Remove some src/s files that are now empty
[bpt/emacs.git] / src / ChangeLog
CommitLineData
983188fd
GM
12012-07-13 Glenn Morris <rgm@gnu.org>
2
32fb4bb6
GM
3 * s/bsd-common, s/cygwin.h: Remove empty files.
4 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5
983188fd
GM
6 * s/usg5-4-common.h (USG, USG5):
7 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
8 * s/sol2-6.h (SOLARIS2):
9 * s/irix6-5.h (IRIX6_5):
10 * s/hpux10-20.h (USG, USG5, HPUX):
11 * s/gnu-linux.h (USG, GNU_LINUX):
12 * s/freebsd.h (BSD_SYSTEM):
13 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
14 * s/cygwin.h (CYGWIN):
15 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
16 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
17
d1e68667 182012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
19
20 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 21
6de0e799
GM
222012-07-13 Glenn Morris <rgm@gnu.org>
23
739ae010
GM
24 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
25
dbee5793
GM
26 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
27
6de0e799
GM
28 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
29 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
30
b82da769
GM
312012-07-12 Glenn Morris <rgm@gnu.org>
32
4fae5a7a 33 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
34
35 * process.c (init_process_emacs): Rename from init_process.
36 The old name is also the name of a Mach system call.
37 * lisp.h, emacs.c: Update for this name change.
38 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
39 longer needed.
40
5a979817
EZ
412012-07-12 Eli Zaretskii <eliz@gnu.org>
42
43 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
44 memmove call that removes glyphs covered by the left truncation
45 glyph. Improve commentary.
46 (display_line): Fix display of continuation glyphs on GUI frames
47 when the right fringe is turned off and variable-size fonts are
48 used in the window. Move the code that appends a stretch glyph to
49 produce_special_glyphs, so that it could be used for truncation
50 and continuation glyphs alike.
51 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
52 glyph of a suitably computed width, to align the special glyphs at
53 the window margin. Code moved from display_line. (Bug#11832)
54
3e91a053
GM
552012-07-12 Glenn Morris <rgm@gnu.org>
56
ba9e4b84
GM
57 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
58
59 * s/gnu-linux.h, s/hpux10-20.h:
60 Do not unconditionally define HAVE_XRMSETDATABASE.
61
3e91a053
GM
62 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
63
b300b1f4
PE
642012-07-12 Paul Eggert <eggert@cs.ucla.edu>
65
66 Fix typos that broke OS X build.
67 Reported by Randal L. Schwartz in
68 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
69 * nsterm.m (ns_timeout): Add missing local decl.
70 (ns_get_color): snprintf -> sprintf, to fix typo.
71
6e777848
GM
722012-07-12 Glenn Morris <rgm@gnu.org>
73
3f922c37
GM
74 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
75 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
76 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
77 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
78
0ab7b23a
GM
79 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
80 Move PTY_OPEN to configure.
81
6e777848
GM
82 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
83 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
84 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
85
4a7edc24
DA
862012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
87
88 Use empty_unibyte_string where applicable.
89 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
90 * lread.c (read1): Likewise.
91 * xsettings.c (syms_of_xsettings): Likewise.
92
308aab79
GM
932012-07-12 Glenn Morris <rgm@gnu.org>
94
42bd1719
GM
95 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
96 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
97 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
98 * s/hpux10-20.h (RUN_TIME_REMAP):
99 * s/bsd-common.h (TABDLY): Move to configure.
100
101 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
102
103 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
104
ea0bbd17 105 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 106 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
107
108 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 109
308aab79
GM
110 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
111 * s/template.h: Move NARROWPROTO to configure.
112
ee1cf5cf
GM
1132012-07-11 Glenn Morris <rgm@gnu.org>
114
30fe9bf4
GM
115 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
116 unused since 2011-01-17 change to systty.h.
117
ee1cf5cf
GM
118 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
119 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
120 Move HAVE_PTYS and HAVE_SOCKETS to configure.
121
63e47e07
PE
1222012-07-11 Paul Eggert <eggert@cs.ucla.edu>
123
124 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
125
c43fb4c3
GM
1262012-07-11 Glenn Morris <rgm@gnu.org>
127
128 * s/darwin.h, s/gnu-linux.h, s/template.h:
129 Move INTERRUPT_INPUT to configure.
130
e8df9267
DA
1312012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
132
133 Minor adjustments to interning code.
134 * lisp.h (intern, intern_c_string): Redefine as static inline
135 wrappers for intern_1 and intern_c_string_1, respectively.
136 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
137 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
138 Vobarray checking.
e8df9267
DA
139 * font.c (font_intern_prop): Likewise. Adjust comment.
140 * w32font.c (intern_font_name): Likewise.
141
34348bd4
AS
1422012-07-11 Andreas Schwab <schwab@linux-m68k.org>
143
d96a1e0c
AS
144 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
145
34348bd4
AS
146 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
147 of Fcar/Fcdr if possible.
148 * font.c (check_otf_features): Likewise.
149 * fontset.c (Fnew_fontset): Likewise.
150 * gnutls.c (Fgnutls_boot): Likewise.
151 * minibuf.c (read_minibuf): Likewise.
152 * msdos.c (IT_set_frame_parameters): Likewise.
153 * xmenu.c (Fx_popup_dialog): Likewise.
154 * w32menu.c (Fx_popup_dialog): Likewise.
155
c8add24e
GM
1562012-07-11 Glenn Morris <rgm@gnu.org>
157
4b575b3c
GM
158 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
159 since nothing has defined it on these platforms.
160
09f4e3b0
GM
161 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
162 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
163
172bedef
GM
164 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
165 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
166 Move CLASH_DETECTION to configure.
167
249685df
GM
168 * s/gnu.h: Remove file, which is now empty.
169
c8add24e
GM
170 * s/gnu.h, s/gnu-linux.h:
171 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
172
b41253a3
JW
1732012-07-11 John Wiegley <johnw@newartisans.com>
174
175 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
176 function attribute, so we only use it if it exists in the
177 compiler.
178
d923b542
DA
1792012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
180
181 Avoid call to strlen in fast_c_string_match_ignore_case.
182 * search.c (fast_c_string_match_ignore_case): Change to use
183 length argument. Adjust users accordingly.
184 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
185
5ebbef1d
PE
1862012-07-11 Paul Eggert <eggert@cs.ucla.edu>
187
bb352260
PE
188 Assume mkdir, rmdir.
189 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
190 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
191
57054ddd
PE
192 Assume rename.
193 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
194
b747d3f7
PE
195 Assume perror.
196 * s/hpux10-20.h (HAVE_PERROR): Remove.
197 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
198 Remove dummy definition, as this problem was obsolete long ago.
199
5ebbef1d
PE
200 Assume strerror.
201 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
202
984e7f30
DA
2032012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
204
205 Avoid calls to strlen in font processing functions.
206 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 207 (font_open_by_name): Change to use length argument. Adjust
984e7f30 208 users accordingly.
d923b542
DA
209 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
210 Adjust prototypes.
211 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
212 Change to return ptrdiff_t.
984e7f30
DA
213 (xfont_list_pattern, xfont_match): Use length returned by
214 xfont_decode_coding_xlfd.
215 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
216
20e94fdd
GM
2172012-07-11 Glenn Morris <rgm@gnu.org>
218
9d596af3
GM
219 * s/darwin.h, s/freebsd.h, s/netbsd.h:
220 Move DONT_REOPEN_PTY to configure.
221
20e94fdd
GM
222 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
223 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
224
e99a530f
PE
2252012-07-10 Paul Eggert <eggert@cs.ucla.edu>
226
22ffb973
PE
227 Remove "#define unix" that is no longer needed (Bug#11905).
228 * s/aix4-2.h (unix): Remove; no longer needed.
229
e9a9ae03
PE
230 EMACS_TIME simplification (Bug#11875).
231 This replaces macros (which typically do not work in GDB)
232 with functions, typedefs and enums, making the code easier to debug.
233 The functional style also makes code easier to read and maintain.
234 * systime.h: Include <sys/time.h> on all hosts, not just if
235 WINDOWSNT, since 'struct timeval' is needed in general.
236 (EMACS_TIME): Now a typedef, not a macro.
237 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
238 not macros.
239 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
240 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
241 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
242 (EMACS_TIME_LE): Now functions, not macros.
243 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
244 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
245 which are not functions. All uses rewritten to use:
246 (make_emacs_time): New function.
247 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
248 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
249 not functions. All uses rewritten to use the following, respectively:
250 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
251 (add_emacs_time, sub_emacs_time): New functions.
252 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
253 * fileio.c (Fcopy_file):
254 * xterm.c (XTflash): Get the current time closer to when it's used.
255 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
256
ffacb126
PE
257 * bytecode.c (targets): Suppress -Woverride-init warnings.
258
e99a530f
PE
259 Simplify by avoiding confusing use of strncpy etc.
260 * doc.c (Fsnarf_documentation):
261 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
262 * frame.c (Fmake_terminal_frame):
263 * gtkutil.c (get_utf8_string):
264 * lread.c (openp):
265 * nsmenu.m (ns_update_menubar):
266 * regex.c (regerror):
267 Prefer memcpy to strncpy and strncat when either will do.
268 * fileio.c (Fsubstitute_in_file_name):
269 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
270 (menu_separator_name_p):
271 * nsmenu.m (ns_update_menubar):
272 Prefer memcmp to strncmp when either will do.
273 * nsterm.m: Include <ftoastr.h>.
274 (ns_get_color):
275 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
276 Prefer snprintf to strncpy.
277 * nsterm.m (ns_term_init):
278 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
279 * nsterm.m (ns_term_init):
280 Avoid the need for strncpy, by using build_string or
281 make_unibyte_string directly. Use dtoastr, not snprintf.
282 * process.c (Fmake_network_process): Diagnose service names that
283 are too long, rather than silently truncating them or creating
284 non-null-terminated names.
285 (Fnetwork_interface_info): Likewise, for interface names.
286 * sysdep.c (system_process_attributes) [GNU_LINUX]:
287 Prefer sprintf to strncat.
288 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
289 Prefer vsnprintf to vsprintf + strncpy.
290
c59592b3
GM
2912012-07-10 Glenn Morris <rgm@gnu.org>
292
293 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
294 Clarify fallback case.
295
7d7bbefd
DA
2962012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
297
298 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
299 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
300 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 301 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
302 where argument type is known to be a Lisp_Cons.
303
3a4c8000
TT
3042012-07-10 Tom Tromey <tromey@redhat.com>
305
306 * bytecode.c (BYTE_CODE_THREADED): New macro.
307 (BYTE_CODES): New macro. Replaces all old byte-code defines.
308 (enum byte_code_op): New type.
309 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
310 (exec_byte_code): Use them. Use token threading when applicable.
311
2a0213a6
DA
3122012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
313
314 Optimize pure C strings initialization.
315 * lisp.h (make_pure_string): Fix prototype.
316 (build_pure_c_string): New function, defined as static inline. This
317 provides a better opportunity to optimize away calls to strlen when
318 the function is called with compile-time constant argument.
319 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
320 argument, adjust users accordingly. Use build_pure_c_string where
321 appropriate.
322 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
323 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
324 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
325
cb1caeaf
DA
3262012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
327
328 Avoid calls to strlen in miscellaneous functions.
329 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
330 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
331 * lread.c (openp): Likewise.
332
c293e30c
DA
3332012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
334
335 Avoid calls to strlen in path processing functions.
336 * fileio.c (file_name_as_directory): Add comment. Change to add
337 srclen argument and return the length of result. Adjust users
338 accordingly.
339 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 340 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
341 users accordingly.
342 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
343
9e059e3f
GM
3442012-07-10 Glenn Morris <rgm@gnu.org>
345
d02eb359
GM
346 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
347 Move PENDING_OUTPUT_COUNT definition to configure.
348
882cf227
GM
349 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
350 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
351 * s/gnu.h (DATA_START): Move definitions to configure.
352
af6e839f
GM
353 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
354 We include usg5-4-common.h, which defines them both.
355
40289a12
GM
356 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
357 O_RDONLY already includes it).
358
9e059e3f
GM
359 Stop ns builds setting the EMACSLOADPATH environment variable.
360 * nsterm.m (ns_load_path): Rename from ns_init_paths.
361 Now it does not set EMACSLOADPATH, just returns the load-path string.
362 * nsterm.h: Update accordingly.
363 * lread.c [HAVE_NS]: Include nsterm.h.
364 (init_lread) [HAVE_NS]: Use ns_load_path.
365 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
366
7c4e8ec0
GM
3672012-07-09 Glenn Morris <rgm@gnu.org>
368
d4f600ff
GM
369 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
370 since the included bsd-common.h does so.
371
cbb31951
GM
372 Stop ns builds setting the EMACSPATH environment variable.
373 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
374 (ns_init_paths): Do not set EMACSPATH.
375 * nsterm.h (ns_exec_path): Add it.
376 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
377 Use ns_exec_path.
378
7c4e8ec0
GM
379 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
380
26bccfae
PE
3812012-07-09 Paul Eggert <eggert@cs.ucla.edu>
382
a0bee46f
PE
383 * process.c (wait_reading_process_output): 'waitchannels' was unset
384 when read_kbd || !NILP (wait_for_cell); fix this.
385
5994c183
PE
386 Add GCC-style 'const' attribute to functions that can use it.
387 * character.h (char_resolve_modifier_mask):
388 * keyboard.h (make_ctrl_char):
389 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
390 (init_character_once, next_almost_prime, init_fns, init_image)
391 (flush_pending_output, init_sound):
392 * mem-limits.h (start_of_data):
393 * menu.h (finish_menu_items):
394 Add ATTRIBUTE_CONST.
395 * emacs.c (DEFINE_DUMMY_FUNCTION):
396 Declare the dummy function with ATTRIBUTE_CONST.
397 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
398 Add decls with ATTRIBUTE_CONST.
399
26bccfae
PE
400 Minor improvements to make_formatted_string.
401 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
402 where int is good enough, as vsprintf returns an int.
403 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
404
a8290ec3
DA
4052012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
406
407 Use make_formatted_string to avoid double length calculation.
408 * lisp.h (make_formatted_string): New prototype.
409 * alloc.c (make_formatted_string): New function.
410 * buffer.c (Fgenerate_new_buffer_name): Use it.
411 * dbus.c (syms_of_dbusbind): Likewise.
412 * editfns.c (Fcurrent_time_zone): Likewise.
413 * filelock.c (get_boot_time): Likewise.
414 * frame.c (make_terminal_frame, set_term_frame_name)
415 (x_report_frame_params): Likewise.
416 * image.c (gs_load): Likewise.
417 * minibuf.c (get_minibuffer): Likewise.
418 * msdos.c (dos_set_window_size): Likewise.
419 * process.c (make_process): Likewise.
420 * xdisp.c (ensure_echo_area_buffers): Likewise.
421 * xsettings.c (apply_xft_settings): Likewise.
422
d01ba2f1
GM
4232012-07-09 Glenn Morris <rgm@gnu.org>
424
425 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
426 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
427 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
428 * nsterm.h (ns_etc_directory): Add it.
429 * callproc.c [HAVE_NS]: Include nsterm.h.
430 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
431
f1f924b6
DA
4322012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
433
434 Move marker debugging code under MARKER_DEBUG.
435 * marker.c (MARKER_DEBUG): Move marker debugging code under
436 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
437 for bootstrap with --enable-checking (~3x slowdown reported
438 by Juanma Barranquero <lekktu@gmail.com>).
439 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
440
ab531b66
PE
4412012-07-08 Paul Eggert <eggert@cs.ucla.edu>
442
443 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
444 See <http://bugs.gnu.org/11825#29>.
445
c4b3bc8a
EZ
4462012-07-08 Eli Zaretskii <eliz@gnu.org>
447
448 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
449 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
450 (display_line): Add commentary about displaying truncation glyphs
451 on GUI frames.
452 (produce_special_glyphs): Move here from term.c.
453
454 * term.c (produce_special_glyphs): Move to xdisp.c.
455
456 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
457 section.
c4b3bc8a 458
b676b881
AS
4592012-07-07 Andreas Schwab <schwab@linux-m68k.org>
460
f17c5273
AS
461 * xdisp.c (display_line): Avoid warning about implicit declaration
462 of FRAME_FONT.
463
298819b9
AS
464 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
465
b676b881
AS
466 * lisp.h: Remove empty conditional.
467
6045c4fd
PE
4682012-07-07 Paul Eggert <eggert@cs.ucla.edu>
469
b3350bf9
PE
470 * lread.c (load_path_check): Now static.
471
6045c4fd
PE
472 Fix some minor --with-ns problems found by static checking.
473 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
474 (x_set_font) [!HAVE_X_WINDOWS]:
475 * image.c (xpm_load_image) [HAVE_NS]:
476 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
477 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
478 Remove unused local.
479 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
480 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
481 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
482 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
483 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
484 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
485 Fix pointer signedness problem.
486 * xfaces.c (FRAME_X_FONT_TABLE):
487 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
488
929e7845
GM
4892012-07-07 Glenn Morris <rgm@gnu.org>
490
491 * lread.c (load_path_check): New function, split from init_lread.
492 (init_lread): Reorganize. Motivation:
493 If EMACSLOADPATH is set, check/warn about that rather than the
494 defaults, which we are not going to use. Hence we can remove
495 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
496 Don't warn if site-lisp directories are missing.
497 If not installed, start from a blank load-path, since
498 PATH_LOADSEARCH refers to the eventual installation directories.
499
58dd0aa4
EZ
5002012-07-07 Eli Zaretskii <eliz@gnu.org>
501
502 Support truncation and continuation glyphs on GUI frames, when
503 fringes are disabled. (Bug#11832)
504 * xdisp.c (init_iterator): Get dimensions of truncation and
505 continuation glyphs even if on GUI frames. Adjust
506 it->last_visible_x on GUI frames when the left or right fringes,
507 or both, are absent.
508 (start_display, move_it_in_display_line_to): Handle the case of a
509 GUI frame without a fringe to display continuation or truncation
510 glyphs.
511 (insert_left_trunc_glyphs): Support GUI frames: make sure
512 truncation glyphs overwrite enough glyphs from the current line to
513 have sufficient space in pixels.
514 (display_line): Support truncation and continuation glyphs on GUI
515 frames. If some spare pixels are left on the line after inserting
516 the truncation glyphs, fill that space with a stretch glyph of a
517 suitably computed width.
518
519 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
520 produce_glyphs, to support GUI sessions.
521
31571fd7
PE
5222012-07-07 Paul Eggert <eggert@cs.ucla.edu>
523
5a16b9bc
PE
524 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
525
f3047c75
PE
526 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
527
31571fd7
PE
528 Do not require float-time's arg to fit in time_t (Bug#11825).
529 This works better on hosts where time_t is unsigned, and where
530 float-time is applied to the (negative) difference between two times.
531 * editfns.c (decode_time_components): Last arg is now double *,
532 not int *, and means to store all the result as a double, without
533 worrying about whether the seconds part fits in time_t.
534 All callers changed.
535 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
536 All callers changed.
537 (Ffloat_time): Do not fail merely because the specified time falls
538 outside of time_t range.
539
4516fbef
GM
5402012-07-07 Glenn Morris <rgm@gnu.org>
541
542 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
543 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
544 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
545
07adc2c6
JB
5462012-07-07 Juanma Barranquero <lekktu@gmail.com>
547
548 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
549 Update dependencies.
550
551 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
552
fd573f31
PE
5532012-07-06 Paul Eggert <eggert@cs.ucla.edu>
554
fee5959d
PE
555 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
556 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
557 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
558 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
559 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
560 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
561
fd573f31
PE
562 * xfont.c (compare_font_names): Redo to omit the need for casts.
563
ddadbc0e
AS
5642012-07-06 Andreas Schwab <schwab@linux-m68k.org>
565
fca8d6b6
AS
566 * xfns.c (Fx_change_window_property): Doc fix.
567 * w32fns.c (Fx_change_window_property): Doc fix.
568
ddadbc0e
AS
569 * w32fns.c (Fx_window_property): Accept the same arguments as the
570 X Windows version. Doc fix.
571 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
572
f247498e
JB
5732012-07-06 Juanma Barranquero <lekktu@gmail.com>
574 Eli Zaretskii <eliz@gnu.org>
575
576 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
577 Windows-specific code from nt/config.nt moved here.
578 Obsolete settings removed.
579
216ee680
PE
5802012-07-06 Paul Eggert <eggert@cs.ucla.edu>
581
582 * process.c: Avoid unnecessary calls to gettime.
583 (wait_reading_process_output): Don't get the time of day
584 when gobbling data immediately and not waiting, as there's no need
585 for it in that case. This removes a FIXME.
586
bdd091e4
JD
5872012-07-06 Jan Djärv <jan.h.d@swipnet.se>
588
589 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
590 is defined (Bug#11768).
591
9d44f8ce
DA
5922012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
593
594 Fix marker debugging code.
595 * marker.c (byte_char_debug_check): Do not perform the check
596 if buffer is not multibyte.
090bd7cb
JB
597 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
598 Call byte_char_debug_check with correct arguments.
9d44f8ce 599
90fc4786
DA
6002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
601
602 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
603 * marker.c (byte_char_debug_check, count_markers):
604 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
605 (byte_debug_flag): Remove.
606 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
607 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
608
7b7ae965
DA
6092012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
610
4e57b342
DA
611 Avoid code repetition in marker-related functions.
612 * marker.c (attach_marker): New function.
613 (Fset_marker, set_marker_restricted, set_marker_both)
614 (set_marker_restricted_both): Use it.
615 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
616 Consistently rename charno to charpos.
617 (marker_position): Add eassert.
618 (marker_byte_position): Convert to eassert.
619
6202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
621
622 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 623 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 624 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 625
657924ff
DA
6262012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
627
628 Introduce fast path for the widely used marker operation.
629 * alloc.c (build_marker): New function.
630 * lisp.h (build_marker): New prototype.
631 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
632 * composite.c (autocmp_chars): Likewise.
633 * editfns.c (buildmark): Remove.
634 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
635 (save_restriction_save): Use build_marker.
636 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
637 * window.c (save_window_save): Likewise.
638
041a49a6
DA
6392012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
640
641 Do not use Fdelete_overlay in delete_all_overlays
642 to avoid redundant calls to unchain_overlay.
643 * buffer.c (drop_overlay): New function.
644 (delete_all_overlays, Fdelete_overlay): Use it.
645 * minibuf.c (get_minibuffer): Fix comment.
646
7dca65a4
PE
6472012-07-06 Paul Eggert <eggert@cs.ucla.edu>
648
649 Port to OpenBSD 5.1 amd64.
650 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
651 This is needed for OpenBSD, and should be harmless on all BSD systems.
652 Also, include <sys/sysctl.h>, as it should be available on all
653 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
654 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
655 use p_pid member, not kp_proc.pid.
656
8eb876e2
GM
6572012-07-06 Glenn Morris <rgm@gnu.org>
658
659 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
660
38182d90
PE
6612012-07-05 Paul Eggert <eggert@cs.ucla.edu>
662
663 More xmalloc and related cleanup.
664 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
665 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
666 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
667 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
668 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
669 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
670 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
671 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
672 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
673 * xterm.c:
674 Omit needless casts involving void * pointers and allocation.
675 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
676 as the former is more robust if P's type is changed.
677 Prefer xzalloc to xmalloc + memset 0.
678 Simplify malloc-or-realloc to realloc.
679 Don't worry about xmalloc returning a null pointer.
680 Prefer xstrdup to xmalloc + strcpy.
681 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
682 growing it.
683 * keyboard.c (apply_modifiers_uncached): Prefer local array to
684 alloca of a constant.
685
6dd5a677
EZ
6862012-07-05 Eli Zaretskii <eliz@gnu.org>
687
688 * xdisp.c (display_line): Fix horizontal pixel coordinates when
689 hscroll is larger than the line width. Fixes long and futile
690 looping inside extend_face_to_end_of_line (on a TTY) producing
691 glyphs that are not needed and thrown away.
692
6b312f0f
DA
6932012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
694
695 * marker.c (set_marker_restricted_both): Simplify by using
696 clip_to_bounds.
697
f520ef9b
PE
6982012-07-05 Paul Eggert <eggert@cs.ucla.edu>
699
700 * editfns.c (region_limit): Simplify by using clip_to_bounds.
701
383b7c95
JD
7022012-07-05 Jan Djärv <jan.h.d@swipnet.se>
703
704 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
705 not defined (Bug#11768).
706 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
707 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
708 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
709 followed by gtk_box_set_homogeneous (Bug#11768).
710 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
711 (update_theme_scrollbar_width, xg_create_scroll_bar):
712 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
713 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
714 (is_box_type): New function (Bug#11768).
715 (xg_tool_item_stale_p): Call is_box_type.
5293d758 716 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
717 with default display (Bug#11768).
718
d6e7bf45
EZ
7192012-07-05 Eli Zaretskii <eliz@gnu.org>
720
721 * xdisp.c (window_hscroll_limited): New function.
722 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
723 coordinates when window's hscroll is set to insanely large
724 values. (Bug#11857)
725
431391ec
JB
7262012-07-05 Juanma Barranquero <lekktu@gmail.com>
727
728 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
729 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
730
23f86fce
DA
7312012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
732
733 Cleanup xmalloc.
734 * lisp.h (xzalloc): New prototype. Omit needless casts.
735 * alloc.c (xzalloc): New function. Omit needless casts.
736 * charset.c: Omit needless casts. Convert all calls to
737 xmalloc with following memset to xzalloc.
738 * dispnew.c: Likewise.
739 * fringe.c: Likewise.
740 * image.c: Likewise.
741 * sound.c: Likewise.
742 * term.c: Likewise.
743 * w32fns.c: Likewise.
744 * w32font.c: Likewise.
745 * w32term.c: Likewise.
746 * xfaces.c: Likewise.
747 * xfns.c: Likewise.
748 * xterm.c: Likewise.
749 * atimer.c: Omit needless casts.
750 * buffer.c: Likewise.
751 * callproc.c: Likewise.
752 * ccl.c: Likewise.
753 * coding.c: Likewise.
754 * composite.c: Likewise.
755 * doc.c: Likewise.
756 * doprnt.c: Likewise.
757 * editfns.c: Likewise.
758 * emacs.c: Likewise.
759 * eval.c: Likewise.
760 * filelock.c: Likewise.
761 * fns.c: Likewise.
762 * gtkutil.c: Likewise.
763 * keyboard.c: Likewise.
764 * lisp.h: Likewise.
765 * lread.c: Likewise.
766 * minibuf.c: Likewise.
767 * msdos.c: Likewise.
768 * print.c: Likewise.
769 * process.c: Likewise.
770 * region-cache.c: Likewise.
771 * search.c: Likewise.
772 * sysdep.c: Likewise.
773 * termcap.c: Likewise.
774 * terminal.c: Likewise.
775 * tparam.c: Likewise.
776 * w16select.c: Likewise.
777 * w32.c: Likewise.
778 * w32reg.c: Likewise.
779 * w32select.c: Likewise.
780 * w32uniscribe.c: Likewise.
781 * widget.c: Likewise.
782 * xdisp.c: Likewise.
783 * xmenu.c: Likewise.
784 * xrdb.c: Likewise.
785 * xselect.c: Likewise.
786
0497dc44
PE
7872012-07-05 Paul Eggert <eggert@cs.ucla.edu>
788
789 * fileio.c (time_error_value): Check the right error number.
790 Problem reported by Troels Nielsen in
791 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
792
356e7178
PE
7932012-07-04 Paul Eggert <eggert@cs.ucla.edu>
794
4e71fd89
PE
795 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
796 This should be fixed in a better way; see Eli Zaretskii in
797 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
798 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
799
f0941253
PE
800 * fileio.c (time_error_value): Rename from special_mtime.
801 The old name's problems were noted by Eli Zaretskii in
802 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
803
065c9eb4
PE
804 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
805 This variable's comment says Emacs needs at least one GDB-visible
806 symbol of type enum pvec_type, to work around GDB problems.
807 The symbol's value doesn't matter.
808
356e7178
PE
809 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
810 that causes compilation to fail on pre-C99 compilers.
811
95f61aa2
JB
8122012-07-04 Juanma Barranquero <lekktu@gmail.com>
813
814 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
815 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
816
3884d954
DA
8172012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
818
d209e2fb 819 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
820 headers for buffer_defaults and buffer_local_symbols.
821 Reported by Juanma Barranquero <lekktu@gmail.com>.
822
ee28be33
SM
8232012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
824
825 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
826 * lisp.h (enum pvec_type): Use fewer bits.
827 (PSEUDOVECTOR_SIZE_BITS): New constant.
828 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
829 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
830 change in pvec_type.
831 (PSEUDOVECTOR_TYPEP): New macro.
832 (TYPED_PSEUDOVECTORP): Use it.
833 * fns.c (internal_equal): Adapt code to extract pvectype.
834 * emacs.c (gdb_pvec_type): Update type.
835 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
836 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
837 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
838 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
839 (sweep_vectors): Use it. Use local var `total_bytes' instead of
840 abusing vector->header.next.nbytes.
841 (live_vector_p): Use PVEC_TYPE.
842 (mark_object): Adapt code to extract pvectype. Use switch.
843
c7f2cd7f
PE
8442012-07-04 Paul Eggert <eggert@cs.ucla.edu>
845
846 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
847 Tighten new eassert a bit.
848
8ce70ed2
DA
8492012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
850
851 Fix compilation with --enable-gcc-warnings and -O1
852 optimization level.
853 * doprnt.c (doprnt): Change type of tem to int, initialize
854 to avoid compiler warning. Add eassert.
855 * search.c (simple_search): Initialize match_byte to avoid
856 compiler warning. Add eassert.
857
dea7f1e5
PE
8582012-07-04 Paul Eggert <eggert@cs.ucla.edu>
859
24a212eb
PE
860 Avoid weird behavior with large horizontal scrolls.
861 Without this change, for example, large hscroll values would
862 mess up Emacs's display on Fedora 15 x86, presumably due to
863 overflows in int calculations in the display code.
864 Also, if buffers had long lines, Emacs would freeze.
865 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
866 (set_window_hscroll): New function, containing the old guts of
867 Fset_window_hscroll. Return the clipped value.
868 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
869 This avoids the need to check against PTRDIFF_MAX.
870
dea7f1e5
PE
871 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
872
76046526
DA
8732012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
874
875 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
876
39adff0d
PE
8772012-07-04 Paul Eggert <eggert@cs.ucla.edu>
878
63807d47
PE
879 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
880 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
881 since GCC 4.4.6 issues a bogus warning for them.
882
39adff0d
PE
883 Fix bugs in file timestamp newness comparisons.
884 * fileio.c (Ffile_newer_than_file_p):
885 * lread.c (Fload): Use full timestamp resolution of files,
886 not just the 1-second resolution, so that files that are only
887 slightly newer still count as newer.
888 * fileio.c (Ffile_newer_than_file_p): Don't assume file
889 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
890
dbeed9a6
PE
8912012-07-03 Paul Eggert <eggert@cs.ucla.edu>
892
893 * fileio.c: Improve handling of file time marker. (Bug#11852)
894 (special_mtime): New function.
895 (Finsert_file_contents, Fverify_visited_file_modtime):
896 Use it to set special mtime values consistently.
897
636334d6
AS
8982012-07-03 Andreas Schwab <schwab@linux-m68k.org>
899
900 * fileio.c (Finsert_file_contents): Properly handle st_mtime
901 marker for non-existing file. (Bug#11852)
902
e2017fe2
GM
9032012-07-03 Glenn Morris <rgm@gnu.org>
904
905 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
906 and did not make it into globals.h).
907
404dbd37
TT
9082012-07-03 Tom Tromey <tromey@redhat.com>
909
910 * window.c (Fset_window_margins, Fset_window_fringes)
911 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
912 * textprop.c (Fprevious_property_change): No longer static.
913 * syntax.c (Fsyntax_table_p): No longer static.
914 * process.c (Fget_process, Fprocess_datagram_address): No longer
915 static.
916 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
917 * keyboard.c (Fcommand_execute): No longer static.
918 Remove EXFUN.
919 * insdel.c (Fcombine_after_change_execute): No longer static.
920 * image.c (Finit_image_library): No longer static.
921 * fileio.c (Fmake_symbolic_link): No longer static.
922 * eval.c (Ffetch_bytecode): No longer static.
923 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
924 * doc.c (Fdocumentation_property, Fsnarf_documentation):
925 No longer static.
404dbd37
TT
926 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
927 static.
928 * dired.c (Ffile_attributes): No longer static.
929 * composite.c (Fcomposition_get_gstring): No longer static.
930 * callproc.c (Fgetenv_internal): No longer static.
931
932 * ccl.h: Remove EXFUNs.
933 * buffer.h: Remove EXFUNs.
934 * dispextern.h: Remove EXFUNs.
935 * intervals.h: Remove EXFUNs.
936 * fontset.h: Remove EXFUN.
937 * font.h: Remove EXFUNs.
938 * dosfns.c (system_process_attributes): Remove EXFUN.
939 * keymap.h: Remove EXFUNs.
940 * lisp.h: Remove EXFUNs.
941 * w32term.h: Remove EXFUNs.
942 * window.h: Remove EXFUNs.
943 * xsettings.h: Remove EXFUN.
944 * xterm.h: Remove EXFUN.
945
8e4fd1e1
GM
9462012-07-03 Glenn Morris <rgm@gnu.org>
947
948 * lisp.h (Frandom): Make it visible to C.
949 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
950 buffer for invisible buffers. (Bug#1229)
951
ca95b3eb
DA
9522012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
953
954 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
955 values which aren't power of 2.
956 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
957 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
958 accordingly.
959
7555c33f
SM
9602012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
961
962 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
963
964 * alloc.c (mark_object): Revert part of last patch to use `switch'.
965
d12e8f5a
DA
9662012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
967
968 * alloc.c (allocate_vector_block): Remove redundant
969 calls to mallopt if DOUG_LEA_MALLOC is defined.
970 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
971 avoid calls to mallopt if zero_vector is returned.
972
296094c3
DA
9732012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
974
975 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
976 is enabled, avoid dereferencing NULL current_sblock if
977 running undumped.
978
36429c89
DA
9792012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
980
981 Cleanup basic buffer management.
982 * buffer.h (struct buffer): Change layout to use generic vector
983 marking code. Fix some comments. Change type of 'clip_changed'
984 to bitfield. Remove unused #ifndef old.
985 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
986 (GET_OVERLAYS_AT): Fix indentation.
987 (for_each_per_buffer_object_at): New macro.
988 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
989 (Fbuffer_local_variables): Use it.
990 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
991 * alloc.c (allocate_buffer): Adjust to match new layout of
992 struct buffer. Fix comment.
993 (mark_overlay): New function.
994 (mark_buffer): Use it. Use mark_vectorlike to mark normal
995 Lisp area of struct buffer.
996 (mark_object): Use it. Adjust marking of misc objects
997 and related comments.
998
3b3e4cac
PE
9992012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1000
1001 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1002 wrapper that is not needed because the wrapped code is a no-op (zero
1003 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1004 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1005
cf5c0175
DA
10062012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1007
1008 * alloc.c (mark_buffer): Simplify. Remove prototype.
1009 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1010 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1011 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1012 redundant calls to mark_vectorlike for bool vectors.
1013
ca26824c
GM
10142012-06-30 Glenn Morris <rgm@gnu.org>
1015
2e4c5312
GM
1016 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1017
ca26824c
GM
1018 * epaths.in (PATH_SITELOADSEARCH): New.
1019 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1020 This is rather than relying on --enable-locallisppath elements
1021 having "site-lisp" in their names. (Bug#10208#25, 11658)
1022
0d23c240
EZ
10232012-06-30 Eli Zaretskii <eliz@gnu.org>
1024
c9240d7a
EZ
1025 * w32proc.c (sys_select): Accept and ignore one more argument.
1026
1027 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1028
0d23c240 1029 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1030 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1031
1032 * sysdep.c: Don't include dos.h and dosfns.h.
1033
1034 * process.c (sys_select):
1035 * msdos.c (sys_select): Accept one more argument and ignore it.
1036
1037 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1038 adapt data types and code to that.
1039
1040 * dosfns.c:
1041 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1042 which clashes with the gnulib function of the same name.
1043
af5a5a98
AS
10442012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1045
c5e4379c
AS
1046 * font.c (font_style_to_value, font_style_symbolic)
1047 (font_prop_validate_style): Add type checks for values in
1048 font_style_table.
1049
af5a5a98
AS
1050 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1051 argument.
1052 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1053 uses.
1054
8d38f461
EZ
10552012-06-29 Eli Zaretskii <eliz@gnu.org>
1056
2e5a6631
EZ
1057 * xdisp.c (try_window_id): Undo last change.
1058
8d38f461
EZ
1059 * w32.c (getwd): Adjust commentary about startup_dir.
1060 (init_environment): Always call sys_access, even in non-MSVC
1061 builds. Don't chdir to the directory of the Emacs executable.
1062 This undoes code from 1997 which was justified by the need to
1063 "avoid conflicts when removing and renaming directories". But its
1064 downside was that every relative file name was being interpreted
1065 relative to the directory of the Emacs executable, which can never
1066 be TRT. In particular, it broke sys_access when called with
1067 relative file names.
1068 (sys_access): Map GetLastError to errno.
1069
2af3565e
DA
10702012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1071
1072 * window.h (struct window): Change type of 'fringes_outside_margins'
1073 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1074 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1075 Adjust comment.
1076 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1077 to ptrdiff_t.
1078
c8d3a25c 10792012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1080
c8d3a25c
GM
1081 * gnutls.c (emacs_gnutls_handshake):
1082 Add QUIT to make the loop interruptible.
57570cd3 1083
c8d3a25c 10842012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1085
c8d3a25c
GM
1086 * charset.c (init_charset): Make lack of etc/charsets fatal.
1087
3e984ee8
DA
10882012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1089
1090 * editfns.c (region_limit): Fix type mismatch.
1091
ef884f23
DA
10922012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1093
1094 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1095 undefined. Convert from xassert to eassert.
1096 * nsmenu.m: Convert from xassert to eassert.
1097 * nsterm.m: Likewise.
1098
7d7e0027
SM
10992012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1100
1101 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1102
aa754e6a
PE
11032012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1104
1105 Avoid integer overflow on scroll-left and scroll-right.
1106 * window.c (HSCROLL_MAX): New macro.
1107 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1108 overflow when requested scroll falls outside ptrdiff_t range.
1109
80b00b08
DA
11102012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1111
1112 * window.h (struct window): Change type of 'hscroll',
1113 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1114 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1115 Adjust users accordingly.
1116 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1117 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1118 from EMACS_INT to ptrdiff_t.
1119 (make_window): Omit redundant initialization.
1120
62b2bcf6
JB
11212012-06-28 Juanma Barranquero <lekktu@gmail.com>
1122
1123 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1124
45942c7d
DA
11252012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1126
1127 * window.h (struct window): Change type of 'use_time' and
1128 'sequence_number' from Lisp_Object to int.
1129 * frame.c (make_frame): Adjust users accordingly.
1130 * print.c (print_object): Likewise.
1131 * window.c (select_window, Fwindow_use_time, make_parent_window)
1132 (make_window): Likewise.
1133
e509cfa6
DA
11342012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1135
1136 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1137 enabled with --enable-checking=[all,glyphs] configure option.
1138 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1139 adjust comments accordingly.
1140 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1141 undefined, adjust comments accordingly.
1142 * image.c: Likewise.
1143 * scroll.c: Likewise.
1144 * w32fns.c: Likewise.
1145 * w32term.c: Likewise.
1146 * xdisp.c: Likewise.
1147 * xfaces.c: Likewise.
1148 * xfns.c: Likewise.
1149 * xterm.c: Likewise.
1150
a54e2c05
DA
11512012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1152
1153 Generalize run-time debugging checks.
1154 * dispextern.h (XASSERTS): Remove.
1155 * fontset.c (xassert): Remove.
1156 Convert from xassert to eassert.
1157 * alloc.c: Convert from xassert to eassert.
1158 * bidi.c: Likewise.
1159 * dispnew.c: Likewise.
1160 * fns.c: Likewise.
1161 * fringe.c: Likewise.
1162 * ftfont.c: Likewise.
1163 * gtkutil.c: Likewise.
1164 * image.c: Likewise.
1165 * keyboard.c: Likewise.
1166 * menu.c: Likewise.
1167 * process.c: Likewise.
1168 * scroll.c: Likewise.
1169 * sound.c: Likewise.
1170 * term.c: Likewise.
1171 * w32console.c: Likewise.
1172 * w32fns.c: Likewise.
1173 * w32term.c: Likewise.
1174 * window.c: Likewise.
1175 * xdisp.c: Likewise.
1176 * xfaces.c: Likewise.
1177 * xfns.c: Likewise.
1178 * xselect.c: Likewise.
1179 * xterm.c: Likewise.
1180
1ec4b7b2
SM
11812012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1182
1183 * fns.c (maybe_resize_hash_table): Output message when growing the
1184 purify-hashtable.
1185
2014308a
DA
11862012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1187
1188 * alloc.c (allocate_string_data): Remove dead code.
1189 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1190 avoid GCC warning about unused macro.
1191
246155eb
DA
11922012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1193
1194 * alloc.c (allocate_string): Omit intervals initialization.
1195 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1196 as in make_pure_string and make_pure_c_string.
1197
43184b7b
DA
11982012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1199
d209e2fb 1200 * alloc.c (allocate_string): Fix last change.
43184b7b 1201
3fe6dd74
DA
12022012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1203
d209e2fb 1204 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1205 to memset, add explicit initialization where appropriate.
1206
1ba6038a
GM
12072012-06-27 Glenn Morris <rgm@gnu.org>
1208
1209 * lisp.mk (lisp): Remove paths.elc.
1210
c89926a5
CY
12112012-06-27 Chong Yidong <cyd@gnu.org>
1212
1213 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1214
ed6b3510
JW
12152012-06-26 John Wiegley <johnw@newartisans.com>
1216
1ec4b7b2 1217 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1218 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1219
ed6b3510
JW
1220 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1221 when building with Clang.
1222
8edd4a2b
SM
12232012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1224
1225 * eval.c (Fapply): Allow calling it with a single argument.
1226
f6f62d1b
EZ
12272012-06-26 Eli Zaretskii <eliz@gnu.org>
1228
1229 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1230 _stricmp and _strnicmp.
1231 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1232
62efea5e
DA
12332012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1234
1235 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1236 allocated window.
1237 (allocate_process): Likewise for new process.
8edd4a2b 1238 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1239 (allocate_frame): Likewise.
1240 * frame.c (make_frame): Omit redundant initialization.
1241 * window.c (make_parent_window): Use memset.
1242 (make_window): Omit redundant initialization.
1243 * process.c (make_process): Omit redundant initialization.
1244 * terminal.c (create_terminal): Likewise.
1245
42997f4d
DA
12462012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1247
1248 * term.c (delete_tty): Remove redundant call to memset.
1249
1130ecfc
DA
12502012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1251
1252 * alloc.c: Remove build_string.
1253 * lisp.h: Define build_string as static inline. This provides
1254 a better opportunity to optimize away calls to strlen when the
1255 function is called with compile-time constant argument.
1256 * image.c (imagemagick_error): Convert to build_string.
1257 * w32proc.c (sys_spawnve): Likewise.
1258 * xterm.c (x_term_init): Likewise.
1259
cf38a720
PE
12602012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1261
99027bdd
PE
1262 Use sprintf return value instead of invoking strlen on result.
1263 In the old days this wasn't portable, since some sprintf
1264 implementations returned char *. But they died out years ago and
1265 Emacs already assumes sprintf returns int.
1266 Similarly for float_to_string.
1267 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1268 * ccl.c (ccl_driver):
1269 * character.c (string_escape_byte8):
1270 * data.c (Fnumber_to_string):
1271 * doprnt.c (doprnt):
1272 * print.c (print_object):
1273 * xdisp.c (message_dolog):
1274 * xfns.c (syms_of_xfns):
1275 Use sprintf or float_to_string result to avoid need to call strlen.
1276 * data.c (Fnumber_to_string):
1277 Use make_unibyte_string, since the string must be ASCII.
1278 * lisp.h, print.c (float_to_string): Now returns int length.
1279 * term.c (produce_glyphless_glyph):
1280 Use sprintf result rather than recomputing it.
1281
cf38a720
PE
1282 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1283 * Makefile.in (ALL_CFLAGS):
1284 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1285 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1286
3511c784
DA
12872012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1288
0a08eb21 1289 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1290 strcasecmp if available.
1291 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1292
fb7da12e
AS
12932012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1294
1295 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1296 Avoid comma operator.
1297 * menu.c (push_submenu_start, push_submenu_end)
1298 (push_left_right_boundary, push_menu_pane): Likewise.
1299 * msdos.c (dos_rawgetc): Likewise.
1300
afa2ffd8
DA
13012012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1302
1303 * xfns.c (xic_create_fontsetname): Remove redundant calls
1304 to memset.
1305
b3b4476b
PE
13062012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1307
4495ff38
PE
1308 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1309 sprintf already null-terminates its output.
1310
b3b4476b
PE
1311 * xfns.c (x_window): Remove redundant cast.
1312
b00876c9
DA
13132012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1314
1315 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1316 `const char *' to `char *' to avoid compiler warning.
1317
d188e26b
PE
13182012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1319
885d1d74
PE
1320 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1321 instead of truncating it to 63 (admittedly a generous limit).
1322
d188e26b
PE
1323 * process.c: Fix spelling and caps in comments.
1324
e2f560b1
DN
13252012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1326
e86db54b 1327 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1328 * sysdep.c (setpgrp): Remove definition, not used in this file.
1329
7583a3a1
JB
13302012-06-24 Juanma Barranquero <lekktu@gmail.com>
1331
1332 * makefile.w32-in: Update dependencies.
1333
696056c2
EZ
13342012-06-24 Eli Zaretskii <eliz@gnu.org>
1335
1336 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1337 (SYSTIME_H): Add nt/inc/sys/time.h.
1338
1339 * systime.h [WINDOWSNT]: Include sys/time.h.
1340
1341 * s/ms-w32.h (struct timespec): Definition moved from
1342 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1343
845ca893
PE
13442012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1345
1346 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1347 * buffer.h (buffer_slot_type_mismatch):
1348 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1349 * eval.c (unwind_to_catch):
1350 * image.c (my_png_error, my_error_exit):
1351 * keyboard.c (quit_throw_to_read_char, user_error)
1352 (Fexit_recursive_edit, Fabort_recursive_edit):
1353 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1354 (wrong_type_argument, buffer_overflow, __executable_start)
1355 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1356 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1357 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1358 (fatal):
1359 (child_setup) [!DOS_NT]:
1360 * lread.c (end_of_file_error, invalid_syntax):
1361 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1362 * puresize.h (pure_write_error):
1363 * search.c (matcher_overflow):
1364 * sound.c (sound_perror, alsa_sound_perror):
1365 * sysdep.c, syssignal.h (croak):
1366 * term.c (maybe_fatal, vfatal):
1367 * textprop.c (text_read_only):
1368 * undo.c (user_error):
1369 * unexmacosx.c (unexec_error):
1370 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1371 Use _Noreturn rather than NO_RETURN.
1372 No need for separate decl merely because of _Noreturn.
1373 * sound.c (sound_warning, parse_sound):
1374 Remove unnecessary forward decls.
1375
f1dd8073
PE
13762012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1377
1378 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1379 * lisp.h (WAIT_READING_MAX): New macro.
1380 * dispnew.c (Fsleep_for, sit_for):
1381 * keyboard.c (kbd_buffer_get_event):
1382 * process.c (Faccept_process_output):
1383 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1384 This improves on the previous patch, which introduced a bug
1385 when time_t is unsigned and as wide as intmax_t.
1386 See <http://bugs.gnu.org/9000#51>.
1387
b82c1755
EZ
13882012-06-23 Eli Zaretskii <eliz@gnu.org>
1389
1390 * dispnew.c (sit_for, Fsleep_for):
1391 * keyboard.c (kbd_buffer_get_event):
1392 * process.c (Faccept_process_output): Avoid compiler warnings when
1393 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1394
ca300656
JB
13952012-06-23 Juanma Barranquero <lekktu@gmail.com>
1396
049ec95b
JB
1397 * makefile.w32-in: Update dependencies.
1398
ca300656
JB
1399 * w32.c (ltime): Add return type and declare static.
1400 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1401
db7b8d06
PE
14022012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1403
1404 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1405 Privately reported by Herbert J. Skuhra.
1406 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1407 All uses changed.
1408 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1409 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1410
0bd8297f
EZ
14112012-06-23 Eli Zaretskii <eliz@gnu.org>
1412
96512555
EZ
1413 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1414 last argument of make_unibyte_string.
1415
0bd8297f
EZ
1416 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1417 language ID in the event parameters.
1418
1419 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1420 event.code, not the obscure "character set ID".
1421
63def6b6
CY
14222012-06-23 Chong Yidong <cyd@gnu.org>
1423
1424 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1425
e8a02204
EZ
14262012-06-23 Eli Zaretskii <eliz@gnu.org>
1427
388cdec0
EZ
1428 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1429 * w32.c (fdutimens): New function.
1430
1431 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1432
1433 * s/ms-w32.h (pselect): Redirect to sys_select.
1434
1435 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1436
e8a02204
EZ
1437 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1438 in the logic of incrementing and decrementing the value of
1439 use_relocatable_buffers.
1440
d054f3fb
PE
14412012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1442
1443 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1444 Privately reported by Herbert J. Skuhra.
1445 [__FreeBSD__]: Remove "*/" typo after "#include".
1446 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1447 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1448 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1449 Don't assume EMACS_TIME and struct timeval are the same type.
1450
d35af63c
PE
14512012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1452
1453 Support higher-resolution time stamps (Bug#9000).
1454 The time stamps are only nanosecond-resolution at the C level,
1455 since that's the best that any real-world system supports now.
1456 But they are picosecond-resolution at the Lisp level, as that's
1457 easy, and leaves room for future OS improvements.
1458
1459 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1460 (LIBES): Use it.
1461
1462 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1463 Don't get current time unless it's needed.
1464
1465 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1466 now provides it if it's absent.
1467 (start_atimer): Port to higher-res time stamps.
1468 Check for time stamp overflow. Don't get current time more
1469 often than is needed.
1470
1471 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1472 Include systime.h, not time.h.
1473 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1474
1475 * dired.c: Include stat-time.h.
1476 (Ffile-attributes): File times now have higher resolution.
1477
1478 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1479 (struct image): Timestamp now has higher resolution.
1480
1481 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1482 has at least microseconds now. All uses removed.
1483 (update_frame, update_single_window, update_window, update_frame_1)
1484 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1485
1486 * editfns.c (time_overflow): Now extern.
1487 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1488 (float-time, Fformat_time_string, Fcurrent_time_string)
1489 (Fcurrent_time_zone): Accept and generate higher-resolution
1490 time stamps.
1491 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1492 (decode_time_components, lisp_seconds_argument): New functions.
1493 (make_time): Now static.
1494 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1495 Report an error if the time is invalid, rather than having the caller
1496 do that.
1497
1498 * fileio.c: Include <stat-time.h>
1499 (Fcopy_file): Copy higher-resolution time stamps.
1500 Prefer to set the time stamp via a file descriptor if that works.
1501 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1502 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1503 (Fvisited_file_modtime, Fset_visited_file_modtime):
1504 Support higher-resolution time stamps.
1505
1506 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1507
1508 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1509
1510 * image.c (prepare_image_for_display, clear_image_cache)
1511 (lookup_image): Port to higer-resolution time stamps.
1512
1513 * keyboard.c (start_polling, bind_polling_period):
1514 Check for time stamp overflow.
1515 (read_char, kbd_buffer_get_event, timer_start_idle)
1516 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1517 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1518 Port to higher-resolution time stamps. Do not assume time_t is signed.
1519 (decode_timer): New function. Timers are now vectors of length 9,
1520 not 8, to accommodate the picosecond component.
1521 (timer_check_2): Use it.
1522
1523 * nsterm.m (select_timeout, timeval_subtract): Remove.
1524 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1525 as they're a bit more accurate and handle overflow better.
1526 (ns_select): Change prototype to be compatible with pselect.
1527 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1528 * nsterm.h (ns_select): Adjust prototype.
1529
1530 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1531 us-resolution time stamps.
1532 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1533
1534 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1535
1536 * lisp.h (time_overflow): New decl.
1537 (wait_reading_process_output): First arg is now intmax_t, not int,
1538 to accommodate larger waits.
1539
1540 * process.h (struct Lisp_Process.read_output_delay):
1541 Now counts nanoseconds, not microseconds.
1542 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1543 EMACS_HAS_USECS.
1544 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1545 (wait_reading_process_output):
1546 Port to ns-resolution time stamps.
1547 (Faccept_process_output, wait_reading_process_output):
1548 Check for time stamp overflow. Do not assume time_t is signed.
1549 (select_wrapper): Remove; we now use pselect.
1550 (Fprocess_attributes): Now generates ns-resolution time stamps.
1551
1552 * sysdep.c: Include utimens.h. Don't include utime.h
1553 or worry about struct utimbuf; gnulib does that for us now.
1554 (gettimeofday): Remove; gnulib provides a substitute.
1555 (make_timeval): New function.
1556 (set_file_times): Now sets ns-resolution time stamps.
1557 New arg FD; all uses changed.
1558 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1559 (system_process_attributes):
1560 Now returns ns-resolution time stamp. All uses changed.
1561 Check for time stamp overflow.
1562
1563 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1564 provides a substitute now.
1565
1566 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1567 since it guarantees struct timespec.
1568 (EMACS_TIME): Now struct timespec, so that we can support
1569 ns-resolution time stamps.
1570 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1571 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1572 (EMACS_USECS): Remove.
1573 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1574 so multiply the arg by 1000 before storing it.
1575 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1576 New macros.
1577 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1578 Port to ns-resolution time stamps.
1579 (EMACS_TIME_NEG_P): Remove; replaced by....
1580 (EMACS_TIME_SIGN): New macro.
1581 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1582 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1583 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1584 (make_timeval, make_lisp_time, decode_time_components): New decls.
1585 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1586 that it mishandled time_t overflow. You can't compare by subtracting!
1587 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1588 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1589
1590 * term.c: Include <sys/time.h>.
1591 (timeval_to_Time): New function, for proper overflow wraparound.
1592 (term_mouse_position, term_mouse_click): Use it.
1593
1594 * undo.c (record_first_change): Support higher-resolution time stamps
1595 in the undo buffer.
1596 (Fprimitive_undo): Use them when restoring time stamps.
1597
1598 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1599 (w32_get_internal_run_time):
1600 Port to higher-resolution Emacs time stamps.
1601 (ltime): Now accepts single 64-bit integer, as that's more convenient
1602 for callers.
1603
1604 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1605
1606 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1607 for compatibility with pselect. Support ns-resolution time stamps.
1608
1609 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1610
1611 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1612 Check for time stamp overflow, and support ns-resolution time stamps.
1613
1614 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1615 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1616 (timeval_subtract): Remove; no longer needed.
1617 (XTflash, XTring_bell, x_wait_for_event):
1618 Port to ns-resolution time stamps. Don't assume time_t is signed.
1619
b6a92dfe
CY
16202012-06-22 Chong Yidong <cyd@gnu.org>
1621
1622 * xdisp.c (x_consider_frame_title): Revert last change.
1623
d251c37c
EZ
16242012-06-22 Eli Zaretskii <eliz@gnu.org>
1625
1626 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1627 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1628 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1629 staticidx goes up to 1597 out of 1600 = 0x640.)
1630
f10deafb
PE
16312012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1632
1633 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1634 Otherwise, the umask might be mistakenly 0 while handling input signals.
1635
ec6de1e2
SM
16362012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1637
1638 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1639
28be1ada
DA
16402012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
1641
1642 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1643 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1644 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1645 access to `contents' member of Lisp_Vector objects with AREF and ASET
1646 where appropriate.
1647
c6bf3022
CY
16482012-06-19 Chong Yidong <cyd@gnu.org>
1649
1650 * frame.c (delete_frame): When selecting a frame on a different
1651 text terminal, do not alter the terminal's top-frame.
1652
1653 * xdisp.c (format_mode_line_unwind_data): Record the target
1654 frame's selected window and its terminal's top-frame.
1655 (unwind_format_mode_line): Restore them.
1656 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1657 Callers changed.
1658 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1659 since tty frames can be explicitly named.
1660 (prepare_menu_bars): Likewise.
1661
1662 * term.c (Ftty_top_frame): New function.
1663
defd4196
PE
16642012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1665
1666 Port byte-code-meter to modern targets.
1667 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1668 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 1669 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
1670 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1671 (METER_1, METER_2): Simplify.
1672
1053a871
SM
16732012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
1674
1675 * data.c (Fdefalias): Return `symbol' (bug#11686).
1676
b7e8d081
MR
16772012-06-18 Martin Rudalics <rudalics@gmx.at>
1678
1679 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
1680 gets killed during executing of this function (Bug#11665).
1681 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
1682 (Vkill_buffer_query_functions): In doc-string say that functions
1683 run by this hook should not change the current buffer.
1684
7ea2b339
PE
16852012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1686
1687 Fix recently-introduced process.c problems found by static checking.
1688 * process.c (write_queue_push, write_queue_pop, send_process):
1689 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1690 (write_queue_pop): Fix pointer signedness problem.
1691 (send_process): Remove unused local.
1692
96a313a1
CY
16932012-06-17 Chong Yidong <cyd@gnu.org>
1694
1695 * xdisp.c (redisplay_internal): No need to redisplay terminal
1696 frames that are not on top.
1697
20ca2e94
TN
16982012-06-17 Troels Nielsen <bn.troels@gmail.com>
1699
1700 * process.c (make_process): Initialize write_queue.
1701 (write_queue_push, write_queue_pop): New functions.
1702 (send_process): Use them to maintain correct ordering of process
1703 writes (Bug#10815).
1704
9a900ca9
PE
17052012-06-17 Paul Eggert <eggert@cs.ucla.edu>
1706
310fbfa8
PE
1707 * lisp.h (eassert): Assume C89 or later.
1708 This removes the need for CHECK.
1709 (CHECK): Remove. Its comments about always evaluating its
1710 argument were confusing, as 'eassert' typically does not evaluate
1711 its argument.
1712
27bb1ca4
PE
1713 * coding.c (produce_chars): Use ptrdiff_t, not int.
1714
9a900ca9
PE
1715 * xterm.c (x_draw_underwave): Check for integer overflow.
1716 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1717
41b7f8bc 17182012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
1719
1720 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1721 referenced (Bug#11583).
1722
9b0e3eba
AA
17232012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
1724
1725 Implement wave-style variant of underlining.
1726 * dispextern.h (face_underline_type): New enum.
1727 (face): Add field for underline type.
1728 * nsterm.m (ns_draw_underwave): New function.
1729 (ns_draw_text_decoration): Use it.
1730 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1731 New functions.
1732 (x_draw_glyph_string): Use them.
1733 * xfaces.c (Qline, Qwave): New Lisp objects.
1734 (check_lface_attrs, merge_face_ref)
1053a871
SM
1735 (Finternal_set_lisp_face_attribute, realize_x_face):
1736 Handle wave-style underline face attributes.
9b0e3eba
AA
1737 * xterm.c (x_draw_underwave): New function.
1738 (x_draw_glyph_string): Use it.
1739
0fb52f11
JB
17402012-06-16 Juanma Barranquero <lekktu@gmail.com>
1741
1742 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1743 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1744 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1745 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1746 ($(BLD)/w32select.$(O)): Update dependencies.
1747
e5560ff7
AS
17482012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1749
1750 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1751 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1752 * character.c (_fetch_multibyte_char_p): Remove.
1753 * alloc.c: Include "character.h" before "buffer.h".
1754 * bidi.c: Likewise.
1755 * buffer.c: Likewise.
1756 * bytecode.c: Likewise.
1757 * callint.c: Likewise.
1758 * callproc.c: Likewise.
1759 * casefiddle.c: Likewise.
1760 * casetab.c: Likewise.
1761 * category.c: Likewise.
1762 * cmds.c: Likewise.
1763 * coding.c: Likewise.
1764 * composite.c: Likewise.
1765 * dired.c: Likewise.
1766 * dispnew.c: Likewise.
1767 * doc.c: Likewise.
1768 * dosfns.c: Likewise.
1769 * editfns.c: Likewise.
1770 * emacs.c: Likewise.
1771 * fileio.c: Likewise.
1772 * filelock.c: Likewise.
1773 * font.c: Likewise.
1774 * fontset.c: Likewise.
1775 * fringe.c: Likewise.
1776 * indent.c: Likewise.
1777 * insdel.c: Likewise.
1778 * intervals.c: Likewise.
1779 * keyboard.c: Likewise.
1780 * keymap.c: Likewise.
1781 * lread.c: Likewise.
1782 * macros.c: Likewise.
1783 * marker.c: Likewise.
1784 * minibuf.c: Likewise.
1785 * nsfns.m: Likewise.
1786 * nsmenu.m: Likewise.
1787 * print.c: Likewise.
1788 * process.c: Likewise.
1789 * regex.c: Likewise.
1790 * region-cache.c: Likewise.
1791 * search.c: Likewise.
1792 * syntax.c: Likewise.
1793 * term.c: Likewise.
1794 * textprop.c: Likewise.
1795 * undo.c: Likewise.
1796 * unexsol.c: Likewise.
1797 * w16select.c: Likewise.
1798 * w32fns.c: Likewise.
1799 * w32menu.c: Likewise.
1800 * window.c: Likewise.
1801 * xdisp.c: Likewise.
1802 * xfns.c: Likewise.
1803 * xmenu.c: Likewise.
1804 * xml.c: Likewise.
1805 * xselect.c: Likewise.
1806
2f07e6af
EZ
18072012-06-16 Eli Zaretskii <eliz@gnu.org>
1808
1053a871
SM
1809 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1810 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 1811 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
1812 row.
1813 (handle_face_prop): Use chunk-relative overlay string index when
1814 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
1815 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1816 the rightmost. (Bug#11720)
2f07e6af 1817
29b83cec
AS
18182012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1819
1820 * category.h (CHAR_HAS_CATEGORY): Define as inline.
1821 (CATEGORY_MEMBER): Enforce 1/0 value.
1822 * category.c (_temp_category_set): Remove.
1823
4c5501e9
EZ
18242012-06-16 Eli Zaretskii <eliz@gnu.org>
1825
1826 * window.c (Fdelete_other_windows_internal)
1827 (Fdelete_window_internal): Don't access frame's mouse highlight
1828 info of the initial frame. (Bug#11677)
1829
2b570124
PE
18302012-06-14 Paul Eggert <eggert@cs.ucla.edu>
1831
e93864f9
PE
1832 * .gdbinit (xgetint): Fix recently-introduced paren typo.
1833 Assume USE_2_TAGS_FOR_INTS.
1834 (xreload): Adjust $tagmask width to match recent lisp.h change.
1835
2b570124
PE
1836 Simplify lisp.h in minor ways that should not affect code.
1837 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1838 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1839 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1840 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1841 (INTTYPEBITS): New macro, for clarity.
1842 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
1843 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1844 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
1845 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1846 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1847
81755f69
JB
18482012-06-13 Juanma Barranquero <lekktu@gmail.com>
1849
1850 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1851
16192a57
GM
18522012-06-13 Glenn Morris <rgm@gnu.org>
1853
1854 * s/bsd-common.h (BSD4_3):
1855 * s/usg5-4-common.h (USG5_4): No longer define; unused.
1856
646b5f55
AS
18572012-06-13 Andreas Schwab <schwab@linux-m68k.org>
1858
1859 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1860 instead of union.
1861 (XLI, XIL): Define.
1053a871
SM
1862 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1863 Use them.
1864 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 1865 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 1866 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
1867 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1868 * frame.c (delete_frame): Remove outdated comment.
1869 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1870 USE_LISP_UNION_TYPE.
1871 (Fw32_unregister_hot_key): Likewise.
1872 (Fw32_toggle_lock_key): Likewise.
1873 * w32menu.c (add_menu_item): Likewise.
1874 (w32_menu_display_help): Use XIL instead of checking
1875 USE_LISP_UNION_TYPE.
1876 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1877 (init_heap): Likewise.
1878 * w32term.c (w32_read_socket): Update comment.
1879
1d3823c9
GM
18802012-06-13 Glenn Morris <rgm@gnu.org>
1881
c62ff706
GM
1882 * s/usg5-4-common.h, src/s/unixware.h:
1883 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1884
1d3823c9
GM
1885 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1886
bfe3e0a2
PE
18872012-06-13 Paul Eggert <eggert@cs.ucla.edu>
1888
1889 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1890 * alloc.c (make_number) [!defined make_number]:
1891 Remove, as lisp.h always defines this now.
1892 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1893 (roundup_size): Verify that it is a power of 2.
1894 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
1895 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
1896 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
1897 -DUSE_LSB_TAG=0, to override the automatically-selected default.
1898 USE_LSB_TAG now is always defined to be either 0 or 1.
1899 All uses changed.
1900 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
1901 code works fine either way, and efficiency is not a concern here,
1902 as the union type is for debugging, not for production.
1903 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
1904 Use an inline function on all platforms when using the union type,
1905 since this is simpler and 'static inline' can be used portably
1906 within Emacs now.
1907 (LISP_INITIALLY_ZERO): New macro.
1908 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
1909 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
1910
45fa9c0f
GM
19112012-06-12 Glenn Morris <rgm@gnu.org>
1912
b4492cba
GM
1913 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
1914
1915 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 1916
45fa9c0f
GM
1917 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
1918 Move BROKEN_SIGIO to configure.
1919
1920 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
1921 Move NO_TERMIO to configure.
1922
0e25d334
CY
19232012-06-12 Chong Yidong <cyd@gnu.org>
1924
1925 * image.c (imagemagick_load_image): Use MagickFlattenImage if
1926 MagickMergeImageLayers is undefined. Use pixel pusher loop if
1927 MagickExportImagePixels is undefined.
1928
43682bb6
PE
19292012-06-12 Paul Eggert <eggert@cs.ucla.edu>
1930
1931 * image.c (imagemagick_load_image): Remove unused label.
1932
a9be7d2b
GM
19332012-06-11 Glenn Morris <rgm@gnu.org>
1934
1935 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1936 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
1937 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
1938 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
1939
3017f87f
SM
19402012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
1941
1942 * alloc.c (make_byte_code): New function.
1943 (Fmake_byte_code): Use it. Don't purify here.
1944 * lread.c (read1): Use it as well to avoid extra allocation.
1945
1b9b4cf4
CY
19462012-06-11 Chong Yidong <cyd@gnu.org>
1947
1948 * image.c (imagemagick_load_image): Implement transparency.
1949
95988fcf
AS
19502012-06-10 Andreas Schwab <schwab@linux-m68k.org>
1951
1952 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
1953 account for preceding backslashes. (Bug#11663)
1954
cd4eb164
CY
19552012-06-09 Chong Yidong <cyd@gnu.org>
1956
1957 * term.c: Support italics in capable terminals (Bug#9652).
1958 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
1959 (turn_on_face): Output using TS_enter_italic_mode if available.
1960 Don't handle unused blinking and alt-charset cases.
1961 (turn_off_face): Handle italic case; discard unused tty_blinking_p
1962 and tty_alt_charset_p cases.
1963 (tty_capable_p, init_tty): Support italics.
1964
1965 * termchar.h (struct tty_display_info): Add field for italics.
1966 Remove unused blink field.
1967
1968 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
1969 Handle slant.
1970
1971 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
1972 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
1973 tty_alt_charset_p. Add tty_italic_p.
1974
ff88beb8
MA
19752012-06-09 Michael Albinus <michael.albinus@gmx.de>
1976
1977 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
1978 dbus_type_is_basic if available.
1979 (xd_extract_signed, xd_extract_unsigned): Rename from
1980 extract_signed and extract_unsigned, respectively. Adapt callers.
1981
44286096
CY
19822012-06-09 Chong Yidong <cyd@gnu.org>
1983
1682701f
CY
1984 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
1985
44286096
CY
1986 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
1987 case (Bug#9752).
1988
d86feb17
PE
19892012-06-08 Paul Eggert <eggert@cs.ucla.edu>
1990
1991 * xdisp.c (vmessage): Treat frame message as multibyte.
1992 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
1993 would generate the diagnostic "Making \302\247 buffer-local while
1994 let-bound!".
1995
d5c20fe8
EZ
19962012-06-08 Eli Zaretskii <eliz@gnu.org>
1997
1998 * dispnew.c (showing_window_margins_p): Undo last change, which
1999 was done due to an inadvertent commit.
2000 (adjust_frame_glyphs_for_frame_redisplay): Do call
2001 showing_window_margins_p.
2002
513749ee
SM
20032012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2004
2005 * eval.c (Fmake_var_non_special): New primitive.
2006 (syms_of_eval): Defsubr it.
2007 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2008
d4a8f5c1
JB
20092012-06-08 Juanma Barranquero <lekktu@gmail.com>
2010
2011 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2012 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2013
8bbbc977
EZ
20142012-06-08 Eli Zaretskii <eliz@gnu.org>
2015
2016 * alloc.c (allocate_vectorlike): Fix last change.
2017
f3372c87
DA
20182012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2019
2020 Block-based vector allocation of small vectors.
2021 * lisp.h (struct vectorlike_header): New field `nbytes',
2022 adjust comment accordingly.
2023 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2024 to denote vector blocks. Adjust users (live_vector_p,
2025 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2026 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2027 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2028 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2029 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2030 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2031 (roundup_size): New constant.
2032 (struct vector_block): New data type.
2033 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2034 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2035 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2036 (sweep_vectors): New functions.
2037 (allocate_vectorlike): Return `zero_vector' as the only vector of
2038 0 items. Allocate new vector from block if vector size is less than
2039 or equal to VBLOCK_BYTES_MAX.
2040 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2041 (init_alloc_once): Add call to init_vectors.
2042
4f18a4ed
SM
20432012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2044
2045 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2046
86f158bc
PE
20472012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2048
2049 * doprnt.c (doprnt): Truncate multibyte char correctly.
2050 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2051 would mishandle a string argument "Xc" if X was a multibyte
2052 character of length 2: it would truncate after X's first byte
2053 rather than including all of X.
2054
c5cfcbe0
CY
20552012-06-06 Chong Yidong <cyd@gnu.org>
2056
2057 * buffer.c (word_wrap): Doc fix.
2058
c05cf390
PE
20592012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2060
2061 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2062
0c3461de
GM
20632012-06-03 Glenn Morris <rgm@gnu.org>
2064
2065 * xdisp.c (tool-bar-style): Doc fix.
2066
c71232db
UM
20672012-06-03 Ulrich Müller <ulm@gentoo.org>
2068
2069 * Makefile.in (PAXCTL): Define.
2070 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2071 binary via PaX flags if the paxctl utility is available.
2072 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2073 Restore PaX flags to their default. (Bug#11398)
2074
383f7350
CY
20752012-06-03 Chong Yidong <cyd@gnu.org>
2076
2077 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2078 buffer (Bug#11226).
2079
5f2c76c6
CY
20802012-06-03 Chong Yidong <cyd@gnu.org>
2081
2082 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2083 (note_mode_line_or_margin_highlight): If there is no help echo,
2084 use mode-line-default-help-echo. Handle the case where the mouse
2085 position is past the end of the mode line string.
2086
2087 * buffer.c (buffer_local_value_1): New function, split from
2088 Fbuffer_local_value; can return Qunbound.
2089 (Fbuffer_local_value): Use it.
2090 (Vmode_line_format): Docstring tweaks.
2091
773d47f6
PE
20922012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2093
2094 * sysdep.c (system_process_attributes): Improve comment.
2095
f2d6a3df
SM
20962012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2097
2098 * keyboard.c: Export real-this-command to Elisp.
2099 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2100 and DEFVAR it. Update all users.
2101
63810350
PE
21022012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2103
7bd5c1f4
PE
2104 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2105
63810350
PE
2106 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2107 Convert pctcpu and pctmem to Lisp float properly.
2108 Let the compiler fold better, as 100.0/0x8000 is exact.
2109
a2821611
AS
21102012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2111
2112 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2113 cons_block.
2114
5fceba1d
PE
21152012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2116
2117 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2118
c98ff5dd
DA
21192012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 For a 'struct window', replace some Lisp_Object fields to
2122 bitfields where appropriate, remove unused fields.
2123 * window.h (struct window): Remove unused 'last_mark_x' and
2124 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2125 change it's type from Lisp_Object to bitfield.
2126 Change type of 'force_start', 'optional_new_start',
2127 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2128 fields from Lisp_Object to bitfield. Adjust users accordingly.
2129
ca34e0be
PE
21302012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2131
2132 Pacify gcc -Wdouble-precision when using Xaw.
2133 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2134 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2135 Use 'float' consistently, rather than 'float' in most places
2136 and 'double' in a couple of places.
2137
efc00ab1 21382012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2139
2140 * xdisp.c (handle_stop): Detect whether we have overlay strings
2141 loaded by testing it->current.overlay_string_index to be
2142 non-negative, instead of checking whether n_overlay_strings is
2143 positive. (Bug#11587)
2144
efc00ab1 21452012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2146
2147 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2148
2149 * doc.c (Fsubstitute_command_keys): Doc fix.
2150
efc00ab1 21512012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2152
2153 * search.c (search_buffer): Remove calls to
2154 r_alloc_inhibit_buffer_relocation, as it is now called by
2155 maybe_unify_char, which was the cause of relocation of buffer text
2156 in bug#11519.
2157
efc00ab1 21582012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2159
2160 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2161 for the duration of call to load_charset, to avoid problems with
2162 callers of maybe_unify_char that access buffer text through C
2163 pointers.
2164
2165 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2166 decrement the inhibition flag, instead of just setting or
2167 resetting it.
2168
ba93a187
PE
21692012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2170
2171 Remove obsolete '#define static' cruft.
2172 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2173 This #undef was "temporary" in 2000; it is no longer needed
2174 now that '#define static' has gone away.
2175 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2176 (gray_bitmap_bits): Remove; no longer needed.
2177 All uses replaced with definiens.
2178 * xterm.c: Include "bitmaps/gray.xbm".
2179
9e4bf381
PE
21802012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2181
2182 Clean up __executable_start, monstartup when --enable-profiling.
2183 The following changes affect the code only when profiling.
2184 * dispnew.c (__executable_start): Rename from safe_bcopy.
2185 Define only on platforms that need it.
2186 * emacs.c: Include <sys/gmon.h> when profiling.
2187 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2188 (__executable_start): Remove decl, since lisp.h does it now.
2189 (safe_bcopy): Remove decl; no longer has that name.
2190 (main): Coalesce #if into single bit of code, for simplicity.
2191 Cast pointers to uintptr_t, since standard libraries want integers
2192 and not pointers.
2193 * lisp.h (__executable_start): New decl.
2194
32d72c2f
GM
21952012-05-31 Glenn Morris <rgm@gnu.org>
2196
2197 * image.c (Fimagemagick_types): Doc fix.
2198
baac5bc7
JM
21992012-05-30 Jim Meyering <meyering@redhat.com>
2200
2201 * callproc.c (Fcall_process_region): Include directory component
2202 in mkstemp error message (Bug#11586).
2203
72cb32cf
PE
22042012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2205
2206 * alloc.c, lisp.h (make_pure_vector): Now static.
2207
61b108cc
SM
22082012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2209
2210 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2211 Move to byte-run.el.
2212 (Fautoload): Do the hash-doc more carefully.
2213 * data.c (Fdefalias): Purify definition, except for keymaps.
2214 (Qdefun): Move from eval.c.
2215 * lisp.h (Qdefun): Remove.
2216 * lread.c (read1): Tiny simplification.
2217
471fe23d
TN
22182012-05-29 Troels Nielsen <bn.troels@gmail.com>
2219
934f3f58 2220 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2221 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2222 Bug#9642, but explicitly check that the buffer the overlay would
2223 be moved to is live and rearrange lines to make sure that errors
2224 will not put the overlay in an inconsistent state.
2225 (Fdelete_overlay): Cosmetics.
2226
85d0efd1
EZ
22272012-05-28 Eli Zaretskii <eliz@gnu.org>
2228
2229 * w32term.c (my_bring_window_to_top): New function.
2230 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2231 could be different from the original one.
2232 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2233 (Bug#11513)
2234
2235 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2236 by calling BringWindowToTop.
2237
2238 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2239 (WM_EMACS_END): Increase by one.
2240
da92a98c
PE
22412012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2242
2243 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2244 This avoids undefined behavior that might cause the eassert
2245 to not catch an out-of-range value.
2246
74d1f848
JB
22472012-05-28 Juanma Barranquero <lekktu@gmail.com>
2248
2249 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2250 Update dependencies.
2251
9e1a06fc
EZ
22522012-05-27 Eli Zaretskii <eliz@gnu.org>
2253
2254 * bidi.c (bidi_mirror_char): Fix last change.
2255
f3dd7312
AS
22562012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2257
2258 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2259 when referring to sectname field in printf format.
2260
81899c91
PE
22612012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2262
57b81a9f
PE
2263 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2264 Only r_alloc_inhibit_buffer_relocation needed to be added;
2265 the others were already declared.
2266
81899c91
PE
2267 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2268 before checking whether it's out of range. Put the check inside
2269 eassert. See
2270 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2271
33017faf 22722012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2273
2274 * callproc.c (Fcall_process): Restore a line that was accidentally
2275 commented out in the 2011-02-13 change (bug#11547).
2276
33017faf 22772012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2278
2279 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2280 defined on ralloc.c.
2281
2282 * buffer.c [REL_ALLOC]: Remove prototypes of
2283 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2284 they are now on lisp.h.
2285
2286 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2287
2288 * search.c (search_buffer): Use it to inhibit relocation of buffer
2289 text while re_search_2 is doing its job, because re_search_2 is
2290 passed C pointers to buffer text. (Bug#11519)
2291
23415acf
EZ
2292 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2293 Update value to 24.
2294
44e27368
EZ
2295 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2296 state after an additional call to move_it_in_display_line_to, keep
2297 the values of it->max_ascent and it->max_descent found for the
2298 entire line.
2299 (pos_visible_p): Revert the comparison against bottom_y to what it
2300 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2301 (Bug#11464)
2302
c1892f11
PE
23032012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2304
2305 Fix coding-related core dumps with gcc -ftrapv.
2306 The code was computing A - B, where A and B are pointers, and B is
2307 random garbage. This can lead to core dumps on platforms that
2308 have special pointer registers, and it also leads to core dumps on
2309 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2310 A - B only when B is initialized properly.
2311 * coding.c (coding_set_source, coding_set_destination): Return void.
2312 (coding_change_source, coding_change_destinations): New functions,
2313 with the old behaviors of coding_set_source and coding_set_destination.
2314 All callers that need an offset changed to use these new functions.
2315
eb7afdad
GM
23162012-05-26 Glenn Morris <rgm@gnu.org>
2317
2318 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2319
f12fdf02
EZ
23202012-05-26 Eli Zaretskii <eliz@gnu.org>
2321
53a63be6 2322 Extend mouse support on W32 text-mode console.
61b108cc
SM
2323 * xdisp.c (draw_row_with_mouse_face):
2324 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2325
eb3f6f01 2326 * w32console.c: Include window.h.
61b108cc
SM
2327 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2328 New functions.
eb3f6f01
EZ
2329 (initialize_w32_display): Initialize mouse-highlight data.
2330
53a63be6
EZ
2331 * w32inevt.c: Include termchar.h and window.h.
2332 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2333 moves, call note_mouse_highlight. If help_echo changed, call
2334 gen_help_event to produce help-echo message in the echo area.
2335 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2336 highlight info.
2337
4cfd81f6
PE
23382012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2339
2340 * lread.c (read1): Simplify slightly to avoid an overflow warning
2341 with GCC 4.7.0 on x86-64.
2342
4446092a
EZ
23432012-05-26 Eli Zaretskii <eliz@gnu.org>
2344
2345 * bidi.c (bidi_mirror_char): Revert last change: an int is
2346 definitely wide enough here.
2347
42b2a986 23482012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2349
42b2a986 2350 Fix integer width and related bugs (Bug#9874).
eb106a49 2351 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2352 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2353 (string_bytes, check_sblock, allocate_string_data):
2354 (compact_small_strings, Fmake_bool_vector, make_string)
2355 (make_unibyte_string, make_multibyte_string)
2356 (make_string_from_bytes, make_specified_string)
2357 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2358 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2359 (mark_vectorlike):
2360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2361 (allocate_pseudovector):
2362 Use int, not EMACS_INT, where int is wide enough.
2363 (inhibit_garbage_collection, Fgarbage_collect):
2364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2365 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2366 int might not be wide enough.
2367 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2368 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2369 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2370 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2371 (bidi_level_of_next_char, bidi_move_to_visually_next):
2372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2373 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2374 (Fkill_buffer, Fset_buffer_major_mode)
2375 (advance_to_char_boundary, Fbuffer_swap_text)
2376 (Fset_buffer_multibyte, overlays_at, overlays_in)
2377 (overlay_touches_p, struct sortvec, record_overlay_string)
2378 (overlay_strings, recenter_overlay_lists)
2379 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2380 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2381 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2382 (Foverlay_recenter, last_overlay_modification_hooks_used)
2383 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2385 (validate_region): Omit unnecessary test for b <= e,
2386 since that's guaranteed by the previous test.
d311d28c
PE
2387 (adjust_overlays_for_delete): Avoid pos + length overflow.
2388 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2389 (report_overlay_modification):
2390 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2391 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2392 Omit pointer cast, which isn't needed anyway, and doesn't work
2393 after the EMACS_INT -> ptrdiff_t change.
02481186 2394 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2395 * buffer.h: Adjust decls to match defn changes elsewhere.
2396 (struct buffer_text, struct buffer):
2397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2398 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2399 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2400 not int, to avoid needless 32-bit limit on 64-bit hosts.
2401 (exec_byte_code): Use tighter memory-full test, one that checks
2402 for alloca overflow. Don't compute the address of the object just
2403 before an array, as that's not portable. Use EMACS_INT, not
2404 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2405 * callint.c (Fcall_interactively):
2406 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2407 * callproc.c (call_process_kill, Fcall_process):
2408 Don't assume pid_t fits into an Emacs fixnum.
2409 (call_process_cleanup, Fcall_process, child_setup):
2410 Don't assume pid_t fits into int.
2411 (call_process_cleanup, Fcall_process, delete_temp_file)
2412 (Fcall_process_region):
2413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2414 (Fcall_process): Simplify handling of volatile integers.
2415 Use int, not EMACS_INT, where int will do.
2416 * casefiddle.c (casify_object, casify_region, operate_on_word)
2417 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2418 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2419 (casify_object): Avoid integer overflow when overallocating buffer.
2420 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2421 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2422 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2423 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2424 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2425 integers are now checked earlier. All uses replaced with XINT.
2426 (ccl_driver):
2427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2428 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2429 (ccl_driver, Fregister_code_conversion_map):
2430 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2431 (resolve_symbol_ccl_program): Check that vector header is in range.
2432 Always copy the vector, so that we can check its contents reliably
2433 now rather than having to recheck each instruction as it's being
2434 executed. Check that vector words fit in 'int'.
2435 (ccl_get_compiled_code, Fregister_ccl_program)
2436 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2437 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2438 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2439 contents are in range.
2440 (Fccl_execute_on_string): Check that status is in range.
2441 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2442 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2443 Accept and return EMACS_INT, not int, because callers can pass values
2444 out of 'int' range.
2445 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2446 (multibyte_chars_in_text, parse_str_as_multibyte)
2447 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2448 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2449 (string_escape_byte8, Fget_byte):
2450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2451 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2452 avoid mishandling large integers.
2453 * character.h: Adjust decls to match defn changes elsewhere.
2454 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2455 (Ffind_charset_region):
2456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2457 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2458 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2459 Don't assume fixnum fits in int.
d311d28c
PE
2460 (load_charset_map_from_vector, Fmap_charset_chars):
2461 Remove now-unnecessary CHECK_NATNUMs.
2462 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2463 Don't rely on undefined behavior with signed left shift overflow.
2464 Don't assume unsigned int fits into fixnum, or that fixnum fits
2465 into unsigned int. Don't require max_code to be a valid fixnum;
2466 that's not true for gb10830 4-byte on a 32-bit host. Allow
2467 invalid_code to be a cons, for the same reason. Require code_offset
2468 to be a character. Avoid int overflow if max_char is close
2469 to INT_MAX.
2470 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2471 this is intended anyway and avoids some undefined behavior.
2472 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2473 INDEX_TO_CODE_POINT, as that's what it expects.
2474 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2475 * charset.h (DECODE_CHAR): Return int, not unsigned;
2476 this is what was intended anyway, and it avoids undefined behavior.
2477 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2478 integer-overflow issues.
2479 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2480 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2481 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2482 * chartab.c (Fmake_char_table, Fset_char_table_range)
2483 (uniprop_get_decoder, uniprop_get_encoder):
2484 Don't assume fixnum fits in int.
2485 * cmds.c (move_point): New function, that does the gist of
2486 Fforward_char and Fbackward_char, but does so while checking
2487 for integer overflow more accurately.
c96e5d6a 2488 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2489 (Fforward_line, Fend_of_line, internal_self_insert)
2490 (internal_self_insert):
2491 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2492 Fix a FIXME, by checking for integer overflow when calculating
2493 target_clm and actual_clm.
2494 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2495 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2496 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2497 (coding_alloc_by_making_gap, alloc_destination)
2498 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2499 (encode_coding_utf_16, detect_coding_emacs_mule)
2500 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2501 (detect_coding_iso_2022, decode_coding_iso_2022)
2502 (encode_invocation_designation, encode_designation_at_bol)
2503 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2504 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2505 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2506 (encode_coding_ccl, encode_coding_raw_text)
2507 (detect_coding_charset, decode_coding_charset)
2508 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2509 (produce_composition, produce_charset, produce_annotation)
2510 (decode_coding, handle_composition_annotation)
2511 (handle_charset_annotation, consume_chars, decode_coding_gap)
2512 (decode_coding_object, encode_coding_object, detect_coding_system)
2513 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2514 (code_convert_region, code_convert_string)
8f50130c
PE
2515 (Fdefine_coding_system_internal)
2516 (coding_set_source, coding_set_destination):
d311d28c
PE
2517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2518 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2519 (Fdefine_coding_system_internal):
2520 Don't assume fixnums fit in int.
2521 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2522 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2523 (Funencodable_char_position, Fcheck_coding_systems_region)
2524 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2525 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2526 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2527 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2528 Don't access memory outside of the args array.
d311d28c 2529 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2530 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2531 result of ENCODE_CHAR.
d311d28c
PE
2532 * coding.h: Adjust decls to match defn changes elsewhere.
2533 (struct coding_system):
2534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2535 * composite.c (get_composition_id, find_composition)
2536 (run_composition_function, update_compositions)
2537 (compose_text, composition_gstring_put_cache)
2538 (composition_gstring_p, composition_gstring_width)
2539 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2540 (composition_compute_stop_pos, composition_reseat_it)
2541 (composition_update_it, struct position_record)
2542 (find_automatic_composition, composition_adjust_point)
2543 (Fcomposition_get_gstring, Ffind_composition_internal):
2544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2545 (update_compositions):
2546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2547 * composite.h: Adjust decls to match defn changes elsewhere.
2548 (struct composition):
2549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2550 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2551 Do not attempt to compute the address of the object just before a
2552 buffer; this is not portable.
2553 (Faref, Faset):
2554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2555 (Faset): Use int, not EMACS_INT, where int is wide enough.
2556 (Fstring_to_number): Don't assume fixnums fit in int.
2557 (Frem): Don't assume arg is nonnegative.
2558 * dbusbind.c (xd_append_arg): Check for integers out of range.
2559 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2560 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2561 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2562 (xd_get_connection_references): Return ptrdiff_t, not int.
2563 All uses changed.
2564 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2565 (xd_read_message_1):
2566 Use int, not unsigned, where the dbus API uses int.
2567 (Fdbus_message_internal): Don't overflow mtype.
2568 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2569 * dired.c (directory_files_internal, file_name_completion, scmp)
2570 (file_name_completion_stat):
2571 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2572 (file_name_completion): Don't overflow matchcount.
2573 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2574 * dispextern.h: Adjust decls to match defn changes elsewhere.
2575 (struct text_pos, struct glyph, struct bidi_saved_info)
2576 (struct bidi_string_data, struct bidi_it, struct composition_it)
2577 (struct it):
2578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2579 (struct display_pos, struct composition_it, struct it):
2580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2581 * dispnew.c (increment_matrix_positions)
2582 (increment_row_positions, mode_line_string)
2583 (marginal_area_string):
2584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2585 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2586 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2587 (duration_to_sec_usec): New function, to check for overflow better.
2588 (Fsleep_for, sit_for): Use it.
2589 * doc.c (get_doc_string, store_function_docstring):
2590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2591 (get_doc_string, Fsnarf_documentation):
2592 Use int, not EMACS_INT, where int is wide enough.
2593 (get_doc_string):
2594 Use SAFE_ALLOCA, not alloca.
2595 Check for overflow when converting EMACS_INT to off_t.
2596 * doprnt.c (doprnt):
2597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2598 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2599 Don't assume uid_t fits into fixnum.
2600 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2601 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2602 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2603 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2604 (general_insert_function)
2605 (Finsert_char, make_buffer_string, make_buffer_string_both)
2606 (update_buffer_properties, Fbuffer_substring)
2607 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2608 (Fsubst_char_in_region, check_translation)
2609 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2610 (transpose_markers, Ftranspose_regions):
2611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2612 (clip_to_bounds): Move to lisp.h as an inline function).
2613 (Fconstrain_to_field): Don't assume integers are nonnegative.
2614 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2615 (Fsubst_char_in_region, Fsave_restriction):
2616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2617 (Femacs_pid): Don't assume pid_t fits into fixnum.
2618 (lo_time): Use int, not EMACS_INT, when int suffices.
2619 (lisp_time_argument): Check for usec out of range.
2620 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
2621 (Fuser_login_name, Fuser_full_name): Signal an error
2622 if a uid argument is out of range, rather than relying on
2623 undefined behavior.
c8d5c857
PE
2624 (Fformat_time_string): Remove now-unnecessary check.
2625 lisp_time_argument checks for out-of-range usec now.
243e0530 2626 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
2627 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2628 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2629 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2630 (init_cmdargs, Fdump_emacs):
2631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2632 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2633 the bottom (typically) 32 bits of the fixnum.
2634 * eval.c (specpdl_size, call_debugger):
2635 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2636 (when_entered_debugger, Fbacktrace_debug):
2637 Don't assume fixnum can fit in int.
2638 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2639 the object just before a buffer; this is not portable.
2640 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2641 (grow_specpdl, unbind_to):
2642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2643 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2644 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 2645 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
2646 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2647 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2649 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2650 (a_write, e_write):
2651 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2652 (Fcopy_file, non_regular_nbytes, read_non_regular)
2653 (Finsert_file_contents):
2654 Use int, not EMACS_INT, where int is wide enough.
2655 (READ_BUF_SIZE): Verify that it fits in int.
2656 (Finsert_file_contents): Check that counts are in proper range,
2657 rather than assuming fixnums fit into ptrdiff_t etc.
2658 Don't assume fixnums fit into int.
125b3835 2659 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
2660 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2661 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
2662 (string_char_to_byte, string_byte_to_char)
2663 (string_make_multibyte, string_to_multibyte)
2664 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2665 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2666 (substring_both, Fdelete, internal_equal, Ffillarray)
2667 (Fclear_string, mapcar1)
2668 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2669 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2670 (larger_vector, make_hash_table, maybe_resize_hash_table)
2671 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2672 (Fmaphash, secure_hash):
2673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2674 (concat): Check for string index and length overflow.
2675 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2676 (Frequire):
2677 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2678 (larger_vector): New API (vec, incr_min, size_max) replaces old
2679 one (vec, new_size, init). This catches size overflow.
2680 INIT was removed because it was always Qnil.
2681 All callers changed.
2682 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2683 the upper bound on a hash table index size.
2684 (make_hash_table, maybe_resize_hash_table): Use it.
2685 (secure_hash): Computer start_byte and end_byte only after
2686 they're known to be in ptrdiff_t range.
2687 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2688 (Ffont_get_glyphs, Ffont_at):
2689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2690 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2691 (Flist_fonts, Fopen_font):
2692 Don't assume fixnum can fit in int.
2693 (check_gstring): Don't assume index can fit in int.
2694 (font_match_p): Check that fixnum is a character, not a nonnegative
2695 fixnum, since the later code needs to stuff it into an int.
2696 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2697 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2698 conversion overflow issues.
2699 (Fopen_font): Check for integer out of range.
2700 (Ffont_get_glyphs): Don't assume index can fit in int.
2701 * font.h: Adjust decls to match defn changes elsewhere.
2702 * fontset.c (reorder_font_vector): Redo score calculation to avoid
2703 integer overflow.
2704 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2705 printmax_t, where ptrdiff_t is wide enough.
2706 (Finternal_char_font):
2707 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2708 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2709 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2710 (Fset_frame_position, x_set_frame_parameters)
2711 (x_set_line_spacing, x_set_border_width)
2712 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2713 Check that fixnums are in proper range for system types.
2714 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2716 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2717 Use SAFE_ALLOCA_LISP, not alloca.
2718 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2719 intptr_t is wide enough.
2720 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2721 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2722 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2723 Check for fixnum out of range.
2724 * ftfont.c (ftfont_list): Don't assume index fits in int.
2725 Check that fixnums are in proper range for system types.
2726 (ftfont_shape_by_flt):
2727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
2728 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2730 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2731 Check that fixnums are in proper range for system types.
2732 * gnutls.h: Adjust decls to match defn changes elsewhere.
2733 * gtkutil.c (xg_dialog_run):
2734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2735 (update_frame_tool_bar):
2736 Check that fixnums are in proper range for system types.
2737 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 2738 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
2739 * indent.c (last_known_column, last_known_column_point):
2740 (current_column_bol_cache):
2741 (skip_invisible, current_column, check_display_width):
2742 (check_display_width, scan_for_column, current_column_1)
2743 (Findent_to, Fcurrent_indentation, position_indentation)
2744 (indented_beyond_p, Fmove_to_column, compute_motion):
2745 (Fcompute_motion, Fvertical_motion):
2746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2747 (last_known_column_modified): Use EMACS_INT, not int.
2748 (check_display_width):
2749 (Fcompute_motion):
2750 Check that fixnums and floats are in proper range for system types.
2751 (compute_motion): Don't assume index or fixnum fits in int.
2752 (compute_motion, Fcompute_motion):
2753 Use int, not EMACS_INT, when it is wide enough.
2754 (vmotion): Omit local var start_hpos that is always 0; that way
2755 we don't need to worry about overflow in expressions involving it.
2756 * indent.h: Adjust decls to match defn changes elsewhere.
2757 (struct position):
2758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2759 Use int, not EMACS_INT, where int is wide enough.
2760 Remove unused members ovstring_chars_done and tab_offset;
2761 all uses removed.
2762 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2763 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2764 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2765 (make_gap, copy_text, insert, insert_and_inherit)
2766 (insert_before_markers, insert_before_markers_and_inherit)
2767 (insert_1, count_combining_before, count_combining_after)
2768 (insert_1_both, insert_from_string)
2769 (insert_from_string_before_markers, insert_from_string_1)
2770 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2771 (adjust_after_replace, adjust_after_insert, replace_range)
2772 (replace_range_2, del_range, del_range_1, del_range_byte)
2773 (del_range_both, del_range_2, modify_region)
2774 (prepare_to_modify_buffer, signal_before_change)
2775 (signal_after_change, Fcombine_after_change_execute):
2776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2777 * intervals.c (traverse_intervals, rotate_right, rotate_left)
2778 (balance_an_interval, split_interval_right, split_interval_left)
2779 (find_interval, next_interval, update_interval)
2780 (adjust_intervals_for_insertion, delete_node, delete_interval)
2781 (interval_deletion_adjustment, adjust_intervals_for_deletion)
2782 (static_offset_intervals, offset_intervals)
2783 (merge_interval_right, merge_interval_left, make_new_interval)
2784 (graft_intervals_into_buffer, temp_set_point_both)
2785 (temp_set_point, set_point, adjust_for_invis_intang)
2786 (set_point_both, move_if_not_intangible, get_property_and_range)
2787 (get_local_map, copy_intervals, copy_intervals_to_string)
2788 (compare_string_intervals, set_intervals_multibyte_1):
2789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2790 * intervals.h: Adjust decls to match defn changes elsewhere.
2791 (struct interval):
2792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2793 * keyboard.c (this_command_key_count, this_single_command_key_start)
2794 (before_command_key_count, before_command_echo_length, echo_now)
2795 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2796 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2797 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2798 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2800 (last_non_minibuf_size, last_point_position, echo_truncate)
2801 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2802 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2803 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2804 (stuff_buffered_input):
2805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2806 (last_auto_save, command_loop_1, read_char):
2807 Use EMACS_INT, not int, to avoid integer overflow.
2808 (record_char): Avoid overflow in total_keys computation.
2809 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2810 * keyboard.h: Adjust decls to match defn changes elsewhere.
2811 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2812 (Fkey_description, Fdescribe_vector, Flookup_key):
2813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2814 (click_position): New function, to check that positions are in range.
2815 (Fcurrent_active_maps):
2816 (describe_command):
2817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2818 (Faccessible_keymaps, Fkey_description):
2819 (preferred_sequence_p):
2820 Don't assume fixnum can fit into int.
2821 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2822 Check for integer overflow in size calculations.
2823 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2824 avoid mishandling large integers.
2825 * lisp.h: Adjust decls to match defn changes elsewhere.
2826 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2827 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2828 (struct Lisp_Marker):
2829 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2830 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
2831 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2832 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2833 All callers changed.
2834 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2835 Assume the arg has valid form, since it always does.
2836 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2837 unsigned integer system type.
2838 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2839 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2841 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2842 (duration_to_sec_usec): New decl.
2843 * lread.c (read_from_string_index, read_from_string_index_byte)
2844 (read_from_string_limit, readchar, unreadchar, openp)
2845 (read_internal_start, read1, oblookup):
2846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2847 (Fload, readevalloop, Feval_buffer, Feval_region):
2848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2849 (openp): Check for out-of-range argument to 'access'.
2850 (read1): Use int, not EMACS_INT, where int is wide enough.
2851 Don't assume fixnum fits into int.
6efdadfd 2852 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
2853 (read_filtered_event): Use duration_to_sec_usec
2854 to do proper overflow checking on durations.
d311d28c
PE
2855 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2856 in size calculation.
2857 (Fexecute_kbd_macro):
2858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2859 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2860 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2861 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2862 (set_marker_both, set_marker_restricted_both, marker_position)
2863 (marker_byte_position, Fbuffer_has_markers_at):
2864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2865 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 2866 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
2867 It now merely ensures that the menu is large enough, without
2868 necessarily growing it, as this avoids some integer overflow issues.
2869 All callers changed.
2870 (keymap_panes, parse_single_submenu, Fx_popup_menu):
2871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2872 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2873 Use SAFE_ALLOCA_LISP, not alloca.
2874 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2875 to EMACS_INT. Check that fixnums are in proper range for system types.
2876 * minibuf.c (minibuf_prompt_width, string_to_object)
2877 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2878 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2880 (get_minibuffer, read_minibuf_unwind):
2881 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2882 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2883 this simplifies overflow checking. All callers changed.
2884 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2885 (Ftest_completion):
2886 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2887 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2888 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2889 Check that fixnums are in proper range for system types.
2890 (Fx_create_frame, Fx_show_tip):
2891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2892 * nsfont.m (ns_findfonts, nsfont_list_family):
2893 Don't assume fixnum fits in long.
2894 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
2895 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2896 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
2897 wide enough.
17fdb222 2898 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
2899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2900 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
2901 (PRINTDECLARE, PRINTPREPARE):
2902 (strout, print_string):
2903 (print, print_preprocess, print_check_string_charset_prop)
2904 (print_object):
2905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2906 (PRINTDECLARE):
2907 (temp_output_buffer_setup, Fprin1_to_string, print_object):
2908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2909 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 2910 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 2911 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
2912 (print_error_message): Use SAFE_ALLOCA, not alloca.
2913 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
2914 (print_depth, new_backquote_output, print_number_index):
2915 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
2916 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
2917 (Fset_process_window_size, Fformat_network_address)
2918 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 2919 (sigchld_handler):
d311d28c 2920 Check that fixnums are in proper range for system types.
d44287d4 2921 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
2922 Check for process-ids out of pid_t range rather than relying on
2923 undefined behavior.
e4d81efc 2924 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
2925 (Fformat_network_address, read_process_output, send_process)
2926 (Fprocess_send_region, status_notify):
2927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2928 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
2929 (wait_reading_process_output, read_process_output, exec_sentinel):
2930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2931 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
2932 (Faccept_process_output): Use duration_to_sec_usec to do proper
2933 overflow checking on durations.
dde14581
PE
2934 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
2935 Don't assume pid_t fits in int.
02481186
PE
2936 * process.h (struct Lisp_Process): Members tick and update_tick
2937 are now of type EMACS_INT, not int.
b62b53e8
PE
2938 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
2939 configured --with-wide-int.
d311d28c
PE
2940 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
2941 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
2942 * search.c (looking_at_1, string_match_1):
2943 (fast_string_match, fast_c_string_match_ignore_case)
2944 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
2945 (scan_newline, find_before_next_newline, search_command)
2946 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
2947 (set_search_regs, wordify):
2948 (Freplace_match):
2949 (Fmatch_data):
2950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2951 (string_match_1, search_buffer, set_search_regs):
2952 (Fmatch_data):
2953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2954 (wordify): Check for overflow in size calculation.
2955 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
2956 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
2957 Check that fixnums are in proper range for system types.
2958 * sound.c (struct sound_device)
2959 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
2960 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2961 (Fplay_sound_internal):
2962 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 2963 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
2964 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
2965 (Fparse_partial_sexp):
2966 Don't assume fixnums can fit in int.
2967 (struct lisp_parse_state, find_start_pos, find_start_value)
2968 (find_start_value_byte, find_start_begv)
2969 (update_syntax_table, char_quoted, dec_bytepos)
2970 (find_defun_start, prev_char_comend_first, back_comment):
2971 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
2972 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
2973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2974 (Finternal_describe_syntax_value): Check that match_lisp is a
2975 character, not an integer, since the code stuffs it into int.
2976 (scan_words, scan_sexps_forward):
2977 Check that fixnums are in proper range for system types.
2978 (Fforward_word):
2979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2980 (scan_sexps_forward):
2981 Use CHARACTERP, not INTEGERP, since the value must fit into int.
2982 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
2983 * syntax.h: Adjust decls to match defn changes elsewhere.
2984 (struct gl_state_s):
2985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
2986 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
2987 MOST_POSITIVE_FIXNUM.
d311d28c
PE
2988 * sysdep.c (wait_for_termination_1, wait_for_termination)
2989 (interruptible_wait_for_termination, mkdir):
2990 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
2991 (emacs_read, emacs_write):
2992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
2993 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
2994 and double all fit in int.
d311d28c
PE
2995 * term.c (set_tty_color_mode):
2996 Check that fixnums are in proper range for system types.
2997 * termhooks.h (struct input_event):
2998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2999 * textprop.c (validate_interval_range, interval_of)
3000 (Fadd_text_properties, set_text_properties_1)
3001 (Fremove_text_properties, Fremove_list_of_text_properties)
3002 (Ftext_property_any, Ftext_property_not_all)
3003 (copy_text_properties, text_property_list, extend_property_ranges)
3004 (verify_interval_modification):
3005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3006 (Fnext_single_char_property_change)
3007 (Fprevious_single_char_property_change):
3008 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3009 (copy_text_properties):
3010 Check for integer overflow in index calculation.
d311d28c
PE
3011 * undo.c (last_boundary_position, record_point, record_insert)
3012 (record_delete, record_marker_adjustment, record_change)
3013 (record_property_change):
3014 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3015 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3016 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3017 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3018 (Fx_hide_tip, Fx_file_dialog):
3019 * w32menu.c (set_frame_menubar):
3020 Use ptrdiff_t, not int, for consistency with rest of code.
3021 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3022 (select_window, Fdelete_other_windows_internal)
3023 (window_scroll_pixel_based, window_scroll_line_based)
3024 (Frecenter, Fset_window_configuration):
3025 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3026 (Fset_window_hscroll, run_window_configuration_change_hook)
3027 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3028 (Fscroll_other_window, Frecenter):
d311d28c
PE
3029 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3030 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3031 Don't assume fixnum fits in int.
3032 (Fset_window_scroll_bars):
3033 Check that fixnums are in proper range for system types.
3034 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3035 (string_pos, c_string_pos, number_of_chars, init_iterator)
3036 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3037 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3038 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3039 (face_before_or_after_it_pos, handle_invisible_prop)
3040 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3041 (display_prop_intangible_p, string_buffer_position_lim)
3042 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3043 (get_overlay_strings_1, get_overlay_strings)
3044 (iterate_out_of_display_property, forward_to_next_line_start)
3045 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3046 (get_next_display_element, set_iterator_to_next)
3047 (get_visually_first_element, compute_stop_pos_backwards)
3048 (handle_stop_backwards, next_element_from_buffer)
3049 (move_it_in_display_line_to, move_it_in_display_line)
3050 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3051 (add_to_log, message_dolog, message_log_check_duplicate)
3052 (message2, message2_nolog, message3, message3_nolog
3053 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3054 (current_message_1, truncate_echo_area, truncate_message_1)
3055 (set_message, set_message_1, store_mode_line_noprop)
3056 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3057 (text_outside_line_unchanged_p, check_point_in_composition)
3058 (reconsider_clip_changes)
3059 (redisplay_internal, set_cursor_from_row, try_scrolling)
3060 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3061 (redisplay_window, find_last_unchanged_at_beg_row)
3062 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3063 (trailing_whitespace_p, find_row_edges, display_line)
3064 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3065 (display_mode_element, store_mode_line_string)
3066 (pint2str, pint2hrstr, decode_mode_spec)
3067 (display_count_lines, display_string, draw_glyphs)
3068 (x_produce_glyphs, x_insert_glyphs)
3069 (rows_from_pos_range, mouse_face_from_buffer_pos)
3070 (fast_find_string_pos, mouse_face_from_string_pos)
3071 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3073 (safe_call, init_from_display_pos, handle_fontified_prop)
3074 (handle_single_display_spec, load_overlay_strings)
3075 (with_echo_area_buffer, setup_echo_area_for_printing)
3076 (display_echo_area, echo_area_display)
3077 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3078 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3079 (redisplay_window, dump_glyph_row, display_mode_line)
3080 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3081 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3083 (handle_single_display_spec, build_desired_tool_bar_string)
3084 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3085 (get_specified_cursor_type):
3086 Check that fixnums are in proper range for system types.
3087 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3088 (Flookup_image_map):
3089 Don't assume fixnums fit in int.
3090 (compare_overlay_entries):
3091 Avoid mishandling comparisons due to subtraction overflow.
3092 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3093 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3094 (handle_tool_bar_click):
3095 Use int, not unsigned, since we prefer signed and the signedness
3096 doesn't matter here.
3097 (get_next_display_element, next_element_from_display_vector):
3098 Use int, not EMACS_INT, when int is wide enough.
3099 (start_hourglass): Use duration_to_sec_usec to do proper
3100 overflow checking on durations.
3101 * xfaces.c (Fbitmap_spec_p):
3102 Check that fixnums are in proper range for system types.
3103 (compare_fonts_by_sort_order):
3104 Avoid mishandling comparisons due to subtraction overflow.
3105 (Fx_family_fonts, realize_basic_faces):
3106 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3107 (Fx_family_fonts):
3108 Don't assume fixnum fits in int.
3109 Use SAFE_ALLOCA_LISP, not alloca.
3110 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3111 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3112 (face_at_buffer_position, face_for_overlay_string)
3113 (face_at_string_position):
3114 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3115 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3116 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3117 (Fx_show_tip):
3118 Check that fixnums are in proper range for system types.
3119 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3120 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3121 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3122 (Fx_change_window_property): Don't assume fixnums fit in int.
3123 * xfont.c (xfont_chars_supported):
3124 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3125 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3126 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3127 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3128 * xml.c (parse_region):
3129 * xrdb.c (magic_file_p):
3130 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3131 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3132 (x_get_local_selection, x_reply_selection_request)
3133 (x_handle_selection_request, wait_for_property_change):
3134 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3135 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3136 short is wide enough.
3137 (x_send_client_event): Don't assume fixnum fits in int.
3138 * xterm.c (x_x_to_emacs_modifiers):
3139 Don't assume EMACS_INT overflows nicely into int.
3140 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3141 may come from Lisp.
3142 (handle_one_xevent): NATNUMP can eval its arg twice.
3143 (x_connection_closed):
3144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3145 * xterm.h: Adjust decls to match defn changes elsewhere.
3146 (struct scroll_bar): Use struct vectorlike_header
3147 rather than rolling our own approximation.
3148 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3149
c6574eb5
GM
31502012-05-25 Glenn Morris <rgm@gnu.org>
3151
3152 * lisp.mk (lisp): Update for more files being compiled now.
3153
e8d32c7e
SM
31542012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3155
48def666
SM
3156 * lread.c: Remove `read_pure' which makes no difference.
3157 (read_pure): Remove var.
3158 (unreadpure): Remove function.
3159 (readevalloop): Don't call read_list with -1 flag.
3160 (read1, read_vector): Don't test read_pure any more.
3161 (read_list): Simplify.
3162
e8d32c7e
SM
3163 * fileio.c, character.h: Minor style tweaks.
3164
4b2addb7
DA
31652012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3166
3167 * window.h (clip_changed): Remove useless declaration.
3168
584461b2
JB
31692012-05-22 Juanma Barranquero <lekktu@gmail.com>
3170
3171 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3172 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3173
34374650
PE
31742012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3175
3176 Remove src/m/*.
3177 This directory predates autoconf and is no longer needed nowadays.
3178 Move its few remaining bits of functionality to where they're needed.
3179 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3180 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3181 * m/template.h: Remove.
3182 * Makefile.in (M_FILE): Remove. All uses removed.
3183 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3184 * lisp.h (USE_LSB_TAG):
3185 * mem-limits.h (EXCEEDS_LISP_PTR):
3186 Use VAL_MAX, not VALBITS, in #if.
3187 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3188 (EMACS_UINT): Define unconditionally now.
3189 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3190 (BITS_PER_EMACS_INT): New constants, replacing
3191 what used to be in config.h, but not useful in #if.
3192 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3193 define them any more.
3194 (VAL_MAX): New macro.
3195 (VALMASK): Use it.
3196 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3197 BITS_PER_EMACS_INT, in #if.
3198 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3199 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3200 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3201 * s/ms-w32.h (DATA_START):
3202 Move here from removed file m/intel386.h.
3203 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3204 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3205
261cb4bb
PE
32062012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3207
3208 Assume C89 or later.
3209 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3210 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3211 (xrealloc):
3212 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3213 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3214 * textprop.c, tparam.c (NULL): Remove.
3215 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3216 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3217 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3218 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3219 * xterm.c (input_signal_count): Assume volatile works.
3220
ff23cd9f
KB
32212012-05-21 Ken Brown <kbrown@cornell.edu>
3222
3223 * xgselect.c (xg_select): Fix first argument in call to 'select'
3224 (bug#11508).
3225
1b170bc6
KB
32262012-05-20 Ken Brown <kbrown@cornell.edu>
3227
3228 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3229 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3230
b2f4d39f
KB
32312012-05-19 Ken Brown <kbrown@cornell.edu>
3232
3233 * xfns.c (x_in_use): Remove `static' qualifier.
3234 * xterm.h (x_in_use): Declare.
3235 * xgselect.c: Include xterm.h.
3236 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3237 and `display_arg' (bug#9754).
3238
003fdae2
PE
32392012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3240
9232a6d9
PE
3241 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3242
003fdae2
PE
3243 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3244 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3245
784b56e2
EZ
32462012-05-18 Eli Zaretskii <eliz@gnu.org>
3247
3248 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3249
3250 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3251 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3252
3253 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3254 reference to image_cache->refcount.
3255 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3256
a0a79cde
JL
32572012-05-17 Juri Linkov <juri@jurta.org>
3258
3259 * search.c (Fword_search_regexp, Fword_search_backward)
3260 (Fword_search_forward, Fword_search_backward_lax)
3261 (Fword_search_forward_lax): Move functions to isearch.el
3262 (bug#10145, bug#11381).
3263
b0572523
PE
32642012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3265
3266 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3267
9660f5fc
SM
32682012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3269
3270 * lread.c (init_obarray): Declare Qt and Qnil as special.
3271
4374de83
GM
32722012-05-14 Glenn Morris <rgm@gnu.org>
3273
3274 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3275 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3276
dc44c39a
PE
32772012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3278
078c97cb
PE
3279 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3280
dc44c39a
PE
3281 * unexaix.c: Port to more-recent AIX compilers.
3282 (report_error, report_error_1, make_hdr, copy_sym)
3283 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3284 Make arguments const char *, not char *, to avoid violations of C
3285 standard and to fix some AIX warnings reported by Gilles Pion.
3286
e18afed7 32872012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3288
3289 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3290 already have overlays loaded.
3291 (handle_single_display_spec): Before returning without displaying
3292 fringe bitmap, synchronize the bidi iterator with the main display
3293 iterator, by calling iterate_out_of_display_property.
3294 (iterate_out_of_display_property): Detect buffer iteration by
3295 testing that it->string is a Lisp string.
3296 (get_next_display_element): When the current object is exhausted,
3297 and there's something on it->stack, call set_iterator_to_next to
3298 proceed with what's on the stack, instead of returning zero.
3299 (set_iterator_to_next): If called at the end of a Lisp string,
3300 proceed to consider_string_end without incrementing string
3301 position. Don't increment display vector index past the end of
3302 the display vector. (Bug#11417)
c8fb9dc6
EZ
3303 (pos_visible_p): Don't report a position visible when move_it_to
3304 stopped at the last line of window, which happens to be scanned
3305 backwards by the bidi iteration. (Bug#11464)
ac268e67 3306
e18afed7 33072012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3308
3309 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3310 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3311 are on a TTY, and thus unable to display on the fringes.
3312 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3313 so we need to signal to the caller that this is a "replacing"
3314 display spec. This fixes display when the spec is invalid or we
3315 are on a TTY.
3316
e18afed7 33172012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3318
3319 * unexaix.c (make_hdr): Fix typo in prototype.
3320 This bug broke the build on AIX. Problem reported by Gilles Pion.
3321
9d0a235a
MA
33222012-05-14 Michael Albinus <michael.albinus@gmx.de>
3323
3324 * keyboard.c (kbd_buffer_get_event): Read special events also in
3325 batch mode. (Bug#11415)
3326
9e6b06ed
GM
33272012-05-12 Glenn Morris <rgm@gnu.org>
3328
3329 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3330
c1a1d7a3
EZ
33312012-05-12 Eli Zaretskii <eliz@gnu.org>
3332
3333 * lisp.mk (lisp): Add newcomment.elc.
3334
3fe7cdc8
GM
33352012-05-12 Glenn Morris <rgm@gnu.org>
3336
3337 * Makefile.in (MKDIR_P): New, set by configure.
3338 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3339
53f7d2c0
PE
33402012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3341
3342 Remove unused function hourglass_started.
3343 * dispextern.h (hourglass_started):
3344 * w32fns.c (hourglass_started):
3345 * xdisp.c (hourglass_started): Remove.
3346
75aafb17
JB
33472012-05-10 Juanma Barranquero <lekktu@gmail.com>
3348
3349 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3350 Update dependencies.
3351
12959e8e
PE
33522012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3353
97107e2e
PE
3354 * xgselect.c (xg_select): Put maxfds+1 into a var.
3355 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3356
12959e8e
PE
3357 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3358
836d29b3
DA
33592012-05-10 Dave Abrahams <dave@boostpro.com>
3360
3361 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3362 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3363
5cb67954
MA
33642012-05-09 Michael Albinus <michael.albinus@gmx.de>
3365
3366 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3367 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3368 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3369 Initialize xd_registered_buses.
3370
3478ec45
PE
33712012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3372
b263a6b0
PE
3373 Untag more efficiently if USE_LSB_TAG.
3374 This is based on a proposal by YAMAMOTO Mitsuharu in
3375 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3376 For an admittedly artificial (nth 8000 longlist) benchmark on
3377 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3378 Emacs's overall text size by 1%.
3379 * lisp.h (XUNTAG): New macro.
3380 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3381 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3382 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3383 * eval.c (Fautoload):
3384 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3385 * frame.h (XFRAME): Use XUNTAG.
3386
3478ec45
PE
3387 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3388 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3389 Remove unportable assumptions about print widths of types like
3390 dbus_uint32_t.
3391 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3392 intptr_t when converting between pointer and integer, to avoid GCC
3393 warnings about wrong width.
3394
666b903b 33952012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3396
3397 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3398 stack for each reader_thread, instead of defaulting to 8MB
3399 determined by the linker. This avoids failures in creating
3400 subprocesses on Windows 7, see the discussion in this thread:
3401 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3402
b120cc17
JC
34032012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3404
3405 Fix up display of the *Minibuf-0* buffer in the mini window.
3406 * keyboard.c (read_char): Don't clear the echo area if there's no
3407 message to clear.
3408 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3409 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3410
9a4b36f8
MA
34112012-05-07 Michael Albinus <michael.albinus@gmx.de>
3412
3413 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3414 batch mode.
3415
e5f9458f
CY
34162012-05-06 Chong Yidong <cyd@gnu.org>
3417
3418 * lisp.mk (lisp): Update.
3419
eceeb5fc 34202012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3421
3422 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3423
71873e2b
SM
34242012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3425
3426 * data.c (PUT_ERROR): New macro.
3427 (syms_of_data): Use it. Add new error type `user-error'.
3428 * undo.c (user_error): New function.
3429 (Fprimitive_undo): Use it.
3430 * print.c (print_error_message): Adjust print style for `user-error'.
3431 * keyboard.c (user_error): New function.
3432 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3433
ab0fa4e4
PE
34342012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3435
3436 Do not limit current-time-string to years 1000..9999.
3437 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3438 (Fcurrent_time_string): Support any year that is supported by the
3439 underlying localtime representation. Don't use asctime, as it
3440 has undefined behavior for years outside the range -999..9999.
3441
7ed806a7
PE
34422012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3443
3444 Fix race conditions involving setenv, gmtime, localtime, asctime.
3445 Without this fix, interrupts could mess up code that uses these
3446 nonreentrant functions, since setting TZ invalidates existing
3447 tm_zone or tzname values, and since most of these functions return
3448 pointers to static storage.
3449 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3450 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3451 Grow the critical sections to include not just invoking
3452 localtime/gmtime, but also accessing these functions' results
3453 including their tm_zone values if any, and any related TZ setting.
3454 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3455 so that the struct tm is saved in the critical section.
3456 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3457 motivated by the fact that memory allocation needs to be outside
3458 the critical section.
3459
0c16dfed
DA
34602012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3461
3462 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3463 with RESET_INTERVAL.
3464
3465 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3466 Remove duplicated buffer name initialization.
3467
3f83ace8
JM
34682012-05-02 Jim Meyering <jim@meyering.net>
3469
3470 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3471
c7b8541e
JM
3472 * xfns.c (x_window): Use xstrdup (Bug#11375).
3473
90207a15 34742012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3475
3476 * xdisp.c (pos_visible_p): If already at a newline from the
3477 display string before the 'while' loop, don't walk back the glyphs
3478 from it3.glyph_row. Solves assertion violation when the display
3479 string begins with a newline (egg.el). (Bug#11367)
3480
b593d6a9
AH
34812012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3482
3483 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3484 Move to simple.el.
3485
4737362e
GM
34862012-05-01 Glenn Morris <rgm@gnu.org>
3487
99cf43f9
GM
3488 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3489 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3490 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3491 All were removed before 23.1.
3492
9311dcff
GM
3493 * dispnew.c: Remove HAVE_LIBNCURSES test;
3494 it is always true on relevant platforms.
3495
4d5c6349
GM
3496 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3497 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3498
4737362e
GM
3499 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3500
74dd3a6b
AS
35012012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3502
3503 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3504 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3505 Remove.
3506
13c379ee
PE
35072012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3508
3509 Do not avoid creating empty evaporating overlays (Bug#9642).
3510 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3511 That is, do not delete an evaporating overlay if it becomes
3512 empty after its bounds are adjusted to fit within its buffer.
3513 This fix caused other problems, and I'm reverting it until we get
3514 to the bottom of them.
3515
a8e7d6d7 35162012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3517
3518 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3519
a8e7d6d7 35202012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3521
3522 * xdisp.c (pos_visible_p): If the window start position is beyond
3523 ZV, start the display from buffer beginning. Prevents assertion
3524 violation in init_iterator when the minibuffer window is scrolled
3525 via the scroll bar.
3526
3527 * window.c (window_scroll_pixel_based): Likewise.
3528
a8e7d6d7 35292012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3530
3531 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3532
a8e7d6d7 35332012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3534
3535 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3536 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3537
a8e7d6d7 35382012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3539
b593d6a9
AH
3540 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3541 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3542
1c6900d9
EZ
35432012-04-26 Eli Zaretskii <eliz@gnu.org>
3544
4c3fa1d9
EZ
3545 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3546 display element, check also the underlying string or buffer
3547 character. (Bug#11341)
3548
1c6900d9
EZ
3549 * w32menu.c: Include w32heap.h.
3550 (add_menu_item): If the call to AppendMenuW (via
3551 unicode_append_menu) fails, disable Unicode menus only if we are
3552 running on Windows 9X/Me.
3553
42bf8205
AS
35542012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3555
3556 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3557 (xgetint): Add missing shift for LSB tags.
3558
b1bac16e
MR
35592012-04-24 Martin Rudalics <rudalics@gmx.at>
3560
3561 * keyboard.c (read_char): Don't wipe echo area for select window
3562 events: These might get delayed via `mouse-autoselect-window'
3563 (Bug#11304).
3564
d69621cc
JB
35652012-04-24 Juanma Barranquero <lekktu@gmail.com>
3566
3567 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3568 manipulation of :loaded-from data.
3569
02fd101b
JB
35702012-04-23 Juanma Barranquero <lekktu@gmail.com>
3571
3572 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3573 now a cons (bug#11311).
3574
888bec30
PE
35752012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3576
89a438bd
PE
3577 Do not create empty overlays with the evaporate property (Bug#9642).
3578 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3579 if it becomes empty after its bounds are adjusted to fit within
3580 its buffer. Without this fix, in a nonempty buffer (let ((o
3581 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3582 yields an empty overlay that has the evaporate property, which is
3583 not supposed to happen.
3584
1068fe4d
PE
3585 Fix minor GTK3 problems found by static checking.
3586 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3587 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3588 (struct _EmacsFixedClass, emacs_fixed_get_type):
3589 Move decls here from emacsgtkfixed.h, since they needn't be public.
3590 (emacs_fixed_get_type): Now static.
3591 (emacs_fixed_class_init): Omit unused local.
3592 (emacs_fixed_child_type): Remove; unused.
3593 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3594 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3595 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3596 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3597 (EMACS_FIXED_GET_CLASS): Remove; unused.
3598 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3599
888bec30
PE
3600 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3601 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3602
de85e130
PE
36032012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3604
d0baac98 3605 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 3606 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
3607 (__malloc_size_t, __malloc_ptrdiff_t):
3608 Remove. All uses removed, replaced by the definiens if needed,
3609 since we can assume C89 or better now.
3610 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3611 (protect_malloc_state, align, get_contiguous_space)
3612 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3613 (malloc_atfork_handler_child, malloc_enable_thread)
3614 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3615 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3616 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3617 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3618 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3619 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3620 Define using prototypes, not old style.
3621 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3622 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3623 (align): Don't assume that signed integer overflow wraps around.
3624 Omit unused local var.
3625 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3626 (_free_internal_nolock, memalign, mallochook, reallochook):
3627 Omit no-longer-needed casts.
3628 (valloc): Use getpagesize, not __getpagesize.
3629 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3630 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3631
de85e130
PE
3632 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3633
dcbf5805
MA
36342012-04-22 Michael Albinus <michael.albinus@gmx.de>
3635
3636 Move functions from C to Lisp. Make non-blocking method calls
3637 the default. Implement further D-Bus standard interfaces.
3638
3639 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3640 (QCdbus_request_name_allow_replacement)
3641 (QCdbus_request_name_replace_existing)
3642 (QCdbus_request_name_do_not_queue)
3643 (QCdbus_request_name_reply_primary_owner)
3644 (QCdbus_request_name_reply_in_queue)
3645 (QCdbus_request_name_reply_exists)
3646 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3647 (QCdbus_registered_serial, QCdbus_registered_method)
3648 (QCdbus_registered_signal): New Lisp objects.
3649 (XD_DEBUG_MESSAGE): Use sizeof.
3650 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3651 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3652 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3653 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3654 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3655 (xd_signature, xd_append_arg): Allow float for integer types.
3656 (xd_get_connection_references): New function.
b593d6a9
AH
3657 (xd_get_connection_address): Rename from xd_initialize.
3658 Return cached address.
dcbf5805
MA
3659 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3660 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
3661 level.
3662 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 3663 Return number of refcounts.
dcbf5805
MA
3664 (Fdbus_get_unique_name): Make stronger parameter check.
3665 (Fdbus_message_internal): New defun.
3666 (Fdbus_call_method, Fdbus_call_method_asynchronously)
3667 (Fdbus_method_return_internal, Fdbus_method_error_internal)
3668 (Fdbus_send_signal, Fdbus_register_service)
3669 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3670 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3671 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3672 (Vdbus_compiled_version, Vdbus_runtime_version)
3673 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3674 (Vdbus_message_type_method_return, Vdbus_message_type_error)
3675 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
3676 (Vdbus_registered_buses, Vdbus_registered_objects_table):
3677 Adapt docstring.
dcbf5805 3678
52828e02
PE
36792012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3680
da05bc4c
PE
3681 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3682 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3683 Do not assume ptrdiff_t is the same width as 'int'.
3684
52828e02
PE
3685 * alloc.c: Handle unusual debugging option combinations.
3686 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3687 since the two debugging options are incompatible.
3688 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3689 is defined.
3690 (mem_init, mem_insert, mem_insert_fixup):
3691 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3692 (NEED_MEM_INSERT): Remove; no longer needed.
3693
f01769f9
LL
36942012-04-22 Leo Liu <sdl.web@gmail.com>
3695
3696 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3697
5790543d
PE
36982012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3699
3700 * sysdep.c [__FreeBSD__]: Minor cleanups.
3701 (list_system_processes, system_process_attributes) [__FreeBSD__]:
3702 Use Emacs indenting style more consistently. Avoid some casts.
3703 Use 'double' consistently rather than mixing 'float' and 'double'.
3704
b91b7e4d
EW
37052012-04-21 Eduard Wiebe <usenet@pusto.de>
3706
b593d6a9
AH
3707 * sysdep.c (list_system_processes, system_process_attributes):
3708 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 3709
6114eb15
AS
37102012-04-21 Andreas Schwab <schwab@linux-m68k.org>
3711
3712 * lisp.mk (lisp): Update.
3713
2f38dff7
PE
37142012-04-20 Paul Eggert <eggert@cs.ucla.edu>
3715
3716 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3717 It is never used otherwise.
3718
4ae29f89
SM
37192012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
3720
3721 * print.c (print_preprocess): Only check print_depth if print-circle
3722 is nil.
3723 (print_object): Check for cycles even when print-circle is nil and
3724 print-gensym is t, but only check print_depth if print-circle is nil.
3725
f30d612a
CY
37262012-04-20 Chong Yidong <cyd@gnu.org>
3727
3728 * process.c (wait_reading_process_output): If EIO occurs on a pty,
3729 set the status to "failed" and ensure that sentinel is run.
3730
c07a4c0b 37312012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
3732
3733 * process.c (Fset_process_inherit_coding_system_flag)
3734 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 3735 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 3736
c07a4c0b 37372012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
3738
3739 * xdisp.c (string_buffer_position_lim): Limit starting position to
3740 BEGV.
3741 (set_cursor_from_row): If called for a mode-line or header-line
3742 row, return zero immediately.
3743 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
3744 farther than the first row after the header line, if any.
3745 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
3746 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
3747
c07a4c0b 37482012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3749
4ae29f89
SM
3750 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3751 (bug#11238).
ad3a2b41 3752
c07a4c0b 37532012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 37542012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
3755
3756 configure: new option --enable-gcc-warnings (Bug#11207)
3757 * Makefile.in (C_WARNINGS_SWITCH): Remove.
3758 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3759 (ALL_CFLAGS): Use new macros rather than old.
3760 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3761 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
3762 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3763 -Wunused-result, -Wunused-variable. This should go away once
3764 the Emacs and Gnulib regex code is merged.
3765 (xmalloc, xrealloc): Now static.
3766
aba027e8
PE
37672012-04-17 Paul Eggert <eggert@cs.ucla.edu>
3768
3769 * dired.c (Fsystem_groups): Remove unused local.
3770
e5a36063
GM
37712012-04-17 Glenn Morris <rgm@gnu.org>
3772
3773 * dired.c (Fsystem_users): Doc fix.
3774
316411f0
DA
37752012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
3776
3777 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
3778 (syms_of_dired): Add them.
3779
9426aba4
PE
37802012-04-16 Paul Eggert <eggert@cs.ucla.edu>
3781
b62a57be
PE
3782 Fix minor alloc.c problems found by static checking.
3783 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3784 New extern decls, to avoid calling undeclared functions.
3785 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3786 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3787 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3788 (NEED_MEM_INSERT): New macro.
3789 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 3790 Remove one incorrect comment and fix another.
b62a57be 3791
3539f31f
PE
3792 Fix minor ralloc.c problems found by static checking.
3793 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3794 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3795 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3796 (r_alloc_sbrk): Now static.
3797
a041960a
PE
3798 Improve ralloc.c interface checking.
3799 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3800 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3801 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3802 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3803 [REL_ALLOC]: ... to here, to check interface.
3804 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3805 Remove decls. This fixes an "It stinks!".
3806
9426aba4
PE
3807 * alloc.c (which_symbols): Fix alignment issue / type clash.
3808
d55c12ed
AS
38092012-04-15 Andreas Schwab <schwab@linux-m68k.org>
3810
3811 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3812 (struct Lisp_Misc_Any): Likewise.
3813 (struct Lisp_Free): Likewise.
3814 * alloc.c (union aligned_Lisp_Symbol): Define.
3815 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3816 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3817 (union aligned_Lisp_Misc): Define.
3818 (MARKER_BLOCK_SIZE, struct marker_block): Use union
3819 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 3820 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 3821
b948ce8b
PE
38222012-04-14 Paul Eggert <eggert@cs.ucla.edu>
3823
3824 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3825 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3826 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3827 * s/netbsd.h, s/sol2-6.h:
3828 Remove definition of GC_MARK_STACK, since the default now works.
3829 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3830 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3831 no longer the default.
3832 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3833
35dc09a1 38342012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3835
35dc09a1
GM
3836 * lread.c (lisp_file_lexically_bound_p):
3837 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 3838
35dc09a1
GM
38392012-04-14 Eli Zaretskii <eliz@gnu.org>
3840
3841 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3842 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
3843
38442012-04-14 Jan Djärv <jan.h.d@swipnet.se>
3845
3846 * nsterm.m (constrainFrameRect): Always constrain when there is only
3847 one screen (Bug#10962).
3848
bcd86815
KB
38492012-04-13 Ken Brown <kbrown@cornell.edu>
3850
3851 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3852
c25df26e
RT
38532012-04-13 Reuben Thomas <rrt@sc3d.org>
3854
3855 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3856
0fc59f1e
DC
38572012-04-11 Daniel Colascione <dancol@dancol.org>
3858
3859 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3860 against is gone. It's better to use vfork now so that when Cygwin
3861 gains a new, working vfork, we use it automatically (bug#10398).
3862
de8c03dc
SM
38632012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3864
3865 * window.c (save_window_save): Obey window-point-insertion-type.
3866
2f097256
GM
38672012-04-11 Glenn Morris <rgm@gnu.org>
3868
3869 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3870
453b951e
SM
38712012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3872
3873 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3874
75f1671a 38752012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
3876
3877 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3878 (force_quit_count): New var.
3879 (handle_interrupt): Use it.
3880
2a8ce227
JB
38812012-04-10 Juanma Barranquero <lekktu@gmail.com>
3882
3883 * w32.c (w32_delayed_load): Record the full path of the library
3884 being loaded (bug#10424).
3885
935396c0
GM
38862012-04-09 Glenn Morris <rgm@gnu.org>
3887
05920a43
GM
3888 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3889 not just in the obarray, before snarfing them. (Bug#11036)
3890
935396c0
GM
3891 * Makefile.in ($(leimdir)/leim-list.el):
3892 Pass EMACS rather than BUILT_EMACS.
3893
a18ecafa
TZ
38942012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
3895
3896 * process.c (make_process):
3897 * process.h: Add integer `gnutls_handshakes_tried' member to
3898 process struct.
3899
6bbef4e5
JC
3900 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
3901 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
3902
3903 * gnutls.c (gnutls_log_function2i): Convenience log function.
3904 (emacs_gnutls_read): Use new log functions,
3905 `gnutls_handshakes_tried' process member, and
3906 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
3907 attempts per process (connection).
3908
b4d3bc10
CY
39092012-04-09 Chong Yidong <cyd@gnu.org>
3910
3911 * eval.c (Fuser_variable_p, user_variable_p_eh)
3912 (lisp_indirect_variable): Functions deleted.
3913 (Fdefvar): Caller changed.
3914
3915 * callint.c (Finteractive, Fcall_interactively):
3916 * minibuf.c (Fread_variable): Callers changed.
3917
70f4d973
EZ
39182012-04-09 Eli Zaretskii <eliz@gnu.org>
3919
3920 * xdisp.c (set_cursor_from_row): If the display string appears in
3921 the buffer at position that is closer to point than the position
3922 after the display string, display the cursor on the first glyph of
3923 the display string. Fixes cursor display when a 'display' text
3924 property immediately follows invisible text. (Bug#11094)
3925
cb3c2e3e
PE
39262012-04-09 Paul Eggert <eggert@cs.ucla.edu>
3927
3928 composite.c: use 'double' consistently
3929 * composite.c (get_composition_id): Use 'double' consistently
3930 instead of converting 'float' to 'double' and vice versa; this is
3931 easier to understand and avoids a GCC warning.
3932
fd06db5d
GM
39332012-04-09 Glenn Morris <rgm@gnu.org>
3934
50fe702a
GM
3935 * Makefile.in: Generate leim-list with bootstrap-emacs, in
3936 preparation for dumping it with emacs. (Bug#4789)
3937 (leimdir): New variable.
3938 ($(leimdir)/leim-list.el): New rule.
3939 (emacs$(EXEEXT)): Depend on leim-list.el.
3940
fd06db5d
GM
3941 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
3942 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
3943 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
3944
55c131ee
AS
39452012-04-08 Andreas Schwab <schwab@linux-m68k.org>
3946
3947 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
3948 proper alignment.
3949
9209588f
JB
39502012-04-07 Juanma Barranquero <lekktu@gmail.com>
3951
3952 * xml.c (init_libxml2_functions) [WINDOWSNT]:
3953 Remove unused local variable.
3954
e3fb2efb
PE
39552012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3956
3957 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
3958 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
3959 (mark_memory): Mark Lisp_Objects only if pointers might hide in
3960 objects, as mark_maybe_pointer will catch them otherwise.
3961 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
3962 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
3963
b5385551
PE
39642012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3965
3966 Fix typo that broke non-Windows builds.
3967 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
3968
9078ead6
EZ
39692012-04-07 Eli Zaretskii <eliz@gnu.org>
3970
3971 Support building on MS-Windows with libxml2.
3972
3973 * makefile.w32-in (OBJ2): Add xml.$(O).
3974 (GLOBAL_SOURCES): Add xml.c.
3975 ($(BLD)/xml.$(O)): New dependency list.
3976
3977 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
3978 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
3979 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
3980 [!WINDOWSNT]: New macros.
3981 (init_libxml2_functions, libxml2_loaded_p): New functions.
3982 (parse_region): Call fn_xmlCheckVersion instead of using the macro
3983 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
3984 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
3985 Calls xmlCleanupParser only if libxml2 was loaded (or statically
3986 linked in).
6bbef4e5
JC
3987 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
3988 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
3989 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
3990
3991 * emacs.c: Don't include libxml/parser.h.
3992 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
3993 xmlCleanupParser directly.
3994
3995 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
3996
3811fdf3
EZ
39972012-04-07 Eli Zaretskii <eliz@gnu.org>
3998
3999 * indent.c (Fvertical_motion): If there is a display string at
4000 point, use it.vpos to compute how many lines to backtrack after
4001 move_it_to point. (Bug#11133)
4002
2f8e16b2
EZ
40032012-04-06 Eli Zaretskii <eliz@gnu.org>
4004
4005 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4006 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4007 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4008 macros related to unification of CJK characters. For the details,
4009 see the discussion following the message here:
4010 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4011
3d439cd1
CY
40122012-04-04 Chong Yidong <cyd@gnu.org>
4013
4014 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4015
8bc53d00
EZ
40162012-04-01 Eli Zaretskii <eliz@gnu.org>
4017
4018 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4019 instead of alloca. (Bug#11138)
4020
3b0512a3
AS
40212012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4022
4023 * w32menu.c (is_simple_dialog): Properly check lisp types.
4024 (Bug#11141)
4025
8427ddd2
EZ
40262012-03-31 Eli Zaretskii <eliz@gnu.org>
4027
979022ef
EZ
4028 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4029 position we get to after a call to move_it_to fails the
4030 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4031 only if we wind up in a string from display property. (Bug#11063)
4032
a6b1c7cc
EZ
4033 * window.c (Fdelete_other_windows_internal): Invalidate the row
4034 and column information about mouse highlight, so that redisplay
4035 restores it after reallocating the glyph matrices. (Bug#7464)
4036
8427ddd2
EZ
4037 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4038 string comes from a `display' text property, use the buffer
4039 position of that property as if we actually saw that position in
4040 the row's glyphs.
697ba24b
EZ
4041 (move_it_by_lines): Remove the assertion that
4042 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4043 violated when there's a before-string at the beginning of a line.
4044 (Bug#11063)
8427ddd2 4045
65a0a738
EZ
40462012-03-30 Eli Zaretskii <eliz@gnu.org>
4047
4048 * xdisp.c (append_space_for_newline): If the default face was
4049 remapped, use the remapped face for the appended newline.
4050 (extend_face_to_end_of_line): Use the remapped default face for
4051 extending the face to the end of the line.
4052 (display_line): Call extend_face_to_end_of_line when the default
4053 face was remapped. (Bug#11068)
4054
581355cc
EZ
40552012-03-29 Eli Zaretskii <eliz@gnu.org>
4056
4057 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4058
e8fc049f
SM
40592012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4060
4061 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4062
4fb9a543
GM
40632012-03-27 Glenn Morris <rgm@gnu.org>
4064
4065 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4066 Doc fixes.
4067
679910f1
KH
40682012-03-26 Kenichi Handa <handa@m17n.org>
4069
4070 * dispextern.h (struct glyph): Fix previous change. Change the
4071 bit length of glyphless.ch to 25 (Bug#11082).
4072
90d49b7f
CY
40732012-03-26 Chong Yidong <cyd@gnu.org>
4074
4075 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4076 (command_loop_1): Use it; inhibit selection update for
4077 handle-select-window too (Bug#8996).
4078
f514f6f0
FP
40792012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4080
e8fc049f 4081 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4082
bf43fa51
KH
40832012-03-25 Kenichi Handa <handa@m17n.org>
4084
4085 * dispextern.h (struct glyph): Change the bit length of
4086 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4087
8a0c01dd
EZ
40882012-03-24 Eli Zaretskii <eliz@gnu.org>
4089
4090 * s/ms-w32.h (tzname): Include time.h before redirecting to
4091 _tzname. Fixes the MSVC build. (Bug#9960)
4092
7d1c3a76
AS
40932012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4094
8ed79523
AS
4095 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4096 characters.
4097
7d1c3a76
AS
4098 * xterm.c (XTread_socket): Only modify handling_signal if
4099 !SYNC_INPUT. (Bug#11080)
4100
e99a9b8b
EZ
41012012-03-23 Eli Zaretskii <eliz@gnu.org>
4102
4103 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4104 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4105 when fetching a multibyte character consumes more bytes than
4106 CHAR_BYTES returns, due to unification of CJK characters in
4107 string_char. (Bug#11073)
4108
5063c0e1
TN
41092012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4110
4111 * process.c (wait_reading_process_output): Handle pty disconnect
4112 by refraining from sending oneself a SIGCHLD (bug#10933).
4113
9f851fbd
CY
41142012-03-22 Chong Yidong <cyd@gnu.org>
4115
4116 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4117
5063c0e1 4118 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4119 Mark string as coming from a prefix property.
4120 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4121 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4122
fb5b8aca
CY
41232012-03-21 Chong Yidong <cyd@gnu.org>
4124
4125 * xfaces.c (Vface_remapping_alist): Doc fix.
4126
62356a1b
EZ
41272012-03-20 Eli Zaretskii <eliz@gnu.org>
4128
4129 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4130 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4131 Doc fixes.
62356a1b 4132
025de85b
CY
41332012-03-20 Chong Yidong <cyd@gnu.org>
4134
4135 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4136 to reflect default non-nil value of redisplay-dont-pause.
4137
4827f94e
KH
41382012-03-19 Kenichi Handa <handa@m17n.org>
4139
4140 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4141 it fit in a valid range (Bug#11003).
4142
e50a24a2
EZ
41432012-03-18 Eli Zaretskii <eliz@gnu.org>
4144
4145 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4146 that is not from display property, accept the row as a "cursor
4147 row" if one of the string's character has a non-nil `cursor'
4148 property. Fixes cursor positioning when there are newlines in
4149 overlay strings, e.g. in icomplete.el. (Bug#11035)
4150
9af5ed87
PE
41512012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4152
4153 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4154
d1f55f16
CY
41552012-03-12 Chong Yidong <cyd@gnu.org>
4156
4157 * eval.c (inhibit_lisp_code): Rename from
4158 inhibit_window_configuration_change_hook; move from window.c.
4159
4160 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4161 * window.c (run_window_configuration_change_hook)
4162 (syms_of_window): Callers changed.
4163
66c5eebd
CY
41642012-03-11 Chong Yidong <cyd@gnu.org>
4165
413df973
CY
4166 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4167
66c5eebd
CY
4168 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4169
1de11f56
CY
41702012-03-10 Chong Yidong <cyd@gnu.org>
4171
4172 * frame.c (other_visible_frames): Don't assume the selected frame
4173 is visible (Bug#10955).
4174
cae07000
SM
41752012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4176
4177 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4178
89c94350
JD
41792012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4180
4181 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4182 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4183 zero (Bug#10954).
4184
999dd333
GM
41852012-03-03 Glenn Morris <rgm@gnu.org>
4186
01a6dcc8 4187 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4188
de0100f2
EZ
41892012-03-02 Eli Zaretskii <eliz@gnu.org>
4190
4191 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4192 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4193 (redisplay_window, next_element_from_string): Fix typos in
4194 comments.
3e441275
EZ
4195 (redisplay_window): Pass to move_it_vertically the margin in
4196 pixels, not in screen lines.
de0100f2 4197
96a72ee9
GM
41982012-03-02 Glenn Morris <rgm@gnu.org>
4199
4200 * buffer.c (buffer-list-update-hook): Doc fix.
4201
312508d7
EZ
42022012-02-29 Eli Zaretskii <eliz@gnu.org>
4203
4204 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4205 push_it before setting up the iterator for the first overlay
4206 string, even if we have an empty string loaded.
4207 (next_overlay_string): If there's an empty string on the iterator
4208 stack, pop the stack. (Bug#10903)
4209
27f3c637
PE
42102012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4211
4212 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4213 Suggested by Stefan Monnier in
4214 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4215 * alloc.c (widen_to_Lisp_Object): New static function.
4216 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4217 and widening them to Lisp_Objects. This would work even if
4218 USE_LSB_TAG is defined and wide integers are used, which might
4219 happen in a future version of Emacs.
4220
3c9dfce6
CY
42212012-02-25 Chong Yidong <cyd@gnu.org>
4222
fa74b241
CY
4223 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4224 Doc fix.
4225
3c9dfce6
CY
4226 * xselect.c (Fx_selection_exists_p): Doc fix.
4227 (x_clipboard_manager_save_all): Print an informative message
4228 before saving to clipboard manager.
4229
9486df08
CY
42302012-02-24 Chong Yidong <cyd@gnu.org>
4231
4232 * keyboard.c (process_special_events): Handle all X selection
4233 requests in kbd_buffer, not just the next one (Bug#8869).
4234
f01d3321
CY
42352012-02-23 Chong Yidong <cyd@gnu.org>
4236
4237 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4238 call when setting menu-bar-lines and tool-bar-lines parameters.
4239 (unwind_create_frame_1): New helper function.
4240
4241 * window.c (inhibit_window_configuration_change_hook): New var.
4242 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4243 (syms_of_window): Initialize it.
f01d3321 4244
86b847b6
CY
42452012-02-22 Chong Yidong <cyd@gnu.org>
4246
4247 * xterm.c (x_draw_image_relief): Add missing type check for
4248 Vtool_bar_button_margin (Bug#10743).
4249
a59225b1
CY
42502012-02-21 Chong Yidong <cyd@gnu.org>
4251
4252 * fileio.c (Vfile_name_handler_alist): Doc fix.
4253
4254 * buffer.c (Fget_file_buffer): Protect against invalid file
4255 handler return value.
4256
310f5bd4
PE
42572012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4258
cb3a28cc
PE
4259 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4260 when computing $valmask.
4261
310f5bd4
PE
4262 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4263 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4264 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4265 It's useless in that case, and it can cause problems on hosts
4266 that allocate halves of EMACS_INT values separately.
4267 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4268 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4269 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4270 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4271 it avoids undefined behavior on hosts where shifting right by more
4272 than the word width has undefined behavior.
4273
2375c96a
CY
42742012-02-19 Chong Yidong <cyd@gnu.org>
4275
4276 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4277 (Funhandled_file_name_directory, Ffile_name_as_directory)
4278 (Fdirectory_file_name, Fexpand_file_name)
4279 (Fsubstitute_in_file_name): Protect against invalid file handler
4280 return values (Bug#10845).
4281
3eb49e71
EZ
42822012-02-18 Eli Zaretskii <eliz@gnu.org>
4283
4284 * .gdbinit (pitx): Fix incorrect references to fields of the
4285 iterator stack.
4286
7b926f3f
CY
42872012-02-17 Chong Yidong <cyd@gnu.org>
4288
4289 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4290
11273115
PE
42912012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4292
4293 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4294 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4295
c3a70e2b
CY
42962012-02-15 Chong Yidong <cyd@gnu.org>
4297
4298 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4299 marked as special. Also, starting docstrings with * is obsolete.
4300
0ca43699
AS
43012012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4302
4303 * gnutls.c (emacs_gnutls_write): Fix last change.
4304
2e8f3c56
LI
43052012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4306
4307 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4308 send_process.
4309
af70074f
SM
43102012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4311
4312 * keymap.c (Fsingle_key_description): Handle char ranges.
4313
95986d52
CY
43142012-02-12 Chong Yidong <cyd@gnu.org>
4315
afd83bd1
CY
4316 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4317 as that creates a dangerous corner case.
4318
95986d52
CY
4319 * window.c (Fdelete_window_internal): Invalidate the mouse
4320 highlight (Bug#9904).
4321
bd7da63e
GM
43222012-02-12 Glenn Morris <rgm@gnu.org>
4323
4324 * xselect.c (Fx_own_selection_internal)
4325 (Fx_get_selection_internal, Fx_disown_selection_internal)
4326 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4327 * nsselect.m (Fx_own_selection_internal)
4328 (Fx_disown_selection_internal, Fx_selection_exists_p)
4329 (Fx_selection_owner_p, Fx_get_selection_internal):
4330 Sync docs and argument specs with the xselect.c versions.
4331
77abcbc2
LI
43322012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4333
4334 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4335
90b671e2
EZ
43362012-02-11 Eli Zaretskii <eliz@gnu.org>
4337
1c0ca0b7
EZ
4338 * w32select.c (Fx_selection_exists_p): Sync doc string and
4339 argument list with xselect.c. (Bug#10783)
4340
4341 * w16select.c (Fx_selection_exists_p): Sync doc string and
4342 argument list with xselect.c. (Bug#10783)
90b671e2 4343
49241268
GM
43442012-02-10 Glenn Morris <rgm@gnu.org>
4345
4346 * fns.c (Fsecure_hash): Doc fix.
4347
f998bbe7 43482012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4349
4350 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4351
0992bd9c
CY
43522012-02-07 Chong Yidong <cyd@gnu.org>
4353
4354 * buffer.c (Fbuffer_local_variables)
4355 (buffer_lisp_local_variables): Handle unbound vars correctly;
4356 don't let Qunbound leak into Lisp.
4357
af008560
GM
43582012-02-07 Glenn Morris <rgm@gnu.org>
4359
dd605cc4
GM
4360 * image.c (Fimagemagick_types): Doc fix.
4361
af008560
GM
4362 * image.c (imagemagick-render-type): Change it from a lisp object
4363 to an integer. Move the doc here from the lisp manual.
4364 Treat all values not equal to 0 the same.
4365
1449fa1d
CY
43662012-02-06 Chong Yidong <cyd@gnu.org>
4367
4368 * doc.c (store_function_docstring): Avoid applying docstring of
4369 alias to base function (Bug#2603).
4370
3723ec07
AS
43712012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4372
4373 * .gdbinit (pp1, pv1): Remove redundant defines.
4374 (pr): Use pp.
4375
79c1cc1e
CY
43762012-02-04 Chong Yidong <cyd@gnu.org>
4377
4378 * nsterm.m: Declare a global (Bug#10694).
4379
d7f29f8e
EZ
43802012-02-04 Eli Zaretskii <eliz@gnu.org>
4381
cae07000
SM
4382 * w32.c (get_emacs_configuration_options):
4383 Include --enable-checking, if specified, in the return value.
d7f29f8e 4384
3b95a6f9
MR
43852012-02-04 Martin Rudalics <rudalics@gmx.at>
4386
4387 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4388 after rounding frame sizes. (Bug#9723)
4389
d6fa96a6
EZ
43902012-02-04 Eli Zaretskii <eliz@gnu.org>
4391
4392 * keyboard.c (adjust_point_for_property): Don't position point
4393 before BEGV. (Bug#10696)
4394
df0b2940
PE
43952012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4396
4397 Handle overflow when computing char display width (Bug#9496).
4398 * character.c (char_width): Return EMACS_INT, not int.
4399 (char_width, c_string_width): Check for overflow when
4400 computing the width; this is possible now that individual
4401 characters can have unbounded width. Problem introduced
4402 by merge from Emacs 23 on 2012-01-19.
4403
6bee44d6
MA
44042012-02-02 Michael Albinus <michael.albinus@gmx.de>
4405
4406 * dbusbind.c (Fdbus_register_method): Mention the return value
4407 :ignore in the docstring.
4408
44f92739
GM
44092012-02-02 Glenn Morris <rgm@gnu.org>
4410
1b9f60cc
GM
4411 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4412
44f92739
GM
4413 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4414 Unconditionally set to t. (Bug#10673)
4415 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4416 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4417 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4418
c5d3843c
KH
44192012-02-02 Kenichi Handa <handa@m17n.org>
4420
4421 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4422 0, do not call append_composite_glyph.
4423
159462d4 44242012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4425
4426 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4427 NULL (Bug#6988).
4428 (x_produce_glyphs): If the component of a composition is a null
4429 string, set it->pixel_width to 1 to avoid zero-width glyph.
4430
78cef877
EZ
44312012-02-01 Eli Zaretskii <eliz@gnu.org>
4432
4433 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4434 first 2 arguments are identical. This makes inserting large
4435 output from a subprocess an order of magnitude faster on
4436 MS-Windows, where all sbrk'ed memory is always contiguous.
4437
97897668
GM
44382012-01-31 Glenn Morris <rgm@gnu.org>
4439
4440 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4441 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4442 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4443
31fd3586
GM
44442012-01-29 Glenn Morris <rgm@gnu.org>
4445
4446 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4447
0e24a8b2
CY
44482012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4449
4450 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4451
cc0adcb0
CY
44522012-01-28 Chong Yidong <cyd@gnu.org>
4453
4454 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4455
acc28cb9
CY
44562012-01-26 Chong Yidong <cyd@gnu.org>
4457
9c69cfb7
CY
4458 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4459
acc28cb9
CY
4460 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4461 repeat counts (Bug#10507).
4462
48da7392
GM
44632012-01-26 Glenn Morris <rgm@gnu.org>
4464
4465 * lread.c (syms_of_lread): Doc fix.
4466
14af5f7f
CY
44672012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4468
4469 * coding.c (encode_designation_at_bol): Change return value to
4470 EMACS_INT.
4471
0b21c100
CY
44722012-01-25 Chong Yidong <cyd@gnu.org>
4473
4474 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4475
3c2907f7
CY
44762012-01-21 Chong Yidong <cyd@gnu.org>
4477
4478 * floatfns.c (Fcopysign): Make the second argument non-optional,
4479 since nil is not allowed anyway.
4480
959ad23f
AS
44812012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4482
4483 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4484 (send_process): Likewise.
4485
34a02f46
MR
44862012-01-19 Martin Rudalics <rudalics@gmx.at>
4487
4488 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4489 (Vwindow_persistent_parameters): Do not use Qstate.
4490 Rewrite doc-strings.
34a02f46 4491
1259009a 44922012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4493
4494 * character.c (char_width): New function.
70d4fdf6
GM
4495 (Fchar_width, c_string_width, lisp_string_width):
4496 Use char_width (Bug#9496).
25ed9e61 4497
6a6ee00d
MR
44982012-01-16 Martin Rudalics <rudalics@gmx.at>
4499
4500 * window.c (Vwindow_persistent_parameters): New variable.
4501 (Fset_window_configuration, save_window_save): Handle persistent
4502 window parameters.
4503
c85efaf7
EZ
45042012-01-14 Eli Zaretskii <eliz@gnu.org>
4505
4506 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4507 thrashing the stack of the thread. (Bug#9087)
4508
5944709e
PE
45092012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4510
4511 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4512
e71f5d99
EZ
45132012-01-11 Eli Zaretskii <eliz@gnu.org>
4514
4515 * xdisp.c (rows_from_pos_range): Handle the case where the
4516 highlight ends on a newline. (Bug#10464)
4517 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4518 he end column for display of highlight that ends on a newline
4519 before a R2L line.
4520
ce316182
GM
45212012-01-11 Glenn Morris <rgm@gnu.org>
4522
4523 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4524 from load-path also when installation-directory is nil. (Bug#10208)
4525
5b43da69
GM
45262012-01-10 Glenn Morris <rgm@gnu.org>
4527
74cc8ff9
GM
4528 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4529
7d8d6e4e
GM
4530 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4531 Update template values to be closer to their typical values these days.
5b43da69 4532
a0db8d43
EZ
45332012-01-09 Eli Zaretskii <eliz@gnu.org>
4534
4535 * xdisp.c (rows_from_pos_range): Accept additional argument
4536 DISP_STRING, and accept any glyph in a row whose object is that
4537 string as eligible for mouse highlight. Fixes mouse highlight of
4538 display strings from overlays. (Bug#10464)
4539
9a0115ab 45402012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4541
b9110d6a 4542 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4543 * fileio.c (auto_saving_dir_umask): New static var.
4544 (Fmake_directory_internal): Use it.
4545 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4546 creating the directory. The old code temporarily assigns
4547 too-generous permissions to the directory.
4548 (do_auto_save_eh): Clear it.
b9110d6a 4549 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4550 that the var is always cleared.
4551
6c1bd3f3
EZ
45522012-01-07 Eli Zaretskii <eliz@gnu.org>
4553
4554 * search.c (scan_buffer): Pass character positions to
4555 know_region_cache, not byte positions. (Bug#6540)
4556
069d2b50
L
45572012-01-07 LynX <_LynX@bk.ru> (tiny change)
4558
4559 * w32.c (sys_rename): Report EXDEV when rename of a directory
4560 fails because the target is on another logical disk. (Bug#10284)
4561
75bf0d33
DB
45622012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4563
4564 * xterm.c (x_embed_request_focus): New function.
4565
4566 * xterm.h: Add prototype.
4567
4568 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4569
1c6e5a32
GM
45702012-01-05 Glenn Morris <rgm@gnu.org>
4571
4572 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4573
651e947e
EZ
45742012-01-01 Eli Zaretskii <eliz@gnu.org>
4575
4576 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4577 Load gnutls_transport_set_lowat only if GnuTLS version is below
4578 2.11.1.
4579 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4580 GnuTLS versions below 2.11.1.
4581
3778cdd8
AL
45822011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4583
4584 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4585 to the doc string advising against its use for altering the way
4586 windows are scrolled.
4587
0e5317f7
KH
45882011-12-28 Kenichi Handa <handa@m17n.org>
4589
4590 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4591 coding-system ASCII compatible only when it does not produce BOM
4592 on encoding (Bug#10383).
4593
93d5ca1f
JD
45942011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4595
4596 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4597 can scroll.
4598 (create_and_show_popup_menu): Always use menu_position_func for
4599 Gtk3 (Bug#10361).
4600
ca22b785
AS
46012011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4602
4603 * callint.c (Fcall_interactively): Don't truncate prompt string.
4604
d048e1e6
EZ
46052011-12-23 Eli Zaretskii <eliz@gnu.org>
4606
4607 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4608 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 4609 resumed from there (after widening). (Bug#10360)
d048e1e6 4610
5ccaba1f
JD
46112011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4612
4613 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4614
204ee57f
JD
46152011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4616
b81d40f0
JB
4617 * nsterm.m (x_free_frame_resources):
4618 Release f->output_data.ns->miniimage.
204ee57f
JD
4619 (ns_index_color): Fix indentation. Do not retain
4620 color_table->colors[i].
4621
4622 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4623 before returning.
4624
4625 * nsfns.m (x_set_background_color): Assign return value from
4626 ns_index_color to face-background instead of NSColor*.
4627 (ns_implicitly_set_icon_type): Fix indentation.
4628 Change assignment in for loop to comparison.
4629
4630 * emacs.c (ns_pool): New variable.
4631 (main): Assign ns_pool.
4632 (Fkill_emacs): Call ns_release_autorelease_pool.
4633
4634 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4635 autorelease fdesc, release fdAttrs and tdict.
4636 (ns_get_covering_families): Release charset.
4637 (ns_findfonts): Release NSFontDescriptor created with new.
4638 (ns_uni_to_glyphs): Fix indentation.
4639 (setString): Release attrStr before assigning new value.
4640
c803b2b7
JD
46412011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4642
678f4426
JD
4643 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4644 and NS_IMPL_COCOA.
4645 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4646 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4647
cd394be1 46482011-12-18 David Reitter <reitter@cmu.edu>
678f4426 4649
5fecd5fc
JD
4650 * nsterm.m (ns_term_init): Subscribe for notifications
4651 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4652 to method trackingNotification in EmacsMenu.
4653
4654 * nsmenu.m (trackingMenu): New variable.
3771cb17 4655 (trackingNotification): New method (from Aquamacs).
5fecd5fc 4656 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 4657 from Aquamacs (Bug#7030).
678f4426
JD
4658
46592011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 4660
c803b2b7
JD
4661 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4662 (symbol_to_nsstring): Fix indentation.
4663 (ns_symbol_to_pb): New function.
cae07000
SM
4664 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4665 (Fns_rotate_cut_buffers_internal): Remove.
4666 (Fns_store_selection_internal): Rename from
c803b2b7
JD
4667 Fns_store_cut_buffer_internal.
4668 (ns_get_foreign_selection, Fx_own_selection_internal)
4669 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
4670 (Fns_get_selection_internal, Fns_store_selection_internal):
4671 Use ns_symbol_to_pb and check if return value is nil.
4672 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
4673 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
4674 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4675 renamed to Sns_store_selection_internal.
4676 (ns_handle_selection_request): Move code to Fx_own_selection_internal
4677 and remove this function.
4678 (ns_handle_selection_clear): Remove, never used.
4679 (Fx_own_selection_internal): Move code from ns_handle_selection_request
4680 here.
4681
e1b01a3a
KB
46822011-12-17 Ken Brown <kbrown@cornell.edu>
4683
4684 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4685 GID is unknown (Bug#10257).
4686
2adb6e85
PE
46872011-12-17 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4690 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4691 which caused a build failure on GNU/Linux IA-64. This problem was
4692 introduced by my 2011-10-07 patch.
4693
d1d7b339
JL
46942011-12-15 Juri Linkov <juri@jurta.org>
4695
4696 * image.c (imagemagick_error): New function. (Bug#10112)
4697 (imagemagick_load_image): Comment out `MagickSetResolution' call.
4698 Use `imagemagick_error' where ImageMagick functions return
4699 `MagickFalse'.
4700 (Fimagemagick_types): Add `Fnreverse' to return the list in the
4701 proper order.
4702
100d5755
KH
47032011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4704
4705 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4706 fill background (Bug#8992).
4707
454592a6
MR
47082011-12-13 Martin Rudalics <rudalics@gmx.at>
4709
4710 * window.c (Vwindow_combination_resize)
4711 (Vwindow_combination_limit): Use t instead of non-nil in
4712 doc-strings.
61d4b438
MR
4713 (Vrecenter_redisplay): Add first sentence of doc-string on
4714 separate line.
53524d93 4715 (Frecenter): Fix doc-string typo.
454592a6 4716
3633e3aa
KH
47172011-12-11 Kenichi Handa <handa@m17n.org>
4718
4719 * coding.c (Funencodable_char_position): Pay attention to the
4720 buffer text relocation (Bug#9389).
4721
7b9d523a 47222011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 4723
7b9d523a
JD
4724 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4725 gtk_init (Bug#10100).
4726
b73189c6
EZ
47272011-12-10 Eli Zaretskii <eliz@gnu.org>
4728
4729 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4730 IT->string is nil. (Bug#10263)
4731
f7dfe5d6
JD
47322011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4733
83faebb4
JD
4734 * nsterm.h (x_free_frame_resources): Declare.
4735
f7dfe5d6
JD
4736 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4737 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4738
4739 * nsterm.h (ns_get_defaults_value): Declare.
4740
4741 * nsterm.m (ns_default): Call ns_get_defaults_value.
4742
7cd4e72c
EZ
47432011-12-09 Eli Zaretskii <eliz@gnu.org>
4744
4745 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4746 (Bug#10170)
4747
b34d7317
YM
47482011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4749
4750 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4751 that where the value of an _OBJC_* symbol points to is in the .bss
4752 section (Bug#10240).
4753
76470ad1
KH
47542011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4755
4756 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 4757 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 4758
745fff94
KH
47592011-12-08 Kenichi Handa <handa@m17n.org>
4760
4761 * ftfont.c (get_adstyle_property): Fix previous change
4762 (Bug#10233).
4763
6e44397c
JB
47642011-12-07 Juanma Barranquero <lekktu@gmail.com>
4765
4766 * w32.c (init_environment): If no_site_lisp, remove site-lisp
4767 dirs from the default value of EMACSLOADPATH (bug#10208).
4768
7efa6272
GM
47692011-12-07 Glenn Morris <rgm@gnu.org>
4770
4771 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4772 installation and source directories as well. (Bug#10208)
4773
f6fc4d87
CY
47742011-12-06 Chong Yidong <cyd@gnu.org>
4775
4776 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4777
2bf26180
GM
47782011-12-06 Glenn Morris <rgm@gnu.org>
4779
4780 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4781 as an error, not just -1. (Bug#10217)
4782
3a6ad4f0
CY
47832011-12-05 Chong Yidong <cyd@gnu.org>
4784
4785 * keyboard.c (process_special_events): New function.
4786 (swallow_events, Finput_pending_p): Use it (Bug#10195).
4787
75a3b399
PE
47882011-12-05 Paul Eggert <eggert@cs.ucla.edu>
4789
4790 * coding.c (encode_designation_at_bol): Don't use uninitialized
4791 local variable (Bug#9318).
4792
c3c9e25e
KH
47932011-12-05 Kenichi Handa <handa@m17n.org>
4794
4795 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4796 return Qnil (Bug#8046, Bug#10193).
4797
5eb05ea3
KH
47982011-12-05 Kenichi Handa <handa@m17n.org>
4799
4800 * coding.c (encode_designation_at_bol): New args charbuf_end and
4801 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
4802 (coding_set_source): Return how many bytes coding->source was
4803 relocated.
4804 (coding_set_destination): Return how many bytes
4805 coding->destination was relocated.
4806 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 4807 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
4808
48092011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4810
4811 * coding.c (CODING_CHAR_CHARSET_P): New macro.
4812 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4813 macro (Bug#9318).
4814
48152011-12-05 Andreas Schwab <schwab@linux-m68k.org>
4816
4817 The following changes are to fix Bug#9318.
4818
a79703f5 4819 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
4820 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4821 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 4822 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 4823
7dbda6df
JB
48242011-12-05 Juanma Barranquero <lekktu@gmail.com>
4825
4826 * lisp.h (process_quit_flag): Fix external declaration.
4827
6d5eb5b0
SM
48282011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
4829
4830 Don't macro-inline non-performance-critical code.
4831 * eval.c (process_quit_flag): New function.
4832 * lisp.h (QUIT): Use it.
4833
a0c3fad0
JD
48342011-12-04 Jan Djärv <jan.h.d@swipnet.se>
4835
4836 * nsfns.m (get_geometry_from_preferences): New function.
4837 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4838
6c07aac2
AS
48392011-12-04 Andreas Schwab <schwab@linux-m68k.org>
4840
4841 * emacs.c (Qkill_emacs): Define.
4842 (syms_of_emacs): Initialize it.
4843 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4844 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
4845 (quit_throw_to_read_char): Add parameter `from_signal'.
4846 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
4847 * lisp.h (QUIT): Call Fkill_emacs if requested.
4848
c052ead4
JD
48492011-12-03 Jan Djärv <jan.h.d@swipnet.se>
4850
4851 * widget.c (update_wm_hints): Return if wmshell is null.
4852 (widget_update_wm_size_hints): New function.
4853
4854 * widget.h (widget_update_wm_size_hints): Declare.
4855
4856 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4857 widget_update_wm_size_hints (Bug#10104).
4858
9e49252b
EZ
48592011-12-03 Eli Zaretskii <eliz@gnu.org>
4860
4861 * xdisp.c (handle_invisible_prop): If the invisible text ends just
4862 before a newline, prepare the bidi iterator for consuming the
4863 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 4864 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 4865
02b16839
JL
48662011-12-02 Juri Linkov <juri@jurta.org>
4867
4868 * search.c (Fword_search_regexp): New Lisp function created from
4869 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
4870 (Fword_search_backward, Fword_search_forward)
4871 (Fword_search_backward_lax, Fword_search_forward_lax):
4872 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
4873 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
4874
0068070e
SM
48752011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
4876
4877 * fileio.c (Finsert_file_contents): Move after-change-function call
4878 to before the "handled:" label, since all "goto handled" appear in
4879 cases where the *-change-functions have already been properly called
4880 (bug#10117).
4881
3360a3fc
AS
48822011-12-01 Andreas Schwab <schwab@linux-m68k.org>
4883
4884 * keyboard.c (interrupt_signal): Don't call kill-emacs when
4885 waiting for input. (Bug#10169)
4886
73d6c093
EZ
48872011-11-30 Eli Zaretskii <eliz@gnu.org>
4888
4889 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4890 verifies glyph row's hash code--we have just reallocated the
4891 glyphs, so their contents can be complete garbage. (Bug#10164)
4892
febe6bea
JB
48932011-11-30 Juanma Barranquero <lekktu@gmail.com>
4894
4895 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
4896
801a4313
EZ
48972011-11-30 Eli Zaretskii <eliz@gnu.org>
4898
4899 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
4900 attributes are tested _before_ calling verify_row_hash, to protect
4901 against GCC re-ordering of the tests. (Bug#10164)
4902
2b56b87e
JD
49032011-11-29 Jan Djärv <jan.h.d@swipnet.se>
4904
4905 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
4906
4907 * xterm.c (handle_one_xevent): Only set async_visible and friends
4908 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 4909 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
4910 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
4911
dbf31225
PE
49122011-11-28 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 Remove GCPRO-related macros that exist only to avoid shadowing locals.
4915 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
4916 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
4917 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4918 All uses changed to use GCPRO1 etc.
4919 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
4920 Revert to old implementation (i.e., before 2011-03-11).
4921
1305621b
YM
49222011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4923
4924 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
4925 of scroll runs so as to avoid assigning disabled bogus rows and
4926 unnecessary graphics copy operations.
4927
8c9afb46
EZ
49282011-11-27 Eli Zaretskii <eliz@gnu.org>
4929
4930 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
4931 (snprintf) [_MSC_VER]: Redirect to _snprintf.
4932 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
4933 (malloc, free, realloc, calloc): Redirect to e_* only when
4934 compiling Emacs.
4935
4936 * lisp.h (GCTYPEBITS): Move before first use.
4937 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
4938 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
4939 this macro definition.
4940
4941 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
4942 _MSC_VER.
4943
54e9e3bf
JD
49442011-11-27 Jan Djärv <jan.h.d@swipnet.se>
4945
6d5eb5b0
SM
4946 * gtkutil.c (xg_create_frame_widgets):
4947 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
4948 present with Gtk+ 2.0.
4949
83aca1cb
PE
49502011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4951
4952 * fileio.c (Finsert_file_contents): Undo previous change; see
4953 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4954
5b76caa4
PE
49552011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4956
4957 Rename locals to avoid shadowing.
4958 * fileio.c (Finsert_file_contents):
4959 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
4960 * process.c (wait_reading_process_output):
4961 Rename inner 'proc' to 'p' to avoid shadowing.
4962 Indent for consistency with usual Emacs style.
4963
8c535114
EZ
49642011-11-25 Eli Zaretskii <eliz@gnu.org>
4965
4966 * xdisp.c (redisplay_window): If cursor row is not fully visible
4967 after recentering, and scroll-conservatively is set to a large
4968 number, scroll window by a few more lines to make the cursor fully
4969 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
4970 (start_display): Don't move to the next line if the display should
4971 start at a newline that is part of a display vector or an overlay
4972 string. (Bug#10119)
8c535114 4973
fa4fdb5c
JL
49742011-11-24 Juri Linkov <juri@jurta.org>
4975
4976 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
4977 after the `MagickPingImage' call. (Bug#10112)
4978
90ec88df
CY
49792011-11-23 Chong Yidong <cyd@gnu.org>
4980
4981 * window.c (Fcoordinates_in_window_p): Accept only live windows.
4982
56e2e794
MR
49832011-11-23 Martin Rudalics <rudalics@gmx.at>
4984
4985 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
4986 making another buffer current. (Bug#10114)
4987
b6e64c41
GM
49882011-11-23 Glenn Morris <rgm@gnu.org>
4989
4990 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
4991
6b21de18
CY
49922011-11-23 Chong Yidong <cyd@gnu.org>
4993
4994 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
4995 using it (Bug#5984).
4996
b12cd789
EZ
49972011-11-22 Eli Zaretskii <eliz@gnu.org>
4998
4999 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5000 and header-lines, as they don't have one computed for them.
5001 (Bug#10098)
5002
5003 * .gdbinit (prow): Make displayed values more self-explaining.
5004 Add row's hash code.
5005
261b6fd4
LMI
50062011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5007
5008 * process.c (wait_reading_process_output): Fix asynchrounous
5009 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5010 (wait_reading_process_output): Add comment and URL.
261b6fd4 5011
e7cfd277
JD
50122011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5013
5014 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5015
a9b9b7f5
CY
50162011-11-21 Chong Yidong <cyd@gnu.org>
5017
5018 * window.c (Fnext_window, Fprevious_window): Doc fix.
5019
b0d15b4f
SM
50202011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5021
5022 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5023
fe7a3057
JB
50242011-11-20 Juanma Barranquero <lekktu@gmail.com>
5025
5026 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5027
d2999b1a
MR
50282011-11-20 Martin Rudalics <rudalics@gmx.at>
5029
5030 * window.c (Fset_window_combination_limit): Rename argument
5031 STATUS to LIMIT.
5032 (Vwindow_combination_limit): Remove "status" from doc-string.
5033
d5ff9cd0
AS
50342011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5035
5036 * m/ibms390.h: Remove.
5037 * m/ibms390x.h: Don't include "ibms390.h".
5038
a5bb9bd3
SM
50392011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5040
5041 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5042 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5043
cd1181db
JB
50442011-11-20 Juanma Barranquero <lekktu@gmail.com>
5045
5046 * casetab.c (Fset_case_table):
5047 * charset.c (Fcharset_after): Fix typos.
5048
615a3b8d 50492011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5050
17e845af
PE
5051 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5052 Otherwise, valgrind does not work on some platforms.
5053 Problem reported by Andreas Schwab in
6a0bf43d
PE
5054 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5055 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5056 is set, removing the need for VIRT_ADDRESS_VARIES.
5057 (PURE_P): Use a more-efficient implementation that needs just one
5058 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5059 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5060 to 4 (xorl, subq, cmpq, setbe).
5061 * alloc.c (pure): Always extern now, since that's the
5062 VIRT_ADDR_VARIES behavior.
5063 (PURE_POINTER_P): Use a single comparison, not two, for
5064 consistency with the new puresize.h.
5065 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5066 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5067 Remove VIRT_ADDR_VARIES no longer needed.
5068
f8fe6f96
EZ
50692011-11-19 Eli Zaretskii <eliz@gnu.org>
5070
5071 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5072 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5073 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5074 behave as if the cursor position were at the window margin.
5075
5076 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5077 and the cursor position is out of bounds, behave as if the cursor
5078 position were at the window margin. (Bug#10075)
5079
df05a53c
CY
50802011-11-18 Chong Yidong <cyd@gnu.org>
5081
5082 * window.c (Fwindow_combination_limit): Make first argument
5083 non-optional, since it is meaningless for live windows like the
5084 selected window.
61ccba97 5085
2071918e
DA
50862011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5087
5088 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5089
b50a28de
SM
50902011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5091
5092 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5093 (graft_intervals_into_buffer): Simplify.
5094
015137db
EZ
50952011-11-18 Eli Zaretskii <eliz@gnu.org>
5096
5097 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5098 hash values of the two rows.
5099 (copy_row_except_pointers): Preserve the used[] arrays and the
5100 hash values of the two rows. (Bug#10035)
68c95424 5101 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5102
5103 * xdisp.c (row_hash): New function, body extracted from
5104 compute_line_metrics.
5105 (compute_line_metrics): Call row_hash, instead of computing the
5106 hash code inline.
5107
5108 * dispnew.c (verify_row_hash): Call row_hash for computing the
5109 hash code of a row, instead of duplicating code from xdisp.c.
5110
5111 * dispextern.h (row_hash): Add prototype.
5112
a2addb04
TH
51132011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5114
5115 * frame.c (delete_frame): Don't delete the terminal when the last
5116 X frame is closed if emacs is built with GTK toolkit.
5117
df85d315
JB
51182011-11-17 Juanma Barranquero <lekktu@gmail.com>
5119
5120 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5121
a0c2d0ae
MR
51222011-11-17 Martin Rudalics <rudalics@gmx.at>
5123
5124 * window.c (Vwindow_splits): Rename to
5125 Vwindow_combination_resize. Suggested by Juri Linkov.
5126 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5127 of Vwindow_splits.
5128
58179cce
JB
51292011-11-16 Juanma Barranquero <lekktu@gmail.com>
5130
7877f373
JB
5131 * nsfns.m (Fns_font_name):
5132 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5133
b6f67890
MR
51342011-11-16 Martin Rudalics <rudalics@gmx.at>
5135
5136 * window.h (window): Rename slot "nest" to "combination_limit".
5137 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5138 (Fset_window_nest): Rename to Fset_window_combination_limit.
5139 (Vwindow_nest): Rename to Vwindow_combination_limit.
5140 (recombine_windows, make_parent_window, make_window)
5141 (Fsplit_window_internal, saved_window)
5142 (Fset_window_configuration, save_window_save): Rename all
5143 occurrences of window_nest to window_combination_limit.
5144
c7015153
JB
51452011-11-15 Juanma Barranquero <lekktu@gmail.com>
5146
5147 * image.c (imagemagick_load_image): Fix typo.
5148
322ad6ec
EZ
51492011-11-14 Eli Zaretskii <eliz@gnu.org>
5150
5151 * xdisp.c (display_line): Move the call to
5152 highlight_trailing_whitespace before the call to
5153 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5154 faces of all the glyphs to compute ROW's hash value.
5155 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5156
f067b8ec
JB
51572011-11-14 Juanma Barranquero <lekktu@gmail.com>
5158
5159 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5160 just return (bug#10044).
5161
1e5b2111
EZ
51622011-11-12 Eli Zaretskii <eliz@gnu.org>
5163
7ef3cbd5
EZ
5164 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5165 with user-defined heap size. Bump the default size of the temacs
5166 heap to 27MB, to avoid memory warning when running temacs.
5167 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5168
1e5b2111
EZ
5169 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5170 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5171 (verify_row_hash) [XASSERTS]: New function.
5172 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5173 that the hash value of glyph rows is correct.
1e5b2111 5174
89d61221
MR
51752011-11-12 Martin Rudalics <rudalics@gmx.at>
5176
5177 * window.h (window): Remove splits slot.
5178 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5179 (Fdelete_other_windows_internal, make_parent_window)
5180 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5181 (Fset_window_configuration, save_window_save): Don't deal with
5182 split status of windows.
5183 (saved_window): Remove splits slot.
5184 (Vwindow_splits): Rewrite doc-string.
5185
97f18cc8
JD
51862011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5187
5188 * xfns.c (unwind_create_frame):
5189 * nsfns.m (unwind_create_frame):
5190 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5191 Vframe_list (Bug#9999).
5192
22a648b4
DA
51932011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5194
0b381c7e 5195 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5196
659afede
KH
51972011-11-11 Kenichi Handa <handa@m17n.org>
5198
5199 * callproc.c (Fcall_process): Set the member dst_multibyte of
5200 process_coding.
5201
9ac0394b
KH
52022011-11-11 Johan Bockgård <bojohan@gnu.org>
5203
5204 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5205 avoid a crash (bug#9496).
5206
2fbdc249
CY
52072011-11-09 Chong Yidong <cyd@gnu.org>
5208
5209 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5210 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5211
ac6b1f81
PE
52122011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5213
5214 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5215
09db192c
PE
52162011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5217
5218 Avoid some portability problems by eschewing 'extern inline' functions.
5219 The trivial performance wins aren't worth the portability hassles; see
5220 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5221 et seq.
5222 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5223 (window_box_width, window_box_left, window_box_left_offset)
5224 (window_box_right, window_box_right_offset): Undo previous change,
5225 by removing the "extern"s.
5226 * intervals.c (adjust_intervals_for_insertion)
5227 (adjust_intervals_for_deletion): Undo previous change,
5228 making these static again.
5229 (offset_intervals, temp_set_point_both, temp_set_point)
5230 (copy_intervals_to_string): No longer inline.
5231 * xdisp.c (window_text_bottom_y, window_box_width)
5232 (window_box_height, window_box_left_offset)
5233 (window_box_right_offset, window_box_left, window_box_right)
5234 (window_box): No longer inline.
5235
105216ed
CY
52362011-11-08 Chong Yidong <cyd@gnu.org>
5237
5238 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5239 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5240 Signal an error if not a live window.
105216ed
CY
5241 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5242 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5243
ae9e237f
JB
52442011-11-07 Juanma Barranquero <lekktu@gmail.com>
5245
5246 * lisp.h (syms_of_abbrev): Remove declaration.
5247 Reported by CHENG Gao <chenggao@royau.me>.
5248
c7aa8333
EZ
52492011-11-07 Eli Zaretskii <eliz@gnu.org>
5250
5251 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5252 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5253 of temacs in GUI mode.
5254
be7f5545
MR
52552011-11-07 Martin Rudalics <rudalics@gmx.at>
5256
5257 * window.h: Declare delete_all_child_windows instead of
5258 delete_all_subwindows.
5259 * window.c (Fwindow_nest, Fset_window_nest)
5260 (Fset_window_new_total, Fset_window_new_normal)
5261 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5262 (delete_all_subwindows): Rename to delete_all_child_windows.
5263 (Fdelete_other_windows_internal, Fset_window_configuration):
5264 Call delete_all_child_windows instead of delete_all_subwindows.
5265 * frame.c (delete_frame): Call delete_all_child_windows instead
5266 of delete_all_subwindows.
5267
ca78dc43
PE
52682011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5269
5270 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5271 This is also needed for porting to any host where GC_MARK_STACK is
5272 not GC_MAKE_GCPROS_NOOPS.
5273 (which_symbols): Use it.
5274
a0241d01
KH
52752011-11-07 Kenichi Handa <handa@m17n.org>
5276
5277 * coding.c (coding_set_destination): Check coding->src_pos only
5278 when coding->src_object is a buffer (bug#9910).
5279
5280 * process.c (send_process): Set the member src_multibyte of coding
5281 to 0 (bug#9911) when sending a unibyte text.
5282
5283 * callproc.c (Fcall_process): Set the member src_multibyte of
5284 process_coding to 0 (bug#9912).
5285
a64bfdfa 52862011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5287
5288 * xmenu.c (cleanup_widget_value_tree): New function.
5289 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5290 calling free_menubar_widget_value_tree directly (Bug#9830).
5291
cb41b32a
PE
52922011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5293
5294 Fix some portability problems with 'inline'.
5295 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5296 (window_box_width, window_box_left, window_box_left_offset)
5297 (window_box_right, window_box_right_offset): Declare extern.
5298 Otherwise, these inline functions do not conform to C99 and
5299 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5300 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5301 * intervals.c (adjust_intervals_for_insertion)
5302 (adjust_intervals_for_deletion): Now extern, because otherwise the
5303 extern inline functions 'offset_intervals' couldn't refer to it.
5304 (static_offset_intervals): Remove.
5305 (offset_intervals): Rewrite using the old contents of
5306 static_offset_intervals. The old version didn't conform to C99
5307 because an extern inline function contained a reference to an
5308 identifier with static linkage.
5309
b7041366
AS
53102011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5311
5312 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5313 GC.
5314
88a37c4d
EZ
53152011-11-06 Eli Zaretskii <eliz@gnu.org>
5316
5317 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5318 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5319 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5320 return Qleft_to_right.
5321
49745b39
CY
53222011-11-06 Chong Yidong <cyd@gnu.org>
5323
5324 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5325 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5326 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5327 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5328 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5329 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5330 (Fwindow_vscroll): Doc fix.
5331 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5332 argument, since it makes no sense to pass a live window and for
5333 consistency with window-child.
5334
1f05cd82
CS
53352011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5336
5337 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5338 support MSVC.
5339
22610910
JR
53402011-11-05 Jason Rumney <jasonr@gnu.org>
5341
5342 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5343 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5344 fonts (Bug#6029).
5345 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5346 bitwise arithmetic preventing use of unicode-sip and non-truetype
5347 opentype fonts.
5348
a06776b2
EZ
53492011-11-05 Eli Zaretskii <eliz@gnu.org>
5350
3ad924ba
EZ
5351 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5352 "emacs"-only part.
5353
a06776b2
EZ
5354 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5355 initialization code to keep similarity to xfns.c after changes
5356 from 2011-11-05.
5357
c9e7db78
JD
53582011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5359
a97f8f3f
JD
5360 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5361 (unwind_create_frame): New function (Bug#9943).
5362 (Fx_create_frame): Restructure code to be more similar to the one in
5363 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5364 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5365 Move terminal->reference_count++ just before making the frame official
5366 (Bug#9943).
5367
5368 * nsterm.m (x_free_frame_resources): New function.
5369 (x_destroy_window): Move code to x_free_frame_resources.
5370
c9e7db78 5371 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5372 (Fx_create_frame, x_create_tip_frame):
5373 Move terminal->reference_count++ just before making the frame
75f1671a 5374 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5375 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5376
a6fc3b5c
EZ
53772011-11-05 Eli Zaretskii <eliz@gnu.org>
5378
5379 Support MSVC build with newer versions of Visual Studio.
5380 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5381 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5382 nt/gmake.defs.
5383
5384 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5385 which are not supported by MSVC.
5386 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5387 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5388 bitfields.
5389 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5390 types in bitfields.
5391 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5392
5393 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5394
58179cce 53952011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5396
5397 Support MSVC build with newer versions of Visual Studio.
5398 * w32.c: Don't include w32api.h for MSVC.
5399 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5400
5401 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5402 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5403 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5404 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5405 e_* cousins.
5406 (alloca) [_MSC_VER]: Define to _alloca.
5407
5408 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5409
5410 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5411
a58c13ed
EZ
54122011-11-04 Eli Zaretskii <eliz@gnu.org>
5413
5414 * xdisp.c (note_mouse_highlight): If either of
5415 previous/next-single-property-change returns nil, treat that as
5416 the beginning or the end of the buffer. (Bug#9955)
5417
fe0b6370
JD
54182011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5419
a58c13ed 5420 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5421 label is not null (Bug#9951).
5422 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5423 may be NULL.
5424
89bd5ee1
EZ
54252011-11-04 Eli Zaretskii <eliz@gnu.org>
5426
5427 * window.c (Fwindow_body_size): Mention in the doc string that the
5428 return value is in frame's canonical units. (Bug#9949)
5429
84c3edb9
EZ
54302011-11-03 Eli Zaretskii <eliz@gnu.org>
5431
4e2fb5c7
EZ
5432 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5433
84c3edb9 5434 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5435 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5436 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5437
bc17a887
EZ
54382011-11-01 Eli Zaretskii <eliz@gnu.org>
5439
5440 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5441 Don't stop backward scan on the continuation glyph, even though
5442 its CHARPOS is positive.
6d5eb5b0
SM
5443 (mouse_face_from_buffer_pos, note_mouse_highlight):
5444 Rename cover_string to disp_string.
bc17a887 5445
4ee88440
MR
54462011-11-01 Martin Rudalics <rudalics@gmx.at>
5447
5448 * window.c (temp_output_buffer_show): Don't use
5449 Vtemp_buffer_show_specifiers.
5450 (Vtemp_buffer_show_specifiers): Remove unused variable.
5451
c2ff3c02
EZ
54522011-10-30 Eli Zaretskii <eliz@gnu.org>
5453
5454 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5455 past the beginning of the current glyph matrix.
5456
58179cce 54572011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5458
5459 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5460 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5461 HAVE_GTK3 (Bug#9869).
b77a6a7f 5462
3b574623
JD
5463 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5464 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5465
b77a6a7f
JD
5466 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5467
5468 * xterm.c: Declare x_handle_net_wm_state to return int.
5469 (handle_one_xevent): Check if we are iconified but don't have
5470 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5471 (get_current_wm_state): Return non-zero if not hidden,
5472 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5473 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5474 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5475 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5476
196e41e4
PE
54772011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5478
5479 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5480 so that this new function doesn't get optimized away by a
5481 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5482
021f2e1a
AS
54832011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5484
5485 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5486
8b058d44
EZ
54872011-10-29 Eli Zaretskii <eliz@gnu.org>
5488
5489 Fix the `xbytecode' command.
5490 * .gdbinit (xprintbytestr): New command.
b50a28de 5491 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5492 (xbytecode): Print the byte-code string as well.
5493
4452fb80
EZ
54942011-10-29 Kim Storm <storm@cua.dk>
5495
8b058d44
EZ
5496 * alloc.c (which_symbols): New function.
5497
21b72067
AS
54982011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5499
5500 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5501 line. (Bug#9903)
5502
83ed7b5c
GM
55032011-10-29 Glenn Morris <rgm@gnu.org>
5504
5505 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5506 Not clear what it was for, and it causes various bugs. (Bug#9839)
5507
5a7a728b
EZ
55082011-10-28 Eli Zaretskii <eliz@gnu.org>
5509
5510 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5511 possible random value that matches one of those tested as
5512 condition to clear the mouse face.
5513
d3d0842f
CY
55142011-10-28 Chong Yidong <cyd@gnu.org>
5515
5516 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5517
31b39d13
DN
55182011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5519
5520 * window.c (make_window): Initialize phys_cursor_on_p.
5521
9aba6043
SM
55222011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5523
5524 * lisp.h (struct Lisp_Symbol): Update comments.
5525
c20992f4
JB
55262011-10-28 Juanma Barranquero <lekktu@gmail.com>
5527
5528 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5529
db4f02f2
EZ
55302011-10-28 Eli Zaretskii <eliz@gnu.org>
5531
5532 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5533 <oslsachem@gmail.com> for helping to debug this.
5534
5535 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5536 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5537 (g_b_init_get_glyph_outline_w): New static variables.
5538 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5539 (GetGlyphOutlineW_Proc): New typedefs.
5540 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5541 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5542 New functions.
5543 (w32font_open_internal, compute_metrics):
5544 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5545 instead of calling the "wide" APIs directly.
5546
5547 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5548
5549 * w32.h (syms_of_w32font): Add prototype.
5550
87e68db4
JB
55512011-10-27 Juanma Barranquero <lekktu@gmail.com>
5552
5553 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5554 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5555 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5556 (Fmove_to_window_line): Doc fix.
5557
435c1d67
CY
55582011-10-27 Chong Yidong <cyd@gnu.org>
5559
5560 * process.c (make_process): Set gnutls_state to NULL.
5561
5562 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5563 non-NULL, regardless of GNUTLS_INITSTAGE.
5564 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5565 an error. Set process slots as soon as we allocate them.
5566
5567 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5568
9c6c6f49
CY
55692011-10-27 Chong Yidong <cyd@gnu.org>
5570
9aba6043
SM
5571 * gnutls.c (emacs_gnutls_deinit): New function.
5572 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5573 (Fgnutls_deinit, Fgnutls_boot): Use it.
5574
5575 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5576 (deactivate_process): Call emacs_gnutls_deinit.
5577
657d08d3
JB
55782011-10-27 Juanma Barranquero <lekktu@gmail.com>
5579
5580 * image.c (x_create_x_image_and_pixmap):
5581 * w32.c (sys_rename, w32_delayed_load):
5582 * w32font.c (fill_in_logfont):
5583 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5584
5430d399
JB
55852011-10-26 Juanma Barranquero <lekktu@gmail.com>
5586
5587 * w32fns.c (w32_default_color_map): New function,
5588 extracted from Fw32_default_color_map.
a7ef684b 5589 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5590
fe0055fa
PE
55912011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5592
5593 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5594
e6346438
SM
55952011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5596
5597 * keyboard.c (test_undefined): New function (bug#9751).
5598 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5599
e112cc37
ET
56002011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5601
5602 * sysdep.c (init_sys_modes): Fix the check for the controlling
5603 terminal (Bug#6649).
5604
7b5d6677
EZ
56052011-10-20 Eli Zaretskii <eliz@gnu.org>
5606
5607 * dispextern.h (struct bidi_it): New member next_en_type.
5608
5609 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5610 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5611 current character, check also for next_en_type being WEAK_EN.
5612 (bidi_resolve_weak): Don't enter the expensive loop if the current
5613 position is before next_en_pos. Record the bidi type of the first
5614 non-ET, non-BN character we find, in addition to its position.
5615 (bidi_level_of_next_char): Invalidate next_en_type when
5616 next_en_pos is over-stepped.
5617
7da0b018
PE
56182011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5619
5620 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5621 * editfns.c: Rewrite current-time-zone so that it invokes
5622 the equivalent of (format-time-string "%Z") to get the time zone name.
5623 This fixes a bug when the time zone name contains characters that
5624 need converting from the system time locale to Emacs internal format.
5625 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5626 that patch fixed format-time-string to do the conversion, but
5627 I forgot to fix current-time-zone.
5628 (format_time_string): New function, containing most of
5629 what Fformat_time_string used to contain.
5630 (Fformat_time_string): Rewrite in terms of format_time_string.
5631 This doesn't change this function's behavior.
5632 (current-time-zone): Rewrite to use format_time_string.
5633 This fixes the bug reported by Michael Schierl in
5634 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5635 Jason Rumney's 2007-06-07 change worked around this bug, but
5636 didn't fix it.
5637 * systime.h (tzname, timezone): Remove no-longer-used declarations.
5638
8547b010
EZ
56392011-10-19 Eli Zaretskii <eliz@gnu.org>
5640
5641 * xdisp.c (start_display): If the character at POS is displayed
5642 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
5643 (try_window_reusing_current_matrix): If a line ends in a display
5644 vector or the next line starts in a display vector, continue
5645 redrawing the window even though the character position of
5646 start_row was reached.
8547b010
EZ
5647 (Bug#9771, part 2)
5648
4e948d15
CY
56492011-10-18 Chong Yidong <cyd@gnu.org>
5650
5651 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5652 with nobreak-char-display too.
5653
4787455f
EZ
56542011-10-18 Eli Zaretskii <eliz@gnu.org>
5655
5656 Fix part 3 of bug#9771.
5657 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5658 (bidi_resolve_neutral): Don't enter the expensive loop looking for
5659 non-neutral characters if the current character is a paragraph
5660 separator (a.k.a. Newline). This avoids running the same
5661 expensive loop twice, once when we consume the preceding newline
5662 and the other time when the line actually needs to be displayed.
5663 Avoid the loop when we see neutrals on the base embedding level
5664 following a character whose directionality is the same as the
5665 paragraph's. This avoids running the expensive loop when a line
5666 ends in a long sequence of neutrals, like control characters.
5667 Add assertion against STRONG_AL type. Slightly rearrange code
5668 that determines the type of a neutral given the first non-neutral
5669 that follows it.
5670 (bidi_level_of_next_char): Set next_en_pos to zero when
5671 invalidating its info.
5672
2c91f553
EZ
56732011-10-17 Eli Zaretskii <eliz@gnu.org>
5674
5675 * xdisp.c (push_display_prop): Determine whether to record string
5676 or buffer position by IT->string, not by IT->method. Allow
5677 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
5678 (move_it_vertically_backward): Don't look for character position
5679 immediately after the newline when in a continuation line.
5680 (Bug#9771, part 1)
2c91f553 5681
c7b08b0d
MR
56822011-10-15 Martin Rudalics <rudalics@gmx.at>
5683
5684 * window.c (coordinates_in_window): Rewrite and delabelize
5685 vertical border check. (Bug#5357) (Bug#9618)
5686
6b02f655
SM
56872011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
5688
5689 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5690 errors in XSetWindowBorder (bug#9310).
5691
81d40c92
DA
56922011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
5693
5694 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5695 avoid crash when xmalloc overrun checking is enabled.
5696
d4172c3b
EZ
56972011-10-13 Eli Zaretskii <eliz@gnu.org>
5698
5699 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5700 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
5701 cursor motion with <left> and <right> arrow keys.
5702
5703 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5704 some callers set that themselves.
5705
b00eea75
EZ
57062011-10-12 Eli Zaretskii <eliz@gnu.org>
5707
5708 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5709 display string and the previous row comes from the same string and
5710 is empty. (Bug#9739) (Bug#9738)
5711
8fe012c4
SM
57122011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5713
5714 * doc.c (get_doc_string): Encode file name (bug#9735).
5715
0074aef2
EZ
57162011-10-12 Eli Zaretskii <eliz@gnu.org>
5717
79beb178
EZ
5718 * bidi.c (bidi_level_of_next_char):
5719 * xdisp.c (get_visually_first_element): Remove old incorrect
5720 comments regarding the Unicode Line Separator character.
5721
0074aef2
EZ
5722 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5723
6e4b3fbe
DA
57242011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
5725
5726 * alloc.c (Fgc_status): Do not access beyond zombies array
5727 boundary if nzombies > MAX_ZOMBIES.
5728 * alloc.c (dump_zombies): Add missing format specifier.
5729
0324f3af
PE
57302011-10-12 Paul Eggert <eggert@cs.ucla.edu>
5731
b5525cac
PE
5732 * xdisp.c (set_cursor_from_row): Simplify conditionals,
5733 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5734
0324f3af
PE
5735 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5736 Some packages use them to denote characters with modifiers.
5737
e9b5f888
AS
57382011-10-11 Andreas Schwab <schwab@linux-m68k.org>
5739
5740 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5741 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5742 matching a pp-number. Rename parameter var to var1.
5743
127827c0
SM
57442011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5745
5746 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5747
c8fd3bd0
GM
57482011-10-08 Glenn Morris <rgm@gnu.org>
5749
5750 * callint.c (Fcall_interactively): Give a more explicit error for the
5751 'c' case with a non-character input. (Bug#8479)
5752
352ec8ff
EZ
57532011-10-08 Eli Zaretskii <eliz@gnu.org>
5754
03669ccb
EZ
5755 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5756 lines.
7061c986
EZ
5757 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5758 lines that are hscrolled on the left.
03669ccb 5759
352ec8ff
EZ
5760 * dispnew.c (buffer_posn_from_coords): Account for a possible
5761 presence of header-line. (Bug#4426)
5762
a66cfb1c
SM
57632011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
5764
6b02f655
SM
5765 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5766 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 5767
7c5ee88e
PE
57682011-10-07 Paul Eggert <eggert@cs.ucla.edu>
5769
5770 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5771 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
5772 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5773 this makes Emacs dump core during garbage collection on rare
5774 occasions. sizeof is obviously inferior to offsetof here, so
5775 stick with offsetof.
5776 (GC_POINTER_ALIGNMENT): New macro.
5777 (mark_memory): Omit 3rd (offset) arg; caller changed.
5778 Don't assume EMACS_INT alignment is the same as pointer alignment.
5779
df1bbe5b
SM
57802011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
5781
5782 * keyboard.c (read_key_sequence_remapped): New var.
5783 (read_key_sequence): Compute remapping in the right buffer.
5784 (command_loop_1): Use read_key_sequence's remapping directly.
5785
51553db6
SM
57862011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5787
32c1fffd
SM
5788 * dired.c (file_name_completion): Don't expand file name.
5789 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5790 before checking file name handler.
5791
51553db6
SM
5792 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5793 they've been requested explicitly (bug#9591).
5794
b6bd1599 57952011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
5796
5797 * keymap.c (Fsingle_key_description): Use make_specified_string
5798 instead of build_string to build string from push_key_description.
5799 (Bug#5193)
5800
f701dc2a
PE
58012011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5802
4222c55d
PE
5803 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5804 This fixes a Y2038 bug on 64-bit hosts.
5805 * buffer.c (reset_buffer):
5806 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5807 (Fclear_buffer_auto_save_failure):
5808 Use 0, not -1, to represent an unset failure time, since time_t
5809 might not be signed.
5810
f701dc2a
PE
5811 Remove dependency on glibc malloc internals.
5812 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5813 Move back here from lisp.h, but with their new implementations.
5814 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5815 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5816 * charset.c (charset_table_init): New static var.
5817 (syms_of_charset): Use it instead of xmalloc. This removes a
5818 dependency on glibc malloc internals. See Eli Zaretskii's comment in
5819 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5820 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5821 Move back to alloc.c.
5822 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5823 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5824
9ceebf39
JD
58252011-09-30 Jan Djärv <jan.h.d@swipnet.se>
5826
5827 * nsterm.m (windowDidResize): Call x_set_window_size only when
5828 ns_in_resize is true. Otherwise set pixelwidth/height and
5829 call change_frame_size (Bug#9628).
5830
cb993c58
PE
58312011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5832
3930c88b
PE
5833 Port --enable-checking=all to Fedora 14 x86-64.
5834 * charset.c (syms_of_charset): Also account for glibc malloc's
5835 internal overhead when calculating the initial malloc maximum.
5836
cb993c58
PE
5837 Port --enable-checking=all to Fedora 14 x86.
5838 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5839 Move to lisp.h.
5840 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5841 (overrun_check_realloc, overrun_check_free):
5842 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5843 That way, xmalloc returns a properly-aligned pointer even if
5844 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
5845 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5846 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5847 into account when calculating the initial malloc maximum.
5848 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5849 Move here from alloc.c, so that charset.c can use it too.
5850 Properly align; the old code wasn't right for common 32-bit hosts
5851 when configured with --enable-checking=all.
5852 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5853 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5854
31bed486
EZ
58552011-09-29 Eli Zaretskii <eliz@gnu.org>
5856
04c70788 5857 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
5858 use EDOM.
5859
fbcaa2f3
EZ
58602011-09-28 Eli Zaretskii <eliz@gnu.org>
5861
5862 * xdisp.c (compute_display_string_end): If there's no display
5863 string at CHARPOS, return -1.
5864
5865 * bidi.c (bidi_fetch_char): When compute_display_string_end
5866 returns a negative value, treat the character as a normal
5867 character not covered by a display string. (Bug#9624)
5868
a239d4e9
JB
58692011-09-28 Juanma Barranquero <lekktu@gmail.com>
5870
5871 * lread.c (Fread_from_string): Fix typo in docstring.
5872
88652fd5
EZ
58732011-09-27 Eli Zaretskii <eliz@gnu.org>
5874
5875 * xdisp.c (handle_invisible_prop): If invisible text ends on a
5876 newline, reseat the iterator instead of bidi-iterating there one
5877 character at a time. (Bug#9610)
32c1fffd
SM
5878 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5879 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 5880
ed497dd4
AS
58812011-09-27 Andreas Schwab <schwab@linux-m68k.org>
5882
5883 * lread.c (readevalloop): Use correct code for NBSP.
5884 (read1): Likewise. (Bug#9608)
5885
b2bf61aa
MA
58862011-09-25 Michael Albinus <michael.albinus@gmx.de>
5887
5888 * dbusbind.c (Fdbus_register_signal): When service is not
5889 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
5890
32bbb17c
GM
58912011-09-25 Glenn Morris <rgm@gnu.org>
5892
5893 * buffer.c (truncate-lines): Doc fix.
5894
94e0933e
CY
58952011-09-24 Chong Yidong <cyd@stupidchicken.com>
5896
5897 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
5898 (Fset_window_next_buffers): Doc fix.
5899
cddde921
GM
59002011-09-24 Glenn Morris <rgm@gnu.org>
5901
5902 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
5903
1260aef1
PE
59042011-09-24 Paul Eggert <eggert@cs.ucla.edu>
5905
25b4bfa0
PE
5906 Fix minor problems found by static checking.
5907 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
5908 * indent.c (Fvertical_motion): Fix == vs = typo.
5909
e3cbd34b
EZ
59102011-09-24 Eli Zaretskii <eliz@gnu.org>
5911
a66cfb1c
SM
5912 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
5913 Default value is now t. Doc fix.
6bf7006f 5914
e3cbd34b 5915 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 5916 logic when moving up, not only when moving down. Fix the
e3cbd34b 5917 confusing name and values of the it_overshoot_expected variable;
32c1fffd 5918 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
5919
5920 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
5921 CHARPOS is covered by a display string which includes newlines.
5922 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
5923 is covered by a display string with embedded newlines.
5924
a3de0cbd
MA
59252011-09-24 Michael Albinus <michael.albinus@gmx.de>
5926
5927 * dbusbind.c (Fdbus_register_signal): Add match rule to
5928 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
5929 (Fdbus_register_method, Vdbus_registered_objects_table):
5930 Fix docstring.
a3de0cbd 5931
b260039d
JM
59322011-09-24 Jim Meyering <meyering@redhat.com>
5933
32c1fffd 5934 do not ignore write error for any output size
b260039d
JM
5935 The previous change was incomplete.
5936 While it makes emacs --batch detect the vast majority of stdout
5937 write failures, errors were still ignored whenever the output size is
5938 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
5939 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
5940 && echo FAIL: ignored write error
5941 FAIL: ignored write error
5942 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
5943 && echo FAIL: ignored write error
5944 FAIL: ignored write error
5945 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
5946
8eca8a7c
AS
59472011-09-23 Andreas Schwab <schwab@linux-m68k.org>
5948
5949 * emacs.c (Fkill_emacs): In noninteractive mode exit
5950 non-successfully if a write error occurred on stdout. (Bug#9574)
5951
3341db62
EZ
59522011-09-21 Eli Zaretskii <eliz@gnu.org>
5953
5954 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
5955 the xassert test.
5956
5957 * dispextern.h (struct it): Update the comment documenting what
5958 can it->OBJECT be.
5959
8c203dbf
EZ
59602011-09-20 Eli Zaretskii <eliz@gnu.org>
5961
5962 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
5963 a display string, extend search for cursor position to end of row.
5964 (find_row_edges): If the row ends in a newline from a display
5965 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
5966 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
5967 (Fcurrent_bidi_paragraph_direction): Fix search for previous
5968 non-empty line. Fixes confusing cursor motion with arrow keys at
5969 the beginning of a line that starts with whitespace.
8c203dbf 5970
a4824228
LMI
59712011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5972
5973 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
5974 (bug#9493).
5975
33ed493b
CY
59762011-09-18 Chong Yidong <cyd@stupidchicken.com>
5977
5978 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
5979 boolean (Bug#9154).
5980
56cd55c8
EZ
59812011-09-18 Eli Zaretskii <eliz@gnu.org>
5982
5983 * xdisp.c (display_line): Record maximum and minimum buffer
5984 positions even if no glyphs were produced (e.g., by a zero-width
5985 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
5986 buffer positions that will be removed from the glyph row because
5987 they don't fit.
c02dcedf
EZ
5988 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
5989 column is beyond frame width: don't subtract 1 "pixel" when
5990 computing width of the stretch.
3e62b7e0
EZ
5991 (reseat_at_next_visible_line_start): Undo the change made on
5992 2011-09-17 that saved paragraph information and restored it after
5993 the call to `reseat'. (Bug#9545)
56cd55c8 5994
5ed99d36 59952011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
5996
5997 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
5998 and turn window cursor on if cleared (Bug#9415).
5999
5ed99d36 60002011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6001
6002 * search.c (boyer_moore): Take unibyte characters from pattern
6003 literally. (Bug#9458)
6004
9bade7b2
EZ
60052011-09-18 Eli Zaretskii <eliz@gnu.org>
6006
6007 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6008
e5e9d610
PE
60092011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6010
87e4427a
PE
6011 Fix minor problem found by static checking.
6012 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6013 initialized, to pacify gcc -Wuninitialized.
6014
e5e9d610
PE
6015 * fileio.c: Report proper errno when syscall falls.
6016 (Finsert_file_contents): Save and restore errno,
6017 so that report_file_error outputs the correct diagnostic.
6018 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6019
a1674f0b
EZ
60202011-09-18 Eli Zaretskii <eliz@gnu.org>
6021
6022 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6023
fbfb6dd4
EZ
60242011-09-17 Eli Zaretskii <eliz@gnu.org>
6025
6026 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6027 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6028
bb187662
EZ
60292011-09-17 Eli Zaretskii <eliz@gnu.org>
6030
1137e8b8 6031 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6032 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6033
6034 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6035 (bidi_find_paragraph_start): Search back for paragraph beginning
6036 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6037 (bidi_move_to_visually_next): Only trigger paragraph-related
6038 computations when the last character is a newline or at EOB, not
6039 just any NEUTRAL_B. (Bug#9470)
6040
bb187662
EZ
6041 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6042 truncated lines if point is covered by a display string. (Bug#9524)
6043
2e621251
PE
60442011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6045
6046 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6047 (cons_to_x_long): New function.
6048 (lisp_data_to_selection_data): Use it. Correct the test for
6049 short-versus-long data; it was negated. Break out of vector
6050 loop, for efficiency, when a long datum is discovered.
6051
91a15bc6
SM
60522011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6053
6054 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6055
b41c3a35
EZ
60562011-09-16 Eli Zaretskii <eliz@gnu.org>
6057
6058 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6059 GCC PR/17406) by declaring this function with external scope.
6060
7812ba2d
PE
60612011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6062
6063 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6064 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6065
cf7edc2a
AS
60662011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6067
6068 * editfns.c (Fformat): Correctly handle text properties on "%%".
6069
bd01620e
EZ
60702011-09-15 Eli Zaretskii <eliz@gnu.org>
6071
6072 * xterm.c (x_draw_composite_glyph_string_foreground):
6073 * w32term.c (x_draw_composite_glyph_string_foreground):
6074 * term.c (encode_terminal_code):
6075 * composite.c (composition_update_it, get_composition_id):
6076 * xdisp.c (get_next_display_element)
6077 (fill_composite_glyph_string): Add comments about special meaning
6078 of TAB characters in a composition.
6079
a02719a3
PE
60802011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6083 This occurs when processing a multibyte format.
6084 Problem reported by Wolfgang Jenker.
a02719a3 6085
72589a3c
JB
60862011-09-15 Johan Bockgård <bojohan@gnu.org>
6087
6088 * xdisp.c (try_cursor_movement): Only check for exact match if
6089 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6090
1c14176c
PE
60912011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6092
6093 Remove unused external symbols.
6094 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6095 * xdisp.c (calc_pixel_width_or_height): Now static.
6096 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6097 * indent.c (check_display_width):
6098 * w32term.c: Fix comment to match code.
6099 * xterm.c, xterm.h (x_catching_errors): Remove.
6100
d2eea5b5
PE
61012011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6102
6103 * xselect.c: Use signed conversions more consistently (Bug#9498).
6104 (selection_data_to_lisp_data): Assume incoming selection data are
6105 signed integers, not unsigned. This is to be consistent with
6106 outgoing selection data, which was modified to use signed integers
6107 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6108 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6109 expects long, not unsigned long.
6110
46888499
EZ
61112011-09-14 Eli Zaretskii <eliz@gnu.org>
6112
6113 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6114 computation of loop end. Reported by Johan Bockgård
6115 <bojohan@gnu.org>.
6116
ef8ef9fb
CY
61172011-09-13 Chong Yidong <cyd@stupidchicken.com>
6118
6119 * frame.c (Fother_visible_frames_p): Function deleted.
6120
fa819fed
EZ
61212011-09-12 Eli Zaretskii <eliz@gnu.org>
6122
6123 * indent.c (compute_motion): Process display vector front to back
6124 rather than the other way around. (Bug#2496)
6125
2ba8e008
SM
61262011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6127
6128 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6129
20f53c69
CY
61302011-09-11 Chong Yidong <cyd@stupidchicken.com>
6131
6132 * minibuf.c (Fread_from_minibuffer): Doc fix.
6133
d562d7a4
EZ
61342011-09-11 Eli Zaretskii <eliz@gnu.org>
6135
6136 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6137 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6138
1c4d7f3d
LMI
61392011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6140
6141 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6142 value for non-existent files.
6143
b885bf36
EZ
61442011-09-11 Eli Zaretskii <eliz@gnu.org>
6145
6146 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6147 set its "size" to -1. This will set the modtime_size field of
6148 the corresponding buffer to -1, which is what
6149 verify-visited-file-modtime expects for files that do not exist.
6150 (Bug#9139)
6151
6612f0bf
PE
61522011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6153
6154 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6155 here ...
6156 * lisp.h: ... from here. push_key_description is no longer
6157 defined in keyboard.c, so its declaration should not be in
6158 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6159 logically belongs with push_key_description.
6160
dfb3f755
PE
61612011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6162
6163 * buffer.h: Include <sys/types.h> instead of <time.h>.
6164 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6165 Problem reported by Herbert J. Skuhra.
6166
3134906c
LMI
61672011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6168
6169 * xml.c (parse_region): Make the parsing work for
6170 non-comment-starting XML files again (bug#9144).
6171
8d903f4e
AS
61722011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6173
6174 * image.c (gif_load): Fix calculation of bottom and right corner.
6175 (Bug#9468)
6176
80ad64f4
EZ
61772011-09-10 Eli Zaretskii <eliz@gnu.org>
6178
6179 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6180 redisplay in small windows.
6181
208a048d
EZ
61822011-09-09 Eli Zaretskii <eliz@gnu.org>
6183
6184 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6185
9b1c252e
MR
61862011-09-08 Martin Rudalics <rudalics@gmx.at>
6187
6188 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6189 Operate on live windows only.
6190
2949f33b
JB
61912011-09-08 Juanma Barranquero <lekktu@gmail.com>
6192
6193 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6194
e08dcafd
EZ
61952011-09-07 Eli Zaretskii <eliz@gnu.org>
6196
6197 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6198 only under bidi iteration.
6199
115b96bd
JD
62002011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6201
6202 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6203
c8199d0f
PE
62042011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6205
6206 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6207 Without this fix, the command to link temacs failed due to an
6208 undefined symbol __builtin_isnan. This is because
6209 /usr/include/iso/math_c99.h #defines isnan(x) to
6210 __builtin_isnan(x), but the bundled gcc, which identifies itself
6211 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6212 a __builtin_isnan.
6213 * floatfns.c (isnan): #undef, and then #define to a clone of
6214 what's in data.c.
6215 (Fisnan): Always define, since it's always available now.
6216 (syms_of_floatfns): Always define isnan at the Lisp level.
6217
e39b275c 62182011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6219
6220 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6221
b2db44d9 62222011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6223
f4af5137 6224 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6225 The previous code assumed that file offsets (off_t values) fit in
6226 EMACS_INT variables, which is not true on typical 32-bit hosts.
6227 The code messed up by falsely reporting buffer overflow in cases
6228 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6229 when "big" contains more than 2**29 bytes, even though this
6230 inserts just one byte and does not overflow the buffer.
6231 (Finsert_file_contents): Store file offsets as off_t
6232 values, not as EMACS_INT values. Check for overflow when
6233 converting between EMACS_INT and off_t. When checking for
6234 buffer overflow or for overlap, take the offsets into account.
6235 Don't use EMACS_INT for small values where int suffices.
6236 When checking for overlap, fix a typo: ZV was used where
6237 ZV_BYTE was intended.
6238 (Fwrite_region): Don't assume off_t fits into 'long'.
6239 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6240
ecfc0a49
MA
62412011-09-05 Michael Albinus <michael.albinus@gmx.de>
6242
6243 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6244
6511acf2 62452011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6246
0999621a 6247 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6248
6249 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6250 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6251 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6252 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6253 (modify_event_symbol): Do not assume that the length of
6254 name_alist_or_stem is safe to alloca and fits in int.
6255 (Fexecute_extended_command): Likewise for function name and binding.
6256 (Frecursion_depth): Wrap around reliably on integer overflow.
6257 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6258 since some callers pass EMACS_INT values.
6259 (Fsingle_key_description): Don't crash if symbol name contains more
6260 than MAX_ALLOCA bytes.
6261 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6262 (get_minibuffer): Arg is now EMACS_INT, not int.
6263 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6264 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6265 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6266
2be7d702
PE
6267 * dbusbind.c (signature_cat): New function.
6268 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6269 Do not overrun buffer; instead, report string overflow.
6270
9d1df220
PE
6271 * dispnew.c (add_window_display_history): Don't overrun buffer.
6272 Truncate instead; this is OK since it's just a log.
6273
33ef5c64
PE
6274 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6275 even if the time zone offset is outlandishly large.
6276 Don't mishandle offset == INT_MIN.
6277
66c6fdd5
PE
6278 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6279 when creating daemon; the previous buffer-overflow check was incorrect.
6280
d749b01b
PE
6281 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6282 which has the guts of the old verror function.
6283
b5cd1905
PE
6284 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6285 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6286
6e1a67fb
PE
6287 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6288 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6289 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6290 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6291 length of string rather than counting it via multiple sprintfs;
6292 that's simpler and more reliable.
c21721cc
PE
6293 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6294 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6295 sprintf, in case result does not fit in int.
6296
c57b67fc
PE
6297 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6298 (fontset_from_font): Print it.
6299
8a401434
PE
6300 * frame.c (tty_frame_count): Now printmax_t, not int.
6301 (make_terminal_frame, set_term_frame_name): Print it.
6302 (x_report_frame_params): In X, window IDs are unsigned long,
6303 not signed long, so print them as unsigned.
6304 (validate_x_resource_name): Check for implausibly long names,
6305 and don't assume name length fits in 'int'.
6306 (x_get_resource_string): Don't blindly alloca invocation name;
6307 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6308 not fit in int.
6309
6e1a67fb
PE
6310 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6311 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6312 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6313
0df02bf3
PE
6314 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6315 Use esprintf, not sprintf, in case result does not fit in int.
6316
48e30793
PE
6317 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6318 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6319 it as a large positive number.
6320 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6321 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6322
a66ff6d8
PE
6323 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6324 in case result does not fit in int.
6325
aca216ff
PE
6326 * print.c (float_to_string): Detect width overflow more reliably.
6327 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6328 buffer overrun. Don't assume list length fits in 'int'. Treat
6329 print length of 0 as 0, not as infinity; to be consistent with other
6330 uses of print length in this function. Don't overflow print length
6331 index. Don't assume hash table size fits in 'long', or that
6332 vectorlike size fits in 'unsigned long'.
6333
31c286f7
PE
6334 * process.c (make_process): Use printmax_t, not int, to format
6335 process-name gensyms.
6336
55e5faa1
PE
6337 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6338
80f2e268
PE
6339 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6340 to avoid potential buffer overrun.
6341
670741ab
PE
6342 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6343 if X resource line is longer than 512 bytes.
6344
b7163a50
PE
6345 * xfns.c (x_window): Make sprintf buffer a bit bigger
6346 to avoid potential buffer overrun.
6347
ae58ff1f
PE
6348 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6349
c43c8a6a
PE
6350 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6351
3f8236f4
PE
63522011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6353
53e9fe90 6354 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6355 Without these, Emacs silently mishandles large integers sometimes.
6356 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6357 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6358
6511acf2
PE
6359 * xdisp.c (try_window_id): Check Emacs fixnum range before
6360 converting to 'int'.
806add1d 6361
6511acf2 6362 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6363 Check that an Emacs fixnum is in range before assigning it to 'int'.
6364 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6365 values converted from Emacs fixnums.
6366 (Frecenter): Don't wrap around a line count if it is out of 'int'
6367 range; instead, treat it as an extreme value.
6368 (Fset_window_configuration, compare_window_configurations):
6369 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6370
6511acf2
PE
6371 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6372 that can exceed INT_MAX. Check that EMACS_INT value is in range
6373 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6374 (match_limit): Don't assume that a fixnum can fit in 'int'.
6375
6511acf2 6376 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6377 exceed INT_MAX.
6378
6511acf2 6379 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6380 (Fvertical_motion): Don't wrap around LINES values that don't fit
6381 in 'int'. Instead, treat them as extreme values. This is good
6382 enough for windows, which can't have more than INT_MAX lines anyway.
6383
fcb901a7
LMI
63842011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6385
0f2f6b6d
LMI
6386 * Require libxml/parser.h to avoid compilation warning.
6387
fcb901a7
LMI
6388 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6389
6390 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6391 since this reportedly can destroy thread storage.
6392
6e20a0d4
CY
63932011-08-30 Chong Yidong <cyd@stupidchicken.com>
6394
6395 * syntax.c (find_defun_start): Update all cache variables if
6396 exiting early (Bug#9401).
6397
148ae00e
EZ
63982011-08-30 Eli Zaretskii <eliz@gnu.org>
6399
f6cfbd8f
EZ
6400 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6401
148ae00e
EZ
6402 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6403 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6404 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6405
6406 * term.c (tty_append_glyph): New function.
6407 (produce_stretch_glyph): Static function and its prototype deleted.
6408
a66cfb1c
SM
6409 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6410 Add prototypes.
148ae00e 6411
c4a07a4c
PE
64122011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6413
6414 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6415 when checking :margin (Bug#9390).
6416 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6417 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6418 so that the name doesn't mislead. All uses changed.
6419
6bc8cd65
JB
64202011-08-28 Johan Bockgård <bojohan@gnu.org>
6421
6422 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6423 set_tty_hooks.
6424
dca4927e
EZ
64252011-08-27 Eli Zaretskii <eliz@gnu.org>
6426
6427 * xdisp.c (move_it_to): Don't bail out early when reaching
6428 position beyond to_charpos, if we are scanning backwards.
6429 (move_it_vertically_backward): When DY == 0, make sure we get to
6430 the first character in the line after the newline.
6431
f2cad773
PE
64322011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6433
6434 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6435 (ccl_driver): Do not generate an out-of-range pointer.
6436 (Fccl_execute_on_string): Remove unnecessary check for
6437 integer overflow, noted by Stefan Monnier in
6438 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6439 Remove a FIXME that didn't need fixing.
6440 Simplify the newly-introduced buffer reallocation code.
6441
0cae2cdb
JB
64422011-08-27 Juanma Barranquero <lekktu@gmail.com>
6443
6444 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6445
5fc295a4 64462011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6447
70c60eb2 6448 Integer and memory overflow issues (Bug#9196).
726e0ab1 6449
d31850da
PE
6450 * doc.c (get_doc_string): Rework so that
6451 get_doc_string_buffer_size is the actual buffer size, rather than
6452 being 1 less than the actual buffer size; this makes xpalloc more
6453 convenient.
6454
a69fbedb
PE
6455 * image.c (x_allocate_bitmap_record, cache_image):
6456 * xselect.c (Fx_register_dnd_atom):
6457 Simplify previous changes by using xpalloc.
6458
fe5c5d37
PE
6459 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6460 since either will do and ptrdiff_t is convenient with xpalloc.
6461
0065d054
PE
6462 * charset.c (charset_table_size)
6463 (struct charset_sort_data.priority): Now ptrdiff_t.
6464 (charset_compare): Don't overflow if priorities differ greatly.
6465 (Fsort_charsets): Don't assume list length fits in int.
6466 Check for size-calculation overflow when allocating sort data.
6467 (syms_of_charset): Allocate an initial charset table that is
6468 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6469
6470 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6471
6472 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6473 The actual value is always <= INT_MAX, and leaving it unsigned made
6474 overflow checking harder.
6475
6476 * dispextern.h (struct glyph_matrix.rows_allocated)
6477 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6478 with xpalloc. The values are still always <= INT_MAX.
6479
6480 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6481
6482 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6483 (SAFE_NALLOCA): New macro.
6484
6485 * region-cache.c (struct boundary.pos, find_cache_boundary)
6486 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6487 (set_cache_region, invalidate_region_cache)
6488 (revalidate_region_cache, know_region_cache, region_cache_forward)
6489 (region_cache_backward, pp_cache):
6490 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6491 so that ptrdiff_t * can be passed to xpalloc.
6492 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6493 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6494 (pp_cache): Don't assume cache_len fits in int.
6495 * region-cache.h: Adjust extern decls to match.
6496
6497 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6498 EMACS_INT, since either will do, for xpalloc.
6499
6500 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6501 (xnmalloc, xnrealloc, xpalloc): New functions.
6502
726e0ab1
PE
6503 * bidi.c (bidi_shelve_header_size): New constant.
6504 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6505 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6506
51f30bc5 6507 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6508 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6509 (overlay_strings):
6510 Don't update size of array until after memory allocation succeeds,
6511 because xmalloc/xrealloc may not return.
0065d054
PE
6512 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6513 now that we have proper integer overflow checking.
6514 (record_overlay_string, overlay_strings): Catch overflows when
6515 calculating size of overlay_str_buf.
726e0ab1 6516
0065d054
PE
6517 * callproc.c (Fcall_process): Check for size overflow when
6518 calculating size of args2.
6519 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6520 Normally we prefer signed values, but sticking with ptrdiff_t would
6521 require adding more-complicated checks.
726e0ab1
PE
6522
6523 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6524 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6525 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6526 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6527
6528 * character.c (Fstring): Check for size-calculation overflow.
6529
6530 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6531 unnecessary integer overflow. Check for size overflow.
6532 (encode_coding_object): Don't update size until xmalloc succeeds.
6533
6534 * composite.c (get_composition_id): Check for overflow in glyph
6535 length calculations.
6536
6537 Integer and memory overflow fixes for display code.
6538 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6539 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6540 (scrolling_window): Check for overflow in size calculations.
6541 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6542 Don't assume glyph table len fits in int.
6543 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6544 (row_table_size): Now ptrdiff_t, not int.
6545 (scrolling_window): Avoid overflow in size calculations.
6546 Don't update size until allocation succeeds.
6547 * fns.c (concat): Check for overflow in size calculations.
6548 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6549 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6550 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6551
6552 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6553 (get_doc_string): Check for size calculation overflow.
6554 Don't update size until allocation succeeds.
6555 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6556 EMACS_INT, where ptrdiff_t will do.
6557 (Fsubstitute_command_keys): Check for string overflow.
6558
6559 * editfns.c (set_time_zone_rule): Don't assume environment length
6560 fits in int.
6561 (message_length): Now ptrdiff_t, not int.
6562 (Fmessage_box): Don't update size until allocation succeeds.
6563 Don't assume message length fits in int.
6564 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6565
0065d054
PE
6566 * emacs.c (main): Do not reallocate argv, since there is a null at
6567 the end that can be overwritten, and this way there's no need to
6568 worry about size-calculation overflow.
6569 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6570
6571 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6572 alloc succeeds.
6573 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6574
6575 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6576 (x_set_scroll_bar_width, x_figure_window_size):
6577 Check for integer overflow.
6578 (x_set_alpha): Do not assume XINT fits in int.
6579
6580 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6581 This is for the members text_lines, text_cols, total_lines, total_cols,
6582 where the system imposes an 'int' limit.
6583
6584 * fringe.c (Fdefine_fringe_bitmap):
6585 Don't update size until alloc works.
6586
6587 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6588 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6589
6590 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6591 Check for size-calculation overflow.
6592 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6593 do, as we prefer signed integers.
6594 (id_to_widget.max_size, id_to_widget.used)
6595 (xg_store_widget_in_map, xg_remove_widget_from_map)
6596 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6597 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6598 Use and return ptrdiff_t, not int.
6599 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6600 * gtkutil.h: Change prototypes to match the above.
6601
6602 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6603 are duplicate now that they've been promoted to lisp.h.
6604 (x_allocate_bitmap_record, x_alloc_image_color)
6605 (make_image_cache, cache_image, xpm_load):
6606 Don't update size until alloc is done.
6607 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6608 (x_detect_edges):
3256efce 6609 Check for size calculation overflow.
726e0ab1
PE
6610 (ct_colors_allocated_max): New constant.
6611 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6612 overflow.
3256efce 6613
726e0ab1
PE
6614 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6615 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6616 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6617 Use ptrdiff_t, not int, to count maps.
6618 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
6619 calculations. Don't update size until allocation succeeds.
6620 Redo calculations to avoid overflow.
726e0ab1
PE
6621 * keyboard.h: Change prototypes to match the above.
6622
6623 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6624 to count maps.
6625 (current_minor_maps): Check for size calculation overflow.
6626 * keymap.h: Change prototypes to match the above.
6627
6628 * lread.c (read1, init_obarray): Don't update size until alloc done.
6629
6630 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6631 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6632
726e0ab1
PE
6633 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6634 Now ptrdiff_t, not int.
6635 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6636 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6637
6638 * process.c (Fnetwork_interface_list): Check for overflow
6639 in size calculation.
6640
6641 * region-cache.c (move_cache_gap): Check for size calculation overflow.
6642
6643 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6644 overflow. Don't bother calling xmalloc when xrealloc will do.
6645
6646 * search.c (Freplace_match): Check for size calculation overflow.
6647 (Fset_match_data): Don't assume list lengths fit in 'int'.
6648
6649 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6650 for command line length. Do not attempt to address one before the
6651 beginning of an array, as that's not portable.
6652
6653 * term.c (max_frame_lines): Remove; unused.
6654 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6655 not int.
6656 (encode_terminal_code, calculate_costs): Check for size
6657 calculation overflow.
6658 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6659 table lengths and related sizes. Don't update size until alloc
6660 done. Redo calculations to avoid overflow.
6661 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6662
6663 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6664 subtracting pointers.
6665 (gobble_line): Check for overflow more carefully. Don't update size
6666 until alloc done.
6667
6668 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6669 Don't update size until alloc done.
6670 Redo size calculations to avoid overflow.
6671 Check for size calculation overflow.
0065d054 6672 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
6673
6674 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6675 Use ptrdiff_t, not int, for sizes.
6676 (store_mode_line_noprop_char): Don't update size until alloc done.
6677
0065d054
PE
6678 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6679 Use ptrdiff_t, not int, for sizes.
6680 (Finternal_make_lisp_face, cache_face):
6681 Check for size calculation overflow.
6682 (cache_face): Treat size calculation overflows as if they were
6683 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
6684
6685 * xfns.c (x_encode_text, x_set_name_internal)
6686 (Fx_change_window_property): Use ptrdiff_t, not int, to count
6687 sizes, since they can exceed INT_MAX in size. Check for size
6688 calculation overflow.
6689
0065d054
PE
6690 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6691 (xg_select): Check for size calculation overflow.
726e0ab1
PE
6692 Don't update size until alloc done.
6693
0065d054 6694 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 6695 as sprintf is limited to int lengths.
1d526e2f 6696
252c5ee1
PE
6697 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6698 (X_LONG_MIN): New macros.
864d7ce7
PE
6699 Use them to make the following changes clearer.
6700 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6701 This change doesn't affect the value now, but it may help remind
6702 future maintainers not to raise the value too much later.
6703 (SELECTION_QUANTUM): Remove, replacing with ...
6704 (selection_quantum): ... new function, which avoids overflow.
6705 All uses changed.
6706 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6707 assumption that selection length fits in 'int'.
6708 (x_reply_selection_request, x_handle_selection_request)
6709 (x_get_window_property, receive_incremental_selection)
6710 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6711 (lisp_data_to_selection_data, clean_local_selection_data):
6712 Use ptrdiff_t, not int, to record length of selection.
6713 (x_reply_selection_request, x_get_window_property)
6714 (receive_incremental_selection, x_property_data_to_lisp):
6715 Redo calculations to avoid overflow.
6716 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 6717 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
6718 something.
6719 (x_get_window_property, receive_incremental_selection)
6720 (lisp_data_to_selection_data, x_property_data_to_lisp):
6721 Check for size-calculation overflow.
6722 (x_get_window_property, receive_incremental_selection)
6723 (lisp_data_to_selection_data, Fx_register_dnd_atom):
6724 Don't store size until memory allocation succeeds.
6725 (x_get_window_property): Plug memory leak on memory exhaustion.
6726 Don't double-block input; malloc is safe here. Don't assume 2**34
6727 - 4 fits in unsigned long. Add an xassert to check
6728 XGetWindowProperty overflow. Be more careful about overflow
6729 calculations, and distinguish size from memory overflow better.
6730 (receive_incremental_selection): When tracing, don't assume
6731 unsigned int is less than INT_MAX.
6732 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6733 harmful) conversions of unsigned short to int.
6734 (lisp_data_to_selection_data): Don't assume that integers
6735 in the range -65535 through -1 fit in an X unsigned short.
6736 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
6737 result parameters unless successful. Rely on cons_to_unsigned
6738 to report problems with elements; the old code wasn't right anyway.
6739 (x_check_property_data): Check for int overflow; we cannot use
6740 a wider type due to X limits.
6741 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6742
726e0ab1 6743 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 6744
0065d054
PE
6745 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6746 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
6747 (x_color_cells): Don't store size until memory allocation succeeds.
6748 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 6749 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
6750 (x_term_init): Don't assume length fits in int (sprintf is limited
6751 to int size).
bc18e09d 6752
ebfa62c0
PE
6753 Use ptrdiff_t for composition IDs.
6754 * character.c (lisp_string_width):
6755 * composite.c (composition_table_size, n_compositions)
6756 (get_composition_id, composition_gstring_from_id):
6757 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6758 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6759 * window.c (Frecenter):
6760 Use ptrdiff_t, not int, for composition IDs.
6761 * composite.c (get_composition_id): Check for integer overflow.
6762 * composite.h: Adjust prototypes to match the above changes.
6763
d3411f89
PE
6764 Use ptrdiff_t for hash table indexes.
6765 * category.c (hash_get_category_set):
6766 * ccl.c (ccl_driver):
6767 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6768 * coding.c (coding_system_charset_list, detect_coding_system):
6769 * coding.h (struct coding_system.id):
6770 * composite.c (get_composition_id, gstring_lookup_cache):
6771 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6772 * image.c (xpm_get_color_table_h):
6773 * lisp.h (hash_lookup, hash_put):
6774 * minibuf.c (Ftest_completion):
6775 Use ptrdiff_t for hash table indexes, not int (which is too
6776 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6777 32-bit --with-wide-int hosts).
6778
e097a6fa
PE
6779 * charset.c (Fdefine_charset_internal): Check for integer overflow.
6780 Add a FIXME comment about memory leaks.
6781 (syms_of_charset): Don't assume xmalloc returns.
6782
5637687f
PE
6783 Don't assume that stated character widths fit in int.
6784 * character.c (Fchar_width, c_string_width, lisp_string_width):
6785 * character.h (CHAR_WIDTH):
6786 * indent.c (MULTIBYTE_BYTES_WIDTH):
6787 Use sanitize_char_width to avoid undefined and/or bad behavior
6788 with outlandish widths.
a66cfb1c 6789 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
6790 now that we have two such functions. All uses changed.
6791 (sanitize_char_width): New inline function.
6792
a2271ba2
PE
6793 Don't assume that tab-width fits in int.
6794 * character.h (sanitize_width): New inline function.
6795 (SANE_TAB_WIDTH): New macro.
6796 (ASCII_CHAR_WIDTH): Use it.
6797 * indent.c (sane_tab_width): Remove. All uses replaced by
6798 SANE_TAB_WIDTH (current_buffer).
6799 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6800
18c52557
PE
6801 * fileio.c: Integer overflow issues with file modes.
6802 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6803
caeeedc1
PE
6804 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
6805 Remove unreachable code.
6806 (read_hex, load_charset_map_from_file): Check for integer overflow.
6807
6df6ae42 6808 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
6809 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6810 (x_send_scroll_bar_event): Likewise. Check that the size does not
6811 exceed limits imposed by XClientMessageEvent, as well as the usual
6812 ptrdiff_t and size_t limits.
6813
b13995db
PE
6814 * keyboard.c: Overflow, signedness and related fixes.
6815 (make_lispy_movement): Use same integer type in forward decl
6816 that is used in the definition.
6817 (read_key_sequence, keyremap_step):
6818 Change bufsize argument back to int, undoing my 2011-03-30 change.
6819 We prefer signed types, and int is wide enough here.
6820 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6821 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
6822 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
6823 length, not size_t. Use ptrdiff_t for index, not int.
6824 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6825 possibility of integer overflow.
6826
13464394
PE
6827 Overflow, signedness and related fixes for images.
6828
6829 * dispextern.h (struct it.stack[0].u.image.image_id)
6830 (struct_it.image_id, struct image.id, struct image_cache.size)
6831 (struct image_cache.used, struct image_cache.ref_count):
6832 * gtkutil.c (update_frame_tool_bar):
6833 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6834 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6835 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6836 * nsmenu.m (update_frame_tool_bar):
6837 * xdisp.c (calc_pixel_width_or_height):
6838 * xfns.c (image_cache_refcount):
6839 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6840 on typical 64-bit hosts.
6841
6842 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6843 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6844 Omit unnecessary casts to int.
6845 (parse_image_spec): Check that integers fall into 'int' range
6846 when the callers expect that.
6847 (image_ascent): Redo ascent calculation to avoid int overflow.
6848 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6849 (lookup_image): Remove unnecessary tests.
6850 (xbm_image_p): Locals are now of int, not EMACS_INT,
6851 since parse_image_check makes sure they fit into int.
6852 (png_load, gif_load, svg_load_image):
6853 Prefer int to unsigned where either will do.
6854 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
6855 old tiff_error_handler and tiff_warning_handler.
6856 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
6857 stack buffer overflows. It uses only the features of vsnprintf
6858 that are common to both POSIX and native Microsoft.
6859 (tiff_error_handler, tiff_warning_handler): Use it.
6860 (tiff_load, gif_load, imagemagick_load_image):
6861 Don't assume :index value fits in 'int'.
6862 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6863 (imagemagick_load_image): Check that crop parameters fit into
6864 the integer types that MagickCropImage accepts. Don't assume
6865 Vimagemagick_render_type has a nonnegative value. Don't assume
6866 size_t fits in 'long'.
6867 (gs_load): Use printmax_t to print the widest integers possible.
6868 Check for integer overflow when computing image height and width.
6869
c11821d4
EZ
68702011-08-26 Eli Zaretskii <eliz@gnu.org>
6871
6872 * xdisp.c (redisplay_window): Don't force window start if point
6873 will be invisible in the resulting window. (Bug#9324)
6874
0c95fcf7
EZ
68752011-08-25 Eli Zaretskii <eliz@gnu.org>
6876
6877 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6878 the display spec is of the form `(space ...)'.
6879 (handle_display_spec): Return the value returned by
6880 handle_single_display_spec, not just 1 or zero.
6881 (handle_single_display_spec): If the display spec is of the form
6882 `(space ...)', and specifies display in the text area, return 2
6883 rather than 1.
fee65a97 6884 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
6885 accurately, and prefer exact match for point under bidi.
6886 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
6887
6888 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6889 into disp_prop; all users changed.
6890
6891 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6892 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6893 for the text covered by the display property.
6894
e4ed06f1
CY
68952011-08-25 Chong Yidong <cyd@stupidchicken.com>
6896
6897 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
6898 Change return value to nil.
6899 (Frecord_buffer): Delete unused function.
6900
f67cdd7f
EZ
69012011-08-24 Eli Zaretskii <eliz@gnu.org>
6902
5980d4c6
EZ
6903 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
6904 buffers, return left-to-right.
8610fe8b
EZ
6905 (set_cursor_from_row): Consider candidate row a win if its glyph
6906 represents a newline and point is on that newline. Fixes cursor
6907 positioning on the newline at EOL of R2L text within L2R
6908 paragraph, and vice versa.
6909 (try_cursor_movement): Check continued rows, in addition to
6910 continuation rows. Fixes unwarranted scroll when point enters a
6911 continued line of R2L text within an L2R paragraph, or vice versa.
6912 (cursor_row_p): Consider the case of point being equal to
6913 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
6914 from the end of a short line to the beginning of a continued line
6915 of R2L text within L2R paragraph.
6916 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
6917 composed characters.
5980d4c6 6918
f67cdd7f
EZ
6919 * bidi.c (bidi_check_type): Use xassert.
6920 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
6921 members.
6922
bca633fb
EZ
69232011-08-23 Eli Zaretskii <eliz@gnu.org>
6924
6925 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
6926 a character.
6927
4a5885a7
CY
69282011-08-23 Chong Yidong <cyd@stupidchicken.com>
6929
6930 * nsfont.m (ns_otf_to_script): Fix typo.
6931
0902a04e
KH
69322011-08-22 Kenichi Handa <handa@m17n.org>
6933
6934 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
6935 extra slot even if the purpose is char-code-property-table.
6936
1a2e6670
EZ
69372011-08-23 Eli Zaretskii <eliz@gnu.org>
6938
8ddde651
EZ
6939 * xdisp.c (redisplay_window): When computing centering_position,
6940 account for the height of the header line. (Bug#8874)
6941
425cc014
EZ
6942 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
6943 instead of CHAR_TO_BYTE. Fixes a crash when a completion
6944 candidate is selected by the mouse, and that candidate has a
6945 composed character under the mouse.
6946
1a2e6670
EZ
6947 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
6948 coordinates reported by pos-visible-in-window-p for a composed
6949 character in column zero.
6950
8b76d6f8
SM
69512011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
6952
6953 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
6954
dac347dd
EZ
69552011-08-22 Eli Zaretskii <eliz@gnu.org>
6956
6957 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
6958 consider it a hit if to_charpos is anywhere in the range of the
6959 composed buffer positions.
6960
e013fb34
CY
69612011-08-22 Chong Yidong <cyd@stupidchicken.com>
6962
6963 * image.c (gif_load): Don't assume that each subimage has the same
6964 dimensions as the base image. Handle disposal method that is
6965 "undefined" by the gif spec (Bug#9335).
6966
bd1ba3e8
CY
69672011-08-20 Chong Yidong <cyd@stupidchicken.com>
6968
6969 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 6970 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 6971
54a1215b
EZ
69722011-08-19 Eli Zaretskii <eliz@gnu.org>
6973
823564e5
EZ
6974 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
6975 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
6976 from an Org mode buffer to a Speedbar frame.
6977
54a1215b
EZ
6978 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
6979 a composition, take its buffer position from IT->cmp_it.charpos.
6980 Fixes cursor positioning at the beginning of a line that begins
6981 with a composed character.
6982
9778ebcc
EZ
69832011-08-18 Eli Zaretskii <eliz@gnu.org>
6984
0be6ee06
EZ
6985 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
6986 character bidirectional type, use STRONG_L instead. Fixes crashes
6987 in a buffer produced by `describe-categories'.
6988
9778ebcc
EZ
6989 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
6990 members before the level stack, so they would be saved and
6991 restored when copying iterator state. Fixes incorrect reordering
6992 around TABs covered by display properties.
6993
156bffbe
AS
69942011-08-18 Andreas Schwab <schwab@linux-m68k.org>
6995
6b02f655 6996 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 6997
72ad093b
CY
69982011-08-17 Chong Yidong <cyd@stupidchicken.com>
6999
7000 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7001 (internal_condition_case_2, internal_condition_case_n):
7002 Remove unnecessary aborts (Bug#9081).
72ad093b 7003
35774242
EZ
70042011-08-17 Eli Zaretskii <eliz@gnu.org>
7005
7006 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7007 has no `load' handler, try opening the file locally. (Bug#9311)
7008
db76dd85
KB
70092011-08-16 Ken Brown <kbrown@cornell.edu>
7010
7011 * gmalloc.c: Expand comment.
7012
b215eee5
EZ
70132011-08-16 Eli Zaretskii <eliz@gnu.org>
7014
7015 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7016 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7017
a4579d33
KB
70182011-08-16 Ken Brown <kbrown@cornell.edu>
7019
7020 Fix memory allocation problems in Cygwin build (Bug#9273).
7021
7022 * unexcw.c ( __malloc_initialized): Declare external variable.
7023 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7024
8b76d6f8
SM
7025 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7026 New variables.
a4579d33
KB
7027 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7028 dumped emacs.
7029 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7030 in the static heap.
7031 [CYGWIN] (special_realloc): New function.
7032 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7033 requests to realloc storage in the static heap.
7034
3ebec551
PE
70352011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7036
7037 * bidi.c (bidi_initialize): Remove unused local.
7038
9fd8be00
EZ
70392011-08-15 Eli Zaretskii <eliz@gnu.org>
7040
6b02f655
SM
7041 * bidimirror.h:
7042 * biditype.h: Remove file.
7043 * makefile.w32-in ($(BLD)/bidi.$(O)):
7044 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7045
7046 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7047
7048 * chartab.c: Improve commentary for the uniprop_table API.
7049
32413314
EZ
7050 * bidi.c (bidi_paragraph_init): Support zero value of
7051 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7052 (bidi_initialize): Use uniprop_table instead of including
7053 biditype.h and bidimirror.h.
32413314 7054
9fd8be00
EZ
7055 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7056 coordinates of the iterator when restoring from ppos_it.
7057 (Bug#9296)
7058
5cf2b69b
KH
70592011-08-14 Kenichi Handa <handa@m17n.org>
7060
7061 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7062 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7063
daf17d00
EZ
70642011-08-14 Eli Zaretskii <eliz@gnu.org>
7065
7066 * xdisp.c (move_it_in_display_line_to): Don't invoke
7067 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7068 ppos_it. Fixes vertical cursor motion when line beginning is
7069 covered by an image. (Bug#9296)
7070
08e3161a
JD
70712011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7072
7073 * nsterm.h (ns_run_ascript): Declare.
7074 (NSAPP_DATA2_RUNASSCRIPT): Define.
7075
7076 * nsfns.m (as_script, as_result, as_status): New static variables.
7077 (ns_run_ascript): New function.
5e617bc2 7078 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7079 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7080 the event loop. Get status from as_status (Bug#7276).
7081
7082 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7083 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7084 the event loop (Bug#7276).
7085
a3720aa2
AS
70862011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7087
7088 * gnutls.c (QCgnutls_bootprop_priority)
7089 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7090 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7091 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7092 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7093 (QCgnutls_bootprop_verify_hostname_error)
7094 (QCgnutls_bootprop_callbacks_verify): Rename from
7095 Qgnutls_bootprop_..., all uses changed.
7096
7097 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7098 uses changed.
7099
0a0d27fb
PE
71002011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7101
19d5c50c
PE
7102 * xfaces.c (Qframe_set_background_mode): Now static.
7103 * dispextern.h (Qframe_set_background_mode): Remove decl.
7104
0a0d27fb
PE
7105 * process.c (Fnetwork_interface_info): Declare local only if needed.
7106
377538cb
JD
71072011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7108
7109 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7110 (Fnetwork_interface_list): Allocate in increments of bytes instead
7111 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7112 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7113 sockaddr.
7114 (struct ifflag_def): notrailers is smart on OSX.
7115 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7116 Get hardware address with getifaddrs if available.
7117
08fff70c
EZ
71182011-08-12 Eli Zaretskii <eliz@gnu.org>
7119
7120 * xdisp.c (iterate_out_of_display_property): xassert that
7121 IT->position is set to within IT->object's boundaries. Break from
7122 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7123 when IT->position is set up wrongly due to some bug.
7124 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7125 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7126 entry. Force push_it to save on the stack the current
7127 buffer/string position, to be restored by pop_it. Fix flags in
7128 the iterator structure wrt the object coming from a display
7129 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7130 properties. (Bug#9284)
7131
7be1c708 71322011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7133
7be1c708
CY
7134 * fontset.c (fontset_get_font_group): Add proper type checks.
7135 (Bug#9172)
aac0c6e3 7136
7be1c708 71372011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7138
7be1c708
CY
7139 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7140 and LC_VERSION_MIN_MACOSX.
7141 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7142 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7143
97bb72a6
EZ
71442011-08-08 Eli Zaretskii <eliz@gnu.org>
7145
7146 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7147 no-display-properties-and-no-overlays under bidi display.
7148 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7149 properties and overlays.
97bb72a6 7150
d5617611
CY
71512011-08-08 Chong Yidong <cyd@stupidchicken.com>
7152
37e11a63
CY
7153 * editfns.c (Fset_time_zone_rule): Document relationship with the
7154 setenv function.
7155
d5617611
CY
7156 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7157 the font entity extracted from the cache (Bug#8109).
7158
58872834
CY
71592011-08-07 Chong Yidong <cyd@stupidchicken.com>
7160
7161 * composite.c (autocmp_chars): Don't reset point. That is done by
7162 restore_point_unwind (Bug#5984).
7163
75bfc667
JL
71642011-08-07 Juri Linkov <juri@jurta.org>
7165
7166 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7167 to show the arg `TIME' instead of `TIMEVAL'.
7168
d1410150
EZ
71692011-08-06 Eli Zaretskii <eliz@gnu.org>
7170
7171 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7172 display property strides EOL and includes a newline, as in
7173 longlines-mode. (Bug#9254)
75b771e4
EZ
7174 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7175 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7176
7177 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7178 is non-zero, even if the data buffer is NULL. Fixes a crash in
7179 vertical-motion with longlines-mode. (Bug#9254)
7180
35928349
EZ
71812011-08-05 Eli Zaretskii <eliz@gnu.org>
7182
ec7cc85b
EZ
7183 * bidi.c <bidi_cache_total_alloc>: Now static.
7184 (bidi_initialize): Initialize bidi_cache_total_alloc.
7185
8b76d6f8 7186 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7187 cache. (Bug#9221)
7188
7189 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7190 amount allocated this far in `bidi_cache_total_alloc'.
7191 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7192 non-zero, only free the data buffer without restoring the cache
7193 contents. All callers changed.
7194
7195 * dispextern.h (bidi_unshelve_cache): Update prototype.
7196
7197 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7198 (move_it_in_display_line, move_it_to)
7199 (move_it_vertically_backward, move_it_by_lines): Replace the call
7200 to xfree to an equivalent call to bidi_unshelve_cache.
7201 (move_it_in_display_line_to): Fix logic of returning
412b6358 7202 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7203
e2e2423b
EZ
72042011-08-05 Eli Zaretskii <eliz@gnu.org>
7205
7206 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7207 came from a string character with a `cursor' property. (Bug#9229)
7208
ae9e757a
JD
72092011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7210
7211 * Makefile.in (LIB_PTHREAD): New variable.
7212 (LIBES): Add LIB_PTHREAD (Bug#9216).
7213
7214 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7215 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7216
213bd7f2
AS
72172011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7218
6b02f655 7219 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7220
99aaf75f
JD
72212011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7222
7223 * xterm.c (x_find_topmost_parent): New function.
7224 (x_set_frame_alpha): Find topmost parent window with
7225 x_find_topmost_parent and set the property there also (bug#9181).
7226 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7227
c74e9d86
PE
72282011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7229
7230 * callproc.c (Fcall_process): Avoid vfork clobbering
7231 the local vars buffer, coding_systems, current_dir.
7232
640c8776
SM
72332011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7234
7235 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7236
f26d0e4c
PE
72372011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7238
8a10d76c
PE
7239 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7240 so that it is not optimized away.
7241
f26d0e4c
PE
7242 * xdisp.c (compute_display_string_pos): Remove unused local.
7243
55439c61
EZ
72442011-08-02 Eli Zaretskii <eliz@gnu.org>
7245
7246 Fix slow cursor motion and scrolling in large buffers with
7247 selective display, like Org Mode buffers. (Bug#9218)
7248
7249 * dispextern.h (struct bidi_it): New member disp_prop_p.
7250
7251 * xdisp.c: Remove one-slot cache of display string positions.
7252 (compute_display_string_pos): Accept an additional argument
5e617bc2 7253 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7254 for a display string or property. If found, set DISP_PROP_P
7255 non-zero.
7256
7257 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7258 DISP_PROP_P, and pass it to compute_display_string_pos.
7259 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7260 non-zero. All callers of bidi_fetch_char changed.
7261
fb33fa43
SM
72622011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7263
7264 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7265
b099e063
DM
72662010-12-03 Don March <don@ohspite.net>
7267
7268 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7269 last character M-[char] is translated to ESC [char] (bug#7541).
7270
5cc7f7af
KH
72712011-08-02 Kenichi Handa <handa@m17n.org>
7272
d0fffa3f 7273 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7274
7275 * chartab.c (uniprop_table): Make it non-static.
7276
525d5e6e
EZ
72772011-08-01 Eli Zaretskii <eliz@gnu.org>
7278
7279 * xdisp.c (forward_to_next_line_start): Accept additional argument
7280 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7281 on the newline.
7282 (reseat_at_next_visible_line_start): Use the bidi iterator state
7283 returned by forward_to_next_line_start to restore the state of
7284 it->bidi_it after backing up to previous newline. (Bug#9212)
7285
31011111
AS
72862011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7287
7288 * regex.c (re_comp): Protoize.
7289 (re_exec): Fix return type.
7290 (regexec): Fix type of `ret'. (Bug#9203)
7291
476371c4
PE
72922011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7293
e5d76069
PE
7294 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7295 This is needed if max-image-size is a floating-point number.
7296
9a79b20c
AS
72972011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7298
7299 * print.c (print_object): Print empty symbol as ##.
7300
7301 * lread.c (read1): Read ## as empty symbol.
7302
d8c2fa78
AA
73032011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7304
7305 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7306 setting frame foreground color (Bug#9175).
7307 (x_set_background_color): Likewise.
7308
ffe57a7a
AA
7309 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7310 contents (Bug#9176).
7311 (EmacsTooltip -init): Remove bezels and add shadows to
7312 tooltip windows.
7313
bf3492a5
AA
7314 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7315 or scroll bar (Bug#8470).
7316
d55e9c53
AA
7317 * nsfont.m (nsfont_open): Remove assignment to voffset and
7318 unnecessary vars hshink, expand, hd, full_height, min_height.
7319 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7320
7321 * nsterm.h (nsfont_info): Remove voffset field.
7322
d8c2fa78 73232011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7324
7325 Implement strike-through and overline on NextStep (Bug#8863).
7326
7327 * nsfont.m (nsfont_open): Use underline position provided by font,
7328 instead of hard-coded value of 2.
7329 (nsfont_draw): Call ns_draw_text_decoration instead.
7330
7331 * nsterm.h: Add declaration for ns_draw_text_decoration.
7332
7333 * nsterm.m (ns_draw_text_decoration): New function for drawing
7334 underline, overline, and strike-through.
7335 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7336 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7337 accommodate underlining, etc.
4843aac3 7338
4cc60b9b
EZ
73392011-07-28 Eli Zaretskii <eliz@gnu.org>
7340
bc7ece87
EZ
7341 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7342 default.
4cc60b9b 7343
476371c4
PE
73442011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7345
66606eea
PE
7346 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7347 Without this fix, if a signal arrives just after memory fills up,
7348 'malloc' might be invoked reentrantly.
7349
476371c4
PE
7350 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7351 In other words, assume that every image size is allowed, on non-X
7352 hosts. This assumption is probably wrong, but it lets Emacs compile.
7353
f3fcc40d
AS
73542011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7355
7356 * regex.c (re_iswctype): Convert return values to boolean.
7357
350c992f
EZ
73582011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7359
7360 * xdisp.c (compute_display_string_pos): Don't use cached display
7361 string position if the buffer had its restriction changed.
7362 (Bug#9184)
7363
5266b4bb
PE
73642011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7365
7366 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7367
2573a837 73682011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7369
41f55ccd 7370 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7371
39e378da
PE
7372 * bidi.c: Integer size and overflow fixes.
7373 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7374 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7375 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7376 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7377 (bidi_find_other_level_edge):
7378 Use ptrdiff_t instead of EMACS_INT where either will do.
7379 This works better on 32-bit hosts configured --with-wide-int.
7380 (bidi_cache_ensure_space): Check for size-calculation overflow.
7381 Use % rather than repeated addition, for better worst-case speed.
7382 Don't set bidi_cache_size until after xrealloc returns, because it
7383 might not return.
7384 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7385 (bidi_cache_ensure_space): Also check that the bidi cache size
7386 does not exceed that of the largest Lisp string or buffer. See Eli
7387 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7388
5e927815
PE
7389 * alloc.c (__malloc_size_t): Remove.
7390 All uses replaced by size_t. See Andreas Schwab's note
7391 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7392
ca4aa935
PE
7393 * image.c: Improve checking for integer overflow.
7394 (check_image_size): Assume that f is nonnull, since
7395 it is always nonnull in practice. This is one less thing to
7396 worry about when checking for integer overflow later.
7397 (x_check_image_size): New function, which checks for integer
7398 overflow issues inside X.
7399 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7400 This removes the need for a memory_full check.
7401 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7402 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7403 (xbm_read_bitmap_data): Change locals back to 'int', since
7404 their values must fit in 'int'.
7405 (xpm_load_image, png_load, tiff_load):
7406 Invoke x_create_x_image_and_pixmap earlier,
7407 to avoid much needless work if the image is too large.
7408 (tiff_load): Treat overly large images as if
7409 x_create_x_image_and_pixmap failed, not as malloc failures.
7410 (gs_load): Use x_check_image_size.
7411
5f8f9cc2
PE
7412 * gtkutil.c: Omit integer casts.
7413 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7414 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7415
5adf60bc
PE
7416 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7417
c8907a93
PE
7418 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7419 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7420 would wrongly return t on a 64-bit host.
7421
e3c25c68
PE
7422 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7423 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7424 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7425 and therefore cause GCC to emit a bogus diagnostic in some cases.
7426
3f791afe
PE
7427 * image.c: Integer signedness and overflow and related fixes.
7428 This is not an exhaustive set of fixes, but it's time to
7429 record what I've got.
7430 (lookup_pixel_color, check_image_size): Remove redundant decls.
7431 (check_image_size): Don't assume that arbitrary EMACS_INT values
7432 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7433 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7434 (tiff_load, imagemagick_load_image):
7435 Check for overflow in size calculations.
7436 (x_create_x_image_and_pixmap): Remove unnecessary test for
7437 xmalloc returning NULL; that can't happen.
7438 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7439 (xpm_color_bucket): Use better integer hashing function.
7440 (xpm_cache_color): Don't possibly over-allocate memory.
7441 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7442 (gif_memory_source):
7443 Use ptrdiff_t, not int or size_t, to record sizes.
7444 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7445 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7446 either works, as we prefer signed integers.
7447 (tiff_read_from_memory, tiff_write_from_memory):
7448 Return tsize_t, not size_t, since that's what the TIFF API wants.
7449 (tiff_read_from_memory): Don't fail simply because the read would
7450 go past EOF; instead, return a short read.
7451 (tiff_load): Omit no-longer-needed casts.
7452 (Fimagemagick_types): Don't assume size fits into 'int'.
7453
3cc5a532
PE
7454 Improve hashing quality when configured --with-wide-int.
7455 * fns.c (hash_string): New function, taken from sxhash_string.
7456 Do not discard information about ASCII character case; this
7457 discarding is no longer needed.
7458 (sxhash-string): Use it. Change sig to match it. Caller changed.
7459 * lisp.h: Declare it.
7460 * lread.c (hash_string): Remove, since we now use fns.c's version.
7461 The fns.c version returns a wider integer if --with-wide-int is
7462 specified, so this should help the quality of the hashing a bit.
7463
b312a492
PE
7464 * emacs.c: Integer overflow minor fix.
7465 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7466 Define only if GNU_LINUX.
7467 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7468
dfd153ae
PE
7469 * dispnew.c: Integer signedness and overflow fixes.
7470 Remove unnecessary forward decls, that were a maintenance hassle.
7471 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7472 All uses changed.
7473 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7474 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7475 (prepare_desired_row, line_draw_cost):
7476 Use int, not unsigned, where either works.
7477 (save_current_matrix, restore_current_matrix):
7478 Use ptrdiff_t, not size_t, where either works.
7479 (init_display): Check for overflow more accurately, and without
7480 relying on undefined behavior.
7481
a81d11a3
PE
7482 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7483 Remove, replacing with the new symbols in lisp.h. All uses changed.
7484 * fileio.c (make_temp_name):
7485 * filelock.c (lock_file_1, lock_file):
7486 * xdisp.c (message_dolog):
7487 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7488 Use pMd etc. instead.
7489 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7490 replacing the pWIDE etc. symbols removed from editfns.c.
7491
3300e6fd
PE
7492 * keyboard.h (num_input_events): Now uintmax_t.
7493 This is (very slightly) less likely to mess up due to wraparound.
7494 All uses changed.
7495
fd05c7e9
PE
7496 * buffer.c: Integer signedness fixes.
7497 (alloc_buffer_text, enlarge_buffer_text):
7498 Use ptrdiff_t rather than size_t when either will do, as we prefer
7499 signed integers.
7500
903fe15d
PE
7501 * alloc.c: Integer signedness and overflow fixes.
7502 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7503 (__malloc_size_t): Default to size_t, not to int.
7504 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7505 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7506 Prefer ptrdiff_t to size_t when either would do, as we prefer
7507 signed integers.
7508 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7509 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7510 Now const. Initialize with values that are in range even if char
7511 is signed.
7512 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7513 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7514 These functions do the right thing with sizes > 2**32.
7515 (check_depth): Now ptrdiff_t, not int.
7516 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7517 Adjust to new way of storing sizes. Check for size overflow bugs
7518 in rest of code.
7519 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7520 slightly wrong anyway, as it missed one instance of
7521 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7522 (refill_memory_reserve): Omit needless cast to size_t.
7523 (mark_object_loop_halt): Mark as externally visible.
7524
ac82cc6a
PE
7525 * xselect.c: Integer signedness and overflow fixes.
7526 (Fx_register_dnd_atom, x_handle_dnd_message):
7527 Use ptrdiff_t, not size_t, since we prefer signed.
7528 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7529 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7530 x_dnd_atoms_size and x_dnd_atoms_length.
7531
c2d1e36d
PE
7532 * doprnt.c: Prefer signed to unsigned when either works.
7533 * eval.c (verror):
7534 * doprnt.c (doprnt):
7535 * lisp.h (doprnt):
7536 * xdisp.c (vmessage):
7537 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7538 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7539 prefer signed arithmetic to avoid comparison confusion.
7540 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7541 but is a bit tricky.
7542
0e926e56
PE
7543 Assume freestanding C89 headers, string.h, stdlib.h.
7544 * data.c, doprnt.c, floatfns.c, print.c:
7545 Include float.h unconditionally.
7546 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7547 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7548 * regex.c: Likewise for stddef.h, string.h.
7549 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7550 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7551 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7552 (STDC_HEADERS): Remove obsolete defines.
7553 * sysdep.c: Include limits.h unconditionally.
7554
9cfdb3ec
PE
7555 Assume support for memcmp, memcpy, memmove, memset.
7556 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7557 * regex.c (memcmp, memcpy):
7558 Remove; we assume C89 now.
7559
7560 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7561 (__malloc_safe_bcopy): Remove; no longer needed.
7562
cf950e6b 7563 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7564 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7565 well either way, and we prefer signed to unsigned.
7566
dbf38e02
LMI
75672011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7568
7569 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7570 closes the connection while we're reading (bug#9182).
7571
d6f0886c 75722011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7573
d6f0886c
JD
7574 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7575 are specified (Bug#9168).
24e0f6b1 7576
2eb1f9e6
PE
75772011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7578
7579 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7580 Found by GCC static checking and --with-wide-int on a 32-bit host.
7581
22381272 75822011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7583
7584 * xdisp.c (compute_display_string_pos): Fix logic of caching
7585 previous display string position. Initialize cached_prev_pos to
7586 -1. Fixes slow-down at the beginning of a buffer.
7587
f25e39b4
EZ
75882011-07-24 Eli Zaretskii <eliz@gnu.org>
7589
7590 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7591 for attrs[LFACE_FONTSET_INDEX].
7592
04c4b52e
PE
75932011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7594
7595 * xml.c (parse_region): Remove unused local
7596 that was recently introduced.
7597
c1734fbd
EZ
75982011-07-23 Eli Zaretskii <eliz@gnu.org>
7599
be18c5a5
EZ
7600 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7601 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7602
c1734fbd
EZ
7603 * xdisp.c (move_it_in_display_line_to): Record the best matching
7604 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
7605 exit if none of the characters scanned was an exact match.
7606 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
7607 when exact match is impossible due to invisible text, and the
7608 lines are truncated.
7609
a258d627
JD
76102011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7611
7612 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7613 for OSX >= 10.7.
7614
b6d5a689
EZ
76152011-07-22 Eli Zaretskii <eliz@gnu.org>
7616
0f74f785
EZ
7617 Fix a significant slow-down of cursor motion with C-n, C-p,
7618 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7619 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 7620 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
7621 (next_element_from_buffer): Call compute_stop_pos_backwards to
7622 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
7623 base_level_stop.
7624 (reseat): Don't look for prev_stop, as that could mean a very long
7625 run.
7626 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7627 <cached_disp_overlay_modiff>: Cache for last found display string
7628 position.
551918c1 7629 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
7630 about the same buffer in the same area of character positions, and
7631 the buffer wasn't changed since the time the display string
7632 position was cached.
551918c1 7633
b2d0c91a
EZ
76342011-07-22 Eli Zaretskii <eliz@gnu.org>
7635
7636 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7637 is an integer, which is important for empty lines. (Bug#9149)
7638
043604ee
CY
76392011-07-22 Chong Yidong <cyd@stupidchicken.com>
7640
7641 * frame.c (Fmodify_frame_parameters): In tty case, update the
7642 default face if necessary (Bug#4238).
7643
da4adb04
CY
76442011-07-21 Chong Yidong <cyd@stupidchicken.com>
7645
7646 * editfns.c (Fstring_to_char): No need to explain what a character
7647 is in the docstring (Bug#6576).
7648
9abd0532
LMI
76492011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7650
7651 * xml.c (parse_region): Make sure we always return a tree.
7652
36881d16
HK
76532011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7654
7655 * xml.c (parse_region): If a document contains only comments,
7656 return that, too.
7657
1e98674d
LMI
76582011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7659
7660 * xml.c (make_dom): Return comments, too.
7661
590bd467
PE
76622011-07-19 Paul Eggert <eggert@cs.ucla.edu>
7663
7664 Port to OpenBSD.
7665 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7666 and the surrounding thread.
7667 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7668 rather than fgets, and retry after EINTR. Otherwise, 'emacs
7669 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7670 timer goes off.
7671 * s/openbsd.h (BROKEN_SIGIO): Define.
7672 * unexelf.c (unexec) [__OpenBSD__]:
7673 Don't update the .mdebug section of the Alpha COFF symbol table.
7674
f41628b2
LMI
76752011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7676
7677 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7678 (bug#8460).
7679
b59b67c5
PE
76802011-07-18 Paul Eggert <eggert@cs.ucla.edu>
7681
15e3a074
PE
7682 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7683 This fixes some race conditions on the permissions of any newly
7684 created file.
7685
41bed37d
PE
7686 * alloc.c (valid_pointer_p): Use pipe, not open.
7687 This fixes some permissions issues when debugging.
7688
b59b67c5
PE
7689 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
7690 If fchown fails to set both uid and gid, try to set just gid,
7691 as that is sometimes allowed. Adjust the file's mode to eliminate
7692 setuid or setgid bits that are inappropriate if fchown fails.
7693
925a6be7
SM
76942011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7695
7696 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7697 to compare Lisp_Objects.
7698 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7699 global_gnutls_log_level, don't mistake it for a Lisp_Object.
7700 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7701
52968808
AS
77022011-07-17 Andreas Schwab <schwab@linux-m68k.org>
7703
0a6a104b
AS
7704 * lread.c (read_integer): Unread even EOF character.
7705 (read1): Likewise. Properly record start position of symbol.
7706
52968808
AS
7707 * lread.c (read1): Read `#:' as empty uninterned symbol if no
7708 symbol character follows.
7709
9e381cdd
PE
77102011-07-17 Paul Eggert <eggert@cs.ucla.edu>
7711
7712 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
7713 This works around a problem with the previous change to Fcopy_file.
7714 Recent glibc declares fchown with __attribute__((warn_unused_result)),
7715 and without this change, GCC might complain about discarding
7716 fchown's return value.
7717
b5641435
JB
77182011-07-16 Juanma Barranquero <lekktu@gmail.com>
7719
7720 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7721
a8031457
PE
77222011-07-16 Paul Eggert <eggert@cs.ucla.edu>
7723
7724 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
7725
dd889327
LMI
77262011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
7727
750c33f7
LMI
7728 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7729 it's used from the C level.
7730
dd889327
LMI
7731 * process.c: Use the same condition for POLL_FOR_INPUT in both
7732 keyboard.c and process.c (bug#1858).
7733
87e86684
LM
77342011-07-09 Lawrence Mitchell <wence@gmx.li>
7735
7736 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7737 (Fgnutls_boot): Use it.
7738
64348f40
AS
77392011-07-15 Andreas Schwab <schwab@linux-m68k.org>
7740
7741 * doc.c (Fsubstitute_command_keys): Revert last change.
7742
1d698799
LMI
77432011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
7744
f863868c
LMI
7745 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7746 quotes the next character, and doesn't affect other longer
7747 sequences (bug#8935).
7748
1d698799
LMI
7749 * lread.c (syms_of_lread): Clarify that is isn't only
7750 `eval-buffer' and `eval-defun' that's affected by
7751 `lexical-binding' (bug#8460).
7752
aa4b6df6
EZ
77532011-07-15 Eli Zaretskii <eliz@gnu.org>
7754
7755 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 7756 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 7757
5d856da6
PE
77582011-07-14 Paul Eggert <eggert@cs.ucla.edu>
7759
ad6042bb
PE
7760 Fix minor problems found by static checking.
7761 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7762 (elsz): Now a signed constant, not a size_t var. We prefer signed
7763 types to unsigned, to avoid integer comparison confusion. Without
7764 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7765 "cannot optimize loop, the loop counter may overflow", a symptom
7766 of the confusion.
f00bbb22 7767 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
7768 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7769
6468f31c
LMI
77702011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7771
49080b10
LMI
7772 * search.c (Fre_search_backward): Mention `case-fold-search' in
7773 all the re_search_* functions (bug#8138).
7774
6468f31c
LMI
7775 * keyboard.c (Fopen_dribble_file): Document when the file is
7776 closed (bug#8056).
7777
c965adc5
EZ
77782011-07-14 Eli Zaretskii <eliz@gnu.org>
7779
df9733bf
EZ
7780 * bidi.c (bidi_dump_cached_states): Fix format of displaying
7781 bidi_cache_idx.
7782
0bb23927
EZ
7783 Support bidi reordering of display and overlay strings.
7784 * xdisp.c (compute_display_string_pos)
7785 (compute_display_string_end): Accept additional argument STRING.
7786 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7787 (reseat_to_string): Initialize bidi_it->string.s and
7788 bidi_it->string.schars.
7789 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
7790 NULL (avoids a crash in bidi_paragraph_init).
7791 Initialize itb.string.lstring.
0bb23927
EZ
7792 (init_iterator): Call bidi_init_it only of a valid
7793 buffer position was specified. Initialize paragraph_embedding to
7794 L2R.
7795 (reseat_to_string): Initialize the bidi iterator.
7796 (display_string): If we need to ignore text properties of
7797 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
7798 original value of -1 will not work with bidi.)
7799 (compute_display_string_pos): First arg is now struct
7800 `text_pos *'; all callers changed. Support display properties on
7801 Lisp strings.
7802 (compute_display_string_end): Support display properties on Lisp
7803 strings.
7804 (init_iterator, reseat_1, reseat_to_string): Initialize the
7805 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7806 when iterating on a string not from display properties).
640c8776
SM
7807 (compute_display_string_pos, compute_display_string_end):
7808 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
7809 arrow keys.
7810 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
7811 base_level_stop; instead, set base_level_stop to BEGV.
7812 Fixes crashes in vertical-motion.
0bb23927
EZ
7813 (next_element_from_buffer): Improve commentary for when
7814 the iterator is before prev_stop.
7815 (init_iterator): Initialize bidi_p from the default value of
7816 bidi-display-reordering, not from buffer-local value. Use the
7817 buffer-local value only if initializing for buffer iteration.
7818 (handle_invisible_prop): Support invisible properties on strings
7819 that are being bidi-reordered.
7820 (set_iterator_to_next): Support bidi reordering of C strings and
7821 Lisp strings.
7822 (next_element_from_string): Support bidi reordering of Lisp
7823 strings.
7824 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
7825 (display_string): Support display of R2L glyph rows.
7826 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
7827 (init_iterator): Don't initialize it->bidi_p for strings
7828 here.
7829 (reseat_to_string): Initialize it->bidi_p for strings here.
7830 (next_element_from_string, next_element_from_c_string)
7831 (next_element_from_buffer): Add xassert's for correspondence
7832 between IT's object being iterated and it->bidi_it.string
7833 structure.
7834 (face_before_or_after_it_pos): Support bidi iteration.
7835 (next_element_from_c_string): Handle the case of the first string
7836 character that is not the first one in the visual order.
7837 (get_visually_first_element): New function, refactored from common
7838 parts of next_element_from_buffer, next_element_from_string, and
7839 next_element_from_c_string.
7840 (tool_bar_lines_needed, redisplay_tool_bar)
7841 (display_menu_bar): Force left-to-right direction. Add a FIXME
7842 comment for making that be controlled by a user option.
7843 (push_it, pop_it): Save and restore the state of the
7844 bidi iterator. Save and restore the bidi_p flag.
7845 (pop_it): Iterate out of display property for string iteration as
7846 well.
7847 (iterate_out_of_display_property): Support iteration over strings.
7848 (handle_single_display_spec): Set up it->bidi_it for iteration
7849 over a display string, and call bidi_init_it.
7850 (handle_single_display_spec, next_overlay_string)
7851 (get_overlay_strings_1, push_display_prop): Set up the bidi
7852 iterator for displaying display or overlay strings.
7853 (forward_to_next_line_start): Don't use the shortcut if
7854 bidi-iterating.
7855 (back_to_previous_visible_line_start): If handle_display_prop
7856 pushed the iterator stack, restore the internal state of the bidi
7857 iterator by calling bidi_pop_it same number of times.
7858 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7859 and we are bidi-iterating, don't decrement the iterator position;
7860 instead, set the first_elt flag in the bidi iterator, to produce
7861 the same effect.
7862 (reseat_1): Remove redundant setting of string_from_display_prop_p.
7863 (push_display_prop): xassert that we are iterating a buffer.
7864 (push_it, pop_it): Save and restore paragraph_embedding member.
7865 (handle_single_display_spec, next_overlay_string)
7866 (get_overlay_strings_1, reseat_1, reseat_to_string)
7867 (push_display_prop): Set up the `unibyte' member of bidi_it.string
7868 correctly. Don't assume unibyte strings are not bidi-reordered.
7869 (compute_display_string_pos)
7870 (compute_display_string_end): Fix handling the case of C string.
7871 (push_it, pop_it): Save and restore from_disp_prop_p.
7872 (handle_single_display_spec, push_display_prop): Set the
7873 from_disp_prop_p flag.
7874 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7875 (pop_it): Call iterate_out_of_display_property only if we are
7876 popping after iteration over a string that came from a display
7877 property. Fix a typo in popping stretch info. Add an assertion
7878 for verifying that the iterator position is in sync with the bidi
7879 iterator.
7880 (handle_single_display_spec, get_overlay_strings_1)
7881 (push_display_prop): Fix initialization of paragraph direction for
7882 string when that of the parent object is not yet determined.
7883 (reseat_1): Call bidi_init_it to resync the bidi
7884 iterator with IT's position. (Bug#7616)
7885 (find_row_edges): If ROW->start.pos gives position
7886 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
7887 (handle_stop, back_to_previous_visible_line_start, reseat_1):
7888 Reset the from_disp_prop_p flag.
7889 (SAVE_IT, RESTORE_IT): New macros.
7890 (pos_visible_p, face_before_or_after_it_pos)
7891 (back_to_previous_visible_line_start)
7892 (move_it_in_display_line_to, move_it_in_display_line)
7893 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7894 (try_scrolling, redisplay_window, display_line): Use them when
7895 saving a temporary copy of the iterator and restoring it back.
7896 (back_to_previous_visible_line_start, reseat_1)
7897 (init_iterator): Empty the bidi cache "stack".
7898 (move_it_in_display_line_to): If iterator ended up at
7899 EOL, but we never saw any buffer positions smaller than
7900 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
7901 motion in bidi-reordered lines.
7902 (move_it_in_display_line_to): Record prev_method and prev_pos
7903 immediately before the call to set_iterator_to_next. Fixes cursor
7904 motion in bidi-reordered lines with stretch glyphs and strings
7905 displayed in margins. (Bug#8133) (Bug#8867)
7906 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
7907 TO_CHARPOS.
640c8776
SM
7908 (pos_visible_p): Support positions in bidi-reordered lines.
7909 Save and restore bidi cache.
0bb23927
EZ
7910
7911 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
7912 (bidi_paragraph_info): Delete unused struct.
7913 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
7914 (bidi_cache_start): New variable.
7915 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
7916 to zero.
7917 (bidi_cache_fetch_state, bidi_cache_search)
7918 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7919 (bidi_cache_find, bidi_peek_at_next_level)
7920 (bidi_level_of_next_char, bidi_find_other_level_edge)
7921 (bidi_move_to_visually_next): Compare cache index with
7922 bidi_cache_start rather than with zero.
7923 (bidi_fetch_char): Accept new argument STRING; all callers
7924 changed. Support iteration over a string. Support strings with
7925 display properties. Support unibyte strings. Fix the type of
7926 `len' according to what STRING_CHAR_AND_LENGTH expects.
7927 (bidi_paragraph_init, bidi_resolve_explicit_1)
7928 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
7929 (bidi_level_of_next_char, bidi_move_to_visually_next):
7930 Support iteration over a string.
0bb23927
EZ
7931 (bidi_set_sor_type, bidi_resolve_explicit_1)
7932 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
7933 can now be zero (for strings); special values 0 and -1 were
7934 changed to -1 and -2, respectively.
7935 (bidi_char_at_pos): New function.
7936 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
7937 Call it instead of FETCH_MULTIBYTE_CHAR.
7938 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
7939 initialized to valid values.
7940 (bidi_init_it): Don't initialize charpos and bytepos with invalid
7941 values.
7942 (bidi_level_of_next_char): Allow the sentinel "position" to pass
7943 the test for valid cached positions. Fix the logic for looking up
7944 the sentinel state in the cache. GCPRO the Lisp string we are
7945 iterating.
7946 (bidi_push_it, bidi_pop_it): New functions.
7947 (bidi_initialize): Initialize the bidi cache start stack pointer.
7948 (bidi_cache_ensure_space): New function, refactored from part of
7949 bidi_cache_iterator_state. Don't assume the required size is just
7950 one BIDI_CACHE_CHUNK away.
7951 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
7952 (bidi_count_bytes, bidi_char_at_pos): New functions.
7953 (bidi_cache_search): Don't assume bidi_cache_last_idx is
7954 always valid if bidi_cache_idx is valid.
7955 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
7956 is valid if it's going to be used.
7957 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
7958 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
7959 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7960 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
7961 (bidi_find_other_level_edge, bidi_cache_start_stack):
7962 All variables related to cache indices are now EMACS_INT.
c965adc5 7963
0bb23927
EZ
7964 * dispextern.h (struct bidi_string_data): New structure.
7965 (struct bidi_it): New member `string'. Make flag members be 1-bit
7966 fields, and put them last in the struct.
640c8776
SM
7967 (compute_display_string_pos, compute_display_string_end):
7968 Update prototypes.
0bb23927
EZ
7969 (bidi_push_it, bidi_pop_it): Add prototypes.
7970 (struct iterator_stack_entry): New members bidi_p,
7971 paragraph_embedding, and from_disp_prop_p.
7972 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
7973 (bidi_shelve_cache, bidi_unshelve_cache):
7974 Declare prototypes.
0bb23927
EZ
7975
7976 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
7977 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
7978 and vector-like objects.
7979
7980 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
7981 cache around display iteration.
7982
7983 * window.c (Fwindow_end, window_scroll_pixel_based)
7984 (displayed_window_lines, Frecenter): Save and restore the bidi
7985 cache around display iteration.
7986
3bbd2265
LMI
79872011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7988
7989 * editfns.c (Fdelete_region): Clarify the use of the named
7990 parameters (bug#6788).
7991
adc47434
MR
79922011-07-14 Martin Rudalics <rudalics@gmx.at>
7993
7994 * indent.c (Fvertical_motion): Set and restore w->pointm when
7995 saving and restoring the window's buffer (Bug#9006).
7996
837c31f8
LMI
79972011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
7998
7999 * editfns.c (Fstring_to_char): Clarify just what is returned
8000 (bug#6576). Text by Eli Zaretskii.
8001
ac389d0c
JB
80022011-07-13 Juanma Barranquero <lekktu@gmail.com>
8003
8004 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8005
0be0ce47
EZ
80062011-07-13 Eli Zaretskii <eliz@gnu.org>
8007
8008 * buffer.c (mmap_find): Fix a typo.
8009
cd18e7e3
JB
80102011-07-13 Johan Bockgård <bojohan@gnu.org>
8011
8012 Fix execution of x selection hooks.
8013 * xselect.c (Qx_lost_selection_functions)
8014 (Qx_sent_selection_functions): New vars.
8015 (syms_of_xselect): DEFSYM them.
8016 (x_handle_selection_request): Pass Qx_sent_selection_functions
8017 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8018 (x_handle_selection_clear,x_clear_frame_selections):
8019 Pass Qx_lost_selection_functions rather than
8020 Vx_lost_selection_functions to Frun_hook_with_args.
8021
47ea7f44
PE
80222011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8023
ac389d0c 8024 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8025 The old code sometimes used this field without initializing it.
8026
47ea7f44
PE
8027 * alloc.c (gc_sweep): Don't read past end of array.
8028 In theory, the old code could also have corrupted Emacs internals,
8029 though it'd be very unlikely.
8030
bc985c87
AS
80312011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8032
8033 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8034 argument. (Bug#4026)
bc985c87 8035
0cf34688
LMI
80362011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8037
b3dadd76
LMI
8038 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8039 key" (bug#4257).
8040
0cf34688
LMI
8041 * window.c (Fset_window_start): Doc fix (bug#4199).
8042 (Fset_window_hscroll): Ditto.
8043
270768cd
PE
80442011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8045
077e3dda 8046 Fix minor new problems caught by GCC 4.6.1.
270768cd 8047 * term.c (init_tty): Remove unused local.
490011a6 8048 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8049 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8050 not used otherwise.
270768cd 8051
b1f58454
CY
80522011-07-12 Chong Yidong <cyd@stupidchicken.com>
8053
8054 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8055
22b9578d
LMI
80562011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8057
6e70ab07
LMI
8058 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8059 are the mini-buffer and the echo area (bug#3320).
8060
22b9578d
LMI
8061 * term.c (init_tty): Remove support for supdup, c10 and perq
8062 terminals, which are no longer supported (bug#1482).
8063
8974cc9f
JB
80642011-07-10 Johan Bockgård <bojohan@gnu.org>
8065
8066 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8067
a560d974
JD
80682011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8069
8070 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8071 for non-popups (Bug#3642).
8072
1dae0f0a
AS
80732011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8074
268c2c36 8075 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8076 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8077 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8078 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8079 * data.c (fmod): Likewise.
8080 * dispnew.c (swap_glyphs_in_rows): Likewise.
8081 * emacs.c (memory_warning_signal): Likewise.
8082 * floatfns.c (float_error): Likewise.
8083 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8084 (otf_open, font_otf_capability, generate_otf_features)
8085 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8086 Likewise.
8087 * image.c (pbm_read_file): Likewise.
8088 * indent.c (string_display_width): Likewise.
8089 * intervals.c (check_for_interval, search_for_interval)
8090 (inc_interval_count, count_intervals, root_interval)
8091 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8092 * lread.c (defalias): Likewise.
268c2c36 8093 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8094 * regex.c (set_image_of_range_1, set_image_of_range)
8095 (regex_grow_registers): Likewise.
8096 * sysdep.c (strerror): Likewise.
8097 * termcap.c (valid_filename_p, tprint, main): Likewise.
8098 * tparam.c (main): Likewise.
8099 * unexhp9k800.c (run_time_remap, save_data_space)
8100 (update_file_ptrs, read_header, write_header, calculate_checksum)
8101 (copy_file, copy_rest, display_header): Likewise.
8102 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8103 Likewise.
8104 * xdisp.c (check_it): Likewise.
8105 * xfaces.c (register_color, unregister_color, unregister_colors):
8106 Likewise.
8107 * xfns.c (print_fontset_result): Likewise.
8108 * xrdb.c (member, fatal, main): Likewise.
8109
99033785
PE
81102011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8111
8112 Fix minor problems found by static checking (Bug#9031).
8113 * chartab.c (char_table_set_range, map_sub_char_table):
8114 Remove unused locals.
8115 (uniprop_table): Now static.
8116 * composite.c (_work_char): Remove unused static var.
8117
9cb2ac56
JB
81182011-07-09 Juanma Barranquero <lekktu@gmail.com>
8119
8120 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8121
f25661f0
JD
81222011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8123
8124 * gtkutil.c (qttip_cb): Remove code without function.
8125
8278c4fe
EZ
81262011-07-09 Eli Zaretskii <eliz@gnu.org>
8127
8128 * w32.c (pthread_sigmask): New stub.
8129
1692ae2d 81302011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8131
8a6ebd58 8132 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8133 sigprocmask is portable only for single-threaded applications, and
8134 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8135 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8136 (LIBES): Use it.
8137 * callproc.c (Fcall_process):
8138 * process.c (create_process):
8139 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8140 Use pthread_sigmask, not sigprocmask.
123403e4 8141
1b854618
JD
81422011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8143
8144 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8145 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8146 wrong (Bug#8591).
8147
3fe4b549
JD
81482011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8149
0ce7e563
JD
8150 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8151 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8152 (xg_hide_tooltip): Fix comment.
8153
3fe4b549
JD
8154 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8155 in registerServicesMenuSendTypes.
8156 (validRequestorForSendType): Don't check ns_return_types.
8157
8158 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8159 ns_return_type.
8160
5df75e47
JR
81612011-07-08 Jason Rumney <jasonr@gnu.org>
8162
22610910
JR
8163 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8164 SH_SHOW for hidden windows (Bug#5482).
8165
5df75e47
JR
8166 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8167 frame struct members of non-existent frames (Bug#6284).
8168
699c10bd
JD
81692011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8170
4393663b
JD
8171 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8172 variable firstTime not needed on OSX >= 10.6.
8173 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8174 >= 10.5. Use setKnobProportion, setDoubleValue.
8175
8176 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8177 (MAC_OS_X_VERSION_10_5): Define if not defined.
8178 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8179 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8180 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8181
8182 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8183 cString and lossyCString on OSX >= 10.4.
4393663b 8184
58179cce 8185 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8186 sizeToFit on OSX >= 10.2.
8187
8188 * nsimage.m (allocInitFromFile): Don't use deprecated method
8189 bestRepresentationForDevice on OSX >= 10.6.
8190
8191 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8192 to avoid warning.
8193
8194 * emacs.c: Declare unexec_init_emacs_zone.
8195
a63e0781
JD
8196 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8197
699c10bd
JD
8198 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8199
8200 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8201 on svcsMenu (Bug#8842).
8202
8203 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8204 ns_return_types.
8205 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8206
8207 * nsterm.m (QUTF8_STRING): Declare.
8208 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8209 (validRequestorForSendType): Return type is (id).
8210 Change indexOfObjectIdenticalTo to indexOfObject.
8211 Check if we have local selection before returning self (Bug#8842).
8212 (writeSelectionToPasteboard): Put local selection into paste board
8213 if we have a local selection (Bug#8842).
8214 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8215
8216 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8217 (ns_get_local_selection): Declare.
8218
54e10184
LMI
82192011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8220
9888ff71
LMI
8221 * keymap.c (describe_map_tree): Don't insert a double newline at
8222 the end of the buffer (bug#1169) and return whether we inserted
8223 something.
8224
54e10184
LMI
8225 * callint.c (Fcall_interactively): Change "reading args" to
8226 "providing args" to try to clarify what it does (bug#1010).
8227
15fa4783
KH
82282011-07-07 Kenichi Handa <handa@m17n.org>
8229
8230 * composite.c (composition_compute_stop_pos): Ignore a static
8231 composition starting before CHARPOS (Bug#8915).
8232
8233 * xdisp.c (handle_composition_prop): Likewise.
8234
a8815b00
EZ
82352011-07-07 Eli Zaretskii <eliz@gnu.org>
8236
8237 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8238 (Bug#9015)
8239
ef7b981d 82402011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8241
8242 * character.h (unicode_category_t): New enum type.
8243
8244 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8245 (Qchar_code_property_table): New variable.
8246 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8247 (UNIPROP_COMPRESSED_FORM_P): New macros.
8248 (char_table_ascii): Uncompress the compressed values.
8249 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8250 Uncompress the compressed values.
ac389d0c 8251 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8252 (char_table_ref_and_range): Uncompress the compressed values.
8253 (sub_char_table_set): New arg is_uniprop. Callers changed.
8254 Uncompress the compressed values.
8255 (sub_char_table_set_range): Args changed. Callers changed.
8256 (char_table_set_range): Adjuted for the above change.
8257 (map_sub_char_table): Delete args default_val and parent. Add arg
8258 top. Give decoded values to a Lisp function.
640c8776 8259 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8260 values to a Lisp function. Gcpro more variables.
8261 (uniprop_table_uncompress)
8262 (uniprop_decode_value_run_length): New functions.
8263 (uniprop_decoder, uniprop_decoder_count): New variables.
8264 (uniprop_get_decoder, uniprop_encode_value_character)
8265 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8266 New functions.
8267 (uniprop_encoder, uniprop_encoder_count): New variables.
8268 (uniprop_get_encoder, uniprop_table)
8269 (Funicode_property_table_internal, Fget_unicode_property_internal)
8270 (Fput_unicode_property_internal): New functions.
8271 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8272 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8273 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8274 char-code-property-alist.
8275
640c8776 8276 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8277 Vunicode_category_table.
8278
640c8776 8279 * font.c (font_range): Adjust for the change of
c805dec0
KH
8280 Vunicode_category_table.
8281
76b397fb
DN
82822011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8283
8284 * m/iris4d.h: Remove file, move contents ...
8285 * s/irix6-5.h: ... here.
8286
22b4128e
PE
82872011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8288
8289 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8290 * alloc.c (mark_buffer):
8291 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8292 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8293 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8294 This isn't true in general, and it's particularly not true
8295 if Emacs is configured with --with-wide-int.
8296 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8297 New macros, used in the buffer.c change.
8298
869795d6
JD
82992011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8300
8301 * xsettings.c: Use both GConf and GSettings if both are available.
8302 (store_config_changed_event): Add comment.
8303 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8304 (store_tool_bar_style_changed): New functions.
5e617bc2 8305 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8306 (struct xsettings): Move font inside HAVE_XFT.
8307 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8308 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8309 Move inside HAVE_XFT.
640c8776 8310 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8311 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8312 also.
8313 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8314 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8315 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8316 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8317 (parse_settings): Move check for font inside HAVE_XFT.
8318 (read_settings, apply_xft_settings): Add comment.
8319 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8320 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8321 call store_font_name_changed.
8322 (xft_settings_event): Add comment.
8323 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8324 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8325 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8326 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8327 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8328 (xsettings_get_system_font, xsettings_get_system_normal_font):
8329 Add comment.
869795d6 8330
d8ed26bd
PE
83312011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8332
8333 Random fixes. E.g., (random) never returned negative values.
8334 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8335 subseconds part to the entropy, as that's a bit more random.
8336 Prefer signed to unsigned, since the signedness doesn't matter and
8337 in general we prefer signed. When given a limit, use a
8338 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8339 latter isn't right if USE_2_TAGS_FOR_INTS.
8340 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8341 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8342
cabf1cac
SM
83432011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8344
8345 * textprop.c (text_property_stickiness):
8346 Obey Vtext_property_default_nonsticky.
8347 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8348 * w32fns.c (syms_of_w32fns):
8349 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8350
6e9b2be9
PE
83512011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8352
8353 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8354 This is more efficient than Ffile_directory_p and avoids a minor race.
8355
90186c68
LMI
83562011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8357
7c301272
LMI
8358 * buffer.c (Foverlay_put): Say what the return value is
8359 (bug#7835).
8360
c4f2d8d4
LMI
8361 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8362 is a directory before asking whether to use the file name
8363 (bug#7564).
ad637907
LMI
8364 (barf_or_query_if_file_exists): Make the "File is a directory"
8365 error be more correct.
c4f2d8d4 8366
90186c68
LMI
8367 * fns.c (Frequire): Remove the mention of the .gz files, since
8368 that's installation-specific, but keep the mention of
8369 `get-load-suffixes'.
8370
da64016e
PE
83712011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8372
8373 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8374 Report string overflow if the output is too long.
8375
7d47b580
JB
83762011-07-04 Juanma Barranquero <lekktu@gmail.com>
8377
a555cb87
JB
8378 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8379 (syms_of_gnutls): Remove duplicate DEFSYM for
8380 Qgnutls_bootprop_verify_hostname_error, an error for
8381 Qgnutls_bootprop_verify_error (which is no longer used).
8382
7d47b580
JB
8383 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8384 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8385 Also (re)move comments that are misplaced or no longer relevant.
8386
1e49bfab
LMI
83872011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8388
8389 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8390
1485f4c0
CY
83912011-07-03 Chong Yidong <cyd@stupidchicken.com>
8392
8393 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8394 and background color parameters if they have been changed.
8395
a9ab721e
LMI
83962011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8397
8398 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8399
cf7cff57
PE
84002011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8401
2e13213d
PE
8402 * xsettings.c (SYSTEM_FONT): Define only when used.
8403 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8404
cf7cff57
PE
8405 * keymap.c (access_keymap_1): Now static.
8406
7a8e04f7
CY
84072011-07-02 Chong Yidong <cyd@stupidchicken.com>
8408
8409 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8410 leave any prefix arg for the up event (Bug#1586).
8411
61352f62
LMI
84122011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8413
69bb1ef7
LMI
8414 * lread.c (syms_of_lread): Mention single symbols defined by
8415 `defvar' or `defconst' (bug#7154).
8416
61352f62 8417 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8418 (Frequire): Mention get-load-suffixes.
61352f62 8419
28545e04
MR
84202011-07-02 Martin Rudalics <rudalics@gmx.at>
8421
8422 * window.h (window): Remove clone_number slot.
8423 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8424 Remove.
8425 (make_parent_window, make_window, saved_window)
8426 (Fset_window_configuration, save_window_save): Don't deal with
8427 clone numbers.
8428 * buffer.c (Qclone_number): Remove declaration.
8429 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8430
3349e122
SM
84312011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8432
8433 Add multiple inheritance to keymaps.
8434 * keymap.c (Fmake_composed_keymap): New function.
8435 (Fset_keymap_parent): Simplify.
8436 (fix_submap_inheritance): Remove.
8437 (access_keymap_1): New function extracted from access_keymap to handle
8438 embedded parents and handle lists of maps.
8439 (access_keymap): Use it.
8440 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8441 (Fcopy_keymap): Handle embedded parents.
8442 (Fcommand_remapping, define_as_prefix): Simplify.
8443 (Fkey_binding): Simplify.
8444 (syms_of_keymap): Move minibuffer-local-completion-map,
8445 minibuffer-local-filename-completion-map,
8446 minibuffer-local-must-match-map, and
8447 minibuffer-local-filename-must-match-map to Elisp.
8448 (syms_of_keymap): Defsubr make-composed-keymap.
8449 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8450 (parse_menu_item): Trivial simplification.
8451
3279eb87
GM
84522011-07-01 Glenn Morris <rgm@gnu.org>
8453
8454 * Makefile.in (SETTINGS_LIBS): Fix typo.
8455
4550efdf
KI
84562011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8457
8458 * coding.c (Fencode_coding_string): Record the last coding system
8459 used, as the function doc string says (bug#8738).
8460
0949d2b6
JD
84612011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8462
8463 * xsettings.c (store_monospaced_changed): Take new font as arg and
8464 check for change against current_mono_font.
8465 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8466 (emacs_settings_constructor, emacs_settings_get_property)
8467 (emacs_settings_set_property, emacs_settings_class_init)
8468 (emacs_settings_init, gsettings_obj): Remove.
8469 (something_changedCB): New function for HAVE_GSETTINGS.
8470 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8471 with value as argument.
8472 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8473 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8474 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8475 "changed".
8476
8477 * xgselect.c: Add defined (HAVE_GSETTINGS).
8478 (xgselect_initialize): Ditto.
8479
8480 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8481 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8482 xg_select.
8483
bbc6b304
PE
84842011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8485
8486 * eval.c (struct backtrace): Simplify and port the data structure.
8487 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8488 signed bit field, as this assumption is not portable and it makes
8489 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8490 "char debug_on_exit : 1" as this is not portable either; instead,
8491 use the portable "unsigned int debug_on_exit : 1". Remove unused
8492 member evalargs. Remove obsolete comments about cc bombing out.
8493
9851bfc5
JD
84942011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8495
51bb811f 8496 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8497 Let HAVE_GSETTINGS override HAVE_GCONF.
8498 (store_monospaced_changed): New function.
8499 (EMACS_SETTINGS): A new type derived from GObject to handle
8500 GSettings notifications.
8501 (emacs_settings_constructor, emacs_settings_get_property)
8502 (emacs_settings_set_property, emacs_settings_class_init):
8503 New functions.
8504 (gsettings_client, gsettings_obj): New variables.
8505 (GSETTINGS_SCHEMA): New define.
8506 (something_changedCB): Call store_monospaced_changed.
8507 (init_gsettings): New function.
8508 (xsettings_initialize): Call init_gsettings.
8509 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8510 to NULL.
8511
640c8776 8512 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8513 GCONF_CFLAGS/LIBS.
8514
5386012d
MR
85152011-06-29 Martin Rudalics <rudalics@gmx.at>
8516
8517 * window.c (resize_root_window, grow_mini_window)
8518 (shrink_mini_window): Rename Qresize_root_window to
8519 Qwindow_resize_root_window and Qresize_root_window_vertically to
8520 Qwindow_resize_root_window_vertically.
8521
f13e0b08
PE
85222011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8523
8524 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8525
94515237
JB
85262011-06-27 Juanma Barranquero <lekktu@gmail.com>
8527
8528 * makefile.w32-in: Redesign dependencies so they reflect more
8529 clearly which files are directly included by each source file,
8530 and not through other includes.
8531
e43b6e43
MR
85322011-06-27 Martin Rudalics <rudalics@gmx.at>
8533
8534 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8535 (sort_overlays, overlay_strings): When an overlay's clone number
8536 matches the window's clone number process the overlay even if
8537 the overlay's window property doesn't match the current window.
8538
d68443dc
MR
8539 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8540 (Fwindow_hchild): Rename to Fwindow_left_child.
8541 (Fwindow_next): Rename to Fwindow_next_sibling.
8542 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8543 (resize_window_check): Rename to window_resize_check.
8544 (resize_window_apply): Rename to window_resize_apply.
8545 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8546 (Fdelete_other_windows_internal, resize_frame_windows)
8547 (Fsplit_window_internal, Fdelete_window_internal)
8548 (grow_mini_window, shrink_mini_window)
8549 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8550
c7e73be5
JD
85512011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8552
8553 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8554 (emacs_fixed_set_min_size): Remove.
8555 (emacs_fixed_new): Take frame as argument.
8556
8557 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8558 (_EmacsFixedPrivate): Remove minwidth/height.
8559 Add struct frame *f.
8560 (emacs_fixed_init): Initialize priv->f.
8561 (get_parent_class, emacs_fixed_set_min_size): Remove.
8562 (emacs_fixed_new): Set priv->f to argument.
8563 (emacs_fixed_get_preferred_width)
8564 (emacs_fixed_get_preferred_height): Use min_width/height from
8565 frames size_hint to set minimum and natural (Bug#8919).
8566 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8567 and use min_width/height from frames size_hint to set
8568 min_width/height (Bug#8919).
8569
8570 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8571 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8572 Fix indentation.
c7e73be5 8573
cf99dcf8
EZ
85742011-06-26 Eli Zaretskii <eliz@gnu.org>
8575
8576 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8577 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8578 called at ZV.
8579
029529ac
CY
85802011-06-26 Chong Yidong <cyd@stupidchicken.com>
8581
8582 * process.c (wait_reading_process_output): Bypass select if
8583 waiting for a cell while ignoring keyboard input, and input is
8584 pending. Suggested by Jan Djärv (Bug#8869).
8585
7a7ef429
PE
85862011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8587
8588 Use gnulib's dup2 module instead of rolling our own.
8589 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8590
11fdef7d 85912011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8592
8593 * dispnew.c (scrolling_window): Before scrolling, turn off a
8594 mouse-highlight in the window being scrolled.
8595
cd3520a4
JB
85962011-06-24 Juanma Barranquero <lekktu@gmail.com>
8597
8598 Move DEFSYM to lisp.h and use everywhere.
8599
8600 * character.h (DEFSYM): Move declaration...
8601 * lisp.h (DEFSYM): ...here.
8602
8603 * gnutls.c:
8604 * minibuf.c:
8605 * w32menu.c:
8606 * w32proc.c:
8607 * w32select.c: Don't include character.h.
8608
8609 * alloc.c (syms_of_alloc):
8610 * buffer.c (syms_of_buffer):
8611 * bytecode.c (syms_of_bytecode):
8612 * callint.c (syms_of_callint):
8613 * casefiddle.c (syms_of_casefiddle):
8614 * casetab.c (init_casetab_once):
8615 * category.c (init_category_once, syms_of_category):
8616 * ccl.c (syms_of_ccl):
8617 * cmds.c (syms_of_cmds):
8618 * composite.c (syms_of_composite):
8619 * dbusbind.c (syms_of_dbusbind):
8620 * dired.c (syms_of_dired):
8621 * dispnew.c (syms_of_display):
8622 * doc.c (syms_of_doc):
8623 * editfns.c (syms_of_editfns):
8624 * emacs.c (syms_of_emacs):
8625 * eval.c (syms_of_eval):
8626 * fileio.c (syms_of_fileio):
8627 * fns.c (syms_of_fns):
8628 * frame.c (syms_of_frame):
8629 * fringe.c (syms_of_fringe):
8630 * insdel.c (syms_of_insdel):
8631 * keymap.c (syms_of_keymap):
8632 * lread.c (init_obarray, syms_of_lread):
8633 * macros.c (syms_of_macros):
8634 * msdos.c (syms_of_msdos):
8635 * print.c (syms_of_print):
8636 * process.c (syms_of_process):
8637 * search.c (syms_of_search):
8638 * sound.c (syms_of_sound):
8639 * syntax.c (init_syntax_once, syms_of_syntax):
8640 * terminal.c (syms_of_terminal):
8641 * textprop.c (syms_of_textprop):
8642 * undo.c (syms_of_undo):
8643 * w32.c (globals_of_w32):
8644 * window.c (syms_of_window):
8645 * xdisp.c (syms_of_xdisp):
8646 * xfaces.c (syms_of_xfaces):
8647 * xfns.c (syms_of_xfns):
8648 * xmenu.c (syms_of_xmenu):
8649 * xsettings.c (syms_of_xsettings):
8650 * xterm.c (syms_of_xterm): Use DEFSYM.
8651
4228cf16
TZ
86522011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8653
cd3520a4 8654 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 8655
7fcccf1e
PE
86562011-06-23 Paul Eggert <eggert@cs.ucla.edu>
8657
7efb4e0e
PE
8658 Integer and buffer overflow fixes (Bug#8873).
8659
ff5844ad
PE
8660 * print.c (printchar, strout): Check for string overflow.
8661 (PRINTPREPARE, printchar, strout):
8662 Don't set size unless allocation succeeds.
8663
90532f02
PE
8664 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8665 for sizes. Check for string overflow more accurately.
8666 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8667
6d84508d
PE
8668 * macros.c: Integer and buffer overflow fixes.
8669 * keyboard.h (struct keyboard.kbd_macro_bufsize):
8670 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8671 Use ptrdiff_t, not int, for sizes.
8672 Don't increment bufsize until after realloc succeeds.
8673 Check for size-calculation overflow.
8674 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8675
437b2cb4
PE
8676 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8677
8b9ac8b4
PE
8678 * lread.c: Integer overflow fixes.
8679 (read_integer): Radix is now EMACS_INT, not int,
8680 to improve quality of diagnostics for out-of-range radices.
8681 Calculate buffer size correctly for out-of-range radices.
8682 (read1): Check for integer overflow in radices, and in
8683 read-circle numbers.
82cb60d3
PE
8684 (read_escape): Avoid int overflow.
8685 (Fload, openp, read_buffer_size, read1)
8686 (substitute_object_recurse, read_vector, read_list, map_obarray):
8687 Use ptrdiff_t, not int, for sizes.
8688 (read1): Use EMACS_INT, not int, for sizes.
20270765 8689 Check for size overflow.
8b9ac8b4 8690
7fcccf1e
PE
8691 * image.c (cache_image): Check for size arithmetic overflow.
8692
bfbbd7e7
PE
8693 * lread.c: Integer overflow issues.
8694 (saved_doc_string_size, saved_doc_string_length)
8695 (prev_saved_doc_string_size, prev_saved_doc_string_length):
8696 Now ptrdiff_t, not int.
8697 (read1): Don't assume doc string length fits in int. Check for
8698 out-of-range doc string lengths.
8699 (read_list): Don't assume file position fits in int.
39019e54 8700 (read_escape): Check for hex character overflow.
bfbbd7e7 8701
4e323265
LL
87022011-06-22 Leo Liu <sdl.web@gmail.com>
8703
8704 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8705 Move to minibuffer.el.
8706
85fece3e
PE
87072011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8708
20b84ce9 8709 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
8710 The following patches are for when GLYPH_DEBUG && !XASSERT.
8711 * dispextern.h (trace_redisplay_p, dump_glyph_string):
8712 * dispnew.c (flush_stdout):
8713 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8714 Mark as externally visible.
8715 * dispnew.c (check_window_matrix_pointers): Now static.
8716 * dispnew.c (window_to_frame_vpos):
8717 * xfns.c (unwind_create_frame):
8718 * xterm.c (x_check_font): Remove unused local.
8719 * scroll.c (CHECK_BOUNDS):
8720 * xfaces.c (cache_fache): Rename local to avoid shadowing.
8721 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8722 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8723 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8724 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8725 Now static.
8726 (debug_method_add): Use va_list and vsprintf rather than relying
8727 on undefined behavior with wrong number of arguments.
8728 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8729 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8730 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8731 since we're not interested in debugging glyphs with old libraries.
8732 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8733 GCC 4.6.0's static checking.
8734
0766b489
PE
87352011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8736
31fd4b32
PE
8737 Integer overflow and signedness fixes (Bug#8873).
8738 A few related buffer overrun fixes, too.
8739
b79e8648
PE
8740 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8741
0766b489
PE
8742 * dispextern.h (struct face.stipple):
8743 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8744 (x_bitmap_mask, x_allocate_bitmap_record)
8745 (x_create_bitmap_from_data, x_create_bitmap_from_file)
8746 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8747 (x_create_bitmap_from_xpm_data):
8748 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8749 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8750 (.bitmaps_last):
8751 * xfaces.c (load_pixmap):
8752 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8753 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8754 (.bitmaps_last, struct x_output.icon_bitmap):
8755 Use ptrdiff_t, not int, for bitmap indexes.
8756 (x_allocate_bitmap_record): Check for size overflow.
8757 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8758
b081724f
PE
8759 Use ptrdiff_t, not int, for overlay counts.
8760 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8761 * editfns.c (overlays_around, get_pos_property):
8762 * textprop.c (get_char_property_and_overlay):
8763 * xdisp.c (next_overlay_change, note_mouse_highlight):
8764 * xfaces.c (face_at_buffer_position):
21514da7
PE
8765 * buffer.c (OVERLAY_COUNT_MAX): New macro.
8766 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8767 (Fnext_overlay_change, Fprevious_overlay_change)
8768 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 8769 Use ptrdiff_t, not int, for sizes.
21514da7 8770 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 8771
3de73e5e
PE
8772 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8773
2606c57b
PE
8774 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8775 (x_session_initialize): Do not assume string length fits in int.
8776
aaafe47a
PE
8777 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8778 This is unlikely, but can occur if DPI is outlandish.
8779
2674ddc8 8780 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
8781 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8782
28154962
PE
8783 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8784 * xrdb.c (magic_file_p, search_magic_path):
8785 Omit last arg SUFFIX; it was always 0. All callers changed.
8786 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
8787
7de51af5
PE
8788 * xfont.c (xfont_match): Avoid need for strlen.
8789
25ed6cc3
PE
8790 * xfns.c: Don't assume strlen fits in int.
8791 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8792
4eab31dd
PE
8793 * xdisp.c (message_log_check_duplicate): Return intmax_t,
8794 not unsigned long, as we prefer signed integers. All callers changed.
8795 Detect integer overflow in repeat count.
8796 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 8797 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 8798
171e2a58
PE
8799 * termcap.c: Don't assume sizes fit in int and never overflow.
8800 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8801 (gobble_line): Check for size-calculation overflow.
8802
ad39faca 8803 * minibuf.c (Fread_buffer):
6e5bb2dc 8804 * lread.c (intern, intern_c_string):
74ca2eb3
PE
8805 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8806 Don't assume string length fits in int.
8807
52c61c22 8808 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
8809 * gtkutil.c (style_changed_cb): Avoid need for strlen.
8810
b5b8c9e5
PE
8811 * font.c: Don't assume string length fits in int.
8812 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8813 Use ptrdiff_t, not int.
ccd6111c
PE
8814 (font_intern_prop): Don't assume string length fits in int.
8815 Don't assume integer property fits in fixnum.
8816 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 8817
882f0d81 8818 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 8819 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
8820 Reformulate so as not to need the command string.
8821 Invoke gzip -cd rather than gunzip, as it's more portable.
8822 (lock_info_type, lock_file_1, lock_file):
8823 Don't assume pid_t and time_t fit in unsigned long.
8824 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8825 (current_lock_owner): Prefer signed type for sizes.
8826 Use memcpy, not strncpy, where memcpy is what is really wanted.
8827 Don't assume (via atoi) that time_t and pid_t fit in int.
8828 Check for time_t and/or pid_t out of range, e.g., via a network share.
8829 Don't alloca where an auto var works fine.
8830
93f4cf88
PE
8831 * fileio.c: Fix some integer overflow issues.
8832 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8833 Don't assume string length fits in int.
8834 (directory_file_name): Don't assume string length fits in long.
8835 (make_temp_name): Don't assume pid fits in int, or that its print
8836 length is less than 20.
8837
f3e92b69
PE
8838 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8839
1bfdaf10
PE
8840 * coding.c (make_subsidiaries): Don't assume string length fits in int.
8841
35016e9a
PE
8842 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8843
3d1e65a1
PE
8844 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8845 We prefer signed integers, even for size calculations.
8846
0b963a93
PE
8847 * emacs.c: Don't assume string length fits in 'int'.
8848 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8849 (main): Don't invoke strlen when not needed.
8850
573f4b54
PE
8851 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8852 (XD_DEBUG_MESSAGE): Don't waste a byte.
8853
989f33ba
PE
8854 * callproc.c (getenv_internal_1, getenv_internal)
8855 (Fgetenv_internal):
965d34eb
PE
8856 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8857
e4d29b33
PE
8858 * lread.c (invalid_syntax): Omit length argument.
8859 All uses changed. This doesn't fix a bug, but it simplifies the
8860 code away from its former Hollerith-constant appearance, and it's
8861 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 8862 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 8863
eb49b136
PE
8864 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8865 This didn't break anything, but it didn't help either.
8866 It's confusing to put a bogus integer in a place where the actual
8867 value does not matter.
9f62aeb1 8868 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 8869 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 8870
15375a22
PE
8871 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8872 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8873 implementation.
b61cc01c
PE
8874 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8875 We prefer signed types, and the value cannot exceed the EMACS_INT
8876 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
8877 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8878 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8879 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 8880
53b2623d
PE
8881 * indent.c (sane_tab_width): New function.
8882 (current_column, scan_for_column, Findent_to, position_indentation)
8883 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 8884 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 8885
51cab52b 8886 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 8887
f2ed8a70
PE
8888 * lisp.h (lint_assume): New macro.
8889 * composite.c (composition_gstring_put_cache):
8890 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8891
abe80cc6
PE
8892 * editfns.c, insdel.c:
8893 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 8894
b02c740e
PE
8895 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
8896
ebc96716
PE
8897 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
8898
b4e50fa0 8899 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 8900 Use much-faster test for byte-length change.
311d5d7c 8901 Don't assume string byte-length fits in 'int'.
a4cf38e4 8902 Check that character arg fits in 'int'.
85461888 8903 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 8904
c0c1ee9f
PE
8905 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
8906
a498d7f4
PE
8907 * fns.c (concat): Catch string overflow earlier.
8908 Do not rely on integer wraparound.
8909
51cab52b
PE
8910 * dispextern.h (struct it.overlay_strings_charpos)
8911 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
8912 * xdisp.c (forward_to_next_line_start)
8913 (back_to_previous_visible_line_start)
8914 (reseat_at_next_visible_line_start, next_element_from_buffer):
8915 Don't arbitrarily truncate the value of 'selective' to int.
8916
76031fad
PE
8917 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
8918
5eb55db9
PE
8919 * composite.c: Don't truncate sizes to 'int'.
8920 (composition_gstring_p, composition_reseat_it)
8921 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
8922 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
8923 not EMACS_UINT, for indexes.
5eb55db9 8924
0703a717
PE
8925 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
8926
d6202519
PE
8927 * buffer.c: Include <verify.h>.
8928 (struct sortvec.priority, struct sortstr.priority):
8961a454 8929 Now EMACS_INT, not int.
c20998a7 8930 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
8931 (struct sortstr.size, record_overlay_string)
8932 (struct sortstrlist.size, struct sortlist.used):
8933 Don't truncate size to int.
8934 (record_overlay_string): Check for size-calculation overflow.
d6202519 8935 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 8936
d5a19415
JM
89372011-06-22 Jim Meyering <meyering@redhat.com>
8938
029529ac 8939 Don't leak an XBM-image-sized buffer
d5a19415
JM
8940 * image.c (xbm_load): Free the image buffer after using it.
8941
a9041e6c
PE
89422011-06-21 Paul Eggert <eggert@cs.ucla.edu>
8943
8944 Port to Sun C.
8945 * composite.c (find_automatic_composition): Omit needless 'return 0;'
8946 that Sun C diagnosed.
8947 * fns.c (secure_hash): Fix pointer signedness issue.
8948 * intervals.c (static_offset_intervals): New function.
8949 (offset_intervals): Use it.
8950
7f3f739f
LL
89512011-06-21 Leo Liu <sdl.web@gmail.com>
8952
8953 * deps.mk (fns.o):
8954 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
8955 sha512.h.
8956
8957 * fns.c (secure_hash): Rename from crypto_hash_function and change
8958 the first arg to accept symbols.
5b66d427 8959 (Fsecure_hash): New primitive.
7f3f739f
LL
8960 (syms_of_fns): New symbols.
8961
76147d94
DD
89622011-06-20 Deniz Dogan <deniz@dogan.se>
8963
8964 * process.c (Fset_process_buffer): Clarify return value in
8965 docstring.
8966
7d7d0045
CY
89672011-06-18 Chong Yidong <cyd@stupidchicken.com>
8968
8969 * dispnew.c (add_window_display_history): Use BVAR.
8970
8971 * xdisp.c (debug_method_add): Use BVAR.
8972 (check_window_end, dump_glyph_matrix, dump_glyph)
8973 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
8974
8975 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
8976 Likewise.
8977
8978 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
8979 check till after the cache is created in init_frame_faces.
8980
ff2bc410
SM
89812011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
8982
8983 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
8984
28177add
PE
89852011-06-16 Paul Eggert <eggert@cs.ucla.edu>
8986
dd3482fe
PE
8987 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
8988 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
8989 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
8990
393d71f3 8991 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
8992 * fileio.c (Finsert_file_contents):
8993 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
8994 Remove the old (too-loose) buffer overflow checks.
8995 They weren't needed, since make_gap checks for buffer overflow.
8996 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
8997 The old code merely checked for Emacs fixnum overflow, and relied
8998 on undefined (wraparound) behavior. The new code avoids undefined
8999 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9000
2e6813b0 9001 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9002 Tune. Don't use wider integers than needed. Don't use alloca.
9003 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9004
599a9e4f
PE
9005 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9006
99561444
PE
9007 * insdel.c, lisp.h (buffer_overflow): New function.
9008 (insert_from_buffer_1, replace_range, replace_range_2):
9009 * insdel.c (make_gap_larger):
9010 * editfns.c (Finsert_char):
9011 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9012
28177add
PE
9013 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9014
e69dafad
PE
90152011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9016
4baa020d 9017 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9018
b1c46f02
PE
9019 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9020 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9021
e69dafad
PE
9022 * fileio.c: Don't assume EMACS_INT fits in off_t.
9023 (emacs_lseek): New static function.
9024 (Finsert_file_contents, Fwrite_region): Use it.
9025 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9026
566684ea
PE
9027 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9028
e6966cd6
PE
9029 * fns.c: Don't overflow int when computing a list length.
9030 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9031 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9032 truncation on 64-bit hosts. Check for QUIT every
9033 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9034 faster and is responsive enough.
9035 (Flength): Report an error instead of overflowing an integer.
9036 (Fsafe_length): Return a float if the value is not representable
9037 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9038 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9039 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9040
dd0b0efb
PE
9041 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9042 (header_size, word_size): New constants.
9043 (allocate_vectorlike): Don't check size overflow here.
9044 (allocate_vector): Check it here instead, since this is the only
9045 caller of allocate_vectorlike that could cause overflow.
9046 Check that the new vector's length is representable as a fixnum.
9047
86fe5cfe
PE
9048 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9049 The previous code was bogus. For example, next_almost_prime (32)
9050 returned 39, which is undesirable as it is a multiple of 3; and
9051 next_almost_prime (24) returned 25, which is a multiple of 5 so
9052 why was the code bothering to check for multiples of 7?
9053
80e88859
PE
9054 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9055
4a2f0ad6
PE
9056 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9057
f66c7cf8
PE
9058 Variadic C functions now count arguments with ptrdiff_t.
9059 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9060 Back then I didn't know that the Emacs coding style prefers signed int.
9061 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9062 were being counted with int, which may truncate counts on 64-bit
9063 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9064 * lisp.h (struct Lisp_Subr.function.aMANY)
9065 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9066 Arg counts are now ptrdiff_t, not size_t.
9067 All variadic functions and their callers changed accordingly.
9068 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9069 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9070 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9071 * callint.c (Fcall_interactively): Check arg count for overflow,
9072 to avoid potential buffer overrun. Use signed char, not 'int',
9073 for 'varies' array, so that we needn't bother to check its size
9074 calculation for overflow.
9075 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9076 * eval.c (apply_lambda):
9077 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9078 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9079 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9080
a1759b76
PE
9081 * callint.c (Fcall_interactively): Don't use index var as event count.
9082
d96be9fc
PE
9083 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9084 * mem-limits.h (SIZE): Remove; no longer used.
9085
a690a978 9086 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9087
578c21e6
PE
9088 Remove unnecessary casts.
9089 * xterm.c (x_term_init):
9090 * xfns.c (x_set_border_pixel):
9091 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9092 These aren't needed now that we assume ANSI C.
9093
96f53c6c
PE
9094 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9095 It's more likely to cause problems (due to unsigned overflow)
9096 than to cure them.
9097
83c77d31
PE
9098 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9099
ee2079f1
PE
9100 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9101
6da65536
PE
9102 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9103
7147c4a4
PE
9104 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9105
193e32d9
PE
9106 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9107
e5533da6
PE
9108 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9109
9910e595
PE
9110 GLYPH_CODE_FACE returns EMACS_INT, not int.
9111 * dispextern.h (merge_faces):
9112 * xfaces.c (merge_faces):
01103c44
PE
9113 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9114 Don't assume EMACS_INT fits in int.
9910e595 9115
2638320e
PE
9116 * character.h (CHAR_VALID_P): Remove unused parameter.
9117 * fontset.c, lisp.h, xdisp.c: All uses changed.
9118
045eb8d9
PE
9119 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9120
c1f134b5
PE
9121 * fns.c (concat): Minor tuning based on overflow analysis.
9122 This doesn't fix any bugs. Use int to hold character, instead
9123 of constantly refetching from Emacs object. Use XFASTINT, not
9124 XINT, for value known to be a character. Don't bother comparing
9125 a single byte to 0400, as it's always less.
9126
395fcb93 9127 * floatfns.c (Fexpt):
327eeec8
PE
9128 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9129
abbd3d23
PE
9130 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9131 for characters.
9132
684a03ef
PE
9133 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9134
0fed43f3
PE
9135 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9136 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9137 incorrectly succeed when S was a string, because 4294967386 was
9138 truncated before it was used.
9139
8fd02eb7
PE
9140 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9141 Otherwise, an out-of-range integer could cause undefined behavior
9142 on a 64-bit host.
9143
f8c86b69
PE
9144 * composite.c: Use int, not EMACS_INT, for characters.
9145 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9146 EMACS_INT, for values that are known to be in character range.
9147 This doesn't fix any bugs but is the usual style inside Emacs and
9148 may generate better code on 32-bit machines.
9149
34206dd2
PE
9150 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9151 This is for reasons similar to the recent CHAR_STRING fix.
9152 * charset.c (Fencode_char): Check that character arg is actually
9153 a character. Pass an int to ENCODE_CHAR.
9154 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9155 wider than 'int', as a compile-time check to prevent future regressions
9156 in this area.
9157
c5958d4c 9158 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9159
9160 Make sure a 64-bit char is never passed to CHAR_STRING.
9161 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9162 by silently ignoring the top 32 bits, allowing some values
9163 that were far too large to be valid characters.
9164 * character.h: Include <verify.h>.
9165 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9166 arguments are no wider than unsigned, as a compile-time check
9167 to prevent future regressions in this area.
9168 * data.c (Faset):
01103c44 9169 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9170 (Fsubst_char_in_region):
9171 * fns.c (concat):
9172 * xdisp.c (decode_mode_spec_coding):
9173 Adjust to CHAR_STRING's new requirement.
9174 * editfns.c (Finsert_char, Fsubst_char_in_region):
9175 * fns.c (concat): Check that character args are actually
9176 characters. Without this test, these functions did the wrong
9177 thing with wildly out-of-range values on 64-bit hosts.
9178
d37ca623
PE
9179 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9180 These casts should not be needed on 32-bit hosts, either.
9181 * keyboard.c (read_char):
9182 * lread.c (Fload): Remove casts to unsigned.
9183
ea204efb
PE
9184 * lisp.h (UNSIGNED_CMP): New macro.
9185 This fixes comparison bugs on 64-bit hosts.
9186 (ASCII_CHAR_P): Use it.
9187 * casefiddle.c (casify_object):
01103c44 9188 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9189 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9190 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9191 * dispextern.h (FACE_FROM_ID):
9192 * keyboard.c (read_char): Use UNSIGNED_CMP.
9193
41cb286c
PE
9194 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9195 not to EMACS_INT, to avoid GCC warning.
9196
4a1b9832
PE
9197 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9198
55daad71
PE
9199 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9200 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9201 isn't needed on 32-bit machines.
8f95c75c 9202
01103c44
PE
9203 * buffer.c (Fgenerate_new_buffer_name):
9204 Use EMACS_INT for count, not int.
0ceccced 9205 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9206
9207 * data.c (Qcompiled_function): Now static.
9208
c6f072e7
PE
9209 * window.c (window_body_lines): Now static.
9210
20ce5912
PE
9211 * image.c (gif_load): Rename local to avoid shadowing.
9212
9c4c5f81
PE
9213 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9214 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9215 * alloc.c (make_save_value): Integer argument is now of type
9216 ptrdiff_t, not int.
9217 (mark_object): Use ptrdiff_t, not int.
9218 * lisp.h (pD): New macro.
9219 * print.c (print_object): Use it.
9220
c0c5c8ae
PE
9221 * alloc.c: Use EMACS_INT, not int, to count objects.
9222 (total_conses, total_markers, total_symbols, total_vector_size)
9223 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9224 (total_free_floats, total_floats, total_free_intervals)
9225 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9226 Now EMACS_INT, not int. All uses changed.
9227 (Fgarbage_collect): Compute overall total using a double, so that
9228 integer overflow is less likely to be a problem. Check for overflow
9229 when converting back to an integer.
5a25e253
PE
9230 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9231 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9232 These were 'int' variables that could overflow on 64-bit hosts;
9233 they were never used, so remove them instead of repairing them.
211a0b2a 9234 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9235 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9236 Previously, this ceilinged at INT_MAX, but that doesn't work on
9237 64-bit machines.
e46bb31a 9238 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9239
c78baabf 9240 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9241 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9242 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9243 when a (possibly-narrower) signed value would do just as well.
9244 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9245
c9d624c6
PE
9246 * alloc.c: Catch some string size overflows that we were missing.
9247 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9248 for convenience in STRING_BYTES_MAX.
9249 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9250 The definition here is exact; the one in lisp.h was approximate.
9251 (allocate_string_data): Check for string overflow. This catches
9252 some instances we weren't catching before. Also, it catches
9253 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9254 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9255 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9256
c9d624c6
PE
9257 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9258 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9259 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9260
353032ce
PE
9261 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9262
2bccce07
PE
9263 * alloc.c (Fmake_string): Check for out-of-range init.
9264
0ac30604
SM
92652011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9266
9267 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9268
c195f2de
JD
92692011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9270
9271 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9272 xg_get_default_scrollbar_width.
9273
9274 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9275 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9276 (style_changed_cb): Call update_theme_scrollbar_width and call
9277 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9278 all frames (Bug#8505).
9279 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9280 Call gtk_window_set_resizable if HAVE_GTK3.
9281 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9282 and height if HAVE_GTK3 (Bug#8505).
9283 (scroll_bar_width_for_theme): New variable.
9284 (update_theme_scrollbar_width): New function.
9285 (xg_get_default_scrollbar_width): Move code to
9286 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9287 (xg_initialize): Call update_theme_scrollbar_width.
9288
9289 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9290
9291 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9292
e10ac9f1
MR
92932011-06-12 Martin Rudalics <rudalics@gmx.at>
9294
9295 * frame.c (make_frame): Call other_buffer_safely instead of
9296 other_buffer.
9297
9298 * window.c (temp_output_buffer_show): Call display_buffer with
9299 second argument Vtemp_buffer_show_specifiers and reset latter
9300 immediately after the call.
9301 (Vtemp_buffer_show_specifiers): New variable.
9302 (auto_window_vscroll_p, next_screen_context_lines)
9303 (Vscroll_preserve_screen_position): Remove leading asterisks from
9304 doc-strings.
9305
2d3c217e 93062011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9307
7b7f97e8 9308 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9309 * buffer.c (Qclone_number): Remove for now, as it's unused.
9310 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9311 (record_buffer): Remove unused local.
9312 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9313 (set_frame_buffer_list): Remove; unused.
9314 * frame.h (other_visible_frames): Remove decl.
9315 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9316 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9317 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9318 if HAVE_GPM.
9319 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9320 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9321 Define only if HAVE_GPM.
9322 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9323 (update_hints_inhibit): Remove; never set. All uses removed.
9324 * widgetprv.h (emacsFrameClassRec): Remove decl.
9325 * window.c (delete_deletable_window): Now returns void, since it
9326 wasn't returning anything.
9327 (compare_window_configurations): Remove unused locals.
9328 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9329 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9330 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9331 the same widths as pointers. This follows up on the 2011-05-06 patch.
9332 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9333 * xterm.h: Likewise.
9334 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9335
1384b89e
JB
93362011-06-12 Juanma Barranquero <lekktu@gmail.com>
9337
9338 * makefile.w32-in: Update dependencies.
9339 (LISP_H): Add lib/intprops.h.
9340
1100a63c
CY
93412011-06-11 Chong Yidong <cyd@stupidchicken.com>
9342
9343 * image.c (gif_load): Add animation frame delay to the metadata.
9344 (syms_of_image): Use DEFSYM. New symbol `delay'.
9345
6198ccd0
MR
93462011-06-11 Martin Rudalics <rudalics@gmx.at>
9347
9348 * window.c (delete_deletable_window): Re-add.
9349 (Fset_window_configuration): Rewrite to handle dead buffers and
9350 consequently deletable windows.
9351 (window_tree, Fwindow_tree): Remove. Supply functionality in
9352 window.el.
9353 (compare_window_configurations): Simplify code.
9354
b6e3633c
AS
93552011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9356
1ab0dee5
AS
9357 * image.c (imagemagick_load_image): Fix type mismatch.
9358 (Fimagemagick_types): Likewise.
9359
b6e3633c
AS
9360 * window.h (replace_buffer_in_windows): Declare.
9361
9397e56f
MR
93622011-06-11 Martin Rudalics <rudalics@gmx.at>
9363
9364 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9365 Qclone_number. Remove external declaration of Qdelete_window.
9366 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9367 code.
640c8776
SM
9368 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9369 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9370 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9371 buffer list implementation.
9372 (other_buffer_safely): New function.
9373 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9374 calls to replace_buffer_in_windows and
9375 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9376 if allowed.
9377 (record_buffer): Inhibit quitting and rewrite using quittable
9378 functions. Run Qbuffer_list_update_hook if allowed.
9379 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9380 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9381 Move switch-to-buffer to window.el.
9397e56f
MR
9382 (bury-buffer): Move to window.el.
9383 (Vbuffer_list_update_hook): New variable.
9384
9385 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9386 section.
9387
9388 * window.h (resize_frame_windows): Move up in code.
9389 (Fwindow_frame): Remove EXFUN.
9390 (replace_buffer_in_all_windows): Remove prototype.
9391 (replace_buffer_in_windows_safely): Add prototype.
9392
9393 * window.c: Declare Qdelete_window static again. Move down
9394 declaration of select_count.
9395 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9396 (Fother_window): Move to window.el.
9397 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9398 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9399 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9400 window.el.
9401 (replace_buffer_in_windows): Implement by calling
9402 Qreplace_buffer_in_windows.
9403 (replace_buffer_in_all_windows): Remove with some functionality
9404 moved into replace_buffer_in_windows_safely.
9405 (replace_buffer_in_windows_safely): New function.
9406 (select_window_norecord, select_frame_norecord): Move in front
9407 of run_window_configuration_change_hook. Remove now obsolete
9408 declarations.
640c8776
SM
9409 (Fset_window_buffer): Rewrite doc-string.
9410 Call Qrecord_window_buffer.
9397e56f
MR
9411 (keys_of_window): Move binding for other-window to window.el.
9412
b50691aa
CY
94132011-06-11 Chong Yidong <cyd@stupidchicken.com>
9414
9415 * dispextern.h (struct image): Replace data member, whose int_val
9416 and ptr_val fields were not used by anything, with a single
9417 lisp_val object.
9418
9419 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9420 (gif_clear_image, gif_load, imagemagick_load_image)
9421 (gs_clear_image, gs_load): Callers changed.
9422
3f754b86
PE
94232011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9424
cca69397
PE
9425 * buffer.h: Include <time.h>, for time_t.
9426 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9427
109e28d0
PE
9428 Fix minor problems found by static checking.
9429
60737f02
PE
9430 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9431
4b66faf3
PE
9432 Make identifiers static if they are not used in other modules.
9433 * data.c (Qcompiled_function, Qframe, Qvector):
9434 * image.c (QimageMagick, Qsvg):
9435 * minibuf.c (Qmetadata):
9436 * window.c (resize_window_check, resize_root_window): Now static.
9437 * window.h (resize_window_check, resize_root_window): Remove decls.
9438
109e28d0
PE
9439 * window.c (window_deletion_count, delete_deletable_window):
9440 Remove; unused.
46a4ce9e
PE
9441 (window_body_lines): Now static.
9442 (Fdelete_other_windows_internal): Mark vars as initialized.
9443 Make sure 'resize_failed' is initialized.
9444 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9445 (resize_window_apply): Remove unused local.
9446 * window.h (delete_deletable_window): Remove decl.
9447
109e28d0 9448 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9449 (imagemagick_load_image): Fix pointer signedness problem by changing
9450 last arg from unsigned char * to char *. All uses changed.
9451 Also, fix a local for similar reasons.
9452 Remove unused locals. Remove locals to avoid shadowing.
9453 (fn_rsvg_handle_free): Remove; unused.
9454 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9455 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9456
3f754b86
PE
9457 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9458
2547adb1
CY
94592011-06-10 Chong Yidong <cyd@stupidchicken.com>
9460
9461 * image.c (gif_load): Fix omitted cast error introduced by
9462 2011-06-06 change.
9463
2c8e37d4
MR
94642011-06-10 Martin Rudalics <rudalics@gmx.at>
9465
9466 * window.h (resize_proportionally, orig_total_lines)
9467 (orig_top_line): Remove from window structure.
9468 (set_window_height, set_window_width, change_window_heights)
9469 (Fdelete_window): Remove prototypes.
9470 (resize_frame_windows): Remove duplicate declaration.
9471
440a42e3
EZ
94722011-06-10 Eli Zaretskii <eliz@gnu.org>
9473
9474 * window.h (resize_frame_windows, resize_window_check)
9475 (delete_deletable_window, resize_root_window)
9476 (resize_frame_windows): Declare prototypes.
9477
9478 * window.c (resize_window_apply): Make definition be "static" to
9479 match the prototype.
9480
562dd5e9
MR
94812011-06-10 Martin Rudalics <rudalics@gmx.at>
9482
9483 * window.c: Remove declarations of Qwindow_size_fixed,
9484 window_min_size_1, window_min_size_2, window_min_size,
9485 size_window, window_fixed_size_p, enlarge_window, delete_window.
9486 Remove static from declaration of Qdelete_window, it's
9487 temporarily needed by Fbury_buffer.
9488 (replace_window): Don't assign orig_top_line and
9489 orig_total_lines.
9490 (Fdelete_window, delete_window): Remove. Window deletion is
9491 handled by window.el.
640c8776
SM
9492 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9493 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9494 (Fdelete_other_windows): Remove. Deleting other windows is
9495 handled by window.el.
9496 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9497 handled in window.el.
9498 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9499 Window minimum sizes are handled in window.el.
9500 (shrink_windows, size_window, set_window_height)
9501 (set_window_width, change_window_heights, window_height)
9502 (window_width, CURBEG, CURSIZE, enlarge_window)
9503 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9504 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9505 handled in window.el.
9506 (make_dummy_parent): Rename to make_parent_window and give it a
9507 second argument horflag.
9508 (make_window): Don't set resize_proportionally any more.
9509 (Fsplit_window): Remove. Windows are split in window.el.
9510 (save_restore_action, save_restore_orig_size)
9511 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9512 Resize mini windows in window.el.
9513 (grow_mini_window, shrink_mini_window): Implement by calling
9514 Qresize_root_window_vertically, resize_window_check and
9515 resize_window_apply.
640c8776
SM
9516 (saved_window, Fset_window_configuration, save_window_save):
9517 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9518 resize_proportionally.
9519 (window_min_height, window_min_width): Move to window.el.
9520 (keys_of_window): Move bindings for delete-other-windows,
9521 split-window, delete-window and enlarge-window to window.el.
9522
9523 * buffer.c: Temporarily extern Qdelete_window.
9524 (Fbury_buffer): Temporarily call Qdelete_window instead of
9525 Fdelete_window (Fbury_buffer will move to window.el soon).
9526
9527 * frame.c (set_menu_bar_lines_1): Remove code handling
9528 orig_top_line and orig_total_lines.
9529
9530 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9531 set_window_height but set heights directly.
9532 (change_frame_size_1): Use resize_frame_windows.
9533
9534 * xdisp.c (init_xdisp): Don't use set_window_height but set
9535 heights directly.
9536
640c8776
SM
9537 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9538 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9539 run_window_configuration_change_hook.
9540
9541 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9542 instead of change_window_heights and run
9543 run_window_configuration_change_hook.
9544
1a13852e
MR
95452011-06-09 Martin Rudalics <rudalics@gmx.at>
9546
9547 * window.c (replace_window): Rename second argument REPLACEMENT to
9548 NEW. New third argument SETFLAG. Rewrite.
9549 (delete_window, make_dummy_parent): Call replace_window with
9550 third argument 1.
9551 (window_list_1): Move down in code.
9552 (run_window_configuration_change_hook): Move set_buffer part
9553 before select_frame_norecord part in order to unwind correctly.
9554 Rename count1 to count.
9555 (recombine_windows, delete_deletable_window, resize_root_window)
9556 (Fdelete_other_windows_internal)
9557 (Frun_window_configuration_change_hook, make_parent_window)
9558 (resize_window_check, resize_window_apply, Fresize_window_apply)
9559 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9560 (Fdelete_window_internal, Fresize_mini_window_internal):
9561 New functions.
1a13852e
MR
9562 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9563
f3d1777e
MR
95642011-06-08 Martin Rudalics <rudalics@gmx.at>
9565
496e208e
MR
9566 * window.h (window): Add some new members to window structure -
9567 normal_lines, normal_cols, new_total, new_normal, clone_number,
9568 splits, nest, prev_buffers, next_buffers.
9569 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9570 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9571
f3d1777e
MR
9572 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9573 Remove.
496e208e
MR
9574 (make_dummy_parent): Set new members of windows structure.
9575 (make_window): Move down in code. Handle new members of window
9576 structure.
9577 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9578 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9579 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9580 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9581 (Fset_window_next_buffers, Fset_window_clone_number):
9582 New functions.
496e208e
MR
9583 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9584 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9585 Doc-string fixes.
9586 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9587 Argument WINDOW can be now internal window too.
9588 (Fwindow_use_time): Move up in code.
9589 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9590 Rewrite doc-string.
9591 (Fset_window_configuration, saved_window)
9592 (Fcurrent_window_configuration, save_window_save): Handle new
9593 members of window structure.
b9e809c2
MR
9594 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9595 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9596 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9597 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9598 Qget_mru_window, Qresize_root_window,
9599 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9600 Qauto_buffer_name; staticpro them.
f3d1777e 9601
abde8f8c
MR
96022011-06-07 Martin Rudalics <rudalics@gmx.at>
9603
9604 * window.c (Fwindow_total_size, Fwindow_left_column)
9605 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9606 (Fwindow_list_1): New functions.
9607 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
9608 (Fwindow_width, Fscroll_left, Fscroll_right):
9609 Use window_body_cols instead of window_box_text_cols.
9610 (delete_window, Fset_window_configuration):
9611 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
9612 (delete_all_subwindows): Take a window as argument and not a
9613 structure. Rewrite.
190b47e6
MR
9614 (window_loop): Remove handling of GET_LRU_WINDOW and
9615 GET_LARGEST_WINDOW.
9616 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
9617
9618 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
9619 window_box_text_cols. delete_all_subwindows now takes a
9620 Lisp_Object as argument.
abde8f8c 9621
640c8776
SM
9622 * indent.c (compute_motion, Fcompute_motion):
9623 Use window_body_cols instead of window_box_text_cols.
abde8f8c 9624
fa8a67e6
MR
9625 * frame.c (delete_frame): Call delete_all_subwindows with root
9626 window as argument.
9627
a54e3482
DC
96282011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9629
9630 * fns.c (Fputhash): Document return value.
9631
60002bf5
CY
96322011-06-06 Chong Yidong <cyd@stupidchicken.com>
9633
9634 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9635
0c671da6 96362011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 9637
b862a52a 9638 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 9639
be44ca6c
PE
9640 Check for overflow when converting integer to cons and back.
9641 * charset.c (Fdefine_charset_internal, Fdecode_char):
9642 Use cons_to_unsigned to catch overflow.
9643 (Fencode_char): Use INTEGER_TO_CONS.
9644 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9645 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9646 * data.c (long_to_cons, cons_to_long): Remove.
9647 (cons_to_unsigned, cons_to_signed): New functions.
9648 These signal an error for invalid or out-of-range values.
9649 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9650 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9651 * font.c (Ffont_variation_glyphs):
9652 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9653 * lisp.h: Include <intprops.h>.
9654 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9655 (cons_to_signed, cons_to_unsigned): New decls.
9656 (long_to_cons, cons_to_long): Remove decls.
9657 * undo.c (record_first_change): Use INTEGER_TO_CONS.
9658 (Fprimitive_undo): Use CONS_TO_INTEGER.
9659 * xfns.c (Fx_window_property): Likewise.
9660 * xselect.c: Include <limits.h>.
9661 (x_own_selection, selection_data_to_lisp_data):
9662 Use INTEGER_TO_CONS.
9663 (x_handle_selection_request, x_handle_selection_clear)
9664 (x_get_foreign_selection, Fx_disown_selection_internal)
9665 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9666 (lisp_data_to_selection_data): Use cons_to_unsigned.
9667 (x_fill_property_data): Use cons_to_signed.
9668 Report values out of range.
9669
d1f3d2af
PE
9670 Check for buffer and string overflow more precisely.
9671 * buffer.h (BUF_BYTES_MAX): New macro.
9672 * lisp.h (STRING_BYTES_MAX): New macro.
9673 * alloc.c (Fmake_string):
9674 * character.c (string_escape_byte8):
9675 * coding.c (coding_alloc_by_realloc):
9676 * doprnt.c (doprnt):
9677 * editfns.c (Fformat):
9678 * eval.c (verror):
9679 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9680 since they may not be the same number.
9681 * editfns.c (Finsert_char):
9682 * fileio.c (Finsert_file_contents):
9683 Likewise for BUF_BYTES_MAX.
9684
dd52fcea
PE
9685 * image.c: Use ptrdiff_t, not int, for sizes.
9686 (slurp_file): Switch from int to ptrdiff_t.
9687 All uses changed.
9688 (slurp_file): Check that file size fits in both size_t (for
9689 malloc) and ptrdiff_t (for sanity and safety).
9690
7f9bbdbb
PE
9691 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9692 if b->modtime has its maximal value.
9693
dfe18f82
PE
9694 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9695
84acfcf0
PE
9696 Don't assume time_t can fit into int.
9697 * buffer.h (struct buffer.modtime): Now time_t, not int.
9698 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9699 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9700
ccd9a01a
PE
9701 Minor fixes for signed vs unsigned integers.
9702 * character.h (MAYBE_UNIFY_CHAR):
9703 * charset.c (maybe_unify_char):
9704 * keyboard.c (read_char, reorder_modifiers):
9705 XINT -> XFASTINT, since the integer must be nonnegative.
9706 * ftfont.c (ftfont_spec_pattern):
9707 * keymap.c (access_keymap, silly_event_symbol_error):
9708 XUINT -> XFASTINT, since the integer must be nonnegative.
9709 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9710 since it makes no difference and we prefer signed.
9711 * keyboard.c (record_char): Use XUINT when all the neighbors do.
9712 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9713 nonnegative.
9714
d6d100dd
SM
97152011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
9716
9717 * window.h (Fwindow_frame): Declare.
9718
2b6148e4
PE
97192011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9720
9721 * alloc.c: Simplify handling of large-request failures (Bug#8800).
9722 (SPARE_MEMORY): Always define.
9723 (LARGE_REQUEST): Remove.
9724 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9725
f230ecc9
MR
97262011-06-06 Martin Rudalics <rudalics@gmx.at>
9727
727e958e
MR
9728 * lisp.h: Move EXFUNS for Fframe_root_window,
9729 Fframe_first_window and Fset_frame_selected_window to window.h.
9730
9731 * window.h: Move EXFUNS for Fframe_root_window,
9732 Fframe_first_window and Fset_frame_selected_window here from
9733 lisp.h.
9734
9735 * frame.c (Fwindow_frame, Fframe_first_window)
9736 (Fframe_root_window, Fframe_selected_window)
9737 (Fset_frame_selected_window): Move to window.c.
9738 (Factive_minibuffer_window): Move to minibuf.c.
9739 (Fother_visible_frames_p): New function.
9740
9741 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9742
f230ecc9
MR
9743 * window.c (decode_window, decode_any_window): Move up in code.
9744 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9745 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
9746 (Fwindow_buffer): Move up and rewrite doc-string.
9747 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9748 (Fwindow_prev): New functions.
727e958e
MR
9749 (Fwindow_frame): Move here from frame.c. Accept any window as
9750 argument.
9751 (Fframe_root_window, Fframe_first_window)
9752 (Fframe_selected_window): Move here from frame.c. Accept frame
9753 or arbitrary window as argument. Update doc-strings.
9754 (Fminibuffer_window): Move up in code.
9755 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
9756 (Fset_frame_selected_window): Move here from frame.c.
9757 Marginal rewrite.
727e958e
MR
9758 (Fselected_window, select_window, Fselect_window): Move up in
9759 code. Minor doc-string fixes.
f230ecc9 9760
4d09bcf6
PE
97612011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9762
9763 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9764 Do not assume that spare memory exists; that assumption is valid
9765 only if SYSTEM_MALLOC.
9766 (LARGE_REQUEST): New macro, so that the issue of large requests
9767 is separated from the issue of spare memory.
9768
810928a2
AS
97692011-06-05 Andreas Schwab <schwab@linux-m68k.org>
9770
172418ad
AS
9771 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9772 format. (Bug#8806)
9773
43f862f7
AS
9774 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9775
810928a2
AS
9776 * xfns.c (x_set_scroll_bar_default_width): Move declarations
9777 before statements.
9778
a059fe24
JD
97792011-06-05 Jan Djärv <jan.h.d@swipnet.se>
9780
9781 * gtkutil.c (xg_get_default_scrollbar_width): New function.
9782
9783 * gtkutil.h: Declare xg_get_default_scrollbar_width.
9784
9785 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9786 min width by calling x_set_scroll_bar_default_width (Bug#8505).
9787
989bf368
JB
97882011-06-05 Juanma Barranquero <lekktu@gmail.com>
9789
9790 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9791
4b80f674
CY
97922011-06-04 Chong Yidong <cyd@stupidchicken.com>
9793
9794 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9795 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
9796 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9797 New error handlers.
4b80f674
CY
9798 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9799 Obey Vx_select_enable_clipboard_manager. Catch errors in
9800 x_clipboard_manager_save (Bug#8779).
9801 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 9802 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 9803
99a33b77 98042011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
9805
9806 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9807
99a33b77 98082011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
9809
9810 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9811 in the current matrix if keep_current_p is non-zero.
9812
8264569d
EZ
98132011-06-04 Eli Zaretskii <eliz@gnu.org>
9814
9815 * bidi.c (bidi_level_of_next_char): Fix last change.
9816
57f97249
EZ
98172011-06-03 Eli Zaretskii <eliz@gnu.org>
9818
fec2107c 9819 Support bidi reordering of text covered by display properties.
57f97249 9820
fec2107c
EZ
9821 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9822 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9823 (bidi_cache_search, bidi_cache_iterator_state)
9824 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
9825 (bidi_level_of_next_char, bidi_move_to_visually_next):
9826 Support character positions inside a run of characters covered by a
fec2107c
EZ
9827 display string.
9828 (bidi_paragraph_init, bidi_resolve_explicit_1)
9829 (bidi_level_of_next_char): Call bidi_fetch_char and
9830 bidi_fetch_char_advance instead of FETCH_CHAR and
9831 FETCH_CHAR_ADVANCE.
9832 (bidi_init_it): Initialize new members.
9833 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9834 definitions.
9835 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9836 instead of using explicit *_CHAR codes.
d6d100dd
SM
9837 (bidi_resolve_explicit, bidi_resolve_weak):
9838 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
9839 bidirectional text is supported only in multibyte buffers.
9840 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9841 it to initialize the frame_window_p member of struct bidi_it.
9842 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9843 (bidi_resolve_explicit, bidi_resolve_weak)
9844 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9845 bidi_it->nchars is non-positive.
9846 (bidi_level_of_next_char): Don't try to lookup the cache for the
9847 next/previous character if nothing is cached there yet, or if we
9848 were just reseat()'ed to a new position.
c40e2fb2 9849
0e14fe90
EZ
9850 * xdisp.c (set_cursor_from_row): Set start and stop points
9851 according to the row's direction when priming the loop that looks
9852 for the glyph on which to display cursor.
9853 (single_display_spec_intangible_p): Function deleted.
9854 (display_prop_intangible_p): Reimplement to call
9855 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
9856 Accept 3 additional arguments needed by handle_display_spec.
9857 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
9858 values: lists, `(when COND...)' forms, etc.
9859 (single_display_spec_string_p): Support property values that are
9860 lists with the argument STRING its top-level element.
9861 (display_prop_string_p): Fix the condition for processing a
9862 property that is a list to be consistent with handle_display_spec.
fec2107c 9863 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
9864 last portion of handle_display_prop.
9865 (compute_display_string_pos): Accept additional argument
9866 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
9867 value of a `display' property is a "replacing spec".
9868 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9869 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
9870 the display property, but just return a value indicating whether
9871 the display property will replace the characters it covers.
9872 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9873 frame_window_p members of struct bidi_it.
d6d100dd
SM
9874 (compute_display_string_pos, compute_display_string_end):
9875 New functions.
fec2107c
EZ
9876 (push_it): Accept second argument POSITION, where pop_it should
9877 jump to continue iteration.
9878 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 9879
fec2107c
EZ
9880 * keyboard.c (adjust_point_for_property): Adjust the call to
9881 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
9882
9883 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
9884 (bidi_init_it): Update prototypes.
9885 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
9886 (compute_display_string_pos, compute_display_string_end):
9887 Declare prototypes.
fec2107c
EZ
9888 (struct bidi_it): New members nchars and disp_pos. ch_len is now
9889 EMACS_INT.
fc6f18ce 9890
40087514 98912011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 9892
57f53182
PE
9893 Malloc failure behavior now depends on size of allocation.
9894 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
9895 * lisp.h: Change signatures accordingly.
9896 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
9897 All callers changed. (Bug#8762)
9898
9899 * gnutls.c: Use Emacs's memory allocators.
9900 Without this change, the gnutls library would invoke malloc etc.
9901 directly, which causes problems on non-SYNC_INPUT hosts, and which
9902 runs afoul of improving memory_full behavior. (Bug#8761)
9903 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
9904 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
9905 xfree instead of the default malloc, realloc, free.
9906 (Fgnutls_boot): No need to check for memory allocation failure,
9907 since xmalloc does that for us.
9908
ac32cd99 9909 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
9910 * category.c (hash_get_category_set):
9911 * ccl.c (ccl_driver):
9912 * charset.c (Fdefine_charset_internal):
9913 * charset.h (struct charset.hash_index):
9914 * composite.c (get_composition_id, gstring_lookup_cache)
9915 (composition_gstring_put_cache):
9916 * composite.h (struct composition.hash_index):
9917 * dispextern.h (struct image.hash):
9918 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
9919 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
9920 (hashfn_equal, hashfn_user_defined, make_hash_table)
9921 (maybe_resize_hash_table, hash_lookup, hash_put)
9922 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
9923 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
9924 (Fsxhash, Fgethash, Fputhash, Fmaphash):
9925 * image.c (make_image, search_image_cache, lookup_image)
9926 (xpm_put_color_table_h):
9927 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 9928 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 9929 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 9930 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
9931 * alloc.c (allocate_vectorlike):
9932 Check for overflow in vector size calculations.
9933 * ccl.c (ccl_driver):
9934 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
9935 * fns.c, image.c: Remove unnecessary static decls that would otherwise
9936 need to be updated by these changes.
40087514
PE
9937 * fns.c (make_hash_table, maybe_resize_hash_table):
9938 Check for integer overflow with large hash tables.
0de4bb68
PE
9939 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
9940 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
9941 (SXHASH_REDUCE): New macro.
9942 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
9943 Use it instead of discarding useful hash info with large hash values.
9944 (sxhash_float): New function.
9945 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
9946 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
9947 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
9948 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
9949 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
9950 Adjust signatures to match updated version of code.
9951 (consing_since_gc): Now EMACS_INT, since a single hash table can
9952 use more than INT_MAX bytes.
9953
698d32e2
DN
99542011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
9955
9956 Make it possible to build with GCC-4.6+ -O2 -flto.
9957
9958 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
9959
fd6fa53f
SM
99602011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
9961
9962 * minibuf.c (get_minibuffer, read_minibuf_unwind):
9963 Call minibuffer-inactive-mode.
9964
864db017
JB
99652011-05-31 Juanma Barranquero <lekktu@gmail.com>
9966
9967 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
9968 Update dependencies.
9969
2ad0baf4
DN
99702011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9971
9972 * data.c (init_data): Remove code for UTS, this system is not
9973 supported anymore.
9974
4fcc2638
DN
99752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9976
9977 Don't force ./temacs to start in terminal mode.
9978
9979 * frame.c (make_initial_frame): Initialize faces in all cases, not
9980 only when CANNOT_DUMP is defined.
9981 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
9982
c56e0fd5
DN
99832011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9984
9985 * dispnew.c (add_window_display_history): Use const for the string
9986 pointer. Remove declaration, not needed.
9987
333d54da 99882011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 9989
55d4c1b2 9990 Use 'inline', not 'INLINE'.
333d54da 9991 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
9992 * alloc.c, fontset.c (INLINE): Remove.
9993 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
9994 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
9995 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
9996 * gmalloc.c (register_heapinfo): Use inline unconditionally.
9997 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
9998
738db178
DN
99992011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10000
10001 Make it possible to run ./temacs.
10002
10003 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10004 syms_of_callproc does the same thing. Remove test for
10005 "initialized", do it in the caller.
10006 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10007
620c53a6
SM
100082011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10009
10010 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10011 (read_minibuf): Use get_minibuffer.
10012 (syms_of_minibuf): Use DEFSYM.
10013 (Qmetadata): New var.
10014 * data.c (Qbuffer): Don't make it static.
10015 (syms_of_data): Use DEFSYM.
10016
e003a292
PE
100172011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10018
10019 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10020 (CCL_CODE_MIN): New macro.
10021
ed008a6d
PE
100222011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10023
3687c2ef
PE
10024 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10025
ed008a6d
PE
10026 * eval.c (Qdebug): Now static.
10027 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10028 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10029 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10030
d66c4c7c
CY
100312011-05-29 Chong Yidong <cyd@stupidchicken.com>
10032
10033 * image.c: Various fixes to ImageMagick code comments.
10034 (Fimagemagick_types): Doc fix.
10035
5fbc2025
PE
100362011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10037
0196f88a
PE
10038 Minor fixes prompted by GCC 4.6.0 warnings.
10039
10040 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10041
5fbc2025
PE
10042 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10043 (x_clipboard_manager_save_all): Move extern decl to ...
10044 * xterm.h: ... here, so that it can be checked for consistency.
10045
1dd3c2d9
CY
100462011-05-29 Chong Yidong <cyd@stupidchicken.com>
10047
10048 * xselect.c (x_clipboard_manager_save_frame)
10049 (x_clipboard_manager_save_all): New functions.
10050 (Fx_clipboard_manager_save): Lisp function deleted.
10051
10052 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10053 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10054
10055 * xterm.h: Update prototype.
10056
5ba6571d
WX
100572011-05-28 William Xu <william.xwl@gmail.com>
10058
10059 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10060 exiting (Bug#8239).
10061
3eaff834
JM
100622011-05-28 Jim Meyering <meyering@redhat.com>
10063
e1900994 10064 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10065 * fns.c (to_uchar): Define.
10066 (crypto_hash_function): Use it to convert some newly-signed
10067 variables to unsigned, to avoid sign-extension bugs. For example,
10068 without this change, (md5 "truc") would evaluate to
10069 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10070 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10071 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10072
0f6990a7
PE
100732011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10074
10075 Integer overflow fixes.
c8a9ca5a 10076
08686060
PE
10077 * dbusbind.c: Serial number integer overflow fixes.
10078 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10079 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10080 to hold a serial number that is too large for a fixnum.
10081 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10082 Check for serial numbers out of range. Decode any serial number
59568bf0 10083 that was so large that it became a float. (Bug#8722)
08686060 10084
2d1fc3c7
PE
10085 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10086 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10087 Use XFASTINT rather than XUINT when numbers are nonnegative.
10088 (xd_append_arg, Fdbus_method_return_internal):
10089 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10090 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10091 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10092 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10093 (Bug#8722)
2d1fc3c7 10094
c8a9ca5a
PE
10095 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10096
519e1d69
PE
10097 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10098
6df6ae42 10099 ccl: Add integer overflow checks.
30569699
PE
10100 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10101 (IN_INT_RANGE): New macros.
10102 (ccl_driver): Use them to check for integer overflow when
10103 decoding a CCL program. Many of the new checks are whether XINT (x)
10104 fits in int; it doesn't always, on 64-bit hosts. The new version
10105 doesn't catch all possible integer overflows, but it's an
847044ea 10106 improvement. (Bug#8719)
30569699 10107
c11285dc
PE
10108 * alloc.c (make_event_array): Use XINT, not XUINT.
10109 There's no need for unsigned here.
10110
fdccd48e
PE
10111 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10112 This follows up to the 2011-05-06 change that substituted uintptr_t
10113 for EMACS_INT. This case wasn't caught back then.
10114
37910ab2
PE
10115 Rework Fformat to avoid integer overflow issues.
10116 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10117 now (part of C89). Include <verify.h>.
10118 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10119 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10120 (Fformat): Avoid the prepass trying to compute sizes; it was only
10121 approximate and thus did not catch overflow reliably. Instead, walk
10122 through the format just once, formatting and computing sizes as we go,
10123 checking for integer overflow at every step, and allocating a larger
10124 buffer as needed. Keep track separately whether the format is
10125 multibyte. Keep only the most-recently calculated precision, rather
10126 than them all. Record whether each argument has been converted to
10127 string. Use EMACS_INT, not int, for byte and char and arg counts.
10128 Support field widths and precisions larger than INT_MAX. Avoid
10129 sprintf's undefined behavior with conversion specifications such as %#d
10130 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10131 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10132 formatting out-of-range floating point numbers with int
9173deec 10133 formats. (Bug#8668)
37910ab2 10134
2e6578fb
PE
10135 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10136
0ae6bdee
PE
10137 * data.c: Avoid integer truncation in expressions involving floats.
10138 * data.c: Include <intprops.h>.
10139 (arith_driver): When there's an integer overflow in an expression
10140 involving floating point, convert the integers to floating point
10141 so that the resulting value does not suffer from catastrophic
10142 integer truncation. For example, on a 64-bit host (* 4
10143 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10144 Do not rely on undefined behavior after integer overflow.
10145
de883a70
PE
10146 merge count_size_as_multibyte, parse_str_to_multibyte
10147 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10148 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10149 Check for integer overflow.
10150 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10151 since it's now a duplicate of the other. This is more of
10152 a character than a buffer op, so better that it's in character.c.
10153 * fns.c, print.c: Adjust to above changes.
10154
2ff916cb
PE
101552011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10156
10157 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10158
f1b54466
PE
101592011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10160
fb1ac845
PE
10161 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10162 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10163 (x_clipboard_manager_save): Now static.
10164 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10165
f1b54466
PE
10166 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10167 (crypto_hash_function): Now static.
10168 Fix pointer signedness problems. Avoid unnecessary initializations.
10169
a9f737ee
CY
101702011-05-27 Chong Yidong <cyd@stupidchicken.com>
10171
10172 * termhooks.h (Vselection_alist): Make it terminal-local.
10173
10174 * terminal.c (create_terminal): Initialize it.
10175
10176 * xselect.c: Support for clipboard managers.
10177 (Vselection_alist): Move to termhooks.h as terminal-local var.
10178 (LOCAL_SELECTION): New macro.
10179 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10180 (symbol_to_x_atom): Remove gratuitous arg.
10181 (x_handle_selection_request, lisp_data_to_selection_data)
10182 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10183 (x_own_selection, x_get_local_selection, x_convert_selection):
10184 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10185 (some_frame_on_display): Delete unused function.
10186 (Fx_own_selection_internal, Fx_get_selection_internal)
10187 (Fx_disown_selection_internal, Fx_selection_owner_p)
10188 (Fx_selection_exists_p): New optional frame arg.
10189 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10190 (x_handle_selection_clear): Don't treat other terminals with the
10191 same keyboard specially. Use the terminal-local Vselection_alist.
10192 (x_clear_frame_selections): Use Frun_hook_with_args.
10193
10194 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10195
10196 * xterm.h: Add support for those atoms.
10197
e067f0c1
CY
101982011-05-26 Chong Yidong <cyd@stupidchicken.com>
10199
10200 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10201 (converted_selections, conversion_fail_tag): New global variables.
10202 (x_selection_request_lisp_error): Free the above.
10203 (x_get_local_selection): Remove unnecessary code.
10204 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10205 of converted selections stored in converted_selections.
10206 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10207 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10208 (x_convert_selection): New function.
10209 (x_handle_selection_event): Simplify.
10210 (x_get_foreign_selection): Don't ignore incoming requests while
10211 waiting for an answer; this will fail when we implement
10212 SAVE_TARGETS, and seems unnecessary anyway.
10213 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10214 (Vx_sent_selection_functions): Doc fix.
10215
0f4aebc0
LL
102162011-05-26 Leo Liu <sdl.web@gmail.com>
10217
10218 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10219
e61124cd
YM
102202011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10221
10222 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10223
10224 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10225 for fringe update if it has periodic bitmap.
ac389d0c 10226 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10227 and fringe_bitmap_periodic_p.
10228
10229 * fringe.c (get_fringe_bitmap_data): New function.
10230 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10231 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10232 row. Mark glyph row for fringe update if periodicity changed.
10233
10234 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10235 for fringe update unless it has periodic bitmap.
10236
f16d9837
KH
102372011-05-25 Kenichi Handa <handa@m17n.org>
10238
10239 * xdisp.c (get_next_display_element): Set correct it->face_id for
10240 a static composition.
10241
e1b90ef6
LL
102422011-05-24 Leo Liu <sdl.web@gmail.com>
10243
10244 * deps.mk (fns.o):
10245 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10246
10247 * fns.c (crypto_hash_function, Fsha1): New function.
10248 (Fmd5): Use crypto_hash_function.
10249 (syms_of_fns): Add Ssha1.
10250
7400048f
PE
102512011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10252
10253 * gnutls.c: Remove unused macros.
10254 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10255 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10256 Remove macros that are defined and never used.
10257 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10258
abb71cf4
CY
102592011-05-22 Chong Yidong <cyd@stupidchicken.com>
10260
10261 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10262 (Fx_get_selection_internal): Minor cleanup.
10263 (Fx_own_selection_internal): Rename arguments for consistency with
10264 select.el.
10265
6307db39
PE
102662011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10267
10268 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10269
f3d4e0a4
CY
102702011-05-22 Chong Yidong <cyd@stupidchicken.com>
10271
10272 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10273
4d8ade89
YM
102742011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10275
10276 * dispnew.c (scrolling_window): Don't exclude the case that the
10277 last enabled row in the desired matrix touches the bottom boundary.
10278
32078c8d
GM
102792011-05-21 Glenn Morris <rgm@gnu.org>
10280
10281 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10282 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10283 and add some more files.
32078c8d 10284
7285dc67
EZ
102852011-05-20 Eli Zaretskii <eliz@gnu.org>
10286
10287 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10288 report_file_error introduced by the change from 2011-05-07.
10289
89d1bd22
PE
102902011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10291
10292 * systime.h (Time): Define only if emacs is defined.
10293 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10294 where the include path doesn't have X11/X.h by default. See
10295 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10296
cd394be1 102972011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10298
10299 * composite.c (find_automatic_composition): Fix previous change.
10300
b9704ad9
GM
103012011-05-20 Glenn Morris <rgm@gnu.org>
10302
10303 * lisp.mk: New file, split from Makefile.in.
10304 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10305 (shortlisp): Remove.
10306 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10307
4a720484
GM
103082011-05-19 Glenn Morris <rgm@gnu.org>
10309
10310 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10311 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10312 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10313 (lisp): Set the order to that of loadup.el.
10314 (shortlisp): Make it a copy of $lisp.
10315 (SOME_MACHINE_LISP): Remove.
10316 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10317 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10318
a28d4396
KH
103192011-05-18 Kenichi Handa <handa@m17n.org>
10320
10321 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10322 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10323 (find_automatic_composition): Mostly rewrite for efficiency.
10324
a2b1fa8e
JB
103252011-05-18 Juanma Barranquero <lekktu@gmail.com>
10326
10327 * makefile.w32-in: Update dependencies.
10328
8e1f5610
CS
103292011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10330
10331 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10332 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10333
7025ee00 103342011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10335
cdfa6eab
PE
10336 Fix some integer overflow issues, such as string length overflow.
10337
06d6db33
PE
10338 * insdel.c (count_size_as_multibyte): Check for string overflow.
10339
2b4560a8
PE
10340 * character.c (lisp_string_width): Check for string overflow.
10341 Use EMACS_INT, not int, for string indexes and lengths; in
10342 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10343 the resulting string length overflows an EMACS_INT; instead,
10344 report a string overflow if no precision given. When checking for
10345 precision exhaustion, use a check that cannot possibly have
10346 integer overflow. (Bug#8675)
10347 * character.h (lisp_string_width): Adjust to new signature.
10348
cb93f9be
PE
10349 * alloc.c (string_overflow): New function.
10350 (Fmake_string): Use it. This doesn't change behavior, but saves
10351 a few bytes and will simplify future changes.
10352 * character.c (string_escape_byte8): Likewise.
10353 * lisp.h (string_overflow): New decl.
10354
1a1f3366
PE
10355 Fixups, following up to the user-interface timestamp change.
10356 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10357 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10358 * msdos.c (mouse_get_pos): Likewise.
10359 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10360 * w32gui.h (Time): Define by including "systime.h" rather than by
10361 declaring it ourselves. (Bug#8664)
10362
d4e3e4d3
PE
10363 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10364 * image.c (clear_image_cache): Likewise.
10365
f6a24d19
PE
10366 * term.c (term_mouse_position): Don't assume time_t wraparound.
10367
08dc5ae6
PE
10368 Be more systematic about user-interface timestamps.
10369 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10370 and sometimes 'EMACS_UINT', to represent these timestamps.
10371 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10372 This makes the code easier to follow, and makes it easier to catch
10373 integer overflow bugs such as Bug#8664.
10374 * frame.c (Fmouse_position, Fmouse_pixel_position):
10375 Use Time, not unsigned long, for user-interface timestamps.
10376 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10377 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10378 * keyboard.h (last_event_timestamp): Likewise.
10379 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10380 * menu.h (xmenu_show): Likewise.
10381 * term.c (term_mouse_position): Likewise.
10382 * termhooks.h (struct input_event.timestamp): Likewise.
10383 (struct terminal.mouse_position_hook): Likewise.
10384 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10385 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10386 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10387 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10388 what it was before.
10389 * menu.h, termhooks.h: Include "systime.h", for Time.
10390
8e55734a
PE
10391 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10392 Don't assume that the difference between two unsigned long values
10393 can fit into an integer. At this point, we know button_down_time
10394 <= event->timestamp, so the difference must be nonnegative, so
10395 there's no need to cast the result if double-click-time is
10396 nonnegative, as it should be; check that it's nonnegative, just in
10397 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10398 apart (about 25 days). (Bug#8664)
8e55734a 10399
841f1b75 10400 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10401 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10402
3e26f69c
PE
10403 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10404 that always fit in int. Use a sentinel instead of a counter, to
10405 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10406 * frame.h (struct frame): Use int for menu_bar_items_used
10407 instead of EMACS_INT, since it always fits in int.
3e26f69c 10408
5cc152c0
PE
10409 * menu.c (grow_menu_items): Check for int overflow.
10410
d89eb65e
PE
10411 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10412
5235bd3e
PE
10413 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10414 Before, the code was not consistent. These values cannot exceed
10415 2**31 - 1 so there's no need to make them unsigned.
10416 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10417 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10418 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10419 as modifiers.
10420 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10421
bc827e23
PE
10422 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10423 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10424 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10425 presumably because the widths might not match.
10426
78eb494e
PE
10427 * window.c (size_window): Avoid needless test at loop start.
10428
04f2d78b
CB
104292011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10430
10431 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10432
d2fc7e3d 104332011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10434
10435 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10436
d2fc7e3d 104372011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10438
10439 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10440 `width' to `bar_area_x' and `bar_area_width', respectively.
10441 (x_scroll_run): Take account of fringe background extension.
10442
04f2d78b
CB
10443 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10444 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10445 `bar_area_width', respectively.
10446 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10447 background extension.
10448
79b70037
GM
104492011-05-10 Jim Meyering <meyering@redhat.com>
10450
10451 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10452
2f142cc5
JB
104532011-05-10 Juanma Barranquero <lekktu@gmail.com>
10454
10455 * image.c (Finit_image_library): Return t for built-in image types,
10456 like pbm and xbm. (Bug#8640)
10457
57679c86
AS
104582011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10459
10460 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10461
888c9e86
EZ
104622011-05-07 Eli Zaretskii <eliz@gnu.org>
10463
b0512a1d
EZ
10464 * w32console.c (Fset_screen_color): Doc fix.
10465 (Fget_screen_color): New function.
10466 (syms_of_ntterm): Defsubr it.
10467
7285dc67
EZ
10468 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10469 unlink the temporary file if Fcall_process didn't create it in the
10470 first place.
10471 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10472 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10473 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10474 cue to call_process_cleanup not to close that handle.
10475
4d3fcc8e
BK
104762011-05-07 Ben Key <bkey76@gmail.com>
10477
10478 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10479 one of two shell specific rules, either bootstrap-temacs-CMD or
10480 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10481 to the previous implementation of the bootstrap-temacs rule.
10482 The bootstrap-temacs-CMD rule is similar to the previous
10483 implementation of the bootstrap-temacs rule except that it
10484 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10485 variable.
10486
10487 These changes, along with some changes to nt/configure.bat,
10488 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10489 earlier fix to add support for --cflags and --ldflags options
10490 that include quotes so that it works whether make uses cmd or
10491 sh as the shell.
10492
b4289b64
MA
104932011-05-06 Michael Albinus <michael.albinus@gmx.de>
10494
10495 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10496 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10497 is a constant.
10498 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10499 a string. Handle both cases.
10500 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10501 (Fdbus_register_method): Use Qinvalid_function.
10502
af4c0e28
JB
105032011-05-06 Juanma Barranquero <lekktu@gmail.com>
10504
10505 * makefile.w32-in: Update dependencies.
10506 (LISP_H): Add inttypes.h and stdin.h.
10507 (PROCESS_H): Add unistd.h.
10508
c51453d9
EZ
105092011-05-06 Eli Zaretskii <eliz@gnu.org>
10510
10511 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10512 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10513
8ff0ac3c 105142011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10515
4c4b566b
PE
10516 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10517
aab2b9b5
PE
10518 * term.c (vfatal): Remove stray call to va_end.
10519 It's not needed and the C Standard doesn't allow it here anyway.
10520
c378da0b
PE
10521 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10522 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10523
288b08c7
PE
10524 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10525 bytes.
10526
e3601888
PE
10527 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10528
db6c0e74
PE
10529 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10530
dd5963ea
PE
10531 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10532
88c9450f
PE
10533 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10534
2f9442b8
PE
10535 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10536
c032b5f8
PE
10537 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10538 * charset.c (Fdefine_charset_internal): Don't initialize
10539 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10540 32-bit int (Bug#8600).
a108c10b
PE
10541
10542 * lread.c (read_integer): Be more consistent with string-to-number.
10543 Use string_to_number to do the actual conversion; this avoids
10544 rounding errors and fixes some other screwups. Without this fix,
10545 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10546 (digit_to_number): Move earlier, for benefit of read_integer.
10547 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10548 not a digit in any supported base. (Bug#8602)
a108c10b 10549
ad5f9eea
PE
10550 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10551
aec1708a
PE
10552 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10553 to match comment at start of function. This also removes a
10554 GCC warning about overflow in a 32+64-bit port.
10555
47be4ab5
PE
10556 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10557
371cac43
PE
10558 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10559 Reported by Stefan Monnier in
10560 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10561 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10562 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10563
d01a7826
PE
10564 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10565 (EMACS_UINTPTR): Likewise, with uintptr_t.
10566
7fd47d5c
PE
10567 * lisp.h: Prefer 64-bit EMACS_INT if available.
10568 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10569 on 32-bit hosts that have 64-bit int, so that they can access
10570 large files.
122b0c86
PE
10571 However, temporarily disable this change unless the temporary
10572 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10573
8727937b
PE
10574 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10575
8ac068ac
PE
10576 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10577 This removes an assumption that EMACS_INT and long are the same
10578 width as pointers. The assumption is true for Emacs porting targets
10579 now, but we want to make other targets possible.
10580 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10581 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10582 In the rest of the code, change types of integers that hold casted
10583 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10584 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10585 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10586 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10587 No need to cast type when ORing.
10588 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10589 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10590 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10591 assume EMACS_INT is the same width as char *.
10592 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10593 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10594 Remove no-longer-needed casts.
10595 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10596 (xg_tool_bar_help_callback, xg_make_tool_item):
10597 Use EMACS_INTPTR to hold an integer
10598 that will be cast to void *; this can avoid a GCC warning
10599 if EMACS_INT is not the same width as void *.
10600 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10601 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10602 (current_message_1, set_message_1):
10603 Use a local to convert to proper width without a cast.
10604 * xmenu.c (dialog_selection_callback): Likewise.
10605
ede49d71
PE
10606 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10607 Also, don't assume VALBITS / RAND_BITS is less than 5,
10608 and don't rely on undefined behavior when shifting a 1 left into
10609 the sign bit.
10610 * lisp.h (get_random): Change signature to match.
10611
2f30ecd0
PE
10612 * lread.c (hash_string): Use size_t, not int, for hash computation.
10613 Normally we prefer signed values; but hashing is special, because
10614 it's better to use unsigned division on hash table sizes so that
10615 the remainder is nonnegative. Also, size_t is the natural width
10616 for hashing into memory. The previous code used 'int', which doesn't
10617 retain enough info to hash well into very large tables.
10618 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10619
2a866e7b
PE
10620 * dbusbind.c: Don't possibly lose pointer info when converting.
10621 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10622 Use XPNTR rather than XHASH, so that the high-order bits of
10623 the pointer aren't lost when converting through void *.
10624
51639eac
PE
10625 * eval.c (Fautoload): Don't double-shift a pointer.
10626
92394119
PE
10627 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10628
dbdb9a7c
JB
106292011-05-06 Juanma Barranquero <lekktu@gmail.com>
10630
10631 * gnutls.c (DEF_GNUTLS_FN):
10632 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10633
db7a0b4f
AS
106342011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10635
10636 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10637 marker. (Bug#8610)
10638
cd394be1 106392011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
10640
10641 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10642 New version that can reserve upto 2GB of heap space.
10643
f7ff1b0f 106442011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
10645
10646 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10647
639c109b
TZ
106482011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10649
10650 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10651 `gnutls_certificate_set_x509_key_file'.
10652
d2127135
JB
106532011-05-05 Juanma Barranquero <lekktu@gmail.com>
10654
10655 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10656 Update dependencies.
10657
e968f4f3
JB
106582011-05-04 Juanma Barranquero <lekktu@gmail.com>
10659
10660 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10661 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10662 Remove unused parameter `fildes'.
10663 * process.c (read_process_output, send_process): Don't pass it.
10664
84d358f0
JB
106652011-05-04 Juanma Barranquero <lekktu@gmail.com>
10666
10667 Fix previous change: the library cache is defined in w32.c.
10668 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10669 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10670
0898ca10
JB
106712011-05-04 Juanma Barranquero <lekktu@gmail.com>
10672
10673 Implement dynamic loading of GnuTLS on Windows.
10674
10675 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10676 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10677 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10678 Declare.
10679
10680 * gnutls.c (Qgnutls_dll): Define.
10681 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10682 (gnutls_*): Declare function pointers.
10683 (init_gnutls_functions): New function to initialize function pointers.
10684 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10685 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10686 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10687 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10688 (emacs_gnutls_write, emacs_gnutls_read)
10689 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10690 (Fgnutls_available_p): New function.
10691 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
10692 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10693 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10694
10695 * image.c: Include w32.h.
10696 (Vimage_type_cache): Delete.
10697 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10698 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10699 (w32_delayed_load): Move to w32.c.
10700
10701 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10702
10703 * w32.c (QCloaded_from, Vlibrary_cache): Define.
10704 (w32_delayed_load): Move from image.c. When loading a library, record
10705 its filename in the :loaded-from property of the library id.
10706 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10707 Initialize and staticpro them.
10708 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10709
10710 * process.c: Include lisp.h before w32.h, not after.
10711 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10712 instead of gnutls_record_check_pending.
10713
10714 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10715
ff4de4aa
TZ
107162011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
10717
10718 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10719 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
10720 as passed in.
10721
abe95abb
JD
107222011-05-03 Jan Djärv <jan.h.d@swipnet.se>
10723
10724 * xterm.c (x_set_frame_alpha): Do not set property on anything
10725 else than FRAME_X_OUTER_WINDOW (Bug#8608).
10726
e16e55d4
JB
107272011-05-02 Juanma Barranquero <lekktu@gmail.com>
10728
10729 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
10730
bafcf6a5
JB
107312011-05-02 Juanma Barranquero <lekktu@gmail.com>
10732
10733 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10734 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10735 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10736 (gnutls_global_initialized, Qgnutls_bootprop_priority)
10737 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10738 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10739 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10740 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10741 (Qgnutls_bootprop_callbacks_verify): Make static.
10742
e7a6747f
AS
107432011-05-01 Andreas Schwab <schwab@linux-m68k.org>
10744
19ed11ba
AS
10745 * callproc.c: Indentation fixup.
10746
e7a6747f 10747 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
10748 (wait_for_termination, interruptible_wait_for_termination):
10749 Move after wait_for_termination_1.
e7a6747f 10750
1ef14cb4
LMI
107512011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
10752
10753 * sysdep.c (interruptible_wait_for_termination): New function
10754 which is like wait_for_termination, but allows keyboard
10755 interruptions.
10756
10757 * callproc.c (Fcall_process): Add (:file "file") as an option for
10758 the STDOUT buffer.
10759 (Fcall_process_region): Ditto.
10760
330d880c
EZ
107612011-04-30 Eli Zaretskii <eliz@gnu.org>
10762
8db90b73
EZ
10763 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10764 rather than `XVECTOR (FOO)->size'.
10765
330d880c
EZ
10766 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10767 inttypes.h, as a gnulib replacement is used if it not available in
10768 system headers.
10769
15cbd324
EZ
107702011-04-21 Eli Zaretskii <eliz@gnu.org>
10771
10772 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10773 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10774 of MOST_POSITIVE_FIXNUM. (Bug#8528)
10775
10776 * coding.c (coding_alloc_by_realloc): Error out if destination
10777 will grow beyond MOST_POSITIVE_FIXNUM.
10778 (decode_coding_emacs_mule): Abort if there isn't enough place in
10779 charbuf for the composition carryover bytes. Reserve an extra
10780 space for up to 2 characters produced in a loop.
10781 (decode_coding_iso_2022): Abort if there isn't enough place in
10782 charbuf for the composition carryover bytes.
10783
107842011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 10785
ae940cca
EZ
10786 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10787 aborting when %lld or %lll format is passed.
10788 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10789 %llo or %llx format is passed. (Bug#8545)
10790
03ab8921
EZ
10791 * window.c (window_scroll_line_based): Use a marker instead of
10792 simple variables to record original value of point. (Bug#7952)
10793
afda1437
EZ
10794 * doprnt.c (doprnt): Fix the case where a multibyte sequence
10795 produced by %s or %c overflows available buffer space. (Bug#8545)
10796
f76dee0c
PE
107972011-04-28 Paul Eggert <eggert@cs.ucla.edu>
10798
10799 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 10800 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 10801
fdc5744d
JB
108022011-04-28 Juanma Barranquero <lekktu@gmail.com>
10803
10804 * w32.c (init_environment): Warn about defaulting HOME to C:\.
10805
638f053a
JB
108062011-04-28 Juanma Barranquero <lekktu@gmail.com>
10807
10808 * keyboard.c (Qdelayed_warnings_hook): Define.
10809 (command_loop_1): Run `delayed-warnings-hook'
10810 if Vdelayed_warnings_list is non-nil.
10811 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10812 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10813
d178f871
EZ
108142011-04-28 Eli Zaretskii <eliz@gnu.org>
10815
10816 * doprnt.c (doprnt): Don't return value smaller than the buffer
10817 size if the message was truncated. (Bug#8545).
10818
b124fd93
JB
108192011-04-28 Juanma Barranquero <lekktu@gmail.com>
10820
10821 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10822 (Fx_window_property): #if-0 the whole functions, not just the bodies.
10823
e810457d
PE
108242011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10825
10826 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10827
ea51cceb
JB
108282011-04-27 Juanma Barranquero <lekktu@gmail.com>
10829
10830 * makefile.w32-in: Update dependencies.
10831
94dcfacf
EZ
108322011-04-27 Eli Zaretskii <eliz@gnu.org>
10833
10834 Improve `doprnt' and its usage. (Bug#8545)
10835 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10836 `format_end'. Remove support for %l as a conversion specifier.
10837 Don't use xrealloc. Improve diagnostics when the %l size modifier
10838 is used. Update the commentary.
10839
10840 * eval.c (verror): Simplify calculation of size_t.
10841
10842 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10843 messages.
10844
f61f41d7
PE
108452011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
10846
10847 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10848 change.
10849
96fb4434
PE
108502011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10851
10852 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10853 This makes this file independent of the recent pseudovector change.
10854
671875da 108552011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 10856
69e9b5a3
PE
10857 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10858
b5f869a7 10859 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 10860 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 10861 Remove unused local.
c8926152 10862 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 10863
841a1577 10864 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
10865 GCC 4.6.0 optimizes based on type-based alias analysis.
10866 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
10867 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10868 != &v->size, and therefore "v->size = 1; b->size = 2; return
10869 v->size;" must therefore return 1. This assumption is incorrect
10870 for Emacs, since it type-puns struct Lisp_Vector * with many other
10871 types. To fix this problem, this patch adds a new type struct
f904488f 10872 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
10873 and pseudovectors, and helps optimizing compilers not get fooled
10874 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
10875 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
10876 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10877 the size member.
eab3844f
PE
10878 (XSETPVECTYPE): Rewrite in terms of new macro.
10879 (XSETPVECTYPESIZE): New macro, specifying both type and size.
10880 This is a bit clearer, and further avoids the possibility of
10881 undesirable aliasing.
10882 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 10883 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
10884 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10885 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
10886 (ASIZE): Now uses header.size rather than size.
10887 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
10888 to avoid the hassle of writing XVECTOR (foo)->header.size.
10889 (struct vectorlike_header): New type.
eab3844f
PE
10890 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10891 object, to help avoid aliasing.
10892 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10893 (SUBRP): Likewise, since Lisp_Subr is a special case.
10894 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
10895 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
10896 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 10897 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
10898 changed to be "header.size" and "header.next".
10899 * buffer.h (struct buffer): Likewise.
10900 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
10901 * frame.h (struct frame): Likewise.
10902 * process.h (struct Lisp_Process): Likewise.
10903 * termhooks.h (struct terminal): Likewise.
10904 * window.c (struct save_window_data, struct saved_window): Likewise.
10905 * window.h (struct window): Likewise.
10906 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
10907 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
10908 * buffer.c (init_buffer_once): Likewise.
10909 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
10910 special case.
10911 * process.c (Fformat_network_address): Use local var for size,
10912 for brevity.
10913
0df1eac5
PE
10914 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
10915
847ab9d1 10916 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
10917 * data.c (atof): Remove decl; no longer used or needed.
10918 (digit_to_number): Move to lread.c.
10919 (Fstring_to_number): Use new string_to_number function, to be
10920 consistent with how the Lisp reader treats infinities and NaNs.
10921 Do not assume that floating-point numbers represent EMACS_INT
10922 without losing information; this is not true on most 64-bit hosts.
10923 Avoid double-rounding errors, by insisting on integers when
10924 parsing non-base-10 numbers, as the documentation specifies.
10925 * lisp.h (string_to_number): New decl, replacing ...
10926 (isfloat_string): Remove.
bc0a5c13 10927 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 10928 (read1): Do not accept +. and -. as integers; this
452f4150
PE
10929 appears to have been a coding error. Similarly, do not accept
10930 strings like +-1e0 as floating point numbers. Do not report
10931 overflow for integer overflows unless the base is not 10 which
10932 means we have no simple and reliable way to continue.
10933 Break out the floating-point parsing into a new
10934 function string_to_number, so that Fstring_to_number parses
10935 floating point numbers consistently with the Lisp reader.
04f2d78b 10936 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
10937 (E_CHAR, EXP_INT): Remove, replacing with ...
10938 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
10939 (string_to_number): New function, replacing isfloat_string.
10940 This function checks for valid syntax and produces the resulting
10941 Lisp float number too. Rework it so that string-to-number
bc0a5c13 10942 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
10943 so that overflow for non-base-10 numbers is reported only when
10944 there's no portable and simple way to convert to floating point.
452f4150 10945
67769ffc
PE
10946 * textprop.c (set_text_properties_1): Rewrite for clarity,
10947 and to avoid GCC warning about integer overflow.
10948
c20db43f
PE
10949 * intervals.h (struct interval): Use EMACS_INT for members
10950 where EMACS_UINT might cause problems. See
10951 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
10952 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
10953 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
10954 All uses changed.
37aa2f85
PE
10955 (offset_intervals): Tell GCC not to worry about length overflow
10956 when negating a negative length.
c20db43f 10957
2538aa2f
PE
10958 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
10959 (overrun_check_free): Likewise.
10960
f2d3008d
PE
10961 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
10962 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
10963 word size.
10964
ec8df744
PE
10965 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10966 (gnutls_make_error): Rename local to avoid shadowing.
10967 (gnutls_emacs_global_deinit): ifdef out; not used.
10968 (Fgnutls_boot): Use const for pointer to readonly storage.
10969 Comment out unused local. Fix pointer signedness problems.
10970
640ee02d
PE
10971 * lread.c (openp): Don't stuff size_t into an 'int'.
10972 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
10973 about possible signed overflow.
10974
6048fb2a
PE
10975 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10976 (GDK_KEY_g): Don't define if already defined.
10977 (xg_prepare_tooltip): Avoid pointer signedness problem.
10978 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
10979
fa3c87e1
PE
10980 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
10981 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
10982
2172544b
PE
10983 * xfns.c (Fx_window_property): Simplify a bit,
10984 to make a bit faster and to avoid GCC 4.6.0 warning.
10985 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
10986
9b821a21
PE
10987 * fns.c (internal_equal): Don't assume size_t fits in int.
10988
3c616cfa
PE
10989 * alloc.c (compact_small_strings): Tighten assertion a little.
10990
c2982e87
PE
10991 Replace pEd with more-general pI, and fix some printf arg casts.
10992 * lisp.h (pI): New macro, generalizing old pEd macro to other
10993 conversion specifiers. For example, use "...%"pI"d..." rather
10994 than "...%"pEd"...".
10995 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 10996 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
10997 * alloc.c (check_pure_size): Don't overflow by converting size to int.
10998 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
10999 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11000 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11001 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11002 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11003 64-bit hosts.
11004 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11005 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11006 * print.c (safe_debug_print, print_object): Likewise.
11007 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11008 to int.
6f04d126
PE
11009 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11010 avoiding the 0 flag, which is not portable.
c2982e87
PE
11011 * process.c (Fmake_network_process): Use pI to avoid cast.
11012 * region-cache.c (pp_cache): Likewise.
11013 * xdisp.c (decode_mode_spec): Likewise.
11014 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11015 behavior on 64-bit hosts with printf arg.
6f04d126 11016 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11017 (x_stop_queuing_selection_requests): Likewise.
11018 (x_get_window_property): Don't truncate byte count to an 'int'
11019 when tracing.
0b432f21 11020
5e073ec7
PE
11021 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11022 here, since it parses constructs like leading '-' and spaces,
11023 which are not wanted; and it overflows with large numbers.
11024 Instead, simply match F[0-9]+, which is what is wanted anyway.
11025
36372bf9
PE
11026 * alloc.c: Remove unportable assumptions about struct layout.
11027 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11028 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11029 (allocate_vectorlike, make_pure_vector): Use the new macros,
11030 plus offsetof, to remove unportable assumptions about struct layout.
11031 These assumptions hold on all porting targets that I know of, but
11032 they are not guaranteed, they're easy to remove, and removing them
11033 makes further changes easier.
11034
0b432f21
PE
11035 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11036 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11037 (string_overrun_cookie): Now const. Use initializers that
11038 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11039 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11040 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11041 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11042 multiple of sizeof (EMACS_INT); it need not be, if
11043 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11044 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11045
895009e1
JB
110462011-04-26 Juanma Barranquero <lekktu@gmail.com>
11047
11048 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11049
6a7a1b0b
TZ
110502011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11051
11052 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11053 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11054 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11055
841a1577 110562011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11057
11058 * lisp.h (Qdebug): List symbol.
895009e1 11059 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11060 * keyboard.c (debug-on-event): New variable.
11061 (handle_user_signal): Break into debugger when debug-on-event
11062 matches the current signal symbol.
11063
f2d3ba6f
DN
110642011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11065
11066 * alloc.c (check_sblock, check_string_bytes)
11067 (check_string_free_list): Convert to standard C.
11068
42ce4c63
TZ
110692011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11070
11071 * w32.c (emacs_gnutls_push): Fix typo.
11072
825cd63c
EZ
110732011-04-25 Eli Zaretskii <eliz@gnu.org>
11074
fb11d64d
EZ
11075 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11076 "cast to pointer from integer of different size".
11077
825cd63c
EZ
11078 Improve doprnt and its use in verror. (Bug#8545)
11079 * doprnt.c (doprnt): Document the set of format control sequences
11080 supported by the function. Use SAFE_ALLOCA instead of always
11081 using `alloca'.
11082
11083 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11084 is one byte too soon. Don't use xrealloc; instead xfree and
11085 xmalloc anew.
11086
e061a11b
TZ
110872011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11088
11089 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11090 callbacks stage.
11091
11092 * gnutls.c: Renamed global_initialized to
11093 gnutls_global_initialized. Added internals for the
11094 :verify-hostname-error, :verify-error, and :verify-flags
11095 parameters of `gnutls-boot' and documented those parameters in the
11096 docstring. Start callback support.
9173deec
JB
11097 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11098 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11099 on error. Return error code.
e061a11b
TZ
11100 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11101 (emacs_gnutls_read): Likewise.
11102 (Fgnutls_boot): Return handshake error code.
11103 (emacs_gnutls_handle_error): New function.
11104 (wsaerror_to_errno): Likewise.
11105
11106 * w32.h (emacs_gnutls_pull): Add prototype.
11107 (emacs_gnutls_push): Likewise.
11108
11109 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11110 (emacs_gnutls_push): Likewise.
11111
111122011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11113
11114 * process.c (wait_reading_process_output): Check if GnuTLS
11115 buffered some data internally if no FDs are set for TLS
11116 connections.
11117
11118 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11119 (LIBS): Link to USER_LIBS.
11120 ($(BLD)/gnutls.$(0)): New target.
11121
fa6996bc
EZ
111222011-04-24 Eli Zaretskii <eliz@gnu.org>
11123
eb35682e
EZ
11124 * xdisp.c (handle_single_display_spec): Rename the
11125 display_replaced_before_p argument into display_replaced_p, to
11126 make it consistent with the commentary. Fix typos in the
11127 commentary.
11128
e2ad650c
EZ
11129 * textprop.c (syms_of_textprop): Remove dead code.
11130 (copy_text_properties): Delete obsolete commentary about an
11131 interface that was deleted long ago. Fix typos in the description
11132 of arguments.
11133
1b2de274
EZ
11134 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11135 to changes in oldXMenu/XMenu.h from 2011-04-16.
11136 <menu_help_message, prev_menu_help_message>: Constify.
11137 (IT_menu_make_room): menu->help_text is now `const char **';
11138 adjust.
11139
11140 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11141 to changes in oldXMenu/XMenu.h from 2011-04-16.
11142 (struct XMenu): Declare `help_text' `const char **'.
11143
11144 * xfaces.c <Qunspecified>: Make extern again.
11145
11146 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11147 required by POSIX.
1b2de274 11148
762b15be
EZ
11149 * doc.c (get_doc_string): Improve the format passed to `error'.
11150
11151 * doprnt.c (doprnt): Improve commentary.
11152
11153 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11154
11155 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11156 them with etags.
11157
f1052e5d
EZ
11158 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11159 changes in globals.h immediately force recompilation.
762b15be
EZ
11160 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11161 $(CURDIR)/s/ms-w32.h.
11162 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11163
fa6996bc
EZ
11164 * character.c (Fchar_direction): Function deleted.
11165 (syms_of_character): Don't defsubr it.
11166 <char-direction-table>: Deleted.
11167
e6c3da20
EZ
111682011-04-23 Eli Zaretskii <eliz@gnu.org>
11169
11170 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11171 * doprnt.c: Include limits.h.
11172 (SIZE_MAX): New macro.
04f2d78b
CB
11173 (doprnt): Return a size_t value. 2nd arg is now size_t.
11174 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11175 Improve overflow protection. Support `l' modifier for integer
11176 conversions. Support %l conversion. Don't assume an EMACS_INT
11177 argument for integer conversions and for %c.
11178
11179 * lisp.h (doprnt): Restore prototype.
11180
11181 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11182 $(SRC)/character.h.
11183
11184 * Makefile.in (base_obj): Add back doprnt.o.
11185
11186 * deps.mk (doprnt.o): Add back prerequisites.
11187 (callint.o): Depend on character.h.
11188
11189 * eval.c (internal_lisp_condition_case): Include the handler
11190 representation in the error message.
11191 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11192 when breaking from the loop.
11193
11194 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11195
11196 * callint.c (Fcall_interactively): When displaying error message
11197 about invalid control letter, pass the character's codepoint, not
11198 a pointer to its multibyte form. Improve display of the character
11199 in octal and display also its hex code.
11200
11201 * character.c (char_string): Use %x to display the (unsigned)
11202 codepoint of an invalid character, to avoid displaying a bogus
11203 negative value.
11204
11205 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11206 `error', not SYMBOL_NAME itself.
11207
11208 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11209 character arguments to `error'.
11210
11211 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11212 to `error' in error message about FINAL_CHAR argument. Make sure
11213 FINAL_CHAR is a character, and use %c when it is passed as
11214 argument to `error'.
11215
4ffd0d6b 112162011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11217
11218 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11219
11220 * w32.c: Include <time.h>.
11221 (sys_localtime): New function.
11222
4ffd0d6b 112232011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11224
11225 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11226
4ffd0d6b 11227 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11228
4ffd0d6b 112292011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11230
4ffd0d6b
GM
11231 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11232 zombies (Bug#8467).
aac0c6e3 11233
04c56954
EZ
112342011-04-19 Eli Zaretskii <eliz@gnu.org>
11235
11236 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11237 gl_state.e_property when gl_state.object is Qt.
11238
11239 * insdel.c (make_gap_larger): Remove limitation of buffer size
11240 to <= INT_MAX.
11241
16a43933
CY
112422011-04-18 Chong Yidong <cyd@stupidchicken.com>
11243
11244 * xdisp.c (lookup_glyphless_char_display)
11245 (produce_glyphless_glyph): Handle cons cell entry in
11246 glyphless-char-display.
11247 (Vglyphless_char_display): Document it.
11248
11249 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11250 glyphless-char-display.
11251
4581706e
CY
112522011-04-17 Chong Yidong <cyd@stupidchicken.com>
11253
11254 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11255
11256 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11257
11258 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11259 definition for no-X builds.
11260
4887c6e2 112612011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11262
fd35b6f9
PE
11263 Static checks with GCC 4.6.0 and non-default toolkits.
11264
5c1ccb01
PE
11265 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11266
006c5daa
PE
11267 * process.c (keyboard_bit_set): Define only if SIGIO.
11268 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11269 (send_process): Repair possible setjmp clobbering.
11270
efc736d3
PE
11271 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11272
4e2fe2e6
PE
11273 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11274
f97334a2
PE
11275 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11276
4e75f29d
PE
11277 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11278 Define only if needed.
11279
90efadd1
PE
11280 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11281 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11282 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11283
3c647824
PE
11284 * dispextern.h (struct redisplay_interface): Rename param
11285 to avoid shadowing.
e264f262 11286 * termhooks.h (struct terminal): Likewise.
761383f4 11287 * xterm.c (xembed_send_message): Likewise.
3c647824 11288
b58c5c4a
PE
11289 * insdel.c (make_gap_smaller): Define only if
11290 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11291
cad59032
PE
11292 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11293 it.
11294
c339dc2e
PE
11295 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11296 so that we aren't warned about unused symbols.
11297
91a3e27b
PE
11298 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11299
399c71d3 11300 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11301
8ffc96f5
PE
11302 * xfns.c (x_real_positions): Mark locals as initialized.
11303
eef9bc79
PE
11304 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11305
098db9dd
PE
11306 * xterm.c: Fix problems found by static analysis with other toolkits.
11307 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11308 (x_dispatch_event): Declare static if USE_GTK, and
11309 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11310 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11311 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11312 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11313 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11314
eb18f6cc
PE
11315 * xmenu.c (menu_help_callback): Pointer type fixes.
11316 Use const pointers when pointing at readonly data. Avoid pointer
11317 signedness clashes.
11318 (FALSE): Remove unused macro.
11319 (update_frame_menubar): Remove unused decl.
11320
1fe72bf8
PE
11321 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11322
60d9e1db
PE
11323 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11324 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11325 (single_menu_item): Rename local to avoid shadowing.
11326
39261c26
PE
11327 * keyboard.c (make_lispy_event): Remove unused local var.
11328
018c5e19
PE
11329 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11330 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11331
63d2b86e
PE
11332 * bitmaps: Change bitmaps from unsigned char back to the X11
11333 compatible char. Avoid the old compiler warnings about
11334 out-of-range initializers by using, for example, '\xab' rather
11335 than 0xab.
11336
aefd87e1
PE
11337 * xgselect.c (xgselect_initialize): Check vs interface
11338 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11339
bf501fb9
PE
11340 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11341
e9829fdf
PE
11342 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11343 to read-only memory.
11344
1086c095
PE
11345 * fns.c (vector): Remove; this old hack is no longer needed.
11346
2baccd04 11347 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11348 Remove unused var.
dde42981 11349 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11350
72391843 11351 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11352
436c16df 11353 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11354 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11355 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11356
92bb796d 11357 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11358 (x_term_init): Remove local to avoid shadowing.
92bb796d 11359
764430a3 11360 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11361
11362 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11363 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11364
d1dfb56c
EZ
113652011-04-16 Eli Zaretskii <eliz@gnu.org>
11366
c4354cb4
EZ
11367 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11368
d1dfb56c
EZ
11369 Fix regex.c, syntax.c and friends for buffers > 2GB.
11370 * syntax.h (struct gl_state_s): Declare character position members
11371 EMACS_INT.
11372
11373 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11374
04f2d78b
CB
11375 * textprop.c (verify_interval_modification, interval_of):
11376 Declare arguments EMACS_INT.
d1dfb56c
EZ
11377
11378 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11379 EMACS_INT.
11380
11381 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11382
11383 * indent.c (Fvertical_motion): Local variable it_start is now
11384 EMACS_INT.
11385
11386 * regex.c (re_match, re_match_2, re_match_2_internal)
11387 (bcmp_translate, regcomp, regexec, print_double_string)
11388 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11389 (re_compile_pattern, re_exec): Declare arguments and local
11390 variables `size_t' and `ssize_t' and return values `regoff_t', as
11391 appropriate.
11392 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11393 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11394 <compile_stack_type>: `size' and `avail' are now `size_t'.
11395
11396 * regex.h <regoff_t>: Use ssize_t, not int.
11397 (re_search, re_search_2, re_match, re_match_2): Arguments that
11398 specify buffer/string position and length are now ssize_t and
11399 size_t. Return type is regoff_t.
11400
613052cd
BK
114012011-04-16 Ben Key <bkey76@gmail.com>
11402
11403 * nsfont.m: Fixed bugs in ns_get_family and
11404 ns_descriptor_to_entity that were caused by using free to
11405 deallocate memory blocks that were allocated by xmalloc (via
11406 xstrdup). This caused Emacs to crash when compiled with
11407 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11408 --enable-checking=xmallocoverrun). xfree is now used to
11409 deallocate these memory blocks.
11410
4170f62f 114112011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11412
71b41406
PE
11413 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11414
9587a89d
PE
11415 emacs_write: Accept and return EMACS_INT for sizes.
11416 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11417 et seq.
11418 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11419 Accept and return EMACS_INT.
11420 (emacs_gnutls_write): Return the number of bytes written on
11421 partial writes.
11422 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11423 (emacs_read, emacs_write): Remove check for negative size, as the
11424 Emacs source code has been audited now.
9587a89d
PE
11425 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11426 (emacs_read, emacs_write): Use it.
273a5f82
PE
11427 * process.c (send_process): Adjust to the new signatures of
11428 emacs_write and emacs_gnutls_write. Do not attempt to store
11429 a byte offset into an 'int'; it might overflow.
9587a89d 11430 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11431
3e047f51
PE
11432 * sound.c: Don't assume sizes fit in 'int'.
11433 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11434 Return EMACS_INT, not int.
3e047f51 11435 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11436 Accept EMACS_INT, not int.
11437 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11438 record read return values.
11439
cc39a9db
BK
114402011-04-15 Ben Key <bkey76@gmail.com>
11441
c9d0ec6d
JB
11442 * keyboard.c (Qundefined): Don't declare static since it is used
11443 in nsfns.m.
11444 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11445 static since they are used in nsfont.m.
cc39a9db 11446
6c60eb9f
SM
114472011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11448
11449 * process.c (Qprocessp): Don't declare static.
11450 * lisp.h (Qprocessp): Declare again.
11451
7990b61a
JB
114522011-04-15 Juanma Barranquero <lekktu@gmail.com>
11453
11454 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11455
5d4cb038
PE
114562011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11457
8bd7b830 11458 Improve C-level modularity by making more things 'static'.
cd64ea1d 11459
e3b27b31
PE
11460 Don't publish debugger-only interfaces to other modules.
11461 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11462 (verify_bytepos, count_markers): Move decls to the only modules
11463 that need them.
11464 * region-cache.h (pp_cache): Likewise.
11465 * window.h (check_all_windows): Likewise.
11466 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11467
5d4cb038
PE
11468 * sysdep.c (croak): Now static, if
11469 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11470 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11471
11472 * alloc.c (refill_memory_reserve): Now static if
11473 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11474 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11475
e87b6180
PE
11476 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11477 Define only if USE_LUCID.
11478
ac64929e
PE
11479 * xrdb.c (x_customization_string, x_rm_string): Now static.
11480
6f37259d
PE
11481 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11482 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11483
1683e3ab
PE
11484 * xdisp.c (draw_row_with_mouse_face): Now static.
11485 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11486
de9c2632
PE
11487 * window.h (check_all_windows): Mark externally visible.
11488
2b96acb7
PE
11489 * window.c (window_deletion_count): Now static.
11490
11491 * undo.c: Make symbols static if they're not exported.
11492 (last_undo_buffer, last_boundary_position, pending_boundary):
11493 Now static.
11494
50436f33
PE
11495 * textprop.c (interval_insert_behind_hooks): Now static.
11496 (interval_insert_in_front_hooks): Likewise.
11497
64520e5c
PE
11498 * term.c: Make symbols static if they're not exported.
11499 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11500 (max_frame_lines, tty_set_terminal_modes):
11501 (tty_reset_terminal_modes, tty_turn_off_highlight):
11502 (get_tty_terminal): Now static.
11503 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11504 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11505 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11506 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11507 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11508
1fa53021
PE
11509 * sysdep.c: Make symbols static if they're not exported.
11510 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11511 Now static.
11512 (sigprocmask_set, full_mask): Remove; unused.
11513 (wait_debugging): Mark as visible.
11514 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11515 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11516
d4b43b22
PE
11517 * syntax.c (syntax_temp): Define only if !__GNUC__.
11518
b7c513d0
PE
11519 * sound.c (current_sound_device, current_sound): Now static.
11520
989b29ad
PE
11521 * search.c (searchbufs, searchbuf_head): Now static.
11522
13a55a78
PE
11523 * scroll.c (scroll_cost): Remove; unused.
11524 * dispextern.h (scroll_cost): Remove decl.
11525
de68a1fc
PE
11526 * region-cache.h (pp_cache): Mark as externally visible.
11527
40ccffa6
PE
11528 * process.c: Make symbols static if they're not exported.
11529 (process_tick, update_tick, create_process, chan_process):
11530 (Vprocess_alist, proc_buffered_char, datagram_access):
11531 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11532 (deactivate_process): Mark defn as static, as well as decl.
11533 * lisp.h (create_process): Remove decl.
11534 * process.h (chan_process, Vprocess_alist): Remove decls.
11535
ad64fc97
PE
11536 * print.c: Make symbols static if they're not exported.
11537 (print_depth, new_backquote_output, being_printed, print_buffer):
11538 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11539 (print_interval, print_number_index, initial_stderr_stream):
11540 Now static.
11541 * lisp.h (Fprinc): Remove decl.
11542 (debug_output_compilation_hack): Mark as externally visible.
11543
adddb265
PE
11544 * sysdep.c (croak): Move decl from here to syssignal.h.
11545 * syssignal.h (croak): Put it here, so the API can be checked when
11546 'croak' is called from dissociate_if_controlling_tty.
11547
1717ede2
PE
11548 * minibuf.c: Make symbols static if they're not exported.
11549 (minibuf_save_list, choose_minibuf_frame): Now static.
11550 * lisp.h (choose_minibuf_frame): Remove decl.
11551
fa5fb2bc
PE
11552 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11553
1e3890d1
PE
11554 * lread.c: Make symbols static if they're not exported.
11555 (read_objects, initial_obarray, oblookup_last_bucket_number):
11556 Now static.
11557 (make_symbol): Remove; unused.
11558 * lisp.h (initial_obarray, make_symbol): Remove decls.
11559
8a1414fa
PE
11560 * keyboard.c: Make symbols static if they're not exported.
11561 (single_kboard, recent_keys_index, total_keys, recent_keys):
11562 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11563 (this_single_command_key_start, echoing, last_auto_save):
11564 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11565 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11566 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11567 (Vlispy_mouse_stem, double_click_count):
11568 Now static.
11569 (force_auto_save_soon): Define only if SIGDANGER.
11570 (ignore_mouse_drag_p): Now static if
11571 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11572 (print_help): Remove; unused.
11573 (stop_character, last_timer_event): Mark as externally visible.
11574 * keyboard.h (ignore_mouse_drag_p): Declare only if
11575 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11576 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11577 * lisp.h (echoing): Remove decl.
11578 (force_auto_save_soon): Declare only if SIGDANGER.
11579 * xdisp.c (redisplay_window): Simplify code, to make it more
11580 obvious that ignore_mouse_drag_p is not accessed if !defined
11581 USE_GTK && !defined HAVE_NS.
11582
93ea6e8f
PE
11583 * intervals.c: Make symbols static if they're not exported.
11584 (merge_properties_sticky, merge_interval_right, delete_interval):
11585 Now static.
11586 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11587
77382fcc
PE
11588 * insdel.c: Make symbols static if they're not exported.
11589 However, leave prepare_to_modify_buffer alone. It's never
11590 called from outside this function, but that appears to be a bug.
11591 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11592 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11593 (adjust_after_replace_noundo): Remove; unused.
11594 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 11595 (signal_before_change): Remove decls.
77382fcc 11596
9306c32e
PE
11597 * indent.c (val_compute_motion, val_vmotion): Now static.
11598
cd44d2eb
PE
11599 * image.c: Make symbols static if they're not exported.
11600 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11601 if USE_GTK.
11602 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11603 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11604
ad9a7a06
PE
11605 * fringe.c (standard_bitmaps): Now static.
11606 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11607
81626931
PE
11608 * frame.c: Make symbols static if they're not exported.
11609 (x_report_frame_params, make_terminal_frame): Now static.
11610 (get_frame_param): Now static, unless HAVE_NS.
11611 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11612 (x_get_resource_string): Remove; not used.
11613 * frame.h (make_terminal_frame, x_report_frame_params):
11614 (x_get_resource_string); Remove decls.
11615 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11616 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11617
239f9db9
PE
11618 * font.c, fontset.c: Make symbols static if they're not exported.
11619 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11620 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11621 * font.c (font_close_object): Now static.
11622 * font.h (font_close_object): Remove.
11623 * fontset.c (FONTSET_OBJLIST): Remove.
11624 (free_realized_fontset) #if-0 the body, which does nothing.
11625 (face_suitable_for_char_p): #if-0, as it's never called.
11626 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
11627 * xfaces.c (face_at_string_position):
11628 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
11629 since 0 is always ASCII.
11630
dfcf3579
PE
11631 * fns.c (weak_hash_tables): Now static.
11632
5045092b
PE
11633 * fileio.c: Make symbols static if they're not exported.
11634 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11635 (Vwrite_region_annotation_buffers): Now static.
11636
57a96f5c
PE
11637 * eval.c: Make symbols static if they're not exported.
11638 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11639 * lisp.h (backtrace_list): Remove decl.
11640
35f08c38
PE
11641 * emacs.c: Make symbols static if they're not exported.
11642 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11643 (fatal_error_code, fatal_error_signal_hook, standard_args):
11644 Now static.
11645 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11646 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11647 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11648 * lisp.h (fatal_error_signal_hook): Remove decl.
11649 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11650
f44bd759
PE
11651 * editfns.c: Move a (normally-unused) function to its only use.
11652 * editfns.c, lisp.h (get_operating_system_release): Remove.
11653 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11654 worth the hassle of breaking this out.
11655
b532497d
PE
11656 * xterm.c: Make symbols static if they're not exported.
11657 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11658 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11659 (x_destroy_window, x_delete_display):
11660 Now static.
11661 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11662 (x_mouse_leave): Remove; unused.
11663 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11664 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11665 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11666 Remove decls.
11667 (x_mouse_leave): Declare only if WINDOWSNT.
11668 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11669 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11670 USE_X_TOOLKIT.
11671
1675728f
PE
11672 * ftxfont.c: Make symbols static if they're not exported.
11673 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11674 HAVE_FREETYPE.
11675 * font.h (ftxfont_driver): Likewise.
11676
e4cebfca
PE
11677 * xfns.c: Make symbols static if they're not exported.
11678 (x_last_font_name, x_display_info_for_name):
11679 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11680 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11681 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11682 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11683 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11684 (last_show_tip_args): Now static.
11685 (xic_defaut_fontset, xic_create_fontsetname): Define only if
11686 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11687 (x_screen_planes): Remove; unused.
11688 * dispextern.h (x_screen_planes): Remove decl.
11689
5bf46f05
PE
11690 * dispnew.c: Make symbols static if they're not exported.
11691 * dispextern.h (redraw_garbaged_frames, scrolling):
11692 (increment_row_positions): Remove.
11693 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11694 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11695 Now static.
11696 (redraw_garbaged_frames): Remove; unused.
11697
435f4c28
PE
11698 * xfaces.c: Make symbols static if they're not exported.
11699 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11700 Remove decls.
11701 * xterm.h (defined_color): Remove decls.
11702 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11703 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11704 (menu_face_changed_default, defined_color, free_realized_face):
11705 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11706 (ascii_face_of_lisp_face): Remove; unused.
11707
8524aef3
PE
11708 * xdisp.c: Make symbols static if they're not exported.
11709 * dispextern.h (scratch_glyph_row, window_box_edges):
11710 (glyph_to_pixel_coords, set_cursor_from_row):
11711 (get_next_display_element, set_iterator_to_next):
11712 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11713 (show_mouse_face): Remove decls
11714 * frame.h (message_buf_print): Likewise.
11715 * lisp.h (pop_message, set_message, check_point_in_composition):
11716 Likewise.
11717 * xterm.h (set_vertical_scroll_bar): Likewise.
11718 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11719 (message_buf_print, scratch_glyph_row, displayed_buffer):
11720 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11721 (get_next_display_element, show_mouse_face, window_box_edges):
11722 (frame_to_window_pixel_xy, check_point_in_composition):
11723 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11724 (glyph_to_pixel_coords): Remove; unused.
11725
16390cd2
PE
11726 * dired.c (file_name_completion): Now static.
11727
11728 * dbusbind.c (xd_in_read_queued_messages): Now static.
11729
a25f4dfa
PE
11730 * lisp.h (circular_list_error, FOREACH): Remove; unused.
11731 * data.c (circular_list_error): Remove.
11732
14a9c8df
PE
11733 * commands.h (last_point_position, last_point_position_buffer):
11734 (last_point_position_window): Remove decls.
11735 * keyboard.c: Make these variables static.
11736
04f2d78b
CB
11737 * coding.h (coding, code_convert_region, encode_coding_gap):
11738 Remove decls.
74ab6df5
PE
11739 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11740 (iso_code_class, detect_coding, code_convert_region): Now static.
11741 (encode_coding_gap): Remove; unused.
11742
38dfbee1
PE
11743 * chartab.c (chartab_chars, chartab_bits): Now static.
11744
a2cb4e63
PE
11745 * charset.h (charset_iso_8859_1): Remove decl.
11746 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11747 Now static.
11748
127198fd
PE
11749 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11750 * ccl.c (Vccl_program_table): Now static.
11751 (check_ccl_update): Remove; unused.
11752
d85b608f
PE
11753 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11754 * category.h: ... from here.
11755 * category.c (check_category_table, set_category_set): Now static.
11756
31cd66f3
PE
11757 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11758 * lisp.h: Remove these decls.
11759
c358e587
PE
11760 * buffer.c (buffer_count): Remove unused var.
11761
e78aecca
PE
11762 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11763 so that it's not optimized away.
11764 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11765 * dispextern.h (bidi_dump_cached_states): Remove, since it's
11766 exported only to the debugger.
11767
e192d7d3 11768 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 11769 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 11770
92470028
PE
11771 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11772 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11773 was inaccessible from Lisp.
11774 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11775 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11776
244ed907
PE
11777 alloc.c: Import and export fewer symbols, and remove unused items.
11778 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11779 is defined.
11780 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11781 it's not optimized away by whole-program optimization.
11782 (message_enable_multibyte, free_misc): Remove.
11783 (catchlist, handlerlist, mark_backtrace):
11784 Declare only if BYTE_MARK_STACK.
11785 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11786 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11787 (message_enable_multibyte): Remove decl.
11788 (free_misc, interval_free_list, float_block, float_block_index):
11789 (n_float_blocks, float_free_list, cons_block, cons_block_index):
11790 (cons_free_list, last_marked_index):
11791 Now static.
11792 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11793 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11794 (mark_backtrace): Define only if BYTE_MARK_STACK.
11795 * xdisp.c (message_enable_multibyte): Now static.
11796
61c2b50e 11797 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
11798 This makes it easier for human readers (and static analyzers)
11799 to see whether these variables are used from other modules.
11800 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11801 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11802 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11803 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11804 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11805 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11806 * xmenu.c, xselect.c:
11807 Declare Q* vars static if they are not used in other modules.
11808 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11809 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11810 Remove decls of unexported vars.
11811 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11812
95c82688
PE
11813 * lisp.h (DEFINE_FUNC): Make sname 'static'.
11814
16a97296
PE
11815 Make Emacs functions such as Fatom 'static' by default.
11816 This makes it easier for human readers (and static analyzers)
11817 to see whether these functions can be called from other modules.
11818 DEFUN now defines a static function. To make the function external
11819 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
11820 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11821 (Finit_image_library):
16a97296
PE
11822 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11823 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11824 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11825 Remove decls, since these functions are now static.
11826 (Funintern, Fget_internal_run_time): New decls, since these functions
11827 were already external.
95c82688 11828
16a97296
PE
11829 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11830 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11831 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11832 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11833 * keyboard.c, keymap.c, lread.c:
11834 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11835 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11836 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11837 Mark functions with DEFUE instead of DEFUN,
11838 if they are used in other modules.
11839 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11840 decls for now-static functions.
11841 * buffer.h (Fdelete_overlay): Remove decl.
11842 * callproc.c (Fgetenv_internal): Mark as internal.
11843 * composite.c (Fremove_list_of_text_properties): Remove decl.
11844 (Fcomposition_get_gstring): New forward static decl.
11845 * composite.h (Fcomposite_get_gstring): Remove decl.
11846 * dired.c (Ffile_attributes): New forward static decl.
11847 * doc.c (Fdocumntation_property): New forward static decl.
11848 * eval.c (Ffetch_bytecode): New forward static decl.
11849 (Funintern): Remove extern decl; now in .h file where it belongs.
11850 * fileio.c (Fmake_symbolic_link): New forward static decl.
11851 * image.c (Finit_image_library): New forward static decl.
11852 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11853 * intervals.h (Fprevious_property_change):
11854 (Fremove_list_of_text_properties): Remove decls.
11855 * keyboard.c (Fthis_command_keys): Remove decl.
11856 (Fcommand_execute): New forward static decl.
11857 * keymap.c (Flookup_key): New forward static decl.
11858 (Fcopy_keymap): Now static.
11859 * keymap.h (Flookup_key): Remove decl.
11860 * process.c (Fget_process): New forward static decl.
11861 (Fprocess_datagram_address): Mark as internal.
11862 * syntax.c (Fsyntax_table_p): New forward static decl.
11863 (skip_chars): Remove duplicate decl.
11864 * textprop.c (Fprevious_property_change): New forward static decl.
11865 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11866 Now internal.
11867 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11868 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11869
785bbd42
PE
11870 * editfns.c (Fformat): Remove unreachable code.
11871
8b913b57
AS
118722011-04-14 Andreas Schwab <schwab@linux-m68k.org>
11873
11874 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11875 change. (Bug#8496)
11876
a6744a35
EZ
118772011-04-13 Eli Zaretskii <eliz@gnu.org>
11878
11879 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11880 when at ZV. (Bug#8487)
11881
e7974947
AS
118822011-04-12 Andreas Schwab <schwab@linux-m68k.org>
11883
baad03f0
AS
11884 * charset.c (Fclear_charset_maps): Use xfree instead of free.
11885 (Bug#8437)
11886 * keyboard.c (parse_tool_bar_item): Likewise.
11887 * sound.c (sound_cleanup, alsa_close): Likewise.
11888 * termcap.c (tgetent): Likewise.
11889 * xfns.c (x_default_font_parameter): Likewise.
11890 * xsettings.c (read_and_apply_settings): Likewise.
11891
e7974947
AS
11892 * alloc.c (overrun_check_malloc, overrun_check_realloc)
11893 (overrun_check_free): Protoize.
11894
28272684
PE
118952011-04-12 Paul Eggert <eggert@cs.ucla.edu>
11896
11897 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
11898 since callers should never pass a negative size.
11899 Change the signature to match that of plain 'read' and 'write'; see
11900 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
11901 * lisp.h: Update prototypes of emacs_write and emacs_read.
11902
11997c76
EZ
119032011-04-11 Eli Zaretskii <eliz@gnu.org>
11904
11905 * xdisp.c (redisplay_window): Don't try to determine the character
11906 position of the scroll margin if the window start point w->startp
e896f03c 11907 is outside the buffer's accessible region. (Bug#8468)
11997c76 11908
8a2cbd72
EZ
119092011-04-10 Eli Zaretskii <eliz@gnu.org>
11910
11911 Fix write-region and its subroutines for buffers > 2GB.
11912 * fileio.c (a_write, e_write): Modify declaration of arguments and
11913 local variables to support buffers larger than 2GB.
11914 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
11915
11916 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
11917 argument, local variables, and return value.
11918
11919 * lisp.h: Update prototypes of emacs_write and emacs_read.
11920
11921 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
11922
4073e537 119232011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 11924
1ebfdcb6
PE
11925 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
11926
b2ded58d
PE
11927 Fix more problems found by GCC 4.6.0's static checks.
11928
7d66342c
PE
11929 * xdisp.c (vmessage): Use a better test for character truncation.
11930
bbf47d44
PE
11931 * charset.c (load_charset_map): <, not <=, for optimization,
11932 and to avoid potential problems with integer overflow.
9248994d 11933 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 11934 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 11935 * editfns.c (Fformat): Likewise.
1e69125e 11936 * syntax.c (skip_chars): Likewise.
3befa583 11937
e3019616
PE
11938 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
11939 This also lets GCC 4.6.0 generate slightly better loop code.
11940
becfa255
PE
11941 * callint.c (Fcall_interactively): <, not <=, for optimization.
11942 (Fcall_interactively): Count the number of arguments produced,
11943 not the number of arguments given. This is simpler and lets GCC
11944 4.6.0 generate slightly better code.
11945
dae0cd48
PE
11946 * ftfont.c: Distingish more carefully between FcChar8 and char.
11947 The previous code passed unsigned char * to a functions like
11948 strlen and xstrcasecmp that expect char *, which does not
11949 conform to the C standard.
11950 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
11951 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
11952 char * when the C standard requires it.
11953
76032d70
PE
11954 * keyboard.c (read_char): Remove unused var.
11955
eb3f1cc8
PE
11956 * eval.c: Port to Windows vsnprintf (Bug#8435).
11957 Include <limits.h>.
11958 (SIZE_MAX): Define if the headers do not.
11959 (verror): Do not give up if vsnprintf returns a negative count.
11960 Instead, grow the buffer. This ports to Windows vsnprintf, which
11961 does not conform to C99. Problem reported by Eli Zaretskii.
11962 Also, simplify the allocation scheme, by avoiding the need for
11963 calling realloc, and removing the ALLOCATED variable.
11964
70476b54
PE
11965 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
11966
12020a9e
PE
11967 Remove invocations of doprnt, as Emacs now uses vsnprintf.
11968 But keep the doprint source code for now, as we might revamp it
11969 and use it again (Bug#8435).
ea6c7ae6
PE
11970 * lisp.h (doprnt): Remove.
11971 * Makefile.in (base_obj): Remove doprnt.o.
11972 * deps.mk (doprnt.o): Remove.
11973
5fdb398c
PE
11974 error: Print 32- and 64-bit integers portably (Bug#8435).
11975 Without this change, on typical 64-bit hosts error ("...%d...", N)
11976 was used to print both 32- and 64-bit integers N, which relied on
11977 undefined behavior.
61bdb816 11978 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
11979 * lisp.h (error, verror): Mark as printf-like functions.
11980 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
11981 Report overflow in size calculations when allocating printf buffer.
11982 Do not truncate output string at its first null byte.
11983 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
11984 Truncate the output at a character boundary, since vsnprintf does not
11985 do that.
11986 * charset.c (check_iso_charset_parameter): Convert internal
11987 character to string before calling 'error', since %c now has the
11988 printf meaning.
11989 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
11990 overflow when computing char to be passed to 'error'. Do not
11991 pass Lisp_Object to 'error'; pass the integer instead.
11992 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
11993 formatted with plain %d.
11994
b189fa66
PE
11995 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
11996
bff87ef0
PE
11997 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
11998
7e2cac20
PE
11999 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12000
ce4d90b5
PE
12001 * xterm.c (x_catch_errors): Remove duplicate declaration.
12002
266c9547
PE
12003 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12004
79c49ad2
PE
12005 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12006
368f4090
JM
120072011-04-10 Jim Meyering <meyering@redhat.com>
12008
12009 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12010 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12011 return ssize_t not "int", and use size_t as the buffer length.
12012 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12013 * gnutls.h: Update declarations.
12014 * process.c (read_process_output): Use ssize_t, to match.
12015 (send_process): Likewise.
12016
a32d4040
CY
120172011-04-09 Chong Yidong <cyd@stupidchicken.com>
12018
12019 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12020
8546720e 120212011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12022
04f2d78b
CB
12023 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12024 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12025
8546720e
GM
12026 * xterm.c (handle_one_xevent):
12027 * xmenu.c (create_and_show_popup_menu):
12028 * xselect.c (x_decline_selection_request)
12029 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12030
0a2f5c1a 120312011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12032
12033 Fix some uses of `int' instead of EMACS_INT.
12034 * search.c (string_match_1, fast_string_match)
12035 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12036 (scan_buffer, find_next_newline_no_quit)
12037 (find_before_next_newline, search_command, Freplace_match)
12038 (Fmatch_data): Make some `int' variables be EMACS_INT.
12039
12040 * xdisp.c (display_count_lines): 3rd argument and return value now
12041 EMACS_INT. All callers changed.
12042 (pint2hrstr): Last argument is now EMACS_INT.
12043
12044 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12045 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12046 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12047 (decode_coding_utf_16, decode_coding_emacs_mule)
12048 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12049 (decode_coding_ccl, decode_coding_charset)
12050 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12051 (decode_coding_iso_2022, decode_coding_emacs_mule)
12052 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12053 <char_offset, last_offset>: Declare EMACS_INT.
12054 (encode_coding_utf_8, encode_coding_utf_16)
12055 (encode_coding_emacs_mule, encode_invocation_designation)
12056 (encode_designation_at_bol, encode_coding_iso_2022)
12057 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12058 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12059 Declare EMACS_INT.
12060 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12061 (encode_invocation_designation): Last argument P_NCHARS is now
12062 EMACS_INT.
12063 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12064 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12065
12066 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12067 All users changed.
12068
12069 * ccl.c (Fccl_execute_on_string): Declare some variables
12070 EMACS_INT.
12071
8546720e 120722011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12073
12074 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12075
4e19a977
CS
120762011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12077
12078 * process.c (Fformat_network_address): Doc fix.
12079
87302331
R
120802011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12081
ee7683eb 12082 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12083
cbb59342
CY
120842011-04-08 Chong Yidong <cyd@stupidchicken.com>
12085
12086 * keyboard.c (read_char): Call Lisp function help-form-show,
12087 instead of using internal_with_output_to_temp_buffer.
12088 (Qhelp_form_show): New var.
e0d38eeb 12089 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12090
12091 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12092
12093 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12094
e67a13ab
CY
120952011-04-06 Chong Yidong <cyd@stupidchicken.com>
12096
04f2d78b
CB
12097 * process.c (Flist_processes): Remove to Lisp.
12098 (list_processes_1): Delete.
e67a13ab 12099
973f782d
EZ
121002011-04-06 Eli Zaretskii <eliz@gnu.org>
12101
7c106b1e
EZ
12102 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12103
973f782d
EZ
12104 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12105
41cf7d1a 121062011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12107
ca23cc88
PE
12108 Fix more problems found by GCC 4.6.0's static checks.
12109
f390e2d5
PE
12110 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12111
42eea0d0
PE
12112 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12113
b69769da 12114 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12115
f9541e84
PE
12116 * xdisp.c (vmessage): Mark as a printf-like function.
12117
13841b55
PE
12118 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12119
c136c10f
PE
12120 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12121
5e2d4a30
PE
12122 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12123 printf-like functions.
12124 (tiff_load): Add casts to remove these marks before passing them
12125 to system-supplied API.
12126
583f48b9
PE
12127 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12128
b25d760e
PE
12129 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12130 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12131 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12132 directly, rather than having caller test rule sign. This avoids
12133 some unnecessary tests.
12134 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12135 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12136 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12137
bc7b6697 12138 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12139 (xfont_open): Avoid unnecessary tests.
bc7b6697 12140
27ccc379
PE
12141 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12142
dcd5c89a
PE
12143 * composite.h, composite.c (composition_gstring_put_cache):
12144 Use EMACS_INT, not int, for length.
12145
b13a45c6
PE
12146 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12147 breaking out part of COMPOSITION_DECODE_RULE.
12148 (COMPOSITION_DECODE_RULE): Use it.
12149 * composite.c (get_composition_id): Remove unused local vars,
12150 by using the new macro.
12151
1e792e4d
PE
12152 * textprop.c (set_text_properties_1): Change while to do-while,
12153 since the condition is always true at first.
12154
dc6c6455 12155 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12156 (interval_deletion_adjustment): Return unsigned value.
12157 All uses changed.
dc6c6455 12158
aba7731a
PE
12159 * process.c (list_processes_1, create_pty, read_process_output):
12160 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12161 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12162 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12163 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12164 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12165
fdfc4bf3
PE
12166 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12167
fca8fe46 12168 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12169 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12170
06a0259a 12171 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12172 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12173 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12174
e7b9e80f
PE
12175 * print.c (print_error_message): Avoid int overflow.
12176
56201685
PE
12177 * font.c (font_list_entities): Redo for clarity,
12178 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12179
78834453 12180 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12181 (font_score): Avoid potential overflow in diff calculation.
78834453 12182
0bc0b309 12183 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12184 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12185
e610eaca
PE
12186 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12187
b895abce
PE
12188 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12189 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12190 can always succeed if overflow has undefined behavior.
12191
1f1d9321 12192 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12193 (wordify): Omit three unnecessary tests.
1f1d9321 12194
c59478bc
PE
12195 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12196 All callers changed. This avoids the need for an unused var.
12197
79b73827
PE
12198 * casefiddle.c (casify_region): Remove var that is set but not used.
12199
a4db5dfe
PE
12200 * dired.c (file_name_completion): Remove var that is set but not used.
12201
43aae36e
PE
12202 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12203
2a47c44d 12204 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12205 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12206
a37c69bf
PE
12207 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12208 Check for integer overflow on size calculations.
12209
328ab8e7
PE
12210 * buffer.c (Fprevious_overlay_change): Remove var that is set
12211 but not used.
12212
e5a2a5cb
PE
12213 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12214 Remove vars that are set but not used.
8d84a6eb 12215 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12216 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12217
a60e5f68
PE
12218 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12219
f661cb61 12220 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12221 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12222
f0397f5a
PE
12223 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12224 that are set but not used.
12225
8664db06 12226 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12227 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12228
6abdaa4a
PE
12229 * xselect.c (x_get_local_selection, x_handle_property_notify):
12230 Remove vars that are set but not used.
12231
0ce7538d 12232 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12233 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12234
9ae848fc
PE
12235 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12236 Remove var that is set but not used.
0b918413
PE
12237 (scroll_bar_windows_size): Now size_t, not int.
12238 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12239 Check for overflow.
9ae848fc 12240
a5a62657
PE
12241 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12242 (map_tty_color) [!defined MSDOS]: Likewise.
12243
5c5cdd39
PE
12244 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12245
66ebf983
PE
12246 * coding.c: Remove vars that are set but not used.
12247 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12248 All callers changed.
12249 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12250 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12251 (decode_coding_charset): Remove vars that are set but not used.
12252
1be4d761
PE
12253 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12254 that is set but not used.
12255
47553fa8
PE
12256 * print.c (print_object): Remove var that is set but not used.
12257
1f7196bf 12258 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12259 The gnulib version avoids calling malloc in the usual case,
12260 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12261 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12262 * filelock.c (current_lock_owner): Likewise.
12263 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12264 * sysdep.c: Include allocator.h, careadlinkat.h.
12265 (emacs_no_realloc_allocator): New static constant.
12266 (emacs_readlink): New function.
fdb61804
PE
12267 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12268 ../lib/careadlinkat.h.
d1fdcab7 12269
f84c17c7
SM
122702011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12271
12272 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12273 first non-nil return value).
12274
ef3862ad
JD
122752011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12276
12277 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12278 if not defined (Bug#8403).
12279
376a7006
JB
122802011-04-02 Juanma Barranquero <lekktu@gmail.com>
12281
12282 * xdisp.c (display_count_lines): Remove parameter `start',
12283 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12284 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12285 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12286 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12287 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12288 and thereabouts. All callers changed.
12289 (get_per_char_metric): Remove parameter `f', unused since
12290 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12291
6ca3801d
JM
122922011-04-02 Jim Meyering <meyering@redhat.com>
12293
12294 do not dereference NULL upon failed strdup
12295 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12296 (ns_get_family): Likewise.
12297
d8e2b5ba
JB
122982011-04-02 Juanma Barranquero <lekktu@gmail.com>
12299
12300 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12301
8c74fcbd
JD
123022011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12303
12304 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12305 later (Bug#8403).
12306
7200d79c
SM
123072011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12308
03408648 12309 Add lexical binding.
7200d79c 12310
03408648
SM
12311 * window.c (Ftemp_output_buffer_show): New fun.
12312 (Fsave_window_excursion):
12313 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12314
12315 * lread.c (lisp_file_lexically_bound_p): New function.
12316 (Fload): Bind Qlexical_binding.
12317 (readevalloop): Remove `evalfun' arg.
12318 Bind Qinternal_interpreter_environment.
12319 (Feval_buffer): Bind Qlexical_binding.
12320 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12321 Mark as dynamic.
12322 (syms_of_lread): Declare `lexical-binding'.
12323
12324 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12325
12326 * keyboard.c (eval_dyn): New fun.
12327 (menu_item_eval_property): Use it.
ca105506
SM
12328
12329 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12330
03408648
SM
12331 * fns.c (concat, mapcar1): Accept byte-code-functions.
12332
12333 * eval.c (Fsetq): Handle lexical vars.
12334 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12335 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12336 (FletX, Flet): Obey lexical binding.
12337 (Fcommandp): Handle closures.
12338 (Feval): New `lexical' arg.
12339 (eval_sub): New function extracted from Feval. Use it almost
12340 everywhere where Feval was used. Look up vars in lexical env.
12341 Handle closures.
12342 (Ffunctionp): Move from subr.el.
12343 (Ffuncall): Handle closures.
12344 (apply_lambda): Remove `eval_flags'.
12345 (funcall_lambda): Handle closures and new byte-code-functions.
12346 (Fspecial_variable_p): New function.
12347 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12348 but without exporting it to Lisp.
23aba0ea 12349
23aba0ea 12350 * doc.c (Fdocumentation, store_function_docstring):
03408648 12351 * data.c (Finteractive_form): Handle closures.
23aba0ea 12352
03408648
SM
12353 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12354 interactive spec.
ba83908c 12355
04f2d78b
CB
12356 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12357 New byte-codes.
03408648
SM
12358 (exec_byte_code): New function extracted from Fbyte_code to handle new
12359 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12360
03408648 12361 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12362
03408648 12363 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12364
e2abce01
JB
123652011-03-31 Juanma Barranquero <lekktu@gmail.com>
12366
12367 * xdisp.c (redisplay_internal): Fix prototype.
12368
63696a73 123692011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12370
63696a73 12371 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12372 (try_scrolling): Use it when setting scroll_limit.
12373 Limit scrolling to 100 screen lines.
63696a73
EZ
12374 (redisplay_window): Even when falling back on "recentering",
12375 position point in the window according to scroll-conservatively,
12376 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12377
12378 (try_scrolling): When point is above the window, allow searching
12379 as far as scroll_max, or one screenful, to compute vertical
12380 distance from PT to the scroll margin position. This prevents
12381 try_scrolling from unnecessarily failing when
12382 scroll-conservatively is set to a value slightly larger than the
12383 window height. Clean up the case of PT below the margin at bottom
12384 of window: scroll_max can no longer be INT_MAX. When aggressive
12385 scrolling is in use, don't let point enter the opposite scroll
12386 margin as result of the scroll.
12387 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12388 threshold of 100 lines for never-recentering scrolling.
12389
e4cc2dfc
JB
123902011-03-31 Juanma Barranquero <lekktu@gmail.com>
12391
12392 * dispextern.h (move_it_by_lines):
12393 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12394 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12395 (message_log_check_duplicate): Remove parameters `prev_bol' and
12396 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12397 (redisplay_internal): Remove parameter `preserve_echo_area',
12398 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12399
12400 * indent.c (Fvertical_motion):
12401 * window.c (window_scroll_pixel_based, Frecenter):
12402 Don't pass `need_y_p' to `move_it_by_lines'.
12403
1c470562
SM
124042011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12405
44f230aa
SM
12406 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12407 steal a few bits to be more compact.
12408 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12409 Remove unneeded casts.
12410
1c470562
SM
12411 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12412
888adce9
ZK
124132011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12414
12415 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12416 binding" message (bug#7967).
12417
f838ed7b
PE
124182011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12419
77861b95
PE
12420 Fix more problems found by GCC 4.6.0's static checks.
12421
de6dbc14
PE
12422 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12423 Remove unused local var.
12424
f838ed7b
PE
12425 * editfns.c (Fmessage_box): Remove unused local var.
12426
792c7b2b
PE
12427 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12428 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12429 Omit unused local vars.
c499e557 12430 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12431 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12432 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12433 Omit unused local var.
12434
ba0165e1
PE
12435 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12436 Don't assume string length fits in int.
32ad8845 12437 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12438 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12439
3c59b4c9
PE
12440 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12441 instead of alloca (Bug#8344).
12442
a3eed478 12443 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12444 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12445
eb4d412d
PE
12446 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12447
1658b401
PE
12448 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12449 concerns.
12450
12451 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12452
12453 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12454
9a2c6e05
PE
12455 * keyboard.c (syms_of_keyboard): Use the same style as later
12456 in this function when indexing through an array. This also
12457 works around GCC bug 48267.
12458
03d0a109
PE
12459 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12460
44f730c8
PE
12461 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12462
fe75f926
PE
12463 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12464 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12465
ffa8c828
PE
12466 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12467 This avoids undefined behavior on integer overflow, and is a bit
12468 more convenient anyway since it is compared to a size_t variable.
12469
c5101a77
PE
12470 Variadic C functions now count arguments with size_t, not int.
12471 This avoids an unnecessary limitation on 64-bit machines, which
12472 caused (substring ...) to crash on large vectors (Bug#8344).
12473 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12474 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12475 All variadic functions and their callers changed accordingly.
c5101a77
PE
12476 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12477 * data.c (arith_driver, float_arith_driver): Likewise.
12478 * editfns.c (general_insert_function): Likewise.
12479 * eval.c (struct backtrace.nargs, interactive_p)
12480 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12481 (funcall_lambda, mark_backtrace): Likewise.
12482 * fns.c (concat): Likewise.
12483 * frame.c (x_set_frame_parameters): Likewise.
12484 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12485 0 if not found, not -1. All callers changed.
12486
dd3f25f7
PE
12487 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12488 (stack_copy_size): Now size_t, not int.
12489 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12490
461c2ab9
JB
124912011-03-28 Juanma Barranquero <lekktu@gmail.com>
12492
12493 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12494 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12495 All callers changed.
12496
12497 * lisp.h (multibyte_char_to_unibyte):
12498 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12499 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12500 * character.h (CHAR_TO_BYTE8):
12501 * cmds.c (internal_self_insert):
12502 * editfns.c (general_insert_function):
12503 * keymap.c (push_key_description):
12504 * search.c (Freplace_match):
12505 * xdisp.c (message_dolog, set_message_1): All callers changed.
12506
f6d62986
SM
125072011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12508
12509 * keyboard.c (safe_run_hook_funcall): New function.
12510 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12511 don't set the hook to nil, but remove the offending function instead.
12512 (Qcommand_hook_internal): Remove, unused.
12513 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12514 Vcommand_hook_internal.
12515
12516 * eval.c (enum run_hooks_condition): Remove.
12517 (funcall_nil, funcall_not): New functions.
12518 (run_hook_with_args): Call each function through a `funcall' argument.
12519 Remove `cond' argument, now redundant.
12520 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12521 (Frun_hook_with_args_until_failure): Adjust accordingly.
12522 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12523
1db5b1ad
JB
125242011-03-28 Juanma Barranquero <lekktu@gmail.com>
12525
12526 * dispextern.h (string_buffer_position): Remove declaration.
12527
12528 * print.c (strout): Remove parameter `multibyte', unused since
12529 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12530
12531 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12532 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12533 All callers changed.
12534
12535 * w32.c (_wsa_errlist): Use braces for struct initializers.
12536
12537 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12538 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12539 All callers changed.
12540 (string_buffer_position): Likewise. Also, make static (it's never
12541 used outside xdisp.c).
12542 (cursor_row_p): Remove parameter `w', unused since
12543 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12544 (decode_mode_spec): Remove parameter `precision', introduced during
12545 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12546 All callers changed.
12547
5ffb62aa
JD
125482011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12549
12550 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12551
461c2ab9 125522011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12553
12554 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12555 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12556 (ns_update_auto_hide_menu_bar): New functions.
12557 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12558 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12559 ns_constrain_all_frames.
12560 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12561 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12562
5c380ffb
JD
125632011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12564
12565 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12566
9af30bdf
GM
125672011-03-27 Glenn Morris <rgm@gnu.org>
12568
12569 * syssignal.h: Replace RETSIGTYPE with void.
12570 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12571 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12572 Replace SIGTYPE with void everywhere.
12573 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12574 * s/template.h (SIGTYPE): Remove commented out definition.
12575
e2abce01
JB
125762011-03-26 Eli Zaretskii <eliz@gnu.org>
12577
12578 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12579 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12580
f868cd8a
JB
125812011-03-26 Juanma Barranquero <lekktu@gmail.com>
12582
59eb0929
JB
12583 * w32.c (read_unc_volume): Use parameter `henum', instead of
12584 global variable `wget_enum_handle'.
12585
12586 * keymap.c (describe_vector): Remove parameters `indices' and
12587 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12588 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12589
f868cd8a
JB
12590 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12591
12592 * keyboard.c (timer_check): Remove parameter `do_it_now',
12593 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12594 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12595 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12596
12597 * keyboard.c (read_char):
12598 * w32menu.c (w32_menu_display_help):
12599 * xmenu.c (show_help_event, menu_help_callback):
12600 Adjust calls to `show_help_echo'.
12601
12602 * gtkutil.c (xg_maybe_add_timer):
12603 * keyboard.c (readable_events):
12604 * process.c (wait_reading_process_output):
12605 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12606
12607 * insdel.c (adjust_markers_gap_motion):
12608 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12609 (gap_left, gap_right): Don't call it.
12610
2ecf6fdb
CY
126112011-03-25 Chong Yidong <cyd@stupidchicken.com>
12612
12613 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12614 incurred during fontification.
12615
6b1f9ba4
JB
126162011-03-25 Juanma Barranquero <lekktu@gmail.com>
12617
12618 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12619 (DEFVAR_PER_BUFFER): Don't pass it.
12620
12621 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12622 (scrolling_window): Don't pass it.
12623
0f4a96b5
JB
126242011-03-25 Juanma Barranquero <lekktu@gmail.com>
12625
12626 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12627
12628 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12629 and `suffix'.
12630 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12631 of variables specific to SELinux and computation of `encoded_absname'.
12632
12633 * image.c (XPutPixel): Remove unused variable `height'.
12634
12635 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12636
12637 * unexw32.c (get_section_info): Remove unused variable `section'.
12638
12639 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12640 (system_process_attributes): Remove unused variable `sess'.
12641 (sys_read): Remove unused variable `err'.
12642
12643 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12644 (w32_wnd_proc): Remove unused variable `isdead'.
12645 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12646 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12647 (x_create_tip_frame): Remove unused variable `tem'.
12648
12649 * w32inevt.c (w32_console_read_socket):
12650 Remove unused variable `no_events'.
12651
12652 * w32term.c (x_draw_composite_glyph_string_foreground):
12653 Remove unused variable `width'.
12654
1149507c
JB
126552011-03-24 Juanma Barranquero <lekktu@gmail.com>
12656
12657 * w32term.c (x_set_glyph_string_clipping):
12658 Don't pass uninitialized region to CombineRgn.
12659
9c88f339
JB
126602011-03-23 Juanma Barranquero <lekktu@gmail.com>
12661
12662 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12663 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12664 (Fx_close_connection): Remove unused variable `i'.
12665
12666 * w32font.c (w32font_draw): Return number of glyphs.
12667 (w32font_open_internal): Remove unused variable `i'.
12668 (w32font_driver): Add missing initializer.
12669
12670 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12671 (fill_in_menu): Remove unused variable `items_added'.
12672
12673 * w32term.c (last_mouse_press_frame): Remove static global variable.
12674 (w32_clip_to_row): Remove unused variable `f'.
12675 (x_delete_terminal): Remove unused variable `i'.
12676
12677 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12678 (NOTHING): Remove unused static global variable.
12679 (uniscribe_check_otf): Remove unused variable `table'.
12680 (uniscribe_font_driver): Add missing initializers.
12681
dee091a3
JD
126822011-03-23 Julien Danjou <julien@danjou.info>
12683
12684 * term.c (Fsuspend_tty, Fresume_tty):
12685 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12686 * window.c (temp_output_buffer_show):
12687 * insdel.c (signal_before_change):
12688 * frame.c (Fhandle_switch_frame):
12689 * fileio.c (Fdo_auto_save):
12690 * emacs.c (Fkill_emacs):
12691 * editfns.c (save_excursion_restore):
12692 * cmds.c (internal_self_insert):
12693 * callint.c (Fcall_interactively):
12694 * buffer.c (Fkill_all_local_variables):
12695 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12696 Use Frun_hooks.
0f4a96b5 12697 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 12698 unconditionally since it does the check itself.
dee091a3 12699
2c520ab5 127002011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 12701
c9c49752
PE
12702 Fix more problems found by GCC 4.5.2's static checks.
12703
8abc3f12
PE
12704 * coding.c (encode_coding_raw_text): Avoid unnecessary test
12705 the first time through the loop, since we know p0 < p1 then.
12706 This also avoids a gcc -Wstrict-overflow warning.
12707
a2d26660
PE
12708 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12709 leading to a memory leak, possible in functions like
12710 load_charset_map_from_file that can allocate an unbounded number
b12ef411 12711 of objects (Bug#8318).
a2d26660 12712
916c72e9
PE
12713 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12714 that could (at least in theory) be that large.
12715
19ab8a18
PE
12716 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12717 This is less likely to overflow, and avoids undefined behavior if
12718 overflow does occur. All callers changed. Use strtoul to scan
12719 for the unsigned long integer.
b7cbbd6f
PE
12720 (pint2hrstr): Simplify and tune code slightly.
12721 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 12722
f0641eff
PE
12723 * scroll.c (do_scrolling): Work around GCC bug 48228.
12724 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12725
7f650bb9
PE
12726 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12727 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
12728 (validate_x_resource_name): Simplify count usage.
12729 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 12730
37dd57d1
PE
12731 * fileio.c (Fcopy_file): Report error if fchown or fchmod
12732 fail (Bug#8306).
81e56e61 12733
699979fc 12734 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 12735
401bf9b4
PE
12736 * process.c (Fmake_network_process): Use socklen_t, not int,
12737 where POSIX says socklen_t is required in portable programs.
12738 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 12739 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
12740 (Fmake_network_process, server_accept_connection):
12741 (wait_reading_process_output, read_process_output):
12742 Likewise.
12743
b93aacde
PE
12744 * process.c: Rename or move locals to avoid shadowing.
12745 (list_processes_1, Fmake_network_process):
12746 (read_process_output_error_handler, exec_sentinel_error_handler):
12747 Rename or move locals.
4dc343ee 12748 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 12749 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 12750 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 12751 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 12752 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 12753
af8a867c 12754 Make tparam.h and terminfo.c consistent.
44f230aa
SM
12755 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12756 Include tparam.h instead, since it declares them.
af8a867c
PE
12757 * cm.h (PC): Remove extern decl; tparam.h now does this.
12758 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12759 * terminfo.c: Include tparam.h, to check interfaces.
12760 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
12761 (tparam): Adjust signature to match interface in tparam.h;
12762 this removes some undefined behavior. Check that outstring and len
12763 are zero, which they always are with Emacs.
12764 * tparam.h (PC, BC, UP): New extern decls.
12765
0248044d 12766 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 12767 (xftfont_open): Rename locals to avoid shadowing.
0248044d 12768
8ff096c1 12769 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
12770 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12771 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 12772 (ftfont_list): Remove unused local.
49eaafba
PE
12773 (get_adstyle_property, ftfont_pattern_entity):
12774 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12775 Rename locals to avoid shadowing.
8ff096c1 12776
e2be39f6
PE
12777 * xfont.c (xfont_list_family): Mark var as initialized.
12778
c9735e30
PE
12779 * xml.c (make_dom): Now static.
12780
8f5201ae
PE
12781 * composite.c (composition_compute_stop_pos): Rename local to
12782 avoid shadowing.
b246f932
PE
12783 (composition_reseat_it): Remove unused locals.
12784 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 12785 (composition_update_it): Mark var as initialized.
11b61122
PE
12786 (find_automatic_composition): Mark vars as initialized,
12787 with a FIXME (Bug#8290).
8f5201ae 12788
760fbc2c
PE
12789 character.h: Rename locals to avoid shadowing.
12790 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12791 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12792 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12793 (BUF_DEC_POS): Be more systematic about renaming local temporaries
12794 to avoid shadowing.
12795
ff08eb85
PE
12796 * textprop.c (property_change_between_p): Remove; unused.
12797
fc7bf025
PE
12798 * intervals.c (interval_start_pos): Now static.
12799
235d7abc
PE
12800 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12801
44f230aa
SM
12802 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12803 Rename locals to avoid shadowing.
3e7d6594 12804
50060332
PE
12805 * sound.c (wav_play, au_play, Fplay_sound_internal):
12806 Fix pointer signedness.
d01f234b 12807 (alsa_choose_format): Remove unused local var.
c83b8872
PE
12808 (wav_play): Initialize a variable to 0, to prevent undefined
12809 behavior (Bug#8278).
50060332 12810
c4fc4e30
PE
12811 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12812
918436ed
PE
12813 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12814
c939f91b
PE
12815 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12816 clobbering (Bug#8298).
b9c7f648
PE
12817 * sysdep.c (sys_subshell): Likewise.
12818 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 12819
6bd8c144
PE
12820 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12821 This should get cleaned up, so that child_setup has the
12822 same signature on all platforms.
12823
7710357c 12824 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 12825 (relocate_fd): Rename locals to avoid shadowing.
7710357c 12826
c59da222
CY
128272011-03-22 Chong Yidong <cyd@stupidchicken.com>
12828
12829 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
12830 not to be necessary, and produces flickering.
12831
66b87493
GM
128322011-03-20 Glenn Morris <rgm@gnu.org>
12833
12834 * config.in: Remove file.
12835
45b6f6d5
JB
128362011-03-20 Juanma Barranquero <lekktu@gmail.com>
12837
12838 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12839 are now in src/globals.h.
12840 (syms_of_minibuf): Remove spurious & from previous change.
12841
cd394be1 128422011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
12843
12844 * minibuf.c (completing-read-function): New variable.
12845 (completing-read-default): Rename from completing-read.
12846 (completing-read): Call completing-read-function.
12847
b14e3e21
CY
128482011-03-19 Juanma Barranquero <lekktu@gmail.com>
12849
12850 * xfaces.c (Fx_load_color_file):
12851 Read color file from absolute filename (bug#8250).
12852
f2b726e6
JB
128532011-03-19 Juanma Barranquero <lekktu@gmail.com>
12854
12855 * makefile.w32-in: Update dependencies.
12856
09f6ff02
EZ
128572011-03-17 Eli Zaretskii <eliz@gnu.org>
12858
12859 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12860
29a6015a
PE
128612011-03-17 Paul Eggert <eggert@cs.ucla.edu>
12862
a3a6c54e
PE
12863 Fix more problems found by GCC 4.5.2's static checks.
12864
b766f867
PE
12865 * process.c (make_serial_process_unwind, send_process_trap):
12866 (sigchld_handler): Now static.
12867
be02381c
PE
12868 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12869 That way, the code declares only the vars that it needs.
12870 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12871 * s/cygwin.h (PTY_ITERATION): Likewise.
12872 * s/darwin.h (PTY_ITERATION): Likewise.
12873 * s/gnu-linux.h (PTY_ITERATION): Likewise.
12874
57048744
PE
12875 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12876 * process.c (allocate_pty): Don't declare stb unless it's needed.
12877
7914961c 12878 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
12879 (CONSTANTLIM): Remove; unused.
12880 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12881 Define only if needed.
7914961c 12882
b3967b18
PE
12883 * unexelf.c (unexec): Name an expression,
12884 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
12885 Use a different way to cause a compilation error if anyone uses
12886 n rather than nn, a way that does not involve shadowing.
73366a00 12887 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 12888
29a6015a
PE
12889 * deps.mk (unexalpha.o): Remove; unused.
12890
43cfc33e 12891 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 12892 * unexec.h: New file.
ce701a33
PE
12893 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
12894 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
12895 Depend on unexec.h.
12896 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
12897 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
12898 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 12899 Change as necessary to match prototype in unexec.h.
ce701a33 12900
01f44d5a
PE
12901 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
12902 shadowing.
4f63c6bb 12903 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 12904
a6670b0b
PE
12905 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
12906 Rename locals to avoid shadowing.
12907
cef2010d 12908 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 12909 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 12910
d4d7173a
PE
12911 * print.c (Fredirect_debugging_output): Fix pointer signedess.
12912
f08b802a
PE
12913 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
12914 warning when compiling print.c.
12915
3ddb0639
PE
12916 * font.c (font_unparse_fcname): Abort in an "impossible" situation
12917 instead of using an uninitialized var.
5ad03b97 12918 (font_sort_entities): Mark var as initialized.
3ddb0639 12919
170a2692
PE
12920 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
12921
e663c700
PE
12922 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
12923 pointers to constants.
89bc529a 12924 (font_parse_fcname): Remove unused vars.
7b81e2d0 12925 (font_delete_unmatched): Now static.
ea838e10 12926 (font_get_spec): Remove; unused.
13a547c6
PE
12927 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
12928 (font_update_drivers, Ffont_get_glyphs, font_add_log):
12929 Rename or move locals to avoid shadowing.
e663c700 12930
2a80c887 12931 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 12932 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 12933
1384fa33 12934 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 12935 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 12936
8b2c52e9
PE
12937 * alloc.c (mark_backtrace): Move decl from here ...
12938 * lisp.h: ... to here, so that it can be checked.
12939
475545b5 12940 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 12941 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
12942 (lisp_indirect_variable): Name an expression,
12943 to avoid gcc -Wbad-function-cast warning.
1faed8ae 12944 (Fdefvar): Rename locals to avoid shadowing.
475545b5 12945
b1349114 12946 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 12947 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 12948 Use const pointer when appropriate.
b1349114 12949
a2928364
PE
12950 * lisp.h (get_system_name, get_operating_system_release):
12951 Move decls here, to check interfaces.
12952 * process.c (get_operating_system_release): Move decl to lisp.h.
12953 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
12954 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
12955 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
12956 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
12957 (Fformat_time_string, Fencode_time, Finsert_char):
12958 (Ftranslate_region_internal, Fformat):
12959 Rename or remove local vars to avoid shadowing.
9710023e 12960 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 12961
a415e694
PE
12962 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
12963 avoid shadowing.
12964
8ef4622d
PE
12965 * lisp.h (eassert): Check that the argument compiles, even if
12966 ENABLE_CHECKING is not defined.
12967
946f9a5b
PE
12968 * data.c (Findirect_variable): Name an expression, to avoid
12969 gcc -Wbad-function-cast warning.
112396d6 12970 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 12971 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
12972 (Fmake_variable_buffer_local, Fmake_local_variable):
12973 Mark variables as initialized.
52746918 12974 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 12975
e5aab7e7 12976 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
12977 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
12978 Rename locals to avoid shadowing.
dff45157
PE
12979 (mark_stack): Move local variables into the #ifdef region where
12980 they're used.
7bc26fdb
PE
12981 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
12982 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
12983 needed otherwise.
12984 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
12985 (GC_STRING_CHARS): Remove; not used.
d40d4be1 12986 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 12987
e5aab7e7
PE
12988 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
12989 avoids undefined behavior in theory.
12990
4da60324
PE
12991 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
12992
88043301
PE
12993 Use functions, not macros, for up- and down-casing (Bug#8254).
12994 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12995 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
12996 to use the following functions instead of these macros.
12997 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
12998 EMACS_INT, since callers assume the returned value fits in int.
12999 (upcase1): Likewise, for UPCASE_TABLE.
13000 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13001 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13002 the race-condition problem in the old DOWNCASE.
88043301 13003
19ed5445
PE
13004 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13005 Rename locals to avoid shadowing.
13006 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13007 (regex_compile, re_search_2, re_match_2_internal):
13008 Remove unused local vars.
952db0d7
PE
13009 (FREE_VAR): Rewrite so as not to use empty "else",
13010 which gcc can warn about.
da053e48 13011 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13012 (RETALLOC_IF): Define only if needed.
13013 (WORDCHAR_P): Likewise. This one is never needed, but is used
13014 only in a comment talking about a compiler bug, so put inside
13015 the #if 0 of that comment.
13016 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13017 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13018 Remove; unused.
19ed5445 13019
1f3561e4 13020 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13021 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13022 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13023
ded6f8f7
PE
13024 * search.c (simple_search): Remove unused var.
13025
dbd37a95
PE
13026 * dired.c (compile_pattern): Move decl from here ...
13027 * lisp.h: ... to here, so that it can be checked.
13028 (struct re_registers): New forward decl.
13029
7e47afad
PE
13030 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13031
85f24f61
PE
13032 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13033 All uses changed.
13034 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13035 Rename locals to avoid shadowing.
5671df8f 13036 (Fvertical_motion): Mark locals as initialized.
85f24f61 13037
181aa2be 13038 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13039 (casify_region): Mark local as initialized.
181aa2be 13040
930d429c
PE
13041 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13042
7082eac6
PE
13043 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13044 New macros, so that the caller can use some names other than
13045 gcpro1, gcpro2, etc.
13046 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13047 of the new macros.
13048 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13049 argument, for consistency with GCPRO2_VAR, etc: it is now the
13050 prefix of the variable, not the variable itself. All uses
13051 changed.
38b2c076
PE
13052 * dired.c (directory_files_internal, file_name_completion):
13053 Rename locals to avoid shadowing.
13054
15206ed9
PE
13055 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13056 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13057 dired.c's scmp function, had undefined behavior.
13058 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13059 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13060 * buffer.h: ... to here, because these macros use current_buffer,
13061 and the new implementation with inline functions needs to have
13062 current_buffer in scope now, rather than later when the macros
13063 are used.
13064 (downcase, upcase1): New static inline functions.
13065 (DOWNCASE, UPCASE1): Reimplement using these functions.
13066 This avoids undefined behavior in expressions like
13067 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13068 from race conditions in accessing the global variables
13069 case_temp1 and case_temp2.
13070 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13071 * lisp.h (case_temp1, case_temp2): Remove their decls.
13072 * character.h (ASCII_CHAR_P): Move from here ...
13073 * lisp.h: ... to here, so that the inline functions mentioned
13074 above can use them.
13075
4a6bea26
PE
13076 * dired.c (directory_files_internal_unwind): Now static.
13077
f14b7e14
PE
13078 * fileio.c (file_name_as_directory, directory_file_name):
13079 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13080 Now static.
2893f146
PE
13081 (file_name_as_directory): Use const pointers when appropriate.
13082 (Fexpand_file_name): Likewise. In particular, newdir might
13083 point at constant storage, so make it a const pointer.
fd4ead52 13084 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13085 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13086 signedness issues.
f839df0c
PE
13087 (Fset_file_times, Finsert_file_contents, auto_save_error):
13088 Rename locals to avoid shadowing.
f14b7e14 13089
5716756e 13090 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13091 (Ftry_completion, Fall_completions): Rename or remove locals
13092 to avoid shadowing.
5716756e 13093
b4c3046a
PE
13094 * marker.c (bytepos_to_charpos): Remove; unused.
13095
b45db522
PE
13096 * lisp.h (verify_bytepos, count_markers): New decls,
13097 so that gcc does not warn that these functions aren't declared.
13098
85876d07
PE
13099 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13100 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13101 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13102 (copy_text): Remove unused local var.
85876d07 13103
03d78a21 13104 * filelock.c (within_one_second): Now static.
b3dd38ab 13105 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13106
5df8f01b
PE
13107 * buffer.c (fix_overlays_before): Mark locals as initialized.
13108 (fix_start_end_in_overlays): Likewise. This function should be
13109 simplified by using pointers-to-pointers, but that's a different
13110 matter.
b1d876f1 13111 (switch_to_buffer_1): Now static.
8f54f30a
PE
13112 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13113 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13114
a70072c9 13115 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13116 Fix pointer signedness issue.
edced198
PE
13117 (sys_subshell): Mark local as volatile if checking for lint,
13118 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13119 (MAXPATHLEN): Define only if needed.
a70072c9 13120
a0977c44
PE
13121 * process.c (serial_open, serial_configure): Move decls from here ...
13122 * systty.h: ... to here, so that they can be checked.
13123
a884fdcc
PE
13124 * fns.c (get_random, seed_random): Move extern decls from here ...
13125 * lisp.h: ... to here, so that they can be checked.
13126
604efe86 13127 * sysdep.c (reset_io): Now static.
b8950c94 13128 (wait_for_termination_signal): Remove; unused.
604efe86 13129
38fc62d9
PE
13130 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13131 (copy_keymap_item, append_key, push_text_char_description):
13132 Now static.
1004a21a 13133 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13134 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13135 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13136 (describe_map_tree):
13137 Rename locals to avoid shadowing.
38fc62d9 13138
2f2650da
PE
13139 * keyboard.c: Declare functions static if they are not used elsewhere.
13140 (echo_char, echo_dash, cmd_error, top_level_2):
13141 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13142 (read_char, kbd_buffer_get_event, make_lispy_position):
13143 (make_lispy_event, make_lispy_movement, apply_modifiers):
13144 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13145 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13146 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13147 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13148 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13149
a053e86c 13150 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13151 (mark_kboards): Move decl here ...
13152 * alloc.c (mark_kboards): ... from here.
a053e86c 13153
4752793e
PE
13154 * lisp.h (force_auto_save_soon): New decl.
13155
74f10ca7 13156 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13157 (DEFINE_DUMMY_FUNCTION): New macro.
13158 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13159 Use it.
c03cd23f
PE
13160 (main): Add casts to avoid warnings
13161 if GCC considers string literals to be constants.
74f10ca7 13162
022e70d4
PE
13163 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13164
59d6fe83
PE
13165 * dbusbind.c: Pointer signedness fixes.
13166 (xd_signature, xd_append_arg, xd_initialize):
13167 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13168 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13169 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13170 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13171
78320123
PE
13172 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13173 if GCC considers string literals to be constants.
49cebcca 13174 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13175
35ac2a97
SM
131762011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13177
fb103ca9
SM
13178 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13179 (print_preprocess, print_object): New macro to fix last change.
13180
35ac2a97
SM
13181 * print.c (print_preprocess): Don't forget font objects.
13182
62973b41
JB
131832011-03-16 Juanma Barranquero <lekktu@gmail.com>
13184
13185 * emacs.c (USAGE3): Doc fixes.
13186
0e48bb22
AS
131872011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13188
13189 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13190 structure.
13191
7684e57b
JB
131922011-03-14 Juanma Barranquero <lekktu@gmail.com>
13193
13194 * lisp.h (VWindow_system, Qfile_name_history):
13195 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13196 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13197 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13198
13199 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13200 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13201
13202 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13203 * w32console.c (detect_input_pending, read_input_pending)
13204 (encode_terminal_code):
13205 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13206 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13207 (w32_system_caret_y, Qfile_name_history):
13208 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13209 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13210 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13211 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13212 * w32proc.c (Qlocal, report_file_error):
13213 * w32term.c (Vwindow_system, updating_frame):
13214 * w32uniscribe.c (initialized, uniscribe_font_driver):
13215 Remove unneeded extern declarations.
13216
2aa46d6c
CY
132172011-03-14 Chong Yidong <cyd@stupidchicken.com>
13218
c96bbc66 13219 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13220
cffc6f3b
CY
132212011-03-13 Chong Yidong <cyd@stupidchicken.com>
13222
13223 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13224 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13225 These macros can no longer be used for assignment.
13226
44f230aa
SM
13227 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13228 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13229 (record_buffer_markers, fetch_buffer_markers): New functions for
13230 recording and fetching special buffer markers.
13231 (set_buffer_internal_1, set_buffer_temp): Use them.
13232
13233 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13234
13235 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13236
13237 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13238 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13239
13240 * xdisp.c (hscroll_window_tree):
13241 (reconsider_clip_changes): Use PT instead of BUF_PT.
13242
d251f04b
EZ
132432011-03-13 Eli Zaretskii <eliz@gnu.org>
13244
13245 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13246 $(EMACS_ROOT)/lib/intprops.h.
13247
f0c77cd1
PE
132482011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13249
3eca4629
PE
13250 Fix more problems found by GCC 4.5.2's static checks.
13251
7c86ee98
PE
13252 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13253 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13254 (xg_free_frame_widgets): Make it clear that a local variable is
13255 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13256 (gdk_window_get_screen): Make it clear that this macro is needed
13257 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13258 (int_gtk_range_get_value): New function, which avoids a diagnostic
13259 from gcc -Wbad-function-cast.
13260 (xg_set_toolkit_scroll_bar_thumb): Use it.
13261 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13262 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13263 (get_utf8_string, xg_get_file_with_chooser):
13264 Rename locals to avoid shadowing.
13265 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13266
41729b81
PE
13267 * xgselect.c (xg_select): Remove unused var.
13268
f0c77cd1
PE
13269 * image.c (four_corners_best): Mark locals as initialized.
13270 (gif_load): Initialize transparent_p to zero (Bug#8238).
13271 Mark another local as initialized.
ec6cf4c6 13272 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13273
ce0ad53d 13274 * image.c (clear_image_cache): Now static.
d5d5a617 13275 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13276 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13277 (x_edge_detection): Remove unnecessary cast that
13278 gcc -Wbad-function-cast diagnoses.
2037898d 13279 (gif_load): Fix pointer signedness.
6ae141d6
PE
13280 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13281 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13282
33383987 132832011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13284
d32df629
PE
13285 Improve quality of tests for time stamp overflow.
13286 For example, without this patch (encode-time 0 0 0 1 1
13287 1152921504606846976) returns the obviously-bogus value (-948597
13288 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13289 reports time overflow. See
13290 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13291 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13292 * editfns.c: Include limits.h and intprops.h.
13293 (TIME_T_MIN, TIME_T_MAX): New macros.
13294 (time_overflow): Move earlier, to before first use.
13295 (hi_time, lo_time): New functions, for an accurate test for
13296 out-of-range times.
13297 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13298 (Fget_internal_run_time): Don't assume time_t fits in int.
13299 (make_time): Use list2 instead of Fcons twice.
13300 (Fdecode_time): More accurate test for out-of-range times.
13301 (check_tm_member): New function.
13302 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13303 (lisp_time_argument): Don't rely on undefined left-shift and
13304 right-shift behavior when checking for time stamp overflow.
8be6f318 13305
fe31d94c
PE
13306 * editfns.c (time_overflow): New function, refactoring common code.
13307 (Fformat_time_string, Fdecode_time, Fencode_time):
13308 (Fcurrent_time_string): Use it.
13309
8be6f318
PE
13310 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13311 * dired.c (make_time): Move to ...
13312 * editfns.c (make_time): ... here.
13313 * systime.h: Note the move.
13314
09d9db2c 133152011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13316
126bc0dc
YM
13317 * fringe.c (update_window_fringes): Remove unused variables.
13318
c47cbdfd
YM
13319 * unexmacosx.c (copy_data_segment): Also copy __got section.
13320 (Bug#8223)
13321
7ac80be9
EZ
133222011-03-12 Eli Zaretskii <eliz@gnu.org>
13323
c96bbc66 13324 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13325 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13326 Constify `char *' arguments and their references according to
13327 prototypes in tparam.h.
13328
ecb0f94d 13329 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13330
7ac80be9
EZ
13331 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13332 Adapt all references accordingly.
13333
13334 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13335
ef1fd07e
TT
133362011-03-11 Tom Tromey <tromey@redhat.com>
13337
13338 * buffer.c (syms_of_buffer): Remove obsolete comment.
13339
7ef4b50c
EZ
133402011-03-11 Eli Zaretskii <eliz@gnu.org>
13341
13342 * termhooks.h (encode_terminal_code): Declare prototype.
13343
13344 * msdos.c (encode_terminal_code): Don't declare prototype.
13345
13346 * term.c (encode_terminal_code): Now external again, used by
13347 w32console.c and msdos.c.
13348
44f230aa
SM
13349 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13350 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13351
4b1ec863 133522011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13353
1714f52b 13354 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13355
4b1ec863
PE
13356 * fringe.c (update_window_fringes): Mark locals as initialized
13357 (Bug#8227).
13358 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13359
524c7aa6
PE
13360 * alloc.c (mark_fringe_data): Move decl from here ...
13361 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13362 to check its interface.
13363 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13364
a5c0af81 13365 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13366 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13367 (fontset_font): Mark local as initialized.
a9a06e0b 13368 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13369
b4716021
PE
13370 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13371
811e9bac 13372 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13373 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13374 (x_own_selection, Fx_disown_selection_internal): Rename locals
13375 to avoid shadowing.
13376 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13377
7e3ab302
PE
13378 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13379 so that the caller can use some name other than gcpro1.
13380 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13381 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13382 (Fx_backspace_delete_keys_p):
13383 Use them to avoid shadowing, and rename vars to avoid shadowing.
13384 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13385 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13386 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13387 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13388 Remove unused locals.
7e3ab302
PE
13389 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13390 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13391 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13392 macros.
f78faa98 13393
e2b13473
PE
13394 * xterm.h (x_mouse_leave): New decl.
13395
77f23912
PE
13396 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13397 Remove unused functions.
cdf4ba58
PE
13398 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13399 (x_calc_absolute_position): Now static.
7411c686 13400 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13401 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13402 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13403 unless they are used.
38d0b34a
PE
13404 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13405 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13406 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13407 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13408 (x_error_catcher, x_connection_closed, x_error_handler):
13409 (x_error_quitter, xembed_send_message, x_iconify_frame):
13410 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13411 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13412 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13413
44f230aa
SM
13414 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13415 Rename or move locals to avoid shadowing.
6b463e58 13416 (tty_defined_color, merge_face_heights): Now static.
5967d051 13417 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13418 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13419 does not deduce is never used uninitialized.
73719eba
PE
13420 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13421 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13422
426994c3 13423 * terminal.c (store_terminal_param): Now static.
5489860b 13424
032f1620 13425 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13426 (set_frame_menubar): Remove unused local.
d4323972 13427 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13428 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13429 since they might point to immutable storage.
281585b0
PE
13430 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13431 since it's unused otherwise.
032f1620 13432
367c19e5 13433 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13434 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13435 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13436 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13437 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13438 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13439 does not deduce are never used uninitialized.
70739cbe 13440
07b48fa9
PE
13441 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13442
8868a238 13443 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13444 * window.c (window_loop, size_window):
13445 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13446
7e5cf297 13447 * window.c (display_buffer): Now static.
d6550a9f
PE
13448 (size_window): Mark variables that gcc -Wuninitialized
13449 does not deduce are never used uninitialized.
a586633d
PE
13450 * window.h (check_all_windows): New decl, to forestall
13451 gcc -Wmissing-prototypes diagnostic.
5b555da1 13452 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13453
f6095868
PE
13454 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13455 shadowing.
13456 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13457 Include <limits.h>.
13458 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13459 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13460 (load_charset_map): Mark variables that gcc -Wuninitialized
13461 does not deduce are never used uninitialized.
53df7c11 13462 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13463
f38b440c
PE
13464 * coding.c (coding_set_source, coding_set_destination):
13465 Use "else { /* comment */ }" rather than "else /* comment */;"
13466 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13467 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13468 a block, when the outer 'i' will do.
13469 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13470 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13471 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13472 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13473 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13474 Rename locals to avoid shadowing.
13475 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13476 * coding.c (emacs_mule_char, encode_invocation_designation):
13477 Now static, since they're not used elsewhere.
413bb2db 13478 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13479 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13480 (decode_coding_emacs_mule): Mark variables that gcc
13481 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13482 (detect_coding_iso_2022): Initialize a local variable that might
13483 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13484 this initialization is needed. (Bug#8211)
5f58e762
PE
13485 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13486 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13487 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13488 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13489 Remove unused macros.
f38b440c 13490
232b38b9 13491 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13492 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13493 * character.c (string_count_byte8): Likewise.
232b38b9 13494
fb90da1b
PE
13495 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13496 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13497
fb93dbc2
PE
13498 * chartab.c (copy_sub_char_table): Now static, since it's not used
13499 elsewhere.
5c156ace
PE
13500 (sub_char_table_ref_and_range, char_table_ref_and_range):
13501 Rename locals to avoid shadowing.
bbcd0949 13502 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13503
7d3b3862 13504 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13505 (BIDI_BOB): Remove unused macro.
7d3b3862 13506
6be7d3da
PE
13507 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13508 deduce are never used uninitialized.
c2ed9c8b 13509 * term.c (encode_terminal_code): Likewise.
6be7d3da 13510
75f8807f 13511 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13512
50938595
PE
13513 * tparam.h: New file.
13514 * term.c, tparam.h: Include it.
13515 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13516 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13517 Move these decls to tparam.h, and make them agree with what
13518 is actually in tparam.c. The previous trick of using incompatible
13519 decls in different modules does not conform to the C standard.
13520 All callers of tparam changed to use tparam's actual API.
13521 * tparam.c (tparam1, tparam, tgoto):
13522 Use const pointers where appropriate.
13523
fbceeba2
PE
13524 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13525 * cm.h (struct cm): Likewise.
13526 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13527 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13528 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13529 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13530 (turn_on_face, init_tty): Likewise.
13531 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13532
7f3f1250
PE
13533 * term.c (term_mouse_position): Rename local to avoid shadowing.
13534
e6ca6543
PE
13535 * alloc.c (mark_ttys): Move decl from here ...
13536 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13537
c40f8d15
AS
135382011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13539
13540 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13541
cfe0661d
JB
135422011-03-09 Juanma Barranquero <lekktu@gmail.com>
13543
13544 * search.c (compile_pattern_1): Remove argument regp, unused since
13545 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13546 (compile_pattern): Don't pass it.
13547
0afb4571
J
135482011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13549
13550 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13551 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13552 for ! HAVE_GTK3.
13553 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13554
13555 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13556
13557 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13558 gdk_window_get_screen, gdk_window_get_geometry,
13559 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13560 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13561 (xg_get_pixbuf_from_pixmap): New function.
13562 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13563 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13564 Call xg_get_pixbuf_from_pixmap instead of
13565 gdk_pixbuf_get_from_drawable.
13566 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13567 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13568 (xg_check_special_colors): Use GtkStyleContext and its functions
13569 for HAVE_GTK3.
13570 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13571 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13572 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13573 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13574 Call gtk_widget_get_preferred_size.
0afb4571
J
13575 (xg_frame_resized): gdk_window_get_geometry only takes 5
13576 parameters.
44f230aa
SM
13577 (xg_win_to_widget, xg_event_is_for_menubar):
13578 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13579 (xg_set_widget_bg): New function.
13580 (delete_cb): New function.
895009e1 13581 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13582 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13583 (xg_set_background_color): Call xg_set_widget_bg.
13584 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13585 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13586 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13587 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13588 if ! HAVE_GTK3.
13589 (update_frame_tool_bar): Call gtk_widget_hide.
13590 (xg_initialize): Use GDK_KEY_g.
13591
13592 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13593 if ! HAVE_GTK3
13594 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13595
13596 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13597 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13598 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13599
1c2cc4ef
JB
136002011-03-08 Juanma Barranquero <lekktu@gmail.com>
13601
13602 * w32xfns.c (select_palette): Check success of RealizePalette against
13603 GDI_ERROR, not zero.
13604
33383987 13605See ChangeLog.11 for earlier changes.
aac0c6e3
MR
13606
13607;; Local Variables:
13608;; coding: utf-8
aac0c6e3
MR
13609;; End:
13610
2f097256 13611 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
13612
13613 This file is part of GNU Emacs.
13614
13615 GNU Emacs is free software: you can redistribute it and/or modify
13616 it under the terms of the GNU General Public License as published by
13617 the Free Software Foundation, either version 3 of the License, or
13618 (at your option) any later version.
13619
13620 GNU Emacs is distributed in the hope that it will be useful,
13621 but WITHOUT ANY WARRANTY; without even the implied warranty of
13622 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13623 GNU General Public License for more details.
13624
13625 You should have received a copy of the GNU General Public License
13626 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.