* nt/config.nt: Sync with autogen/config.in.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
ef099b57
JB
12012-07-13 Juanma Barranquero <lekktu@gmail.com>
2
3 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5 Set here, not in nt/config.nt.
6
ea814a5d
EZ
72012-07-13 Eli Zaretskii <eliz@gnu.org>
8
9 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10 cursor overflow into the last glyph on display line when the right
11 fringe is off. (Bug#11832)
12
1a952767
PE
132012-07-13 Paul Eggert <eggert@cs.ucla.edu>
14
15 * xdisp.c (produce_special_glyphs): Now static.
16 * dispextern.h (produce_special_glyphs): Remove decl.
17
983188fd
GM
182012-07-13 Glenn Morris <rgm@gnu.org>
19
32fb4bb6
GM
20 * s/bsd-common, s/cygwin.h: Remove empty files.
21 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
22
983188fd
GM
23 * s/usg5-4-common.h (USG, USG5):
24 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
25 * s/sol2-6.h (SOLARIS2):
26 * s/irix6-5.h (IRIX6_5):
27 * s/hpux10-20.h (USG, USG5, HPUX):
28 * s/gnu-linux.h (USG, GNU_LINUX):
29 * s/freebsd.h (BSD_SYSTEM):
30 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
31 * s/cygwin.h (CYGWIN):
32 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
33 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
34
d1e68667 352012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
36
37 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 38
6de0e799
GM
392012-07-13 Glenn Morris <rgm@gnu.org>
40
739ae010
GM
41 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
42
dbee5793
GM
43 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
44
6de0e799
GM
45 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
46 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
47
b82da769
GM
482012-07-12 Glenn Morris <rgm@gnu.org>
49
4fae5a7a 50 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
51
52 * process.c (init_process_emacs): Rename from init_process.
53 The old name is also the name of a Mach system call.
54 * lisp.h, emacs.c: Update for this name change.
55 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
56 longer needed.
57
5a979817
EZ
582012-07-12 Eli Zaretskii <eliz@gnu.org>
59
60 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
61 memmove call that removes glyphs covered by the left truncation
62 glyph. Improve commentary.
63 (display_line): Fix display of continuation glyphs on GUI frames
64 when the right fringe is turned off and variable-size fonts are
65 used in the window. Move the code that appends a stretch glyph to
66 produce_special_glyphs, so that it could be used for truncation
67 and continuation glyphs alike.
68 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
69 glyph of a suitably computed width, to align the special glyphs at
70 the window margin. Code moved from display_line. (Bug#11832)
71
3e91a053
GM
722012-07-12 Glenn Morris <rgm@gnu.org>
73
ba9e4b84
GM
74 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
75
76 * s/gnu-linux.h, s/hpux10-20.h:
77 Do not unconditionally define HAVE_XRMSETDATABASE.
78
3e91a053
GM
79 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
80
b300b1f4
PE
812012-07-12 Paul Eggert <eggert@cs.ucla.edu>
82
83 Fix typos that broke OS X build.
84 Reported by Randal L. Schwartz in
85 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
86 * nsterm.m (ns_timeout): Add missing local decl.
87 (ns_get_color): snprintf -> sprintf, to fix typo.
88
6e777848
GM
892012-07-12 Glenn Morris <rgm@gnu.org>
90
3f922c37
GM
91 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
92 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
93 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
94 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
95
0ab7b23a
GM
96 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
97 Move PTY_OPEN to configure.
98
6e777848
GM
99 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
100 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
101 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
102
4a7edc24
DA
1032012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
104
105 Use empty_unibyte_string where applicable.
106 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
107 * lread.c (read1): Likewise.
108 * xsettings.c (syms_of_xsettings): Likewise.
109
308aab79
GM
1102012-07-12 Glenn Morris <rgm@gnu.org>
111
42bd1719
GM
112 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
113 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
114 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
115 * s/hpux10-20.h (RUN_TIME_REMAP):
116 * s/bsd-common.h (TABDLY): Move to configure.
117
118 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
119
120 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
121
ea0bbd17 122 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 123 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
124
125 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 126
308aab79
GM
127 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
128 * s/template.h: Move NARROWPROTO to configure.
129
ee1cf5cf
GM
1302012-07-11 Glenn Morris <rgm@gnu.org>
131
30fe9bf4
GM
132 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
133 unused since 2011-01-17 change to systty.h.
134
ee1cf5cf
GM
135 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
136 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
137 Move HAVE_PTYS and HAVE_SOCKETS to configure.
138
63e47e07
PE
1392012-07-11 Paul Eggert <eggert@cs.ucla.edu>
140
141 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
142
c43fb4c3
GM
1432012-07-11 Glenn Morris <rgm@gnu.org>
144
145 * s/darwin.h, s/gnu-linux.h, s/template.h:
146 Move INTERRUPT_INPUT to configure.
147
e8df9267
DA
1482012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
149
150 Minor adjustments to interning code.
151 * lisp.h (intern, intern_c_string): Redefine as static inline
152 wrappers for intern_1 and intern_c_string_1, respectively.
153 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
154 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
155 Vobarray checking.
e8df9267
DA
156 * font.c (font_intern_prop): Likewise. Adjust comment.
157 * w32font.c (intern_font_name): Likewise.
158
34348bd4
AS
1592012-07-11 Andreas Schwab <schwab@linux-m68k.org>
160
d96a1e0c
AS
161 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
162
34348bd4
AS
163 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
164 of Fcar/Fcdr if possible.
165 * font.c (check_otf_features): Likewise.
166 * fontset.c (Fnew_fontset): Likewise.
167 * gnutls.c (Fgnutls_boot): Likewise.
168 * minibuf.c (read_minibuf): Likewise.
169 * msdos.c (IT_set_frame_parameters): Likewise.
170 * xmenu.c (Fx_popup_dialog): Likewise.
171 * w32menu.c (Fx_popup_dialog): Likewise.
172
c8add24e
GM
1732012-07-11 Glenn Morris <rgm@gnu.org>
174
4b575b3c
GM
175 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
176 since nothing has defined it on these platforms.
177
09f4e3b0
GM
178 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
179 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
180
172bedef
GM
181 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
182 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
183 Move CLASH_DETECTION to configure.
184
249685df
GM
185 * s/gnu.h: Remove file, which is now empty.
186
c8add24e
GM
187 * s/gnu.h, s/gnu-linux.h:
188 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
189
b41253a3
JW
1902012-07-11 John Wiegley <johnw@newartisans.com>
191
192 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
193 function attribute, so we only use it if it exists in the
194 compiler.
195
d923b542
DA
1962012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
197
198 Avoid call to strlen in fast_c_string_match_ignore_case.
199 * search.c (fast_c_string_match_ignore_case): Change to use
200 length argument. Adjust users accordingly.
201 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
202
5ebbef1d
PE
2032012-07-11 Paul Eggert <eggert@cs.ucla.edu>
204
bb352260
PE
205 Assume mkdir, rmdir.
206 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
207 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
208
57054ddd
PE
209 Assume rename.
210 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
211
b747d3f7
PE
212 Assume perror.
213 * s/hpux10-20.h (HAVE_PERROR): Remove.
214 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
215 Remove dummy definition, as this problem was obsolete long ago.
216
5ebbef1d
PE
217 Assume strerror.
218 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
219
984e7f30
DA
2202012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
221
222 Avoid calls to strlen in font processing functions.
223 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 224 (font_open_by_name): Change to use length argument. Adjust
984e7f30 225 users accordingly.
d923b542
DA
226 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
227 Adjust prototypes.
228 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
229 Change to return ptrdiff_t.
984e7f30
DA
230 (xfont_list_pattern, xfont_match): Use length returned by
231 xfont_decode_coding_xlfd.
232 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
233
20e94fdd
GM
2342012-07-11 Glenn Morris <rgm@gnu.org>
235
9d596af3
GM
236 * s/darwin.h, s/freebsd.h, s/netbsd.h:
237 Move DONT_REOPEN_PTY to configure.
238
20e94fdd
GM
239 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
240 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
241
e99a530f
PE
2422012-07-10 Paul Eggert <eggert@cs.ucla.edu>
243
22ffb973
PE
244 Remove "#define unix" that is no longer needed (Bug#11905).
245 * s/aix4-2.h (unix): Remove; no longer needed.
246
e9a9ae03
PE
247 EMACS_TIME simplification (Bug#11875).
248 This replaces macros (which typically do not work in GDB)
249 with functions, typedefs and enums, making the code easier to debug.
250 The functional style also makes code easier to read and maintain.
251 * systime.h: Include <sys/time.h> on all hosts, not just if
252 WINDOWSNT, since 'struct timeval' is needed in general.
253 (EMACS_TIME): Now a typedef, not a macro.
254 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
255 not macros.
256 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
257 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
258 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
259 (EMACS_TIME_LE): Now functions, not macros.
260 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
261 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
262 which are not functions. All uses rewritten to use:
263 (make_emacs_time): New function.
264 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
265 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
266 not functions. All uses rewritten to use the following, respectively:
267 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
268 (add_emacs_time, sub_emacs_time): New functions.
269 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
270 * fileio.c (Fcopy_file):
271 * xterm.c (XTflash): Get the current time closer to when it's used.
272 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
273
ffacb126
PE
274 * bytecode.c (targets): Suppress -Woverride-init warnings.
275
e99a530f
PE
276 Simplify by avoiding confusing use of strncpy etc.
277 * doc.c (Fsnarf_documentation):
278 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
279 * frame.c (Fmake_terminal_frame):
280 * gtkutil.c (get_utf8_string):
281 * lread.c (openp):
282 * nsmenu.m (ns_update_menubar):
283 * regex.c (regerror):
284 Prefer memcpy to strncpy and strncat when either will do.
285 * fileio.c (Fsubstitute_in_file_name):
286 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
287 (menu_separator_name_p):
288 * nsmenu.m (ns_update_menubar):
289 Prefer memcmp to strncmp when either will do.
290 * nsterm.m: Include <ftoastr.h>.
291 (ns_get_color):
292 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
293 Prefer snprintf to strncpy.
294 * nsterm.m (ns_term_init):
295 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
296 * nsterm.m (ns_term_init):
297 Avoid the need for strncpy, by using build_string or
298 make_unibyte_string directly. Use dtoastr, not snprintf.
299 * process.c (Fmake_network_process): Diagnose service names that
300 are too long, rather than silently truncating them or creating
301 non-null-terminated names.
302 (Fnetwork_interface_info): Likewise, for interface names.
303 * sysdep.c (system_process_attributes) [GNU_LINUX]:
304 Prefer sprintf to strncat.
305 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
306 Prefer vsnprintf to vsprintf + strncpy.
307
c59592b3
GM
3082012-07-10 Glenn Morris <rgm@gnu.org>
309
310 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
311 Clarify fallback case.
312
7d7bbefd
DA
3132012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
314
315 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
316 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
317 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 318 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
319 where argument type is known to be a Lisp_Cons.
320
3a4c8000
TT
3212012-07-10 Tom Tromey <tromey@redhat.com>
322
323 * bytecode.c (BYTE_CODE_THREADED): New macro.
324 (BYTE_CODES): New macro. Replaces all old byte-code defines.
325 (enum byte_code_op): New type.
326 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
327 (exec_byte_code): Use them. Use token threading when applicable.
328
2a0213a6
DA
3292012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
330
331 Optimize pure C strings initialization.
332 * lisp.h (make_pure_string): Fix prototype.
333 (build_pure_c_string): New function, defined as static inline. This
334 provides a better opportunity to optimize away calls to strlen when
335 the function is called with compile-time constant argument.
336 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
337 argument, adjust users accordingly. Use build_pure_c_string where
338 appropriate.
339 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
340 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
341 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
342
cb1caeaf
DA
3432012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
344
345 Avoid calls to strlen in miscellaneous functions.
346 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
347 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
348 * lread.c (openp): Likewise.
349
c293e30c
DA
3502012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
351
352 Avoid calls to strlen in path processing functions.
353 * fileio.c (file_name_as_directory): Add comment. Change to add
354 srclen argument and return the length of result. Adjust users
355 accordingly.
356 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 357 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
358 users accordingly.
359 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
360
9e059e3f
GM
3612012-07-10 Glenn Morris <rgm@gnu.org>
362
d02eb359
GM
363 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
364 Move PENDING_OUTPUT_COUNT definition to configure.
365
882cf227
GM
366 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
367 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
368 * s/gnu.h (DATA_START): Move definitions to configure.
369
af6e839f
GM
370 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
371 We include usg5-4-common.h, which defines them both.
372
40289a12
GM
373 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
374 O_RDONLY already includes it).
375
9e059e3f
GM
376 Stop ns builds setting the EMACSLOADPATH environment variable.
377 * nsterm.m (ns_load_path): Rename from ns_init_paths.
378 Now it does not set EMACSLOADPATH, just returns the load-path string.
379 * nsterm.h: Update accordingly.
380 * lread.c [HAVE_NS]: Include nsterm.h.
381 (init_lread) [HAVE_NS]: Use ns_load_path.
382 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
383
7c4e8ec0
GM
3842012-07-09 Glenn Morris <rgm@gnu.org>
385
d4f600ff
GM
386 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
387 since the included bsd-common.h does so.
388
cbb31951
GM
389 Stop ns builds setting the EMACSPATH environment variable.
390 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
391 (ns_init_paths): Do not set EMACSPATH.
392 * nsterm.h (ns_exec_path): Add it.
393 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
394 Use ns_exec_path.
395
7c4e8ec0
GM
396 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
397
26bccfae
PE
3982012-07-09 Paul Eggert <eggert@cs.ucla.edu>
399
a0bee46f
PE
400 * process.c (wait_reading_process_output): 'waitchannels' was unset
401 when read_kbd || !NILP (wait_for_cell); fix this.
402
5994c183
PE
403 Add GCC-style 'const' attribute to functions that can use it.
404 * character.h (char_resolve_modifier_mask):
405 * keyboard.h (make_ctrl_char):
406 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
407 (init_character_once, next_almost_prime, init_fns, init_image)
408 (flush_pending_output, init_sound):
409 * mem-limits.h (start_of_data):
410 * menu.h (finish_menu_items):
411 Add ATTRIBUTE_CONST.
412 * emacs.c (DEFINE_DUMMY_FUNCTION):
413 Declare the dummy function with ATTRIBUTE_CONST.
414 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
415 Add decls with ATTRIBUTE_CONST.
416
26bccfae
PE
417 Minor improvements to make_formatted_string.
418 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
419 where int is good enough, as vsprintf returns an int.
420 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
421
a8290ec3
DA
4222012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
423
424 Use make_formatted_string to avoid double length calculation.
425 * lisp.h (make_formatted_string): New prototype.
426 * alloc.c (make_formatted_string): New function.
427 * buffer.c (Fgenerate_new_buffer_name): Use it.
428 * dbus.c (syms_of_dbusbind): Likewise.
429 * editfns.c (Fcurrent_time_zone): Likewise.
430 * filelock.c (get_boot_time): Likewise.
431 * frame.c (make_terminal_frame, set_term_frame_name)
432 (x_report_frame_params): Likewise.
433 * image.c (gs_load): Likewise.
434 * minibuf.c (get_minibuffer): Likewise.
435 * msdos.c (dos_set_window_size): Likewise.
436 * process.c (make_process): Likewise.
437 * xdisp.c (ensure_echo_area_buffers): Likewise.
438 * xsettings.c (apply_xft_settings): Likewise.
439
d01ba2f1
GM
4402012-07-09 Glenn Morris <rgm@gnu.org>
441
442 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
443 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
444 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
445 * nsterm.h (ns_etc_directory): Add it.
446 * callproc.c [HAVE_NS]: Include nsterm.h.
447 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
448
f1f924b6
DA
4492012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
450
451 Move marker debugging code under MARKER_DEBUG.
452 * marker.c (MARKER_DEBUG): Move marker debugging code under
453 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
454 for bootstrap with --enable-checking (~3x slowdown reported
455 by Juanma Barranquero <lekktu@gmail.com>).
456 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
457
ab531b66
PE
4582012-07-08 Paul Eggert <eggert@cs.ucla.edu>
459
460 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
461 See <http://bugs.gnu.org/11825#29>.
462
c4b3bc8a
EZ
4632012-07-08 Eli Zaretskii <eliz@gnu.org>
464
465 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
466 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
467 (display_line): Add commentary about displaying truncation glyphs
468 on GUI frames.
469 (produce_special_glyphs): Move here from term.c.
470
471 * term.c (produce_special_glyphs): Move to xdisp.c.
472
473 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
474 section.
c4b3bc8a 475
b676b881
AS
4762012-07-07 Andreas Schwab <schwab@linux-m68k.org>
477
f17c5273
AS
478 * xdisp.c (display_line): Avoid warning about implicit declaration
479 of FRAME_FONT.
480
298819b9
AS
481 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
482
b676b881
AS
483 * lisp.h: Remove empty conditional.
484
6045c4fd
PE
4852012-07-07 Paul Eggert <eggert@cs.ucla.edu>
486
b3350bf9
PE
487 * lread.c (load_path_check): Now static.
488
6045c4fd
PE
489 Fix some minor --with-ns problems found by static checking.
490 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
491 (x_set_font) [!HAVE_X_WINDOWS]:
492 * image.c (xpm_load_image) [HAVE_NS]:
493 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
494 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
495 Remove unused local.
496 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
497 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
498 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
499 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
500 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
501 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
502 Fix pointer signedness problem.
503 * xfaces.c (FRAME_X_FONT_TABLE):
504 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
505
929e7845
GM
5062012-07-07 Glenn Morris <rgm@gnu.org>
507
508 * lread.c (load_path_check): New function, split from init_lread.
509 (init_lread): Reorganize. Motivation:
510 If EMACSLOADPATH is set, check/warn about that rather than the
511 defaults, which we are not going to use. Hence we can remove
512 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
513 Don't warn if site-lisp directories are missing.
514 If not installed, start from a blank load-path, since
515 PATH_LOADSEARCH refers to the eventual installation directories.
516
58dd0aa4
EZ
5172012-07-07 Eli Zaretskii <eliz@gnu.org>
518
519 Support truncation and continuation glyphs on GUI frames, when
520 fringes are disabled. (Bug#11832)
521 * xdisp.c (init_iterator): Get dimensions of truncation and
522 continuation glyphs even if on GUI frames. Adjust
523 it->last_visible_x on GUI frames when the left or right fringes,
524 or both, are absent.
525 (start_display, move_it_in_display_line_to): Handle the case of a
526 GUI frame without a fringe to display continuation or truncation
527 glyphs.
528 (insert_left_trunc_glyphs): Support GUI frames: make sure
529 truncation glyphs overwrite enough glyphs from the current line to
530 have sufficient space in pixels.
531 (display_line): Support truncation and continuation glyphs on GUI
532 frames. If some spare pixels are left on the line after inserting
533 the truncation glyphs, fill that space with a stretch glyph of a
534 suitably computed width.
535
536 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
537 produce_glyphs, to support GUI sessions.
538
31571fd7
PE
5392012-07-07 Paul Eggert <eggert@cs.ucla.edu>
540
5a16b9bc
PE
541 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
542
f3047c75
PE
543 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
544
31571fd7
PE
545 Do not require float-time's arg to fit in time_t (Bug#11825).
546 This works better on hosts where time_t is unsigned, and where
547 float-time is applied to the (negative) difference between two times.
548 * editfns.c (decode_time_components): Last arg is now double *,
549 not int *, and means to store all the result as a double, without
550 worrying about whether the seconds part fits in time_t.
551 All callers changed.
552 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
553 All callers changed.
554 (Ffloat_time): Do not fail merely because the specified time falls
555 outside of time_t range.
556
4516fbef
GM
5572012-07-07 Glenn Morris <rgm@gnu.org>
558
559 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
560 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
561 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
562
07adc2c6
JB
5632012-07-07 Juanma Barranquero <lekktu@gmail.com>
564
565 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
566 Update dependencies.
567
568 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
569
fd573f31
PE
5702012-07-06 Paul Eggert <eggert@cs.ucla.edu>
571
fee5959d
PE
572 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
573 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
574 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
575 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
576 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
577 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
578
fd573f31
PE
579 * xfont.c (compare_font_names): Redo to omit the need for casts.
580
ddadbc0e
AS
5812012-07-06 Andreas Schwab <schwab@linux-m68k.org>
582
fca8d6b6
AS
583 * xfns.c (Fx_change_window_property): Doc fix.
584 * w32fns.c (Fx_change_window_property): Doc fix.
585
ddadbc0e
AS
586 * w32fns.c (Fx_window_property): Accept the same arguments as the
587 X Windows version. Doc fix.
588 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
589
f247498e
JB
5902012-07-06 Juanma Barranquero <lekktu@gmail.com>
591 Eli Zaretskii <eliz@gnu.org>
592
593 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
594 Windows-specific code from nt/config.nt moved here.
595 Obsolete settings removed.
596
216ee680
PE
5972012-07-06 Paul Eggert <eggert@cs.ucla.edu>
598
599 * process.c: Avoid unnecessary calls to gettime.
600 (wait_reading_process_output): Don't get the time of day
601 when gobbling data immediately and not waiting, as there's no need
602 for it in that case. This removes a FIXME.
603
bdd091e4
JD
6042012-07-06 Jan Djärv <jan.h.d@swipnet.se>
605
606 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
607 is defined (Bug#11768).
608
9d44f8ce
DA
6092012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
610
611 Fix marker debugging code.
612 * marker.c (byte_char_debug_check): Do not perform the check
613 if buffer is not multibyte.
090bd7cb
JB
614 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
615 Call byte_char_debug_check with correct arguments.
9d44f8ce 616
90fc4786
DA
6172012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
618
619 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
620 * marker.c (byte_char_debug_check, count_markers):
621 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
622 (byte_debug_flag): Remove.
623 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
624 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
625
7b7ae965
DA
6262012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
627
4e57b342
DA
628 Avoid code repetition in marker-related functions.
629 * marker.c (attach_marker): New function.
630 (Fset_marker, set_marker_restricted, set_marker_both)
631 (set_marker_restricted_both): Use it.
632 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
633 Consistently rename charno to charpos.
634 (marker_position): Add eassert.
635 (marker_byte_position): Convert to eassert.
636
6372012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
638
639 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 640 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 641 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 642
657924ff
DA
6432012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
644
645 Introduce fast path for the widely used marker operation.
646 * alloc.c (build_marker): New function.
647 * lisp.h (build_marker): New prototype.
648 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
649 * composite.c (autocmp_chars): Likewise.
650 * editfns.c (buildmark): Remove.
651 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
652 (save_restriction_save): Use build_marker.
653 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
654 * window.c (save_window_save): Likewise.
655
041a49a6
DA
6562012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
657
658 Do not use Fdelete_overlay in delete_all_overlays
659 to avoid redundant calls to unchain_overlay.
660 * buffer.c (drop_overlay): New function.
661 (delete_all_overlays, Fdelete_overlay): Use it.
662 * minibuf.c (get_minibuffer): Fix comment.
663
7dca65a4
PE
6642012-07-06 Paul Eggert <eggert@cs.ucla.edu>
665
666 Port to OpenBSD 5.1 amd64.
667 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
668 This is needed for OpenBSD, and should be harmless on all BSD systems.
669 Also, include <sys/sysctl.h>, as it should be available on all
670 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
671 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
672 use p_pid member, not kp_proc.pid.
673
8eb876e2
GM
6742012-07-06 Glenn Morris <rgm@gnu.org>
675
676 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
677
38182d90
PE
6782012-07-05 Paul Eggert <eggert@cs.ucla.edu>
679
680 More xmalloc and related cleanup.
681 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
682 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
683 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
684 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
685 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
686 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
687 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
688 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
689 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
690 * xterm.c:
691 Omit needless casts involving void * pointers and allocation.
692 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
693 as the former is more robust if P's type is changed.
694 Prefer xzalloc to xmalloc + memset 0.
695 Simplify malloc-or-realloc to realloc.
696 Don't worry about xmalloc returning a null pointer.
697 Prefer xstrdup to xmalloc + strcpy.
698 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
699 growing it.
700 * keyboard.c (apply_modifiers_uncached): Prefer local array to
701 alloca of a constant.
702
6dd5a677
EZ
7032012-07-05 Eli Zaretskii <eliz@gnu.org>
704
705 * xdisp.c (display_line): Fix horizontal pixel coordinates when
706 hscroll is larger than the line width. Fixes long and futile
707 looping inside extend_face_to_end_of_line (on a TTY) producing
708 glyphs that are not needed and thrown away.
709
6b312f0f
DA
7102012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
711
712 * marker.c (set_marker_restricted_both): Simplify by using
713 clip_to_bounds.
714
f520ef9b
PE
7152012-07-05 Paul Eggert <eggert@cs.ucla.edu>
716
717 * editfns.c (region_limit): Simplify by using clip_to_bounds.
718
383b7c95
JD
7192012-07-05 Jan Djärv <jan.h.d@swipnet.se>
720
721 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
722 not defined (Bug#11768).
723 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
724 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
725 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
726 followed by gtk_box_set_homogeneous (Bug#11768).
727 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
728 (update_theme_scrollbar_width, xg_create_scroll_bar):
729 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
730 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
731 (is_box_type): New function (Bug#11768).
732 (xg_tool_item_stale_p): Call is_box_type.
5293d758 733 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
734 with default display (Bug#11768).
735
d6e7bf45
EZ
7362012-07-05 Eli Zaretskii <eliz@gnu.org>
737
738 * xdisp.c (window_hscroll_limited): New function.
739 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
740 coordinates when window's hscroll is set to insanely large
741 values. (Bug#11857)
742
431391ec
JB
7432012-07-05 Juanma Barranquero <lekktu@gmail.com>
744
745 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
746 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
747
23f86fce
DA
7482012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
749
750 Cleanup xmalloc.
751 * lisp.h (xzalloc): New prototype. Omit needless casts.
752 * alloc.c (xzalloc): New function. Omit needless casts.
753 * charset.c: Omit needless casts. Convert all calls to
754 xmalloc with following memset to xzalloc.
755 * dispnew.c: Likewise.
756 * fringe.c: Likewise.
757 * image.c: Likewise.
758 * sound.c: Likewise.
759 * term.c: Likewise.
760 * w32fns.c: Likewise.
761 * w32font.c: Likewise.
762 * w32term.c: Likewise.
763 * xfaces.c: Likewise.
764 * xfns.c: Likewise.
765 * xterm.c: Likewise.
766 * atimer.c: Omit needless casts.
767 * buffer.c: Likewise.
768 * callproc.c: Likewise.
769 * ccl.c: Likewise.
770 * coding.c: Likewise.
771 * composite.c: Likewise.
772 * doc.c: Likewise.
773 * doprnt.c: Likewise.
774 * editfns.c: Likewise.
775 * emacs.c: Likewise.
776 * eval.c: Likewise.
777 * filelock.c: Likewise.
778 * fns.c: Likewise.
779 * gtkutil.c: Likewise.
780 * keyboard.c: Likewise.
781 * lisp.h: Likewise.
782 * lread.c: Likewise.
783 * minibuf.c: Likewise.
784 * msdos.c: Likewise.
785 * print.c: Likewise.
786 * process.c: Likewise.
787 * region-cache.c: Likewise.
788 * search.c: Likewise.
789 * sysdep.c: Likewise.
790 * termcap.c: Likewise.
791 * terminal.c: Likewise.
792 * tparam.c: Likewise.
793 * w16select.c: Likewise.
794 * w32.c: Likewise.
795 * w32reg.c: Likewise.
796 * w32select.c: Likewise.
797 * w32uniscribe.c: Likewise.
798 * widget.c: Likewise.
799 * xdisp.c: Likewise.
800 * xmenu.c: Likewise.
801 * xrdb.c: Likewise.
802 * xselect.c: Likewise.
803
0497dc44
PE
8042012-07-05 Paul Eggert <eggert@cs.ucla.edu>
805
806 * fileio.c (time_error_value): Check the right error number.
807 Problem reported by Troels Nielsen in
808 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
809
356e7178
PE
8102012-07-04 Paul Eggert <eggert@cs.ucla.edu>
811
4e71fd89
PE
812 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
813 This should be fixed in a better way; see Eli Zaretskii in
814 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
815 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
816
f0941253
PE
817 * fileio.c (time_error_value): Rename from special_mtime.
818 The old name's problems were noted by Eli Zaretskii in
819 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
820
065c9eb4
PE
821 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
822 This variable's comment says Emacs needs at least one GDB-visible
823 symbol of type enum pvec_type, to work around GDB problems.
824 The symbol's value doesn't matter.
825
356e7178
PE
826 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
827 that causes compilation to fail on pre-C99 compilers.
828
95f61aa2
JB
8292012-07-04 Juanma Barranquero <lekktu@gmail.com>
830
831 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
832 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
833
3884d954
DA
8342012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
835
d209e2fb 836 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
837 headers for buffer_defaults and buffer_local_symbols.
838 Reported by Juanma Barranquero <lekktu@gmail.com>.
839
ee28be33
SM
8402012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
841
842 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
843 * lisp.h (enum pvec_type): Use fewer bits.
844 (PSEUDOVECTOR_SIZE_BITS): New constant.
845 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
846 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
847 change in pvec_type.
848 (PSEUDOVECTOR_TYPEP): New macro.
849 (TYPED_PSEUDOVECTORP): Use it.
850 * fns.c (internal_equal): Adapt code to extract pvectype.
851 * emacs.c (gdb_pvec_type): Update type.
852 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
853 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
854 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
855 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
856 (sweep_vectors): Use it. Use local var `total_bytes' instead of
857 abusing vector->header.next.nbytes.
858 (live_vector_p): Use PVEC_TYPE.
859 (mark_object): Adapt code to extract pvectype. Use switch.
860
c7f2cd7f
PE
8612012-07-04 Paul Eggert <eggert@cs.ucla.edu>
862
863 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
864 Tighten new eassert a bit.
865
8ce70ed2
DA
8662012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
867
868 Fix compilation with --enable-gcc-warnings and -O1
869 optimization level.
870 * doprnt.c (doprnt): Change type of tem to int, initialize
871 to avoid compiler warning. Add eassert.
872 * search.c (simple_search): Initialize match_byte to avoid
873 compiler warning. Add eassert.
874
dea7f1e5
PE
8752012-07-04 Paul Eggert <eggert@cs.ucla.edu>
876
24a212eb
PE
877 Avoid weird behavior with large horizontal scrolls.
878 Without this change, for example, large hscroll values would
879 mess up Emacs's display on Fedora 15 x86, presumably due to
880 overflows in int calculations in the display code.
881 Also, if buffers had long lines, Emacs would freeze.
882 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
883 (set_window_hscroll): New function, containing the old guts of
884 Fset_window_hscroll. Return the clipped value.
885 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
886 This avoids the need to check against PTRDIFF_MAX.
887
dea7f1e5
PE
888 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
889
76046526
DA
8902012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
891
892 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
893
39adff0d
PE
8942012-07-04 Paul Eggert <eggert@cs.ucla.edu>
895
63807d47
PE
896 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
897 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
898 since GCC 4.4.6 issues a bogus warning for them.
899
39adff0d
PE
900 Fix bugs in file timestamp newness comparisons.
901 * fileio.c (Ffile_newer_than_file_p):
902 * lread.c (Fload): Use full timestamp resolution of files,
903 not just the 1-second resolution, so that files that are only
904 slightly newer still count as newer.
905 * fileio.c (Ffile_newer_than_file_p): Don't assume file
906 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
907
dbeed9a6
PE
9082012-07-03 Paul Eggert <eggert@cs.ucla.edu>
909
910 * fileio.c: Improve handling of file time marker. (Bug#11852)
911 (special_mtime): New function.
912 (Finsert_file_contents, Fverify_visited_file_modtime):
913 Use it to set special mtime values consistently.
914
636334d6
AS
9152012-07-03 Andreas Schwab <schwab@linux-m68k.org>
916
917 * fileio.c (Finsert_file_contents): Properly handle st_mtime
918 marker for non-existing file. (Bug#11852)
919
e2017fe2
GM
9202012-07-03 Glenn Morris <rgm@gnu.org>
921
922 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
923 and did not make it into globals.h).
924
404dbd37
TT
9252012-07-03 Tom Tromey <tromey@redhat.com>
926
927 * window.c (Fset_window_margins, Fset_window_fringes)
928 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
929 * textprop.c (Fprevious_property_change): No longer static.
930 * syntax.c (Fsyntax_table_p): No longer static.
931 * process.c (Fget_process, Fprocess_datagram_address): No longer
932 static.
933 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
934 * keyboard.c (Fcommand_execute): No longer static.
935 Remove EXFUN.
936 * insdel.c (Fcombine_after_change_execute): No longer static.
937 * image.c (Finit_image_library): No longer static.
938 * fileio.c (Fmake_symbolic_link): No longer static.
939 * eval.c (Ffetch_bytecode): No longer static.
940 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
941 * doc.c (Fdocumentation_property, Fsnarf_documentation):
942 No longer static.
404dbd37
TT
943 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
944 static.
945 * dired.c (Ffile_attributes): No longer static.
946 * composite.c (Fcomposition_get_gstring): No longer static.
947 * callproc.c (Fgetenv_internal): No longer static.
948
949 * ccl.h: Remove EXFUNs.
950 * buffer.h: Remove EXFUNs.
951 * dispextern.h: Remove EXFUNs.
952 * intervals.h: Remove EXFUNs.
953 * fontset.h: Remove EXFUN.
954 * font.h: Remove EXFUNs.
955 * dosfns.c (system_process_attributes): Remove EXFUN.
956 * keymap.h: Remove EXFUNs.
957 * lisp.h: Remove EXFUNs.
958 * w32term.h: Remove EXFUNs.
959 * window.h: Remove EXFUNs.
960 * xsettings.h: Remove EXFUN.
961 * xterm.h: Remove EXFUN.
962
8e4fd1e1
GM
9632012-07-03 Glenn Morris <rgm@gnu.org>
964
965 * lisp.h (Frandom): Make it visible to C.
966 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
967 buffer for invisible buffers. (Bug#1229)
968
ca95b3eb
DA
9692012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
970
971 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
972 values which aren't power of 2.
973 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
974 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
975 accordingly.
976
7555c33f
SM
9772012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
978
979 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
980
981 * alloc.c (mark_object): Revert part of last patch to use `switch'.
982
d12e8f5a
DA
9832012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
984
985 * alloc.c (allocate_vector_block): Remove redundant
986 calls to mallopt if DOUG_LEA_MALLOC is defined.
987 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
988 avoid calls to mallopt if zero_vector is returned.
989
296094c3
DA
9902012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
991
992 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
993 is enabled, avoid dereferencing NULL current_sblock if
994 running undumped.
995
36429c89
DA
9962012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
997
998 Cleanup basic buffer management.
999 * buffer.h (struct buffer): Change layout to use generic vector
1000 marking code. Fix some comments. Change type of 'clip_changed'
1001 to bitfield. Remove unused #ifndef old.
1002 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1003 (GET_OVERLAYS_AT): Fix indentation.
1004 (for_each_per_buffer_object_at): New macro.
1005 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1006 (Fbuffer_local_variables): Use it.
1007 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1008 * alloc.c (allocate_buffer): Adjust to match new layout of
1009 struct buffer. Fix comment.
1010 (mark_overlay): New function.
1011 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1012 Lisp area of struct buffer.
1013 (mark_object): Use it. Adjust marking of misc objects
1014 and related comments.
1015
3b3e4cac
PE
10162012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1017
1018 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1019 wrapper that is not needed because the wrapped code is a no-op (zero
1020 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1021 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1022
cf5c0175
DA
10232012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1024
1025 * alloc.c (mark_buffer): Simplify. Remove prototype.
1026 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1027 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1028 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1029 redundant calls to mark_vectorlike for bool vectors.
1030
ca26824c
GM
10312012-06-30 Glenn Morris <rgm@gnu.org>
1032
2e4c5312
GM
1033 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1034
ca26824c
GM
1035 * epaths.in (PATH_SITELOADSEARCH): New.
1036 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1037 This is rather than relying on --enable-locallisppath elements
1038 having "site-lisp" in their names. (Bug#10208#25, 11658)
1039
0d23c240
EZ
10402012-06-30 Eli Zaretskii <eliz@gnu.org>
1041
c9240d7a
EZ
1042 * w32proc.c (sys_select): Accept and ignore one more argument.
1043
1044 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1045
0d23c240 1046 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1047 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1048
1049 * sysdep.c: Don't include dos.h and dosfns.h.
1050
1051 * process.c (sys_select):
1052 * msdos.c (sys_select): Accept one more argument and ignore it.
1053
1054 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1055 adapt data types and code to that.
1056
1057 * dosfns.c:
1058 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1059 which clashes with the gnulib function of the same name.
1060
af5a5a98
AS
10612012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1062
c5e4379c
AS
1063 * font.c (font_style_to_value, font_style_symbolic)
1064 (font_prop_validate_style): Add type checks for values in
1065 font_style_table.
1066
af5a5a98
AS
1067 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1068 argument.
1069 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1070 uses.
1071
8d38f461
EZ
10722012-06-29 Eli Zaretskii <eliz@gnu.org>
1073
2e5a6631
EZ
1074 * xdisp.c (try_window_id): Undo last change.
1075
8d38f461
EZ
1076 * w32.c (getwd): Adjust commentary about startup_dir.
1077 (init_environment): Always call sys_access, even in non-MSVC
1078 builds. Don't chdir to the directory of the Emacs executable.
1079 This undoes code from 1997 which was justified by the need to
1080 "avoid conflicts when removing and renaming directories". But its
1081 downside was that every relative file name was being interpreted
1082 relative to the directory of the Emacs executable, which can never
1083 be TRT. In particular, it broke sys_access when called with
1084 relative file names.
1085 (sys_access): Map GetLastError to errno.
1086
2af3565e
DA
10872012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1088
1089 * window.h (struct window): Change type of 'fringes_outside_margins'
1090 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1091 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1092 Adjust comment.
1093 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1094 to ptrdiff_t.
1095
c8d3a25c 10962012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1097
c8d3a25c
GM
1098 * gnutls.c (emacs_gnutls_handshake):
1099 Add QUIT to make the loop interruptible.
57570cd3 1100
c8d3a25c 11012012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1102
c8d3a25c
GM
1103 * charset.c (init_charset): Make lack of etc/charsets fatal.
1104
3e984ee8
DA
11052012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1106
1107 * editfns.c (region_limit): Fix type mismatch.
1108
ef884f23
DA
11092012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1110
1111 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1112 undefined. Convert from xassert to eassert.
1113 * nsmenu.m: Convert from xassert to eassert.
1114 * nsterm.m: Likewise.
1115
7d7e0027
SM
11162012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1117
1118 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1119
aa754e6a
PE
11202012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1121
1122 Avoid integer overflow on scroll-left and scroll-right.
1123 * window.c (HSCROLL_MAX): New macro.
1124 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1125 overflow when requested scroll falls outside ptrdiff_t range.
1126
80b00b08
DA
11272012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1128
1129 * window.h (struct window): Change type of 'hscroll',
1130 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1131 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1132 Adjust users accordingly.
1133 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1134 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1135 from EMACS_INT to ptrdiff_t.
1136 (make_window): Omit redundant initialization.
1137
62b2bcf6
JB
11382012-06-28 Juanma Barranquero <lekktu@gmail.com>
1139
1140 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1141
45942c7d
DA
11422012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1143
1144 * window.h (struct window): Change type of 'use_time' and
1145 'sequence_number' from Lisp_Object to int.
1146 * frame.c (make_frame): Adjust users accordingly.
1147 * print.c (print_object): Likewise.
1148 * window.c (select_window, Fwindow_use_time, make_parent_window)
1149 (make_window): Likewise.
1150
e509cfa6
DA
11512012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1152
1153 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1154 enabled with --enable-checking=[all,glyphs] configure option.
1155 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1156 adjust comments accordingly.
1157 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1158 undefined, adjust comments accordingly.
1159 * image.c: Likewise.
1160 * scroll.c: Likewise.
1161 * w32fns.c: Likewise.
1162 * w32term.c: Likewise.
1163 * xdisp.c: Likewise.
1164 * xfaces.c: Likewise.
1165 * xfns.c: Likewise.
1166 * xterm.c: Likewise.
1167
a54e2c05
DA
11682012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1169
1170 Generalize run-time debugging checks.
1171 * dispextern.h (XASSERTS): Remove.
1172 * fontset.c (xassert): Remove.
1173 Convert from xassert to eassert.
1174 * alloc.c: Convert from xassert to eassert.
1175 * bidi.c: Likewise.
1176 * dispnew.c: Likewise.
1177 * fns.c: Likewise.
1178 * fringe.c: Likewise.
1179 * ftfont.c: Likewise.
1180 * gtkutil.c: Likewise.
1181 * image.c: Likewise.
1182 * keyboard.c: Likewise.
1183 * menu.c: Likewise.
1184 * process.c: Likewise.
1185 * scroll.c: Likewise.
1186 * sound.c: Likewise.
1187 * term.c: Likewise.
1188 * w32console.c: Likewise.
1189 * w32fns.c: Likewise.
1190 * w32term.c: Likewise.
1191 * window.c: Likewise.
1192 * xdisp.c: Likewise.
1193 * xfaces.c: Likewise.
1194 * xfns.c: Likewise.
1195 * xselect.c: Likewise.
1196 * xterm.c: Likewise.
1197
1ec4b7b2
SM
11982012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1199
1200 * fns.c (maybe_resize_hash_table): Output message when growing the
1201 purify-hashtable.
1202
2014308a
DA
12032012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1204
1205 * alloc.c (allocate_string_data): Remove dead code.
1206 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1207 avoid GCC warning about unused macro.
1208
246155eb
DA
12092012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1210
1211 * alloc.c (allocate_string): Omit intervals initialization.
1212 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1213 as in make_pure_string and make_pure_c_string.
1214
43184b7b
DA
12152012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1216
d209e2fb 1217 * alloc.c (allocate_string): Fix last change.
43184b7b 1218
3fe6dd74
DA
12192012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1220
d209e2fb 1221 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1222 to memset, add explicit initialization where appropriate.
1223
1ba6038a
GM
12242012-06-27 Glenn Morris <rgm@gnu.org>
1225
1226 * lisp.mk (lisp): Remove paths.elc.
1227
c89926a5
CY
12282012-06-27 Chong Yidong <cyd@gnu.org>
1229
1230 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1231
ed6b3510
JW
12322012-06-26 John Wiegley <johnw@newartisans.com>
1233
1ec4b7b2 1234 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1235 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1236
ed6b3510
JW
1237 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1238 when building with Clang.
1239
8edd4a2b
SM
12402012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1241
1242 * eval.c (Fapply): Allow calling it with a single argument.
1243
f6f62d1b
EZ
12442012-06-26 Eli Zaretskii <eliz@gnu.org>
1245
1246 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1247 _stricmp and _strnicmp.
1248 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1249
62efea5e
DA
12502012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1251
1252 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1253 allocated window.
1254 (allocate_process): Likewise for new process.
8edd4a2b 1255 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1256 (allocate_frame): Likewise.
1257 * frame.c (make_frame): Omit redundant initialization.
1258 * window.c (make_parent_window): Use memset.
1259 (make_window): Omit redundant initialization.
1260 * process.c (make_process): Omit redundant initialization.
1261 * terminal.c (create_terminal): Likewise.
1262
42997f4d
DA
12632012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1264
1265 * term.c (delete_tty): Remove redundant call to memset.
1266
1130ecfc
DA
12672012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1268
1269 * alloc.c: Remove build_string.
1270 * lisp.h: Define build_string as static inline. This provides
1271 a better opportunity to optimize away calls to strlen when the
1272 function is called with compile-time constant argument.
1273 * image.c (imagemagick_error): Convert to build_string.
1274 * w32proc.c (sys_spawnve): Likewise.
1275 * xterm.c (x_term_init): Likewise.
1276
cf38a720
PE
12772012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1278
99027bdd
PE
1279 Use sprintf return value instead of invoking strlen on result.
1280 In the old days this wasn't portable, since some sprintf
1281 implementations returned char *. But they died out years ago and
1282 Emacs already assumes sprintf returns int.
1283 Similarly for float_to_string.
1284 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1285 * ccl.c (ccl_driver):
1286 * character.c (string_escape_byte8):
1287 * data.c (Fnumber_to_string):
1288 * doprnt.c (doprnt):
1289 * print.c (print_object):
1290 * xdisp.c (message_dolog):
1291 * xfns.c (syms_of_xfns):
1292 Use sprintf or float_to_string result to avoid need to call strlen.
1293 * data.c (Fnumber_to_string):
1294 Use make_unibyte_string, since the string must be ASCII.
1295 * lisp.h, print.c (float_to_string): Now returns int length.
1296 * term.c (produce_glyphless_glyph):
1297 Use sprintf result rather than recomputing it.
1298
cf38a720
PE
1299 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1300 * Makefile.in (ALL_CFLAGS):
1301 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1302 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1303
3511c784
DA
13042012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1305
0a08eb21 1306 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1307 strcasecmp if available.
1308 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1309
fb7da12e
AS
13102012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1311
1312 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1313 Avoid comma operator.
1314 * menu.c (push_submenu_start, push_submenu_end)
1315 (push_left_right_boundary, push_menu_pane): Likewise.
1316 * msdos.c (dos_rawgetc): Likewise.
1317
afa2ffd8
DA
13182012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1319
1320 * xfns.c (xic_create_fontsetname): Remove redundant calls
1321 to memset.
1322
b3b4476b
PE
13232012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1324
4495ff38
PE
1325 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1326 sprintf already null-terminates its output.
1327
b3b4476b
PE
1328 * xfns.c (x_window): Remove redundant cast.
1329
b00876c9
DA
13302012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1331
1332 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1333 `const char *' to `char *' to avoid compiler warning.
1334
d188e26b
PE
13352012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1336
885d1d74
PE
1337 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1338 instead of truncating it to 63 (admittedly a generous limit).
1339
d188e26b
PE
1340 * process.c: Fix spelling and caps in comments.
1341
e2f560b1
DN
13422012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1343
e86db54b 1344 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1345 * sysdep.c (setpgrp): Remove definition, not used in this file.
1346
7583a3a1
JB
13472012-06-24 Juanma Barranquero <lekktu@gmail.com>
1348
1349 * makefile.w32-in: Update dependencies.
1350
696056c2
EZ
13512012-06-24 Eli Zaretskii <eliz@gnu.org>
1352
1353 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1354 (SYSTIME_H): Add nt/inc/sys/time.h.
1355
1356 * systime.h [WINDOWSNT]: Include sys/time.h.
1357
1358 * s/ms-w32.h (struct timespec): Definition moved from
1359 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1360
845ca893
PE
13612012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1362
1363 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1364 * buffer.h (buffer_slot_type_mismatch):
1365 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1366 * eval.c (unwind_to_catch):
1367 * image.c (my_png_error, my_error_exit):
1368 * keyboard.c (quit_throw_to_read_char, user_error)
1369 (Fexit_recursive_edit, Fabort_recursive_edit):
1370 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1371 (wrong_type_argument, buffer_overflow, __executable_start)
1372 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1373 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1374 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1375 (fatal):
1376 (child_setup) [!DOS_NT]:
1377 * lread.c (end_of_file_error, invalid_syntax):
1378 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1379 * puresize.h (pure_write_error):
1380 * search.c (matcher_overflow):
1381 * sound.c (sound_perror, alsa_sound_perror):
1382 * sysdep.c, syssignal.h (croak):
1383 * term.c (maybe_fatal, vfatal):
1384 * textprop.c (text_read_only):
1385 * undo.c (user_error):
1386 * unexmacosx.c (unexec_error):
1387 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1388 Use _Noreturn rather than NO_RETURN.
1389 No need for separate decl merely because of _Noreturn.
1390 * sound.c (sound_warning, parse_sound):
1391 Remove unnecessary forward decls.
1392
f1dd8073
PE
13932012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1394
1395 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1396 * lisp.h (WAIT_READING_MAX): New macro.
1397 * dispnew.c (Fsleep_for, sit_for):
1398 * keyboard.c (kbd_buffer_get_event):
1399 * process.c (Faccept_process_output):
1400 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1401 This improves on the previous patch, which introduced a bug
1402 when time_t is unsigned and as wide as intmax_t.
1403 See <http://bugs.gnu.org/9000#51>.
1404
b82c1755
EZ
14052012-06-23 Eli Zaretskii <eliz@gnu.org>
1406
1407 * dispnew.c (sit_for, Fsleep_for):
1408 * keyboard.c (kbd_buffer_get_event):
1409 * process.c (Faccept_process_output): Avoid compiler warnings when
1410 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1411
ca300656
JB
14122012-06-23 Juanma Barranquero <lekktu@gmail.com>
1413
049ec95b
JB
1414 * makefile.w32-in: Update dependencies.
1415
ca300656
JB
1416 * w32.c (ltime): Add return type and declare static.
1417 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1418
db7b8d06
PE
14192012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1420
1421 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1422 Privately reported by Herbert J. Skuhra.
1423 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1424 All uses changed.
1425 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1426 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1427
0bd8297f
EZ
14282012-06-23 Eli Zaretskii <eliz@gnu.org>
1429
96512555
EZ
1430 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1431 last argument of make_unibyte_string.
1432
0bd8297f
EZ
1433 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1434 language ID in the event parameters.
1435
1436 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1437 event.code, not the obscure "character set ID".
1438
63def6b6
CY
14392012-06-23 Chong Yidong <cyd@gnu.org>
1440
1441 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1442
e8a02204
EZ
14432012-06-23 Eli Zaretskii <eliz@gnu.org>
1444
388cdec0
EZ
1445 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1446 * w32.c (fdutimens): New function.
1447
1448 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1449
1450 * s/ms-w32.h (pselect): Redirect to sys_select.
1451
1452 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1453
e8a02204
EZ
1454 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1455 in the logic of incrementing and decrementing the value of
1456 use_relocatable_buffers.
1457
d054f3fb
PE
14582012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1459
1460 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1461 Privately reported by Herbert J. Skuhra.
1462 [__FreeBSD__]: Remove "*/" typo after "#include".
1463 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1464 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1465 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1466 Don't assume EMACS_TIME and struct timeval are the same type.
1467
d35af63c
PE
14682012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1469
1470 Support higher-resolution time stamps (Bug#9000).
1471 The time stamps are only nanosecond-resolution at the C level,
1472 since that's the best that any real-world system supports now.
1473 But they are picosecond-resolution at the Lisp level, as that's
1474 easy, and leaves room for future OS improvements.
1475
1476 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1477 (LIBES): Use it.
1478
1479 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1480 Don't get current time unless it's needed.
1481
1482 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1483 now provides it if it's absent.
1484 (start_atimer): Port to higher-res time stamps.
1485 Check for time stamp overflow. Don't get current time more
1486 often than is needed.
1487
1488 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1489 Include systime.h, not time.h.
1490 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1491
1492 * dired.c: Include stat-time.h.
1493 (Ffile-attributes): File times now have higher resolution.
1494
1495 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1496 (struct image): Timestamp now has higher resolution.
1497
1498 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1499 has at least microseconds now. All uses removed.
1500 (update_frame, update_single_window, update_window, update_frame_1)
1501 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1502
1503 * editfns.c (time_overflow): Now extern.
1504 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1505 (float-time, Fformat_time_string, Fcurrent_time_string)
1506 (Fcurrent_time_zone): Accept and generate higher-resolution
1507 time stamps.
1508 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1509 (decode_time_components, lisp_seconds_argument): New functions.
1510 (make_time): Now static.
1511 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1512 Report an error if the time is invalid, rather than having the caller
1513 do that.
1514
1515 * fileio.c: Include <stat-time.h>
1516 (Fcopy_file): Copy higher-resolution time stamps.
1517 Prefer to set the time stamp via a file descriptor if that works.
1518 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1519 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1520 (Fvisited_file_modtime, Fset_visited_file_modtime):
1521 Support higher-resolution time stamps.
1522
1523 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1524
1525 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1526
1527 * image.c (prepare_image_for_display, clear_image_cache)
1528 (lookup_image): Port to higer-resolution time stamps.
1529
1530 * keyboard.c (start_polling, bind_polling_period):
1531 Check for time stamp overflow.
1532 (read_char, kbd_buffer_get_event, timer_start_idle)
1533 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1534 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1535 Port to higher-resolution time stamps. Do not assume time_t is signed.
1536 (decode_timer): New function. Timers are now vectors of length 9,
1537 not 8, to accommodate the picosecond component.
1538 (timer_check_2): Use it.
1539
1540 * nsterm.m (select_timeout, timeval_subtract): Remove.
1541 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1542 as they're a bit more accurate and handle overflow better.
1543 (ns_select): Change prototype to be compatible with pselect.
1544 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1545 * nsterm.h (ns_select): Adjust prototype.
1546
1547 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1548 us-resolution time stamps.
1549 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1550
1551 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1552
1553 * lisp.h (time_overflow): New decl.
1554 (wait_reading_process_output): First arg is now intmax_t, not int,
1555 to accommodate larger waits.
1556
1557 * process.h (struct Lisp_Process.read_output_delay):
1558 Now counts nanoseconds, not microseconds.
1559 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1560 EMACS_HAS_USECS.
1561 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1562 (wait_reading_process_output):
1563 Port to ns-resolution time stamps.
1564 (Faccept_process_output, wait_reading_process_output):
1565 Check for time stamp overflow. Do not assume time_t is signed.
1566 (select_wrapper): Remove; we now use pselect.
1567 (Fprocess_attributes): Now generates ns-resolution time stamps.
1568
1569 * sysdep.c: Include utimens.h. Don't include utime.h
1570 or worry about struct utimbuf; gnulib does that for us now.
1571 (gettimeofday): Remove; gnulib provides a substitute.
1572 (make_timeval): New function.
1573 (set_file_times): Now sets ns-resolution time stamps.
1574 New arg FD; all uses changed.
1575 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1576 (system_process_attributes):
1577 Now returns ns-resolution time stamp. All uses changed.
1578 Check for time stamp overflow.
1579
1580 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1581 provides a substitute now.
1582
1583 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1584 since it guarantees struct timespec.
1585 (EMACS_TIME): Now struct timespec, so that we can support
1586 ns-resolution time stamps.
1587 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1588 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1589 (EMACS_USECS): Remove.
1590 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1591 so multiply the arg by 1000 before storing it.
1592 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1593 New macros.
1594 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1595 Port to ns-resolution time stamps.
1596 (EMACS_TIME_NEG_P): Remove; replaced by....
1597 (EMACS_TIME_SIGN): New macro.
1598 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1599 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1600 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1601 (make_timeval, make_lisp_time, decode_time_components): New decls.
1602 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1603 that it mishandled time_t overflow. You can't compare by subtracting!
1604 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1605 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1606
1607 * term.c: Include <sys/time.h>.
1608 (timeval_to_Time): New function, for proper overflow wraparound.
1609 (term_mouse_position, term_mouse_click): Use it.
1610
1611 * undo.c (record_first_change): Support higher-resolution time stamps
1612 in the undo buffer.
1613 (Fprimitive_undo): Use them when restoring time stamps.
1614
1615 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1616 (w32_get_internal_run_time):
1617 Port to higher-resolution Emacs time stamps.
1618 (ltime): Now accepts single 64-bit integer, as that's more convenient
1619 for callers.
1620
1621 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1622
1623 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1624 for compatibility with pselect. Support ns-resolution time stamps.
1625
1626 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1627
1628 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1629 Check for time stamp overflow, and support ns-resolution time stamps.
1630
1631 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1632 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1633 (timeval_subtract): Remove; no longer needed.
1634 (XTflash, XTring_bell, x_wait_for_event):
1635 Port to ns-resolution time stamps. Don't assume time_t is signed.
1636
b6a92dfe
CY
16372012-06-22 Chong Yidong <cyd@gnu.org>
1638
1639 * xdisp.c (x_consider_frame_title): Revert last change.
1640
d251c37c
EZ
16412012-06-22 Eli Zaretskii <eliz@gnu.org>
1642
1643 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1644 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1645 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1646 staticidx goes up to 1597 out of 1600 = 0x640.)
1647
f10deafb
PE
16482012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1649
1650 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1651 Otherwise, the umask might be mistakenly 0 while handling input signals.
1652
ec6de1e2
SM
16532012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1654
1655 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1656
28be1ada
DA
16572012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
1658
1659 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1660 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1661 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1662 access to `contents' member of Lisp_Vector objects with AREF and ASET
1663 where appropriate.
1664
c6bf3022
CY
16652012-06-19 Chong Yidong <cyd@gnu.org>
1666
1667 * frame.c (delete_frame): When selecting a frame on a different
1668 text terminal, do not alter the terminal's top-frame.
1669
1670 * xdisp.c (format_mode_line_unwind_data): Record the target
1671 frame's selected window and its terminal's top-frame.
1672 (unwind_format_mode_line): Restore them.
1673 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1674 Callers changed.
1675 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1676 since tty frames can be explicitly named.
1677 (prepare_menu_bars): Likewise.
1678
1679 * term.c (Ftty_top_frame): New function.
1680
defd4196
PE
16812012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1682
1683 Port byte-code-meter to modern targets.
1684 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1685 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 1686 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
1687 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1688 (METER_1, METER_2): Simplify.
1689
1053a871
SM
16902012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
1691
1692 * data.c (Fdefalias): Return `symbol' (bug#11686).
1693
b7e8d081
MR
16942012-06-18 Martin Rudalics <rudalics@gmx.at>
1695
1696 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
1697 gets killed during executing of this function (Bug#11665).
1698 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
1699 (Vkill_buffer_query_functions): In doc-string say that functions
1700 run by this hook should not change the current buffer.
1701
7ea2b339
PE
17022012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1703
1704 Fix recently-introduced process.c problems found by static checking.
1705 * process.c (write_queue_push, write_queue_pop, send_process):
1706 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1707 (write_queue_pop): Fix pointer signedness problem.
1708 (send_process): Remove unused local.
1709
96a313a1
CY
17102012-06-17 Chong Yidong <cyd@gnu.org>
1711
1712 * xdisp.c (redisplay_internal): No need to redisplay terminal
1713 frames that are not on top.
1714
20ca2e94
TN
17152012-06-17 Troels Nielsen <bn.troels@gmail.com>
1716
1717 * process.c (make_process): Initialize write_queue.
1718 (write_queue_push, write_queue_pop): New functions.
1719 (send_process): Use them to maintain correct ordering of process
1720 writes (Bug#10815).
1721
9a900ca9
PE
17222012-06-17 Paul Eggert <eggert@cs.ucla.edu>
1723
310fbfa8
PE
1724 * lisp.h (eassert): Assume C89 or later.
1725 This removes the need for CHECK.
1726 (CHECK): Remove. Its comments about always evaluating its
1727 argument were confusing, as 'eassert' typically does not evaluate
1728 its argument.
1729
27bb1ca4
PE
1730 * coding.c (produce_chars): Use ptrdiff_t, not int.
1731
9a900ca9
PE
1732 * xterm.c (x_draw_underwave): Check for integer overflow.
1733 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1734
41b7f8bc 17352012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
1736
1737 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1738 referenced (Bug#11583).
1739
9b0e3eba
AA
17402012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
1741
1742 Implement wave-style variant of underlining.
1743 * dispextern.h (face_underline_type): New enum.
1744 (face): Add field for underline type.
1745 * nsterm.m (ns_draw_underwave): New function.
1746 (ns_draw_text_decoration): Use it.
1747 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1748 New functions.
1749 (x_draw_glyph_string): Use them.
1750 * xfaces.c (Qline, Qwave): New Lisp objects.
1751 (check_lface_attrs, merge_face_ref)
1053a871
SM
1752 (Finternal_set_lisp_face_attribute, realize_x_face):
1753 Handle wave-style underline face attributes.
9b0e3eba
AA
1754 * xterm.c (x_draw_underwave): New function.
1755 (x_draw_glyph_string): Use it.
1756
0fb52f11
JB
17572012-06-16 Juanma Barranquero <lekktu@gmail.com>
1758
1759 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1760 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1761 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1762 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1763 ($(BLD)/w32select.$(O)): Update dependencies.
1764
e5560ff7
AS
17652012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1766
1767 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1768 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1769 * character.c (_fetch_multibyte_char_p): Remove.
1770 * alloc.c: Include "character.h" before "buffer.h".
1771 * bidi.c: Likewise.
1772 * buffer.c: Likewise.
1773 * bytecode.c: Likewise.
1774 * callint.c: Likewise.
1775 * callproc.c: Likewise.
1776 * casefiddle.c: Likewise.
1777 * casetab.c: Likewise.
1778 * category.c: Likewise.
1779 * cmds.c: Likewise.
1780 * coding.c: Likewise.
1781 * composite.c: Likewise.
1782 * dired.c: Likewise.
1783 * dispnew.c: Likewise.
1784 * doc.c: Likewise.
1785 * dosfns.c: Likewise.
1786 * editfns.c: Likewise.
1787 * emacs.c: Likewise.
1788 * fileio.c: Likewise.
1789 * filelock.c: Likewise.
1790 * font.c: Likewise.
1791 * fontset.c: Likewise.
1792 * fringe.c: Likewise.
1793 * indent.c: Likewise.
1794 * insdel.c: Likewise.
1795 * intervals.c: Likewise.
1796 * keyboard.c: Likewise.
1797 * keymap.c: Likewise.
1798 * lread.c: Likewise.
1799 * macros.c: Likewise.
1800 * marker.c: Likewise.
1801 * minibuf.c: Likewise.
1802 * nsfns.m: Likewise.
1803 * nsmenu.m: Likewise.
1804 * print.c: Likewise.
1805 * process.c: Likewise.
1806 * regex.c: Likewise.
1807 * region-cache.c: Likewise.
1808 * search.c: Likewise.
1809 * syntax.c: Likewise.
1810 * term.c: Likewise.
1811 * textprop.c: Likewise.
1812 * undo.c: Likewise.
1813 * unexsol.c: Likewise.
1814 * w16select.c: Likewise.
1815 * w32fns.c: Likewise.
1816 * w32menu.c: Likewise.
1817 * window.c: Likewise.
1818 * xdisp.c: Likewise.
1819 * xfns.c: Likewise.
1820 * xmenu.c: Likewise.
1821 * xml.c: Likewise.
1822 * xselect.c: Likewise.
1823
2f07e6af
EZ
18242012-06-16 Eli Zaretskii <eliz@gnu.org>
1825
1053a871
SM
1826 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1827 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 1828 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
1829 row.
1830 (handle_face_prop): Use chunk-relative overlay string index when
1831 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
1832 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1833 the rightmost. (Bug#11720)
2f07e6af 1834
29b83cec
AS
18352012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1836
1837 * category.h (CHAR_HAS_CATEGORY): Define as inline.
1838 (CATEGORY_MEMBER): Enforce 1/0 value.
1839 * category.c (_temp_category_set): Remove.
1840
4c5501e9
EZ
18412012-06-16 Eli Zaretskii <eliz@gnu.org>
1842
1843 * window.c (Fdelete_other_windows_internal)
1844 (Fdelete_window_internal): Don't access frame's mouse highlight
1845 info of the initial frame. (Bug#11677)
1846
2b570124
PE
18472012-06-14 Paul Eggert <eggert@cs.ucla.edu>
1848
e93864f9
PE
1849 * .gdbinit (xgetint): Fix recently-introduced paren typo.
1850 Assume USE_2_TAGS_FOR_INTS.
1851 (xreload): Adjust $tagmask width to match recent lisp.h change.
1852
2b570124
PE
1853 Simplify lisp.h in minor ways that should not affect code.
1854 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1855 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1856 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1857 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1858 (INTTYPEBITS): New macro, for clarity.
1859 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
1860 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1861 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
1862 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1863 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1864
81755f69
JB
18652012-06-13 Juanma Barranquero <lekktu@gmail.com>
1866
1867 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1868
16192a57
GM
18692012-06-13 Glenn Morris <rgm@gnu.org>
1870
1871 * s/bsd-common.h (BSD4_3):
1872 * s/usg5-4-common.h (USG5_4): No longer define; unused.
1873
646b5f55
AS
18742012-06-13 Andreas Schwab <schwab@linux-m68k.org>
1875
1876 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1877 instead of union.
1878 (XLI, XIL): Define.
1053a871
SM
1879 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1880 Use them.
1881 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 1882 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 1883 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
1884 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1885 * frame.c (delete_frame): Remove outdated comment.
1886 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1887 USE_LISP_UNION_TYPE.
1888 (Fw32_unregister_hot_key): Likewise.
1889 (Fw32_toggle_lock_key): Likewise.
1890 * w32menu.c (add_menu_item): Likewise.
1891 (w32_menu_display_help): Use XIL instead of checking
1892 USE_LISP_UNION_TYPE.
1893 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1894 (init_heap): Likewise.
1895 * w32term.c (w32_read_socket): Update comment.
1896
1d3823c9
GM
18972012-06-13 Glenn Morris <rgm@gnu.org>
1898
c62ff706
GM
1899 * s/usg5-4-common.h, src/s/unixware.h:
1900 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1901
1d3823c9
GM
1902 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1903
bfe3e0a2
PE
19042012-06-13 Paul Eggert <eggert@cs.ucla.edu>
1905
1906 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1907 * alloc.c (make_number) [!defined make_number]:
1908 Remove, as lisp.h always defines this now.
1909 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1910 (roundup_size): Verify that it is a power of 2.
1911 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
1912 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
1913 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
1914 -DUSE_LSB_TAG=0, to override the automatically-selected default.
1915 USE_LSB_TAG now is always defined to be either 0 or 1.
1916 All uses changed.
1917 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
1918 code works fine either way, and efficiency is not a concern here,
1919 as the union type is for debugging, not for production.
1920 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
1921 Use an inline function on all platforms when using the union type,
1922 since this is simpler and 'static inline' can be used portably
1923 within Emacs now.
1924 (LISP_INITIALLY_ZERO): New macro.
1925 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
1926 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
1927
45fa9c0f
GM
19282012-06-12 Glenn Morris <rgm@gnu.org>
1929
b4492cba
GM
1930 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
1931
1932 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 1933
45fa9c0f
GM
1934 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
1935 Move BROKEN_SIGIO to configure.
1936
1937 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
1938 Move NO_TERMIO to configure.
1939
0e25d334
CY
19402012-06-12 Chong Yidong <cyd@gnu.org>
1941
1942 * image.c (imagemagick_load_image): Use MagickFlattenImage if
1943 MagickMergeImageLayers is undefined. Use pixel pusher loop if
1944 MagickExportImagePixels is undefined.
1945
43682bb6
PE
19462012-06-12 Paul Eggert <eggert@cs.ucla.edu>
1947
1948 * image.c (imagemagick_load_image): Remove unused label.
1949
a9be7d2b
GM
19502012-06-11 Glenn Morris <rgm@gnu.org>
1951
1952 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1953 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
1954 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
1955 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
1956
3017f87f
SM
19572012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
1958
1959 * alloc.c (make_byte_code): New function.
1960 (Fmake_byte_code): Use it. Don't purify here.
1961 * lread.c (read1): Use it as well to avoid extra allocation.
1962
1b9b4cf4
CY
19632012-06-11 Chong Yidong <cyd@gnu.org>
1964
1965 * image.c (imagemagick_load_image): Implement transparency.
1966
95988fcf
AS
19672012-06-10 Andreas Schwab <schwab@linux-m68k.org>
1968
1969 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
1970 account for preceding backslashes. (Bug#11663)
1971
cd4eb164
CY
19722012-06-09 Chong Yidong <cyd@gnu.org>
1973
1974 * term.c: Support italics in capable terminals (Bug#9652).
1975 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
1976 (turn_on_face): Output using TS_enter_italic_mode if available.
1977 Don't handle unused blinking and alt-charset cases.
1978 (turn_off_face): Handle italic case; discard unused tty_blinking_p
1979 and tty_alt_charset_p cases.
1980 (tty_capable_p, init_tty): Support italics.
1981
1982 * termchar.h (struct tty_display_info): Add field for italics.
1983 Remove unused blink field.
1984
1985 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
1986 Handle slant.
1987
1988 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
1989 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
1990 tty_alt_charset_p. Add tty_italic_p.
1991
ff88beb8
MA
19922012-06-09 Michael Albinus <michael.albinus@gmx.de>
1993
1994 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
1995 dbus_type_is_basic if available.
1996 (xd_extract_signed, xd_extract_unsigned): Rename from
1997 extract_signed and extract_unsigned, respectively. Adapt callers.
1998
44286096
CY
19992012-06-09 Chong Yidong <cyd@gnu.org>
2000
1682701f
CY
2001 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2002
44286096
CY
2003 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2004 case (Bug#9752).
2005
d86feb17
PE
20062012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2007
2008 * xdisp.c (vmessage): Treat frame message as multibyte.
2009 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2010 would generate the diagnostic "Making \302\247 buffer-local while
2011 let-bound!".
2012
d5c20fe8
EZ
20132012-06-08 Eli Zaretskii <eliz@gnu.org>
2014
2015 * dispnew.c (showing_window_margins_p): Undo last change, which
2016 was done due to an inadvertent commit.
2017 (adjust_frame_glyphs_for_frame_redisplay): Do call
2018 showing_window_margins_p.
2019
513749ee
SM
20202012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2021
2022 * eval.c (Fmake_var_non_special): New primitive.
2023 (syms_of_eval): Defsubr it.
2024 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2025
d4a8f5c1
JB
20262012-06-08 Juanma Barranquero <lekktu@gmail.com>
2027
2028 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2029 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2030
8bbbc977
EZ
20312012-06-08 Eli Zaretskii <eliz@gnu.org>
2032
2033 * alloc.c (allocate_vectorlike): Fix last change.
2034
f3372c87
DA
20352012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2036
2037 Block-based vector allocation of small vectors.
2038 * lisp.h (struct vectorlike_header): New field `nbytes',
2039 adjust comment accordingly.
2040 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2041 to denote vector blocks. Adjust users (live_vector_p,
2042 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2043 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2044 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2045 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2046 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2047 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2048 (roundup_size): New constant.
2049 (struct vector_block): New data type.
2050 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2051 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2052 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2053 (sweep_vectors): New functions.
2054 (allocate_vectorlike): Return `zero_vector' as the only vector of
2055 0 items. Allocate new vector from block if vector size is less than
2056 or equal to VBLOCK_BYTES_MAX.
2057 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2058 (init_alloc_once): Add call to init_vectors.
2059
4f18a4ed
SM
20602012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2061
2062 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2063
86f158bc
PE
20642012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2065
2066 * doprnt.c (doprnt): Truncate multibyte char correctly.
2067 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2068 would mishandle a string argument "Xc" if X was a multibyte
2069 character of length 2: it would truncate after X's first byte
2070 rather than including all of X.
2071
c5cfcbe0
CY
20722012-06-06 Chong Yidong <cyd@gnu.org>
2073
2074 * buffer.c (word_wrap): Doc fix.
2075
c05cf390
PE
20762012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2077
2078 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2079
0c3461de
GM
20802012-06-03 Glenn Morris <rgm@gnu.org>
2081
2082 * xdisp.c (tool-bar-style): Doc fix.
2083
c71232db
UM
20842012-06-03 Ulrich Müller <ulm@gentoo.org>
2085
2086 * Makefile.in (PAXCTL): Define.
2087 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2088 binary via PaX flags if the paxctl utility is available.
2089 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2090 Restore PaX flags to their default. (Bug#11398)
2091
383f7350
CY
20922012-06-03 Chong Yidong <cyd@gnu.org>
2093
2094 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2095 buffer (Bug#11226).
2096
5f2c76c6
CY
20972012-06-03 Chong Yidong <cyd@gnu.org>
2098
2099 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2100 (note_mode_line_or_margin_highlight): If there is no help echo,
2101 use mode-line-default-help-echo. Handle the case where the mouse
2102 position is past the end of the mode line string.
2103
2104 * buffer.c (buffer_local_value_1): New function, split from
2105 Fbuffer_local_value; can return Qunbound.
2106 (Fbuffer_local_value): Use it.
2107 (Vmode_line_format): Docstring tweaks.
2108
773d47f6
PE
21092012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2110
2111 * sysdep.c (system_process_attributes): Improve comment.
2112
f2d6a3df
SM
21132012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2114
2115 * keyboard.c: Export real-this-command to Elisp.
2116 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2117 and DEFVAR it. Update all users.
2118
63810350
PE
21192012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2120
7bd5c1f4
PE
2121 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2122
63810350
PE
2123 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2124 Convert pctcpu and pctmem to Lisp float properly.
2125 Let the compiler fold better, as 100.0/0x8000 is exact.
2126
a2821611
AS
21272012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2128
2129 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2130 cons_block.
2131
5fceba1d
PE
21322012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2133
2134 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2135
c98ff5dd
DA
21362012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2137
2138 For a 'struct window', replace some Lisp_Object fields to
2139 bitfields where appropriate, remove unused fields.
2140 * window.h (struct window): Remove unused 'last_mark_x' and
2141 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2142 change it's type from Lisp_Object to bitfield.
2143 Change type of 'force_start', 'optional_new_start',
2144 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2145 fields from Lisp_Object to bitfield. Adjust users accordingly.
2146
ca34e0be
PE
21472012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2148
2149 Pacify gcc -Wdouble-precision when using Xaw.
2150 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2151 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2152 Use 'float' consistently, rather than 'float' in most places
2153 and 'double' in a couple of places.
2154
efc00ab1 21552012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2156
2157 * xdisp.c (handle_stop): Detect whether we have overlay strings
2158 loaded by testing it->current.overlay_string_index to be
2159 non-negative, instead of checking whether n_overlay_strings is
2160 positive. (Bug#11587)
2161
efc00ab1 21622012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2163
2164 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2165
2166 * doc.c (Fsubstitute_command_keys): Doc fix.
2167
efc00ab1 21682012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2169
2170 * search.c (search_buffer): Remove calls to
2171 r_alloc_inhibit_buffer_relocation, as it is now called by
2172 maybe_unify_char, which was the cause of relocation of buffer text
2173 in bug#11519.
2174
efc00ab1 21752012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2176
2177 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2178 for the duration of call to load_charset, to avoid problems with
2179 callers of maybe_unify_char that access buffer text through C
2180 pointers.
2181
2182 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2183 decrement the inhibition flag, instead of just setting or
2184 resetting it.
2185
ba93a187
PE
21862012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2187
2188 Remove obsolete '#define static' cruft.
2189 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2190 This #undef was "temporary" in 2000; it is no longer needed
2191 now that '#define static' has gone away.
2192 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2193 (gray_bitmap_bits): Remove; no longer needed.
2194 All uses replaced with definiens.
2195 * xterm.c: Include "bitmaps/gray.xbm".
2196
9e4bf381
PE
21972012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2198
2199 Clean up __executable_start, monstartup when --enable-profiling.
2200 The following changes affect the code only when profiling.
2201 * dispnew.c (__executable_start): Rename from safe_bcopy.
2202 Define only on platforms that need it.
2203 * emacs.c: Include <sys/gmon.h> when profiling.
2204 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2205 (__executable_start): Remove decl, since lisp.h does it now.
2206 (safe_bcopy): Remove decl; no longer has that name.
2207 (main): Coalesce #if into single bit of code, for simplicity.
2208 Cast pointers to uintptr_t, since standard libraries want integers
2209 and not pointers.
2210 * lisp.h (__executable_start): New decl.
2211
32d72c2f
GM
22122012-05-31 Glenn Morris <rgm@gnu.org>
2213
2214 * image.c (Fimagemagick_types): Doc fix.
2215
baac5bc7
JM
22162012-05-30 Jim Meyering <meyering@redhat.com>
2217
2218 * callproc.c (Fcall_process_region): Include directory component
2219 in mkstemp error message (Bug#11586).
2220
72cb32cf
PE
22212012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2222
2223 * alloc.c, lisp.h (make_pure_vector): Now static.
2224
61b108cc
SM
22252012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2226
2227 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2228 Move to byte-run.el.
2229 (Fautoload): Do the hash-doc more carefully.
2230 * data.c (Fdefalias): Purify definition, except for keymaps.
2231 (Qdefun): Move from eval.c.
2232 * lisp.h (Qdefun): Remove.
2233 * lread.c (read1): Tiny simplification.
2234
471fe23d
TN
22352012-05-29 Troels Nielsen <bn.troels@gmail.com>
2236
934f3f58 2237 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2238 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2239 Bug#9642, but explicitly check that the buffer the overlay would
2240 be moved to is live and rearrange lines to make sure that errors
2241 will not put the overlay in an inconsistent state.
2242 (Fdelete_overlay): Cosmetics.
2243
85d0efd1
EZ
22442012-05-28 Eli Zaretskii <eliz@gnu.org>
2245
2246 * w32term.c (my_bring_window_to_top): New function.
2247 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2248 could be different from the original one.
2249 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2250 (Bug#11513)
2251
2252 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2253 by calling BringWindowToTop.
2254
2255 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2256 (WM_EMACS_END): Increase by one.
2257
da92a98c
PE
22582012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2259
2260 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2261 This avoids undefined behavior that might cause the eassert
2262 to not catch an out-of-range value.
2263
74d1f848
JB
22642012-05-28 Juanma Barranquero <lekktu@gmail.com>
2265
2266 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2267 Update dependencies.
2268
9e1a06fc
EZ
22692012-05-27 Eli Zaretskii <eliz@gnu.org>
2270
2271 * bidi.c (bidi_mirror_char): Fix last change.
2272
f3dd7312
AS
22732012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2274
2275 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2276 when referring to sectname field in printf format.
2277
81899c91
PE
22782012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2279
57b81a9f
PE
2280 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2281 Only r_alloc_inhibit_buffer_relocation needed to be added;
2282 the others were already declared.
2283
81899c91
PE
2284 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2285 before checking whether it's out of range. Put the check inside
2286 eassert. See
2287 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2288
33017faf 22892012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2290
2291 * callproc.c (Fcall_process): Restore a line that was accidentally
2292 commented out in the 2011-02-13 change (bug#11547).
2293
33017faf 22942012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2295
2296 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2297 defined on ralloc.c.
2298
2299 * buffer.c [REL_ALLOC]: Remove prototypes of
2300 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2301 they are now on lisp.h.
2302
2303 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2304
2305 * search.c (search_buffer): Use it to inhibit relocation of buffer
2306 text while re_search_2 is doing its job, because re_search_2 is
2307 passed C pointers to buffer text. (Bug#11519)
2308
23415acf
EZ
2309 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2310 Update value to 24.
2311
44e27368
EZ
2312 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2313 state after an additional call to move_it_in_display_line_to, keep
2314 the values of it->max_ascent and it->max_descent found for the
2315 entire line.
2316 (pos_visible_p): Revert the comparison against bottom_y to what it
2317 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2318 (Bug#11464)
2319
c1892f11
PE
23202012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2321
2322 Fix coding-related core dumps with gcc -ftrapv.
2323 The code was computing A - B, where A and B are pointers, and B is
2324 random garbage. This can lead to core dumps on platforms that
2325 have special pointer registers, and it also leads to core dumps on
2326 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2327 A - B only when B is initialized properly.
2328 * coding.c (coding_set_source, coding_set_destination): Return void.
2329 (coding_change_source, coding_change_destinations): New functions,
2330 with the old behaviors of coding_set_source and coding_set_destination.
2331 All callers that need an offset changed to use these new functions.
2332
eb7afdad
GM
23332012-05-26 Glenn Morris <rgm@gnu.org>
2334
2335 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2336
f12fdf02
EZ
23372012-05-26 Eli Zaretskii <eliz@gnu.org>
2338
53a63be6 2339 Extend mouse support on W32 text-mode console.
61b108cc
SM
2340 * xdisp.c (draw_row_with_mouse_face):
2341 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2342
eb3f6f01 2343 * w32console.c: Include window.h.
61b108cc
SM
2344 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2345 New functions.
eb3f6f01
EZ
2346 (initialize_w32_display): Initialize mouse-highlight data.
2347
53a63be6
EZ
2348 * w32inevt.c: Include termchar.h and window.h.
2349 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2350 moves, call note_mouse_highlight. If help_echo changed, call
2351 gen_help_event to produce help-echo message in the echo area.
2352 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2353 highlight info.
2354
4cfd81f6
PE
23552012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2356
2357 * lread.c (read1): Simplify slightly to avoid an overflow warning
2358 with GCC 4.7.0 on x86-64.
2359
4446092a
EZ
23602012-05-26 Eli Zaretskii <eliz@gnu.org>
2361
2362 * bidi.c (bidi_mirror_char): Revert last change: an int is
2363 definitely wide enough here.
2364
42b2a986 23652012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2366
42b2a986 2367 Fix integer width and related bugs (Bug#9874).
eb106a49 2368 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2369 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2370 (string_bytes, check_sblock, allocate_string_data):
2371 (compact_small_strings, Fmake_bool_vector, make_string)
2372 (make_unibyte_string, make_multibyte_string)
2373 (make_string_from_bytes, make_specified_string)
2374 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2375 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2376 (mark_vectorlike):
2377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2378 (allocate_pseudovector):
2379 Use int, not EMACS_INT, where int is wide enough.
2380 (inhibit_garbage_collection, Fgarbage_collect):
2381 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2382 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2383 int might not be wide enough.
2384 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2385 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2386 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2387 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2388 (bidi_level_of_next_char, bidi_move_to_visually_next):
2389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2390 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2391 (Fkill_buffer, Fset_buffer_major_mode)
2392 (advance_to_char_boundary, Fbuffer_swap_text)
2393 (Fset_buffer_multibyte, overlays_at, overlays_in)
2394 (overlay_touches_p, struct sortvec, record_overlay_string)
2395 (overlay_strings, recenter_overlay_lists)
2396 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2397 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2398 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2399 (Foverlay_recenter, last_overlay_modification_hooks_used)
2400 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2402 (validate_region): Omit unnecessary test for b <= e,
2403 since that's guaranteed by the previous test.
d311d28c
PE
2404 (adjust_overlays_for_delete): Avoid pos + length overflow.
2405 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2406 (report_overlay_modification):
2407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2408 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2409 Omit pointer cast, which isn't needed anyway, and doesn't work
2410 after the EMACS_INT -> ptrdiff_t change.
02481186 2411 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2412 * buffer.h: Adjust decls to match defn changes elsewhere.
2413 (struct buffer_text, struct buffer):
2414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2415 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2416 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2417 not int, to avoid needless 32-bit limit on 64-bit hosts.
2418 (exec_byte_code): Use tighter memory-full test, one that checks
2419 for alloca overflow. Don't compute the address of the object just
2420 before an array, as that's not portable. Use EMACS_INT, not
2421 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2422 * callint.c (Fcall_interactively):
2423 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2424 * callproc.c (call_process_kill, Fcall_process):
2425 Don't assume pid_t fits into an Emacs fixnum.
2426 (call_process_cleanup, Fcall_process, child_setup):
2427 Don't assume pid_t fits into int.
2428 (call_process_cleanup, Fcall_process, delete_temp_file)
2429 (Fcall_process_region):
2430 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2431 (Fcall_process): Simplify handling of volatile integers.
2432 Use int, not EMACS_INT, where int will do.
2433 * casefiddle.c (casify_object, casify_region, operate_on_word)
2434 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2436 (casify_object): Avoid integer overflow when overallocating buffer.
2437 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2438 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2439 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2440 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2441 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2442 integers are now checked earlier. All uses replaced with XINT.
2443 (ccl_driver):
2444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2445 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2446 (ccl_driver, Fregister_code_conversion_map):
2447 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2448 (resolve_symbol_ccl_program): Check that vector header is in range.
2449 Always copy the vector, so that we can check its contents reliably
2450 now rather than having to recheck each instruction as it's being
2451 executed. Check that vector words fit in 'int'.
2452 (ccl_get_compiled_code, Fregister_ccl_program)
2453 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2454 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2455 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2456 contents are in range.
2457 (Fccl_execute_on_string): Check that status is in range.
2458 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2459 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2460 Accept and return EMACS_INT, not int, because callers can pass values
2461 out of 'int' range.
2462 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2463 (multibyte_chars_in_text, parse_str_as_multibyte)
2464 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2465 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2466 (string_escape_byte8, Fget_byte):
2467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2468 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2469 avoid mishandling large integers.
2470 * character.h: Adjust decls to match defn changes elsewhere.
2471 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2472 (Ffind_charset_region):
2473 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2474 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2475 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2476 Don't assume fixnum fits in int.
d311d28c
PE
2477 (load_charset_map_from_vector, Fmap_charset_chars):
2478 Remove now-unnecessary CHECK_NATNUMs.
2479 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2480 Don't rely on undefined behavior with signed left shift overflow.
2481 Don't assume unsigned int fits into fixnum, or that fixnum fits
2482 into unsigned int. Don't require max_code to be a valid fixnum;
2483 that's not true for gb10830 4-byte on a 32-bit host. Allow
2484 invalid_code to be a cons, for the same reason. Require code_offset
2485 to be a character. Avoid int overflow if max_char is close
2486 to INT_MAX.
2487 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2488 this is intended anyway and avoids some undefined behavior.
2489 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2490 INDEX_TO_CODE_POINT, as that's what it expects.
2491 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2492 * charset.h (DECODE_CHAR): Return int, not unsigned;
2493 this is what was intended anyway, and it avoids undefined behavior.
2494 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2495 integer-overflow issues.
2496 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2497 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2498 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2499 * chartab.c (Fmake_char_table, Fset_char_table_range)
2500 (uniprop_get_decoder, uniprop_get_encoder):
2501 Don't assume fixnum fits in int.
2502 * cmds.c (move_point): New function, that does the gist of
2503 Fforward_char and Fbackward_char, but does so while checking
2504 for integer overflow more accurately.
c96e5d6a 2505 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2506 (Fforward_line, Fend_of_line, internal_self_insert)
2507 (internal_self_insert):
2508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2509 Fix a FIXME, by checking for integer overflow when calculating
2510 target_clm and actual_clm.
2511 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2512 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2513 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2514 (coding_alloc_by_making_gap, alloc_destination)
2515 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2516 (encode_coding_utf_16, detect_coding_emacs_mule)
2517 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2518 (detect_coding_iso_2022, decode_coding_iso_2022)
2519 (encode_invocation_designation, encode_designation_at_bol)
2520 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2521 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2522 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2523 (encode_coding_ccl, encode_coding_raw_text)
2524 (detect_coding_charset, decode_coding_charset)
2525 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2526 (produce_composition, produce_charset, produce_annotation)
2527 (decode_coding, handle_composition_annotation)
2528 (handle_charset_annotation, consume_chars, decode_coding_gap)
2529 (decode_coding_object, encode_coding_object, detect_coding_system)
2530 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2531 (code_convert_region, code_convert_string)
8f50130c
PE
2532 (Fdefine_coding_system_internal)
2533 (coding_set_source, coding_set_destination):
d311d28c
PE
2534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2535 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2536 (Fdefine_coding_system_internal):
2537 Don't assume fixnums fit in int.
2538 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2539 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2540 (Funencodable_char_position, Fcheck_coding_systems_region)
2541 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2543 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2544 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2545 Don't access memory outside of the args array.
d311d28c 2546 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2547 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2548 result of ENCODE_CHAR.
d311d28c
PE
2549 * coding.h: Adjust decls to match defn changes elsewhere.
2550 (struct coding_system):
2551 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2552 * composite.c (get_composition_id, find_composition)
2553 (run_composition_function, update_compositions)
2554 (compose_text, composition_gstring_put_cache)
2555 (composition_gstring_p, composition_gstring_width)
2556 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2557 (composition_compute_stop_pos, composition_reseat_it)
2558 (composition_update_it, struct position_record)
2559 (find_automatic_composition, composition_adjust_point)
2560 (Fcomposition_get_gstring, Ffind_composition_internal):
2561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2562 (update_compositions):
2563 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2564 * composite.h: Adjust decls to match defn changes elsewhere.
2565 (struct composition):
2566 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2567 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2568 Do not attempt to compute the address of the object just before a
2569 buffer; this is not portable.
2570 (Faref, Faset):
2571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2572 (Faset): Use int, not EMACS_INT, where int is wide enough.
2573 (Fstring_to_number): Don't assume fixnums fit in int.
2574 (Frem): Don't assume arg is nonnegative.
2575 * dbusbind.c (xd_append_arg): Check for integers out of range.
2576 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2577 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2578 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2579 (xd_get_connection_references): Return ptrdiff_t, not int.
2580 All uses changed.
2581 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2582 (xd_read_message_1):
2583 Use int, not unsigned, where the dbus API uses int.
2584 (Fdbus_message_internal): Don't overflow mtype.
2585 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2586 * dired.c (directory_files_internal, file_name_completion, scmp)
2587 (file_name_completion_stat):
2588 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2589 (file_name_completion): Don't overflow matchcount.
2590 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2591 * dispextern.h: Adjust decls to match defn changes elsewhere.
2592 (struct text_pos, struct glyph, struct bidi_saved_info)
2593 (struct bidi_string_data, struct bidi_it, struct composition_it)
2594 (struct it):
2595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2596 (struct display_pos, struct composition_it, struct it):
2597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2598 * dispnew.c (increment_matrix_positions)
2599 (increment_row_positions, mode_line_string)
2600 (marginal_area_string):
2601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2602 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2603 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2604 (duration_to_sec_usec): New function, to check for overflow better.
2605 (Fsleep_for, sit_for): Use it.
2606 * doc.c (get_doc_string, store_function_docstring):
2607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2608 (get_doc_string, Fsnarf_documentation):
2609 Use int, not EMACS_INT, where int is wide enough.
2610 (get_doc_string):
2611 Use SAFE_ALLOCA, not alloca.
2612 Check for overflow when converting EMACS_INT to off_t.
2613 * doprnt.c (doprnt):
2614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2615 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2616 Don't assume uid_t fits into fixnum.
2617 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2618 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2619 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2620 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2621 (general_insert_function)
2622 (Finsert_char, make_buffer_string, make_buffer_string_both)
2623 (update_buffer_properties, Fbuffer_substring)
2624 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2625 (Fsubst_char_in_region, check_translation)
2626 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2627 (transpose_markers, Ftranspose_regions):
2628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2629 (clip_to_bounds): Move to lisp.h as an inline function).
2630 (Fconstrain_to_field): Don't assume integers are nonnegative.
2631 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2632 (Fsubst_char_in_region, Fsave_restriction):
2633 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2634 (Femacs_pid): Don't assume pid_t fits into fixnum.
2635 (lo_time): Use int, not EMACS_INT, when int suffices.
2636 (lisp_time_argument): Check for usec out of range.
2637 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
2638 (Fuser_login_name, Fuser_full_name): Signal an error
2639 if a uid argument is out of range, rather than relying on
2640 undefined behavior.
c8d5c857
PE
2641 (Fformat_time_string): Remove now-unnecessary check.
2642 lisp_time_argument checks for out-of-range usec now.
243e0530 2643 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
2644 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2645 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2646 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2647 (init_cmdargs, Fdump_emacs):
2648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2649 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2650 the bottom (typically) 32 bits of the fixnum.
2651 * eval.c (specpdl_size, call_debugger):
2652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2653 (when_entered_debugger, Fbacktrace_debug):
2654 Don't assume fixnum can fit in int.
2655 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2656 the object just before a buffer; this is not portable.
2657 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2658 (grow_specpdl, unbind_to):
2659 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2660 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2661 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 2662 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
2663 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2664 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2665 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2666 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2667 (a_write, e_write):
2668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2669 (Fcopy_file, non_regular_nbytes, read_non_regular)
2670 (Finsert_file_contents):
2671 Use int, not EMACS_INT, where int is wide enough.
2672 (READ_BUF_SIZE): Verify that it fits in int.
2673 (Finsert_file_contents): Check that counts are in proper range,
2674 rather than assuming fixnums fit into ptrdiff_t etc.
2675 Don't assume fixnums fit into int.
125b3835 2676 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
2677 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2678 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
2679 (string_char_to_byte, string_byte_to_char)
2680 (string_make_multibyte, string_to_multibyte)
2681 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2682 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2683 (substring_both, Fdelete, internal_equal, Ffillarray)
2684 (Fclear_string, mapcar1)
2685 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2686 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2687 (larger_vector, make_hash_table, maybe_resize_hash_table)
2688 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2689 (Fmaphash, secure_hash):
2690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2691 (concat): Check for string index and length overflow.
2692 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2693 (Frequire):
2694 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2695 (larger_vector): New API (vec, incr_min, size_max) replaces old
2696 one (vec, new_size, init). This catches size overflow.
2697 INIT was removed because it was always Qnil.
2698 All callers changed.
2699 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2700 the upper bound on a hash table index size.
2701 (make_hash_table, maybe_resize_hash_table): Use it.
2702 (secure_hash): Computer start_byte and end_byte only after
2703 they're known to be in ptrdiff_t range.
2704 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2705 (Ffont_get_glyphs, Ffont_at):
2706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2707 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2708 (Flist_fonts, Fopen_font):
2709 Don't assume fixnum can fit in int.
2710 (check_gstring): Don't assume index can fit in int.
2711 (font_match_p): Check that fixnum is a character, not a nonnegative
2712 fixnum, since the later code needs to stuff it into an int.
2713 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2714 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2715 conversion overflow issues.
2716 (Fopen_font): Check for integer out of range.
2717 (Ffont_get_glyphs): Don't assume index can fit in int.
2718 * font.h: Adjust decls to match defn changes elsewhere.
2719 * fontset.c (reorder_font_vector): Redo score calculation to avoid
2720 integer overflow.
2721 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2722 printmax_t, where ptrdiff_t is wide enough.
2723 (Finternal_char_font):
2724 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2725 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2726 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2727 (Fset_frame_position, x_set_frame_parameters)
2728 (x_set_line_spacing, x_set_border_width)
2729 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2730 Check that fixnums are in proper range for system types.
2731 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2732 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2733 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2734 Use SAFE_ALLOCA_LISP, not alloca.
2735 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2736 intptr_t is wide enough.
2737 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2738 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2739 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2740 Check for fixnum out of range.
2741 * ftfont.c (ftfont_list): Don't assume index fits in int.
2742 Check that fixnums are in proper range for system types.
2743 (ftfont_shape_by_flt):
2744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
2745 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2747 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2748 Check that fixnums are in proper range for system types.
2749 * gnutls.h: Adjust decls to match defn changes elsewhere.
2750 * gtkutil.c (xg_dialog_run):
2751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2752 (update_frame_tool_bar):
2753 Check that fixnums are in proper range for system types.
2754 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 2755 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
2756 * indent.c (last_known_column, last_known_column_point):
2757 (current_column_bol_cache):
2758 (skip_invisible, current_column, check_display_width):
2759 (check_display_width, scan_for_column, current_column_1)
2760 (Findent_to, Fcurrent_indentation, position_indentation)
2761 (indented_beyond_p, Fmove_to_column, compute_motion):
2762 (Fcompute_motion, Fvertical_motion):
2763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2764 (last_known_column_modified): Use EMACS_INT, not int.
2765 (check_display_width):
2766 (Fcompute_motion):
2767 Check that fixnums and floats are in proper range for system types.
2768 (compute_motion): Don't assume index or fixnum fits in int.
2769 (compute_motion, Fcompute_motion):
2770 Use int, not EMACS_INT, when it is wide enough.
2771 (vmotion): Omit local var start_hpos that is always 0; that way
2772 we don't need to worry about overflow in expressions involving it.
2773 * indent.h: Adjust decls to match defn changes elsewhere.
2774 (struct position):
2775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2776 Use int, not EMACS_INT, where int is wide enough.
2777 Remove unused members ovstring_chars_done and tab_offset;
2778 all uses removed.
2779 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2780 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2781 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2782 (make_gap, copy_text, insert, insert_and_inherit)
2783 (insert_before_markers, insert_before_markers_and_inherit)
2784 (insert_1, count_combining_before, count_combining_after)
2785 (insert_1_both, insert_from_string)
2786 (insert_from_string_before_markers, insert_from_string_1)
2787 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2788 (adjust_after_replace, adjust_after_insert, replace_range)
2789 (replace_range_2, del_range, del_range_1, del_range_byte)
2790 (del_range_both, del_range_2, modify_region)
2791 (prepare_to_modify_buffer, signal_before_change)
2792 (signal_after_change, Fcombine_after_change_execute):
2793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2794 * intervals.c (traverse_intervals, rotate_right, rotate_left)
2795 (balance_an_interval, split_interval_right, split_interval_left)
2796 (find_interval, next_interval, update_interval)
2797 (adjust_intervals_for_insertion, delete_node, delete_interval)
2798 (interval_deletion_adjustment, adjust_intervals_for_deletion)
2799 (static_offset_intervals, offset_intervals)
2800 (merge_interval_right, merge_interval_left, make_new_interval)
2801 (graft_intervals_into_buffer, temp_set_point_both)
2802 (temp_set_point, set_point, adjust_for_invis_intang)
2803 (set_point_both, move_if_not_intangible, get_property_and_range)
2804 (get_local_map, copy_intervals, copy_intervals_to_string)
2805 (compare_string_intervals, set_intervals_multibyte_1):
2806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2807 * intervals.h: Adjust decls to match defn changes elsewhere.
2808 (struct interval):
2809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2810 * keyboard.c (this_command_key_count, this_single_command_key_start)
2811 (before_command_key_count, before_command_echo_length, echo_now)
2812 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2813 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2814 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2815 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2817 (last_non_minibuf_size, last_point_position, echo_truncate)
2818 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2819 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2820 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2821 (stuff_buffered_input):
2822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2823 (last_auto_save, command_loop_1, read_char):
2824 Use EMACS_INT, not int, to avoid integer overflow.
2825 (record_char): Avoid overflow in total_keys computation.
2826 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2827 * keyboard.h: Adjust decls to match defn changes elsewhere.
2828 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2829 (Fkey_description, Fdescribe_vector, Flookup_key):
2830 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2831 (click_position): New function, to check that positions are in range.
2832 (Fcurrent_active_maps):
2833 (describe_command):
2834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2835 (Faccessible_keymaps, Fkey_description):
2836 (preferred_sequence_p):
2837 Don't assume fixnum can fit into int.
2838 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2839 Check for integer overflow in size calculations.
2840 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2841 avoid mishandling large integers.
2842 * lisp.h: Adjust decls to match defn changes elsewhere.
2843 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2844 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2845 (struct Lisp_Marker):
2846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2847 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
2848 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2849 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2850 All callers changed.
2851 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2852 Assume the arg has valid form, since it always does.
2853 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2854 unsigned integer system type.
2855 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2856 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2858 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2859 (duration_to_sec_usec): New decl.
2860 * lread.c (read_from_string_index, read_from_string_index_byte)
2861 (read_from_string_limit, readchar, unreadchar, openp)
2862 (read_internal_start, read1, oblookup):
2863 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2864 (Fload, readevalloop, Feval_buffer, Feval_region):
2865 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2866 (openp): Check for out-of-range argument to 'access'.
2867 (read1): Use int, not EMACS_INT, where int is wide enough.
2868 Don't assume fixnum fits into int.
6efdadfd 2869 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
2870 (read_filtered_event): Use duration_to_sec_usec
2871 to do proper overflow checking on durations.
d311d28c
PE
2872 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2873 in size calculation.
2874 (Fexecute_kbd_macro):
2875 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2876 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2877 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2878 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2879 (set_marker_both, set_marker_restricted_both, marker_position)
2880 (marker_byte_position, Fbuffer_has_markers_at):
2881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2882 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 2883 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
2884 It now merely ensures that the menu is large enough, without
2885 necessarily growing it, as this avoids some integer overflow issues.
2886 All callers changed.
2887 (keymap_panes, parse_single_submenu, Fx_popup_menu):
2888 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2889 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2890 Use SAFE_ALLOCA_LISP, not alloca.
2891 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2892 to EMACS_INT. Check that fixnums are in proper range for system types.
2893 * minibuf.c (minibuf_prompt_width, string_to_object)
2894 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2895 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2897 (get_minibuffer, read_minibuf_unwind):
2898 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2899 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2900 this simplifies overflow checking. All callers changed.
2901 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2902 (Ftest_completion):
2903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2904 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2905 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2906 Check that fixnums are in proper range for system types.
2907 (Fx_create_frame, Fx_show_tip):
2908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2909 * nsfont.m (ns_findfonts, nsfont_list_family):
2910 Don't assume fixnum fits in long.
2911 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
2912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2913 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
2914 wide enough.
17fdb222 2915 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
2916 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2917 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
2918 (PRINTDECLARE, PRINTPREPARE):
2919 (strout, print_string):
2920 (print, print_preprocess, print_check_string_charset_prop)
2921 (print_object):
2922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2923 (PRINTDECLARE):
2924 (temp_output_buffer_setup, Fprin1_to_string, print_object):
2925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2926 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 2927 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 2928 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
2929 (print_error_message): Use SAFE_ALLOCA, not alloca.
2930 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
2931 (print_depth, new_backquote_output, print_number_index):
2932 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
2933 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
2934 (Fset_process_window_size, Fformat_network_address)
2935 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 2936 (sigchld_handler):
d311d28c 2937 Check that fixnums are in proper range for system types.
d44287d4 2938 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
2939 Check for process-ids out of pid_t range rather than relying on
2940 undefined behavior.
e4d81efc 2941 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
2942 (Fformat_network_address, read_process_output, send_process)
2943 (Fprocess_send_region, status_notify):
2944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2945 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
2946 (wait_reading_process_output, read_process_output, exec_sentinel):
2947 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2948 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
2949 (Faccept_process_output): Use duration_to_sec_usec to do proper
2950 overflow checking on durations.
dde14581
PE
2951 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
2952 Don't assume pid_t fits in int.
02481186
PE
2953 * process.h (struct Lisp_Process): Members tick and update_tick
2954 are now of type EMACS_INT, not int.
b62b53e8
PE
2955 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
2956 configured --with-wide-int.
d311d28c
PE
2957 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
2958 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
2959 * search.c (looking_at_1, string_match_1):
2960 (fast_string_match, fast_c_string_match_ignore_case)
2961 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
2962 (scan_newline, find_before_next_newline, search_command)
2963 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
2964 (set_search_regs, wordify):
2965 (Freplace_match):
2966 (Fmatch_data):
2967 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2968 (string_match_1, search_buffer, set_search_regs):
2969 (Fmatch_data):
2970 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2971 (wordify): Check for overflow in size calculation.
2972 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
2973 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
2974 Check that fixnums are in proper range for system types.
2975 * sound.c (struct sound_device)
2976 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
2977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2978 (Fplay_sound_internal):
2979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 2980 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
2981 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
2982 (Fparse_partial_sexp):
2983 Don't assume fixnums can fit in int.
2984 (struct lisp_parse_state, find_start_pos, find_start_value)
2985 (find_start_value_byte, find_start_begv)
2986 (update_syntax_table, char_quoted, dec_bytepos)
2987 (find_defun_start, prev_char_comend_first, back_comment):
2988 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
2989 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
2990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2991 (Finternal_describe_syntax_value): Check that match_lisp is a
2992 character, not an integer, since the code stuffs it into int.
2993 (scan_words, scan_sexps_forward):
2994 Check that fixnums are in proper range for system types.
2995 (Fforward_word):
2996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2997 (scan_sexps_forward):
2998 Use CHARACTERP, not INTEGERP, since the value must fit into int.
2999 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3000 * syntax.h: Adjust decls to match defn changes elsewhere.
3001 (struct gl_state_s):
3002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3003 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3004 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3005 * sysdep.c (wait_for_termination_1, wait_for_termination)
3006 (interruptible_wait_for_termination, mkdir):
3007 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3008 (emacs_read, emacs_write):
3009 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3010 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3011 and double all fit in int.
d311d28c
PE
3012 * term.c (set_tty_color_mode):
3013 Check that fixnums are in proper range for system types.
3014 * termhooks.h (struct input_event):
3015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3016 * textprop.c (validate_interval_range, interval_of)
3017 (Fadd_text_properties, set_text_properties_1)
3018 (Fremove_text_properties, Fremove_list_of_text_properties)
3019 (Ftext_property_any, Ftext_property_not_all)
3020 (copy_text_properties, text_property_list, extend_property_ranges)
3021 (verify_interval_modification):
3022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3023 (Fnext_single_char_property_change)
3024 (Fprevious_single_char_property_change):
3025 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3026 (copy_text_properties):
3027 Check for integer overflow in index calculation.
d311d28c
PE
3028 * undo.c (last_boundary_position, record_point, record_insert)
3029 (record_delete, record_marker_adjustment, record_change)
3030 (record_property_change):
3031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3032 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3033 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3034 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3035 (Fx_hide_tip, Fx_file_dialog):
3036 * w32menu.c (set_frame_menubar):
3037 Use ptrdiff_t, not int, for consistency with rest of code.
3038 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3039 (select_window, Fdelete_other_windows_internal)
3040 (window_scroll_pixel_based, window_scroll_line_based)
3041 (Frecenter, Fset_window_configuration):
3042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3043 (Fset_window_hscroll, run_window_configuration_change_hook)
3044 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3045 (Fscroll_other_window, Frecenter):
d311d28c
PE
3046 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3047 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3048 Don't assume fixnum fits in int.
3049 (Fset_window_scroll_bars):
3050 Check that fixnums are in proper range for system types.
3051 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3052 (string_pos, c_string_pos, number_of_chars, init_iterator)
3053 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3054 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3055 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3056 (face_before_or_after_it_pos, handle_invisible_prop)
3057 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3058 (display_prop_intangible_p, string_buffer_position_lim)
3059 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3060 (get_overlay_strings_1, get_overlay_strings)
3061 (iterate_out_of_display_property, forward_to_next_line_start)
3062 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3063 (get_next_display_element, set_iterator_to_next)
3064 (get_visually_first_element, compute_stop_pos_backwards)
3065 (handle_stop_backwards, next_element_from_buffer)
3066 (move_it_in_display_line_to, move_it_in_display_line)
3067 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3068 (add_to_log, message_dolog, message_log_check_duplicate)
3069 (message2, message2_nolog, message3, message3_nolog
3070 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3071 (current_message_1, truncate_echo_area, truncate_message_1)
3072 (set_message, set_message_1, store_mode_line_noprop)
3073 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3074 (text_outside_line_unchanged_p, check_point_in_composition)
3075 (reconsider_clip_changes)
3076 (redisplay_internal, set_cursor_from_row, try_scrolling)
3077 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3078 (redisplay_window, find_last_unchanged_at_beg_row)
3079 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3080 (trailing_whitespace_p, find_row_edges, display_line)
3081 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3082 (display_mode_element, store_mode_line_string)
3083 (pint2str, pint2hrstr, decode_mode_spec)
3084 (display_count_lines, display_string, draw_glyphs)
3085 (x_produce_glyphs, x_insert_glyphs)
3086 (rows_from_pos_range, mouse_face_from_buffer_pos)
3087 (fast_find_string_pos, mouse_face_from_string_pos)
3088 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3090 (safe_call, init_from_display_pos, handle_fontified_prop)
3091 (handle_single_display_spec, load_overlay_strings)
3092 (with_echo_area_buffer, setup_echo_area_for_printing)
3093 (display_echo_area, echo_area_display)
3094 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3095 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3096 (redisplay_window, dump_glyph_row, display_mode_line)
3097 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3098 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3099 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3100 (handle_single_display_spec, build_desired_tool_bar_string)
3101 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3102 (get_specified_cursor_type):
3103 Check that fixnums are in proper range for system types.
3104 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3105 (Flookup_image_map):
3106 Don't assume fixnums fit in int.
3107 (compare_overlay_entries):
3108 Avoid mishandling comparisons due to subtraction overflow.
3109 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3110 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3111 (handle_tool_bar_click):
3112 Use int, not unsigned, since we prefer signed and the signedness
3113 doesn't matter here.
3114 (get_next_display_element, next_element_from_display_vector):
3115 Use int, not EMACS_INT, when int is wide enough.
3116 (start_hourglass): Use duration_to_sec_usec to do proper
3117 overflow checking on durations.
3118 * xfaces.c (Fbitmap_spec_p):
3119 Check that fixnums are in proper range for system types.
3120 (compare_fonts_by_sort_order):
3121 Avoid mishandling comparisons due to subtraction overflow.
3122 (Fx_family_fonts, realize_basic_faces):
3123 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3124 (Fx_family_fonts):
3125 Don't assume fixnum fits in int.
3126 Use SAFE_ALLOCA_LISP, not alloca.
3127 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3128 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3129 (face_at_buffer_position, face_for_overlay_string)
3130 (face_at_string_position):
3131 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3132 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3133 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3134 (Fx_show_tip):
3135 Check that fixnums are in proper range for system types.
3136 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3137 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3139 (Fx_change_window_property): Don't assume fixnums fit in int.
3140 * xfont.c (xfont_chars_supported):
3141 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3142 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3143 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3145 * xml.c (parse_region):
3146 * xrdb.c (magic_file_p):
3147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3148 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3149 (x_get_local_selection, x_reply_selection_request)
3150 (x_handle_selection_request, wait_for_property_change):
3151 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3152 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3153 short is wide enough.
3154 (x_send_client_event): Don't assume fixnum fits in int.
3155 * xterm.c (x_x_to_emacs_modifiers):
3156 Don't assume EMACS_INT overflows nicely into int.
3157 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3158 may come from Lisp.
3159 (handle_one_xevent): NATNUMP can eval its arg twice.
3160 (x_connection_closed):
3161 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3162 * xterm.h: Adjust decls to match defn changes elsewhere.
3163 (struct scroll_bar): Use struct vectorlike_header
3164 rather than rolling our own approximation.
3165 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3166
c6574eb5
GM
31672012-05-25 Glenn Morris <rgm@gnu.org>
3168
3169 * lisp.mk (lisp): Update for more files being compiled now.
3170
e8d32c7e
SM
31712012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3172
48def666
SM
3173 * lread.c: Remove `read_pure' which makes no difference.
3174 (read_pure): Remove var.
3175 (unreadpure): Remove function.
3176 (readevalloop): Don't call read_list with -1 flag.
3177 (read1, read_vector): Don't test read_pure any more.
3178 (read_list): Simplify.
3179
e8d32c7e
SM
3180 * fileio.c, character.h: Minor style tweaks.
3181
4b2addb7
DA
31822012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3183
3184 * window.h (clip_changed): Remove useless declaration.
3185
584461b2
JB
31862012-05-22 Juanma Barranquero <lekktu@gmail.com>
3187
3188 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3189 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3190
34374650
PE
31912012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3192
3193 Remove src/m/*.
3194 This directory predates autoconf and is no longer needed nowadays.
3195 Move its few remaining bits of functionality to where they're needed.
3196 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3197 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3198 * m/template.h: Remove.
3199 * Makefile.in (M_FILE): Remove. All uses removed.
3200 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3201 * lisp.h (USE_LSB_TAG):
3202 * mem-limits.h (EXCEEDS_LISP_PTR):
3203 Use VAL_MAX, not VALBITS, in #if.
3204 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3205 (EMACS_UINT): Define unconditionally now.
3206 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3207 (BITS_PER_EMACS_INT): New constants, replacing
3208 what used to be in config.h, but not useful in #if.
3209 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3210 define them any more.
3211 (VAL_MAX): New macro.
3212 (VALMASK): Use it.
3213 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3214 BITS_PER_EMACS_INT, in #if.
3215 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3216 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3217 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3218 * s/ms-w32.h (DATA_START):
3219 Move here from removed file m/intel386.h.
3220 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3221 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3222
261cb4bb
PE
32232012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3224
3225 Assume C89 or later.
3226 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3227 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3228 (xrealloc):
3229 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3230 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3231 * textprop.c, tparam.c (NULL): Remove.
3232 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3233 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3234 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3235 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3236 * xterm.c (input_signal_count): Assume volatile works.
3237
ff23cd9f
KB
32382012-05-21 Ken Brown <kbrown@cornell.edu>
3239
3240 * xgselect.c (xg_select): Fix first argument in call to 'select'
3241 (bug#11508).
3242
1b170bc6
KB
32432012-05-20 Ken Brown <kbrown@cornell.edu>
3244
3245 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3246 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3247
b2f4d39f
KB
32482012-05-19 Ken Brown <kbrown@cornell.edu>
3249
3250 * xfns.c (x_in_use): Remove `static' qualifier.
3251 * xterm.h (x_in_use): Declare.
3252 * xgselect.c: Include xterm.h.
3253 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3254 and `display_arg' (bug#9754).
3255
003fdae2
PE
32562012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3257
9232a6d9
PE
3258 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3259
003fdae2
PE
3260 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3261 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3262
784b56e2
EZ
32632012-05-18 Eli Zaretskii <eliz@gnu.org>
3264
3265 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3266
3267 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3268 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3269
3270 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3271 reference to image_cache->refcount.
3272 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3273
a0a79cde
JL
32742012-05-17 Juri Linkov <juri@jurta.org>
3275
3276 * search.c (Fword_search_regexp, Fword_search_backward)
3277 (Fword_search_forward, Fword_search_backward_lax)
3278 (Fword_search_forward_lax): Move functions to isearch.el
3279 (bug#10145, bug#11381).
3280
b0572523
PE
32812012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3282
3283 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3284
9660f5fc
SM
32852012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3286
3287 * lread.c (init_obarray): Declare Qt and Qnil as special.
3288
4374de83
GM
32892012-05-14 Glenn Morris <rgm@gnu.org>
3290
3291 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3292 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3293
dc44c39a
PE
32942012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3295
078c97cb
PE
3296 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3297
dc44c39a
PE
3298 * unexaix.c: Port to more-recent AIX compilers.
3299 (report_error, report_error_1, make_hdr, copy_sym)
3300 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3301 Make arguments const char *, not char *, to avoid violations of C
3302 standard and to fix some AIX warnings reported by Gilles Pion.
3303
e18afed7 33042012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3305
3306 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3307 already have overlays loaded.
3308 (handle_single_display_spec): Before returning without displaying
3309 fringe bitmap, synchronize the bidi iterator with the main display
3310 iterator, by calling iterate_out_of_display_property.
3311 (iterate_out_of_display_property): Detect buffer iteration by
3312 testing that it->string is a Lisp string.
3313 (get_next_display_element): When the current object is exhausted,
3314 and there's something on it->stack, call set_iterator_to_next to
3315 proceed with what's on the stack, instead of returning zero.
3316 (set_iterator_to_next): If called at the end of a Lisp string,
3317 proceed to consider_string_end without incrementing string
3318 position. Don't increment display vector index past the end of
3319 the display vector. (Bug#11417)
c8fb9dc6
EZ
3320 (pos_visible_p): Don't report a position visible when move_it_to
3321 stopped at the last line of window, which happens to be scanned
3322 backwards by the bidi iteration. (Bug#11464)
ac268e67 3323
e18afed7 33242012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3325
3326 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3327 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3328 are on a TTY, and thus unable to display on the fringes.
3329 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3330 so we need to signal to the caller that this is a "replacing"
3331 display spec. This fixes display when the spec is invalid or we
3332 are on a TTY.
3333
e18afed7 33342012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3335
3336 * unexaix.c (make_hdr): Fix typo in prototype.
3337 This bug broke the build on AIX. Problem reported by Gilles Pion.
3338
9d0a235a
MA
33392012-05-14 Michael Albinus <michael.albinus@gmx.de>
3340
3341 * keyboard.c (kbd_buffer_get_event): Read special events also in
3342 batch mode. (Bug#11415)
3343
9e6b06ed
GM
33442012-05-12 Glenn Morris <rgm@gnu.org>
3345
3346 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3347
c1a1d7a3
EZ
33482012-05-12 Eli Zaretskii <eliz@gnu.org>
3349
3350 * lisp.mk (lisp): Add newcomment.elc.
3351
3fe7cdc8
GM
33522012-05-12 Glenn Morris <rgm@gnu.org>
3353
3354 * Makefile.in (MKDIR_P): New, set by configure.
3355 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3356
53f7d2c0
PE
33572012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3358
3359 Remove unused function hourglass_started.
3360 * dispextern.h (hourglass_started):
3361 * w32fns.c (hourglass_started):
3362 * xdisp.c (hourglass_started): Remove.
3363
75aafb17
JB
33642012-05-10 Juanma Barranquero <lekktu@gmail.com>
3365
3366 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3367 Update dependencies.
3368
12959e8e
PE
33692012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3370
97107e2e
PE
3371 * xgselect.c (xg_select): Put maxfds+1 into a var.
3372 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3373
12959e8e
PE
3374 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3375
836d29b3
DA
33762012-05-10 Dave Abrahams <dave@boostpro.com>
3377
3378 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3379 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3380
5cb67954
MA
33812012-05-09 Michael Albinus <michael.albinus@gmx.de>
3382
3383 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3384 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3385 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3386 Initialize xd_registered_buses.
3387
3478ec45
PE
33882012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3389
b263a6b0
PE
3390 Untag more efficiently if USE_LSB_TAG.
3391 This is based on a proposal by YAMAMOTO Mitsuharu in
3392 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3393 For an admittedly artificial (nth 8000 longlist) benchmark on
3394 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3395 Emacs's overall text size by 1%.
3396 * lisp.h (XUNTAG): New macro.
3397 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3398 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3399 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3400 * eval.c (Fautoload):
3401 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3402 * frame.h (XFRAME): Use XUNTAG.
3403
3478ec45
PE
3404 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3405 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3406 Remove unportable assumptions about print widths of types like
3407 dbus_uint32_t.
3408 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3409 intptr_t when converting between pointer and integer, to avoid GCC
3410 warnings about wrong width.
3411
666b903b 34122012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3413
3414 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3415 stack for each reader_thread, instead of defaulting to 8MB
3416 determined by the linker. This avoids failures in creating
3417 subprocesses on Windows 7, see the discussion in this thread:
3418 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3419
b120cc17
JC
34202012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3421
3422 Fix up display of the *Minibuf-0* buffer in the mini window.
3423 * keyboard.c (read_char): Don't clear the echo area if there's no
3424 message to clear.
3425 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3426 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3427
9a4b36f8
MA
34282012-05-07 Michael Albinus <michael.albinus@gmx.de>
3429
3430 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3431 batch mode.
3432
e5f9458f
CY
34332012-05-06 Chong Yidong <cyd@gnu.org>
3434
3435 * lisp.mk (lisp): Update.
3436
eceeb5fc 34372012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3438
3439 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3440
71873e2b
SM
34412012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3442
3443 * data.c (PUT_ERROR): New macro.
3444 (syms_of_data): Use it. Add new error type `user-error'.
3445 * undo.c (user_error): New function.
3446 (Fprimitive_undo): Use it.
3447 * print.c (print_error_message): Adjust print style for `user-error'.
3448 * keyboard.c (user_error): New function.
3449 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3450
ab0fa4e4
PE
34512012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3452
3453 Do not limit current-time-string to years 1000..9999.
3454 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3455 (Fcurrent_time_string): Support any year that is supported by the
3456 underlying localtime representation. Don't use asctime, as it
3457 has undefined behavior for years outside the range -999..9999.
3458
7ed806a7
PE
34592012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3460
3461 Fix race conditions involving setenv, gmtime, localtime, asctime.
3462 Without this fix, interrupts could mess up code that uses these
3463 nonreentrant functions, since setting TZ invalidates existing
3464 tm_zone or tzname values, and since most of these functions return
3465 pointers to static storage.
3466 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3467 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3468 Grow the critical sections to include not just invoking
3469 localtime/gmtime, but also accessing these functions' results
3470 including their tm_zone values if any, and any related TZ setting.
3471 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3472 so that the struct tm is saved in the critical section.
3473 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3474 motivated by the fact that memory allocation needs to be outside
3475 the critical section.
3476
0c16dfed
DA
34772012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3478
3479 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3480 with RESET_INTERVAL.
3481
3482 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3483 Remove duplicated buffer name initialization.
3484
3f83ace8
JM
34852012-05-02 Jim Meyering <jim@meyering.net>
3486
3487 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3488
c7b8541e
JM
3489 * xfns.c (x_window): Use xstrdup (Bug#11375).
3490
90207a15 34912012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3492
3493 * xdisp.c (pos_visible_p): If already at a newline from the
3494 display string before the 'while' loop, don't walk back the glyphs
3495 from it3.glyph_row. Solves assertion violation when the display
3496 string begins with a newline (egg.el). (Bug#11367)
3497
b593d6a9
AH
34982012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3499
3500 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3501 Move to simple.el.
3502
4737362e
GM
35032012-05-01 Glenn Morris <rgm@gnu.org>
3504
99cf43f9
GM
3505 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3506 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3507 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3508 All were removed before 23.1.
3509
9311dcff
GM
3510 * dispnew.c: Remove HAVE_LIBNCURSES test;
3511 it is always true on relevant platforms.
3512
4d5c6349
GM
3513 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3514 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3515
4737362e
GM
3516 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3517
74dd3a6b
AS
35182012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3519
3520 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3521 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3522 Remove.
3523
13c379ee
PE
35242012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3525
3526 Do not avoid creating empty evaporating overlays (Bug#9642).
3527 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3528 That is, do not delete an evaporating overlay if it becomes
3529 empty after its bounds are adjusted to fit within its buffer.
3530 This fix caused other problems, and I'm reverting it until we get
3531 to the bottom of them.
3532
a8e7d6d7 35332012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3534
3535 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3536
a8e7d6d7 35372012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3538
3539 * xdisp.c (pos_visible_p): If the window start position is beyond
3540 ZV, start the display from buffer beginning. Prevents assertion
3541 violation in init_iterator when the minibuffer window is scrolled
3542 via the scroll bar.
3543
3544 * window.c (window_scroll_pixel_based): Likewise.
3545
a8e7d6d7 35462012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3547
3548 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3549
a8e7d6d7 35502012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3551
3552 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3553 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3554
a8e7d6d7 35552012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3556
b593d6a9
AH
3557 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3558 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3559
1c6900d9
EZ
35602012-04-26 Eli Zaretskii <eliz@gnu.org>
3561
4c3fa1d9
EZ
3562 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3563 display element, check also the underlying string or buffer
3564 character. (Bug#11341)
3565
1c6900d9
EZ
3566 * w32menu.c: Include w32heap.h.
3567 (add_menu_item): If the call to AppendMenuW (via
3568 unicode_append_menu) fails, disable Unicode menus only if we are
3569 running on Windows 9X/Me.
3570
42bf8205
AS
35712012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3572
3573 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3574 (xgetint): Add missing shift for LSB tags.
3575
b1bac16e
MR
35762012-04-24 Martin Rudalics <rudalics@gmx.at>
3577
3578 * keyboard.c (read_char): Don't wipe echo area for select window
3579 events: These might get delayed via `mouse-autoselect-window'
3580 (Bug#11304).
3581
d69621cc
JB
35822012-04-24 Juanma Barranquero <lekktu@gmail.com>
3583
3584 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3585 manipulation of :loaded-from data.
3586
02fd101b
JB
35872012-04-23 Juanma Barranquero <lekktu@gmail.com>
3588
3589 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3590 now a cons (bug#11311).
3591
888bec30
PE
35922012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3593
89a438bd
PE
3594 Do not create empty overlays with the evaporate property (Bug#9642).
3595 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3596 if it becomes empty after its bounds are adjusted to fit within
3597 its buffer. Without this fix, in a nonempty buffer (let ((o
3598 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3599 yields an empty overlay that has the evaporate property, which is
3600 not supposed to happen.
3601
1068fe4d
PE
3602 Fix minor GTK3 problems found by static checking.
3603 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3604 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3605 (struct _EmacsFixedClass, emacs_fixed_get_type):
3606 Move decls here from emacsgtkfixed.h, since they needn't be public.
3607 (emacs_fixed_get_type): Now static.
3608 (emacs_fixed_class_init): Omit unused local.
3609 (emacs_fixed_child_type): Remove; unused.
3610 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3611 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3612 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3613 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3614 (EMACS_FIXED_GET_CLASS): Remove; unused.
3615 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3616
888bec30
PE
3617 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3618 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3619
de85e130
PE
36202012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3621
d0baac98 3622 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 3623 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
3624 (__malloc_size_t, __malloc_ptrdiff_t):
3625 Remove. All uses removed, replaced by the definiens if needed,
3626 since we can assume C89 or better now.
3627 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3628 (protect_malloc_state, align, get_contiguous_space)
3629 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3630 (malloc_atfork_handler_child, malloc_enable_thread)
3631 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3632 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3633 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3634 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3635 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3636 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3637 Define using prototypes, not old style.
3638 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3639 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3640 (align): Don't assume that signed integer overflow wraps around.
3641 Omit unused local var.
3642 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3643 (_free_internal_nolock, memalign, mallochook, reallochook):
3644 Omit no-longer-needed casts.
3645 (valloc): Use getpagesize, not __getpagesize.
3646 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3647 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3648
de85e130
PE
3649 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3650
dcbf5805
MA
36512012-04-22 Michael Albinus <michael.albinus@gmx.de>
3652
3653 Move functions from C to Lisp. Make non-blocking method calls
3654 the default. Implement further D-Bus standard interfaces.
3655
3656 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3657 (QCdbus_request_name_allow_replacement)
3658 (QCdbus_request_name_replace_existing)
3659 (QCdbus_request_name_do_not_queue)
3660 (QCdbus_request_name_reply_primary_owner)
3661 (QCdbus_request_name_reply_in_queue)
3662 (QCdbus_request_name_reply_exists)
3663 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3664 (QCdbus_registered_serial, QCdbus_registered_method)
3665 (QCdbus_registered_signal): New Lisp objects.
3666 (XD_DEBUG_MESSAGE): Use sizeof.
3667 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3668 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3669 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3670 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3671 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3672 (xd_signature, xd_append_arg): Allow float for integer types.
3673 (xd_get_connection_references): New function.
b593d6a9
AH
3674 (xd_get_connection_address): Rename from xd_initialize.
3675 Return cached address.
dcbf5805
MA
3676 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3677 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
3678 level.
3679 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 3680 Return number of refcounts.
dcbf5805
MA
3681 (Fdbus_get_unique_name): Make stronger parameter check.
3682 (Fdbus_message_internal): New defun.
3683 (Fdbus_call_method, Fdbus_call_method_asynchronously)
3684 (Fdbus_method_return_internal, Fdbus_method_error_internal)
3685 (Fdbus_send_signal, Fdbus_register_service)
3686 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3687 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3688 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3689 (Vdbus_compiled_version, Vdbus_runtime_version)
3690 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3691 (Vdbus_message_type_method_return, Vdbus_message_type_error)
3692 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
3693 (Vdbus_registered_buses, Vdbus_registered_objects_table):
3694 Adapt docstring.
dcbf5805 3695
52828e02
PE
36962012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3697
da05bc4c
PE
3698 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3699 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3700 Do not assume ptrdiff_t is the same width as 'int'.
3701
52828e02
PE
3702 * alloc.c: Handle unusual debugging option combinations.
3703 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3704 since the two debugging options are incompatible.
3705 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3706 is defined.
3707 (mem_init, mem_insert, mem_insert_fixup):
3708 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3709 (NEED_MEM_INSERT): Remove; no longer needed.
3710
f01769f9
LL
37112012-04-22 Leo Liu <sdl.web@gmail.com>
3712
3713 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3714
5790543d
PE
37152012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3716
3717 * sysdep.c [__FreeBSD__]: Minor cleanups.
3718 (list_system_processes, system_process_attributes) [__FreeBSD__]:
3719 Use Emacs indenting style more consistently. Avoid some casts.
3720 Use 'double' consistently rather than mixing 'float' and 'double'.
3721
b91b7e4d
EW
37222012-04-21 Eduard Wiebe <usenet@pusto.de>
3723
b593d6a9
AH
3724 * sysdep.c (list_system_processes, system_process_attributes):
3725 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 3726
6114eb15
AS
37272012-04-21 Andreas Schwab <schwab@linux-m68k.org>
3728
3729 * lisp.mk (lisp): Update.
3730
2f38dff7
PE
37312012-04-20 Paul Eggert <eggert@cs.ucla.edu>
3732
3733 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3734 It is never used otherwise.
3735
4ae29f89
SM
37362012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
3737
3738 * print.c (print_preprocess): Only check print_depth if print-circle
3739 is nil.
3740 (print_object): Check for cycles even when print-circle is nil and
3741 print-gensym is t, but only check print_depth if print-circle is nil.
3742
f30d612a
CY
37432012-04-20 Chong Yidong <cyd@gnu.org>
3744
3745 * process.c (wait_reading_process_output): If EIO occurs on a pty,
3746 set the status to "failed" and ensure that sentinel is run.
3747
c07a4c0b 37482012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
3749
3750 * process.c (Fset_process_inherit_coding_system_flag)
3751 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 3752 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 3753
c07a4c0b 37542012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
3755
3756 * xdisp.c (string_buffer_position_lim): Limit starting position to
3757 BEGV.
3758 (set_cursor_from_row): If called for a mode-line or header-line
3759 row, return zero immediately.
3760 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
3761 farther than the first row after the header line, if any.
3762 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
3763 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
3764
c07a4c0b 37652012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3766
4ae29f89
SM
3767 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3768 (bug#11238).
ad3a2b41 3769
c07a4c0b 37702012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 37712012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
3772
3773 configure: new option --enable-gcc-warnings (Bug#11207)
3774 * Makefile.in (C_WARNINGS_SWITCH): Remove.
3775 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3776 (ALL_CFLAGS): Use new macros rather than old.
3777 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3778 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
3779 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3780 -Wunused-result, -Wunused-variable. This should go away once
3781 the Emacs and Gnulib regex code is merged.
3782 (xmalloc, xrealloc): Now static.
3783
aba027e8
PE
37842012-04-17 Paul Eggert <eggert@cs.ucla.edu>
3785
3786 * dired.c (Fsystem_groups): Remove unused local.
3787
e5a36063
GM
37882012-04-17 Glenn Morris <rgm@gnu.org>
3789
3790 * dired.c (Fsystem_users): Doc fix.
3791
316411f0
DA
37922012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
3793
3794 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
3795 (syms_of_dired): Add them.
3796
9426aba4
PE
37972012-04-16 Paul Eggert <eggert@cs.ucla.edu>
3798
b62a57be
PE
3799 Fix minor alloc.c problems found by static checking.
3800 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3801 New extern decls, to avoid calling undeclared functions.
3802 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3803 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3804 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3805 (NEED_MEM_INSERT): New macro.
3806 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 3807 Remove one incorrect comment and fix another.
b62a57be 3808
3539f31f
PE
3809 Fix minor ralloc.c problems found by static checking.
3810 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3811 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3812 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3813 (r_alloc_sbrk): Now static.
3814
a041960a
PE
3815 Improve ralloc.c interface checking.
3816 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3817 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3818 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3819 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3820 [REL_ALLOC]: ... to here, to check interface.
3821 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3822 Remove decls. This fixes an "It stinks!".
3823
9426aba4
PE
3824 * alloc.c (which_symbols): Fix alignment issue / type clash.
3825
d55c12ed
AS
38262012-04-15 Andreas Schwab <schwab@linux-m68k.org>
3827
3828 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3829 (struct Lisp_Misc_Any): Likewise.
3830 (struct Lisp_Free): Likewise.
3831 * alloc.c (union aligned_Lisp_Symbol): Define.
3832 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3833 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3834 (union aligned_Lisp_Misc): Define.
3835 (MARKER_BLOCK_SIZE, struct marker_block): Use union
3836 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 3837 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 3838
b948ce8b
PE
38392012-04-14 Paul Eggert <eggert@cs.ucla.edu>
3840
3841 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3842 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3843 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3844 * s/netbsd.h, s/sol2-6.h:
3845 Remove definition of GC_MARK_STACK, since the default now works.
3846 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3847 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3848 no longer the default.
3849 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3850
35dc09a1 38512012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3852
35dc09a1
GM
3853 * lread.c (lisp_file_lexically_bound_p):
3854 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 3855
35dc09a1
GM
38562012-04-14 Eli Zaretskii <eliz@gnu.org>
3857
3858 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3859 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
3860
38612012-04-14 Jan Djärv <jan.h.d@swipnet.se>
3862
3863 * nsterm.m (constrainFrameRect): Always constrain when there is only
3864 one screen (Bug#10962).
3865
bcd86815
KB
38662012-04-13 Ken Brown <kbrown@cornell.edu>
3867
3868 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3869
c25df26e
RT
38702012-04-13 Reuben Thomas <rrt@sc3d.org>
3871
3872 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3873
0fc59f1e
DC
38742012-04-11 Daniel Colascione <dancol@dancol.org>
3875
3876 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3877 against is gone. It's better to use vfork now so that when Cygwin
3878 gains a new, working vfork, we use it automatically (bug#10398).
3879
de8c03dc
SM
38802012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3881
3882 * window.c (save_window_save): Obey window-point-insertion-type.
3883
2f097256
GM
38842012-04-11 Glenn Morris <rgm@gnu.org>
3885
3886 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3887
453b951e
SM
38882012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3889
3890 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3891
75f1671a 38922012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
3893
3894 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3895 (force_quit_count): New var.
3896 (handle_interrupt): Use it.
3897
2a8ce227
JB
38982012-04-10 Juanma Barranquero <lekktu@gmail.com>
3899
3900 * w32.c (w32_delayed_load): Record the full path of the library
3901 being loaded (bug#10424).
3902
935396c0
GM
39032012-04-09 Glenn Morris <rgm@gnu.org>
3904
05920a43
GM
3905 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3906 not just in the obarray, before snarfing them. (Bug#11036)
3907
935396c0
GM
3908 * Makefile.in ($(leimdir)/leim-list.el):
3909 Pass EMACS rather than BUILT_EMACS.
3910
a18ecafa
TZ
39112012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
3912
3913 * process.c (make_process):
3914 * process.h: Add integer `gnutls_handshakes_tried' member to
3915 process struct.
3916
6bbef4e5
JC
3917 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
3918 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
3919
3920 * gnutls.c (gnutls_log_function2i): Convenience log function.
3921 (emacs_gnutls_read): Use new log functions,
3922 `gnutls_handshakes_tried' process member, and
3923 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
3924 attempts per process (connection).
3925
b4d3bc10
CY
39262012-04-09 Chong Yidong <cyd@gnu.org>
3927
3928 * eval.c (Fuser_variable_p, user_variable_p_eh)
3929 (lisp_indirect_variable): Functions deleted.
3930 (Fdefvar): Caller changed.
3931
3932 * callint.c (Finteractive, Fcall_interactively):
3933 * minibuf.c (Fread_variable): Callers changed.
3934
70f4d973
EZ
39352012-04-09 Eli Zaretskii <eliz@gnu.org>
3936
3937 * xdisp.c (set_cursor_from_row): If the display string appears in
3938 the buffer at position that is closer to point than the position
3939 after the display string, display the cursor on the first glyph of
3940 the display string. Fixes cursor display when a 'display' text
3941 property immediately follows invisible text. (Bug#11094)
3942
cb3c2e3e
PE
39432012-04-09 Paul Eggert <eggert@cs.ucla.edu>
3944
3945 composite.c: use 'double' consistently
3946 * composite.c (get_composition_id): Use 'double' consistently
3947 instead of converting 'float' to 'double' and vice versa; this is
3948 easier to understand and avoids a GCC warning.
3949
fd06db5d
GM
39502012-04-09 Glenn Morris <rgm@gnu.org>
3951
50fe702a
GM
3952 * Makefile.in: Generate leim-list with bootstrap-emacs, in
3953 preparation for dumping it with emacs. (Bug#4789)
3954 (leimdir): New variable.
3955 ($(leimdir)/leim-list.el): New rule.
3956 (emacs$(EXEEXT)): Depend on leim-list.el.
3957
fd06db5d
GM
3958 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
3959 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
3960 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
3961
55c131ee
AS
39622012-04-08 Andreas Schwab <schwab@linux-m68k.org>
3963
3964 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
3965 proper alignment.
3966
9209588f
JB
39672012-04-07 Juanma Barranquero <lekktu@gmail.com>
3968
3969 * xml.c (init_libxml2_functions) [WINDOWSNT]:
3970 Remove unused local variable.
3971
e3fb2efb
PE
39722012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3973
3974 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
3975 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
3976 (mark_memory): Mark Lisp_Objects only if pointers might hide in
3977 objects, as mark_maybe_pointer will catch them otherwise.
3978 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
3979 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
3980
b5385551
PE
39812012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3982
3983 Fix typo that broke non-Windows builds.
3984 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
3985
9078ead6
EZ
39862012-04-07 Eli Zaretskii <eliz@gnu.org>
3987
3988 Support building on MS-Windows with libxml2.
3989
3990 * makefile.w32-in (OBJ2): Add xml.$(O).
3991 (GLOBAL_SOURCES): Add xml.c.
3992 ($(BLD)/xml.$(O)): New dependency list.
3993
3994 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
3995 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
3996 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
3997 [!WINDOWSNT]: New macros.
3998 (init_libxml2_functions, libxml2_loaded_p): New functions.
3999 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4000 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4001 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4002 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4003 linked in).
6bbef4e5
JC
4004 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4005 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4006 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4007
4008 * emacs.c: Don't include libxml/parser.h.
4009 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4010 xmlCleanupParser directly.
4011
4012 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4013
3811fdf3
EZ
40142012-04-07 Eli Zaretskii <eliz@gnu.org>
4015
4016 * indent.c (Fvertical_motion): If there is a display string at
4017 point, use it.vpos to compute how many lines to backtrack after
4018 move_it_to point. (Bug#11133)
4019
2f8e16b2
EZ
40202012-04-06 Eli Zaretskii <eliz@gnu.org>
4021
4022 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4023 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4024 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4025 macros related to unification of CJK characters. For the details,
4026 see the discussion following the message here:
4027 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4028
3d439cd1
CY
40292012-04-04 Chong Yidong <cyd@gnu.org>
4030
4031 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4032
8bc53d00
EZ
40332012-04-01 Eli Zaretskii <eliz@gnu.org>
4034
4035 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4036 instead of alloca. (Bug#11138)
4037
3b0512a3
AS
40382012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4039
4040 * w32menu.c (is_simple_dialog): Properly check lisp types.
4041 (Bug#11141)
4042
8427ddd2
EZ
40432012-03-31 Eli Zaretskii <eliz@gnu.org>
4044
979022ef
EZ
4045 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4046 position we get to after a call to move_it_to fails the
4047 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4048 only if we wind up in a string from display property. (Bug#11063)
4049
a6b1c7cc
EZ
4050 * window.c (Fdelete_other_windows_internal): Invalidate the row
4051 and column information about mouse highlight, so that redisplay
4052 restores it after reallocating the glyph matrices. (Bug#7464)
4053
8427ddd2
EZ
4054 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4055 string comes from a `display' text property, use the buffer
4056 position of that property as if we actually saw that position in
4057 the row's glyphs.
697ba24b
EZ
4058 (move_it_by_lines): Remove the assertion that
4059 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4060 violated when there's a before-string at the beginning of a line.
4061 (Bug#11063)
8427ddd2 4062
65a0a738
EZ
40632012-03-30 Eli Zaretskii <eliz@gnu.org>
4064
4065 * xdisp.c (append_space_for_newline): If the default face was
4066 remapped, use the remapped face for the appended newline.
4067 (extend_face_to_end_of_line): Use the remapped default face for
4068 extending the face to the end of the line.
4069 (display_line): Call extend_face_to_end_of_line when the default
4070 face was remapped. (Bug#11068)
4071
581355cc
EZ
40722012-03-29 Eli Zaretskii <eliz@gnu.org>
4073
4074 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4075
e8fc049f
SM
40762012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4077
4078 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4079
4fb9a543
GM
40802012-03-27 Glenn Morris <rgm@gnu.org>
4081
4082 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4083 Doc fixes.
4084
679910f1
KH
40852012-03-26 Kenichi Handa <handa@m17n.org>
4086
4087 * dispextern.h (struct glyph): Fix previous change. Change the
4088 bit length of glyphless.ch to 25 (Bug#11082).
4089
90d49b7f
CY
40902012-03-26 Chong Yidong <cyd@gnu.org>
4091
4092 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4093 (command_loop_1): Use it; inhibit selection update for
4094 handle-select-window too (Bug#8996).
4095
f514f6f0
FP
40962012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4097
e8fc049f 4098 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4099
bf43fa51
KH
41002012-03-25 Kenichi Handa <handa@m17n.org>
4101
4102 * dispextern.h (struct glyph): Change the bit length of
4103 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4104
8a0c01dd
EZ
41052012-03-24 Eli Zaretskii <eliz@gnu.org>
4106
4107 * s/ms-w32.h (tzname): Include time.h before redirecting to
4108 _tzname. Fixes the MSVC build. (Bug#9960)
4109
7d1c3a76
AS
41102012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4111
8ed79523
AS
4112 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4113 characters.
4114
7d1c3a76
AS
4115 * xterm.c (XTread_socket): Only modify handling_signal if
4116 !SYNC_INPUT. (Bug#11080)
4117
e99a9b8b
EZ
41182012-03-23 Eli Zaretskii <eliz@gnu.org>
4119
4120 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4121 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4122 when fetching a multibyte character consumes more bytes than
4123 CHAR_BYTES returns, due to unification of CJK characters in
4124 string_char. (Bug#11073)
4125
5063c0e1
TN
41262012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4127
4128 * process.c (wait_reading_process_output): Handle pty disconnect
4129 by refraining from sending oneself a SIGCHLD (bug#10933).
4130
9f851fbd
CY
41312012-03-22 Chong Yidong <cyd@gnu.org>
4132
4133 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4134
5063c0e1 4135 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4136 Mark string as coming from a prefix property.
4137 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4138 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4139
fb5b8aca
CY
41402012-03-21 Chong Yidong <cyd@gnu.org>
4141
4142 * xfaces.c (Vface_remapping_alist): Doc fix.
4143
62356a1b
EZ
41442012-03-20 Eli Zaretskii <eliz@gnu.org>
4145
4146 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4147 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4148 Doc fixes.
62356a1b 4149
025de85b
CY
41502012-03-20 Chong Yidong <cyd@gnu.org>
4151
4152 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4153 to reflect default non-nil value of redisplay-dont-pause.
4154
4827f94e
KH
41552012-03-19 Kenichi Handa <handa@m17n.org>
4156
4157 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4158 it fit in a valid range (Bug#11003).
4159
e50a24a2
EZ
41602012-03-18 Eli Zaretskii <eliz@gnu.org>
4161
4162 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4163 that is not from display property, accept the row as a "cursor
4164 row" if one of the string's character has a non-nil `cursor'
4165 property. Fixes cursor positioning when there are newlines in
4166 overlay strings, e.g. in icomplete.el. (Bug#11035)
4167
9af5ed87
PE
41682012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4169
4170 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4171
d1f55f16
CY
41722012-03-12 Chong Yidong <cyd@gnu.org>
4173
4174 * eval.c (inhibit_lisp_code): Rename from
4175 inhibit_window_configuration_change_hook; move from window.c.
4176
4177 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4178 * window.c (run_window_configuration_change_hook)
4179 (syms_of_window): Callers changed.
4180
66c5eebd
CY
41812012-03-11 Chong Yidong <cyd@gnu.org>
4182
413df973
CY
4183 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4184
66c5eebd
CY
4185 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4186
1de11f56
CY
41872012-03-10 Chong Yidong <cyd@gnu.org>
4188
4189 * frame.c (other_visible_frames): Don't assume the selected frame
4190 is visible (Bug#10955).
4191
cae07000
SM
41922012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4193
4194 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4195
89c94350
JD
41962012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4197
4198 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4199 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4200 zero (Bug#10954).
4201
999dd333
GM
42022012-03-03 Glenn Morris <rgm@gnu.org>
4203
01a6dcc8 4204 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4205
de0100f2
EZ
42062012-03-02 Eli Zaretskii <eliz@gnu.org>
4207
4208 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4209 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4210 (redisplay_window, next_element_from_string): Fix typos in
4211 comments.
3e441275
EZ
4212 (redisplay_window): Pass to move_it_vertically the margin in
4213 pixels, not in screen lines.
de0100f2 4214
96a72ee9
GM
42152012-03-02 Glenn Morris <rgm@gnu.org>
4216
4217 * buffer.c (buffer-list-update-hook): Doc fix.
4218
312508d7
EZ
42192012-02-29 Eli Zaretskii <eliz@gnu.org>
4220
4221 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4222 push_it before setting up the iterator for the first overlay
4223 string, even if we have an empty string loaded.
4224 (next_overlay_string): If there's an empty string on the iterator
4225 stack, pop the stack. (Bug#10903)
4226
27f3c637
PE
42272012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4228
4229 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4230 Suggested by Stefan Monnier in
4231 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4232 * alloc.c (widen_to_Lisp_Object): New static function.
4233 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4234 and widening them to Lisp_Objects. This would work even if
4235 USE_LSB_TAG is defined and wide integers are used, which might
4236 happen in a future version of Emacs.
4237
3c9dfce6
CY
42382012-02-25 Chong Yidong <cyd@gnu.org>
4239
fa74b241
CY
4240 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4241 Doc fix.
4242
3c9dfce6
CY
4243 * xselect.c (Fx_selection_exists_p): Doc fix.
4244 (x_clipboard_manager_save_all): Print an informative message
4245 before saving to clipboard manager.
4246
9486df08
CY
42472012-02-24 Chong Yidong <cyd@gnu.org>
4248
4249 * keyboard.c (process_special_events): Handle all X selection
4250 requests in kbd_buffer, not just the next one (Bug#8869).
4251
f01d3321
CY
42522012-02-23 Chong Yidong <cyd@gnu.org>
4253
4254 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4255 call when setting menu-bar-lines and tool-bar-lines parameters.
4256 (unwind_create_frame_1): New helper function.
4257
4258 * window.c (inhibit_window_configuration_change_hook): New var.
4259 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4260 (syms_of_window): Initialize it.
f01d3321 4261
86b847b6
CY
42622012-02-22 Chong Yidong <cyd@gnu.org>
4263
4264 * xterm.c (x_draw_image_relief): Add missing type check for
4265 Vtool_bar_button_margin (Bug#10743).
4266
a59225b1
CY
42672012-02-21 Chong Yidong <cyd@gnu.org>
4268
4269 * fileio.c (Vfile_name_handler_alist): Doc fix.
4270
4271 * buffer.c (Fget_file_buffer): Protect against invalid file
4272 handler return value.
4273
310f5bd4
PE
42742012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4275
cb3a28cc
PE
4276 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4277 when computing $valmask.
4278
310f5bd4
PE
4279 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4280 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4281 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4282 It's useless in that case, and it can cause problems on hosts
4283 that allocate halves of EMACS_INT values separately.
4284 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4285 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4286 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4287 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4288 it avoids undefined behavior on hosts where shifting right by more
4289 than the word width has undefined behavior.
4290
2375c96a
CY
42912012-02-19 Chong Yidong <cyd@gnu.org>
4292
4293 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4294 (Funhandled_file_name_directory, Ffile_name_as_directory)
4295 (Fdirectory_file_name, Fexpand_file_name)
4296 (Fsubstitute_in_file_name): Protect against invalid file handler
4297 return values (Bug#10845).
4298
3eb49e71
EZ
42992012-02-18 Eli Zaretskii <eliz@gnu.org>
4300
4301 * .gdbinit (pitx): Fix incorrect references to fields of the
4302 iterator stack.
4303
7b926f3f
CY
43042012-02-17 Chong Yidong <cyd@gnu.org>
4305
4306 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4307
11273115
PE
43082012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4309
4310 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4311 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4312
c3a70e2b
CY
43132012-02-15 Chong Yidong <cyd@gnu.org>
4314
4315 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4316 marked as special. Also, starting docstrings with * is obsolete.
4317
0ca43699
AS
43182012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4319
4320 * gnutls.c (emacs_gnutls_write): Fix last change.
4321
2e8f3c56
LI
43222012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4323
4324 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4325 send_process.
4326
af70074f
SM
43272012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4328
4329 * keymap.c (Fsingle_key_description): Handle char ranges.
4330
95986d52
CY
43312012-02-12 Chong Yidong <cyd@gnu.org>
4332
afd83bd1
CY
4333 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4334 as that creates a dangerous corner case.
4335
95986d52
CY
4336 * window.c (Fdelete_window_internal): Invalidate the mouse
4337 highlight (Bug#9904).
4338
bd7da63e
GM
43392012-02-12 Glenn Morris <rgm@gnu.org>
4340
4341 * xselect.c (Fx_own_selection_internal)
4342 (Fx_get_selection_internal, Fx_disown_selection_internal)
4343 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4344 * nsselect.m (Fx_own_selection_internal)
4345 (Fx_disown_selection_internal, Fx_selection_exists_p)
4346 (Fx_selection_owner_p, Fx_get_selection_internal):
4347 Sync docs and argument specs with the xselect.c versions.
4348
77abcbc2
LI
43492012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4350
4351 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4352
90b671e2
EZ
43532012-02-11 Eli Zaretskii <eliz@gnu.org>
4354
1c0ca0b7
EZ
4355 * w32select.c (Fx_selection_exists_p): Sync doc string and
4356 argument list with xselect.c. (Bug#10783)
4357
4358 * w16select.c (Fx_selection_exists_p): Sync doc string and
4359 argument list with xselect.c. (Bug#10783)
90b671e2 4360
49241268
GM
43612012-02-10 Glenn Morris <rgm@gnu.org>
4362
4363 * fns.c (Fsecure_hash): Doc fix.
4364
f998bbe7 43652012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4366
4367 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4368
0992bd9c
CY
43692012-02-07 Chong Yidong <cyd@gnu.org>
4370
4371 * buffer.c (Fbuffer_local_variables)
4372 (buffer_lisp_local_variables): Handle unbound vars correctly;
4373 don't let Qunbound leak into Lisp.
4374
af008560
GM
43752012-02-07 Glenn Morris <rgm@gnu.org>
4376
dd605cc4
GM
4377 * image.c (Fimagemagick_types): Doc fix.
4378
af008560
GM
4379 * image.c (imagemagick-render-type): Change it from a lisp object
4380 to an integer. Move the doc here from the lisp manual.
4381 Treat all values not equal to 0 the same.
4382
1449fa1d
CY
43832012-02-06 Chong Yidong <cyd@gnu.org>
4384
4385 * doc.c (store_function_docstring): Avoid applying docstring of
4386 alias to base function (Bug#2603).
4387
3723ec07
AS
43882012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4389
4390 * .gdbinit (pp1, pv1): Remove redundant defines.
4391 (pr): Use pp.
4392
79c1cc1e
CY
43932012-02-04 Chong Yidong <cyd@gnu.org>
4394
4395 * nsterm.m: Declare a global (Bug#10694).
4396
d7f29f8e
EZ
43972012-02-04 Eli Zaretskii <eliz@gnu.org>
4398
cae07000
SM
4399 * w32.c (get_emacs_configuration_options):
4400 Include --enable-checking, if specified, in the return value.
d7f29f8e 4401
3b95a6f9
MR
44022012-02-04 Martin Rudalics <rudalics@gmx.at>
4403
4404 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4405 after rounding frame sizes. (Bug#9723)
4406
d6fa96a6
EZ
44072012-02-04 Eli Zaretskii <eliz@gnu.org>
4408
4409 * keyboard.c (adjust_point_for_property): Don't position point
4410 before BEGV. (Bug#10696)
4411
df0b2940
PE
44122012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4413
4414 Handle overflow when computing char display width (Bug#9496).
4415 * character.c (char_width): Return EMACS_INT, not int.
4416 (char_width, c_string_width): Check for overflow when
4417 computing the width; this is possible now that individual
4418 characters can have unbounded width. Problem introduced
4419 by merge from Emacs 23 on 2012-01-19.
4420
6bee44d6
MA
44212012-02-02 Michael Albinus <michael.albinus@gmx.de>
4422
4423 * dbusbind.c (Fdbus_register_method): Mention the return value
4424 :ignore in the docstring.
4425
44f92739
GM
44262012-02-02 Glenn Morris <rgm@gnu.org>
4427
1b9f60cc
GM
4428 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4429
44f92739
GM
4430 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4431 Unconditionally set to t. (Bug#10673)
4432 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4433 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4434 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4435
c5d3843c
KH
44362012-02-02 Kenichi Handa <handa@m17n.org>
4437
4438 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4439 0, do not call append_composite_glyph.
4440
159462d4 44412012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4442
4443 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4444 NULL (Bug#6988).
4445 (x_produce_glyphs): If the component of a composition is a null
4446 string, set it->pixel_width to 1 to avoid zero-width glyph.
4447
78cef877
EZ
44482012-02-01 Eli Zaretskii <eliz@gnu.org>
4449
4450 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4451 first 2 arguments are identical. This makes inserting large
4452 output from a subprocess an order of magnitude faster on
4453 MS-Windows, where all sbrk'ed memory is always contiguous.
4454
97897668
GM
44552012-01-31 Glenn Morris <rgm@gnu.org>
4456
4457 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4458 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4459 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4460
31fd3586
GM
44612012-01-29 Glenn Morris <rgm@gnu.org>
4462
4463 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4464
0e24a8b2
CY
44652012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4466
4467 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4468
cc0adcb0
CY
44692012-01-28 Chong Yidong <cyd@gnu.org>
4470
4471 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4472
acc28cb9
CY
44732012-01-26 Chong Yidong <cyd@gnu.org>
4474
9c69cfb7
CY
4475 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4476
acc28cb9
CY
4477 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4478 repeat counts (Bug#10507).
4479
48da7392
GM
44802012-01-26 Glenn Morris <rgm@gnu.org>
4481
4482 * lread.c (syms_of_lread): Doc fix.
4483
14af5f7f
CY
44842012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4485
4486 * coding.c (encode_designation_at_bol): Change return value to
4487 EMACS_INT.
4488
0b21c100
CY
44892012-01-25 Chong Yidong <cyd@gnu.org>
4490
4491 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4492
3c2907f7
CY
44932012-01-21 Chong Yidong <cyd@gnu.org>
4494
4495 * floatfns.c (Fcopysign): Make the second argument non-optional,
4496 since nil is not allowed anyway.
4497
959ad23f
AS
44982012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4499
4500 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4501 (send_process): Likewise.
4502
34a02f46
MR
45032012-01-19 Martin Rudalics <rudalics@gmx.at>
4504
4505 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4506 (Vwindow_persistent_parameters): Do not use Qstate.
4507 Rewrite doc-strings.
34a02f46 4508
1259009a 45092012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4510
4511 * character.c (char_width): New function.
70d4fdf6
GM
4512 (Fchar_width, c_string_width, lisp_string_width):
4513 Use char_width (Bug#9496).
25ed9e61 4514
6a6ee00d
MR
45152012-01-16 Martin Rudalics <rudalics@gmx.at>
4516
4517 * window.c (Vwindow_persistent_parameters): New variable.
4518 (Fset_window_configuration, save_window_save): Handle persistent
4519 window parameters.
4520
c85efaf7
EZ
45212012-01-14 Eli Zaretskii <eliz@gnu.org>
4522
4523 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4524 thrashing the stack of the thread. (Bug#9087)
4525
5944709e
PE
45262012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4529
e71f5d99
EZ
45302012-01-11 Eli Zaretskii <eliz@gnu.org>
4531
4532 * xdisp.c (rows_from_pos_range): Handle the case where the
4533 highlight ends on a newline. (Bug#10464)
4534 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4535 he end column for display of highlight that ends on a newline
4536 before a R2L line.
4537
ce316182
GM
45382012-01-11 Glenn Morris <rgm@gnu.org>
4539
4540 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4541 from load-path also when installation-directory is nil. (Bug#10208)
4542
5b43da69
GM
45432012-01-10 Glenn Morris <rgm@gnu.org>
4544
74cc8ff9
GM
4545 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4546
7d8d6e4e
GM
4547 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4548 Update template values to be closer to their typical values these days.
5b43da69 4549
a0db8d43
EZ
45502012-01-09 Eli Zaretskii <eliz@gnu.org>
4551
4552 * xdisp.c (rows_from_pos_range): Accept additional argument
4553 DISP_STRING, and accept any glyph in a row whose object is that
4554 string as eligible for mouse highlight. Fixes mouse highlight of
4555 display strings from overlays. (Bug#10464)
4556
9a0115ab 45572012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4558
b9110d6a 4559 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4560 * fileio.c (auto_saving_dir_umask): New static var.
4561 (Fmake_directory_internal): Use it.
4562 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4563 creating the directory. The old code temporarily assigns
4564 too-generous permissions to the directory.
4565 (do_auto_save_eh): Clear it.
b9110d6a 4566 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4567 that the var is always cleared.
4568
6c1bd3f3
EZ
45692012-01-07 Eli Zaretskii <eliz@gnu.org>
4570
4571 * search.c (scan_buffer): Pass character positions to
4572 know_region_cache, not byte positions. (Bug#6540)
4573
069d2b50
L
45742012-01-07 LynX <_LynX@bk.ru> (tiny change)
4575
4576 * w32.c (sys_rename): Report EXDEV when rename of a directory
4577 fails because the target is on another logical disk. (Bug#10284)
4578
75bf0d33
DB
45792012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4580
4581 * xterm.c (x_embed_request_focus): New function.
4582
4583 * xterm.h: Add prototype.
4584
4585 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4586
1c6e5a32
GM
45872012-01-05 Glenn Morris <rgm@gnu.org>
4588
4589 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4590
651e947e
EZ
45912012-01-01 Eli Zaretskii <eliz@gnu.org>
4592
4593 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4594 Load gnutls_transport_set_lowat only if GnuTLS version is below
4595 2.11.1.
4596 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4597 GnuTLS versions below 2.11.1.
4598
3778cdd8
AL
45992011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4600
4601 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4602 to the doc string advising against its use for altering the way
4603 windows are scrolled.
4604
0e5317f7
KH
46052011-12-28 Kenichi Handa <handa@m17n.org>
4606
4607 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4608 coding-system ASCII compatible only when it does not produce BOM
4609 on encoding (Bug#10383).
4610
93d5ca1f
JD
46112011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4612
4613 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4614 can scroll.
4615 (create_and_show_popup_menu): Always use menu_position_func for
4616 Gtk3 (Bug#10361).
4617
ca22b785
AS
46182011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4619
4620 * callint.c (Fcall_interactively): Don't truncate prompt string.
4621
d048e1e6
EZ
46222011-12-23 Eli Zaretskii <eliz@gnu.org>
4623
4624 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4625 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 4626 resumed from there (after widening). (Bug#10360)
d048e1e6 4627
5ccaba1f
JD
46282011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4629
4630 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4631
204ee57f
JD
46322011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4633
b81d40f0
JB
4634 * nsterm.m (x_free_frame_resources):
4635 Release f->output_data.ns->miniimage.
204ee57f
JD
4636 (ns_index_color): Fix indentation. Do not retain
4637 color_table->colors[i].
4638
4639 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4640 before returning.
4641
4642 * nsfns.m (x_set_background_color): Assign return value from
4643 ns_index_color to face-background instead of NSColor*.
4644 (ns_implicitly_set_icon_type): Fix indentation.
4645 Change assignment in for loop to comparison.
4646
4647 * emacs.c (ns_pool): New variable.
4648 (main): Assign ns_pool.
4649 (Fkill_emacs): Call ns_release_autorelease_pool.
4650
4651 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4652 autorelease fdesc, release fdAttrs and tdict.
4653 (ns_get_covering_families): Release charset.
4654 (ns_findfonts): Release NSFontDescriptor created with new.
4655 (ns_uni_to_glyphs): Fix indentation.
4656 (setString): Release attrStr before assigning new value.
4657
c803b2b7
JD
46582011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4659
678f4426
JD
4660 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4661 and NS_IMPL_COCOA.
4662 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4663 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4664
cd394be1 46652011-12-18 David Reitter <reitter@cmu.edu>
678f4426 4666
5fecd5fc
JD
4667 * nsterm.m (ns_term_init): Subscribe for notifications
4668 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4669 to method trackingNotification in EmacsMenu.
4670
4671 * nsmenu.m (trackingMenu): New variable.
3771cb17 4672 (trackingNotification): New method (from Aquamacs).
5fecd5fc 4673 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 4674 from Aquamacs (Bug#7030).
678f4426
JD
4675
46762011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 4677
c803b2b7
JD
4678 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4679 (symbol_to_nsstring): Fix indentation.
4680 (ns_symbol_to_pb): New function.
cae07000
SM
4681 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4682 (Fns_rotate_cut_buffers_internal): Remove.
4683 (Fns_store_selection_internal): Rename from
c803b2b7
JD
4684 Fns_store_cut_buffer_internal.
4685 (ns_get_foreign_selection, Fx_own_selection_internal)
4686 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
4687 (Fns_get_selection_internal, Fns_store_selection_internal):
4688 Use ns_symbol_to_pb and check if return value is nil.
4689 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
4690 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
4691 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4692 renamed to Sns_store_selection_internal.
4693 (ns_handle_selection_request): Move code to Fx_own_selection_internal
4694 and remove this function.
4695 (ns_handle_selection_clear): Remove, never used.
4696 (Fx_own_selection_internal): Move code from ns_handle_selection_request
4697 here.
4698
e1b01a3a
KB
46992011-12-17 Ken Brown <kbrown@cornell.edu>
4700
4701 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4702 GID is unknown (Bug#10257).
4703
2adb6e85
PE
47042011-12-17 Paul Eggert <eggert@cs.ucla.edu>
4705
4706 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4707 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4708 which caused a build failure on GNU/Linux IA-64. This problem was
4709 introduced by my 2011-10-07 patch.
4710
d1d7b339
JL
47112011-12-15 Juri Linkov <juri@jurta.org>
4712
4713 * image.c (imagemagick_error): New function. (Bug#10112)
4714 (imagemagick_load_image): Comment out `MagickSetResolution' call.
4715 Use `imagemagick_error' where ImageMagick functions return
4716 `MagickFalse'.
4717 (Fimagemagick_types): Add `Fnreverse' to return the list in the
4718 proper order.
4719
100d5755
KH
47202011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4721
4722 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4723 fill background (Bug#8992).
4724
454592a6
MR
47252011-12-13 Martin Rudalics <rudalics@gmx.at>
4726
4727 * window.c (Vwindow_combination_resize)
4728 (Vwindow_combination_limit): Use t instead of non-nil in
4729 doc-strings.
61d4b438
MR
4730 (Vrecenter_redisplay): Add first sentence of doc-string on
4731 separate line.
53524d93 4732 (Frecenter): Fix doc-string typo.
454592a6 4733
3633e3aa
KH
47342011-12-11 Kenichi Handa <handa@m17n.org>
4735
4736 * coding.c (Funencodable_char_position): Pay attention to the
4737 buffer text relocation (Bug#9389).
4738
7b9d523a 47392011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 4740
7b9d523a
JD
4741 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4742 gtk_init (Bug#10100).
4743
b73189c6
EZ
47442011-12-10 Eli Zaretskii <eliz@gnu.org>
4745
4746 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4747 IT->string is nil. (Bug#10263)
4748
f7dfe5d6
JD
47492011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4750
83faebb4
JD
4751 * nsterm.h (x_free_frame_resources): Declare.
4752
f7dfe5d6
JD
4753 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4754 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4755
4756 * nsterm.h (ns_get_defaults_value): Declare.
4757
4758 * nsterm.m (ns_default): Call ns_get_defaults_value.
4759
7cd4e72c
EZ
47602011-12-09 Eli Zaretskii <eliz@gnu.org>
4761
4762 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4763 (Bug#10170)
4764
b34d7317
YM
47652011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4766
4767 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4768 that where the value of an _OBJC_* symbol points to is in the .bss
4769 section (Bug#10240).
4770
76470ad1
KH
47712011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4772
4773 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 4774 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 4775
745fff94
KH
47762011-12-08 Kenichi Handa <handa@m17n.org>
4777
4778 * ftfont.c (get_adstyle_property): Fix previous change
4779 (Bug#10233).
4780
6e44397c
JB
47812011-12-07 Juanma Barranquero <lekktu@gmail.com>
4782
4783 * w32.c (init_environment): If no_site_lisp, remove site-lisp
4784 dirs from the default value of EMACSLOADPATH (bug#10208).
4785
7efa6272
GM
47862011-12-07 Glenn Morris <rgm@gnu.org>
4787
4788 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4789 installation and source directories as well. (Bug#10208)
4790
f6fc4d87
CY
47912011-12-06 Chong Yidong <cyd@gnu.org>
4792
4793 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4794
2bf26180
GM
47952011-12-06 Glenn Morris <rgm@gnu.org>
4796
4797 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4798 as an error, not just -1. (Bug#10217)
4799
3a6ad4f0
CY
48002011-12-05 Chong Yidong <cyd@gnu.org>
4801
4802 * keyboard.c (process_special_events): New function.
4803 (swallow_events, Finput_pending_p): Use it (Bug#10195).
4804
75a3b399
PE
48052011-12-05 Paul Eggert <eggert@cs.ucla.edu>
4806
4807 * coding.c (encode_designation_at_bol): Don't use uninitialized
4808 local variable (Bug#9318).
4809
c3c9e25e
KH
48102011-12-05 Kenichi Handa <handa@m17n.org>
4811
4812 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4813 return Qnil (Bug#8046, Bug#10193).
4814
5eb05ea3
KH
48152011-12-05 Kenichi Handa <handa@m17n.org>
4816
4817 * coding.c (encode_designation_at_bol): New args charbuf_end and
4818 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
4819 (coding_set_source): Return how many bytes coding->source was
4820 relocated.
4821 (coding_set_destination): Return how many bytes
4822 coding->destination was relocated.
4823 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 4824 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
4825
48262011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4827
4828 * coding.c (CODING_CHAR_CHARSET_P): New macro.
4829 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4830 macro (Bug#9318).
4831
48322011-12-05 Andreas Schwab <schwab@linux-m68k.org>
4833
4834 The following changes are to fix Bug#9318.
4835
a79703f5 4836 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
4837 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4838 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 4839 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 4840
7dbda6df
JB
48412011-12-05 Juanma Barranquero <lekktu@gmail.com>
4842
4843 * lisp.h (process_quit_flag): Fix external declaration.
4844
6d5eb5b0
SM
48452011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
4846
4847 Don't macro-inline non-performance-critical code.
4848 * eval.c (process_quit_flag): New function.
4849 * lisp.h (QUIT): Use it.
4850
a0c3fad0
JD
48512011-12-04 Jan Djärv <jan.h.d@swipnet.se>
4852
4853 * nsfns.m (get_geometry_from_preferences): New function.
4854 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4855
6c07aac2
AS
48562011-12-04 Andreas Schwab <schwab@linux-m68k.org>
4857
4858 * emacs.c (Qkill_emacs): Define.
4859 (syms_of_emacs): Initialize it.
4860 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4861 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
4862 (quit_throw_to_read_char): Add parameter `from_signal'.
4863 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
4864 * lisp.h (QUIT): Call Fkill_emacs if requested.
4865
c052ead4
JD
48662011-12-03 Jan Djärv <jan.h.d@swipnet.se>
4867
4868 * widget.c (update_wm_hints): Return if wmshell is null.
4869 (widget_update_wm_size_hints): New function.
4870
4871 * widget.h (widget_update_wm_size_hints): Declare.
4872
4873 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4874 widget_update_wm_size_hints (Bug#10104).
4875
9e49252b
EZ
48762011-12-03 Eli Zaretskii <eliz@gnu.org>
4877
4878 * xdisp.c (handle_invisible_prop): If the invisible text ends just
4879 before a newline, prepare the bidi iterator for consuming the
4880 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 4881 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 4882
02b16839
JL
48832011-12-02 Juri Linkov <juri@jurta.org>
4884
4885 * search.c (Fword_search_regexp): New Lisp function created from
4886 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
4887 (Fword_search_backward, Fword_search_forward)
4888 (Fword_search_backward_lax, Fword_search_forward_lax):
4889 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
4890 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
4891
0068070e
SM
48922011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
4893
4894 * fileio.c (Finsert_file_contents): Move after-change-function call
4895 to before the "handled:" label, since all "goto handled" appear in
4896 cases where the *-change-functions have already been properly called
4897 (bug#10117).
4898
3360a3fc
AS
48992011-12-01 Andreas Schwab <schwab@linux-m68k.org>
4900
4901 * keyboard.c (interrupt_signal): Don't call kill-emacs when
4902 waiting for input. (Bug#10169)
4903
73d6c093
EZ
49042011-11-30 Eli Zaretskii <eliz@gnu.org>
4905
4906 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4907 verifies glyph row's hash code--we have just reallocated the
4908 glyphs, so their contents can be complete garbage. (Bug#10164)
4909
febe6bea
JB
49102011-11-30 Juanma Barranquero <lekktu@gmail.com>
4911
4912 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
4913
801a4313
EZ
49142011-11-30 Eli Zaretskii <eliz@gnu.org>
4915
4916 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
4917 attributes are tested _before_ calling verify_row_hash, to protect
4918 against GCC re-ordering of the tests. (Bug#10164)
4919
2b56b87e
JD
49202011-11-29 Jan Djärv <jan.h.d@swipnet.se>
4921
4922 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
4923
4924 * xterm.c (handle_one_xevent): Only set async_visible and friends
4925 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 4926 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
4927 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
4928
dbf31225
PE
49292011-11-28 Paul Eggert <eggert@cs.ucla.edu>
4930
4931 Remove GCPRO-related macros that exist only to avoid shadowing locals.
4932 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
4933 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
4934 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4935 All uses changed to use GCPRO1 etc.
4936 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
4937 Revert to old implementation (i.e., before 2011-03-11).
4938
1305621b
YM
49392011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4940
4941 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
4942 of scroll runs so as to avoid assigning disabled bogus rows and
4943 unnecessary graphics copy operations.
4944
8c9afb46
EZ
49452011-11-27 Eli Zaretskii <eliz@gnu.org>
4946
4947 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
4948 (snprintf) [_MSC_VER]: Redirect to _snprintf.
4949 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
4950 (malloc, free, realloc, calloc): Redirect to e_* only when
4951 compiling Emacs.
4952
4953 * lisp.h (GCTYPEBITS): Move before first use.
4954 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
4955 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
4956 this macro definition.
4957
4958 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
4959 _MSC_VER.
4960
54e9e3bf
JD
49612011-11-27 Jan Djärv <jan.h.d@swipnet.se>
4962
6d5eb5b0
SM
4963 * gtkutil.c (xg_create_frame_widgets):
4964 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
4965 present with Gtk+ 2.0.
4966
83aca1cb
PE
49672011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4968
4969 * fileio.c (Finsert_file_contents): Undo previous change; see
4970 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4971
5b76caa4
PE
49722011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4973
4974 Rename locals to avoid shadowing.
4975 * fileio.c (Finsert_file_contents):
4976 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
4977 * process.c (wait_reading_process_output):
4978 Rename inner 'proc' to 'p' to avoid shadowing.
4979 Indent for consistency with usual Emacs style.
4980
8c535114
EZ
49812011-11-25 Eli Zaretskii <eliz@gnu.org>
4982
4983 * xdisp.c (redisplay_window): If cursor row is not fully visible
4984 after recentering, and scroll-conservatively is set to a large
4985 number, scroll window by a few more lines to make the cursor fully
4986 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
4987 (start_display): Don't move to the next line if the display should
4988 start at a newline that is part of a display vector or an overlay
4989 string. (Bug#10119)
8c535114 4990
fa4fdb5c
JL
49912011-11-24 Juri Linkov <juri@jurta.org>
4992
4993 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
4994 after the `MagickPingImage' call. (Bug#10112)
4995
90ec88df
CY
49962011-11-23 Chong Yidong <cyd@gnu.org>
4997
4998 * window.c (Fcoordinates_in_window_p): Accept only live windows.
4999
56e2e794
MR
50002011-11-23 Martin Rudalics <rudalics@gmx.at>
5001
5002 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5003 making another buffer current. (Bug#10114)
5004
b6e64c41
GM
50052011-11-23 Glenn Morris <rgm@gnu.org>
5006
5007 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5008
6b21de18
CY
50092011-11-23 Chong Yidong <cyd@gnu.org>
5010
5011 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5012 using it (Bug#5984).
5013
b12cd789
EZ
50142011-11-22 Eli Zaretskii <eliz@gnu.org>
5015
5016 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5017 and header-lines, as they don't have one computed for them.
5018 (Bug#10098)
5019
5020 * .gdbinit (prow): Make displayed values more self-explaining.
5021 Add row's hash code.
5022
261b6fd4
LMI
50232011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5024
5025 * process.c (wait_reading_process_output): Fix asynchrounous
5026 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5027 (wait_reading_process_output): Add comment and URL.
261b6fd4 5028
e7cfd277
JD
50292011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5030
5031 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5032
a9b9b7f5
CY
50332011-11-21 Chong Yidong <cyd@gnu.org>
5034
5035 * window.c (Fnext_window, Fprevious_window): Doc fix.
5036
b0d15b4f
SM
50372011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5038
5039 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5040
fe7a3057
JB
50412011-11-20 Juanma Barranquero <lekktu@gmail.com>
5042
5043 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5044
d2999b1a
MR
50452011-11-20 Martin Rudalics <rudalics@gmx.at>
5046
5047 * window.c (Fset_window_combination_limit): Rename argument
5048 STATUS to LIMIT.
5049 (Vwindow_combination_limit): Remove "status" from doc-string.
5050
d5ff9cd0
AS
50512011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5052
5053 * m/ibms390.h: Remove.
5054 * m/ibms390x.h: Don't include "ibms390.h".
5055
a5bb9bd3
SM
50562011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5057
5058 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5059 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5060
cd1181db
JB
50612011-11-20 Juanma Barranquero <lekktu@gmail.com>
5062
5063 * casetab.c (Fset_case_table):
5064 * charset.c (Fcharset_after): Fix typos.
5065
615a3b8d 50662011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5067
17e845af
PE
5068 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5069 Otherwise, valgrind does not work on some platforms.
5070 Problem reported by Andreas Schwab in
6a0bf43d
PE
5071 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5072 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5073 is set, removing the need for VIRT_ADDRESS_VARIES.
5074 (PURE_P): Use a more-efficient implementation that needs just one
5075 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5076 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5077 to 4 (xorl, subq, cmpq, setbe).
5078 * alloc.c (pure): Always extern now, since that's the
5079 VIRT_ADDR_VARIES behavior.
5080 (PURE_POINTER_P): Use a single comparison, not two, for
5081 consistency with the new puresize.h.
5082 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5083 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5084 Remove VIRT_ADDR_VARIES no longer needed.
5085
f8fe6f96
EZ
50862011-11-19 Eli Zaretskii <eliz@gnu.org>
5087
5088 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5089 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5090 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5091 behave as if the cursor position were at the window margin.
5092
5093 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5094 and the cursor position is out of bounds, behave as if the cursor
5095 position were at the window margin. (Bug#10075)
5096
df05a53c
CY
50972011-11-18 Chong Yidong <cyd@gnu.org>
5098
5099 * window.c (Fwindow_combination_limit): Make first argument
5100 non-optional, since it is meaningless for live windows like the
5101 selected window.
61ccba97 5102
2071918e
DA
51032011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5104
5105 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5106
b50a28de
SM
51072011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5108
5109 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5110 (graft_intervals_into_buffer): Simplify.
5111
015137db
EZ
51122011-11-18 Eli Zaretskii <eliz@gnu.org>
5113
5114 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5115 hash values of the two rows.
5116 (copy_row_except_pointers): Preserve the used[] arrays and the
5117 hash values of the two rows. (Bug#10035)
68c95424 5118 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5119
5120 * xdisp.c (row_hash): New function, body extracted from
5121 compute_line_metrics.
5122 (compute_line_metrics): Call row_hash, instead of computing the
5123 hash code inline.
5124
5125 * dispnew.c (verify_row_hash): Call row_hash for computing the
5126 hash code of a row, instead of duplicating code from xdisp.c.
5127
5128 * dispextern.h (row_hash): Add prototype.
5129
a2addb04
TH
51302011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5131
5132 * frame.c (delete_frame): Don't delete the terminal when the last
5133 X frame is closed if emacs is built with GTK toolkit.
5134
df85d315
JB
51352011-11-17 Juanma Barranquero <lekktu@gmail.com>
5136
5137 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5138
a0c2d0ae
MR
51392011-11-17 Martin Rudalics <rudalics@gmx.at>
5140
5141 * window.c (Vwindow_splits): Rename to
5142 Vwindow_combination_resize. Suggested by Juri Linkov.
5143 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5144 of Vwindow_splits.
5145
58179cce
JB
51462011-11-16 Juanma Barranquero <lekktu@gmail.com>
5147
7877f373
JB
5148 * nsfns.m (Fns_font_name):
5149 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5150
b6f67890
MR
51512011-11-16 Martin Rudalics <rudalics@gmx.at>
5152
5153 * window.h (window): Rename slot "nest" to "combination_limit".
5154 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5155 (Fset_window_nest): Rename to Fset_window_combination_limit.
5156 (Vwindow_nest): Rename to Vwindow_combination_limit.
5157 (recombine_windows, make_parent_window, make_window)
5158 (Fsplit_window_internal, saved_window)
5159 (Fset_window_configuration, save_window_save): Rename all
5160 occurrences of window_nest to window_combination_limit.
5161
c7015153
JB
51622011-11-15 Juanma Barranquero <lekktu@gmail.com>
5163
5164 * image.c (imagemagick_load_image): Fix typo.
5165
322ad6ec
EZ
51662011-11-14 Eli Zaretskii <eliz@gnu.org>
5167
5168 * xdisp.c (display_line): Move the call to
5169 highlight_trailing_whitespace before the call to
5170 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5171 faces of all the glyphs to compute ROW's hash value.
5172 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5173
f067b8ec
JB
51742011-11-14 Juanma Barranquero <lekktu@gmail.com>
5175
5176 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5177 just return (bug#10044).
5178
1e5b2111
EZ
51792011-11-12 Eli Zaretskii <eliz@gnu.org>
5180
7ef3cbd5
EZ
5181 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5182 with user-defined heap size. Bump the default size of the temacs
5183 heap to 27MB, to avoid memory warning when running temacs.
5184 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5185
1e5b2111
EZ
5186 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5187 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5188 (verify_row_hash) [XASSERTS]: New function.
5189 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5190 that the hash value of glyph rows is correct.
1e5b2111 5191
89d61221
MR
51922011-11-12 Martin Rudalics <rudalics@gmx.at>
5193
5194 * window.h (window): Remove splits slot.
5195 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5196 (Fdelete_other_windows_internal, make_parent_window)
5197 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5198 (Fset_window_configuration, save_window_save): Don't deal with
5199 split status of windows.
5200 (saved_window): Remove splits slot.
5201 (Vwindow_splits): Rewrite doc-string.
5202
97f18cc8
JD
52032011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5204
5205 * xfns.c (unwind_create_frame):
5206 * nsfns.m (unwind_create_frame):
5207 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5208 Vframe_list (Bug#9999).
5209
22a648b4
DA
52102011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5211
0b381c7e 5212 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5213
659afede
KH
52142011-11-11 Kenichi Handa <handa@m17n.org>
5215
5216 * callproc.c (Fcall_process): Set the member dst_multibyte of
5217 process_coding.
5218
9ac0394b
KH
52192011-11-11 Johan Bockgård <bojohan@gnu.org>
5220
5221 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5222 avoid a crash (bug#9496).
5223
2fbdc249
CY
52242011-11-09 Chong Yidong <cyd@gnu.org>
5225
5226 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5227 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5228
ac6b1f81
PE
52292011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5230
5231 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5232
09db192c
PE
52332011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5234
5235 Avoid some portability problems by eschewing 'extern inline' functions.
5236 The trivial performance wins aren't worth the portability hassles; see
5237 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5238 et seq.
5239 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5240 (window_box_width, window_box_left, window_box_left_offset)
5241 (window_box_right, window_box_right_offset): Undo previous change,
5242 by removing the "extern"s.
5243 * intervals.c (adjust_intervals_for_insertion)
5244 (adjust_intervals_for_deletion): Undo previous change,
5245 making these static again.
5246 (offset_intervals, temp_set_point_both, temp_set_point)
5247 (copy_intervals_to_string): No longer inline.
5248 * xdisp.c (window_text_bottom_y, window_box_width)
5249 (window_box_height, window_box_left_offset)
5250 (window_box_right_offset, window_box_left, window_box_right)
5251 (window_box): No longer inline.
5252
105216ed
CY
52532011-11-08 Chong Yidong <cyd@gnu.org>
5254
5255 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5256 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5257 Signal an error if not a live window.
105216ed
CY
5258 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5259 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5260
ae9e237f
JB
52612011-11-07 Juanma Barranquero <lekktu@gmail.com>
5262
5263 * lisp.h (syms_of_abbrev): Remove declaration.
5264 Reported by CHENG Gao <chenggao@royau.me>.
5265
c7aa8333
EZ
52662011-11-07 Eli Zaretskii <eliz@gnu.org>
5267
5268 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5269 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5270 of temacs in GUI mode.
5271
be7f5545
MR
52722011-11-07 Martin Rudalics <rudalics@gmx.at>
5273
5274 * window.h: Declare delete_all_child_windows instead of
5275 delete_all_subwindows.
5276 * window.c (Fwindow_nest, Fset_window_nest)
5277 (Fset_window_new_total, Fset_window_new_normal)
5278 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5279 (delete_all_subwindows): Rename to delete_all_child_windows.
5280 (Fdelete_other_windows_internal, Fset_window_configuration):
5281 Call delete_all_child_windows instead of delete_all_subwindows.
5282 * frame.c (delete_frame): Call delete_all_child_windows instead
5283 of delete_all_subwindows.
5284
ca78dc43
PE
52852011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5286
5287 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5288 This is also needed for porting to any host where GC_MARK_STACK is
5289 not GC_MAKE_GCPROS_NOOPS.
5290 (which_symbols): Use it.
5291
a0241d01
KH
52922011-11-07 Kenichi Handa <handa@m17n.org>
5293
5294 * coding.c (coding_set_destination): Check coding->src_pos only
5295 when coding->src_object is a buffer (bug#9910).
5296
5297 * process.c (send_process): Set the member src_multibyte of coding
5298 to 0 (bug#9911) when sending a unibyte text.
5299
5300 * callproc.c (Fcall_process): Set the member src_multibyte of
5301 process_coding to 0 (bug#9912).
5302
a64bfdfa 53032011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5304
5305 * xmenu.c (cleanup_widget_value_tree): New function.
5306 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5307 calling free_menubar_widget_value_tree directly (Bug#9830).
5308
cb41b32a
PE
53092011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5310
5311 Fix some portability problems with 'inline'.
5312 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5313 (window_box_width, window_box_left, window_box_left_offset)
5314 (window_box_right, window_box_right_offset): Declare extern.
5315 Otherwise, these inline functions do not conform to C99 and
5316 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5317 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5318 * intervals.c (adjust_intervals_for_insertion)
5319 (adjust_intervals_for_deletion): Now extern, because otherwise the
5320 extern inline functions 'offset_intervals' couldn't refer to it.
5321 (static_offset_intervals): Remove.
5322 (offset_intervals): Rewrite using the old contents of
5323 static_offset_intervals. The old version didn't conform to C99
5324 because an extern inline function contained a reference to an
5325 identifier with static linkage.
5326
b7041366
AS
53272011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5328
5329 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5330 GC.
5331
88a37c4d
EZ
53322011-11-06 Eli Zaretskii <eliz@gnu.org>
5333
5334 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5335 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5336 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5337 return Qleft_to_right.
5338
49745b39
CY
53392011-11-06 Chong Yidong <cyd@gnu.org>
5340
5341 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5342 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5343 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5344 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5345 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5346 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5347 (Fwindow_vscroll): Doc fix.
5348 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5349 argument, since it makes no sense to pass a live window and for
5350 consistency with window-child.
5351
1f05cd82
CS
53522011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5353
5354 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5355 support MSVC.
5356
22610910
JR
53572011-11-05 Jason Rumney <jasonr@gnu.org>
5358
5359 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5360 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5361 fonts (Bug#6029).
5362 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5363 bitwise arithmetic preventing use of unicode-sip and non-truetype
5364 opentype fonts.
5365
a06776b2
EZ
53662011-11-05 Eli Zaretskii <eliz@gnu.org>
5367
3ad924ba
EZ
5368 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5369 "emacs"-only part.
5370
a06776b2
EZ
5371 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5372 initialization code to keep similarity to xfns.c after changes
5373 from 2011-11-05.
5374
c9e7db78
JD
53752011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5376
a97f8f3f
JD
5377 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5378 (unwind_create_frame): New function (Bug#9943).
5379 (Fx_create_frame): Restructure code to be more similar to the one in
5380 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5381 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5382 Move terminal->reference_count++ just before making the frame official
5383 (Bug#9943).
5384
5385 * nsterm.m (x_free_frame_resources): New function.
5386 (x_destroy_window): Move code to x_free_frame_resources.
5387
c9e7db78 5388 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5389 (Fx_create_frame, x_create_tip_frame):
5390 Move terminal->reference_count++ just before making the frame
75f1671a 5391 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5392 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5393
a6fc3b5c
EZ
53942011-11-05 Eli Zaretskii <eliz@gnu.org>
5395
5396 Support MSVC build with newer versions of Visual Studio.
5397 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5398 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5399 nt/gmake.defs.
5400
5401 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5402 which are not supported by MSVC.
5403 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5404 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5405 bitfields.
5406 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5407 types in bitfields.
5408 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5409
5410 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5411
58179cce 54122011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5413
5414 Support MSVC build with newer versions of Visual Studio.
5415 * w32.c: Don't include w32api.h for MSVC.
5416 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5417
5418 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5419 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5420 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5421 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5422 e_* cousins.
5423 (alloca) [_MSC_VER]: Define to _alloca.
5424
5425 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5426
5427 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5428
a58c13ed
EZ
54292011-11-04 Eli Zaretskii <eliz@gnu.org>
5430
5431 * xdisp.c (note_mouse_highlight): If either of
5432 previous/next-single-property-change returns nil, treat that as
5433 the beginning or the end of the buffer. (Bug#9955)
5434
fe0b6370
JD
54352011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5436
a58c13ed 5437 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5438 label is not null (Bug#9951).
5439 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5440 may be NULL.
5441
89bd5ee1
EZ
54422011-11-04 Eli Zaretskii <eliz@gnu.org>
5443
5444 * window.c (Fwindow_body_size): Mention in the doc string that the
5445 return value is in frame's canonical units. (Bug#9949)
5446
84c3edb9
EZ
54472011-11-03 Eli Zaretskii <eliz@gnu.org>
5448
4e2fb5c7
EZ
5449 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5450
84c3edb9 5451 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5452 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5453 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5454
bc17a887
EZ
54552011-11-01 Eli Zaretskii <eliz@gnu.org>
5456
5457 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5458 Don't stop backward scan on the continuation glyph, even though
5459 its CHARPOS is positive.
6d5eb5b0
SM
5460 (mouse_face_from_buffer_pos, note_mouse_highlight):
5461 Rename cover_string to disp_string.
bc17a887 5462
4ee88440
MR
54632011-11-01 Martin Rudalics <rudalics@gmx.at>
5464
5465 * window.c (temp_output_buffer_show): Don't use
5466 Vtemp_buffer_show_specifiers.
5467 (Vtemp_buffer_show_specifiers): Remove unused variable.
5468
c2ff3c02
EZ
54692011-10-30 Eli Zaretskii <eliz@gnu.org>
5470
5471 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5472 past the beginning of the current glyph matrix.
5473
58179cce 54742011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5475
5476 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5477 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5478 HAVE_GTK3 (Bug#9869).
b77a6a7f 5479
3b574623
JD
5480 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5481 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5482
b77a6a7f
JD
5483 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5484
5485 * xterm.c: Declare x_handle_net_wm_state to return int.
5486 (handle_one_xevent): Check if we are iconified but don't have
5487 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5488 (get_current_wm_state): Return non-zero if not hidden,
5489 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5490 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5491 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5492 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5493
196e41e4
PE
54942011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5495
5496 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5497 so that this new function doesn't get optimized away by a
5498 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5499
021f2e1a
AS
55002011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5501
5502 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5503
8b058d44
EZ
55042011-10-29 Eli Zaretskii <eliz@gnu.org>
5505
5506 Fix the `xbytecode' command.
5507 * .gdbinit (xprintbytestr): New command.
b50a28de 5508 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5509 (xbytecode): Print the byte-code string as well.
5510
4452fb80
EZ
55112011-10-29 Kim Storm <storm@cua.dk>
5512
8b058d44
EZ
5513 * alloc.c (which_symbols): New function.
5514
21b72067
AS
55152011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5516
5517 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5518 line. (Bug#9903)
5519
83ed7b5c
GM
55202011-10-29 Glenn Morris <rgm@gnu.org>
5521
5522 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5523 Not clear what it was for, and it causes various bugs. (Bug#9839)
5524
5a7a728b
EZ
55252011-10-28 Eli Zaretskii <eliz@gnu.org>
5526
5527 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5528 possible random value that matches one of those tested as
5529 condition to clear the mouse face.
5530
d3d0842f
CY
55312011-10-28 Chong Yidong <cyd@gnu.org>
5532
5533 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5534
31b39d13
DN
55352011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5536
5537 * window.c (make_window): Initialize phys_cursor_on_p.
5538
9aba6043
SM
55392011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5540
5541 * lisp.h (struct Lisp_Symbol): Update comments.
5542
c20992f4
JB
55432011-10-28 Juanma Barranquero <lekktu@gmail.com>
5544
5545 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5546
db4f02f2
EZ
55472011-10-28 Eli Zaretskii <eliz@gnu.org>
5548
5549 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5550 <oslsachem@gmail.com> for helping to debug this.
5551
5552 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5553 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5554 (g_b_init_get_glyph_outline_w): New static variables.
5555 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5556 (GetGlyphOutlineW_Proc): New typedefs.
5557 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5558 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5559 New functions.
5560 (w32font_open_internal, compute_metrics):
5561 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5562 instead of calling the "wide" APIs directly.
5563
5564 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5565
5566 * w32.h (syms_of_w32font): Add prototype.
5567
87e68db4
JB
55682011-10-27 Juanma Barranquero <lekktu@gmail.com>
5569
5570 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5571 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5572 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5573 (Fmove_to_window_line): Doc fix.
5574
435c1d67
CY
55752011-10-27 Chong Yidong <cyd@gnu.org>
5576
5577 * process.c (make_process): Set gnutls_state to NULL.
5578
5579 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5580 non-NULL, regardless of GNUTLS_INITSTAGE.
5581 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5582 an error. Set process slots as soon as we allocate them.
5583
5584 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5585
9c6c6f49
CY
55862011-10-27 Chong Yidong <cyd@gnu.org>
5587
9aba6043
SM
5588 * gnutls.c (emacs_gnutls_deinit): New function.
5589 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5590 (Fgnutls_deinit, Fgnutls_boot): Use it.
5591
5592 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5593 (deactivate_process): Call emacs_gnutls_deinit.
5594
657d08d3
JB
55952011-10-27 Juanma Barranquero <lekktu@gmail.com>
5596
5597 * image.c (x_create_x_image_and_pixmap):
5598 * w32.c (sys_rename, w32_delayed_load):
5599 * w32font.c (fill_in_logfont):
5600 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5601
5430d399
JB
56022011-10-26 Juanma Barranquero <lekktu@gmail.com>
5603
5604 * w32fns.c (w32_default_color_map): New function,
5605 extracted from Fw32_default_color_map.
a7ef684b 5606 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5607
fe0055fa
PE
56082011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5609
5610 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5611
e6346438
SM
56122011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5613
5614 * keyboard.c (test_undefined): New function (bug#9751).
5615 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5616
e112cc37
ET
56172011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5618
5619 * sysdep.c (init_sys_modes): Fix the check for the controlling
5620 terminal (Bug#6649).
5621
7b5d6677
EZ
56222011-10-20 Eli Zaretskii <eliz@gnu.org>
5623
5624 * dispextern.h (struct bidi_it): New member next_en_type.
5625
5626 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5627 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5628 current character, check also for next_en_type being WEAK_EN.
5629 (bidi_resolve_weak): Don't enter the expensive loop if the current
5630 position is before next_en_pos. Record the bidi type of the first
5631 non-ET, non-BN character we find, in addition to its position.
5632 (bidi_level_of_next_char): Invalidate next_en_type when
5633 next_en_pos is over-stepped.
5634
7da0b018
PE
56352011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5636
5637 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5638 * editfns.c: Rewrite current-time-zone so that it invokes
5639 the equivalent of (format-time-string "%Z") to get the time zone name.
5640 This fixes a bug when the time zone name contains characters that
5641 need converting from the system time locale to Emacs internal format.
5642 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5643 that patch fixed format-time-string to do the conversion, but
5644 I forgot to fix current-time-zone.
5645 (format_time_string): New function, containing most of
5646 what Fformat_time_string used to contain.
5647 (Fformat_time_string): Rewrite in terms of format_time_string.
5648 This doesn't change this function's behavior.
5649 (current-time-zone): Rewrite to use format_time_string.
5650 This fixes the bug reported by Michael Schierl in
5651 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5652 Jason Rumney's 2007-06-07 change worked around this bug, but
5653 didn't fix it.
5654 * systime.h (tzname, timezone): Remove no-longer-used declarations.
5655
8547b010
EZ
56562011-10-19 Eli Zaretskii <eliz@gnu.org>
5657
5658 * xdisp.c (start_display): If the character at POS is displayed
5659 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
5660 (try_window_reusing_current_matrix): If a line ends in a display
5661 vector or the next line starts in a display vector, continue
5662 redrawing the window even though the character position of
5663 start_row was reached.
8547b010
EZ
5664 (Bug#9771, part 2)
5665
4e948d15
CY
56662011-10-18 Chong Yidong <cyd@gnu.org>
5667
5668 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5669 with nobreak-char-display too.
5670
4787455f
EZ
56712011-10-18 Eli Zaretskii <eliz@gnu.org>
5672
5673 Fix part 3 of bug#9771.
5674 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5675 (bidi_resolve_neutral): Don't enter the expensive loop looking for
5676 non-neutral characters if the current character is a paragraph
5677 separator (a.k.a. Newline). This avoids running the same
5678 expensive loop twice, once when we consume the preceding newline
5679 and the other time when the line actually needs to be displayed.
5680 Avoid the loop when we see neutrals on the base embedding level
5681 following a character whose directionality is the same as the
5682 paragraph's. This avoids running the expensive loop when a line
5683 ends in a long sequence of neutrals, like control characters.
5684 Add assertion against STRONG_AL type. Slightly rearrange code
5685 that determines the type of a neutral given the first non-neutral
5686 that follows it.
5687 (bidi_level_of_next_char): Set next_en_pos to zero when
5688 invalidating its info.
5689
2c91f553
EZ
56902011-10-17 Eli Zaretskii <eliz@gnu.org>
5691
5692 * xdisp.c (push_display_prop): Determine whether to record string
5693 or buffer position by IT->string, not by IT->method. Allow
5694 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
5695 (move_it_vertically_backward): Don't look for character position
5696 immediately after the newline when in a continuation line.
5697 (Bug#9771, part 1)
2c91f553 5698
c7b08b0d
MR
56992011-10-15 Martin Rudalics <rudalics@gmx.at>
5700
5701 * window.c (coordinates_in_window): Rewrite and delabelize
5702 vertical border check. (Bug#5357) (Bug#9618)
5703
6b02f655
SM
57042011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
5705
5706 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5707 errors in XSetWindowBorder (bug#9310).
5708
81d40c92
DA
57092011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
5710
5711 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5712 avoid crash when xmalloc overrun checking is enabled.
5713
d4172c3b
EZ
57142011-10-13 Eli Zaretskii <eliz@gnu.org>
5715
5716 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5717 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
5718 cursor motion with <left> and <right> arrow keys.
5719
5720 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5721 some callers set that themselves.
5722
b00eea75
EZ
57232011-10-12 Eli Zaretskii <eliz@gnu.org>
5724
5725 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5726 display string and the previous row comes from the same string and
5727 is empty. (Bug#9739) (Bug#9738)
5728
8fe012c4
SM
57292011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5730
5731 * doc.c (get_doc_string): Encode file name (bug#9735).
5732
0074aef2
EZ
57332011-10-12 Eli Zaretskii <eliz@gnu.org>
5734
79beb178
EZ
5735 * bidi.c (bidi_level_of_next_char):
5736 * xdisp.c (get_visually_first_element): Remove old incorrect
5737 comments regarding the Unicode Line Separator character.
5738
0074aef2
EZ
5739 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5740
6e4b3fbe
DA
57412011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
5742
5743 * alloc.c (Fgc_status): Do not access beyond zombies array
5744 boundary if nzombies > MAX_ZOMBIES.
5745 * alloc.c (dump_zombies): Add missing format specifier.
5746
0324f3af
PE
57472011-10-12 Paul Eggert <eggert@cs.ucla.edu>
5748
b5525cac
PE
5749 * xdisp.c (set_cursor_from_row): Simplify conditionals,
5750 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5751
0324f3af
PE
5752 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5753 Some packages use them to denote characters with modifiers.
5754
e9b5f888
AS
57552011-10-11 Andreas Schwab <schwab@linux-m68k.org>
5756
5757 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5758 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5759 matching a pp-number. Rename parameter var to var1.
5760
127827c0
SM
57612011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5762
5763 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5764
c8fd3bd0
GM
57652011-10-08 Glenn Morris <rgm@gnu.org>
5766
5767 * callint.c (Fcall_interactively): Give a more explicit error for the
5768 'c' case with a non-character input. (Bug#8479)
5769
352ec8ff
EZ
57702011-10-08 Eli Zaretskii <eliz@gnu.org>
5771
03669ccb
EZ
5772 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5773 lines.
7061c986
EZ
5774 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5775 lines that are hscrolled on the left.
03669ccb 5776
352ec8ff
EZ
5777 * dispnew.c (buffer_posn_from_coords): Account for a possible
5778 presence of header-line. (Bug#4426)
5779
a66cfb1c
SM
57802011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
5781
6b02f655
SM
5782 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5783 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 5784
7c5ee88e
PE
57852011-10-07 Paul Eggert <eggert@cs.ucla.edu>
5786
5787 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5788 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
5789 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5790 this makes Emacs dump core during garbage collection on rare
5791 occasions. sizeof is obviously inferior to offsetof here, so
5792 stick with offsetof.
5793 (GC_POINTER_ALIGNMENT): New macro.
5794 (mark_memory): Omit 3rd (offset) arg; caller changed.
5795 Don't assume EMACS_INT alignment is the same as pointer alignment.
5796
df1bbe5b
SM
57972011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
5798
5799 * keyboard.c (read_key_sequence_remapped): New var.
5800 (read_key_sequence): Compute remapping in the right buffer.
5801 (command_loop_1): Use read_key_sequence's remapping directly.
5802
51553db6
SM
58032011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5804
32c1fffd
SM
5805 * dired.c (file_name_completion): Don't expand file name.
5806 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5807 before checking file name handler.
5808
51553db6
SM
5809 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5810 they've been requested explicitly (bug#9591).
5811
b6bd1599 58122011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
5813
5814 * keymap.c (Fsingle_key_description): Use make_specified_string
5815 instead of build_string to build string from push_key_description.
5816 (Bug#5193)
5817
f701dc2a
PE
58182011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5819
4222c55d
PE
5820 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5821 This fixes a Y2038 bug on 64-bit hosts.
5822 * buffer.c (reset_buffer):
5823 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5824 (Fclear_buffer_auto_save_failure):
5825 Use 0, not -1, to represent an unset failure time, since time_t
5826 might not be signed.
5827
f701dc2a
PE
5828 Remove dependency on glibc malloc internals.
5829 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5830 Move back here from lisp.h, but with their new implementations.
5831 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5832 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5833 * charset.c (charset_table_init): New static var.
5834 (syms_of_charset): Use it instead of xmalloc. This removes a
5835 dependency on glibc malloc internals. See Eli Zaretskii's comment in
5836 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5837 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5838 Move back to alloc.c.
5839 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5840 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5841
9ceebf39
JD
58422011-09-30 Jan Djärv <jan.h.d@swipnet.se>
5843
5844 * nsterm.m (windowDidResize): Call x_set_window_size only when
5845 ns_in_resize is true. Otherwise set pixelwidth/height and
5846 call change_frame_size (Bug#9628).
5847
cb993c58
PE
58482011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5849
3930c88b
PE
5850 Port --enable-checking=all to Fedora 14 x86-64.
5851 * charset.c (syms_of_charset): Also account for glibc malloc's
5852 internal overhead when calculating the initial malloc maximum.
5853
cb993c58
PE
5854 Port --enable-checking=all to Fedora 14 x86.
5855 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5856 Move to lisp.h.
5857 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5858 (overrun_check_realloc, overrun_check_free):
5859 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5860 That way, xmalloc returns a properly-aligned pointer even if
5861 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
5862 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5863 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5864 into account when calculating the initial malloc maximum.
5865 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5866 Move here from alloc.c, so that charset.c can use it too.
5867 Properly align; the old code wasn't right for common 32-bit hosts
5868 when configured with --enable-checking=all.
5869 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5870 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5871
31bed486
EZ
58722011-09-29 Eli Zaretskii <eliz@gnu.org>
5873
04c70788 5874 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
5875 use EDOM.
5876
fbcaa2f3
EZ
58772011-09-28 Eli Zaretskii <eliz@gnu.org>
5878
5879 * xdisp.c (compute_display_string_end): If there's no display
5880 string at CHARPOS, return -1.
5881
5882 * bidi.c (bidi_fetch_char): When compute_display_string_end
5883 returns a negative value, treat the character as a normal
5884 character not covered by a display string. (Bug#9624)
5885
a239d4e9
JB
58862011-09-28 Juanma Barranquero <lekktu@gmail.com>
5887
5888 * lread.c (Fread_from_string): Fix typo in docstring.
5889
88652fd5
EZ
58902011-09-27 Eli Zaretskii <eliz@gnu.org>
5891
5892 * xdisp.c (handle_invisible_prop): If invisible text ends on a
5893 newline, reseat the iterator instead of bidi-iterating there one
5894 character at a time. (Bug#9610)
32c1fffd
SM
5895 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5896 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 5897
ed497dd4
AS
58982011-09-27 Andreas Schwab <schwab@linux-m68k.org>
5899
5900 * lread.c (readevalloop): Use correct code for NBSP.
5901 (read1): Likewise. (Bug#9608)
5902
b2bf61aa
MA
59032011-09-25 Michael Albinus <michael.albinus@gmx.de>
5904
5905 * dbusbind.c (Fdbus_register_signal): When service is not
5906 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
5907
32bbb17c
GM
59082011-09-25 Glenn Morris <rgm@gnu.org>
5909
5910 * buffer.c (truncate-lines): Doc fix.
5911
94e0933e
CY
59122011-09-24 Chong Yidong <cyd@stupidchicken.com>
5913
5914 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
5915 (Fset_window_next_buffers): Doc fix.
5916
cddde921
GM
59172011-09-24 Glenn Morris <rgm@gnu.org>
5918
5919 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
5920
1260aef1
PE
59212011-09-24 Paul Eggert <eggert@cs.ucla.edu>
5922
25b4bfa0
PE
5923 Fix minor problems found by static checking.
5924 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
5925 * indent.c (Fvertical_motion): Fix == vs = typo.
5926
e3cbd34b
EZ
59272011-09-24 Eli Zaretskii <eliz@gnu.org>
5928
a66cfb1c
SM
5929 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
5930 Default value is now t. Doc fix.
6bf7006f 5931
e3cbd34b 5932 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 5933 logic when moving up, not only when moving down. Fix the
e3cbd34b 5934 confusing name and values of the it_overshoot_expected variable;
32c1fffd 5935 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
5936
5937 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
5938 CHARPOS is covered by a display string which includes newlines.
5939 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
5940 is covered by a display string with embedded newlines.
5941
a3de0cbd
MA
59422011-09-24 Michael Albinus <michael.albinus@gmx.de>
5943
5944 * dbusbind.c (Fdbus_register_signal): Add match rule to
5945 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
5946 (Fdbus_register_method, Vdbus_registered_objects_table):
5947 Fix docstring.
a3de0cbd 5948
b260039d
JM
59492011-09-24 Jim Meyering <meyering@redhat.com>
5950
32c1fffd 5951 do not ignore write error for any output size
b260039d
JM
5952 The previous change was incomplete.
5953 While it makes emacs --batch detect the vast majority of stdout
5954 write failures, errors were still ignored whenever the output size is
5955 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
5956 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
5957 && echo FAIL: ignored write error
5958 FAIL: ignored write error
5959 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
5960 && echo FAIL: ignored write error
5961 FAIL: ignored write error
5962 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
5963
8eca8a7c
AS
59642011-09-23 Andreas Schwab <schwab@linux-m68k.org>
5965
5966 * emacs.c (Fkill_emacs): In noninteractive mode exit
5967 non-successfully if a write error occurred on stdout. (Bug#9574)
5968
3341db62
EZ
59692011-09-21 Eli Zaretskii <eliz@gnu.org>
5970
5971 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
5972 the xassert test.
5973
5974 * dispextern.h (struct it): Update the comment documenting what
5975 can it->OBJECT be.
5976
8c203dbf
EZ
59772011-09-20 Eli Zaretskii <eliz@gnu.org>
5978
5979 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
5980 a display string, extend search for cursor position to end of row.
5981 (find_row_edges): If the row ends in a newline from a display
5982 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
5983 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
5984 (Fcurrent_bidi_paragraph_direction): Fix search for previous
5985 non-empty line. Fixes confusing cursor motion with arrow keys at
5986 the beginning of a line that starts with whitespace.
8c203dbf 5987
a4824228
LMI
59882011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5989
5990 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
5991 (bug#9493).
5992
33ed493b
CY
59932011-09-18 Chong Yidong <cyd@stupidchicken.com>
5994
5995 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
5996 boolean (Bug#9154).
5997
56cd55c8
EZ
59982011-09-18 Eli Zaretskii <eliz@gnu.org>
5999
6000 * xdisp.c (display_line): Record maximum and minimum buffer
6001 positions even if no glyphs were produced (e.g., by a zero-width
6002 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6003 buffer positions that will be removed from the glyph row because
6004 they don't fit.
c02dcedf
EZ
6005 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6006 column is beyond frame width: don't subtract 1 "pixel" when
6007 computing width of the stretch.
3e62b7e0
EZ
6008 (reseat_at_next_visible_line_start): Undo the change made on
6009 2011-09-17 that saved paragraph information and restored it after
6010 the call to `reseat'. (Bug#9545)
56cd55c8 6011
5ed99d36 60122011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6013
6014 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6015 and turn window cursor on if cleared (Bug#9415).
6016
5ed99d36 60172011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6018
6019 * search.c (boyer_moore): Take unibyte characters from pattern
6020 literally. (Bug#9458)
6021
9bade7b2
EZ
60222011-09-18 Eli Zaretskii <eliz@gnu.org>
6023
6024 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6025
e5e9d610
PE
60262011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6027
87e4427a
PE
6028 Fix minor problem found by static checking.
6029 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6030 initialized, to pacify gcc -Wuninitialized.
6031
e5e9d610
PE
6032 * fileio.c: Report proper errno when syscall falls.
6033 (Finsert_file_contents): Save and restore errno,
6034 so that report_file_error outputs the correct diagnostic.
6035 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6036
a1674f0b
EZ
60372011-09-18 Eli Zaretskii <eliz@gnu.org>
6038
6039 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6040
fbfb6dd4
EZ
60412011-09-17 Eli Zaretskii <eliz@gnu.org>
6042
6043 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6044 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6045
bb187662
EZ
60462011-09-17 Eli Zaretskii <eliz@gnu.org>
6047
1137e8b8 6048 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6049 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6050
6051 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6052 (bidi_find_paragraph_start): Search back for paragraph beginning
6053 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6054 (bidi_move_to_visually_next): Only trigger paragraph-related
6055 computations when the last character is a newline or at EOB, not
6056 just any NEUTRAL_B. (Bug#9470)
6057
bb187662
EZ
6058 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6059 truncated lines if point is covered by a display string. (Bug#9524)
6060
2e621251
PE
60612011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6062
6063 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6064 (cons_to_x_long): New function.
6065 (lisp_data_to_selection_data): Use it. Correct the test for
6066 short-versus-long data; it was negated. Break out of vector
6067 loop, for efficiency, when a long datum is discovered.
6068
91a15bc6
SM
60692011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6070
6071 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6072
b41c3a35
EZ
60732011-09-16 Eli Zaretskii <eliz@gnu.org>
6074
6075 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6076 GCC PR/17406) by declaring this function with external scope.
6077
7812ba2d
PE
60782011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6079
6080 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6081 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6082
cf7edc2a
AS
60832011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6084
6085 * editfns.c (Fformat): Correctly handle text properties on "%%".
6086
bd01620e
EZ
60872011-09-15 Eli Zaretskii <eliz@gnu.org>
6088
6089 * xterm.c (x_draw_composite_glyph_string_foreground):
6090 * w32term.c (x_draw_composite_glyph_string_foreground):
6091 * term.c (encode_terminal_code):
6092 * composite.c (composition_update_it, get_composition_id):
6093 * xdisp.c (get_next_display_element)
6094 (fill_composite_glyph_string): Add comments about special meaning
6095 of TAB characters in a composition.
6096
a02719a3
PE
60972011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6098
6099 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6100 This occurs when processing a multibyte format.
6101 Problem reported by Wolfgang Jenker.
a02719a3 6102
72589a3c
JB
61032011-09-15 Johan Bockgård <bojohan@gnu.org>
6104
6105 * xdisp.c (try_cursor_movement): Only check for exact match if
6106 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6107
1c14176c
PE
61082011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6109
6110 Remove unused external symbols.
6111 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6112 * xdisp.c (calc_pixel_width_or_height): Now static.
6113 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6114 * indent.c (check_display_width):
6115 * w32term.c: Fix comment to match code.
6116 * xterm.c, xterm.h (x_catching_errors): Remove.
6117
d2eea5b5
PE
61182011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6119
6120 * xselect.c: Use signed conversions more consistently (Bug#9498).
6121 (selection_data_to_lisp_data): Assume incoming selection data are
6122 signed integers, not unsigned. This is to be consistent with
6123 outgoing selection data, which was modified to use signed integers
6124 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6125 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6126 expects long, not unsigned long.
6127
46888499
EZ
61282011-09-14 Eli Zaretskii <eliz@gnu.org>
6129
6130 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6131 computation of loop end. Reported by Johan Bockgård
6132 <bojohan@gnu.org>.
6133
ef8ef9fb
CY
61342011-09-13 Chong Yidong <cyd@stupidchicken.com>
6135
6136 * frame.c (Fother_visible_frames_p): Function deleted.
6137
fa819fed
EZ
61382011-09-12 Eli Zaretskii <eliz@gnu.org>
6139
6140 * indent.c (compute_motion): Process display vector front to back
6141 rather than the other way around. (Bug#2496)
6142
2ba8e008
SM
61432011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6144
6145 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6146
20f53c69
CY
61472011-09-11 Chong Yidong <cyd@stupidchicken.com>
6148
6149 * minibuf.c (Fread_from_minibuffer): Doc fix.
6150
d562d7a4
EZ
61512011-09-11 Eli Zaretskii <eliz@gnu.org>
6152
6153 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6154 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6155
1c4d7f3d
LMI
61562011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6157
6158 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6159 value for non-existent files.
6160
b885bf36
EZ
61612011-09-11 Eli Zaretskii <eliz@gnu.org>
6162
6163 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6164 set its "size" to -1. This will set the modtime_size field of
6165 the corresponding buffer to -1, which is what
6166 verify-visited-file-modtime expects for files that do not exist.
6167 (Bug#9139)
6168
6612f0bf
PE
61692011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6170
6171 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6172 here ...
6173 * lisp.h: ... from here. push_key_description is no longer
6174 defined in keyboard.c, so its declaration should not be in
6175 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6176 logically belongs with push_key_description.
6177
dfb3f755
PE
61782011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6179
6180 * buffer.h: Include <sys/types.h> instead of <time.h>.
6181 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6182 Problem reported by Herbert J. Skuhra.
6183
3134906c
LMI
61842011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6185
6186 * xml.c (parse_region): Make the parsing work for
6187 non-comment-starting XML files again (bug#9144).
6188
8d903f4e
AS
61892011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6190
6191 * image.c (gif_load): Fix calculation of bottom and right corner.
6192 (Bug#9468)
6193
80ad64f4
EZ
61942011-09-10 Eli Zaretskii <eliz@gnu.org>
6195
6196 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6197 redisplay in small windows.
6198
208a048d
EZ
61992011-09-09 Eli Zaretskii <eliz@gnu.org>
6200
6201 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6202
9b1c252e
MR
62032011-09-08 Martin Rudalics <rudalics@gmx.at>
6204
6205 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6206 Operate on live windows only.
6207
2949f33b
JB
62082011-09-08 Juanma Barranquero <lekktu@gmail.com>
6209
6210 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6211
e08dcafd
EZ
62122011-09-07 Eli Zaretskii <eliz@gnu.org>
6213
6214 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6215 only under bidi iteration.
6216
115b96bd
JD
62172011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6218
6219 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6220
c8199d0f
PE
62212011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6222
6223 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6224 Without this fix, the command to link temacs failed due to an
6225 undefined symbol __builtin_isnan. This is because
6226 /usr/include/iso/math_c99.h #defines isnan(x) to
6227 __builtin_isnan(x), but the bundled gcc, which identifies itself
6228 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6229 a __builtin_isnan.
6230 * floatfns.c (isnan): #undef, and then #define to a clone of
6231 what's in data.c.
6232 (Fisnan): Always define, since it's always available now.
6233 (syms_of_floatfns): Always define isnan at the Lisp level.
6234
e39b275c 62352011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6236
6237 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6238
b2db44d9 62392011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6240
f4af5137 6241 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6242 The previous code assumed that file offsets (off_t values) fit in
6243 EMACS_INT variables, which is not true on typical 32-bit hosts.
6244 The code messed up by falsely reporting buffer overflow in cases
6245 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6246 when "big" contains more than 2**29 bytes, even though this
6247 inserts just one byte and does not overflow the buffer.
6248 (Finsert_file_contents): Store file offsets as off_t
6249 values, not as EMACS_INT values. Check for overflow when
6250 converting between EMACS_INT and off_t. When checking for
6251 buffer overflow or for overlap, take the offsets into account.
6252 Don't use EMACS_INT for small values where int suffices.
6253 When checking for overlap, fix a typo: ZV was used where
6254 ZV_BYTE was intended.
6255 (Fwrite_region): Don't assume off_t fits into 'long'.
6256 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6257
ecfc0a49
MA
62582011-09-05 Michael Albinus <michael.albinus@gmx.de>
6259
6260 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6261
6511acf2 62622011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6263
0999621a 6264 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6265
6266 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6267 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6268 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6269 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6270 (modify_event_symbol): Do not assume that the length of
6271 name_alist_or_stem is safe to alloca and fits in int.
6272 (Fexecute_extended_command): Likewise for function name and binding.
6273 (Frecursion_depth): Wrap around reliably on integer overflow.
6274 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6275 since some callers pass EMACS_INT values.
6276 (Fsingle_key_description): Don't crash if symbol name contains more
6277 than MAX_ALLOCA bytes.
6278 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6279 (get_minibuffer): Arg is now EMACS_INT, not int.
6280 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6281 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6282 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6283
2be7d702
PE
6284 * dbusbind.c (signature_cat): New function.
6285 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6286 Do not overrun buffer; instead, report string overflow.
6287
9d1df220
PE
6288 * dispnew.c (add_window_display_history): Don't overrun buffer.
6289 Truncate instead; this is OK since it's just a log.
6290
33ef5c64
PE
6291 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6292 even if the time zone offset is outlandishly large.
6293 Don't mishandle offset == INT_MIN.
6294
66c6fdd5
PE
6295 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6296 when creating daemon; the previous buffer-overflow check was incorrect.
6297
d749b01b
PE
6298 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6299 which has the guts of the old verror function.
6300
b5cd1905
PE
6301 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6302 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6303
6e1a67fb
PE
6304 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6305 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6306 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6307 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6308 length of string rather than counting it via multiple sprintfs;
6309 that's simpler and more reliable.
c21721cc
PE
6310 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6311 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6312 sprintf, in case result does not fit in int.
6313
c57b67fc
PE
6314 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6315 (fontset_from_font): Print it.
6316
8a401434
PE
6317 * frame.c (tty_frame_count): Now printmax_t, not int.
6318 (make_terminal_frame, set_term_frame_name): Print it.
6319 (x_report_frame_params): In X, window IDs are unsigned long,
6320 not signed long, so print them as unsigned.
6321 (validate_x_resource_name): Check for implausibly long names,
6322 and don't assume name length fits in 'int'.
6323 (x_get_resource_string): Don't blindly alloca invocation name;
6324 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6325 not fit in int.
6326
6e1a67fb
PE
6327 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6328 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6329 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6330
0df02bf3
PE
6331 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6332 Use esprintf, not sprintf, in case result does not fit in int.
6333
48e30793
PE
6334 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6335 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6336 it as a large positive number.
6337 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6338 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6339
a66ff6d8
PE
6340 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6341 in case result does not fit in int.
6342
aca216ff
PE
6343 * print.c (float_to_string): Detect width overflow more reliably.
6344 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6345 buffer overrun. Don't assume list length fits in 'int'. Treat
6346 print length of 0 as 0, not as infinity; to be consistent with other
6347 uses of print length in this function. Don't overflow print length
6348 index. Don't assume hash table size fits in 'long', or that
6349 vectorlike size fits in 'unsigned long'.
6350
31c286f7
PE
6351 * process.c (make_process): Use printmax_t, not int, to format
6352 process-name gensyms.
6353
55e5faa1
PE
6354 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6355
80f2e268
PE
6356 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6357 to avoid potential buffer overrun.
6358
670741ab
PE
6359 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6360 if X resource line is longer than 512 bytes.
6361
b7163a50
PE
6362 * xfns.c (x_window): Make sprintf buffer a bit bigger
6363 to avoid potential buffer overrun.
6364
ae58ff1f
PE
6365 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6366
c43c8a6a
PE
6367 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6368
3f8236f4
PE
63692011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6370
53e9fe90 6371 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6372 Without these, Emacs silently mishandles large integers sometimes.
6373 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6374 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6375
6511acf2
PE
6376 * xdisp.c (try_window_id): Check Emacs fixnum range before
6377 converting to 'int'.
806add1d 6378
6511acf2 6379 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6380 Check that an Emacs fixnum is in range before assigning it to 'int'.
6381 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6382 values converted from Emacs fixnums.
6383 (Frecenter): Don't wrap around a line count if it is out of 'int'
6384 range; instead, treat it as an extreme value.
6385 (Fset_window_configuration, compare_window_configurations):
6386 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6387
6511acf2
PE
6388 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6389 that can exceed INT_MAX. Check that EMACS_INT value is in range
6390 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6391 (match_limit): Don't assume that a fixnum can fit in 'int'.
6392
6511acf2 6393 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6394 exceed INT_MAX.
6395
6511acf2 6396 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6397 (Fvertical_motion): Don't wrap around LINES values that don't fit
6398 in 'int'. Instead, treat them as extreme values. This is good
6399 enough for windows, which can't have more than INT_MAX lines anyway.
6400
fcb901a7
LMI
64012011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6402
0f2f6b6d
LMI
6403 * Require libxml/parser.h to avoid compilation warning.
6404
fcb901a7
LMI
6405 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6406
6407 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6408 since this reportedly can destroy thread storage.
6409
6e20a0d4
CY
64102011-08-30 Chong Yidong <cyd@stupidchicken.com>
6411
6412 * syntax.c (find_defun_start): Update all cache variables if
6413 exiting early (Bug#9401).
6414
148ae00e
EZ
64152011-08-30 Eli Zaretskii <eliz@gnu.org>
6416
f6cfbd8f
EZ
6417 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6418
148ae00e
EZ
6419 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6420 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6421 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6422
6423 * term.c (tty_append_glyph): New function.
6424 (produce_stretch_glyph): Static function and its prototype deleted.
6425
a66cfb1c
SM
6426 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6427 Add prototypes.
148ae00e 6428
c4a07a4c
PE
64292011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6432 when checking :margin (Bug#9390).
6433 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6434 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6435 so that the name doesn't mislead. All uses changed.
6436
6bc8cd65
JB
64372011-08-28 Johan Bockgård <bojohan@gnu.org>
6438
6439 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6440 set_tty_hooks.
6441
dca4927e
EZ
64422011-08-27 Eli Zaretskii <eliz@gnu.org>
6443
6444 * xdisp.c (move_it_to): Don't bail out early when reaching
6445 position beyond to_charpos, if we are scanning backwards.
6446 (move_it_vertically_backward): When DY == 0, make sure we get to
6447 the first character in the line after the newline.
6448
f2cad773
PE
64492011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6450
6451 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6452 (ccl_driver): Do not generate an out-of-range pointer.
6453 (Fccl_execute_on_string): Remove unnecessary check for
6454 integer overflow, noted by Stefan Monnier in
6455 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6456 Remove a FIXME that didn't need fixing.
6457 Simplify the newly-introduced buffer reallocation code.
6458
0cae2cdb
JB
64592011-08-27 Juanma Barranquero <lekktu@gmail.com>
6460
6461 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6462
5fc295a4 64632011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6464
70c60eb2 6465 Integer and memory overflow issues (Bug#9196).
726e0ab1 6466
d31850da
PE
6467 * doc.c (get_doc_string): Rework so that
6468 get_doc_string_buffer_size is the actual buffer size, rather than
6469 being 1 less than the actual buffer size; this makes xpalloc more
6470 convenient.
6471
a69fbedb
PE
6472 * image.c (x_allocate_bitmap_record, cache_image):
6473 * xselect.c (Fx_register_dnd_atom):
6474 Simplify previous changes by using xpalloc.
6475
fe5c5d37
PE
6476 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6477 since either will do and ptrdiff_t is convenient with xpalloc.
6478
0065d054
PE
6479 * charset.c (charset_table_size)
6480 (struct charset_sort_data.priority): Now ptrdiff_t.
6481 (charset_compare): Don't overflow if priorities differ greatly.
6482 (Fsort_charsets): Don't assume list length fits in int.
6483 Check for size-calculation overflow when allocating sort data.
6484 (syms_of_charset): Allocate an initial charset table that is
6485 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6486
6487 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6488
6489 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6490 The actual value is always <= INT_MAX, and leaving it unsigned made
6491 overflow checking harder.
6492
6493 * dispextern.h (struct glyph_matrix.rows_allocated)
6494 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6495 with xpalloc. The values are still always <= INT_MAX.
6496
6497 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6498
6499 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6500 (SAFE_NALLOCA): New macro.
6501
6502 * region-cache.c (struct boundary.pos, find_cache_boundary)
6503 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6504 (set_cache_region, invalidate_region_cache)
6505 (revalidate_region_cache, know_region_cache, region_cache_forward)
6506 (region_cache_backward, pp_cache):
6507 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6508 so that ptrdiff_t * can be passed to xpalloc.
6509 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6510 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6511 (pp_cache): Don't assume cache_len fits in int.
6512 * region-cache.h: Adjust extern decls to match.
6513
6514 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6515 EMACS_INT, since either will do, for xpalloc.
6516
6517 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6518 (xnmalloc, xnrealloc, xpalloc): New functions.
6519
726e0ab1
PE
6520 * bidi.c (bidi_shelve_header_size): New constant.
6521 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6522 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6523
51f30bc5 6524 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6525 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6526 (overlay_strings):
6527 Don't update size of array until after memory allocation succeeds,
6528 because xmalloc/xrealloc may not return.
0065d054
PE
6529 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6530 now that we have proper integer overflow checking.
6531 (record_overlay_string, overlay_strings): Catch overflows when
6532 calculating size of overlay_str_buf.
726e0ab1 6533
0065d054
PE
6534 * callproc.c (Fcall_process): Check for size overflow when
6535 calculating size of args2.
6536 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6537 Normally we prefer signed values, but sticking with ptrdiff_t would
6538 require adding more-complicated checks.
726e0ab1
PE
6539
6540 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6541 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6542 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6543 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6544
6545 * character.c (Fstring): Check for size-calculation overflow.
6546
6547 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6548 unnecessary integer overflow. Check for size overflow.
6549 (encode_coding_object): Don't update size until xmalloc succeeds.
6550
6551 * composite.c (get_composition_id): Check for overflow in glyph
6552 length calculations.
6553
6554 Integer and memory overflow fixes for display code.
6555 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6556 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6557 (scrolling_window): Check for overflow in size calculations.
6558 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6559 Don't assume glyph table len fits in int.
6560 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6561 (row_table_size): Now ptrdiff_t, not int.
6562 (scrolling_window): Avoid overflow in size calculations.
6563 Don't update size until allocation succeeds.
6564 * fns.c (concat): Check for overflow in size calculations.
6565 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6566 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6567 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6568
6569 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6570 (get_doc_string): Check for size calculation overflow.
6571 Don't update size until allocation succeeds.
6572 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6573 EMACS_INT, where ptrdiff_t will do.
6574 (Fsubstitute_command_keys): Check for string overflow.
6575
6576 * editfns.c (set_time_zone_rule): Don't assume environment length
6577 fits in int.
6578 (message_length): Now ptrdiff_t, not int.
6579 (Fmessage_box): Don't update size until allocation succeeds.
6580 Don't assume message length fits in int.
6581 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6582
0065d054
PE
6583 * emacs.c (main): Do not reallocate argv, since there is a null at
6584 the end that can be overwritten, and this way there's no need to
6585 worry about size-calculation overflow.
6586 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6587
6588 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6589 alloc succeeds.
6590 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6591
6592 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6593 (x_set_scroll_bar_width, x_figure_window_size):
6594 Check for integer overflow.
6595 (x_set_alpha): Do not assume XINT fits in int.
6596
6597 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6598 This is for the members text_lines, text_cols, total_lines, total_cols,
6599 where the system imposes an 'int' limit.
6600
6601 * fringe.c (Fdefine_fringe_bitmap):
6602 Don't update size until alloc works.
6603
6604 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6605 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6606
6607 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6608 Check for size-calculation overflow.
6609 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6610 do, as we prefer signed integers.
6611 (id_to_widget.max_size, id_to_widget.used)
6612 (xg_store_widget_in_map, xg_remove_widget_from_map)
6613 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6614 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6615 Use and return ptrdiff_t, not int.
6616 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6617 * gtkutil.h: Change prototypes to match the above.
6618
6619 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6620 are duplicate now that they've been promoted to lisp.h.
6621 (x_allocate_bitmap_record, x_alloc_image_color)
6622 (make_image_cache, cache_image, xpm_load):
6623 Don't update size until alloc is done.
6624 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6625 (x_detect_edges):
3256efce 6626 Check for size calculation overflow.
726e0ab1
PE
6627 (ct_colors_allocated_max): New constant.
6628 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6629 overflow.
3256efce 6630
726e0ab1
PE
6631 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6632 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6633 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6634 Use ptrdiff_t, not int, to count maps.
6635 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
6636 calculations. Don't update size until allocation succeeds.
6637 Redo calculations to avoid overflow.
726e0ab1
PE
6638 * keyboard.h: Change prototypes to match the above.
6639
6640 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6641 to count maps.
6642 (current_minor_maps): Check for size calculation overflow.
6643 * keymap.h: Change prototypes to match the above.
6644
6645 * lread.c (read1, init_obarray): Don't update size until alloc done.
6646
6647 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6648 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6649
726e0ab1
PE
6650 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6651 Now ptrdiff_t, not int.
6652 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6653 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6654
6655 * process.c (Fnetwork_interface_list): Check for overflow
6656 in size calculation.
6657
6658 * region-cache.c (move_cache_gap): Check for size calculation overflow.
6659
6660 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6661 overflow. Don't bother calling xmalloc when xrealloc will do.
6662
6663 * search.c (Freplace_match): Check for size calculation overflow.
6664 (Fset_match_data): Don't assume list lengths fit in 'int'.
6665
6666 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6667 for command line length. Do not attempt to address one before the
6668 beginning of an array, as that's not portable.
6669
6670 * term.c (max_frame_lines): Remove; unused.
6671 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6672 not int.
6673 (encode_terminal_code, calculate_costs): Check for size
6674 calculation overflow.
6675 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6676 table lengths and related sizes. Don't update size until alloc
6677 done. Redo calculations to avoid overflow.
6678 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6679
6680 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6681 subtracting pointers.
6682 (gobble_line): Check for overflow more carefully. Don't update size
6683 until alloc done.
6684
6685 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6686 Don't update size until alloc done.
6687 Redo size calculations to avoid overflow.
6688 Check for size calculation overflow.
0065d054 6689 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
6690
6691 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6692 Use ptrdiff_t, not int, for sizes.
6693 (store_mode_line_noprop_char): Don't update size until alloc done.
6694
0065d054
PE
6695 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6696 Use ptrdiff_t, not int, for sizes.
6697 (Finternal_make_lisp_face, cache_face):
6698 Check for size calculation overflow.
6699 (cache_face): Treat size calculation overflows as if they were
6700 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
6701
6702 * xfns.c (x_encode_text, x_set_name_internal)
6703 (Fx_change_window_property): Use ptrdiff_t, not int, to count
6704 sizes, since they can exceed INT_MAX in size. Check for size
6705 calculation overflow.
6706
0065d054
PE
6707 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6708 (xg_select): Check for size calculation overflow.
726e0ab1
PE
6709 Don't update size until alloc done.
6710
0065d054 6711 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 6712 as sprintf is limited to int lengths.
1d526e2f 6713
252c5ee1
PE
6714 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6715 (X_LONG_MIN): New macros.
864d7ce7
PE
6716 Use them to make the following changes clearer.
6717 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6718 This change doesn't affect the value now, but it may help remind
6719 future maintainers not to raise the value too much later.
6720 (SELECTION_QUANTUM): Remove, replacing with ...
6721 (selection_quantum): ... new function, which avoids overflow.
6722 All uses changed.
6723 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6724 assumption that selection length fits in 'int'.
6725 (x_reply_selection_request, x_handle_selection_request)
6726 (x_get_window_property, receive_incremental_selection)
6727 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6728 (lisp_data_to_selection_data, clean_local_selection_data):
6729 Use ptrdiff_t, not int, to record length of selection.
6730 (x_reply_selection_request, x_get_window_property)
6731 (receive_incremental_selection, x_property_data_to_lisp):
6732 Redo calculations to avoid overflow.
6733 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 6734 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
6735 something.
6736 (x_get_window_property, receive_incremental_selection)
6737 (lisp_data_to_selection_data, x_property_data_to_lisp):
6738 Check for size-calculation overflow.
6739 (x_get_window_property, receive_incremental_selection)
6740 (lisp_data_to_selection_data, Fx_register_dnd_atom):
6741 Don't store size until memory allocation succeeds.
6742 (x_get_window_property): Plug memory leak on memory exhaustion.
6743 Don't double-block input; malloc is safe here. Don't assume 2**34
6744 - 4 fits in unsigned long. Add an xassert to check
6745 XGetWindowProperty overflow. Be more careful about overflow
6746 calculations, and distinguish size from memory overflow better.
6747 (receive_incremental_selection): When tracing, don't assume
6748 unsigned int is less than INT_MAX.
6749 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6750 harmful) conversions of unsigned short to int.
6751 (lisp_data_to_selection_data): Don't assume that integers
6752 in the range -65535 through -1 fit in an X unsigned short.
6753 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
6754 result parameters unless successful. Rely on cons_to_unsigned
6755 to report problems with elements; the old code wasn't right anyway.
6756 (x_check_property_data): Check for int overflow; we cannot use
6757 a wider type due to X limits.
6758 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6759
726e0ab1 6760 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 6761
0065d054
PE
6762 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6763 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
6764 (x_color_cells): Don't store size until memory allocation succeeds.
6765 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 6766 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
6767 (x_term_init): Don't assume length fits in int (sprintf is limited
6768 to int size).
bc18e09d 6769
ebfa62c0
PE
6770 Use ptrdiff_t for composition IDs.
6771 * character.c (lisp_string_width):
6772 * composite.c (composition_table_size, n_compositions)
6773 (get_composition_id, composition_gstring_from_id):
6774 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6775 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6776 * window.c (Frecenter):
6777 Use ptrdiff_t, not int, for composition IDs.
6778 * composite.c (get_composition_id): Check for integer overflow.
6779 * composite.h: Adjust prototypes to match the above changes.
6780
d3411f89
PE
6781 Use ptrdiff_t for hash table indexes.
6782 * category.c (hash_get_category_set):
6783 * ccl.c (ccl_driver):
6784 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6785 * coding.c (coding_system_charset_list, detect_coding_system):
6786 * coding.h (struct coding_system.id):
6787 * composite.c (get_composition_id, gstring_lookup_cache):
6788 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6789 * image.c (xpm_get_color_table_h):
6790 * lisp.h (hash_lookup, hash_put):
6791 * minibuf.c (Ftest_completion):
6792 Use ptrdiff_t for hash table indexes, not int (which is too
6793 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6794 32-bit --with-wide-int hosts).
6795
e097a6fa
PE
6796 * charset.c (Fdefine_charset_internal): Check for integer overflow.
6797 Add a FIXME comment about memory leaks.
6798 (syms_of_charset): Don't assume xmalloc returns.
6799
5637687f
PE
6800 Don't assume that stated character widths fit in int.
6801 * character.c (Fchar_width, c_string_width, lisp_string_width):
6802 * character.h (CHAR_WIDTH):
6803 * indent.c (MULTIBYTE_BYTES_WIDTH):
6804 Use sanitize_char_width to avoid undefined and/or bad behavior
6805 with outlandish widths.
a66cfb1c 6806 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
6807 now that we have two such functions. All uses changed.
6808 (sanitize_char_width): New inline function.
6809
a2271ba2
PE
6810 Don't assume that tab-width fits in int.
6811 * character.h (sanitize_width): New inline function.
6812 (SANE_TAB_WIDTH): New macro.
6813 (ASCII_CHAR_WIDTH): Use it.
6814 * indent.c (sane_tab_width): Remove. All uses replaced by
6815 SANE_TAB_WIDTH (current_buffer).
6816 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6817
18c52557
PE
6818 * fileio.c: Integer overflow issues with file modes.
6819 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6820
caeeedc1
PE
6821 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
6822 Remove unreachable code.
6823 (read_hex, load_charset_map_from_file): Check for integer overflow.
6824
6df6ae42 6825 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
6826 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6827 (x_send_scroll_bar_event): Likewise. Check that the size does not
6828 exceed limits imposed by XClientMessageEvent, as well as the usual
6829 ptrdiff_t and size_t limits.
6830
b13995db
PE
6831 * keyboard.c: Overflow, signedness and related fixes.
6832 (make_lispy_movement): Use same integer type in forward decl
6833 that is used in the definition.
6834 (read_key_sequence, keyremap_step):
6835 Change bufsize argument back to int, undoing my 2011-03-30 change.
6836 We prefer signed types, and int is wide enough here.
6837 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6838 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
6839 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
6840 length, not size_t. Use ptrdiff_t for index, not int.
6841 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6842 possibility of integer overflow.
6843
13464394
PE
6844 Overflow, signedness and related fixes for images.
6845
6846 * dispextern.h (struct it.stack[0].u.image.image_id)
6847 (struct_it.image_id, struct image.id, struct image_cache.size)
6848 (struct image_cache.used, struct image_cache.ref_count):
6849 * gtkutil.c (update_frame_tool_bar):
6850 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6851 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6852 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6853 * nsmenu.m (update_frame_tool_bar):
6854 * xdisp.c (calc_pixel_width_or_height):
6855 * xfns.c (image_cache_refcount):
6856 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6857 on typical 64-bit hosts.
6858
6859 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6860 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6861 Omit unnecessary casts to int.
6862 (parse_image_spec): Check that integers fall into 'int' range
6863 when the callers expect that.
6864 (image_ascent): Redo ascent calculation to avoid int overflow.
6865 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6866 (lookup_image): Remove unnecessary tests.
6867 (xbm_image_p): Locals are now of int, not EMACS_INT,
6868 since parse_image_check makes sure they fit into int.
6869 (png_load, gif_load, svg_load_image):
6870 Prefer int to unsigned where either will do.
6871 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
6872 old tiff_error_handler and tiff_warning_handler.
6873 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
6874 stack buffer overflows. It uses only the features of vsnprintf
6875 that are common to both POSIX and native Microsoft.
6876 (tiff_error_handler, tiff_warning_handler): Use it.
6877 (tiff_load, gif_load, imagemagick_load_image):
6878 Don't assume :index value fits in 'int'.
6879 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6880 (imagemagick_load_image): Check that crop parameters fit into
6881 the integer types that MagickCropImage accepts. Don't assume
6882 Vimagemagick_render_type has a nonnegative value. Don't assume
6883 size_t fits in 'long'.
6884 (gs_load): Use printmax_t to print the widest integers possible.
6885 Check for integer overflow when computing image height and width.
6886
c11821d4
EZ
68872011-08-26 Eli Zaretskii <eliz@gnu.org>
6888
6889 * xdisp.c (redisplay_window): Don't force window start if point
6890 will be invisible in the resulting window. (Bug#9324)
6891
0c95fcf7
EZ
68922011-08-25 Eli Zaretskii <eliz@gnu.org>
6893
6894 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6895 the display spec is of the form `(space ...)'.
6896 (handle_display_spec): Return the value returned by
6897 handle_single_display_spec, not just 1 or zero.
6898 (handle_single_display_spec): If the display spec is of the form
6899 `(space ...)', and specifies display in the text area, return 2
6900 rather than 1.
fee65a97 6901 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
6902 accurately, and prefer exact match for point under bidi.
6903 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
6904
6905 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6906 into disp_prop; all users changed.
6907
6908 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6909 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6910 for the text covered by the display property.
6911
e4ed06f1
CY
69122011-08-25 Chong Yidong <cyd@stupidchicken.com>
6913
6914 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
6915 Change return value to nil.
6916 (Frecord_buffer): Delete unused function.
6917
f67cdd7f
EZ
69182011-08-24 Eli Zaretskii <eliz@gnu.org>
6919
5980d4c6
EZ
6920 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
6921 buffers, return left-to-right.
8610fe8b
EZ
6922 (set_cursor_from_row): Consider candidate row a win if its glyph
6923 represents a newline and point is on that newline. Fixes cursor
6924 positioning on the newline at EOL of R2L text within L2R
6925 paragraph, and vice versa.
6926 (try_cursor_movement): Check continued rows, in addition to
6927 continuation rows. Fixes unwarranted scroll when point enters a
6928 continued line of R2L text within an L2R paragraph, or vice versa.
6929 (cursor_row_p): Consider the case of point being equal to
6930 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
6931 from the end of a short line to the beginning of a continued line
6932 of R2L text within L2R paragraph.
6933 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
6934 composed characters.
5980d4c6 6935
f67cdd7f
EZ
6936 * bidi.c (bidi_check_type): Use xassert.
6937 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
6938 members.
6939
bca633fb
EZ
69402011-08-23 Eli Zaretskii <eliz@gnu.org>
6941
6942 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
6943 a character.
6944
4a5885a7
CY
69452011-08-23 Chong Yidong <cyd@stupidchicken.com>
6946
6947 * nsfont.m (ns_otf_to_script): Fix typo.
6948
0902a04e
KH
69492011-08-22 Kenichi Handa <handa@m17n.org>
6950
6951 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
6952 extra slot even if the purpose is char-code-property-table.
6953
1a2e6670
EZ
69542011-08-23 Eli Zaretskii <eliz@gnu.org>
6955
8ddde651
EZ
6956 * xdisp.c (redisplay_window): When computing centering_position,
6957 account for the height of the header line. (Bug#8874)
6958
425cc014
EZ
6959 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
6960 instead of CHAR_TO_BYTE. Fixes a crash when a completion
6961 candidate is selected by the mouse, and that candidate has a
6962 composed character under the mouse.
6963
1a2e6670
EZ
6964 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
6965 coordinates reported by pos-visible-in-window-p for a composed
6966 character in column zero.
6967
8b76d6f8
SM
69682011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
6969
6970 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
6971
dac347dd
EZ
69722011-08-22 Eli Zaretskii <eliz@gnu.org>
6973
6974 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
6975 consider it a hit if to_charpos is anywhere in the range of the
6976 composed buffer positions.
6977
e013fb34
CY
69782011-08-22 Chong Yidong <cyd@stupidchicken.com>
6979
6980 * image.c (gif_load): Don't assume that each subimage has the same
6981 dimensions as the base image. Handle disposal method that is
6982 "undefined" by the gif spec (Bug#9335).
6983
bd1ba3e8
CY
69842011-08-20 Chong Yidong <cyd@stupidchicken.com>
6985
6986 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 6987 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 6988
54a1215b
EZ
69892011-08-19 Eli Zaretskii <eliz@gnu.org>
6990
823564e5
EZ
6991 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
6992 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
6993 from an Org mode buffer to a Speedbar frame.
6994
54a1215b
EZ
6995 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
6996 a composition, take its buffer position from IT->cmp_it.charpos.
6997 Fixes cursor positioning at the beginning of a line that begins
6998 with a composed character.
6999
9778ebcc
EZ
70002011-08-18 Eli Zaretskii <eliz@gnu.org>
7001
0be6ee06
EZ
7002 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7003 character bidirectional type, use STRONG_L instead. Fixes crashes
7004 in a buffer produced by `describe-categories'.
7005
9778ebcc
EZ
7006 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7007 members before the level stack, so they would be saved and
7008 restored when copying iterator state. Fixes incorrect reordering
7009 around TABs covered by display properties.
7010
156bffbe
AS
70112011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7012
6b02f655 7013 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7014
72ad093b
CY
70152011-08-17 Chong Yidong <cyd@stupidchicken.com>
7016
7017 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7018 (internal_condition_case_2, internal_condition_case_n):
7019 Remove unnecessary aborts (Bug#9081).
72ad093b 7020
35774242
EZ
70212011-08-17 Eli Zaretskii <eliz@gnu.org>
7022
7023 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7024 has no `load' handler, try opening the file locally. (Bug#9311)
7025
db76dd85
KB
70262011-08-16 Ken Brown <kbrown@cornell.edu>
7027
7028 * gmalloc.c: Expand comment.
7029
b215eee5
EZ
70302011-08-16 Eli Zaretskii <eliz@gnu.org>
7031
7032 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7033 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7034
a4579d33
KB
70352011-08-16 Ken Brown <kbrown@cornell.edu>
7036
7037 Fix memory allocation problems in Cygwin build (Bug#9273).
7038
7039 * unexcw.c ( __malloc_initialized): Declare external variable.
7040 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7041
8b76d6f8
SM
7042 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7043 New variables.
a4579d33
KB
7044 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7045 dumped emacs.
7046 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7047 in the static heap.
7048 [CYGWIN] (special_realloc): New function.
7049 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7050 requests to realloc storage in the static heap.
7051
3ebec551
PE
70522011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7053
7054 * bidi.c (bidi_initialize): Remove unused local.
7055
9fd8be00
EZ
70562011-08-15 Eli Zaretskii <eliz@gnu.org>
7057
6b02f655
SM
7058 * bidimirror.h:
7059 * biditype.h: Remove file.
7060 * makefile.w32-in ($(BLD)/bidi.$(O)):
7061 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7062
7063 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7064
7065 * chartab.c: Improve commentary for the uniprop_table API.
7066
32413314
EZ
7067 * bidi.c (bidi_paragraph_init): Support zero value of
7068 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7069 (bidi_initialize): Use uniprop_table instead of including
7070 biditype.h and bidimirror.h.
32413314 7071
9fd8be00
EZ
7072 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7073 coordinates of the iterator when restoring from ppos_it.
7074 (Bug#9296)
7075
5cf2b69b
KH
70762011-08-14 Kenichi Handa <handa@m17n.org>
7077
7078 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7079 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7080
daf17d00
EZ
70812011-08-14 Eli Zaretskii <eliz@gnu.org>
7082
7083 * xdisp.c (move_it_in_display_line_to): Don't invoke
7084 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7085 ppos_it. Fixes vertical cursor motion when line beginning is
7086 covered by an image. (Bug#9296)
7087
08e3161a
JD
70882011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7089
7090 * nsterm.h (ns_run_ascript): Declare.
7091 (NSAPP_DATA2_RUNASSCRIPT): Define.
7092
7093 * nsfns.m (as_script, as_result, as_status): New static variables.
7094 (ns_run_ascript): New function.
5e617bc2 7095 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7096 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7097 the event loop. Get status from as_status (Bug#7276).
7098
7099 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7100 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7101 the event loop (Bug#7276).
7102
a3720aa2
AS
71032011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7104
7105 * gnutls.c (QCgnutls_bootprop_priority)
7106 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7107 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7108 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7109 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7110 (QCgnutls_bootprop_verify_hostname_error)
7111 (QCgnutls_bootprop_callbacks_verify): Rename from
7112 Qgnutls_bootprop_..., all uses changed.
7113
7114 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7115 uses changed.
7116
0a0d27fb
PE
71172011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7118
19d5c50c
PE
7119 * xfaces.c (Qframe_set_background_mode): Now static.
7120 * dispextern.h (Qframe_set_background_mode): Remove decl.
7121
0a0d27fb
PE
7122 * process.c (Fnetwork_interface_info): Declare local only if needed.
7123
377538cb
JD
71242011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7125
7126 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7127 (Fnetwork_interface_list): Allocate in increments of bytes instead
7128 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7129 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7130 sockaddr.
7131 (struct ifflag_def): notrailers is smart on OSX.
7132 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7133 Get hardware address with getifaddrs if available.
7134
08fff70c
EZ
71352011-08-12 Eli Zaretskii <eliz@gnu.org>
7136
7137 * xdisp.c (iterate_out_of_display_property): xassert that
7138 IT->position is set to within IT->object's boundaries. Break from
7139 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7140 when IT->position is set up wrongly due to some bug.
7141 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7142 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7143 entry. Force push_it to save on the stack the current
7144 buffer/string position, to be restored by pop_it. Fix flags in
7145 the iterator structure wrt the object coming from a display
7146 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7147 properties. (Bug#9284)
7148
7be1c708 71492011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7150
7be1c708
CY
7151 * fontset.c (fontset_get_font_group): Add proper type checks.
7152 (Bug#9172)
aac0c6e3 7153
7be1c708 71542011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7155
7be1c708
CY
7156 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7157 and LC_VERSION_MIN_MACOSX.
7158 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7159 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7160
97bb72a6
EZ
71612011-08-08 Eli Zaretskii <eliz@gnu.org>
7162
7163 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7164 no-display-properties-and-no-overlays under bidi display.
7165 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7166 properties and overlays.
97bb72a6 7167
d5617611
CY
71682011-08-08 Chong Yidong <cyd@stupidchicken.com>
7169
37e11a63
CY
7170 * editfns.c (Fset_time_zone_rule): Document relationship with the
7171 setenv function.
7172
d5617611
CY
7173 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7174 the font entity extracted from the cache (Bug#8109).
7175
58872834
CY
71762011-08-07 Chong Yidong <cyd@stupidchicken.com>
7177
7178 * composite.c (autocmp_chars): Don't reset point. That is done by
7179 restore_point_unwind (Bug#5984).
7180
75bfc667
JL
71812011-08-07 Juri Linkov <juri@jurta.org>
7182
7183 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7184 to show the arg `TIME' instead of `TIMEVAL'.
7185
d1410150
EZ
71862011-08-06 Eli Zaretskii <eliz@gnu.org>
7187
7188 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7189 display property strides EOL and includes a newline, as in
7190 longlines-mode. (Bug#9254)
75b771e4
EZ
7191 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7192 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7193
7194 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7195 is non-zero, even if the data buffer is NULL. Fixes a crash in
7196 vertical-motion with longlines-mode. (Bug#9254)
7197
35928349
EZ
71982011-08-05 Eli Zaretskii <eliz@gnu.org>
7199
ec7cc85b
EZ
7200 * bidi.c <bidi_cache_total_alloc>: Now static.
7201 (bidi_initialize): Initialize bidi_cache_total_alloc.
7202
8b76d6f8 7203 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7204 cache. (Bug#9221)
7205
7206 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7207 amount allocated this far in `bidi_cache_total_alloc'.
7208 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7209 non-zero, only free the data buffer without restoring the cache
7210 contents. All callers changed.
7211
7212 * dispextern.h (bidi_unshelve_cache): Update prototype.
7213
7214 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7215 (move_it_in_display_line, move_it_to)
7216 (move_it_vertically_backward, move_it_by_lines): Replace the call
7217 to xfree to an equivalent call to bidi_unshelve_cache.
7218 (move_it_in_display_line_to): Fix logic of returning
412b6358 7219 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7220
e2e2423b
EZ
72212011-08-05 Eli Zaretskii <eliz@gnu.org>
7222
7223 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7224 came from a string character with a `cursor' property. (Bug#9229)
7225
ae9e757a
JD
72262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7227
7228 * Makefile.in (LIB_PTHREAD): New variable.
7229 (LIBES): Add LIB_PTHREAD (Bug#9216).
7230
7231 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7232 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7233
213bd7f2
AS
72342011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7235
6b02f655 7236 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7237
99aaf75f
JD
72382011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7239
7240 * xterm.c (x_find_topmost_parent): New function.
7241 (x_set_frame_alpha): Find topmost parent window with
7242 x_find_topmost_parent and set the property there also (bug#9181).
7243 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7244
c74e9d86
PE
72452011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7246
7247 * callproc.c (Fcall_process): Avoid vfork clobbering
7248 the local vars buffer, coding_systems, current_dir.
7249
640c8776
SM
72502011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7251
7252 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7253
f26d0e4c
PE
72542011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7255
8a10d76c
PE
7256 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7257 so that it is not optimized away.
7258
f26d0e4c
PE
7259 * xdisp.c (compute_display_string_pos): Remove unused local.
7260
55439c61
EZ
72612011-08-02 Eli Zaretskii <eliz@gnu.org>
7262
7263 Fix slow cursor motion and scrolling in large buffers with
7264 selective display, like Org Mode buffers. (Bug#9218)
7265
7266 * dispextern.h (struct bidi_it): New member disp_prop_p.
7267
7268 * xdisp.c: Remove one-slot cache of display string positions.
7269 (compute_display_string_pos): Accept an additional argument
5e617bc2 7270 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7271 for a display string or property. If found, set DISP_PROP_P
7272 non-zero.
7273
7274 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7275 DISP_PROP_P, and pass it to compute_display_string_pos.
7276 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7277 non-zero. All callers of bidi_fetch_char changed.
7278
fb33fa43
SM
72792011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7280
7281 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7282
b099e063
DM
72832010-12-03 Don March <don@ohspite.net>
7284
7285 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7286 last character M-[char] is translated to ESC [char] (bug#7541).
7287
5cc7f7af
KH
72882011-08-02 Kenichi Handa <handa@m17n.org>
7289
d0fffa3f 7290 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7291
7292 * chartab.c (uniprop_table): Make it non-static.
7293
525d5e6e
EZ
72942011-08-01 Eli Zaretskii <eliz@gnu.org>
7295
7296 * xdisp.c (forward_to_next_line_start): Accept additional argument
7297 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7298 on the newline.
7299 (reseat_at_next_visible_line_start): Use the bidi iterator state
7300 returned by forward_to_next_line_start to restore the state of
7301 it->bidi_it after backing up to previous newline. (Bug#9212)
7302
31011111
AS
73032011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7304
7305 * regex.c (re_comp): Protoize.
7306 (re_exec): Fix return type.
7307 (regexec): Fix type of `ret'. (Bug#9203)
7308
476371c4
PE
73092011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7310
e5d76069
PE
7311 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7312 This is needed if max-image-size is a floating-point number.
7313
9a79b20c
AS
73142011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7315
7316 * print.c (print_object): Print empty symbol as ##.
7317
7318 * lread.c (read1): Read ## as empty symbol.
7319
d8c2fa78
AA
73202011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7321
7322 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7323 setting frame foreground color (Bug#9175).
7324 (x_set_background_color): Likewise.
7325
ffe57a7a
AA
7326 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7327 contents (Bug#9176).
7328 (EmacsTooltip -init): Remove bezels and add shadows to
7329 tooltip windows.
7330
bf3492a5
AA
7331 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7332 or scroll bar (Bug#8470).
7333
d55e9c53
AA
7334 * nsfont.m (nsfont_open): Remove assignment to voffset and
7335 unnecessary vars hshink, expand, hd, full_height, min_height.
7336 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7337
7338 * nsterm.h (nsfont_info): Remove voffset field.
7339
d8c2fa78 73402011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7341
7342 Implement strike-through and overline on NextStep (Bug#8863).
7343
7344 * nsfont.m (nsfont_open): Use underline position provided by font,
7345 instead of hard-coded value of 2.
7346 (nsfont_draw): Call ns_draw_text_decoration instead.
7347
7348 * nsterm.h: Add declaration for ns_draw_text_decoration.
7349
7350 * nsterm.m (ns_draw_text_decoration): New function for drawing
7351 underline, overline, and strike-through.
7352 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7353 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7354 accommodate underlining, etc.
4843aac3 7355
4cc60b9b
EZ
73562011-07-28 Eli Zaretskii <eliz@gnu.org>
7357
bc7ece87
EZ
7358 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7359 default.
4cc60b9b 7360
476371c4
PE
73612011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7362
66606eea
PE
7363 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7364 Without this fix, if a signal arrives just after memory fills up,
7365 'malloc' might be invoked reentrantly.
7366
476371c4
PE
7367 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7368 In other words, assume that every image size is allowed, on non-X
7369 hosts. This assumption is probably wrong, but it lets Emacs compile.
7370
f3fcc40d
AS
73712011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7372
7373 * regex.c (re_iswctype): Convert return values to boolean.
7374
350c992f
EZ
73752011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7376
7377 * xdisp.c (compute_display_string_pos): Don't use cached display
7378 string position if the buffer had its restriction changed.
7379 (Bug#9184)
7380
5266b4bb
PE
73812011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7382
7383 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7384
2573a837 73852011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7386
41f55ccd 7387 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7388
39e378da
PE
7389 * bidi.c: Integer size and overflow fixes.
7390 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7391 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7392 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7393 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7394 (bidi_find_other_level_edge):
7395 Use ptrdiff_t instead of EMACS_INT where either will do.
7396 This works better on 32-bit hosts configured --with-wide-int.
7397 (bidi_cache_ensure_space): Check for size-calculation overflow.
7398 Use % rather than repeated addition, for better worst-case speed.
7399 Don't set bidi_cache_size until after xrealloc returns, because it
7400 might not return.
7401 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7402 (bidi_cache_ensure_space): Also check that the bidi cache size
7403 does not exceed that of the largest Lisp string or buffer. See Eli
7404 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7405
5e927815
PE
7406 * alloc.c (__malloc_size_t): Remove.
7407 All uses replaced by size_t. See Andreas Schwab's note
7408 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7409
ca4aa935
PE
7410 * image.c: Improve checking for integer overflow.
7411 (check_image_size): Assume that f is nonnull, since
7412 it is always nonnull in practice. This is one less thing to
7413 worry about when checking for integer overflow later.
7414 (x_check_image_size): New function, which checks for integer
7415 overflow issues inside X.
7416 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7417 This removes the need for a memory_full check.
7418 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7419 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7420 (xbm_read_bitmap_data): Change locals back to 'int', since
7421 their values must fit in 'int'.
7422 (xpm_load_image, png_load, tiff_load):
7423 Invoke x_create_x_image_and_pixmap earlier,
7424 to avoid much needless work if the image is too large.
7425 (tiff_load): Treat overly large images as if
7426 x_create_x_image_and_pixmap failed, not as malloc failures.
7427 (gs_load): Use x_check_image_size.
7428
5f8f9cc2
PE
7429 * gtkutil.c: Omit integer casts.
7430 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7431 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7432
5adf60bc
PE
7433 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7434
c8907a93
PE
7435 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7436 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7437 would wrongly return t on a 64-bit host.
7438
e3c25c68
PE
7439 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7440 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7441 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7442 and therefore cause GCC to emit a bogus diagnostic in some cases.
7443
3f791afe
PE
7444 * image.c: Integer signedness and overflow and related fixes.
7445 This is not an exhaustive set of fixes, but it's time to
7446 record what I've got.
7447 (lookup_pixel_color, check_image_size): Remove redundant decls.
7448 (check_image_size): Don't assume that arbitrary EMACS_INT values
7449 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7450 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7451 (tiff_load, imagemagick_load_image):
7452 Check for overflow in size calculations.
7453 (x_create_x_image_and_pixmap): Remove unnecessary test for
7454 xmalloc returning NULL; that can't happen.
7455 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7456 (xpm_color_bucket): Use better integer hashing function.
7457 (xpm_cache_color): Don't possibly over-allocate memory.
7458 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7459 (gif_memory_source):
7460 Use ptrdiff_t, not int or size_t, to record sizes.
7461 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7462 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7463 either works, as we prefer signed integers.
7464 (tiff_read_from_memory, tiff_write_from_memory):
7465 Return tsize_t, not size_t, since that's what the TIFF API wants.
7466 (tiff_read_from_memory): Don't fail simply because the read would
7467 go past EOF; instead, return a short read.
7468 (tiff_load): Omit no-longer-needed casts.
7469 (Fimagemagick_types): Don't assume size fits into 'int'.
7470
3cc5a532
PE
7471 Improve hashing quality when configured --with-wide-int.
7472 * fns.c (hash_string): New function, taken from sxhash_string.
7473 Do not discard information about ASCII character case; this
7474 discarding is no longer needed.
7475 (sxhash-string): Use it. Change sig to match it. Caller changed.
7476 * lisp.h: Declare it.
7477 * lread.c (hash_string): Remove, since we now use fns.c's version.
7478 The fns.c version returns a wider integer if --with-wide-int is
7479 specified, so this should help the quality of the hashing a bit.
7480
b312a492
PE
7481 * emacs.c: Integer overflow minor fix.
7482 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7483 Define only if GNU_LINUX.
7484 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7485
dfd153ae
PE
7486 * dispnew.c: Integer signedness and overflow fixes.
7487 Remove unnecessary forward decls, that were a maintenance hassle.
7488 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7489 All uses changed.
7490 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7491 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7492 (prepare_desired_row, line_draw_cost):
7493 Use int, not unsigned, where either works.
7494 (save_current_matrix, restore_current_matrix):
7495 Use ptrdiff_t, not size_t, where either works.
7496 (init_display): Check for overflow more accurately, and without
7497 relying on undefined behavior.
7498
a81d11a3
PE
7499 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7500 Remove, replacing with the new symbols in lisp.h. All uses changed.
7501 * fileio.c (make_temp_name):
7502 * filelock.c (lock_file_1, lock_file):
7503 * xdisp.c (message_dolog):
7504 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7505 Use pMd etc. instead.
7506 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7507 replacing the pWIDE etc. symbols removed from editfns.c.
7508
3300e6fd
PE
7509 * keyboard.h (num_input_events): Now uintmax_t.
7510 This is (very slightly) less likely to mess up due to wraparound.
7511 All uses changed.
7512
fd05c7e9
PE
7513 * buffer.c: Integer signedness fixes.
7514 (alloc_buffer_text, enlarge_buffer_text):
7515 Use ptrdiff_t rather than size_t when either will do, as we prefer
7516 signed integers.
7517
903fe15d
PE
7518 * alloc.c: Integer signedness and overflow fixes.
7519 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7520 (__malloc_size_t): Default to size_t, not to int.
7521 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7522 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7523 Prefer ptrdiff_t to size_t when either would do, as we prefer
7524 signed integers.
7525 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7526 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7527 Now const. Initialize with values that are in range even if char
7528 is signed.
7529 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7530 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7531 These functions do the right thing with sizes > 2**32.
7532 (check_depth): Now ptrdiff_t, not int.
7533 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7534 Adjust to new way of storing sizes. Check for size overflow bugs
7535 in rest of code.
7536 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7537 slightly wrong anyway, as it missed one instance of
7538 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7539 (refill_memory_reserve): Omit needless cast to size_t.
7540 (mark_object_loop_halt): Mark as externally visible.
7541
ac82cc6a
PE
7542 * xselect.c: Integer signedness and overflow fixes.
7543 (Fx_register_dnd_atom, x_handle_dnd_message):
7544 Use ptrdiff_t, not size_t, since we prefer signed.
7545 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7546 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7547 x_dnd_atoms_size and x_dnd_atoms_length.
7548
c2d1e36d
PE
7549 * doprnt.c: Prefer signed to unsigned when either works.
7550 * eval.c (verror):
7551 * doprnt.c (doprnt):
7552 * lisp.h (doprnt):
7553 * xdisp.c (vmessage):
7554 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7555 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7556 prefer signed arithmetic to avoid comparison confusion.
7557 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7558 but is a bit tricky.
7559
0e926e56
PE
7560 Assume freestanding C89 headers, string.h, stdlib.h.
7561 * data.c, doprnt.c, floatfns.c, print.c:
7562 Include float.h unconditionally.
7563 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7564 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7565 * regex.c: Likewise for stddef.h, string.h.
7566 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7567 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7568 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7569 (STDC_HEADERS): Remove obsolete defines.
7570 * sysdep.c: Include limits.h unconditionally.
7571
9cfdb3ec
PE
7572 Assume support for memcmp, memcpy, memmove, memset.
7573 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7574 * regex.c (memcmp, memcpy):
7575 Remove; we assume C89 now.
7576
7577 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7578 (__malloc_safe_bcopy): Remove; no longer needed.
7579
cf950e6b 7580 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7581 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7582 well either way, and we prefer signed to unsigned.
7583
dbf38e02
LMI
75842011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7585
7586 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7587 closes the connection while we're reading (bug#9182).
7588
d6f0886c 75892011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7590
d6f0886c
JD
7591 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7592 are specified (Bug#9168).
24e0f6b1 7593
2eb1f9e6
PE
75942011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7595
7596 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7597 Found by GCC static checking and --with-wide-int on a 32-bit host.
7598
22381272 75992011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7600
7601 * xdisp.c (compute_display_string_pos): Fix logic of caching
7602 previous display string position. Initialize cached_prev_pos to
7603 -1. Fixes slow-down at the beginning of a buffer.
7604
f25e39b4
EZ
76052011-07-24 Eli Zaretskii <eliz@gnu.org>
7606
7607 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7608 for attrs[LFACE_FONTSET_INDEX].
7609
04c4b52e
PE
76102011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7611
7612 * xml.c (parse_region): Remove unused local
7613 that was recently introduced.
7614
c1734fbd
EZ
76152011-07-23 Eli Zaretskii <eliz@gnu.org>
7616
be18c5a5
EZ
7617 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7618 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7619
c1734fbd
EZ
7620 * xdisp.c (move_it_in_display_line_to): Record the best matching
7621 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
7622 exit if none of the characters scanned was an exact match.
7623 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
7624 when exact match is impossible due to invisible text, and the
7625 lines are truncated.
7626
a258d627
JD
76272011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7628
7629 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7630 for OSX >= 10.7.
7631
b6d5a689
EZ
76322011-07-22 Eli Zaretskii <eliz@gnu.org>
7633
0f74f785
EZ
7634 Fix a significant slow-down of cursor motion with C-n, C-p,
7635 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7636 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 7637 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
7638 (next_element_from_buffer): Call compute_stop_pos_backwards to
7639 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
7640 base_level_stop.
7641 (reseat): Don't look for prev_stop, as that could mean a very long
7642 run.
7643 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7644 <cached_disp_overlay_modiff>: Cache for last found display string
7645 position.
551918c1 7646 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
7647 about the same buffer in the same area of character positions, and
7648 the buffer wasn't changed since the time the display string
7649 position was cached.
551918c1 7650
b2d0c91a
EZ
76512011-07-22 Eli Zaretskii <eliz@gnu.org>
7652
7653 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7654 is an integer, which is important for empty lines. (Bug#9149)
7655
043604ee
CY
76562011-07-22 Chong Yidong <cyd@stupidchicken.com>
7657
7658 * frame.c (Fmodify_frame_parameters): In tty case, update the
7659 default face if necessary (Bug#4238).
7660
da4adb04
CY
76612011-07-21 Chong Yidong <cyd@stupidchicken.com>
7662
7663 * editfns.c (Fstring_to_char): No need to explain what a character
7664 is in the docstring (Bug#6576).
7665
9abd0532
LMI
76662011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7667
7668 * xml.c (parse_region): Make sure we always return a tree.
7669
36881d16
HK
76702011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7671
7672 * xml.c (parse_region): If a document contains only comments,
7673 return that, too.
7674
1e98674d
LMI
76752011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7676
7677 * xml.c (make_dom): Return comments, too.
7678
590bd467
PE
76792011-07-19 Paul Eggert <eggert@cs.ucla.edu>
7680
7681 Port to OpenBSD.
7682 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7683 and the surrounding thread.
7684 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7685 rather than fgets, and retry after EINTR. Otherwise, 'emacs
7686 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7687 timer goes off.
7688 * s/openbsd.h (BROKEN_SIGIO): Define.
7689 * unexelf.c (unexec) [__OpenBSD__]:
7690 Don't update the .mdebug section of the Alpha COFF symbol table.
7691
f41628b2
LMI
76922011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7693
7694 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7695 (bug#8460).
7696
b59b67c5
PE
76972011-07-18 Paul Eggert <eggert@cs.ucla.edu>
7698
15e3a074
PE
7699 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7700 This fixes some race conditions on the permissions of any newly
7701 created file.
7702
41bed37d
PE
7703 * alloc.c (valid_pointer_p): Use pipe, not open.
7704 This fixes some permissions issues when debugging.
7705
b59b67c5
PE
7706 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
7707 If fchown fails to set both uid and gid, try to set just gid,
7708 as that is sometimes allowed. Adjust the file's mode to eliminate
7709 setuid or setgid bits that are inappropriate if fchown fails.
7710
925a6be7
SM
77112011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7712
7713 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7714 to compare Lisp_Objects.
7715 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7716 global_gnutls_log_level, don't mistake it for a Lisp_Object.
7717 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7718
52968808
AS
77192011-07-17 Andreas Schwab <schwab@linux-m68k.org>
7720
0a6a104b
AS
7721 * lread.c (read_integer): Unread even EOF character.
7722 (read1): Likewise. Properly record start position of symbol.
7723
52968808
AS
7724 * lread.c (read1): Read `#:' as empty uninterned symbol if no
7725 symbol character follows.
7726
9e381cdd
PE
77272011-07-17 Paul Eggert <eggert@cs.ucla.edu>
7728
7729 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
7730 This works around a problem with the previous change to Fcopy_file.
7731 Recent glibc declares fchown with __attribute__((warn_unused_result)),
7732 and without this change, GCC might complain about discarding
7733 fchown's return value.
7734
b5641435
JB
77352011-07-16 Juanma Barranquero <lekktu@gmail.com>
7736
7737 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7738
a8031457
PE
77392011-07-16 Paul Eggert <eggert@cs.ucla.edu>
7740
7741 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
7742
dd889327
LMI
77432011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
7744
750c33f7
LMI
7745 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7746 it's used from the C level.
7747
dd889327
LMI
7748 * process.c: Use the same condition for POLL_FOR_INPUT in both
7749 keyboard.c and process.c (bug#1858).
7750
87e86684
LM
77512011-07-09 Lawrence Mitchell <wence@gmx.li>
7752
7753 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7754 (Fgnutls_boot): Use it.
7755
64348f40
AS
77562011-07-15 Andreas Schwab <schwab@linux-m68k.org>
7757
7758 * doc.c (Fsubstitute_command_keys): Revert last change.
7759
1d698799
LMI
77602011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
7761
f863868c
LMI
7762 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7763 quotes the next character, and doesn't affect other longer
7764 sequences (bug#8935).
7765
1d698799
LMI
7766 * lread.c (syms_of_lread): Clarify that is isn't only
7767 `eval-buffer' and `eval-defun' that's affected by
7768 `lexical-binding' (bug#8460).
7769
aa4b6df6
EZ
77702011-07-15 Eli Zaretskii <eliz@gnu.org>
7771
7772 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 7773 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 7774
5d856da6
PE
77752011-07-14 Paul Eggert <eggert@cs.ucla.edu>
7776
ad6042bb
PE
7777 Fix minor problems found by static checking.
7778 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7779 (elsz): Now a signed constant, not a size_t var. We prefer signed
7780 types to unsigned, to avoid integer comparison confusion. Without
7781 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7782 "cannot optimize loop, the loop counter may overflow", a symptom
7783 of the confusion.
f00bbb22 7784 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
7785 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7786
6468f31c
LMI
77872011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7788
49080b10
LMI
7789 * search.c (Fre_search_backward): Mention `case-fold-search' in
7790 all the re_search_* functions (bug#8138).
7791
6468f31c
LMI
7792 * keyboard.c (Fopen_dribble_file): Document when the file is
7793 closed (bug#8056).
7794
c965adc5
EZ
77952011-07-14 Eli Zaretskii <eliz@gnu.org>
7796
df9733bf
EZ
7797 * bidi.c (bidi_dump_cached_states): Fix format of displaying
7798 bidi_cache_idx.
7799
0bb23927
EZ
7800 Support bidi reordering of display and overlay strings.
7801 * xdisp.c (compute_display_string_pos)
7802 (compute_display_string_end): Accept additional argument STRING.
7803 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7804 (reseat_to_string): Initialize bidi_it->string.s and
7805 bidi_it->string.schars.
7806 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
7807 NULL (avoids a crash in bidi_paragraph_init).
7808 Initialize itb.string.lstring.
0bb23927
EZ
7809 (init_iterator): Call bidi_init_it only of a valid
7810 buffer position was specified. Initialize paragraph_embedding to
7811 L2R.
7812 (reseat_to_string): Initialize the bidi iterator.
7813 (display_string): If we need to ignore text properties of
7814 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
7815 original value of -1 will not work with bidi.)
7816 (compute_display_string_pos): First arg is now struct
7817 `text_pos *'; all callers changed. Support display properties on
7818 Lisp strings.
7819 (compute_display_string_end): Support display properties on Lisp
7820 strings.
7821 (init_iterator, reseat_1, reseat_to_string): Initialize the
7822 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7823 when iterating on a string not from display properties).
640c8776
SM
7824 (compute_display_string_pos, compute_display_string_end):
7825 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
7826 arrow keys.
7827 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
7828 base_level_stop; instead, set base_level_stop to BEGV.
7829 Fixes crashes in vertical-motion.
0bb23927
EZ
7830 (next_element_from_buffer): Improve commentary for when
7831 the iterator is before prev_stop.
7832 (init_iterator): Initialize bidi_p from the default value of
7833 bidi-display-reordering, not from buffer-local value. Use the
7834 buffer-local value only if initializing for buffer iteration.
7835 (handle_invisible_prop): Support invisible properties on strings
7836 that are being bidi-reordered.
7837 (set_iterator_to_next): Support bidi reordering of C strings and
7838 Lisp strings.
7839 (next_element_from_string): Support bidi reordering of Lisp
7840 strings.
7841 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
7842 (display_string): Support display of R2L glyph rows.
7843 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
7844 (init_iterator): Don't initialize it->bidi_p for strings
7845 here.
7846 (reseat_to_string): Initialize it->bidi_p for strings here.
7847 (next_element_from_string, next_element_from_c_string)
7848 (next_element_from_buffer): Add xassert's for correspondence
7849 between IT's object being iterated and it->bidi_it.string
7850 structure.
7851 (face_before_or_after_it_pos): Support bidi iteration.
7852 (next_element_from_c_string): Handle the case of the first string
7853 character that is not the first one in the visual order.
7854 (get_visually_first_element): New function, refactored from common
7855 parts of next_element_from_buffer, next_element_from_string, and
7856 next_element_from_c_string.
7857 (tool_bar_lines_needed, redisplay_tool_bar)
7858 (display_menu_bar): Force left-to-right direction. Add a FIXME
7859 comment for making that be controlled by a user option.
7860 (push_it, pop_it): Save and restore the state of the
7861 bidi iterator. Save and restore the bidi_p flag.
7862 (pop_it): Iterate out of display property for string iteration as
7863 well.
7864 (iterate_out_of_display_property): Support iteration over strings.
7865 (handle_single_display_spec): Set up it->bidi_it for iteration
7866 over a display string, and call bidi_init_it.
7867 (handle_single_display_spec, next_overlay_string)
7868 (get_overlay_strings_1, push_display_prop): Set up the bidi
7869 iterator for displaying display or overlay strings.
7870 (forward_to_next_line_start): Don't use the shortcut if
7871 bidi-iterating.
7872 (back_to_previous_visible_line_start): If handle_display_prop
7873 pushed the iterator stack, restore the internal state of the bidi
7874 iterator by calling bidi_pop_it same number of times.
7875 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7876 and we are bidi-iterating, don't decrement the iterator position;
7877 instead, set the first_elt flag in the bidi iterator, to produce
7878 the same effect.
7879 (reseat_1): Remove redundant setting of string_from_display_prop_p.
7880 (push_display_prop): xassert that we are iterating a buffer.
7881 (push_it, pop_it): Save and restore paragraph_embedding member.
7882 (handle_single_display_spec, next_overlay_string)
7883 (get_overlay_strings_1, reseat_1, reseat_to_string)
7884 (push_display_prop): Set up the `unibyte' member of bidi_it.string
7885 correctly. Don't assume unibyte strings are not bidi-reordered.
7886 (compute_display_string_pos)
7887 (compute_display_string_end): Fix handling the case of C string.
7888 (push_it, pop_it): Save and restore from_disp_prop_p.
7889 (handle_single_display_spec, push_display_prop): Set the
7890 from_disp_prop_p flag.
7891 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7892 (pop_it): Call iterate_out_of_display_property only if we are
7893 popping after iteration over a string that came from a display
7894 property. Fix a typo in popping stretch info. Add an assertion
7895 for verifying that the iterator position is in sync with the bidi
7896 iterator.
7897 (handle_single_display_spec, get_overlay_strings_1)
7898 (push_display_prop): Fix initialization of paragraph direction for
7899 string when that of the parent object is not yet determined.
7900 (reseat_1): Call bidi_init_it to resync the bidi
7901 iterator with IT's position. (Bug#7616)
7902 (find_row_edges): If ROW->start.pos gives position
7903 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
7904 (handle_stop, back_to_previous_visible_line_start, reseat_1):
7905 Reset the from_disp_prop_p flag.
7906 (SAVE_IT, RESTORE_IT): New macros.
7907 (pos_visible_p, face_before_or_after_it_pos)
7908 (back_to_previous_visible_line_start)
7909 (move_it_in_display_line_to, move_it_in_display_line)
7910 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7911 (try_scrolling, redisplay_window, display_line): Use them when
7912 saving a temporary copy of the iterator and restoring it back.
7913 (back_to_previous_visible_line_start, reseat_1)
7914 (init_iterator): Empty the bidi cache "stack".
7915 (move_it_in_display_line_to): If iterator ended up at
7916 EOL, but we never saw any buffer positions smaller than
7917 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
7918 motion in bidi-reordered lines.
7919 (move_it_in_display_line_to): Record prev_method and prev_pos
7920 immediately before the call to set_iterator_to_next. Fixes cursor
7921 motion in bidi-reordered lines with stretch glyphs and strings
7922 displayed in margins. (Bug#8133) (Bug#8867)
7923 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
7924 TO_CHARPOS.
640c8776
SM
7925 (pos_visible_p): Support positions in bidi-reordered lines.
7926 Save and restore bidi cache.
0bb23927
EZ
7927
7928 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
7929 (bidi_paragraph_info): Delete unused struct.
7930 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
7931 (bidi_cache_start): New variable.
7932 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
7933 to zero.
7934 (bidi_cache_fetch_state, bidi_cache_search)
7935 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7936 (bidi_cache_find, bidi_peek_at_next_level)
7937 (bidi_level_of_next_char, bidi_find_other_level_edge)
7938 (bidi_move_to_visually_next): Compare cache index with
7939 bidi_cache_start rather than with zero.
7940 (bidi_fetch_char): Accept new argument STRING; all callers
7941 changed. Support iteration over a string. Support strings with
7942 display properties. Support unibyte strings. Fix the type of
7943 `len' according to what STRING_CHAR_AND_LENGTH expects.
7944 (bidi_paragraph_init, bidi_resolve_explicit_1)
7945 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
7946 (bidi_level_of_next_char, bidi_move_to_visually_next):
7947 Support iteration over a string.
0bb23927
EZ
7948 (bidi_set_sor_type, bidi_resolve_explicit_1)
7949 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
7950 can now be zero (for strings); special values 0 and -1 were
7951 changed to -1 and -2, respectively.
7952 (bidi_char_at_pos): New function.
7953 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
7954 Call it instead of FETCH_MULTIBYTE_CHAR.
7955 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
7956 initialized to valid values.
7957 (bidi_init_it): Don't initialize charpos and bytepos with invalid
7958 values.
7959 (bidi_level_of_next_char): Allow the sentinel "position" to pass
7960 the test for valid cached positions. Fix the logic for looking up
7961 the sentinel state in the cache. GCPRO the Lisp string we are
7962 iterating.
7963 (bidi_push_it, bidi_pop_it): New functions.
7964 (bidi_initialize): Initialize the bidi cache start stack pointer.
7965 (bidi_cache_ensure_space): New function, refactored from part of
7966 bidi_cache_iterator_state. Don't assume the required size is just
7967 one BIDI_CACHE_CHUNK away.
7968 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
7969 (bidi_count_bytes, bidi_char_at_pos): New functions.
7970 (bidi_cache_search): Don't assume bidi_cache_last_idx is
7971 always valid if bidi_cache_idx is valid.
7972 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
7973 is valid if it's going to be used.
7974 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
7975 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
7976 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7977 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
7978 (bidi_find_other_level_edge, bidi_cache_start_stack):
7979 All variables related to cache indices are now EMACS_INT.
c965adc5 7980
0bb23927
EZ
7981 * dispextern.h (struct bidi_string_data): New structure.
7982 (struct bidi_it): New member `string'. Make flag members be 1-bit
7983 fields, and put them last in the struct.
640c8776
SM
7984 (compute_display_string_pos, compute_display_string_end):
7985 Update prototypes.
0bb23927
EZ
7986 (bidi_push_it, bidi_pop_it): Add prototypes.
7987 (struct iterator_stack_entry): New members bidi_p,
7988 paragraph_embedding, and from_disp_prop_p.
7989 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
7990 (bidi_shelve_cache, bidi_unshelve_cache):
7991 Declare prototypes.
0bb23927
EZ
7992
7993 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
7994 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
7995 and vector-like objects.
7996
7997 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
7998 cache around display iteration.
7999
8000 * window.c (Fwindow_end, window_scroll_pixel_based)
8001 (displayed_window_lines, Frecenter): Save and restore the bidi
8002 cache around display iteration.
8003
3bbd2265
LMI
80042011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8005
8006 * editfns.c (Fdelete_region): Clarify the use of the named
8007 parameters (bug#6788).
8008
adc47434
MR
80092011-07-14 Martin Rudalics <rudalics@gmx.at>
8010
8011 * indent.c (Fvertical_motion): Set and restore w->pointm when
8012 saving and restoring the window's buffer (Bug#9006).
8013
837c31f8
LMI
80142011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8015
8016 * editfns.c (Fstring_to_char): Clarify just what is returned
8017 (bug#6576). Text by Eli Zaretskii.
8018
ac389d0c
JB
80192011-07-13 Juanma Barranquero <lekktu@gmail.com>
8020
8021 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8022
0be0ce47
EZ
80232011-07-13 Eli Zaretskii <eliz@gnu.org>
8024
8025 * buffer.c (mmap_find): Fix a typo.
8026
cd18e7e3
JB
80272011-07-13 Johan Bockgård <bojohan@gnu.org>
8028
8029 Fix execution of x selection hooks.
8030 * xselect.c (Qx_lost_selection_functions)
8031 (Qx_sent_selection_functions): New vars.
8032 (syms_of_xselect): DEFSYM them.
8033 (x_handle_selection_request): Pass Qx_sent_selection_functions
8034 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8035 (x_handle_selection_clear,x_clear_frame_selections):
8036 Pass Qx_lost_selection_functions rather than
8037 Vx_lost_selection_functions to Frun_hook_with_args.
8038
47ea7f44
PE
80392011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8040
ac389d0c 8041 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8042 The old code sometimes used this field without initializing it.
8043
47ea7f44
PE
8044 * alloc.c (gc_sweep): Don't read past end of array.
8045 In theory, the old code could also have corrupted Emacs internals,
8046 though it'd be very unlikely.
8047
bc985c87
AS
80482011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8049
8050 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8051 argument. (Bug#4026)
bc985c87 8052
0cf34688
LMI
80532011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8054
b3dadd76
LMI
8055 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8056 key" (bug#4257).
8057
0cf34688
LMI
8058 * window.c (Fset_window_start): Doc fix (bug#4199).
8059 (Fset_window_hscroll): Ditto.
8060
270768cd
PE
80612011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8062
077e3dda 8063 Fix minor new problems caught by GCC 4.6.1.
270768cd 8064 * term.c (init_tty): Remove unused local.
490011a6 8065 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8066 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8067 not used otherwise.
270768cd 8068
b1f58454
CY
80692011-07-12 Chong Yidong <cyd@stupidchicken.com>
8070
8071 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8072
22b9578d
LMI
80732011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8074
6e70ab07
LMI
8075 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8076 are the mini-buffer and the echo area (bug#3320).
8077
22b9578d
LMI
8078 * term.c (init_tty): Remove support for supdup, c10 and perq
8079 terminals, which are no longer supported (bug#1482).
8080
8974cc9f
JB
80812011-07-10 Johan Bockgård <bojohan@gnu.org>
8082
8083 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8084
a560d974
JD
80852011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8086
8087 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8088 for non-popups (Bug#3642).
8089
1dae0f0a
AS
80902011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8091
268c2c36 8092 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8093 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8094 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8095 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8096 * data.c (fmod): Likewise.
8097 * dispnew.c (swap_glyphs_in_rows): Likewise.
8098 * emacs.c (memory_warning_signal): Likewise.
8099 * floatfns.c (float_error): Likewise.
8100 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8101 (otf_open, font_otf_capability, generate_otf_features)
8102 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8103 Likewise.
8104 * image.c (pbm_read_file): Likewise.
8105 * indent.c (string_display_width): Likewise.
8106 * intervals.c (check_for_interval, search_for_interval)
8107 (inc_interval_count, count_intervals, root_interval)
8108 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8109 * lread.c (defalias): Likewise.
268c2c36 8110 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8111 * regex.c (set_image_of_range_1, set_image_of_range)
8112 (regex_grow_registers): Likewise.
8113 * sysdep.c (strerror): Likewise.
8114 * termcap.c (valid_filename_p, tprint, main): Likewise.
8115 * tparam.c (main): Likewise.
8116 * unexhp9k800.c (run_time_remap, save_data_space)
8117 (update_file_ptrs, read_header, write_header, calculate_checksum)
8118 (copy_file, copy_rest, display_header): Likewise.
8119 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8120 Likewise.
8121 * xdisp.c (check_it): Likewise.
8122 * xfaces.c (register_color, unregister_color, unregister_colors):
8123 Likewise.
8124 * xfns.c (print_fontset_result): Likewise.
8125 * xrdb.c (member, fatal, main): Likewise.
8126
99033785
PE
81272011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 Fix minor problems found by static checking (Bug#9031).
8130 * chartab.c (char_table_set_range, map_sub_char_table):
8131 Remove unused locals.
8132 (uniprop_table): Now static.
8133 * composite.c (_work_char): Remove unused static var.
8134
9cb2ac56
JB
81352011-07-09 Juanma Barranquero <lekktu@gmail.com>
8136
8137 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8138
f25661f0
JD
81392011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8140
8141 * gtkutil.c (qttip_cb): Remove code without function.
8142
8278c4fe
EZ
81432011-07-09 Eli Zaretskii <eliz@gnu.org>
8144
8145 * w32.c (pthread_sigmask): New stub.
8146
1692ae2d 81472011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8148
8a6ebd58 8149 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8150 sigprocmask is portable only for single-threaded applications, and
8151 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8152 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8153 (LIBES): Use it.
8154 * callproc.c (Fcall_process):
8155 * process.c (create_process):
8156 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8157 Use pthread_sigmask, not sigprocmask.
123403e4 8158
1b854618
JD
81592011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8160
8161 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8162 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8163 wrong (Bug#8591).
8164
3fe4b549
JD
81652011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8166
0ce7e563
JD
8167 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8168 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8169 (xg_hide_tooltip): Fix comment.
8170
3fe4b549
JD
8171 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8172 in registerServicesMenuSendTypes.
8173 (validRequestorForSendType): Don't check ns_return_types.
8174
8175 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8176 ns_return_type.
8177
5df75e47
JR
81782011-07-08 Jason Rumney <jasonr@gnu.org>
8179
22610910
JR
8180 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8181 SH_SHOW for hidden windows (Bug#5482).
8182
5df75e47
JR
8183 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8184 frame struct members of non-existent frames (Bug#6284).
8185
699c10bd
JD
81862011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8187
4393663b
JD
8188 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8189 variable firstTime not needed on OSX >= 10.6.
8190 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8191 >= 10.5. Use setKnobProportion, setDoubleValue.
8192
8193 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8194 (MAC_OS_X_VERSION_10_5): Define if not defined.
8195 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8196 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8197 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8198
8199 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8200 cString and lossyCString on OSX >= 10.4.
4393663b 8201
58179cce 8202 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8203 sizeToFit on OSX >= 10.2.
8204
8205 * nsimage.m (allocInitFromFile): Don't use deprecated method
8206 bestRepresentationForDevice on OSX >= 10.6.
8207
8208 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8209 to avoid warning.
8210
8211 * emacs.c: Declare unexec_init_emacs_zone.
8212
a63e0781
JD
8213 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8214
699c10bd
JD
8215 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8216
8217 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8218 on svcsMenu (Bug#8842).
8219
8220 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8221 ns_return_types.
8222 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8223
8224 * nsterm.m (QUTF8_STRING): Declare.
8225 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8226 (validRequestorForSendType): Return type is (id).
8227 Change indexOfObjectIdenticalTo to indexOfObject.
8228 Check if we have local selection before returning self (Bug#8842).
8229 (writeSelectionToPasteboard): Put local selection into paste board
8230 if we have a local selection (Bug#8842).
8231 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8232
8233 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8234 (ns_get_local_selection): Declare.
8235
54e10184
LMI
82362011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8237
9888ff71
LMI
8238 * keymap.c (describe_map_tree): Don't insert a double newline at
8239 the end of the buffer (bug#1169) and return whether we inserted
8240 something.
8241
54e10184
LMI
8242 * callint.c (Fcall_interactively): Change "reading args" to
8243 "providing args" to try to clarify what it does (bug#1010).
8244
15fa4783
KH
82452011-07-07 Kenichi Handa <handa@m17n.org>
8246
8247 * composite.c (composition_compute_stop_pos): Ignore a static
8248 composition starting before CHARPOS (Bug#8915).
8249
8250 * xdisp.c (handle_composition_prop): Likewise.
8251
a8815b00
EZ
82522011-07-07 Eli Zaretskii <eliz@gnu.org>
8253
8254 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8255 (Bug#9015)
8256
ef7b981d 82572011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8258
8259 * character.h (unicode_category_t): New enum type.
8260
8261 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8262 (Qchar_code_property_table): New variable.
8263 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8264 (UNIPROP_COMPRESSED_FORM_P): New macros.
8265 (char_table_ascii): Uncompress the compressed values.
8266 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8267 Uncompress the compressed values.
ac389d0c 8268 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8269 (char_table_ref_and_range): Uncompress the compressed values.
8270 (sub_char_table_set): New arg is_uniprop. Callers changed.
8271 Uncompress the compressed values.
8272 (sub_char_table_set_range): Args changed. Callers changed.
8273 (char_table_set_range): Adjuted for the above change.
8274 (map_sub_char_table): Delete args default_val and parent. Add arg
8275 top. Give decoded values to a Lisp function.
640c8776 8276 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8277 values to a Lisp function. Gcpro more variables.
8278 (uniprop_table_uncompress)
8279 (uniprop_decode_value_run_length): New functions.
8280 (uniprop_decoder, uniprop_decoder_count): New variables.
8281 (uniprop_get_decoder, uniprop_encode_value_character)
8282 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8283 New functions.
8284 (uniprop_encoder, uniprop_encoder_count): New variables.
8285 (uniprop_get_encoder, uniprop_table)
8286 (Funicode_property_table_internal, Fget_unicode_property_internal)
8287 (Fput_unicode_property_internal): New functions.
8288 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8289 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8290 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8291 char-code-property-alist.
8292
640c8776 8293 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8294 Vunicode_category_table.
8295
640c8776 8296 * font.c (font_range): Adjust for the change of
c805dec0
KH
8297 Vunicode_category_table.
8298
76b397fb
DN
82992011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8300
8301 * m/iris4d.h: Remove file, move contents ...
8302 * s/irix6-5.h: ... here.
8303
22b4128e
PE
83042011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8305
8306 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8307 * alloc.c (mark_buffer):
8308 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8309 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8310 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8311 This isn't true in general, and it's particularly not true
8312 if Emacs is configured with --with-wide-int.
8313 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8314 New macros, used in the buffer.c change.
8315
869795d6
JD
83162011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8317
8318 * xsettings.c: Use both GConf and GSettings if both are available.
8319 (store_config_changed_event): Add comment.
8320 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8321 (store_tool_bar_style_changed): New functions.
5e617bc2 8322 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8323 (struct xsettings): Move font inside HAVE_XFT.
8324 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8325 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8326 Move inside HAVE_XFT.
640c8776 8327 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8328 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8329 also.
8330 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8331 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8332 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8333 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8334 (parse_settings): Move check for font inside HAVE_XFT.
8335 (read_settings, apply_xft_settings): Add comment.
8336 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8337 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8338 call store_font_name_changed.
8339 (xft_settings_event): Add comment.
8340 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8341 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8342 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8343 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8344 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8345 (xsettings_get_system_font, xsettings_get_system_normal_font):
8346 Add comment.
869795d6 8347
d8ed26bd
PE
83482011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8349
8350 Random fixes. E.g., (random) never returned negative values.
8351 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8352 subseconds part to the entropy, as that's a bit more random.
8353 Prefer signed to unsigned, since the signedness doesn't matter and
8354 in general we prefer signed. When given a limit, use a
8355 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8356 latter isn't right if USE_2_TAGS_FOR_INTS.
8357 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8358 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8359
cabf1cac
SM
83602011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8361
8362 * textprop.c (text_property_stickiness):
8363 Obey Vtext_property_default_nonsticky.
8364 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8365 * w32fns.c (syms_of_w32fns):
8366 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8367
6e9b2be9
PE
83682011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8369
8370 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8371 This is more efficient than Ffile_directory_p and avoids a minor race.
8372
90186c68
LMI
83732011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8374
7c301272
LMI
8375 * buffer.c (Foverlay_put): Say what the return value is
8376 (bug#7835).
8377
c4f2d8d4
LMI
8378 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8379 is a directory before asking whether to use the file name
8380 (bug#7564).
ad637907
LMI
8381 (barf_or_query_if_file_exists): Make the "File is a directory"
8382 error be more correct.
c4f2d8d4 8383
90186c68
LMI
8384 * fns.c (Frequire): Remove the mention of the .gz files, since
8385 that's installation-specific, but keep the mention of
8386 `get-load-suffixes'.
8387
da64016e
PE
83882011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8389
8390 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8391 Report string overflow if the output is too long.
8392
7d47b580
JB
83932011-07-04 Juanma Barranquero <lekktu@gmail.com>
8394
a555cb87
JB
8395 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8396 (syms_of_gnutls): Remove duplicate DEFSYM for
8397 Qgnutls_bootprop_verify_hostname_error, an error for
8398 Qgnutls_bootprop_verify_error (which is no longer used).
8399
7d47b580
JB
8400 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8401 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8402 Also (re)move comments that are misplaced or no longer relevant.
8403
1e49bfab
LMI
84042011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8405
8406 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8407
1485f4c0
CY
84082011-07-03 Chong Yidong <cyd@stupidchicken.com>
8409
8410 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8411 and background color parameters if they have been changed.
8412
a9ab721e
LMI
84132011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8414
8415 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8416
cf7cff57
PE
84172011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8418
2e13213d
PE
8419 * xsettings.c (SYSTEM_FONT): Define only when used.
8420 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8421
cf7cff57
PE
8422 * keymap.c (access_keymap_1): Now static.
8423
7a8e04f7
CY
84242011-07-02 Chong Yidong <cyd@stupidchicken.com>
8425
8426 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8427 leave any prefix arg for the up event (Bug#1586).
8428
61352f62
LMI
84292011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8430
69bb1ef7
LMI
8431 * lread.c (syms_of_lread): Mention single symbols defined by
8432 `defvar' or `defconst' (bug#7154).
8433
61352f62 8434 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8435 (Frequire): Mention get-load-suffixes.
61352f62 8436
28545e04
MR
84372011-07-02 Martin Rudalics <rudalics@gmx.at>
8438
8439 * window.h (window): Remove clone_number slot.
8440 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8441 Remove.
8442 (make_parent_window, make_window, saved_window)
8443 (Fset_window_configuration, save_window_save): Don't deal with
8444 clone numbers.
8445 * buffer.c (Qclone_number): Remove declaration.
8446 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8447
3349e122
SM
84482011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8449
8450 Add multiple inheritance to keymaps.
8451 * keymap.c (Fmake_composed_keymap): New function.
8452 (Fset_keymap_parent): Simplify.
8453 (fix_submap_inheritance): Remove.
8454 (access_keymap_1): New function extracted from access_keymap to handle
8455 embedded parents and handle lists of maps.
8456 (access_keymap): Use it.
8457 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8458 (Fcopy_keymap): Handle embedded parents.
8459 (Fcommand_remapping, define_as_prefix): Simplify.
8460 (Fkey_binding): Simplify.
8461 (syms_of_keymap): Move minibuffer-local-completion-map,
8462 minibuffer-local-filename-completion-map,
8463 minibuffer-local-must-match-map, and
8464 minibuffer-local-filename-must-match-map to Elisp.
8465 (syms_of_keymap): Defsubr make-composed-keymap.
8466 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8467 (parse_menu_item): Trivial simplification.
8468
3279eb87
GM
84692011-07-01 Glenn Morris <rgm@gnu.org>
8470
8471 * Makefile.in (SETTINGS_LIBS): Fix typo.
8472
4550efdf
KI
84732011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8474
8475 * coding.c (Fencode_coding_string): Record the last coding system
8476 used, as the function doc string says (bug#8738).
8477
0949d2b6
JD
84782011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8479
8480 * xsettings.c (store_monospaced_changed): Take new font as arg and
8481 check for change against current_mono_font.
8482 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8483 (emacs_settings_constructor, emacs_settings_get_property)
8484 (emacs_settings_set_property, emacs_settings_class_init)
8485 (emacs_settings_init, gsettings_obj): Remove.
8486 (something_changedCB): New function for HAVE_GSETTINGS.
8487 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8488 with value as argument.
8489 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8490 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8491 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8492 "changed".
8493
8494 * xgselect.c: Add defined (HAVE_GSETTINGS).
8495 (xgselect_initialize): Ditto.
8496
8497 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8498 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8499 xg_select.
8500
bbc6b304
PE
85012011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8502
8503 * eval.c (struct backtrace): Simplify and port the data structure.
8504 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8505 signed bit field, as this assumption is not portable and it makes
8506 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8507 "char debug_on_exit : 1" as this is not portable either; instead,
8508 use the portable "unsigned int debug_on_exit : 1". Remove unused
8509 member evalargs. Remove obsolete comments about cc bombing out.
8510
9851bfc5
JD
85112011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8512
51bb811f 8513 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8514 Let HAVE_GSETTINGS override HAVE_GCONF.
8515 (store_monospaced_changed): New function.
8516 (EMACS_SETTINGS): A new type derived from GObject to handle
8517 GSettings notifications.
8518 (emacs_settings_constructor, emacs_settings_get_property)
8519 (emacs_settings_set_property, emacs_settings_class_init):
8520 New functions.
8521 (gsettings_client, gsettings_obj): New variables.
8522 (GSETTINGS_SCHEMA): New define.
8523 (something_changedCB): Call store_monospaced_changed.
8524 (init_gsettings): New function.
8525 (xsettings_initialize): Call init_gsettings.
8526 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8527 to NULL.
8528
640c8776 8529 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8530 GCONF_CFLAGS/LIBS.
8531
5386012d
MR
85322011-06-29 Martin Rudalics <rudalics@gmx.at>
8533
8534 * window.c (resize_root_window, grow_mini_window)
8535 (shrink_mini_window): Rename Qresize_root_window to
8536 Qwindow_resize_root_window and Qresize_root_window_vertically to
8537 Qwindow_resize_root_window_vertically.
8538
f13e0b08
PE
85392011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8540
8541 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8542
94515237
JB
85432011-06-27 Juanma Barranquero <lekktu@gmail.com>
8544
8545 * makefile.w32-in: Redesign dependencies so they reflect more
8546 clearly which files are directly included by each source file,
8547 and not through other includes.
8548
e43b6e43
MR
85492011-06-27 Martin Rudalics <rudalics@gmx.at>
8550
8551 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8552 (sort_overlays, overlay_strings): When an overlay's clone number
8553 matches the window's clone number process the overlay even if
8554 the overlay's window property doesn't match the current window.
8555
d68443dc
MR
8556 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8557 (Fwindow_hchild): Rename to Fwindow_left_child.
8558 (Fwindow_next): Rename to Fwindow_next_sibling.
8559 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8560 (resize_window_check): Rename to window_resize_check.
8561 (resize_window_apply): Rename to window_resize_apply.
8562 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8563 (Fdelete_other_windows_internal, resize_frame_windows)
8564 (Fsplit_window_internal, Fdelete_window_internal)
8565 (grow_mini_window, shrink_mini_window)
8566 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8567
c7e73be5
JD
85682011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8569
8570 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8571 (emacs_fixed_set_min_size): Remove.
8572 (emacs_fixed_new): Take frame as argument.
8573
8574 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8575 (_EmacsFixedPrivate): Remove minwidth/height.
8576 Add struct frame *f.
8577 (emacs_fixed_init): Initialize priv->f.
8578 (get_parent_class, emacs_fixed_set_min_size): Remove.
8579 (emacs_fixed_new): Set priv->f to argument.
8580 (emacs_fixed_get_preferred_width)
8581 (emacs_fixed_get_preferred_height): Use min_width/height from
8582 frames size_hint to set minimum and natural (Bug#8919).
8583 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8584 and use min_width/height from frames size_hint to set
8585 min_width/height (Bug#8919).
8586
8587 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8588 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8589 Fix indentation.
c7e73be5 8590
cf99dcf8
EZ
85912011-06-26 Eli Zaretskii <eliz@gnu.org>
8592
8593 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8594 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8595 called at ZV.
8596
029529ac
CY
85972011-06-26 Chong Yidong <cyd@stupidchicken.com>
8598
8599 * process.c (wait_reading_process_output): Bypass select if
8600 waiting for a cell while ignoring keyboard input, and input is
8601 pending. Suggested by Jan Djärv (Bug#8869).
8602
7a7ef429
PE
86032011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 Use gnulib's dup2 module instead of rolling our own.
8606 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8607
11fdef7d 86082011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8609
8610 * dispnew.c (scrolling_window): Before scrolling, turn off a
8611 mouse-highlight in the window being scrolled.
8612
cd3520a4
JB
86132011-06-24 Juanma Barranquero <lekktu@gmail.com>
8614
8615 Move DEFSYM to lisp.h and use everywhere.
8616
8617 * character.h (DEFSYM): Move declaration...
8618 * lisp.h (DEFSYM): ...here.
8619
8620 * gnutls.c:
8621 * minibuf.c:
8622 * w32menu.c:
8623 * w32proc.c:
8624 * w32select.c: Don't include character.h.
8625
8626 * alloc.c (syms_of_alloc):
8627 * buffer.c (syms_of_buffer):
8628 * bytecode.c (syms_of_bytecode):
8629 * callint.c (syms_of_callint):
8630 * casefiddle.c (syms_of_casefiddle):
8631 * casetab.c (init_casetab_once):
8632 * category.c (init_category_once, syms_of_category):
8633 * ccl.c (syms_of_ccl):
8634 * cmds.c (syms_of_cmds):
8635 * composite.c (syms_of_composite):
8636 * dbusbind.c (syms_of_dbusbind):
8637 * dired.c (syms_of_dired):
8638 * dispnew.c (syms_of_display):
8639 * doc.c (syms_of_doc):
8640 * editfns.c (syms_of_editfns):
8641 * emacs.c (syms_of_emacs):
8642 * eval.c (syms_of_eval):
8643 * fileio.c (syms_of_fileio):
8644 * fns.c (syms_of_fns):
8645 * frame.c (syms_of_frame):
8646 * fringe.c (syms_of_fringe):
8647 * insdel.c (syms_of_insdel):
8648 * keymap.c (syms_of_keymap):
8649 * lread.c (init_obarray, syms_of_lread):
8650 * macros.c (syms_of_macros):
8651 * msdos.c (syms_of_msdos):
8652 * print.c (syms_of_print):
8653 * process.c (syms_of_process):
8654 * search.c (syms_of_search):
8655 * sound.c (syms_of_sound):
8656 * syntax.c (init_syntax_once, syms_of_syntax):
8657 * terminal.c (syms_of_terminal):
8658 * textprop.c (syms_of_textprop):
8659 * undo.c (syms_of_undo):
8660 * w32.c (globals_of_w32):
8661 * window.c (syms_of_window):
8662 * xdisp.c (syms_of_xdisp):
8663 * xfaces.c (syms_of_xfaces):
8664 * xfns.c (syms_of_xfns):
8665 * xmenu.c (syms_of_xmenu):
8666 * xsettings.c (syms_of_xsettings):
8667 * xterm.c (syms_of_xterm): Use DEFSYM.
8668
4228cf16
TZ
86692011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8670
cd3520a4 8671 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 8672
7fcccf1e
PE
86732011-06-23 Paul Eggert <eggert@cs.ucla.edu>
8674
7efb4e0e
PE
8675 Integer and buffer overflow fixes (Bug#8873).
8676
ff5844ad
PE
8677 * print.c (printchar, strout): Check for string overflow.
8678 (PRINTPREPARE, printchar, strout):
8679 Don't set size unless allocation succeeds.
8680
90532f02
PE
8681 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8682 for sizes. Check for string overflow more accurately.
8683 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8684
6d84508d
PE
8685 * macros.c: Integer and buffer overflow fixes.
8686 * keyboard.h (struct keyboard.kbd_macro_bufsize):
8687 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8688 Use ptrdiff_t, not int, for sizes.
8689 Don't increment bufsize until after realloc succeeds.
8690 Check for size-calculation overflow.
8691 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8692
437b2cb4
PE
8693 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8694
8b9ac8b4
PE
8695 * lread.c: Integer overflow fixes.
8696 (read_integer): Radix is now EMACS_INT, not int,
8697 to improve quality of diagnostics for out-of-range radices.
8698 Calculate buffer size correctly for out-of-range radices.
8699 (read1): Check for integer overflow in radices, and in
8700 read-circle numbers.
82cb60d3
PE
8701 (read_escape): Avoid int overflow.
8702 (Fload, openp, read_buffer_size, read1)
8703 (substitute_object_recurse, read_vector, read_list, map_obarray):
8704 Use ptrdiff_t, not int, for sizes.
8705 (read1): Use EMACS_INT, not int, for sizes.
20270765 8706 Check for size overflow.
8b9ac8b4 8707
7fcccf1e
PE
8708 * image.c (cache_image): Check for size arithmetic overflow.
8709
bfbbd7e7
PE
8710 * lread.c: Integer overflow issues.
8711 (saved_doc_string_size, saved_doc_string_length)
8712 (prev_saved_doc_string_size, prev_saved_doc_string_length):
8713 Now ptrdiff_t, not int.
8714 (read1): Don't assume doc string length fits in int. Check for
8715 out-of-range doc string lengths.
8716 (read_list): Don't assume file position fits in int.
39019e54 8717 (read_escape): Check for hex character overflow.
bfbbd7e7 8718
4e323265
LL
87192011-06-22 Leo Liu <sdl.web@gmail.com>
8720
8721 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8722 Move to minibuffer.el.
8723
85fece3e
PE
87242011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8725
20b84ce9 8726 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
8727 The following patches are for when GLYPH_DEBUG && !XASSERT.
8728 * dispextern.h (trace_redisplay_p, dump_glyph_string):
8729 * dispnew.c (flush_stdout):
8730 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8731 Mark as externally visible.
8732 * dispnew.c (check_window_matrix_pointers): Now static.
8733 * dispnew.c (window_to_frame_vpos):
8734 * xfns.c (unwind_create_frame):
8735 * xterm.c (x_check_font): Remove unused local.
8736 * scroll.c (CHECK_BOUNDS):
8737 * xfaces.c (cache_fache): Rename local to avoid shadowing.
8738 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8739 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8740 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8741 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8742 Now static.
8743 (debug_method_add): Use va_list and vsprintf rather than relying
8744 on undefined behavior with wrong number of arguments.
8745 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8746 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8747 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8748 since we're not interested in debugging glyphs with old libraries.
8749 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8750 GCC 4.6.0's static checking.
8751
0766b489
PE
87522011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8753
31fd4b32
PE
8754 Integer overflow and signedness fixes (Bug#8873).
8755 A few related buffer overrun fixes, too.
8756
b79e8648
PE
8757 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8758
0766b489
PE
8759 * dispextern.h (struct face.stipple):
8760 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8761 (x_bitmap_mask, x_allocate_bitmap_record)
8762 (x_create_bitmap_from_data, x_create_bitmap_from_file)
8763 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8764 (x_create_bitmap_from_xpm_data):
8765 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8766 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8767 (.bitmaps_last):
8768 * xfaces.c (load_pixmap):
8769 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8770 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8771 (.bitmaps_last, struct x_output.icon_bitmap):
8772 Use ptrdiff_t, not int, for bitmap indexes.
8773 (x_allocate_bitmap_record): Check for size overflow.
8774 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8775
b081724f
PE
8776 Use ptrdiff_t, not int, for overlay counts.
8777 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8778 * editfns.c (overlays_around, get_pos_property):
8779 * textprop.c (get_char_property_and_overlay):
8780 * xdisp.c (next_overlay_change, note_mouse_highlight):
8781 * xfaces.c (face_at_buffer_position):
21514da7
PE
8782 * buffer.c (OVERLAY_COUNT_MAX): New macro.
8783 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8784 (Fnext_overlay_change, Fprevious_overlay_change)
8785 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 8786 Use ptrdiff_t, not int, for sizes.
21514da7 8787 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 8788
3de73e5e
PE
8789 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8790
2606c57b
PE
8791 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8792 (x_session_initialize): Do not assume string length fits in int.
8793
aaafe47a
PE
8794 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8795 This is unlikely, but can occur if DPI is outlandish.
8796
2674ddc8 8797 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
8798 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8799
28154962
PE
8800 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8801 * xrdb.c (magic_file_p, search_magic_path):
8802 Omit last arg SUFFIX; it was always 0. All callers changed.
8803 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
8804
7de51af5
PE
8805 * xfont.c (xfont_match): Avoid need for strlen.
8806
25ed6cc3
PE
8807 * xfns.c: Don't assume strlen fits in int.
8808 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8809
4eab31dd
PE
8810 * xdisp.c (message_log_check_duplicate): Return intmax_t,
8811 not unsigned long, as we prefer signed integers. All callers changed.
8812 Detect integer overflow in repeat count.
8813 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 8814 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 8815
171e2a58
PE
8816 * termcap.c: Don't assume sizes fit in int and never overflow.
8817 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8818 (gobble_line): Check for size-calculation overflow.
8819
ad39faca 8820 * minibuf.c (Fread_buffer):
6e5bb2dc 8821 * lread.c (intern, intern_c_string):
74ca2eb3
PE
8822 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8823 Don't assume string length fits in int.
8824
52c61c22 8825 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
8826 * gtkutil.c (style_changed_cb): Avoid need for strlen.
8827
b5b8c9e5
PE
8828 * font.c: Don't assume string length fits in int.
8829 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8830 Use ptrdiff_t, not int.
ccd6111c
PE
8831 (font_intern_prop): Don't assume string length fits in int.
8832 Don't assume integer property fits in fixnum.
8833 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 8834
882f0d81 8835 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 8836 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
8837 Reformulate so as not to need the command string.
8838 Invoke gzip -cd rather than gunzip, as it's more portable.
8839 (lock_info_type, lock_file_1, lock_file):
8840 Don't assume pid_t and time_t fit in unsigned long.
8841 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8842 (current_lock_owner): Prefer signed type for sizes.
8843 Use memcpy, not strncpy, where memcpy is what is really wanted.
8844 Don't assume (via atoi) that time_t and pid_t fit in int.
8845 Check for time_t and/or pid_t out of range, e.g., via a network share.
8846 Don't alloca where an auto var works fine.
8847
93f4cf88
PE
8848 * fileio.c: Fix some integer overflow issues.
8849 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8850 Don't assume string length fits in int.
8851 (directory_file_name): Don't assume string length fits in long.
8852 (make_temp_name): Don't assume pid fits in int, or that its print
8853 length is less than 20.
8854
f3e92b69
PE
8855 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8856
1bfdaf10
PE
8857 * coding.c (make_subsidiaries): Don't assume string length fits in int.
8858
35016e9a
PE
8859 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8860
3d1e65a1
PE
8861 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8862 We prefer signed integers, even for size calculations.
8863
0b963a93
PE
8864 * emacs.c: Don't assume string length fits in 'int'.
8865 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8866 (main): Don't invoke strlen when not needed.
8867
573f4b54
PE
8868 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8869 (XD_DEBUG_MESSAGE): Don't waste a byte.
8870
989f33ba
PE
8871 * callproc.c (getenv_internal_1, getenv_internal)
8872 (Fgetenv_internal):
965d34eb
PE
8873 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8874
e4d29b33
PE
8875 * lread.c (invalid_syntax): Omit length argument.
8876 All uses changed. This doesn't fix a bug, but it simplifies the
8877 code away from its former Hollerith-constant appearance, and it's
8878 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 8879 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 8880
eb49b136
PE
8881 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8882 This didn't break anything, but it didn't help either.
8883 It's confusing to put a bogus integer in a place where the actual
8884 value does not matter.
9f62aeb1 8885 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 8886 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 8887
15375a22
PE
8888 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8889 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8890 implementation.
b61cc01c
PE
8891 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8892 We prefer signed types, and the value cannot exceed the EMACS_INT
8893 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
8894 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8895 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8896 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 8897
53b2623d
PE
8898 * indent.c (sane_tab_width): New function.
8899 (current_column, scan_for_column, Findent_to, position_indentation)
8900 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 8901 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 8902
51cab52b 8903 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 8904
f2ed8a70
PE
8905 * lisp.h (lint_assume): New macro.
8906 * composite.c (composition_gstring_put_cache):
8907 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8908
abe80cc6
PE
8909 * editfns.c, insdel.c:
8910 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 8911
b02c740e
PE
8912 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
8913
ebc96716
PE
8914 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
8915
b4e50fa0 8916 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 8917 Use much-faster test for byte-length change.
311d5d7c 8918 Don't assume string byte-length fits in 'int'.
a4cf38e4 8919 Check that character arg fits in 'int'.
85461888 8920 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 8921
c0c1ee9f
PE
8922 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
8923
a498d7f4
PE
8924 * fns.c (concat): Catch string overflow earlier.
8925 Do not rely on integer wraparound.
8926
51cab52b
PE
8927 * dispextern.h (struct it.overlay_strings_charpos)
8928 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
8929 * xdisp.c (forward_to_next_line_start)
8930 (back_to_previous_visible_line_start)
8931 (reseat_at_next_visible_line_start, next_element_from_buffer):
8932 Don't arbitrarily truncate the value of 'selective' to int.
8933
76031fad
PE
8934 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
8935
5eb55db9
PE
8936 * composite.c: Don't truncate sizes to 'int'.
8937 (composition_gstring_p, composition_reseat_it)
8938 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
8939 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
8940 not EMACS_UINT, for indexes.
5eb55db9 8941
0703a717
PE
8942 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
8943
d6202519
PE
8944 * buffer.c: Include <verify.h>.
8945 (struct sortvec.priority, struct sortstr.priority):
8961a454 8946 Now EMACS_INT, not int.
c20998a7 8947 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
8948 (struct sortstr.size, record_overlay_string)
8949 (struct sortstrlist.size, struct sortlist.used):
8950 Don't truncate size to int.
8951 (record_overlay_string): Check for size-calculation overflow.
d6202519 8952 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 8953
d5a19415
JM
89542011-06-22 Jim Meyering <meyering@redhat.com>
8955
029529ac 8956 Don't leak an XBM-image-sized buffer
d5a19415
JM
8957 * image.c (xbm_load): Free the image buffer after using it.
8958
a9041e6c
PE
89592011-06-21 Paul Eggert <eggert@cs.ucla.edu>
8960
8961 Port to Sun C.
8962 * composite.c (find_automatic_composition): Omit needless 'return 0;'
8963 that Sun C diagnosed.
8964 * fns.c (secure_hash): Fix pointer signedness issue.
8965 * intervals.c (static_offset_intervals): New function.
8966 (offset_intervals): Use it.
8967
7f3f739f
LL
89682011-06-21 Leo Liu <sdl.web@gmail.com>
8969
8970 * deps.mk (fns.o):
8971 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
8972 sha512.h.
8973
8974 * fns.c (secure_hash): Rename from crypto_hash_function and change
8975 the first arg to accept symbols.
5b66d427 8976 (Fsecure_hash): New primitive.
7f3f739f
LL
8977 (syms_of_fns): New symbols.
8978
76147d94
DD
89792011-06-20 Deniz Dogan <deniz@dogan.se>
8980
8981 * process.c (Fset_process_buffer): Clarify return value in
8982 docstring.
8983
7d7d0045
CY
89842011-06-18 Chong Yidong <cyd@stupidchicken.com>
8985
8986 * dispnew.c (add_window_display_history): Use BVAR.
8987
8988 * xdisp.c (debug_method_add): Use BVAR.
8989 (check_window_end, dump_glyph_matrix, dump_glyph)
8990 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
8991
8992 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
8993 Likewise.
8994
8995 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
8996 check till after the cache is created in init_frame_faces.
8997
ff2bc410
SM
89982011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
8999
9000 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9001
28177add
PE
90022011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9003
dd3482fe
PE
9004 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9005 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9006 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9007
393d71f3 9008 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9009 * fileio.c (Finsert_file_contents):
9010 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9011 Remove the old (too-loose) buffer overflow checks.
9012 They weren't needed, since make_gap checks for buffer overflow.
9013 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9014 The old code merely checked for Emacs fixnum overflow, and relied
9015 on undefined (wraparound) behavior. The new code avoids undefined
9016 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9017
2e6813b0 9018 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9019 Tune. Don't use wider integers than needed. Don't use alloca.
9020 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9021
599a9e4f
PE
9022 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9023
99561444
PE
9024 * insdel.c, lisp.h (buffer_overflow): New function.
9025 (insert_from_buffer_1, replace_range, replace_range_2):
9026 * insdel.c (make_gap_larger):
9027 * editfns.c (Finsert_char):
9028 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9029
28177add
PE
9030 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9031
e69dafad
PE
90322011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9033
4baa020d 9034 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9035
b1c46f02
PE
9036 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9037 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9038
e69dafad
PE
9039 * fileio.c: Don't assume EMACS_INT fits in off_t.
9040 (emacs_lseek): New static function.
9041 (Finsert_file_contents, Fwrite_region): Use it.
9042 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9043
566684ea
PE
9044 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9045
e6966cd6
PE
9046 * fns.c: Don't overflow int when computing a list length.
9047 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9048 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9049 truncation on 64-bit hosts. Check for QUIT every
9050 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9051 faster and is responsive enough.
9052 (Flength): Report an error instead of overflowing an integer.
9053 (Fsafe_length): Return a float if the value is not representable
9054 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9055 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9056 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9057
dd0b0efb
PE
9058 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9059 (header_size, word_size): New constants.
9060 (allocate_vectorlike): Don't check size overflow here.
9061 (allocate_vector): Check it here instead, since this is the only
9062 caller of allocate_vectorlike that could cause overflow.
9063 Check that the new vector's length is representable as a fixnum.
9064
86fe5cfe
PE
9065 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9066 The previous code was bogus. For example, next_almost_prime (32)
9067 returned 39, which is undesirable as it is a multiple of 3; and
9068 next_almost_prime (24) returned 25, which is a multiple of 5 so
9069 why was the code bothering to check for multiples of 7?
9070
80e88859
PE
9071 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9072
4a2f0ad6
PE
9073 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9074
f66c7cf8
PE
9075 Variadic C functions now count arguments with ptrdiff_t.
9076 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9077 Back then I didn't know that the Emacs coding style prefers signed int.
9078 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9079 were being counted with int, which may truncate counts on 64-bit
9080 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9081 * lisp.h (struct Lisp_Subr.function.aMANY)
9082 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9083 Arg counts are now ptrdiff_t, not size_t.
9084 All variadic functions and their callers changed accordingly.
9085 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9086 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9087 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9088 * callint.c (Fcall_interactively): Check arg count for overflow,
9089 to avoid potential buffer overrun. Use signed char, not 'int',
9090 for 'varies' array, so that we needn't bother to check its size
9091 calculation for overflow.
9092 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9093 * eval.c (apply_lambda):
9094 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9095 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9096 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9097
a1759b76
PE
9098 * callint.c (Fcall_interactively): Don't use index var as event count.
9099
d96be9fc
PE
9100 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9101 * mem-limits.h (SIZE): Remove; no longer used.
9102
a690a978 9103 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9104
578c21e6
PE
9105 Remove unnecessary casts.
9106 * xterm.c (x_term_init):
9107 * xfns.c (x_set_border_pixel):
9108 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9109 These aren't needed now that we assume ANSI C.
9110
96f53c6c
PE
9111 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9112 It's more likely to cause problems (due to unsigned overflow)
9113 than to cure them.
9114
83c77d31
PE
9115 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9116
ee2079f1
PE
9117 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9118
6da65536
PE
9119 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9120
7147c4a4
PE
9121 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9122
193e32d9
PE
9123 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9124
e5533da6
PE
9125 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9126
9910e595
PE
9127 GLYPH_CODE_FACE returns EMACS_INT, not int.
9128 * dispextern.h (merge_faces):
9129 * xfaces.c (merge_faces):
01103c44
PE
9130 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9131 Don't assume EMACS_INT fits in int.
9910e595 9132
2638320e
PE
9133 * character.h (CHAR_VALID_P): Remove unused parameter.
9134 * fontset.c, lisp.h, xdisp.c: All uses changed.
9135
045eb8d9
PE
9136 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9137
c1f134b5
PE
9138 * fns.c (concat): Minor tuning based on overflow analysis.
9139 This doesn't fix any bugs. Use int to hold character, instead
9140 of constantly refetching from Emacs object. Use XFASTINT, not
9141 XINT, for value known to be a character. Don't bother comparing
9142 a single byte to 0400, as it's always less.
9143
395fcb93 9144 * floatfns.c (Fexpt):
327eeec8
PE
9145 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9146
abbd3d23
PE
9147 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9148 for characters.
9149
684a03ef
PE
9150 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9151
0fed43f3
PE
9152 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9153 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9154 incorrectly succeed when S was a string, because 4294967386 was
9155 truncated before it was used.
9156
8fd02eb7
PE
9157 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9158 Otherwise, an out-of-range integer could cause undefined behavior
9159 on a 64-bit host.
9160
f8c86b69
PE
9161 * composite.c: Use int, not EMACS_INT, for characters.
9162 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9163 EMACS_INT, for values that are known to be in character range.
9164 This doesn't fix any bugs but is the usual style inside Emacs and
9165 may generate better code on 32-bit machines.
9166
34206dd2
PE
9167 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9168 This is for reasons similar to the recent CHAR_STRING fix.
9169 * charset.c (Fencode_char): Check that character arg is actually
9170 a character. Pass an int to ENCODE_CHAR.
9171 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9172 wider than 'int', as a compile-time check to prevent future regressions
9173 in this area.
9174
c5958d4c 9175 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9176
9177 Make sure a 64-bit char is never passed to CHAR_STRING.
9178 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9179 by silently ignoring the top 32 bits, allowing some values
9180 that were far too large to be valid characters.
9181 * character.h: Include <verify.h>.
9182 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9183 arguments are no wider than unsigned, as a compile-time check
9184 to prevent future regressions in this area.
9185 * data.c (Faset):
01103c44 9186 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9187 (Fsubst_char_in_region):
9188 * fns.c (concat):
9189 * xdisp.c (decode_mode_spec_coding):
9190 Adjust to CHAR_STRING's new requirement.
9191 * editfns.c (Finsert_char, Fsubst_char_in_region):
9192 * fns.c (concat): Check that character args are actually
9193 characters. Without this test, these functions did the wrong
9194 thing with wildly out-of-range values on 64-bit hosts.
9195
d37ca623
PE
9196 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9197 These casts should not be needed on 32-bit hosts, either.
9198 * keyboard.c (read_char):
9199 * lread.c (Fload): Remove casts to unsigned.
9200
ea204efb
PE
9201 * lisp.h (UNSIGNED_CMP): New macro.
9202 This fixes comparison bugs on 64-bit hosts.
9203 (ASCII_CHAR_P): Use it.
9204 * casefiddle.c (casify_object):
01103c44 9205 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9206 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9207 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9208 * dispextern.h (FACE_FROM_ID):
9209 * keyboard.c (read_char): Use UNSIGNED_CMP.
9210
41cb286c
PE
9211 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9212 not to EMACS_INT, to avoid GCC warning.
9213
4a1b9832
PE
9214 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9215
55daad71
PE
9216 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9217 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9218 isn't needed on 32-bit machines.
8f95c75c 9219
01103c44
PE
9220 * buffer.c (Fgenerate_new_buffer_name):
9221 Use EMACS_INT for count, not int.
0ceccced 9222 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9223
9224 * data.c (Qcompiled_function): Now static.
9225
c6f072e7
PE
9226 * window.c (window_body_lines): Now static.
9227
20ce5912
PE
9228 * image.c (gif_load): Rename local to avoid shadowing.
9229
9c4c5f81
PE
9230 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9231 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9232 * alloc.c (make_save_value): Integer argument is now of type
9233 ptrdiff_t, not int.
9234 (mark_object): Use ptrdiff_t, not int.
9235 * lisp.h (pD): New macro.
9236 * print.c (print_object): Use it.
9237
c0c5c8ae
PE
9238 * alloc.c: Use EMACS_INT, not int, to count objects.
9239 (total_conses, total_markers, total_symbols, total_vector_size)
9240 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9241 (total_free_floats, total_floats, total_free_intervals)
9242 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9243 Now EMACS_INT, not int. All uses changed.
9244 (Fgarbage_collect): Compute overall total using a double, so that
9245 integer overflow is less likely to be a problem. Check for overflow
9246 when converting back to an integer.
5a25e253
PE
9247 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9248 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9249 These were 'int' variables that could overflow on 64-bit hosts;
9250 they were never used, so remove them instead of repairing them.
211a0b2a 9251 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9252 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9253 Previously, this ceilinged at INT_MAX, but that doesn't work on
9254 64-bit machines.
e46bb31a 9255 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9256
c78baabf 9257 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9258 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9259 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9260 when a (possibly-narrower) signed value would do just as well.
9261 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9262
c9d624c6
PE
9263 * alloc.c: Catch some string size overflows that we were missing.
9264 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9265 for convenience in STRING_BYTES_MAX.
9266 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9267 The definition here is exact; the one in lisp.h was approximate.
9268 (allocate_string_data): Check for string overflow. This catches
9269 some instances we weren't catching before. Also, it catches
9270 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9271 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9272 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9273
c9d624c6
PE
9274 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9275 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9276 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9277
353032ce
PE
9278 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9279
2bccce07
PE
9280 * alloc.c (Fmake_string): Check for out-of-range init.
9281
0ac30604
SM
92822011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9283
9284 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9285
c195f2de
JD
92862011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9287
9288 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9289 xg_get_default_scrollbar_width.
9290
9291 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9292 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9293 (style_changed_cb): Call update_theme_scrollbar_width and call
9294 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9295 all frames (Bug#8505).
9296 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9297 Call gtk_window_set_resizable if HAVE_GTK3.
9298 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9299 and height if HAVE_GTK3 (Bug#8505).
9300 (scroll_bar_width_for_theme): New variable.
9301 (update_theme_scrollbar_width): New function.
9302 (xg_get_default_scrollbar_width): Move code to
9303 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9304 (xg_initialize): Call update_theme_scrollbar_width.
9305
9306 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9307
9308 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9309
e10ac9f1
MR
93102011-06-12 Martin Rudalics <rudalics@gmx.at>
9311
9312 * frame.c (make_frame): Call other_buffer_safely instead of
9313 other_buffer.
9314
9315 * window.c (temp_output_buffer_show): Call display_buffer with
9316 second argument Vtemp_buffer_show_specifiers and reset latter
9317 immediately after the call.
9318 (Vtemp_buffer_show_specifiers): New variable.
9319 (auto_window_vscroll_p, next_screen_context_lines)
9320 (Vscroll_preserve_screen_position): Remove leading asterisks from
9321 doc-strings.
9322
2d3c217e 93232011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9324
7b7f97e8 9325 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9326 * buffer.c (Qclone_number): Remove for now, as it's unused.
9327 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9328 (record_buffer): Remove unused local.
9329 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9330 (set_frame_buffer_list): Remove; unused.
9331 * frame.h (other_visible_frames): Remove decl.
9332 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9333 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9334 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9335 if HAVE_GPM.
9336 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9337 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9338 Define only if HAVE_GPM.
9339 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9340 (update_hints_inhibit): Remove; never set. All uses removed.
9341 * widgetprv.h (emacsFrameClassRec): Remove decl.
9342 * window.c (delete_deletable_window): Now returns void, since it
9343 wasn't returning anything.
9344 (compare_window_configurations): Remove unused locals.
9345 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9346 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9347 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9348 the same widths as pointers. This follows up on the 2011-05-06 patch.
9349 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9350 * xterm.h: Likewise.
9351 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9352
1384b89e
JB
93532011-06-12 Juanma Barranquero <lekktu@gmail.com>
9354
9355 * makefile.w32-in: Update dependencies.
9356 (LISP_H): Add lib/intprops.h.
9357
1100a63c
CY
93582011-06-11 Chong Yidong <cyd@stupidchicken.com>
9359
9360 * image.c (gif_load): Add animation frame delay to the metadata.
9361 (syms_of_image): Use DEFSYM. New symbol `delay'.
9362
6198ccd0
MR
93632011-06-11 Martin Rudalics <rudalics@gmx.at>
9364
9365 * window.c (delete_deletable_window): Re-add.
9366 (Fset_window_configuration): Rewrite to handle dead buffers and
9367 consequently deletable windows.
9368 (window_tree, Fwindow_tree): Remove. Supply functionality in
9369 window.el.
9370 (compare_window_configurations): Simplify code.
9371
b6e3633c
AS
93722011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9373
1ab0dee5
AS
9374 * image.c (imagemagick_load_image): Fix type mismatch.
9375 (Fimagemagick_types): Likewise.
9376
b6e3633c
AS
9377 * window.h (replace_buffer_in_windows): Declare.
9378
9397e56f
MR
93792011-06-11 Martin Rudalics <rudalics@gmx.at>
9380
9381 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9382 Qclone_number. Remove external declaration of Qdelete_window.
9383 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9384 code.
640c8776
SM
9385 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9386 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9387 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9388 buffer list implementation.
9389 (other_buffer_safely): New function.
9390 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9391 calls to replace_buffer_in_windows and
9392 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9393 if allowed.
9394 (record_buffer): Inhibit quitting and rewrite using quittable
9395 functions. Run Qbuffer_list_update_hook if allowed.
9396 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9397 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9398 Move switch-to-buffer to window.el.
9397e56f
MR
9399 (bury-buffer): Move to window.el.
9400 (Vbuffer_list_update_hook): New variable.
9401
9402 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9403 section.
9404
9405 * window.h (resize_frame_windows): Move up in code.
9406 (Fwindow_frame): Remove EXFUN.
9407 (replace_buffer_in_all_windows): Remove prototype.
9408 (replace_buffer_in_windows_safely): Add prototype.
9409
9410 * window.c: Declare Qdelete_window static again. Move down
9411 declaration of select_count.
9412 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9413 (Fother_window): Move to window.el.
9414 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9415 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9416 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9417 window.el.
9418 (replace_buffer_in_windows): Implement by calling
9419 Qreplace_buffer_in_windows.
9420 (replace_buffer_in_all_windows): Remove with some functionality
9421 moved into replace_buffer_in_windows_safely.
9422 (replace_buffer_in_windows_safely): New function.
9423 (select_window_norecord, select_frame_norecord): Move in front
9424 of run_window_configuration_change_hook. Remove now obsolete
9425 declarations.
640c8776
SM
9426 (Fset_window_buffer): Rewrite doc-string.
9427 Call Qrecord_window_buffer.
9397e56f
MR
9428 (keys_of_window): Move binding for other-window to window.el.
9429
b50691aa
CY
94302011-06-11 Chong Yidong <cyd@stupidchicken.com>
9431
9432 * dispextern.h (struct image): Replace data member, whose int_val
9433 and ptr_val fields were not used by anything, with a single
9434 lisp_val object.
9435
9436 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9437 (gif_clear_image, gif_load, imagemagick_load_image)
9438 (gs_clear_image, gs_load): Callers changed.
9439
3f754b86
PE
94402011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9441
cca69397
PE
9442 * buffer.h: Include <time.h>, for time_t.
9443 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9444
109e28d0
PE
9445 Fix minor problems found by static checking.
9446
60737f02
PE
9447 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9448
4b66faf3
PE
9449 Make identifiers static if they are not used in other modules.
9450 * data.c (Qcompiled_function, Qframe, Qvector):
9451 * image.c (QimageMagick, Qsvg):
9452 * minibuf.c (Qmetadata):
9453 * window.c (resize_window_check, resize_root_window): Now static.
9454 * window.h (resize_window_check, resize_root_window): Remove decls.
9455
109e28d0
PE
9456 * window.c (window_deletion_count, delete_deletable_window):
9457 Remove; unused.
46a4ce9e
PE
9458 (window_body_lines): Now static.
9459 (Fdelete_other_windows_internal): Mark vars as initialized.
9460 Make sure 'resize_failed' is initialized.
9461 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9462 (resize_window_apply): Remove unused local.
9463 * window.h (delete_deletable_window): Remove decl.
9464
109e28d0 9465 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9466 (imagemagick_load_image): Fix pointer signedness problem by changing
9467 last arg from unsigned char * to char *. All uses changed.
9468 Also, fix a local for similar reasons.
9469 Remove unused locals. Remove locals to avoid shadowing.
9470 (fn_rsvg_handle_free): Remove; unused.
9471 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9472 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9473
3f754b86
PE
9474 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9475
2547adb1
CY
94762011-06-10 Chong Yidong <cyd@stupidchicken.com>
9477
9478 * image.c (gif_load): Fix omitted cast error introduced by
9479 2011-06-06 change.
9480
2c8e37d4
MR
94812011-06-10 Martin Rudalics <rudalics@gmx.at>
9482
9483 * window.h (resize_proportionally, orig_total_lines)
9484 (orig_top_line): Remove from window structure.
9485 (set_window_height, set_window_width, change_window_heights)
9486 (Fdelete_window): Remove prototypes.
9487 (resize_frame_windows): Remove duplicate declaration.
9488
440a42e3
EZ
94892011-06-10 Eli Zaretskii <eliz@gnu.org>
9490
9491 * window.h (resize_frame_windows, resize_window_check)
9492 (delete_deletable_window, resize_root_window)
9493 (resize_frame_windows): Declare prototypes.
9494
9495 * window.c (resize_window_apply): Make definition be "static" to
9496 match the prototype.
9497
562dd5e9
MR
94982011-06-10 Martin Rudalics <rudalics@gmx.at>
9499
9500 * window.c: Remove declarations of Qwindow_size_fixed,
9501 window_min_size_1, window_min_size_2, window_min_size,
9502 size_window, window_fixed_size_p, enlarge_window, delete_window.
9503 Remove static from declaration of Qdelete_window, it's
9504 temporarily needed by Fbury_buffer.
9505 (replace_window): Don't assign orig_top_line and
9506 orig_total_lines.
9507 (Fdelete_window, delete_window): Remove. Window deletion is
9508 handled by window.el.
640c8776
SM
9509 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9510 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9511 (Fdelete_other_windows): Remove. Deleting other windows is
9512 handled by window.el.
9513 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9514 handled in window.el.
9515 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9516 Window minimum sizes are handled in window.el.
9517 (shrink_windows, size_window, set_window_height)
9518 (set_window_width, change_window_heights, window_height)
9519 (window_width, CURBEG, CURSIZE, enlarge_window)
9520 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9521 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9522 handled in window.el.
9523 (make_dummy_parent): Rename to make_parent_window and give it a
9524 second argument horflag.
9525 (make_window): Don't set resize_proportionally any more.
9526 (Fsplit_window): Remove. Windows are split in window.el.
9527 (save_restore_action, save_restore_orig_size)
9528 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9529 Resize mini windows in window.el.
9530 (grow_mini_window, shrink_mini_window): Implement by calling
9531 Qresize_root_window_vertically, resize_window_check and
9532 resize_window_apply.
640c8776
SM
9533 (saved_window, Fset_window_configuration, save_window_save):
9534 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9535 resize_proportionally.
9536 (window_min_height, window_min_width): Move to window.el.
9537 (keys_of_window): Move bindings for delete-other-windows,
9538 split-window, delete-window and enlarge-window to window.el.
9539
9540 * buffer.c: Temporarily extern Qdelete_window.
9541 (Fbury_buffer): Temporarily call Qdelete_window instead of
9542 Fdelete_window (Fbury_buffer will move to window.el soon).
9543
9544 * frame.c (set_menu_bar_lines_1): Remove code handling
9545 orig_top_line and orig_total_lines.
9546
9547 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9548 set_window_height but set heights directly.
9549 (change_frame_size_1): Use resize_frame_windows.
9550
9551 * xdisp.c (init_xdisp): Don't use set_window_height but set
9552 heights directly.
9553
640c8776
SM
9554 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9555 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9556 run_window_configuration_change_hook.
9557
9558 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9559 instead of change_window_heights and run
9560 run_window_configuration_change_hook.
9561
1a13852e
MR
95622011-06-09 Martin Rudalics <rudalics@gmx.at>
9563
9564 * window.c (replace_window): Rename second argument REPLACEMENT to
9565 NEW. New third argument SETFLAG. Rewrite.
9566 (delete_window, make_dummy_parent): Call replace_window with
9567 third argument 1.
9568 (window_list_1): Move down in code.
9569 (run_window_configuration_change_hook): Move set_buffer part
9570 before select_frame_norecord part in order to unwind correctly.
9571 Rename count1 to count.
9572 (recombine_windows, delete_deletable_window, resize_root_window)
9573 (Fdelete_other_windows_internal)
9574 (Frun_window_configuration_change_hook, make_parent_window)
9575 (resize_window_check, resize_window_apply, Fresize_window_apply)
9576 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9577 (Fdelete_window_internal, Fresize_mini_window_internal):
9578 New functions.
1a13852e
MR
9579 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9580
f3d1777e
MR
95812011-06-08 Martin Rudalics <rudalics@gmx.at>
9582
496e208e
MR
9583 * window.h (window): Add some new members to window structure -
9584 normal_lines, normal_cols, new_total, new_normal, clone_number,
9585 splits, nest, prev_buffers, next_buffers.
9586 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9587 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9588
f3d1777e
MR
9589 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9590 Remove.
496e208e
MR
9591 (make_dummy_parent): Set new members of windows structure.
9592 (make_window): Move down in code. Handle new members of window
9593 structure.
9594 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9595 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9596 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9597 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9598 (Fset_window_next_buffers, Fset_window_clone_number):
9599 New functions.
496e208e
MR
9600 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9601 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9602 Doc-string fixes.
9603 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9604 Argument WINDOW can be now internal window too.
9605 (Fwindow_use_time): Move up in code.
9606 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9607 Rewrite doc-string.
9608 (Fset_window_configuration, saved_window)
9609 (Fcurrent_window_configuration, save_window_save): Handle new
9610 members of window structure.
b9e809c2
MR
9611 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9612 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9613 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9614 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9615 Qget_mru_window, Qresize_root_window,
9616 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9617 Qauto_buffer_name; staticpro them.
f3d1777e 9618
abde8f8c
MR
96192011-06-07 Martin Rudalics <rudalics@gmx.at>
9620
9621 * window.c (Fwindow_total_size, Fwindow_left_column)
9622 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9623 (Fwindow_list_1): New functions.
9624 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
9625 (Fwindow_width, Fscroll_left, Fscroll_right):
9626 Use window_body_cols instead of window_box_text_cols.
9627 (delete_window, Fset_window_configuration):
9628 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
9629 (delete_all_subwindows): Take a window as argument and not a
9630 structure. Rewrite.
190b47e6
MR
9631 (window_loop): Remove handling of GET_LRU_WINDOW and
9632 GET_LARGEST_WINDOW.
9633 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
9634
9635 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
9636 window_box_text_cols. delete_all_subwindows now takes a
9637 Lisp_Object as argument.
abde8f8c 9638
640c8776
SM
9639 * indent.c (compute_motion, Fcompute_motion):
9640 Use window_body_cols instead of window_box_text_cols.
abde8f8c 9641
fa8a67e6
MR
9642 * frame.c (delete_frame): Call delete_all_subwindows with root
9643 window as argument.
9644
a54e3482
DC
96452011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9646
9647 * fns.c (Fputhash): Document return value.
9648
60002bf5
CY
96492011-06-06 Chong Yidong <cyd@stupidchicken.com>
9650
9651 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9652
0c671da6 96532011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 9654
b862a52a 9655 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 9656
be44ca6c
PE
9657 Check for overflow when converting integer to cons and back.
9658 * charset.c (Fdefine_charset_internal, Fdecode_char):
9659 Use cons_to_unsigned to catch overflow.
9660 (Fencode_char): Use INTEGER_TO_CONS.
9661 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9662 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9663 * data.c (long_to_cons, cons_to_long): Remove.
9664 (cons_to_unsigned, cons_to_signed): New functions.
9665 These signal an error for invalid or out-of-range values.
9666 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9667 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9668 * font.c (Ffont_variation_glyphs):
9669 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9670 * lisp.h: Include <intprops.h>.
9671 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9672 (cons_to_signed, cons_to_unsigned): New decls.
9673 (long_to_cons, cons_to_long): Remove decls.
9674 * undo.c (record_first_change): Use INTEGER_TO_CONS.
9675 (Fprimitive_undo): Use CONS_TO_INTEGER.
9676 * xfns.c (Fx_window_property): Likewise.
9677 * xselect.c: Include <limits.h>.
9678 (x_own_selection, selection_data_to_lisp_data):
9679 Use INTEGER_TO_CONS.
9680 (x_handle_selection_request, x_handle_selection_clear)
9681 (x_get_foreign_selection, Fx_disown_selection_internal)
9682 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9683 (lisp_data_to_selection_data): Use cons_to_unsigned.
9684 (x_fill_property_data): Use cons_to_signed.
9685 Report values out of range.
9686
d1f3d2af
PE
9687 Check for buffer and string overflow more precisely.
9688 * buffer.h (BUF_BYTES_MAX): New macro.
9689 * lisp.h (STRING_BYTES_MAX): New macro.
9690 * alloc.c (Fmake_string):
9691 * character.c (string_escape_byte8):
9692 * coding.c (coding_alloc_by_realloc):
9693 * doprnt.c (doprnt):
9694 * editfns.c (Fformat):
9695 * eval.c (verror):
9696 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9697 since they may not be the same number.
9698 * editfns.c (Finsert_char):
9699 * fileio.c (Finsert_file_contents):
9700 Likewise for BUF_BYTES_MAX.
9701
dd52fcea
PE
9702 * image.c: Use ptrdiff_t, not int, for sizes.
9703 (slurp_file): Switch from int to ptrdiff_t.
9704 All uses changed.
9705 (slurp_file): Check that file size fits in both size_t (for
9706 malloc) and ptrdiff_t (for sanity and safety).
9707
7f9bbdbb
PE
9708 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9709 if b->modtime has its maximal value.
9710
dfe18f82
PE
9711 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9712
84acfcf0
PE
9713 Don't assume time_t can fit into int.
9714 * buffer.h (struct buffer.modtime): Now time_t, not int.
9715 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9716 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9717
ccd9a01a
PE
9718 Minor fixes for signed vs unsigned integers.
9719 * character.h (MAYBE_UNIFY_CHAR):
9720 * charset.c (maybe_unify_char):
9721 * keyboard.c (read_char, reorder_modifiers):
9722 XINT -> XFASTINT, since the integer must be nonnegative.
9723 * ftfont.c (ftfont_spec_pattern):
9724 * keymap.c (access_keymap, silly_event_symbol_error):
9725 XUINT -> XFASTINT, since the integer must be nonnegative.
9726 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9727 since it makes no difference and we prefer signed.
9728 * keyboard.c (record_char): Use XUINT when all the neighbors do.
9729 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9730 nonnegative.
9731
d6d100dd
SM
97322011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
9733
9734 * window.h (Fwindow_frame): Declare.
9735
2b6148e4
PE
97362011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 * alloc.c: Simplify handling of large-request failures (Bug#8800).
9739 (SPARE_MEMORY): Always define.
9740 (LARGE_REQUEST): Remove.
9741 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9742
f230ecc9
MR
97432011-06-06 Martin Rudalics <rudalics@gmx.at>
9744
727e958e
MR
9745 * lisp.h: Move EXFUNS for Fframe_root_window,
9746 Fframe_first_window and Fset_frame_selected_window to window.h.
9747
9748 * window.h: Move EXFUNS for Fframe_root_window,
9749 Fframe_first_window and Fset_frame_selected_window here from
9750 lisp.h.
9751
9752 * frame.c (Fwindow_frame, Fframe_first_window)
9753 (Fframe_root_window, Fframe_selected_window)
9754 (Fset_frame_selected_window): Move to window.c.
9755 (Factive_minibuffer_window): Move to minibuf.c.
9756 (Fother_visible_frames_p): New function.
9757
9758 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9759
f230ecc9
MR
9760 * window.c (decode_window, decode_any_window): Move up in code.
9761 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9762 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
9763 (Fwindow_buffer): Move up and rewrite doc-string.
9764 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9765 (Fwindow_prev): New functions.
727e958e
MR
9766 (Fwindow_frame): Move here from frame.c. Accept any window as
9767 argument.
9768 (Fframe_root_window, Fframe_first_window)
9769 (Fframe_selected_window): Move here from frame.c. Accept frame
9770 or arbitrary window as argument. Update doc-strings.
9771 (Fminibuffer_window): Move up in code.
9772 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
9773 (Fset_frame_selected_window): Move here from frame.c.
9774 Marginal rewrite.
727e958e
MR
9775 (Fselected_window, select_window, Fselect_window): Move up in
9776 code. Minor doc-string fixes.
f230ecc9 9777
4d09bcf6
PE
97782011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9779
9780 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9781 Do not assume that spare memory exists; that assumption is valid
9782 only if SYSTEM_MALLOC.
9783 (LARGE_REQUEST): New macro, so that the issue of large requests
9784 is separated from the issue of spare memory.
9785
810928a2
AS
97862011-06-05 Andreas Schwab <schwab@linux-m68k.org>
9787
172418ad
AS
9788 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9789 format. (Bug#8806)
9790
43f862f7
AS
9791 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9792
810928a2
AS
9793 * xfns.c (x_set_scroll_bar_default_width): Move declarations
9794 before statements.
9795
a059fe24
JD
97962011-06-05 Jan Djärv <jan.h.d@swipnet.se>
9797
9798 * gtkutil.c (xg_get_default_scrollbar_width): New function.
9799
9800 * gtkutil.h: Declare xg_get_default_scrollbar_width.
9801
9802 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9803 min width by calling x_set_scroll_bar_default_width (Bug#8505).
9804
989bf368
JB
98052011-06-05 Juanma Barranquero <lekktu@gmail.com>
9806
9807 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9808
4b80f674
CY
98092011-06-04 Chong Yidong <cyd@stupidchicken.com>
9810
9811 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9812 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
9813 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9814 New error handlers.
4b80f674
CY
9815 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9816 Obey Vx_select_enable_clipboard_manager. Catch errors in
9817 x_clipboard_manager_save (Bug#8779).
9818 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 9819 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 9820
99a33b77 98212011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
9822
9823 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9824
99a33b77 98252011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
9826
9827 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9828 in the current matrix if keep_current_p is non-zero.
9829
8264569d
EZ
98302011-06-04 Eli Zaretskii <eliz@gnu.org>
9831
9832 * bidi.c (bidi_level_of_next_char): Fix last change.
9833
57f97249
EZ
98342011-06-03 Eli Zaretskii <eliz@gnu.org>
9835
fec2107c 9836 Support bidi reordering of text covered by display properties.
57f97249 9837
fec2107c
EZ
9838 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9839 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9840 (bidi_cache_search, bidi_cache_iterator_state)
9841 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
9842 (bidi_level_of_next_char, bidi_move_to_visually_next):
9843 Support character positions inside a run of characters covered by a
fec2107c
EZ
9844 display string.
9845 (bidi_paragraph_init, bidi_resolve_explicit_1)
9846 (bidi_level_of_next_char): Call bidi_fetch_char and
9847 bidi_fetch_char_advance instead of FETCH_CHAR and
9848 FETCH_CHAR_ADVANCE.
9849 (bidi_init_it): Initialize new members.
9850 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9851 definitions.
9852 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9853 instead of using explicit *_CHAR codes.
d6d100dd
SM
9854 (bidi_resolve_explicit, bidi_resolve_weak):
9855 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
9856 bidirectional text is supported only in multibyte buffers.
9857 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9858 it to initialize the frame_window_p member of struct bidi_it.
9859 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9860 (bidi_resolve_explicit, bidi_resolve_weak)
9861 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9862 bidi_it->nchars is non-positive.
9863 (bidi_level_of_next_char): Don't try to lookup the cache for the
9864 next/previous character if nothing is cached there yet, or if we
9865 were just reseat()'ed to a new position.
c40e2fb2 9866
0e14fe90
EZ
9867 * xdisp.c (set_cursor_from_row): Set start and stop points
9868 according to the row's direction when priming the loop that looks
9869 for the glyph on which to display cursor.
9870 (single_display_spec_intangible_p): Function deleted.
9871 (display_prop_intangible_p): Reimplement to call
9872 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
9873 Accept 3 additional arguments needed by handle_display_spec.
9874 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
9875 values: lists, `(when COND...)' forms, etc.
9876 (single_display_spec_string_p): Support property values that are
9877 lists with the argument STRING its top-level element.
9878 (display_prop_string_p): Fix the condition for processing a
9879 property that is a list to be consistent with handle_display_spec.
fec2107c 9880 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
9881 last portion of handle_display_prop.
9882 (compute_display_string_pos): Accept additional argument
9883 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
9884 value of a `display' property is a "replacing spec".
9885 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9886 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
9887 the display property, but just return a value indicating whether
9888 the display property will replace the characters it covers.
9889 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9890 frame_window_p members of struct bidi_it.
d6d100dd
SM
9891 (compute_display_string_pos, compute_display_string_end):
9892 New functions.
fec2107c
EZ
9893 (push_it): Accept second argument POSITION, where pop_it should
9894 jump to continue iteration.
9895 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 9896
fec2107c
EZ
9897 * keyboard.c (adjust_point_for_property): Adjust the call to
9898 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
9899
9900 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
9901 (bidi_init_it): Update prototypes.
9902 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
9903 (compute_display_string_pos, compute_display_string_end):
9904 Declare prototypes.
fec2107c
EZ
9905 (struct bidi_it): New members nchars and disp_pos. ch_len is now
9906 EMACS_INT.
fc6f18ce 9907
40087514 99082011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 9909
57f53182
PE
9910 Malloc failure behavior now depends on size of allocation.
9911 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
9912 * lisp.h: Change signatures accordingly.
9913 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
9914 All callers changed. (Bug#8762)
9915
9916 * gnutls.c: Use Emacs's memory allocators.
9917 Without this change, the gnutls library would invoke malloc etc.
9918 directly, which causes problems on non-SYNC_INPUT hosts, and which
9919 runs afoul of improving memory_full behavior. (Bug#8761)
9920 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
9921 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
9922 xfree instead of the default malloc, realloc, free.
9923 (Fgnutls_boot): No need to check for memory allocation failure,
9924 since xmalloc does that for us.
9925
ac32cd99 9926 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
9927 * category.c (hash_get_category_set):
9928 * ccl.c (ccl_driver):
9929 * charset.c (Fdefine_charset_internal):
9930 * charset.h (struct charset.hash_index):
9931 * composite.c (get_composition_id, gstring_lookup_cache)
9932 (composition_gstring_put_cache):
9933 * composite.h (struct composition.hash_index):
9934 * dispextern.h (struct image.hash):
9935 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
9936 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
9937 (hashfn_equal, hashfn_user_defined, make_hash_table)
9938 (maybe_resize_hash_table, hash_lookup, hash_put)
9939 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
9940 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
9941 (Fsxhash, Fgethash, Fputhash, Fmaphash):
9942 * image.c (make_image, search_image_cache, lookup_image)
9943 (xpm_put_color_table_h):
9944 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 9945 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 9946 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 9947 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
9948 * alloc.c (allocate_vectorlike):
9949 Check for overflow in vector size calculations.
9950 * ccl.c (ccl_driver):
9951 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
9952 * fns.c, image.c: Remove unnecessary static decls that would otherwise
9953 need to be updated by these changes.
40087514
PE
9954 * fns.c (make_hash_table, maybe_resize_hash_table):
9955 Check for integer overflow with large hash tables.
0de4bb68
PE
9956 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
9957 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
9958 (SXHASH_REDUCE): New macro.
9959 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
9960 Use it instead of discarding useful hash info with large hash values.
9961 (sxhash_float): New function.
9962 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
9963 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
9964 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
9965 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
9966 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
9967 Adjust signatures to match updated version of code.
9968 (consing_since_gc): Now EMACS_INT, since a single hash table can
9969 use more than INT_MAX bytes.
9970
698d32e2
DN
99712011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
9972
9973 Make it possible to build with GCC-4.6+ -O2 -flto.
9974
9975 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
9976
fd6fa53f
SM
99772011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
9978
9979 * minibuf.c (get_minibuffer, read_minibuf_unwind):
9980 Call minibuffer-inactive-mode.
9981
864db017
JB
99822011-05-31 Juanma Barranquero <lekktu@gmail.com>
9983
9984 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
9985 Update dependencies.
9986
2ad0baf4
DN
99872011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9988
9989 * data.c (init_data): Remove code for UTS, this system is not
9990 supported anymore.
9991
4fcc2638
DN
99922011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9993
9994 Don't force ./temacs to start in terminal mode.
9995
9996 * frame.c (make_initial_frame): Initialize faces in all cases, not
9997 only when CANNOT_DUMP is defined.
9998 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
9999
c56e0fd5
DN
100002011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10001
10002 * dispnew.c (add_window_display_history): Use const for the string
10003 pointer. Remove declaration, not needed.
10004
333d54da 100052011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10006
55d4c1b2 10007 Use 'inline', not 'INLINE'.
333d54da 10008 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10009 * alloc.c, fontset.c (INLINE): Remove.
10010 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10011 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10012 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10013 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10014 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10015
738db178
DN
100162011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10017
10018 Make it possible to run ./temacs.
10019
10020 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10021 syms_of_callproc does the same thing. Remove test for
10022 "initialized", do it in the caller.
10023 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10024
620c53a6
SM
100252011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10026
10027 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10028 (read_minibuf): Use get_minibuffer.
10029 (syms_of_minibuf): Use DEFSYM.
10030 (Qmetadata): New var.
10031 * data.c (Qbuffer): Don't make it static.
10032 (syms_of_data): Use DEFSYM.
10033
e003a292
PE
100342011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10035
10036 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10037 (CCL_CODE_MIN): New macro.
10038
ed008a6d
PE
100392011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10040
3687c2ef
PE
10041 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10042
ed008a6d
PE
10043 * eval.c (Qdebug): Now static.
10044 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10045 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10046 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10047
d66c4c7c
CY
100482011-05-29 Chong Yidong <cyd@stupidchicken.com>
10049
10050 * image.c: Various fixes to ImageMagick code comments.
10051 (Fimagemagick_types): Doc fix.
10052
5fbc2025
PE
100532011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10054
0196f88a
PE
10055 Minor fixes prompted by GCC 4.6.0 warnings.
10056
10057 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10058
5fbc2025
PE
10059 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10060 (x_clipboard_manager_save_all): Move extern decl to ...
10061 * xterm.h: ... here, so that it can be checked for consistency.
10062
1dd3c2d9
CY
100632011-05-29 Chong Yidong <cyd@stupidchicken.com>
10064
10065 * xselect.c (x_clipboard_manager_save_frame)
10066 (x_clipboard_manager_save_all): New functions.
10067 (Fx_clipboard_manager_save): Lisp function deleted.
10068
10069 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10070 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10071
10072 * xterm.h: Update prototype.
10073
5ba6571d
WX
100742011-05-28 William Xu <william.xwl@gmail.com>
10075
10076 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10077 exiting (Bug#8239).
10078
3eaff834
JM
100792011-05-28 Jim Meyering <meyering@redhat.com>
10080
e1900994 10081 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10082 * fns.c (to_uchar): Define.
10083 (crypto_hash_function): Use it to convert some newly-signed
10084 variables to unsigned, to avoid sign-extension bugs. For example,
10085 without this change, (md5 "truc") would evaluate to
10086 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10087 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10088 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10089
0f6990a7
PE
100902011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10091
10092 Integer overflow fixes.
c8a9ca5a 10093
08686060
PE
10094 * dbusbind.c: Serial number integer overflow fixes.
10095 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10096 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10097 to hold a serial number that is too large for a fixnum.
10098 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10099 Check for serial numbers out of range. Decode any serial number
59568bf0 10100 that was so large that it became a float. (Bug#8722)
08686060 10101
2d1fc3c7
PE
10102 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10103 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10104 Use XFASTINT rather than XUINT when numbers are nonnegative.
10105 (xd_append_arg, Fdbus_method_return_internal):
10106 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10107 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10108 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10109 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10110 (Bug#8722)
2d1fc3c7 10111
c8a9ca5a
PE
10112 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10113
519e1d69
PE
10114 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10115
6df6ae42 10116 ccl: Add integer overflow checks.
30569699
PE
10117 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10118 (IN_INT_RANGE): New macros.
10119 (ccl_driver): Use them to check for integer overflow when
10120 decoding a CCL program. Many of the new checks are whether XINT (x)
10121 fits in int; it doesn't always, on 64-bit hosts. The new version
10122 doesn't catch all possible integer overflows, but it's an
847044ea 10123 improvement. (Bug#8719)
30569699 10124
c11285dc
PE
10125 * alloc.c (make_event_array): Use XINT, not XUINT.
10126 There's no need for unsigned here.
10127
fdccd48e
PE
10128 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10129 This follows up to the 2011-05-06 change that substituted uintptr_t
10130 for EMACS_INT. This case wasn't caught back then.
10131
37910ab2
PE
10132 Rework Fformat to avoid integer overflow issues.
10133 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10134 now (part of C89). Include <verify.h>.
10135 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10136 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10137 (Fformat): Avoid the prepass trying to compute sizes; it was only
10138 approximate and thus did not catch overflow reliably. Instead, walk
10139 through the format just once, formatting and computing sizes as we go,
10140 checking for integer overflow at every step, and allocating a larger
10141 buffer as needed. Keep track separately whether the format is
10142 multibyte. Keep only the most-recently calculated precision, rather
10143 than them all. Record whether each argument has been converted to
10144 string. Use EMACS_INT, not int, for byte and char and arg counts.
10145 Support field widths and precisions larger than INT_MAX. Avoid
10146 sprintf's undefined behavior with conversion specifications such as %#d
10147 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10148 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10149 formatting out-of-range floating point numbers with int
9173deec 10150 formats. (Bug#8668)
37910ab2 10151
2e6578fb
PE
10152 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10153
0ae6bdee
PE
10154 * data.c: Avoid integer truncation in expressions involving floats.
10155 * data.c: Include <intprops.h>.
10156 (arith_driver): When there's an integer overflow in an expression
10157 involving floating point, convert the integers to floating point
10158 so that the resulting value does not suffer from catastrophic
10159 integer truncation. For example, on a 64-bit host (* 4
10160 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10161 Do not rely on undefined behavior after integer overflow.
10162
de883a70
PE
10163 merge count_size_as_multibyte, parse_str_to_multibyte
10164 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10165 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10166 Check for integer overflow.
10167 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10168 since it's now a duplicate of the other. This is more of
10169 a character than a buffer op, so better that it's in character.c.
10170 * fns.c, print.c: Adjust to above changes.
10171
2ff916cb
PE
101722011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10173
10174 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10175
f1b54466
PE
101762011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10177
fb1ac845
PE
10178 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10179 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10180 (x_clipboard_manager_save): Now static.
10181 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10182
f1b54466
PE
10183 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10184 (crypto_hash_function): Now static.
10185 Fix pointer signedness problems. Avoid unnecessary initializations.
10186
a9f737ee
CY
101872011-05-27 Chong Yidong <cyd@stupidchicken.com>
10188
10189 * termhooks.h (Vselection_alist): Make it terminal-local.
10190
10191 * terminal.c (create_terminal): Initialize it.
10192
10193 * xselect.c: Support for clipboard managers.
10194 (Vselection_alist): Move to termhooks.h as terminal-local var.
10195 (LOCAL_SELECTION): New macro.
10196 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10197 (symbol_to_x_atom): Remove gratuitous arg.
10198 (x_handle_selection_request, lisp_data_to_selection_data)
10199 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10200 (x_own_selection, x_get_local_selection, x_convert_selection):
10201 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10202 (some_frame_on_display): Delete unused function.
10203 (Fx_own_selection_internal, Fx_get_selection_internal)
10204 (Fx_disown_selection_internal, Fx_selection_owner_p)
10205 (Fx_selection_exists_p): New optional frame arg.
10206 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10207 (x_handle_selection_clear): Don't treat other terminals with the
10208 same keyboard specially. Use the terminal-local Vselection_alist.
10209 (x_clear_frame_selections): Use Frun_hook_with_args.
10210
10211 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10212
10213 * xterm.h: Add support for those atoms.
10214
e067f0c1
CY
102152011-05-26 Chong Yidong <cyd@stupidchicken.com>
10216
10217 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10218 (converted_selections, conversion_fail_tag): New global variables.
10219 (x_selection_request_lisp_error): Free the above.
10220 (x_get_local_selection): Remove unnecessary code.
10221 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10222 of converted selections stored in converted_selections.
10223 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10224 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10225 (x_convert_selection): New function.
10226 (x_handle_selection_event): Simplify.
10227 (x_get_foreign_selection): Don't ignore incoming requests while
10228 waiting for an answer; this will fail when we implement
10229 SAVE_TARGETS, and seems unnecessary anyway.
10230 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10231 (Vx_sent_selection_functions): Doc fix.
10232
0f4aebc0
LL
102332011-05-26 Leo Liu <sdl.web@gmail.com>
10234
10235 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10236
e61124cd
YM
102372011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10238
10239 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10240
10241 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10242 for fringe update if it has periodic bitmap.
ac389d0c 10243 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10244 and fringe_bitmap_periodic_p.
10245
10246 * fringe.c (get_fringe_bitmap_data): New function.
10247 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10248 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10249 row. Mark glyph row for fringe update if periodicity changed.
10250
10251 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10252 for fringe update unless it has periodic bitmap.
10253
f16d9837
KH
102542011-05-25 Kenichi Handa <handa@m17n.org>
10255
10256 * xdisp.c (get_next_display_element): Set correct it->face_id for
10257 a static composition.
10258
e1b90ef6
LL
102592011-05-24 Leo Liu <sdl.web@gmail.com>
10260
10261 * deps.mk (fns.o):
10262 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10263
10264 * fns.c (crypto_hash_function, Fsha1): New function.
10265 (Fmd5): Use crypto_hash_function.
10266 (syms_of_fns): Add Ssha1.
10267
7400048f
PE
102682011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10269
10270 * gnutls.c: Remove unused macros.
10271 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10272 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10273 Remove macros that are defined and never used.
10274 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10275
abb71cf4
CY
102762011-05-22 Chong Yidong <cyd@stupidchicken.com>
10277
10278 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10279 (Fx_get_selection_internal): Minor cleanup.
10280 (Fx_own_selection_internal): Rename arguments for consistency with
10281 select.el.
10282
6307db39
PE
102832011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10284
10285 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10286
f3d4e0a4
CY
102872011-05-22 Chong Yidong <cyd@stupidchicken.com>
10288
10289 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10290
4d8ade89
YM
102912011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10292
10293 * dispnew.c (scrolling_window): Don't exclude the case that the
10294 last enabled row in the desired matrix touches the bottom boundary.
10295
32078c8d
GM
102962011-05-21 Glenn Morris <rgm@gnu.org>
10297
10298 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10299 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10300 and add some more files.
32078c8d 10301
7285dc67
EZ
103022011-05-20 Eli Zaretskii <eliz@gnu.org>
10303
10304 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10305 report_file_error introduced by the change from 2011-05-07.
10306
89d1bd22
PE
103072011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 * systime.h (Time): Define only if emacs is defined.
10310 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10311 where the include path doesn't have X11/X.h by default. See
10312 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10313
cd394be1 103142011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10315
10316 * composite.c (find_automatic_composition): Fix previous change.
10317
b9704ad9
GM
103182011-05-20 Glenn Morris <rgm@gnu.org>
10319
10320 * lisp.mk: New file, split from Makefile.in.
10321 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10322 (shortlisp): Remove.
10323 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10324
4a720484
GM
103252011-05-19 Glenn Morris <rgm@gnu.org>
10326
10327 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10328 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10329 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10330 (lisp): Set the order to that of loadup.el.
10331 (shortlisp): Make it a copy of $lisp.
10332 (SOME_MACHINE_LISP): Remove.
10333 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10334 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10335
a28d4396
KH
103362011-05-18 Kenichi Handa <handa@m17n.org>
10337
10338 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10339 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10340 (find_automatic_composition): Mostly rewrite for efficiency.
10341
a2b1fa8e
JB
103422011-05-18 Juanma Barranquero <lekktu@gmail.com>
10343
10344 * makefile.w32-in: Update dependencies.
10345
8e1f5610
CS
103462011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10347
10348 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10349 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10350
7025ee00 103512011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10352
cdfa6eab
PE
10353 Fix some integer overflow issues, such as string length overflow.
10354
06d6db33
PE
10355 * insdel.c (count_size_as_multibyte): Check for string overflow.
10356
2b4560a8
PE
10357 * character.c (lisp_string_width): Check for string overflow.
10358 Use EMACS_INT, not int, for string indexes and lengths; in
10359 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10360 the resulting string length overflows an EMACS_INT; instead,
10361 report a string overflow if no precision given. When checking for
10362 precision exhaustion, use a check that cannot possibly have
10363 integer overflow. (Bug#8675)
10364 * character.h (lisp_string_width): Adjust to new signature.
10365
cb93f9be
PE
10366 * alloc.c (string_overflow): New function.
10367 (Fmake_string): Use it. This doesn't change behavior, but saves
10368 a few bytes and will simplify future changes.
10369 * character.c (string_escape_byte8): Likewise.
10370 * lisp.h (string_overflow): New decl.
10371
1a1f3366
PE
10372 Fixups, following up to the user-interface timestamp change.
10373 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10374 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10375 * msdos.c (mouse_get_pos): Likewise.
10376 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10377 * w32gui.h (Time): Define by including "systime.h" rather than by
10378 declaring it ourselves. (Bug#8664)
10379
d4e3e4d3
PE
10380 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10381 * image.c (clear_image_cache): Likewise.
10382
f6a24d19
PE
10383 * term.c (term_mouse_position): Don't assume time_t wraparound.
10384
08dc5ae6
PE
10385 Be more systematic about user-interface timestamps.
10386 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10387 and sometimes 'EMACS_UINT', to represent these timestamps.
10388 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10389 This makes the code easier to follow, and makes it easier to catch
10390 integer overflow bugs such as Bug#8664.
10391 * frame.c (Fmouse_position, Fmouse_pixel_position):
10392 Use Time, not unsigned long, for user-interface timestamps.
10393 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10394 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10395 * keyboard.h (last_event_timestamp): Likewise.
10396 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10397 * menu.h (xmenu_show): Likewise.
10398 * term.c (term_mouse_position): Likewise.
10399 * termhooks.h (struct input_event.timestamp): Likewise.
10400 (struct terminal.mouse_position_hook): Likewise.
10401 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10402 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10403 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10404 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10405 what it was before.
10406 * menu.h, termhooks.h: Include "systime.h", for Time.
10407
8e55734a
PE
10408 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10409 Don't assume that the difference between two unsigned long values
10410 can fit into an integer. At this point, we know button_down_time
10411 <= event->timestamp, so the difference must be nonnegative, so
10412 there's no need to cast the result if double-click-time is
10413 nonnegative, as it should be; check that it's nonnegative, just in
10414 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10415 apart (about 25 days). (Bug#8664)
8e55734a 10416
841f1b75 10417 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10418 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10419
3e26f69c
PE
10420 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10421 that always fit in int. Use a sentinel instead of a counter, to
10422 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10423 * frame.h (struct frame): Use int for menu_bar_items_used
10424 instead of EMACS_INT, since it always fits in int.
3e26f69c 10425
5cc152c0
PE
10426 * menu.c (grow_menu_items): Check for int overflow.
10427
d89eb65e
PE
10428 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10429
5235bd3e
PE
10430 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10431 Before, the code was not consistent. These values cannot exceed
10432 2**31 - 1 so there's no need to make them unsigned.
10433 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10434 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10435 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10436 as modifiers.
10437 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10438
bc827e23
PE
10439 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10440 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10441 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10442 presumably because the widths might not match.
10443
78eb494e
PE
10444 * window.c (size_window): Avoid needless test at loop start.
10445
04f2d78b
CB
104462011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10447
10448 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10449
d2fc7e3d 104502011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10451
10452 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10453
d2fc7e3d 104542011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10455
10456 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10457 `width' to `bar_area_x' and `bar_area_width', respectively.
10458 (x_scroll_run): Take account of fringe background extension.
10459
04f2d78b
CB
10460 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10461 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10462 `bar_area_width', respectively.
10463 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10464 background extension.
10465
79b70037
GM
104662011-05-10 Jim Meyering <meyering@redhat.com>
10467
10468 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10469
2f142cc5
JB
104702011-05-10 Juanma Barranquero <lekktu@gmail.com>
10471
10472 * image.c (Finit_image_library): Return t for built-in image types,
10473 like pbm and xbm. (Bug#8640)
10474
57679c86
AS
104752011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10476
10477 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10478
888c9e86
EZ
104792011-05-07 Eli Zaretskii <eliz@gnu.org>
10480
b0512a1d
EZ
10481 * w32console.c (Fset_screen_color): Doc fix.
10482 (Fget_screen_color): New function.
10483 (syms_of_ntterm): Defsubr it.
10484
7285dc67
EZ
10485 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10486 unlink the temporary file if Fcall_process didn't create it in the
10487 first place.
10488 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10489 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10490 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10491 cue to call_process_cleanup not to close that handle.
10492
4d3fcc8e
BK
104932011-05-07 Ben Key <bkey76@gmail.com>
10494
10495 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10496 one of two shell specific rules, either bootstrap-temacs-CMD or
10497 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10498 to the previous implementation of the bootstrap-temacs rule.
10499 The bootstrap-temacs-CMD rule is similar to the previous
10500 implementation of the bootstrap-temacs rule except that it
10501 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10502 variable.
10503
10504 These changes, along with some changes to nt/configure.bat,
10505 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10506 earlier fix to add support for --cflags and --ldflags options
10507 that include quotes so that it works whether make uses cmd or
10508 sh as the shell.
10509
b4289b64
MA
105102011-05-06 Michael Albinus <michael.albinus@gmx.de>
10511
10512 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10513 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10514 is a constant.
10515 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10516 a string. Handle both cases.
10517 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10518 (Fdbus_register_method): Use Qinvalid_function.
10519
af4c0e28
JB
105202011-05-06 Juanma Barranquero <lekktu@gmail.com>
10521
10522 * makefile.w32-in: Update dependencies.
10523 (LISP_H): Add inttypes.h and stdin.h.
10524 (PROCESS_H): Add unistd.h.
10525
c51453d9
EZ
105262011-05-06 Eli Zaretskii <eliz@gnu.org>
10527
10528 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10529 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10530
8ff0ac3c 105312011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10532
4c4b566b
PE
10533 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10534
aab2b9b5
PE
10535 * term.c (vfatal): Remove stray call to va_end.
10536 It's not needed and the C Standard doesn't allow it here anyway.
10537
c378da0b
PE
10538 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10539 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10540
288b08c7
PE
10541 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10542 bytes.
10543
e3601888
PE
10544 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10545
db6c0e74
PE
10546 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10547
dd5963ea
PE
10548 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10549
88c9450f
PE
10550 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10551
2f9442b8
PE
10552 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10553
c032b5f8
PE
10554 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10555 * charset.c (Fdefine_charset_internal): Don't initialize
10556 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10557 32-bit int (Bug#8600).
a108c10b
PE
10558
10559 * lread.c (read_integer): Be more consistent with string-to-number.
10560 Use string_to_number to do the actual conversion; this avoids
10561 rounding errors and fixes some other screwups. Without this fix,
10562 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10563 (digit_to_number): Move earlier, for benefit of read_integer.
10564 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10565 not a digit in any supported base. (Bug#8602)
a108c10b 10566
ad5f9eea
PE
10567 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10568
aec1708a
PE
10569 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10570 to match comment at start of function. This also removes a
10571 GCC warning about overflow in a 32+64-bit port.
10572
47be4ab5
PE
10573 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10574
371cac43
PE
10575 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10576 Reported by Stefan Monnier in
10577 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10578 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10579 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10580
d01a7826
PE
10581 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10582 (EMACS_UINTPTR): Likewise, with uintptr_t.
10583
7fd47d5c
PE
10584 * lisp.h: Prefer 64-bit EMACS_INT if available.
10585 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10586 on 32-bit hosts that have 64-bit int, so that they can access
10587 large files.
122b0c86
PE
10588 However, temporarily disable this change unless the temporary
10589 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10590
8727937b
PE
10591 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10592
8ac068ac
PE
10593 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10594 This removes an assumption that EMACS_INT and long are the same
10595 width as pointers. The assumption is true for Emacs porting targets
10596 now, but we want to make other targets possible.
10597 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10598 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10599 In the rest of the code, change types of integers that hold casted
10600 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10601 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10602 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10603 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10604 No need to cast type when ORing.
10605 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10606 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10607 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10608 assume EMACS_INT is the same width as char *.
10609 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10610 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10611 Remove no-longer-needed casts.
10612 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10613 (xg_tool_bar_help_callback, xg_make_tool_item):
10614 Use EMACS_INTPTR to hold an integer
10615 that will be cast to void *; this can avoid a GCC warning
10616 if EMACS_INT is not the same width as void *.
10617 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10618 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10619 (current_message_1, set_message_1):
10620 Use a local to convert to proper width without a cast.
10621 * xmenu.c (dialog_selection_callback): Likewise.
10622
ede49d71
PE
10623 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10624 Also, don't assume VALBITS / RAND_BITS is less than 5,
10625 and don't rely on undefined behavior when shifting a 1 left into
10626 the sign bit.
10627 * lisp.h (get_random): Change signature to match.
10628
2f30ecd0
PE
10629 * lread.c (hash_string): Use size_t, not int, for hash computation.
10630 Normally we prefer signed values; but hashing is special, because
10631 it's better to use unsigned division on hash table sizes so that
10632 the remainder is nonnegative. Also, size_t is the natural width
10633 for hashing into memory. The previous code used 'int', which doesn't
10634 retain enough info to hash well into very large tables.
10635 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10636
2a866e7b
PE
10637 * dbusbind.c: Don't possibly lose pointer info when converting.
10638 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10639 Use XPNTR rather than XHASH, so that the high-order bits of
10640 the pointer aren't lost when converting through void *.
10641
51639eac
PE
10642 * eval.c (Fautoload): Don't double-shift a pointer.
10643
92394119
PE
10644 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10645
dbdb9a7c
JB
106462011-05-06 Juanma Barranquero <lekktu@gmail.com>
10647
10648 * gnutls.c (DEF_GNUTLS_FN):
10649 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10650
db7a0b4f
AS
106512011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10652
10653 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10654 marker. (Bug#8610)
10655
cd394be1 106562011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
10657
10658 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10659 New version that can reserve upto 2GB of heap space.
10660
f7ff1b0f 106612011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
10662
10663 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10664
639c109b
TZ
106652011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10666
10667 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10668 `gnutls_certificate_set_x509_key_file'.
10669
d2127135
JB
106702011-05-05 Juanma Barranquero <lekktu@gmail.com>
10671
10672 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10673 Update dependencies.
10674
e968f4f3
JB
106752011-05-04 Juanma Barranquero <lekktu@gmail.com>
10676
10677 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10678 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10679 Remove unused parameter `fildes'.
10680 * process.c (read_process_output, send_process): Don't pass it.
10681
84d358f0
JB
106822011-05-04 Juanma Barranquero <lekktu@gmail.com>
10683
10684 Fix previous change: the library cache is defined in w32.c.
10685 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10686 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10687
0898ca10
JB
106882011-05-04 Juanma Barranquero <lekktu@gmail.com>
10689
10690 Implement dynamic loading of GnuTLS on Windows.
10691
10692 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10693 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10694 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10695 Declare.
10696
10697 * gnutls.c (Qgnutls_dll): Define.
10698 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10699 (gnutls_*): Declare function pointers.
10700 (init_gnutls_functions): New function to initialize function pointers.
10701 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10702 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10703 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10704 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10705 (emacs_gnutls_write, emacs_gnutls_read)
10706 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10707 (Fgnutls_available_p): New function.
10708 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
10709 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10710 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10711
10712 * image.c: Include w32.h.
10713 (Vimage_type_cache): Delete.
10714 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10715 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10716 (w32_delayed_load): Move to w32.c.
10717
10718 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10719
10720 * w32.c (QCloaded_from, Vlibrary_cache): Define.
10721 (w32_delayed_load): Move from image.c. When loading a library, record
10722 its filename in the :loaded-from property of the library id.
10723 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10724 Initialize and staticpro them.
10725 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10726
10727 * process.c: Include lisp.h before w32.h, not after.
10728 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10729 instead of gnutls_record_check_pending.
10730
10731 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10732
ff4de4aa
TZ
107332011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
10734
10735 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10736 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
10737 as passed in.
10738
abe95abb
JD
107392011-05-03 Jan Djärv <jan.h.d@swipnet.se>
10740
10741 * xterm.c (x_set_frame_alpha): Do not set property on anything
10742 else than FRAME_X_OUTER_WINDOW (Bug#8608).
10743
e16e55d4
JB
107442011-05-02 Juanma Barranquero <lekktu@gmail.com>
10745
10746 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
10747
bafcf6a5
JB
107482011-05-02 Juanma Barranquero <lekktu@gmail.com>
10749
10750 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10751 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10752 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10753 (gnutls_global_initialized, Qgnutls_bootprop_priority)
10754 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10755 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10756 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10757 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10758 (Qgnutls_bootprop_callbacks_verify): Make static.
10759
e7a6747f
AS
107602011-05-01 Andreas Schwab <schwab@linux-m68k.org>
10761
19ed11ba
AS
10762 * callproc.c: Indentation fixup.
10763
e7a6747f 10764 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
10765 (wait_for_termination, interruptible_wait_for_termination):
10766 Move after wait_for_termination_1.
e7a6747f 10767
1ef14cb4
LMI
107682011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
10769
10770 * sysdep.c (interruptible_wait_for_termination): New function
10771 which is like wait_for_termination, but allows keyboard
10772 interruptions.
10773
10774 * callproc.c (Fcall_process): Add (:file "file") as an option for
10775 the STDOUT buffer.
10776 (Fcall_process_region): Ditto.
10777
330d880c
EZ
107782011-04-30 Eli Zaretskii <eliz@gnu.org>
10779
8db90b73
EZ
10780 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10781 rather than `XVECTOR (FOO)->size'.
10782
330d880c
EZ
10783 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10784 inttypes.h, as a gnulib replacement is used if it not available in
10785 system headers.
10786
15cbd324
EZ
107872011-04-21 Eli Zaretskii <eliz@gnu.org>
10788
10789 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10790 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10791 of MOST_POSITIVE_FIXNUM. (Bug#8528)
10792
10793 * coding.c (coding_alloc_by_realloc): Error out if destination
10794 will grow beyond MOST_POSITIVE_FIXNUM.
10795 (decode_coding_emacs_mule): Abort if there isn't enough place in
10796 charbuf for the composition carryover bytes. Reserve an extra
10797 space for up to 2 characters produced in a loop.
10798 (decode_coding_iso_2022): Abort if there isn't enough place in
10799 charbuf for the composition carryover bytes.
10800
108012011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 10802
ae940cca
EZ
10803 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10804 aborting when %lld or %lll format is passed.
10805 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10806 %llo or %llx format is passed. (Bug#8545)
10807
03ab8921
EZ
10808 * window.c (window_scroll_line_based): Use a marker instead of
10809 simple variables to record original value of point. (Bug#7952)
10810
afda1437
EZ
10811 * doprnt.c (doprnt): Fix the case where a multibyte sequence
10812 produced by %s or %c overflows available buffer space. (Bug#8545)
10813
f76dee0c
PE
108142011-04-28 Paul Eggert <eggert@cs.ucla.edu>
10815
10816 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 10817 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 10818
fdc5744d
JB
108192011-04-28 Juanma Barranquero <lekktu@gmail.com>
10820
10821 * w32.c (init_environment): Warn about defaulting HOME to C:\.
10822
638f053a
JB
108232011-04-28 Juanma Barranquero <lekktu@gmail.com>
10824
10825 * keyboard.c (Qdelayed_warnings_hook): Define.
10826 (command_loop_1): Run `delayed-warnings-hook'
10827 if Vdelayed_warnings_list is non-nil.
10828 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10829 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10830
d178f871
EZ
108312011-04-28 Eli Zaretskii <eliz@gnu.org>
10832
10833 * doprnt.c (doprnt): Don't return value smaller than the buffer
10834 size if the message was truncated. (Bug#8545).
10835
b124fd93
JB
108362011-04-28 Juanma Barranquero <lekktu@gmail.com>
10837
10838 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10839 (Fx_window_property): #if-0 the whole functions, not just the bodies.
10840
e810457d
PE
108412011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10842
10843 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10844
ea51cceb
JB
108452011-04-27 Juanma Barranquero <lekktu@gmail.com>
10846
10847 * makefile.w32-in: Update dependencies.
10848
94dcfacf
EZ
108492011-04-27 Eli Zaretskii <eliz@gnu.org>
10850
10851 Improve `doprnt' and its usage. (Bug#8545)
10852 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10853 `format_end'. Remove support for %l as a conversion specifier.
10854 Don't use xrealloc. Improve diagnostics when the %l size modifier
10855 is used. Update the commentary.
10856
10857 * eval.c (verror): Simplify calculation of size_t.
10858
10859 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10860 messages.
10861
f61f41d7
PE
108622011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
10863
10864 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10865 change.
10866
96fb4434
PE
108672011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10868
10869 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10870 This makes this file independent of the recent pseudovector change.
10871
671875da 108722011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 10873
69e9b5a3
PE
10874 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10875
b5f869a7 10876 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 10877 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 10878 Remove unused local.
c8926152 10879 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 10880
841a1577 10881 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
10882 GCC 4.6.0 optimizes based on type-based alias analysis.
10883 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
10884 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10885 != &v->size, and therefore "v->size = 1; b->size = 2; return
10886 v->size;" must therefore return 1. This assumption is incorrect
10887 for Emacs, since it type-puns struct Lisp_Vector * with many other
10888 types. To fix this problem, this patch adds a new type struct
f904488f 10889 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
10890 and pseudovectors, and helps optimizing compilers not get fooled
10891 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
10892 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
10893 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10894 the size member.
eab3844f
PE
10895 (XSETPVECTYPE): Rewrite in terms of new macro.
10896 (XSETPVECTYPESIZE): New macro, specifying both type and size.
10897 This is a bit clearer, and further avoids the possibility of
10898 undesirable aliasing.
10899 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 10900 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
10901 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10902 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
10903 (ASIZE): Now uses header.size rather than size.
10904 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
10905 to avoid the hassle of writing XVECTOR (foo)->header.size.
10906 (struct vectorlike_header): New type.
eab3844f
PE
10907 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10908 object, to help avoid aliasing.
10909 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10910 (SUBRP): Likewise, since Lisp_Subr is a special case.
10911 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
10912 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
10913 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 10914 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
10915 changed to be "header.size" and "header.next".
10916 * buffer.h (struct buffer): Likewise.
10917 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
10918 * frame.h (struct frame): Likewise.
10919 * process.h (struct Lisp_Process): Likewise.
10920 * termhooks.h (struct terminal): Likewise.
10921 * window.c (struct save_window_data, struct saved_window): Likewise.
10922 * window.h (struct window): Likewise.
10923 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
10924 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
10925 * buffer.c (init_buffer_once): Likewise.
10926 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
10927 special case.
10928 * process.c (Fformat_network_address): Use local var for size,
10929 for brevity.
10930
0df1eac5
PE
10931 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
10932
847ab9d1 10933 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
10934 * data.c (atof): Remove decl; no longer used or needed.
10935 (digit_to_number): Move to lread.c.
10936 (Fstring_to_number): Use new string_to_number function, to be
10937 consistent with how the Lisp reader treats infinities and NaNs.
10938 Do not assume that floating-point numbers represent EMACS_INT
10939 without losing information; this is not true on most 64-bit hosts.
10940 Avoid double-rounding errors, by insisting on integers when
10941 parsing non-base-10 numbers, as the documentation specifies.
10942 * lisp.h (string_to_number): New decl, replacing ...
10943 (isfloat_string): Remove.
bc0a5c13 10944 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 10945 (read1): Do not accept +. and -. as integers; this
452f4150
PE
10946 appears to have been a coding error. Similarly, do not accept
10947 strings like +-1e0 as floating point numbers. Do not report
10948 overflow for integer overflows unless the base is not 10 which
10949 means we have no simple and reliable way to continue.
10950 Break out the floating-point parsing into a new
10951 function string_to_number, so that Fstring_to_number parses
10952 floating point numbers consistently with the Lisp reader.
04f2d78b 10953 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
10954 (E_CHAR, EXP_INT): Remove, replacing with ...
10955 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
10956 (string_to_number): New function, replacing isfloat_string.
10957 This function checks for valid syntax and produces the resulting
10958 Lisp float number too. Rework it so that string-to-number
bc0a5c13 10959 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
10960 so that overflow for non-base-10 numbers is reported only when
10961 there's no portable and simple way to convert to floating point.
452f4150 10962
67769ffc
PE
10963 * textprop.c (set_text_properties_1): Rewrite for clarity,
10964 and to avoid GCC warning about integer overflow.
10965
c20db43f
PE
10966 * intervals.h (struct interval): Use EMACS_INT for members
10967 where EMACS_UINT might cause problems. See
10968 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
10969 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
10970 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
10971 All uses changed.
37aa2f85
PE
10972 (offset_intervals): Tell GCC not to worry about length overflow
10973 when negating a negative length.
c20db43f 10974
2538aa2f
PE
10975 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
10976 (overrun_check_free): Likewise.
10977
f2d3008d
PE
10978 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
10979 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
10980 word size.
10981
ec8df744
PE
10982 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10983 (gnutls_make_error): Rename local to avoid shadowing.
10984 (gnutls_emacs_global_deinit): ifdef out; not used.
10985 (Fgnutls_boot): Use const for pointer to readonly storage.
10986 Comment out unused local. Fix pointer signedness problems.
10987
640ee02d
PE
10988 * lread.c (openp): Don't stuff size_t into an 'int'.
10989 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
10990 about possible signed overflow.
10991
6048fb2a
PE
10992 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10993 (GDK_KEY_g): Don't define if already defined.
10994 (xg_prepare_tooltip): Avoid pointer signedness problem.
10995 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
10996
fa3c87e1
PE
10997 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
10998 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
10999
2172544b
PE
11000 * xfns.c (Fx_window_property): Simplify a bit,
11001 to make a bit faster and to avoid GCC 4.6.0 warning.
11002 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11003
9b821a21
PE
11004 * fns.c (internal_equal): Don't assume size_t fits in int.
11005
3c616cfa
PE
11006 * alloc.c (compact_small_strings): Tighten assertion a little.
11007
c2982e87
PE
11008 Replace pEd with more-general pI, and fix some printf arg casts.
11009 * lisp.h (pI): New macro, generalizing old pEd macro to other
11010 conversion specifiers. For example, use "...%"pI"d..." rather
11011 than "...%"pEd"...".
11012 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11013 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11014 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11015 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11016 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11017 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11018 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11019 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11020 64-bit hosts.
11021 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11022 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11023 * print.c (safe_debug_print, print_object): Likewise.
11024 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11025 to int.
6f04d126
PE
11026 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11027 avoiding the 0 flag, which is not portable.
c2982e87
PE
11028 * process.c (Fmake_network_process): Use pI to avoid cast.
11029 * region-cache.c (pp_cache): Likewise.
11030 * xdisp.c (decode_mode_spec): Likewise.
11031 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11032 behavior on 64-bit hosts with printf arg.
6f04d126 11033 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11034 (x_stop_queuing_selection_requests): Likewise.
11035 (x_get_window_property): Don't truncate byte count to an 'int'
11036 when tracing.
0b432f21 11037
5e073ec7
PE
11038 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11039 here, since it parses constructs like leading '-' and spaces,
11040 which are not wanted; and it overflows with large numbers.
11041 Instead, simply match F[0-9]+, which is what is wanted anyway.
11042
36372bf9
PE
11043 * alloc.c: Remove unportable assumptions about struct layout.
11044 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11045 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11046 (allocate_vectorlike, make_pure_vector): Use the new macros,
11047 plus offsetof, to remove unportable assumptions about struct layout.
11048 These assumptions hold on all porting targets that I know of, but
11049 they are not guaranteed, they're easy to remove, and removing them
11050 makes further changes easier.
11051
0b432f21
PE
11052 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11053 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11054 (string_overrun_cookie): Now const. Use initializers that
11055 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11056 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11057 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11058 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11059 multiple of sizeof (EMACS_INT); it need not be, if
11060 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11061 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11062
895009e1
JB
110632011-04-26 Juanma Barranquero <lekktu@gmail.com>
11064
11065 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11066
6a7a1b0b
TZ
110672011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11068
11069 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11070 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11071 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11072
841a1577 110732011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11074
11075 * lisp.h (Qdebug): List symbol.
895009e1 11076 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11077 * keyboard.c (debug-on-event): New variable.
11078 (handle_user_signal): Break into debugger when debug-on-event
11079 matches the current signal symbol.
11080
f2d3ba6f
DN
110812011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11082
11083 * alloc.c (check_sblock, check_string_bytes)
11084 (check_string_free_list): Convert to standard C.
11085
42ce4c63
TZ
110862011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11087
11088 * w32.c (emacs_gnutls_push): Fix typo.
11089
825cd63c
EZ
110902011-04-25 Eli Zaretskii <eliz@gnu.org>
11091
fb11d64d
EZ
11092 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11093 "cast to pointer from integer of different size".
11094
825cd63c
EZ
11095 Improve doprnt and its use in verror. (Bug#8545)
11096 * doprnt.c (doprnt): Document the set of format control sequences
11097 supported by the function. Use SAFE_ALLOCA instead of always
11098 using `alloca'.
11099
11100 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11101 is one byte too soon. Don't use xrealloc; instead xfree and
11102 xmalloc anew.
11103
e061a11b
TZ
111042011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11105
11106 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11107 callbacks stage.
11108
11109 * gnutls.c: Renamed global_initialized to
11110 gnutls_global_initialized. Added internals for the
11111 :verify-hostname-error, :verify-error, and :verify-flags
11112 parameters of `gnutls-boot' and documented those parameters in the
11113 docstring. Start callback support.
9173deec
JB
11114 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11115 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11116 on error. Return error code.
e061a11b
TZ
11117 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11118 (emacs_gnutls_read): Likewise.
11119 (Fgnutls_boot): Return handshake error code.
11120 (emacs_gnutls_handle_error): New function.
11121 (wsaerror_to_errno): Likewise.
11122
11123 * w32.h (emacs_gnutls_pull): Add prototype.
11124 (emacs_gnutls_push): Likewise.
11125
11126 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11127 (emacs_gnutls_push): Likewise.
11128
111292011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11130
11131 * process.c (wait_reading_process_output): Check if GnuTLS
11132 buffered some data internally if no FDs are set for TLS
11133 connections.
11134
11135 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11136 (LIBS): Link to USER_LIBS.
11137 ($(BLD)/gnutls.$(0)): New target.
11138
fa6996bc
EZ
111392011-04-24 Eli Zaretskii <eliz@gnu.org>
11140
eb35682e
EZ
11141 * xdisp.c (handle_single_display_spec): Rename the
11142 display_replaced_before_p argument into display_replaced_p, to
11143 make it consistent with the commentary. Fix typos in the
11144 commentary.
11145
e2ad650c
EZ
11146 * textprop.c (syms_of_textprop): Remove dead code.
11147 (copy_text_properties): Delete obsolete commentary about an
11148 interface that was deleted long ago. Fix typos in the description
11149 of arguments.
11150
1b2de274
EZ
11151 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11152 to changes in oldXMenu/XMenu.h from 2011-04-16.
11153 <menu_help_message, prev_menu_help_message>: Constify.
11154 (IT_menu_make_room): menu->help_text is now `const char **';
11155 adjust.
11156
11157 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11158 to changes in oldXMenu/XMenu.h from 2011-04-16.
11159 (struct XMenu): Declare `help_text' `const char **'.
11160
11161 * xfaces.c <Qunspecified>: Make extern again.
11162
11163 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11164 required by POSIX.
1b2de274 11165
762b15be
EZ
11166 * doc.c (get_doc_string): Improve the format passed to `error'.
11167
11168 * doprnt.c (doprnt): Improve commentary.
11169
11170 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11171
11172 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11173 them with etags.
11174
f1052e5d
EZ
11175 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11176 changes in globals.h immediately force recompilation.
762b15be
EZ
11177 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11178 $(CURDIR)/s/ms-w32.h.
11179 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11180
fa6996bc
EZ
11181 * character.c (Fchar_direction): Function deleted.
11182 (syms_of_character): Don't defsubr it.
11183 <char-direction-table>: Deleted.
11184
e6c3da20
EZ
111852011-04-23 Eli Zaretskii <eliz@gnu.org>
11186
11187 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11188 * doprnt.c: Include limits.h.
11189 (SIZE_MAX): New macro.
04f2d78b
CB
11190 (doprnt): Return a size_t value. 2nd arg is now size_t.
11191 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11192 Improve overflow protection. Support `l' modifier for integer
11193 conversions. Support %l conversion. Don't assume an EMACS_INT
11194 argument for integer conversions and for %c.
11195
11196 * lisp.h (doprnt): Restore prototype.
11197
11198 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11199 $(SRC)/character.h.
11200
11201 * Makefile.in (base_obj): Add back doprnt.o.
11202
11203 * deps.mk (doprnt.o): Add back prerequisites.
11204 (callint.o): Depend on character.h.
11205
11206 * eval.c (internal_lisp_condition_case): Include the handler
11207 representation in the error message.
11208 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11209 when breaking from the loop.
11210
11211 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11212
11213 * callint.c (Fcall_interactively): When displaying error message
11214 about invalid control letter, pass the character's codepoint, not
11215 a pointer to its multibyte form. Improve display of the character
11216 in octal and display also its hex code.
11217
11218 * character.c (char_string): Use %x to display the (unsigned)
11219 codepoint of an invalid character, to avoid displaying a bogus
11220 negative value.
11221
11222 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11223 `error', not SYMBOL_NAME itself.
11224
11225 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11226 character arguments to `error'.
11227
11228 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11229 to `error' in error message about FINAL_CHAR argument. Make sure
11230 FINAL_CHAR is a character, and use %c when it is passed as
11231 argument to `error'.
11232
4ffd0d6b 112332011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11234
11235 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11236
11237 * w32.c: Include <time.h>.
11238 (sys_localtime): New function.
11239
4ffd0d6b 112402011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11241
11242 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11243
4ffd0d6b 11244 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11245
4ffd0d6b 112462011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11247
4ffd0d6b
GM
11248 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11249 zombies (Bug#8467).
aac0c6e3 11250
04c56954
EZ
112512011-04-19 Eli Zaretskii <eliz@gnu.org>
11252
11253 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11254 gl_state.e_property when gl_state.object is Qt.
11255
11256 * insdel.c (make_gap_larger): Remove limitation of buffer size
11257 to <= INT_MAX.
11258
16a43933
CY
112592011-04-18 Chong Yidong <cyd@stupidchicken.com>
11260
11261 * xdisp.c (lookup_glyphless_char_display)
11262 (produce_glyphless_glyph): Handle cons cell entry in
11263 glyphless-char-display.
11264 (Vglyphless_char_display): Document it.
11265
11266 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11267 glyphless-char-display.
11268
4581706e
CY
112692011-04-17 Chong Yidong <cyd@stupidchicken.com>
11270
11271 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11272
11273 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11274
11275 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11276 definition for no-X builds.
11277
4887c6e2 112782011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11279
fd35b6f9
PE
11280 Static checks with GCC 4.6.0 and non-default toolkits.
11281
5c1ccb01
PE
11282 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11283
006c5daa
PE
11284 * process.c (keyboard_bit_set): Define only if SIGIO.
11285 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11286 (send_process): Repair possible setjmp clobbering.
11287
efc736d3
PE
11288 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11289
4e2fe2e6
PE
11290 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11291
f97334a2
PE
11292 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11293
4e75f29d
PE
11294 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11295 Define only if needed.
11296
90efadd1
PE
11297 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11298 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11299 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11300
3c647824
PE
11301 * dispextern.h (struct redisplay_interface): Rename param
11302 to avoid shadowing.
e264f262 11303 * termhooks.h (struct terminal): Likewise.
761383f4 11304 * xterm.c (xembed_send_message): Likewise.
3c647824 11305
b58c5c4a
PE
11306 * insdel.c (make_gap_smaller): Define only if
11307 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11308
cad59032
PE
11309 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11310 it.
11311
c339dc2e
PE
11312 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11313 so that we aren't warned about unused symbols.
11314
91a3e27b
PE
11315 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11316
399c71d3 11317 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11318
8ffc96f5
PE
11319 * xfns.c (x_real_positions): Mark locals as initialized.
11320
eef9bc79
PE
11321 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11322
098db9dd
PE
11323 * xterm.c: Fix problems found by static analysis with other toolkits.
11324 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11325 (x_dispatch_event): Declare static if USE_GTK, and
11326 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11327 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11328 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11329 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11330 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11331
eb18f6cc
PE
11332 * xmenu.c (menu_help_callback): Pointer type fixes.
11333 Use const pointers when pointing at readonly data. Avoid pointer
11334 signedness clashes.
11335 (FALSE): Remove unused macro.
11336 (update_frame_menubar): Remove unused decl.
11337
1fe72bf8
PE
11338 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11339
60d9e1db
PE
11340 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11341 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11342 (single_menu_item): Rename local to avoid shadowing.
11343
39261c26
PE
11344 * keyboard.c (make_lispy_event): Remove unused local var.
11345
018c5e19
PE
11346 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11347 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11348
63d2b86e
PE
11349 * bitmaps: Change bitmaps from unsigned char back to the X11
11350 compatible char. Avoid the old compiler warnings about
11351 out-of-range initializers by using, for example, '\xab' rather
11352 than 0xab.
11353
aefd87e1
PE
11354 * xgselect.c (xgselect_initialize): Check vs interface
11355 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11356
bf501fb9
PE
11357 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11358
e9829fdf
PE
11359 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11360 to read-only memory.
11361
1086c095
PE
11362 * fns.c (vector): Remove; this old hack is no longer needed.
11363
2baccd04 11364 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11365 Remove unused var.
dde42981 11366 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11367
72391843 11368 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11369
436c16df 11370 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11371 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11372 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11373
92bb796d 11374 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11375 (x_term_init): Remove local to avoid shadowing.
92bb796d 11376
764430a3 11377 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11378
11379 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11380 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11381
d1dfb56c
EZ
113822011-04-16 Eli Zaretskii <eliz@gnu.org>
11383
c4354cb4
EZ
11384 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11385
d1dfb56c
EZ
11386 Fix regex.c, syntax.c and friends for buffers > 2GB.
11387 * syntax.h (struct gl_state_s): Declare character position members
11388 EMACS_INT.
11389
11390 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11391
04f2d78b
CB
11392 * textprop.c (verify_interval_modification, interval_of):
11393 Declare arguments EMACS_INT.
d1dfb56c
EZ
11394
11395 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11396 EMACS_INT.
11397
11398 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11399
11400 * indent.c (Fvertical_motion): Local variable it_start is now
11401 EMACS_INT.
11402
11403 * regex.c (re_match, re_match_2, re_match_2_internal)
11404 (bcmp_translate, regcomp, regexec, print_double_string)
11405 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11406 (re_compile_pattern, re_exec): Declare arguments and local
11407 variables `size_t' and `ssize_t' and return values `regoff_t', as
11408 appropriate.
11409 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11410 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11411 <compile_stack_type>: `size' and `avail' are now `size_t'.
11412
11413 * regex.h <regoff_t>: Use ssize_t, not int.
11414 (re_search, re_search_2, re_match, re_match_2): Arguments that
11415 specify buffer/string position and length are now ssize_t and
11416 size_t. Return type is regoff_t.
11417
613052cd
BK
114182011-04-16 Ben Key <bkey76@gmail.com>
11419
11420 * nsfont.m: Fixed bugs in ns_get_family and
11421 ns_descriptor_to_entity that were caused by using free to
11422 deallocate memory blocks that were allocated by xmalloc (via
11423 xstrdup). This caused Emacs to crash when compiled with
11424 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11425 --enable-checking=xmallocoverrun). xfree is now used to
11426 deallocate these memory blocks.
11427
4170f62f 114282011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11429
71b41406
PE
11430 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11431
9587a89d
PE
11432 emacs_write: Accept and return EMACS_INT for sizes.
11433 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11434 et seq.
11435 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11436 Accept and return EMACS_INT.
11437 (emacs_gnutls_write): Return the number of bytes written on
11438 partial writes.
11439 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11440 (emacs_read, emacs_write): Remove check for negative size, as the
11441 Emacs source code has been audited now.
9587a89d
PE
11442 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11443 (emacs_read, emacs_write): Use it.
273a5f82
PE
11444 * process.c (send_process): Adjust to the new signatures of
11445 emacs_write and emacs_gnutls_write. Do not attempt to store
11446 a byte offset into an 'int'; it might overflow.
9587a89d 11447 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11448
3e047f51
PE
11449 * sound.c: Don't assume sizes fit in 'int'.
11450 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11451 Return EMACS_INT, not int.
3e047f51 11452 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11453 Accept EMACS_INT, not int.
11454 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11455 record read return values.
11456
cc39a9db
BK
114572011-04-15 Ben Key <bkey76@gmail.com>
11458
c9d0ec6d
JB
11459 * keyboard.c (Qundefined): Don't declare static since it is used
11460 in nsfns.m.
11461 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11462 static since they are used in nsfont.m.
cc39a9db 11463
6c60eb9f
SM
114642011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11465
11466 * process.c (Qprocessp): Don't declare static.
11467 * lisp.h (Qprocessp): Declare again.
11468
7990b61a
JB
114692011-04-15 Juanma Barranquero <lekktu@gmail.com>
11470
11471 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11472
5d4cb038
PE
114732011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11474
8bd7b830 11475 Improve C-level modularity by making more things 'static'.
cd64ea1d 11476
e3b27b31
PE
11477 Don't publish debugger-only interfaces to other modules.
11478 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11479 (verify_bytepos, count_markers): Move decls to the only modules
11480 that need them.
11481 * region-cache.h (pp_cache): Likewise.
11482 * window.h (check_all_windows): Likewise.
11483 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11484
5d4cb038
PE
11485 * sysdep.c (croak): Now static, if
11486 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11487 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11488
11489 * alloc.c (refill_memory_reserve): Now static if
11490 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11491 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11492
e87b6180
PE
11493 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11494 Define only if USE_LUCID.
11495
ac64929e
PE
11496 * xrdb.c (x_customization_string, x_rm_string): Now static.
11497
6f37259d
PE
11498 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11499 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11500
1683e3ab
PE
11501 * xdisp.c (draw_row_with_mouse_face): Now static.
11502 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11503
de9c2632
PE
11504 * window.h (check_all_windows): Mark externally visible.
11505
2b96acb7
PE
11506 * window.c (window_deletion_count): Now static.
11507
11508 * undo.c: Make symbols static if they're not exported.
11509 (last_undo_buffer, last_boundary_position, pending_boundary):
11510 Now static.
11511
50436f33
PE
11512 * textprop.c (interval_insert_behind_hooks): Now static.
11513 (interval_insert_in_front_hooks): Likewise.
11514
64520e5c
PE
11515 * term.c: Make symbols static if they're not exported.
11516 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11517 (max_frame_lines, tty_set_terminal_modes):
11518 (tty_reset_terminal_modes, tty_turn_off_highlight):
11519 (get_tty_terminal): Now static.
11520 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11521 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11522 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11523 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11524 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11525
1fa53021
PE
11526 * sysdep.c: Make symbols static if they're not exported.
11527 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11528 Now static.
11529 (sigprocmask_set, full_mask): Remove; unused.
11530 (wait_debugging): Mark as visible.
11531 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11532 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11533
d4b43b22
PE
11534 * syntax.c (syntax_temp): Define only if !__GNUC__.
11535
b7c513d0
PE
11536 * sound.c (current_sound_device, current_sound): Now static.
11537
989b29ad
PE
11538 * search.c (searchbufs, searchbuf_head): Now static.
11539
13a55a78
PE
11540 * scroll.c (scroll_cost): Remove; unused.
11541 * dispextern.h (scroll_cost): Remove decl.
11542
de68a1fc
PE
11543 * region-cache.h (pp_cache): Mark as externally visible.
11544
40ccffa6
PE
11545 * process.c: Make symbols static if they're not exported.
11546 (process_tick, update_tick, create_process, chan_process):
11547 (Vprocess_alist, proc_buffered_char, datagram_access):
11548 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11549 (deactivate_process): Mark defn as static, as well as decl.
11550 * lisp.h (create_process): Remove decl.
11551 * process.h (chan_process, Vprocess_alist): Remove decls.
11552
ad64fc97
PE
11553 * print.c: Make symbols static if they're not exported.
11554 (print_depth, new_backquote_output, being_printed, print_buffer):
11555 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11556 (print_interval, print_number_index, initial_stderr_stream):
11557 Now static.
11558 * lisp.h (Fprinc): Remove decl.
11559 (debug_output_compilation_hack): Mark as externally visible.
11560
adddb265
PE
11561 * sysdep.c (croak): Move decl from here to syssignal.h.
11562 * syssignal.h (croak): Put it here, so the API can be checked when
11563 'croak' is called from dissociate_if_controlling_tty.
11564
1717ede2
PE
11565 * minibuf.c: Make symbols static if they're not exported.
11566 (minibuf_save_list, choose_minibuf_frame): Now static.
11567 * lisp.h (choose_minibuf_frame): Remove decl.
11568
fa5fb2bc
PE
11569 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11570
1e3890d1
PE
11571 * lread.c: Make symbols static if they're not exported.
11572 (read_objects, initial_obarray, oblookup_last_bucket_number):
11573 Now static.
11574 (make_symbol): Remove; unused.
11575 * lisp.h (initial_obarray, make_symbol): Remove decls.
11576
8a1414fa
PE
11577 * keyboard.c: Make symbols static if they're not exported.
11578 (single_kboard, recent_keys_index, total_keys, recent_keys):
11579 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11580 (this_single_command_key_start, echoing, last_auto_save):
11581 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11582 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11583 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11584 (Vlispy_mouse_stem, double_click_count):
11585 Now static.
11586 (force_auto_save_soon): Define only if SIGDANGER.
11587 (ignore_mouse_drag_p): Now static if
11588 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11589 (print_help): Remove; unused.
11590 (stop_character, last_timer_event): Mark as externally visible.
11591 * keyboard.h (ignore_mouse_drag_p): Declare only if
11592 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11593 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11594 * lisp.h (echoing): Remove decl.
11595 (force_auto_save_soon): Declare only if SIGDANGER.
11596 * xdisp.c (redisplay_window): Simplify code, to make it more
11597 obvious that ignore_mouse_drag_p is not accessed if !defined
11598 USE_GTK && !defined HAVE_NS.
11599
93ea6e8f
PE
11600 * intervals.c: Make symbols static if they're not exported.
11601 (merge_properties_sticky, merge_interval_right, delete_interval):
11602 Now static.
11603 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11604
77382fcc
PE
11605 * insdel.c: Make symbols static if they're not exported.
11606 However, leave prepare_to_modify_buffer alone. It's never
11607 called from outside this function, but that appears to be a bug.
11608 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11609 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11610 (adjust_after_replace_noundo): Remove; unused.
11611 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 11612 (signal_before_change): Remove decls.
77382fcc 11613
9306c32e
PE
11614 * indent.c (val_compute_motion, val_vmotion): Now static.
11615
cd44d2eb
PE
11616 * image.c: Make symbols static if they're not exported.
11617 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11618 if USE_GTK.
11619 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11620 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11621
ad9a7a06
PE
11622 * fringe.c (standard_bitmaps): Now static.
11623 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11624
81626931
PE
11625 * frame.c: Make symbols static if they're not exported.
11626 (x_report_frame_params, make_terminal_frame): Now static.
11627 (get_frame_param): Now static, unless HAVE_NS.
11628 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11629 (x_get_resource_string): Remove; not used.
11630 * frame.h (make_terminal_frame, x_report_frame_params):
11631 (x_get_resource_string); Remove decls.
11632 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11633 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11634
239f9db9
PE
11635 * font.c, fontset.c: Make symbols static if they're not exported.
11636 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11637 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11638 * font.c (font_close_object): Now static.
11639 * font.h (font_close_object): Remove.
11640 * fontset.c (FONTSET_OBJLIST): Remove.
11641 (free_realized_fontset) #if-0 the body, which does nothing.
11642 (face_suitable_for_char_p): #if-0, as it's never called.
11643 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
11644 * xfaces.c (face_at_string_position):
11645 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
11646 since 0 is always ASCII.
11647
dfcf3579
PE
11648 * fns.c (weak_hash_tables): Now static.
11649
5045092b
PE
11650 * fileio.c: Make symbols static if they're not exported.
11651 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11652 (Vwrite_region_annotation_buffers): Now static.
11653
57a96f5c
PE
11654 * eval.c: Make symbols static if they're not exported.
11655 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11656 * lisp.h (backtrace_list): Remove decl.
11657
35f08c38
PE
11658 * emacs.c: Make symbols static if they're not exported.
11659 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11660 (fatal_error_code, fatal_error_signal_hook, standard_args):
11661 Now static.
11662 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11663 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11664 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11665 * lisp.h (fatal_error_signal_hook): Remove decl.
11666 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11667
f44bd759
PE
11668 * editfns.c: Move a (normally-unused) function to its only use.
11669 * editfns.c, lisp.h (get_operating_system_release): Remove.
11670 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11671 worth the hassle of breaking this out.
11672
b532497d
PE
11673 * xterm.c: Make symbols static if they're not exported.
11674 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11675 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11676 (x_destroy_window, x_delete_display):
11677 Now static.
11678 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11679 (x_mouse_leave): Remove; unused.
11680 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11681 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11682 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11683 Remove decls.
11684 (x_mouse_leave): Declare only if WINDOWSNT.
11685 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11686 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11687 USE_X_TOOLKIT.
11688
1675728f
PE
11689 * ftxfont.c: Make symbols static if they're not exported.
11690 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11691 HAVE_FREETYPE.
11692 * font.h (ftxfont_driver): Likewise.
11693
e4cebfca
PE
11694 * xfns.c: Make symbols static if they're not exported.
11695 (x_last_font_name, x_display_info_for_name):
11696 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11697 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11698 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11699 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11700 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11701 (last_show_tip_args): Now static.
11702 (xic_defaut_fontset, xic_create_fontsetname): Define only if
11703 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11704 (x_screen_planes): Remove; unused.
11705 * dispextern.h (x_screen_planes): Remove decl.
11706
5bf46f05
PE
11707 * dispnew.c: Make symbols static if they're not exported.
11708 * dispextern.h (redraw_garbaged_frames, scrolling):
11709 (increment_row_positions): Remove.
11710 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11711 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11712 Now static.
11713 (redraw_garbaged_frames): Remove; unused.
11714
435f4c28
PE
11715 * xfaces.c: Make symbols static if they're not exported.
11716 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11717 Remove decls.
11718 * xterm.h (defined_color): Remove decls.
11719 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11720 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11721 (menu_face_changed_default, defined_color, free_realized_face):
11722 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11723 (ascii_face_of_lisp_face): Remove; unused.
11724
8524aef3
PE
11725 * xdisp.c: Make symbols static if they're not exported.
11726 * dispextern.h (scratch_glyph_row, window_box_edges):
11727 (glyph_to_pixel_coords, set_cursor_from_row):
11728 (get_next_display_element, set_iterator_to_next):
11729 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11730 (show_mouse_face): Remove decls
11731 * frame.h (message_buf_print): Likewise.
11732 * lisp.h (pop_message, set_message, check_point_in_composition):
11733 Likewise.
11734 * xterm.h (set_vertical_scroll_bar): Likewise.
11735 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11736 (message_buf_print, scratch_glyph_row, displayed_buffer):
11737 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11738 (get_next_display_element, show_mouse_face, window_box_edges):
11739 (frame_to_window_pixel_xy, check_point_in_composition):
11740 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11741 (glyph_to_pixel_coords): Remove; unused.
11742
16390cd2
PE
11743 * dired.c (file_name_completion): Now static.
11744
11745 * dbusbind.c (xd_in_read_queued_messages): Now static.
11746
a25f4dfa
PE
11747 * lisp.h (circular_list_error, FOREACH): Remove; unused.
11748 * data.c (circular_list_error): Remove.
11749
14a9c8df
PE
11750 * commands.h (last_point_position, last_point_position_buffer):
11751 (last_point_position_window): Remove decls.
11752 * keyboard.c: Make these variables static.
11753
04f2d78b
CB
11754 * coding.h (coding, code_convert_region, encode_coding_gap):
11755 Remove decls.
74ab6df5
PE
11756 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11757 (iso_code_class, detect_coding, code_convert_region): Now static.
11758 (encode_coding_gap): Remove; unused.
11759
38dfbee1
PE
11760 * chartab.c (chartab_chars, chartab_bits): Now static.
11761
a2cb4e63
PE
11762 * charset.h (charset_iso_8859_1): Remove decl.
11763 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11764 Now static.
11765
127198fd
PE
11766 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11767 * ccl.c (Vccl_program_table): Now static.
11768 (check_ccl_update): Remove; unused.
11769
d85b608f
PE
11770 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11771 * category.h: ... from here.
11772 * category.c (check_category_table, set_category_set): Now static.
11773
31cd66f3
PE
11774 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11775 * lisp.h: Remove these decls.
11776
c358e587
PE
11777 * buffer.c (buffer_count): Remove unused var.
11778
e78aecca
PE
11779 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11780 so that it's not optimized away.
11781 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11782 * dispextern.h (bidi_dump_cached_states): Remove, since it's
11783 exported only to the debugger.
11784
e192d7d3 11785 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 11786 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 11787
92470028
PE
11788 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11789 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11790 was inaccessible from Lisp.
11791 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11792 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11793
244ed907
PE
11794 alloc.c: Import and export fewer symbols, and remove unused items.
11795 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11796 is defined.
11797 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11798 it's not optimized away by whole-program optimization.
11799 (message_enable_multibyte, free_misc): Remove.
11800 (catchlist, handlerlist, mark_backtrace):
11801 Declare only if BYTE_MARK_STACK.
11802 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11803 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11804 (message_enable_multibyte): Remove decl.
11805 (free_misc, interval_free_list, float_block, float_block_index):
11806 (n_float_blocks, float_free_list, cons_block, cons_block_index):
11807 (cons_free_list, last_marked_index):
11808 Now static.
11809 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11810 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11811 (mark_backtrace): Define only if BYTE_MARK_STACK.
11812 * xdisp.c (message_enable_multibyte): Now static.
11813
61c2b50e 11814 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
11815 This makes it easier for human readers (and static analyzers)
11816 to see whether these variables are used from other modules.
11817 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11818 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11819 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11820 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11821 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11822 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11823 * xmenu.c, xselect.c:
11824 Declare Q* vars static if they are not used in other modules.
11825 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11826 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11827 Remove decls of unexported vars.
11828 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11829
95c82688
PE
11830 * lisp.h (DEFINE_FUNC): Make sname 'static'.
11831
16a97296
PE
11832 Make Emacs functions such as Fatom 'static' by default.
11833 This makes it easier for human readers (and static analyzers)
11834 to see whether these functions can be called from other modules.
11835 DEFUN now defines a static function. To make the function external
11836 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
11837 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11838 (Finit_image_library):
16a97296
PE
11839 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11840 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11841 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11842 Remove decls, since these functions are now static.
11843 (Funintern, Fget_internal_run_time): New decls, since these functions
11844 were already external.
95c82688 11845
16a97296
PE
11846 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11847 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11848 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11849 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11850 * keyboard.c, keymap.c, lread.c:
11851 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11852 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11853 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11854 Mark functions with DEFUE instead of DEFUN,
11855 if they are used in other modules.
11856 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11857 decls for now-static functions.
11858 * buffer.h (Fdelete_overlay): Remove decl.
11859 * callproc.c (Fgetenv_internal): Mark as internal.
11860 * composite.c (Fremove_list_of_text_properties): Remove decl.
11861 (Fcomposition_get_gstring): New forward static decl.
11862 * composite.h (Fcomposite_get_gstring): Remove decl.
11863 * dired.c (Ffile_attributes): New forward static decl.
11864 * doc.c (Fdocumntation_property): New forward static decl.
11865 * eval.c (Ffetch_bytecode): New forward static decl.
11866 (Funintern): Remove extern decl; now in .h file where it belongs.
11867 * fileio.c (Fmake_symbolic_link): New forward static decl.
11868 * image.c (Finit_image_library): New forward static decl.
11869 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11870 * intervals.h (Fprevious_property_change):
11871 (Fremove_list_of_text_properties): Remove decls.
11872 * keyboard.c (Fthis_command_keys): Remove decl.
11873 (Fcommand_execute): New forward static decl.
11874 * keymap.c (Flookup_key): New forward static decl.
11875 (Fcopy_keymap): Now static.
11876 * keymap.h (Flookup_key): Remove decl.
11877 * process.c (Fget_process): New forward static decl.
11878 (Fprocess_datagram_address): Mark as internal.
11879 * syntax.c (Fsyntax_table_p): New forward static decl.
11880 (skip_chars): Remove duplicate decl.
11881 * textprop.c (Fprevious_property_change): New forward static decl.
11882 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11883 Now internal.
11884 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11885 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11886
785bbd42
PE
11887 * editfns.c (Fformat): Remove unreachable code.
11888
8b913b57
AS
118892011-04-14 Andreas Schwab <schwab@linux-m68k.org>
11890
11891 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11892 change. (Bug#8496)
11893
a6744a35
EZ
118942011-04-13 Eli Zaretskii <eliz@gnu.org>
11895
11896 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11897 when at ZV. (Bug#8487)
11898
e7974947
AS
118992011-04-12 Andreas Schwab <schwab@linux-m68k.org>
11900
baad03f0
AS
11901 * charset.c (Fclear_charset_maps): Use xfree instead of free.
11902 (Bug#8437)
11903 * keyboard.c (parse_tool_bar_item): Likewise.
11904 * sound.c (sound_cleanup, alsa_close): Likewise.
11905 * termcap.c (tgetent): Likewise.
11906 * xfns.c (x_default_font_parameter): Likewise.
11907 * xsettings.c (read_and_apply_settings): Likewise.
11908
e7974947
AS
11909 * alloc.c (overrun_check_malloc, overrun_check_realloc)
11910 (overrun_check_free): Protoize.
11911
28272684
PE
119122011-04-12 Paul Eggert <eggert@cs.ucla.edu>
11913
11914 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
11915 since callers should never pass a negative size.
11916 Change the signature to match that of plain 'read' and 'write'; see
11917 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
11918 * lisp.h: Update prototypes of emacs_write and emacs_read.
11919
11997c76
EZ
119202011-04-11 Eli Zaretskii <eliz@gnu.org>
11921
11922 * xdisp.c (redisplay_window): Don't try to determine the character
11923 position of the scroll margin if the window start point w->startp
e896f03c 11924 is outside the buffer's accessible region. (Bug#8468)
11997c76 11925
8a2cbd72
EZ
119262011-04-10 Eli Zaretskii <eliz@gnu.org>
11927
11928 Fix write-region and its subroutines for buffers > 2GB.
11929 * fileio.c (a_write, e_write): Modify declaration of arguments and
11930 local variables to support buffers larger than 2GB.
11931 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
11932
11933 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
11934 argument, local variables, and return value.
11935
11936 * lisp.h: Update prototypes of emacs_write and emacs_read.
11937
11938 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
11939
4073e537 119402011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 11941
1ebfdcb6
PE
11942 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
11943
b2ded58d
PE
11944 Fix more problems found by GCC 4.6.0's static checks.
11945
7d66342c
PE
11946 * xdisp.c (vmessage): Use a better test for character truncation.
11947
bbf47d44
PE
11948 * charset.c (load_charset_map): <, not <=, for optimization,
11949 and to avoid potential problems with integer overflow.
9248994d 11950 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 11951 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 11952 * editfns.c (Fformat): Likewise.
1e69125e 11953 * syntax.c (skip_chars): Likewise.
3befa583 11954
e3019616
PE
11955 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
11956 This also lets GCC 4.6.0 generate slightly better loop code.
11957
becfa255
PE
11958 * callint.c (Fcall_interactively): <, not <=, for optimization.
11959 (Fcall_interactively): Count the number of arguments produced,
11960 not the number of arguments given. This is simpler and lets GCC
11961 4.6.0 generate slightly better code.
11962
dae0cd48
PE
11963 * ftfont.c: Distingish more carefully between FcChar8 and char.
11964 The previous code passed unsigned char * to a functions like
11965 strlen and xstrcasecmp that expect char *, which does not
11966 conform to the C standard.
11967 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
11968 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
11969 char * when the C standard requires it.
11970
76032d70
PE
11971 * keyboard.c (read_char): Remove unused var.
11972
eb3f1cc8
PE
11973 * eval.c: Port to Windows vsnprintf (Bug#8435).
11974 Include <limits.h>.
11975 (SIZE_MAX): Define if the headers do not.
11976 (verror): Do not give up if vsnprintf returns a negative count.
11977 Instead, grow the buffer. This ports to Windows vsnprintf, which
11978 does not conform to C99. Problem reported by Eli Zaretskii.
11979 Also, simplify the allocation scheme, by avoiding the need for
11980 calling realloc, and removing the ALLOCATED variable.
11981
70476b54
PE
11982 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
11983
12020a9e
PE
11984 Remove invocations of doprnt, as Emacs now uses vsnprintf.
11985 But keep the doprint source code for now, as we might revamp it
11986 and use it again (Bug#8435).
ea6c7ae6
PE
11987 * lisp.h (doprnt): Remove.
11988 * Makefile.in (base_obj): Remove doprnt.o.
11989 * deps.mk (doprnt.o): Remove.
11990
5fdb398c
PE
11991 error: Print 32- and 64-bit integers portably (Bug#8435).
11992 Without this change, on typical 64-bit hosts error ("...%d...", N)
11993 was used to print both 32- and 64-bit integers N, which relied on
11994 undefined behavior.
61bdb816 11995 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
11996 * lisp.h (error, verror): Mark as printf-like functions.
11997 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
11998 Report overflow in size calculations when allocating printf buffer.
11999 Do not truncate output string at its first null byte.
12000 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12001 Truncate the output at a character boundary, since vsnprintf does not
12002 do that.
12003 * charset.c (check_iso_charset_parameter): Convert internal
12004 character to string before calling 'error', since %c now has the
12005 printf meaning.
12006 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12007 overflow when computing char to be passed to 'error'. Do not
12008 pass Lisp_Object to 'error'; pass the integer instead.
12009 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12010 formatted with plain %d.
12011
b189fa66
PE
12012 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12013
bff87ef0
PE
12014 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12015
7e2cac20
PE
12016 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12017
ce4d90b5
PE
12018 * xterm.c (x_catch_errors): Remove duplicate declaration.
12019
266c9547
PE
12020 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12021
79c49ad2
PE
12022 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12023
368f4090
JM
120242011-04-10 Jim Meyering <meyering@redhat.com>
12025
12026 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12027 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12028 return ssize_t not "int", and use size_t as the buffer length.
12029 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12030 * gnutls.h: Update declarations.
12031 * process.c (read_process_output): Use ssize_t, to match.
12032 (send_process): Likewise.
12033
a32d4040
CY
120342011-04-09 Chong Yidong <cyd@stupidchicken.com>
12035
12036 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12037
8546720e 120382011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12039
04f2d78b
CB
12040 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12041 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12042
8546720e
GM
12043 * xterm.c (handle_one_xevent):
12044 * xmenu.c (create_and_show_popup_menu):
12045 * xselect.c (x_decline_selection_request)
12046 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12047
0a2f5c1a 120482011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12049
12050 Fix some uses of `int' instead of EMACS_INT.
12051 * search.c (string_match_1, fast_string_match)
12052 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12053 (scan_buffer, find_next_newline_no_quit)
12054 (find_before_next_newline, search_command, Freplace_match)
12055 (Fmatch_data): Make some `int' variables be EMACS_INT.
12056
12057 * xdisp.c (display_count_lines): 3rd argument and return value now
12058 EMACS_INT. All callers changed.
12059 (pint2hrstr): Last argument is now EMACS_INT.
12060
12061 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12062 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12063 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12064 (decode_coding_utf_16, decode_coding_emacs_mule)
12065 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12066 (decode_coding_ccl, decode_coding_charset)
12067 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12068 (decode_coding_iso_2022, decode_coding_emacs_mule)
12069 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12070 <char_offset, last_offset>: Declare EMACS_INT.
12071 (encode_coding_utf_8, encode_coding_utf_16)
12072 (encode_coding_emacs_mule, encode_invocation_designation)
12073 (encode_designation_at_bol, encode_coding_iso_2022)
12074 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12075 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12076 Declare EMACS_INT.
12077 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12078 (encode_invocation_designation): Last argument P_NCHARS is now
12079 EMACS_INT.
12080 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12081 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12082
12083 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12084 All users changed.
12085
12086 * ccl.c (Fccl_execute_on_string): Declare some variables
12087 EMACS_INT.
12088
8546720e 120892011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12090
12091 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12092
4e19a977
CS
120932011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12094
12095 * process.c (Fformat_network_address): Doc fix.
12096
87302331
R
120972011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12098
ee7683eb 12099 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12100
cbb59342
CY
121012011-04-08 Chong Yidong <cyd@stupidchicken.com>
12102
12103 * keyboard.c (read_char): Call Lisp function help-form-show,
12104 instead of using internal_with_output_to_temp_buffer.
12105 (Qhelp_form_show): New var.
e0d38eeb 12106 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12107
12108 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12109
12110 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12111
e67a13ab
CY
121122011-04-06 Chong Yidong <cyd@stupidchicken.com>
12113
04f2d78b
CB
12114 * process.c (Flist_processes): Remove to Lisp.
12115 (list_processes_1): Delete.
e67a13ab 12116
973f782d
EZ
121172011-04-06 Eli Zaretskii <eliz@gnu.org>
12118
7c106b1e
EZ
12119 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12120
973f782d
EZ
12121 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12122
41cf7d1a 121232011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12124
ca23cc88
PE
12125 Fix more problems found by GCC 4.6.0's static checks.
12126
f390e2d5
PE
12127 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12128
42eea0d0
PE
12129 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12130
b69769da 12131 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12132
f9541e84
PE
12133 * xdisp.c (vmessage): Mark as a printf-like function.
12134
13841b55
PE
12135 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12136
c136c10f
PE
12137 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12138
5e2d4a30
PE
12139 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12140 printf-like functions.
12141 (tiff_load): Add casts to remove these marks before passing them
12142 to system-supplied API.
12143
583f48b9
PE
12144 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12145
b25d760e
PE
12146 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12147 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12148 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12149 directly, rather than having caller test rule sign. This avoids
12150 some unnecessary tests.
12151 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12152 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12153 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12154
bc7b6697 12155 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12156 (xfont_open): Avoid unnecessary tests.
bc7b6697 12157
27ccc379
PE
12158 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12159
dcd5c89a
PE
12160 * composite.h, composite.c (composition_gstring_put_cache):
12161 Use EMACS_INT, not int, for length.
12162
b13a45c6
PE
12163 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12164 breaking out part of COMPOSITION_DECODE_RULE.
12165 (COMPOSITION_DECODE_RULE): Use it.
12166 * composite.c (get_composition_id): Remove unused local vars,
12167 by using the new macro.
12168
1e792e4d
PE
12169 * textprop.c (set_text_properties_1): Change while to do-while,
12170 since the condition is always true at first.
12171
dc6c6455 12172 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12173 (interval_deletion_adjustment): Return unsigned value.
12174 All uses changed.
dc6c6455 12175
aba7731a
PE
12176 * process.c (list_processes_1, create_pty, read_process_output):
12177 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12178 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12179 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12180 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12181 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12182
fdfc4bf3
PE
12183 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12184
fca8fe46 12185 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12186 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12187
06a0259a 12188 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12189 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12190 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12191
e7b9e80f
PE
12192 * print.c (print_error_message): Avoid int overflow.
12193
56201685
PE
12194 * font.c (font_list_entities): Redo for clarity,
12195 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12196
78834453 12197 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12198 (font_score): Avoid potential overflow in diff calculation.
78834453 12199
0bc0b309 12200 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12201 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12202
e610eaca
PE
12203 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12204
b895abce
PE
12205 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12206 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12207 can always succeed if overflow has undefined behavior.
12208
1f1d9321 12209 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12210 (wordify): Omit three unnecessary tests.
1f1d9321 12211
c59478bc
PE
12212 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12213 All callers changed. This avoids the need for an unused var.
12214
79b73827
PE
12215 * casefiddle.c (casify_region): Remove var that is set but not used.
12216
a4db5dfe
PE
12217 * dired.c (file_name_completion): Remove var that is set but not used.
12218
43aae36e
PE
12219 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12220
2a47c44d 12221 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12222 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12223
a37c69bf
PE
12224 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12225 Check for integer overflow on size calculations.
12226
328ab8e7
PE
12227 * buffer.c (Fprevious_overlay_change): Remove var that is set
12228 but not used.
12229
e5a2a5cb
PE
12230 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12231 Remove vars that are set but not used.
8d84a6eb 12232 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12233 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12234
a60e5f68
PE
12235 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12236
f661cb61 12237 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12238 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12239
f0397f5a
PE
12240 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12241 that are set but not used.
12242
8664db06 12243 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12244 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12245
6abdaa4a
PE
12246 * xselect.c (x_get_local_selection, x_handle_property_notify):
12247 Remove vars that are set but not used.
12248
0ce7538d 12249 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12250 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12251
9ae848fc
PE
12252 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12253 Remove var that is set but not used.
0b918413
PE
12254 (scroll_bar_windows_size): Now size_t, not int.
12255 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12256 Check for overflow.
9ae848fc 12257
a5a62657
PE
12258 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12259 (map_tty_color) [!defined MSDOS]: Likewise.
12260
5c5cdd39
PE
12261 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12262
66ebf983
PE
12263 * coding.c: Remove vars that are set but not used.
12264 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12265 All callers changed.
12266 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12267 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12268 (decode_coding_charset): Remove vars that are set but not used.
12269
1be4d761
PE
12270 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12271 that is set but not used.
12272
47553fa8
PE
12273 * print.c (print_object): Remove var that is set but not used.
12274
1f7196bf 12275 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12276 The gnulib version avoids calling malloc in the usual case,
12277 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12278 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12279 * filelock.c (current_lock_owner): Likewise.
12280 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12281 * sysdep.c: Include allocator.h, careadlinkat.h.
12282 (emacs_no_realloc_allocator): New static constant.
12283 (emacs_readlink): New function.
fdb61804
PE
12284 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12285 ../lib/careadlinkat.h.
d1fdcab7 12286
f84c17c7
SM
122872011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12288
12289 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12290 first non-nil return value).
12291
ef3862ad
JD
122922011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12293
12294 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12295 if not defined (Bug#8403).
12296
376a7006
JB
122972011-04-02 Juanma Barranquero <lekktu@gmail.com>
12298
12299 * xdisp.c (display_count_lines): Remove parameter `start',
12300 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12301 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12302 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12303 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12304 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12305 and thereabouts. All callers changed.
12306 (get_per_char_metric): Remove parameter `f', unused since
12307 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12308
6ca3801d
JM
123092011-04-02 Jim Meyering <meyering@redhat.com>
12310
12311 do not dereference NULL upon failed strdup
12312 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12313 (ns_get_family): Likewise.
12314
d8e2b5ba
JB
123152011-04-02 Juanma Barranquero <lekktu@gmail.com>
12316
12317 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12318
8c74fcbd
JD
123192011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12320
12321 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12322 later (Bug#8403).
12323
7200d79c
SM
123242011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12325
03408648 12326 Add lexical binding.
7200d79c 12327
03408648
SM
12328 * window.c (Ftemp_output_buffer_show): New fun.
12329 (Fsave_window_excursion):
12330 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12331
12332 * lread.c (lisp_file_lexically_bound_p): New function.
12333 (Fload): Bind Qlexical_binding.
12334 (readevalloop): Remove `evalfun' arg.
12335 Bind Qinternal_interpreter_environment.
12336 (Feval_buffer): Bind Qlexical_binding.
12337 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12338 Mark as dynamic.
12339 (syms_of_lread): Declare `lexical-binding'.
12340
12341 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12342
12343 * keyboard.c (eval_dyn): New fun.
12344 (menu_item_eval_property): Use it.
ca105506
SM
12345
12346 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12347
03408648
SM
12348 * fns.c (concat, mapcar1): Accept byte-code-functions.
12349
12350 * eval.c (Fsetq): Handle lexical vars.
12351 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12352 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12353 (FletX, Flet): Obey lexical binding.
12354 (Fcommandp): Handle closures.
12355 (Feval): New `lexical' arg.
12356 (eval_sub): New function extracted from Feval. Use it almost
12357 everywhere where Feval was used. Look up vars in lexical env.
12358 Handle closures.
12359 (Ffunctionp): Move from subr.el.
12360 (Ffuncall): Handle closures.
12361 (apply_lambda): Remove `eval_flags'.
12362 (funcall_lambda): Handle closures and new byte-code-functions.
12363 (Fspecial_variable_p): New function.
12364 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12365 but without exporting it to Lisp.
23aba0ea 12366
23aba0ea 12367 * doc.c (Fdocumentation, store_function_docstring):
03408648 12368 * data.c (Finteractive_form): Handle closures.
23aba0ea 12369
03408648
SM
12370 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12371 interactive spec.
ba83908c 12372
04f2d78b
CB
12373 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12374 New byte-codes.
03408648
SM
12375 (exec_byte_code): New function extracted from Fbyte_code to handle new
12376 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12377
03408648 12378 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12379
03408648 12380 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12381
e2abce01
JB
123822011-03-31 Juanma Barranquero <lekktu@gmail.com>
12383
12384 * xdisp.c (redisplay_internal): Fix prototype.
12385
63696a73 123862011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12387
63696a73 12388 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12389 (try_scrolling): Use it when setting scroll_limit.
12390 Limit scrolling to 100 screen lines.
63696a73
EZ
12391 (redisplay_window): Even when falling back on "recentering",
12392 position point in the window according to scroll-conservatively,
12393 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12394
12395 (try_scrolling): When point is above the window, allow searching
12396 as far as scroll_max, or one screenful, to compute vertical
12397 distance from PT to the scroll margin position. This prevents
12398 try_scrolling from unnecessarily failing when
12399 scroll-conservatively is set to a value slightly larger than the
12400 window height. Clean up the case of PT below the margin at bottom
12401 of window: scroll_max can no longer be INT_MAX. When aggressive
12402 scrolling is in use, don't let point enter the opposite scroll
12403 margin as result of the scroll.
12404 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12405 threshold of 100 lines for never-recentering scrolling.
12406
e4cc2dfc
JB
124072011-03-31 Juanma Barranquero <lekktu@gmail.com>
12408
12409 * dispextern.h (move_it_by_lines):
12410 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12411 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12412 (message_log_check_duplicate): Remove parameters `prev_bol' and
12413 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12414 (redisplay_internal): Remove parameter `preserve_echo_area',
12415 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12416
12417 * indent.c (Fvertical_motion):
12418 * window.c (window_scroll_pixel_based, Frecenter):
12419 Don't pass `need_y_p' to `move_it_by_lines'.
12420
1c470562
SM
124212011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12422
44f230aa
SM
12423 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12424 steal a few bits to be more compact.
12425 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12426 Remove unneeded casts.
12427
1c470562
SM
12428 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12429
888adce9
ZK
124302011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12431
12432 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12433 binding" message (bug#7967).
12434
f838ed7b
PE
124352011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12436
77861b95
PE
12437 Fix more problems found by GCC 4.6.0's static checks.
12438
de6dbc14
PE
12439 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12440 Remove unused local var.
12441
f838ed7b
PE
12442 * editfns.c (Fmessage_box): Remove unused local var.
12443
792c7b2b
PE
12444 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12445 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12446 Omit unused local vars.
c499e557 12447 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12448 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12449 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12450 Omit unused local var.
12451
ba0165e1
PE
12452 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12453 Don't assume string length fits in int.
32ad8845 12454 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12455 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12456
3c59b4c9
PE
12457 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12458 instead of alloca (Bug#8344).
12459
a3eed478 12460 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12461 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12462
eb4d412d
PE
12463 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12464
1658b401
PE
12465 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12466 concerns.
12467
12468 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12469
12470 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12471
9a2c6e05
PE
12472 * keyboard.c (syms_of_keyboard): Use the same style as later
12473 in this function when indexing through an array. This also
12474 works around GCC bug 48267.
12475
03d0a109
PE
12476 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12477
44f730c8
PE
12478 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12479
fe75f926
PE
12480 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12481 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12482
ffa8c828
PE
12483 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12484 This avoids undefined behavior on integer overflow, and is a bit
12485 more convenient anyway since it is compared to a size_t variable.
12486
c5101a77
PE
12487 Variadic C functions now count arguments with size_t, not int.
12488 This avoids an unnecessary limitation on 64-bit machines, which
12489 caused (substring ...) to crash on large vectors (Bug#8344).
12490 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12491 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12492 All variadic functions and their callers changed accordingly.
c5101a77
PE
12493 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12494 * data.c (arith_driver, float_arith_driver): Likewise.
12495 * editfns.c (general_insert_function): Likewise.
12496 * eval.c (struct backtrace.nargs, interactive_p)
12497 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12498 (funcall_lambda, mark_backtrace): Likewise.
12499 * fns.c (concat): Likewise.
12500 * frame.c (x_set_frame_parameters): Likewise.
12501 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12502 0 if not found, not -1. All callers changed.
12503
dd3f25f7
PE
12504 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12505 (stack_copy_size): Now size_t, not int.
12506 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12507
461c2ab9
JB
125082011-03-28 Juanma Barranquero <lekktu@gmail.com>
12509
12510 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12511 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12512 All callers changed.
12513
12514 * lisp.h (multibyte_char_to_unibyte):
12515 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12516 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12517 * character.h (CHAR_TO_BYTE8):
12518 * cmds.c (internal_self_insert):
12519 * editfns.c (general_insert_function):
12520 * keymap.c (push_key_description):
12521 * search.c (Freplace_match):
12522 * xdisp.c (message_dolog, set_message_1): All callers changed.
12523
f6d62986
SM
125242011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12525
12526 * keyboard.c (safe_run_hook_funcall): New function.
12527 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12528 don't set the hook to nil, but remove the offending function instead.
12529 (Qcommand_hook_internal): Remove, unused.
12530 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12531 Vcommand_hook_internal.
12532
12533 * eval.c (enum run_hooks_condition): Remove.
12534 (funcall_nil, funcall_not): New functions.
12535 (run_hook_with_args): Call each function through a `funcall' argument.
12536 Remove `cond' argument, now redundant.
12537 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12538 (Frun_hook_with_args_until_failure): Adjust accordingly.
12539 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12540
1db5b1ad
JB
125412011-03-28 Juanma Barranquero <lekktu@gmail.com>
12542
12543 * dispextern.h (string_buffer_position): Remove declaration.
12544
12545 * print.c (strout): Remove parameter `multibyte', unused since
12546 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12547
12548 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12549 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12550 All callers changed.
12551
12552 * w32.c (_wsa_errlist): Use braces for struct initializers.
12553
12554 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12555 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12556 All callers changed.
12557 (string_buffer_position): Likewise. Also, make static (it's never
12558 used outside xdisp.c).
12559 (cursor_row_p): Remove parameter `w', unused since
12560 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12561 (decode_mode_spec): Remove parameter `precision', introduced during
12562 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12563 All callers changed.
12564
5ffb62aa
JD
125652011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12566
12567 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12568
461c2ab9 125692011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12570
12571 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12572 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12573 (ns_update_auto_hide_menu_bar): New functions.
12574 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12575 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12576 ns_constrain_all_frames.
12577 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12578 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12579
5c380ffb
JD
125802011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12581
12582 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12583
9af30bdf
GM
125842011-03-27 Glenn Morris <rgm@gnu.org>
12585
12586 * syssignal.h: Replace RETSIGTYPE with void.
12587 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12588 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12589 Replace SIGTYPE with void everywhere.
12590 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12591 * s/template.h (SIGTYPE): Remove commented out definition.
12592
e2abce01
JB
125932011-03-26 Eli Zaretskii <eliz@gnu.org>
12594
12595 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12596 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12597
f868cd8a
JB
125982011-03-26 Juanma Barranquero <lekktu@gmail.com>
12599
59eb0929
JB
12600 * w32.c (read_unc_volume): Use parameter `henum', instead of
12601 global variable `wget_enum_handle'.
12602
12603 * keymap.c (describe_vector): Remove parameters `indices' and
12604 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12605 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12606
f868cd8a
JB
12607 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12608
12609 * keyboard.c (timer_check): Remove parameter `do_it_now',
12610 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12611 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12612 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12613
12614 * keyboard.c (read_char):
12615 * w32menu.c (w32_menu_display_help):
12616 * xmenu.c (show_help_event, menu_help_callback):
12617 Adjust calls to `show_help_echo'.
12618
12619 * gtkutil.c (xg_maybe_add_timer):
12620 * keyboard.c (readable_events):
12621 * process.c (wait_reading_process_output):
12622 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12623
12624 * insdel.c (adjust_markers_gap_motion):
12625 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12626 (gap_left, gap_right): Don't call it.
12627
2ecf6fdb
CY
126282011-03-25 Chong Yidong <cyd@stupidchicken.com>
12629
12630 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12631 incurred during fontification.
12632
6b1f9ba4
JB
126332011-03-25 Juanma Barranquero <lekktu@gmail.com>
12634
12635 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12636 (DEFVAR_PER_BUFFER): Don't pass it.
12637
12638 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12639 (scrolling_window): Don't pass it.
12640
0f4a96b5
JB
126412011-03-25 Juanma Barranquero <lekktu@gmail.com>
12642
12643 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12644
12645 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12646 and `suffix'.
12647 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12648 of variables specific to SELinux and computation of `encoded_absname'.
12649
12650 * image.c (XPutPixel): Remove unused variable `height'.
12651
12652 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12653
12654 * unexw32.c (get_section_info): Remove unused variable `section'.
12655
12656 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12657 (system_process_attributes): Remove unused variable `sess'.
12658 (sys_read): Remove unused variable `err'.
12659
12660 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12661 (w32_wnd_proc): Remove unused variable `isdead'.
12662 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12663 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12664 (x_create_tip_frame): Remove unused variable `tem'.
12665
12666 * w32inevt.c (w32_console_read_socket):
12667 Remove unused variable `no_events'.
12668
12669 * w32term.c (x_draw_composite_glyph_string_foreground):
12670 Remove unused variable `width'.
12671
1149507c
JB
126722011-03-24 Juanma Barranquero <lekktu@gmail.com>
12673
12674 * w32term.c (x_set_glyph_string_clipping):
12675 Don't pass uninitialized region to CombineRgn.
12676
9c88f339
JB
126772011-03-23 Juanma Barranquero <lekktu@gmail.com>
12678
12679 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12680 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12681 (Fx_close_connection): Remove unused variable `i'.
12682
12683 * w32font.c (w32font_draw): Return number of glyphs.
12684 (w32font_open_internal): Remove unused variable `i'.
12685 (w32font_driver): Add missing initializer.
12686
12687 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12688 (fill_in_menu): Remove unused variable `items_added'.
12689
12690 * w32term.c (last_mouse_press_frame): Remove static global variable.
12691 (w32_clip_to_row): Remove unused variable `f'.
12692 (x_delete_terminal): Remove unused variable `i'.
12693
12694 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12695 (NOTHING): Remove unused static global variable.
12696 (uniscribe_check_otf): Remove unused variable `table'.
12697 (uniscribe_font_driver): Add missing initializers.
12698
dee091a3
JD
126992011-03-23 Julien Danjou <julien@danjou.info>
12700
12701 * term.c (Fsuspend_tty, Fresume_tty):
12702 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12703 * window.c (temp_output_buffer_show):
12704 * insdel.c (signal_before_change):
12705 * frame.c (Fhandle_switch_frame):
12706 * fileio.c (Fdo_auto_save):
12707 * emacs.c (Fkill_emacs):
12708 * editfns.c (save_excursion_restore):
12709 * cmds.c (internal_self_insert):
12710 * callint.c (Fcall_interactively):
12711 * buffer.c (Fkill_all_local_variables):
12712 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12713 Use Frun_hooks.
0f4a96b5 12714 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 12715 unconditionally since it does the check itself.
dee091a3 12716
2c520ab5 127172011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 12718
c9c49752
PE
12719 Fix more problems found by GCC 4.5.2's static checks.
12720
8abc3f12
PE
12721 * coding.c (encode_coding_raw_text): Avoid unnecessary test
12722 the first time through the loop, since we know p0 < p1 then.
12723 This also avoids a gcc -Wstrict-overflow warning.
12724
a2d26660
PE
12725 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12726 leading to a memory leak, possible in functions like
12727 load_charset_map_from_file that can allocate an unbounded number
b12ef411 12728 of objects (Bug#8318).
a2d26660 12729
916c72e9
PE
12730 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12731 that could (at least in theory) be that large.
12732
19ab8a18
PE
12733 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12734 This is less likely to overflow, and avoids undefined behavior if
12735 overflow does occur. All callers changed. Use strtoul to scan
12736 for the unsigned long integer.
b7cbbd6f
PE
12737 (pint2hrstr): Simplify and tune code slightly.
12738 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 12739
f0641eff
PE
12740 * scroll.c (do_scrolling): Work around GCC bug 48228.
12741 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12742
7f650bb9
PE
12743 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12744 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
12745 (validate_x_resource_name): Simplify count usage.
12746 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 12747
37dd57d1
PE
12748 * fileio.c (Fcopy_file): Report error if fchown or fchmod
12749 fail (Bug#8306).
81e56e61 12750
699979fc 12751 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 12752
401bf9b4
PE
12753 * process.c (Fmake_network_process): Use socklen_t, not int,
12754 where POSIX says socklen_t is required in portable programs.
12755 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 12756 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
12757 (Fmake_network_process, server_accept_connection):
12758 (wait_reading_process_output, read_process_output):
12759 Likewise.
12760
b93aacde
PE
12761 * process.c: Rename or move locals to avoid shadowing.
12762 (list_processes_1, Fmake_network_process):
12763 (read_process_output_error_handler, exec_sentinel_error_handler):
12764 Rename or move locals.
4dc343ee 12765 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 12766 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 12767 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 12768 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 12769 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 12770
af8a867c 12771 Make tparam.h and terminfo.c consistent.
44f230aa
SM
12772 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12773 Include tparam.h instead, since it declares them.
af8a867c
PE
12774 * cm.h (PC): Remove extern decl; tparam.h now does this.
12775 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12776 * terminfo.c: Include tparam.h, to check interfaces.
12777 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
12778 (tparam): Adjust signature to match interface in tparam.h;
12779 this removes some undefined behavior. Check that outstring and len
12780 are zero, which they always are with Emacs.
12781 * tparam.h (PC, BC, UP): New extern decls.
12782
0248044d 12783 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 12784 (xftfont_open): Rename locals to avoid shadowing.
0248044d 12785
8ff096c1 12786 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
12787 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12788 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 12789 (ftfont_list): Remove unused local.
49eaafba
PE
12790 (get_adstyle_property, ftfont_pattern_entity):
12791 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12792 Rename locals to avoid shadowing.
8ff096c1 12793
e2be39f6
PE
12794 * xfont.c (xfont_list_family): Mark var as initialized.
12795
c9735e30
PE
12796 * xml.c (make_dom): Now static.
12797
8f5201ae
PE
12798 * composite.c (composition_compute_stop_pos): Rename local to
12799 avoid shadowing.
b246f932
PE
12800 (composition_reseat_it): Remove unused locals.
12801 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 12802 (composition_update_it): Mark var as initialized.
11b61122
PE
12803 (find_automatic_composition): Mark vars as initialized,
12804 with a FIXME (Bug#8290).
8f5201ae 12805
760fbc2c
PE
12806 character.h: Rename locals to avoid shadowing.
12807 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12808 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12809 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12810 (BUF_DEC_POS): Be more systematic about renaming local temporaries
12811 to avoid shadowing.
12812
ff08eb85
PE
12813 * textprop.c (property_change_between_p): Remove; unused.
12814
fc7bf025
PE
12815 * intervals.c (interval_start_pos): Now static.
12816
235d7abc
PE
12817 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12818
44f230aa
SM
12819 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12820 Rename locals to avoid shadowing.
3e7d6594 12821
50060332
PE
12822 * sound.c (wav_play, au_play, Fplay_sound_internal):
12823 Fix pointer signedness.
d01f234b 12824 (alsa_choose_format): Remove unused local var.
c83b8872
PE
12825 (wav_play): Initialize a variable to 0, to prevent undefined
12826 behavior (Bug#8278).
50060332 12827
c4fc4e30
PE
12828 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12829
918436ed
PE
12830 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12831
c939f91b
PE
12832 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12833 clobbering (Bug#8298).
b9c7f648
PE
12834 * sysdep.c (sys_subshell): Likewise.
12835 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 12836
6bd8c144
PE
12837 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12838 This should get cleaned up, so that child_setup has the
12839 same signature on all platforms.
12840
7710357c 12841 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 12842 (relocate_fd): Rename locals to avoid shadowing.
7710357c 12843
c59da222
CY
128442011-03-22 Chong Yidong <cyd@stupidchicken.com>
12845
12846 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
12847 not to be necessary, and produces flickering.
12848
66b87493
GM
128492011-03-20 Glenn Morris <rgm@gnu.org>
12850
12851 * config.in: Remove file.
12852
45b6f6d5
JB
128532011-03-20 Juanma Barranquero <lekktu@gmail.com>
12854
12855 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12856 are now in src/globals.h.
12857 (syms_of_minibuf): Remove spurious & from previous change.
12858
cd394be1 128592011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
12860
12861 * minibuf.c (completing-read-function): New variable.
12862 (completing-read-default): Rename from completing-read.
12863 (completing-read): Call completing-read-function.
12864
b14e3e21
CY
128652011-03-19 Juanma Barranquero <lekktu@gmail.com>
12866
12867 * xfaces.c (Fx_load_color_file):
12868 Read color file from absolute filename (bug#8250).
12869
f2b726e6
JB
128702011-03-19 Juanma Barranquero <lekktu@gmail.com>
12871
12872 * makefile.w32-in: Update dependencies.
12873
09f6ff02
EZ
128742011-03-17 Eli Zaretskii <eliz@gnu.org>
12875
12876 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12877
29a6015a
PE
128782011-03-17 Paul Eggert <eggert@cs.ucla.edu>
12879
a3a6c54e
PE
12880 Fix more problems found by GCC 4.5.2's static checks.
12881
b766f867
PE
12882 * process.c (make_serial_process_unwind, send_process_trap):
12883 (sigchld_handler): Now static.
12884
be02381c
PE
12885 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12886 That way, the code declares only the vars that it needs.
12887 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12888 * s/cygwin.h (PTY_ITERATION): Likewise.
12889 * s/darwin.h (PTY_ITERATION): Likewise.
12890 * s/gnu-linux.h (PTY_ITERATION): Likewise.
12891
57048744
PE
12892 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12893 * process.c (allocate_pty): Don't declare stb unless it's needed.
12894
7914961c 12895 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
12896 (CONSTANTLIM): Remove; unused.
12897 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12898 Define only if needed.
7914961c 12899
b3967b18
PE
12900 * unexelf.c (unexec): Name an expression,
12901 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
12902 Use a different way to cause a compilation error if anyone uses
12903 n rather than nn, a way that does not involve shadowing.
73366a00 12904 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 12905
29a6015a
PE
12906 * deps.mk (unexalpha.o): Remove; unused.
12907
43cfc33e 12908 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 12909 * unexec.h: New file.
ce701a33
PE
12910 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
12911 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
12912 Depend on unexec.h.
12913 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
12914 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
12915 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 12916 Change as necessary to match prototype in unexec.h.
ce701a33 12917
01f44d5a
PE
12918 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
12919 shadowing.
4f63c6bb 12920 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 12921
a6670b0b
PE
12922 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
12923 Rename locals to avoid shadowing.
12924
cef2010d 12925 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 12926 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 12927
d4d7173a
PE
12928 * print.c (Fredirect_debugging_output): Fix pointer signedess.
12929
f08b802a
PE
12930 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
12931 warning when compiling print.c.
12932
3ddb0639
PE
12933 * font.c (font_unparse_fcname): Abort in an "impossible" situation
12934 instead of using an uninitialized var.
5ad03b97 12935 (font_sort_entities): Mark var as initialized.
3ddb0639 12936
170a2692
PE
12937 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
12938
e663c700
PE
12939 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
12940 pointers to constants.
89bc529a 12941 (font_parse_fcname): Remove unused vars.
7b81e2d0 12942 (font_delete_unmatched): Now static.
ea838e10 12943 (font_get_spec): Remove; unused.
13a547c6
PE
12944 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
12945 (font_update_drivers, Ffont_get_glyphs, font_add_log):
12946 Rename or move locals to avoid shadowing.
e663c700 12947
2a80c887 12948 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 12949 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 12950
1384fa33 12951 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 12952 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 12953
8b2c52e9
PE
12954 * alloc.c (mark_backtrace): Move decl from here ...
12955 * lisp.h: ... to here, so that it can be checked.
12956
475545b5 12957 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 12958 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
12959 (lisp_indirect_variable): Name an expression,
12960 to avoid gcc -Wbad-function-cast warning.
1faed8ae 12961 (Fdefvar): Rename locals to avoid shadowing.
475545b5 12962
b1349114 12963 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 12964 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 12965 Use const pointer when appropriate.
b1349114 12966
a2928364
PE
12967 * lisp.h (get_system_name, get_operating_system_release):
12968 Move decls here, to check interfaces.
12969 * process.c (get_operating_system_release): Move decl to lisp.h.
12970 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
12971 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
12972 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
12973 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
12974 (Fformat_time_string, Fencode_time, Finsert_char):
12975 (Ftranslate_region_internal, Fformat):
12976 Rename or remove local vars to avoid shadowing.
9710023e 12977 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 12978
a415e694
PE
12979 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
12980 avoid shadowing.
12981
8ef4622d
PE
12982 * lisp.h (eassert): Check that the argument compiles, even if
12983 ENABLE_CHECKING is not defined.
12984
946f9a5b
PE
12985 * data.c (Findirect_variable): Name an expression, to avoid
12986 gcc -Wbad-function-cast warning.
112396d6 12987 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 12988 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
12989 (Fmake_variable_buffer_local, Fmake_local_variable):
12990 Mark variables as initialized.
52746918 12991 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 12992
e5aab7e7 12993 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
12994 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
12995 Rename locals to avoid shadowing.
dff45157
PE
12996 (mark_stack): Move local variables into the #ifdef region where
12997 they're used.
7bc26fdb
PE
12998 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
12999 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13000 needed otherwise.
13001 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13002 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13003 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13004
e5aab7e7
PE
13005 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13006 avoids undefined behavior in theory.
13007
4da60324
PE
13008 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13009
88043301
PE
13010 Use functions, not macros, for up- and down-casing (Bug#8254).
13011 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13012 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13013 to use the following functions instead of these macros.
13014 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13015 EMACS_INT, since callers assume the returned value fits in int.
13016 (upcase1): Likewise, for UPCASE_TABLE.
13017 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13018 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13019 the race-condition problem in the old DOWNCASE.
88043301 13020
19ed5445
PE
13021 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13022 Rename locals to avoid shadowing.
13023 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13024 (regex_compile, re_search_2, re_match_2_internal):
13025 Remove unused local vars.
952db0d7
PE
13026 (FREE_VAR): Rewrite so as not to use empty "else",
13027 which gcc can warn about.
da053e48 13028 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13029 (RETALLOC_IF): Define only if needed.
13030 (WORDCHAR_P): Likewise. This one is never needed, but is used
13031 only in a comment talking about a compiler bug, so put inside
13032 the #if 0 of that comment.
13033 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13034 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13035 Remove; unused.
19ed5445 13036
1f3561e4 13037 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13038 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13039 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13040
ded6f8f7
PE
13041 * search.c (simple_search): Remove unused var.
13042
dbd37a95
PE
13043 * dired.c (compile_pattern): Move decl from here ...
13044 * lisp.h: ... to here, so that it can be checked.
13045 (struct re_registers): New forward decl.
13046
7e47afad
PE
13047 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13048
85f24f61
PE
13049 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13050 All uses changed.
13051 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13052 Rename locals to avoid shadowing.
5671df8f 13053 (Fvertical_motion): Mark locals as initialized.
85f24f61 13054
181aa2be 13055 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13056 (casify_region): Mark local as initialized.
181aa2be 13057
930d429c
PE
13058 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13059
7082eac6
PE
13060 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13061 New macros, so that the caller can use some names other than
13062 gcpro1, gcpro2, etc.
13063 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13064 of the new macros.
13065 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13066 argument, for consistency with GCPRO2_VAR, etc: it is now the
13067 prefix of the variable, not the variable itself. All uses
13068 changed.
38b2c076
PE
13069 * dired.c (directory_files_internal, file_name_completion):
13070 Rename locals to avoid shadowing.
13071
15206ed9
PE
13072 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13073 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13074 dired.c's scmp function, had undefined behavior.
13075 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13076 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13077 * buffer.h: ... to here, because these macros use current_buffer,
13078 and the new implementation with inline functions needs to have
13079 current_buffer in scope now, rather than later when the macros
13080 are used.
13081 (downcase, upcase1): New static inline functions.
13082 (DOWNCASE, UPCASE1): Reimplement using these functions.
13083 This avoids undefined behavior in expressions like
13084 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13085 from race conditions in accessing the global variables
13086 case_temp1 and case_temp2.
13087 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13088 * lisp.h (case_temp1, case_temp2): Remove their decls.
13089 * character.h (ASCII_CHAR_P): Move from here ...
13090 * lisp.h: ... to here, so that the inline functions mentioned
13091 above can use them.
13092
4a6bea26
PE
13093 * dired.c (directory_files_internal_unwind): Now static.
13094
f14b7e14
PE
13095 * fileio.c (file_name_as_directory, directory_file_name):
13096 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13097 Now static.
2893f146
PE
13098 (file_name_as_directory): Use const pointers when appropriate.
13099 (Fexpand_file_name): Likewise. In particular, newdir might
13100 point at constant storage, so make it a const pointer.
fd4ead52 13101 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13102 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13103 signedness issues.
f839df0c
PE
13104 (Fset_file_times, Finsert_file_contents, auto_save_error):
13105 Rename locals to avoid shadowing.
f14b7e14 13106
5716756e 13107 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13108 (Ftry_completion, Fall_completions): Rename or remove locals
13109 to avoid shadowing.
5716756e 13110
b4c3046a
PE
13111 * marker.c (bytepos_to_charpos): Remove; unused.
13112
b45db522
PE
13113 * lisp.h (verify_bytepos, count_markers): New decls,
13114 so that gcc does not warn that these functions aren't declared.
13115
85876d07
PE
13116 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13117 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13118 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13119 (copy_text): Remove unused local var.
85876d07 13120
03d78a21 13121 * filelock.c (within_one_second): Now static.
b3dd38ab 13122 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13123
5df8f01b
PE
13124 * buffer.c (fix_overlays_before): Mark locals as initialized.
13125 (fix_start_end_in_overlays): Likewise. This function should be
13126 simplified by using pointers-to-pointers, but that's a different
13127 matter.
b1d876f1 13128 (switch_to_buffer_1): Now static.
8f54f30a
PE
13129 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13130 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13131
a70072c9 13132 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13133 Fix pointer signedness issue.
edced198
PE
13134 (sys_subshell): Mark local as volatile if checking for lint,
13135 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13136 (MAXPATHLEN): Define only if needed.
a70072c9 13137
a0977c44
PE
13138 * process.c (serial_open, serial_configure): Move decls from here ...
13139 * systty.h: ... to here, so that they can be checked.
13140
a884fdcc
PE
13141 * fns.c (get_random, seed_random): Move extern decls from here ...
13142 * lisp.h: ... to here, so that they can be checked.
13143
604efe86 13144 * sysdep.c (reset_io): Now static.
b8950c94 13145 (wait_for_termination_signal): Remove; unused.
604efe86 13146
38fc62d9
PE
13147 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13148 (copy_keymap_item, append_key, push_text_char_description):
13149 Now static.
1004a21a 13150 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13151 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13152 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13153 (describe_map_tree):
13154 Rename locals to avoid shadowing.
38fc62d9 13155
2f2650da
PE
13156 * keyboard.c: Declare functions static if they are not used elsewhere.
13157 (echo_char, echo_dash, cmd_error, top_level_2):
13158 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13159 (read_char, kbd_buffer_get_event, make_lispy_position):
13160 (make_lispy_event, make_lispy_movement, apply_modifiers):
13161 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13162 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13163 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13164 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13165 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13166
a053e86c 13167 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13168 (mark_kboards): Move decl here ...
13169 * alloc.c (mark_kboards): ... from here.
a053e86c 13170
4752793e
PE
13171 * lisp.h (force_auto_save_soon): New decl.
13172
74f10ca7 13173 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13174 (DEFINE_DUMMY_FUNCTION): New macro.
13175 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13176 Use it.
c03cd23f
PE
13177 (main): Add casts to avoid warnings
13178 if GCC considers string literals to be constants.
74f10ca7 13179
022e70d4
PE
13180 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13181
59d6fe83
PE
13182 * dbusbind.c: Pointer signedness fixes.
13183 (xd_signature, xd_append_arg, xd_initialize):
13184 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13185 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13186 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13187 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13188
78320123
PE
13189 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13190 if GCC considers string literals to be constants.
49cebcca 13191 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13192
35ac2a97
SM
131932011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13194
fb103ca9
SM
13195 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13196 (print_preprocess, print_object): New macro to fix last change.
13197
35ac2a97
SM
13198 * print.c (print_preprocess): Don't forget font objects.
13199
62973b41
JB
132002011-03-16 Juanma Barranquero <lekktu@gmail.com>
13201
13202 * emacs.c (USAGE3): Doc fixes.
13203
0e48bb22
AS
132042011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13205
13206 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13207 structure.
13208
7684e57b
JB
132092011-03-14 Juanma Barranquero <lekktu@gmail.com>
13210
13211 * lisp.h (VWindow_system, Qfile_name_history):
13212 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13213 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13214 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13215
13216 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13217 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13218
13219 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13220 * w32console.c (detect_input_pending, read_input_pending)
13221 (encode_terminal_code):
13222 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13223 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13224 (w32_system_caret_y, Qfile_name_history):
13225 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13226 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13227 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13228 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13229 * w32proc.c (Qlocal, report_file_error):
13230 * w32term.c (Vwindow_system, updating_frame):
13231 * w32uniscribe.c (initialized, uniscribe_font_driver):
13232 Remove unneeded extern declarations.
13233
2aa46d6c
CY
132342011-03-14 Chong Yidong <cyd@stupidchicken.com>
13235
c96bbc66 13236 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13237
cffc6f3b
CY
132382011-03-13 Chong Yidong <cyd@stupidchicken.com>
13239
13240 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13241 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13242 These macros can no longer be used for assignment.
13243
44f230aa
SM
13244 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13245 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13246 (record_buffer_markers, fetch_buffer_markers): New functions for
13247 recording and fetching special buffer markers.
13248 (set_buffer_internal_1, set_buffer_temp): Use them.
13249
13250 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13251
13252 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13253
13254 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13255 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13256
13257 * xdisp.c (hscroll_window_tree):
13258 (reconsider_clip_changes): Use PT instead of BUF_PT.
13259
d251f04b
EZ
132602011-03-13 Eli Zaretskii <eliz@gnu.org>
13261
13262 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13263 $(EMACS_ROOT)/lib/intprops.h.
13264
f0c77cd1
PE
132652011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13266
3eca4629
PE
13267 Fix more problems found by GCC 4.5.2's static checks.
13268
7c86ee98
PE
13269 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13270 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13271 (xg_free_frame_widgets): Make it clear that a local variable is
13272 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13273 (gdk_window_get_screen): Make it clear that this macro is needed
13274 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13275 (int_gtk_range_get_value): New function, which avoids a diagnostic
13276 from gcc -Wbad-function-cast.
13277 (xg_set_toolkit_scroll_bar_thumb): Use it.
13278 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13279 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13280 (get_utf8_string, xg_get_file_with_chooser):
13281 Rename locals to avoid shadowing.
13282 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13283
41729b81
PE
13284 * xgselect.c (xg_select): Remove unused var.
13285
f0c77cd1
PE
13286 * image.c (four_corners_best): Mark locals as initialized.
13287 (gif_load): Initialize transparent_p to zero (Bug#8238).
13288 Mark another local as initialized.
ec6cf4c6 13289 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13290
ce0ad53d 13291 * image.c (clear_image_cache): Now static.
d5d5a617 13292 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13293 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13294 (x_edge_detection): Remove unnecessary cast that
13295 gcc -Wbad-function-cast diagnoses.
2037898d 13296 (gif_load): Fix pointer signedness.
6ae141d6
PE
13297 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13298 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13299
33383987 133002011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13301
d32df629
PE
13302 Improve quality of tests for time stamp overflow.
13303 For example, without this patch (encode-time 0 0 0 1 1
13304 1152921504606846976) returns the obviously-bogus value (-948597
13305 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13306 reports time overflow. See
13307 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13308 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13309 * editfns.c: Include limits.h and intprops.h.
13310 (TIME_T_MIN, TIME_T_MAX): New macros.
13311 (time_overflow): Move earlier, to before first use.
13312 (hi_time, lo_time): New functions, for an accurate test for
13313 out-of-range times.
13314 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13315 (Fget_internal_run_time): Don't assume time_t fits in int.
13316 (make_time): Use list2 instead of Fcons twice.
13317 (Fdecode_time): More accurate test for out-of-range times.
13318 (check_tm_member): New function.
13319 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13320 (lisp_time_argument): Don't rely on undefined left-shift and
13321 right-shift behavior when checking for time stamp overflow.
8be6f318 13322
fe31d94c
PE
13323 * editfns.c (time_overflow): New function, refactoring common code.
13324 (Fformat_time_string, Fdecode_time, Fencode_time):
13325 (Fcurrent_time_string): Use it.
13326
8be6f318
PE
13327 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13328 * dired.c (make_time): Move to ...
13329 * editfns.c (make_time): ... here.
13330 * systime.h: Note the move.
13331
09d9db2c 133322011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13333
126bc0dc
YM
13334 * fringe.c (update_window_fringes): Remove unused variables.
13335
c47cbdfd
YM
13336 * unexmacosx.c (copy_data_segment): Also copy __got section.
13337 (Bug#8223)
13338
7ac80be9
EZ
133392011-03-12 Eli Zaretskii <eliz@gnu.org>
13340
c96bbc66 13341 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13342 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13343 Constify `char *' arguments and their references according to
13344 prototypes in tparam.h.
13345
ecb0f94d 13346 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13347
7ac80be9
EZ
13348 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13349 Adapt all references accordingly.
13350
13351 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13352
ef1fd07e
TT
133532011-03-11 Tom Tromey <tromey@redhat.com>
13354
13355 * buffer.c (syms_of_buffer): Remove obsolete comment.
13356
7ef4b50c
EZ
133572011-03-11 Eli Zaretskii <eliz@gnu.org>
13358
13359 * termhooks.h (encode_terminal_code): Declare prototype.
13360
13361 * msdos.c (encode_terminal_code): Don't declare prototype.
13362
13363 * term.c (encode_terminal_code): Now external again, used by
13364 w32console.c and msdos.c.
13365
44f230aa
SM
13366 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13367 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13368
4b1ec863 133692011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13370
1714f52b 13371 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13372
4b1ec863
PE
13373 * fringe.c (update_window_fringes): Mark locals as initialized
13374 (Bug#8227).
13375 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13376
524c7aa6
PE
13377 * alloc.c (mark_fringe_data): Move decl from here ...
13378 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13379 to check its interface.
13380 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13381
a5c0af81 13382 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13383 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13384 (fontset_font): Mark local as initialized.
a9a06e0b 13385 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13386
b4716021
PE
13387 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13388
811e9bac 13389 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13390 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13391 (x_own_selection, Fx_disown_selection_internal): Rename locals
13392 to avoid shadowing.
13393 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13394
7e3ab302
PE
13395 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13396 so that the caller can use some name other than gcpro1.
13397 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13398 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13399 (Fx_backspace_delete_keys_p):
13400 Use them to avoid shadowing, and rename vars to avoid shadowing.
13401 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13402 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13403 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13404 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13405 Remove unused locals.
7e3ab302
PE
13406 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13407 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13408 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13409 macros.
f78faa98 13410
e2b13473
PE
13411 * xterm.h (x_mouse_leave): New decl.
13412
77f23912
PE
13413 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13414 Remove unused functions.
cdf4ba58
PE
13415 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13416 (x_calc_absolute_position): Now static.
7411c686 13417 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13418 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13419 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13420 unless they are used.
38d0b34a
PE
13421 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13422 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13423 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13424 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13425 (x_error_catcher, x_connection_closed, x_error_handler):
13426 (x_error_quitter, xembed_send_message, x_iconify_frame):
13427 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13428 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13429 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13430
44f230aa
SM
13431 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13432 Rename or move locals to avoid shadowing.
6b463e58 13433 (tty_defined_color, merge_face_heights): Now static.
5967d051 13434 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13435 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13436 does not deduce is never used uninitialized.
73719eba
PE
13437 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13438 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13439
426994c3 13440 * terminal.c (store_terminal_param): Now static.
5489860b 13441
032f1620 13442 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13443 (set_frame_menubar): Remove unused local.
d4323972 13444 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13445 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13446 since they might point to immutable storage.
281585b0
PE
13447 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13448 since it's unused otherwise.
032f1620 13449
367c19e5 13450 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13451 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13452 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13453 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13454 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13455 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13456 does not deduce are never used uninitialized.
70739cbe 13457
07b48fa9
PE
13458 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13459
8868a238 13460 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13461 * window.c (window_loop, size_window):
13462 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13463
7e5cf297 13464 * window.c (display_buffer): Now static.
d6550a9f
PE
13465 (size_window): Mark variables that gcc -Wuninitialized
13466 does not deduce are never used uninitialized.
a586633d
PE
13467 * window.h (check_all_windows): New decl, to forestall
13468 gcc -Wmissing-prototypes diagnostic.
5b555da1 13469 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13470
f6095868
PE
13471 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13472 shadowing.
13473 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13474 Include <limits.h>.
13475 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13476 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13477 (load_charset_map): Mark variables that gcc -Wuninitialized
13478 does not deduce are never used uninitialized.
53df7c11 13479 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13480
f38b440c
PE
13481 * coding.c (coding_set_source, coding_set_destination):
13482 Use "else { /* comment */ }" rather than "else /* comment */;"
13483 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13484 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13485 a block, when the outer 'i' will do.
13486 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13487 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13488 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13489 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13490 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13491 Rename locals to avoid shadowing.
13492 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13493 * coding.c (emacs_mule_char, encode_invocation_designation):
13494 Now static, since they're not used elsewhere.
413bb2db 13495 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13496 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13497 (decode_coding_emacs_mule): Mark variables that gcc
13498 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13499 (detect_coding_iso_2022): Initialize a local variable that might
13500 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13501 this initialization is needed. (Bug#8211)
5f58e762
PE
13502 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13503 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13504 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13505 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13506 Remove unused macros.
f38b440c 13507
232b38b9 13508 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13509 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13510 * character.c (string_count_byte8): Likewise.
232b38b9 13511
fb90da1b
PE
13512 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13513 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13514
fb93dbc2
PE
13515 * chartab.c (copy_sub_char_table): Now static, since it's not used
13516 elsewhere.
5c156ace
PE
13517 (sub_char_table_ref_and_range, char_table_ref_and_range):
13518 Rename locals to avoid shadowing.
bbcd0949 13519 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13520
7d3b3862 13521 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13522 (BIDI_BOB): Remove unused macro.
7d3b3862 13523
6be7d3da
PE
13524 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13525 deduce are never used uninitialized.
c2ed9c8b 13526 * term.c (encode_terminal_code): Likewise.
6be7d3da 13527
75f8807f 13528 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13529
50938595
PE
13530 * tparam.h: New file.
13531 * term.c, tparam.h: Include it.
13532 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13533 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13534 Move these decls to tparam.h, and make them agree with what
13535 is actually in tparam.c. The previous trick of using incompatible
13536 decls in different modules does not conform to the C standard.
13537 All callers of tparam changed to use tparam's actual API.
13538 * tparam.c (tparam1, tparam, tgoto):
13539 Use const pointers where appropriate.
13540
fbceeba2
PE
13541 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13542 * cm.h (struct cm): Likewise.
13543 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13544 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13545 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13546 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13547 (turn_on_face, init_tty): Likewise.
13548 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13549
7f3f1250
PE
13550 * term.c (term_mouse_position): Rename local to avoid shadowing.
13551
e6ca6543
PE
13552 * alloc.c (mark_ttys): Move decl from here ...
13553 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13554
c40f8d15
AS
135552011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13556
13557 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13558
cfe0661d
JB
135592011-03-09 Juanma Barranquero <lekktu@gmail.com>
13560
13561 * search.c (compile_pattern_1): Remove argument regp, unused since
13562 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13563 (compile_pattern): Don't pass it.
13564
0afb4571
J
135652011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13566
13567 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13568 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13569 for ! HAVE_GTK3.
13570 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13571
13572 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13573
13574 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13575 gdk_window_get_screen, gdk_window_get_geometry,
13576 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13577 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13578 (xg_get_pixbuf_from_pixmap): New function.
13579 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13580 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13581 Call xg_get_pixbuf_from_pixmap instead of
13582 gdk_pixbuf_get_from_drawable.
13583 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13584 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13585 (xg_check_special_colors): Use GtkStyleContext and its functions
13586 for HAVE_GTK3.
13587 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13588 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13589 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13590 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13591 Call gtk_widget_get_preferred_size.
0afb4571
J
13592 (xg_frame_resized): gdk_window_get_geometry only takes 5
13593 parameters.
44f230aa
SM
13594 (xg_win_to_widget, xg_event_is_for_menubar):
13595 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13596 (xg_set_widget_bg): New function.
13597 (delete_cb): New function.
895009e1 13598 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13599 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13600 (xg_set_background_color): Call xg_set_widget_bg.
13601 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13602 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13603 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13604 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13605 if ! HAVE_GTK3.
13606 (update_frame_tool_bar): Call gtk_widget_hide.
13607 (xg_initialize): Use GDK_KEY_g.
13608
13609 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13610 if ! HAVE_GTK3
13611 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13612
13613 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13614 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13615 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13616
1c2cc4ef
JB
136172011-03-08 Juanma Barranquero <lekktu@gmail.com>
13618
13619 * w32xfns.c (select_palette): Check success of RealizePalette against
13620 GDI_ERROR, not zero.
13621
33383987 13622See ChangeLog.11 for earlier changes.
aac0c6e3
MR
13623
13624;; Local Variables:
13625;; coding: utf-8
aac0c6e3
MR
13626;; End:
13627
2f097256 13628 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
13629
13630 This file is part of GNU Emacs.
13631
13632 GNU Emacs is free software: you can redistribute it and/or modify
13633 it under the terms of the GNU General Public License as published by
13634 the Free Software Foundation, either version 3 of the License, or
13635 (at your option) any later version.
13636
13637 GNU Emacs is distributed in the hope that it will be useful,
13638 but WITHOUT ANY WARRANTY; without even the implied warranty of
13639 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13640 GNU General Public License for more details.
13641
13642 You should have received a copy of the GNU General Public License
13643 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.