* lisp/mouse.el (popup-menu-normalize-position): New function.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
42b3a444
DA
12012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Use common inline syntax in intervals.h.
4 * intervals.h (INTERVALS_INLINE): New macro.
5 Change all users from LISP_INLINE.
6
9fb0c957
DA
72012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8
9 Define Qnone once for all platforms.
10 * frame.c (Qnone): Define here.
11 (syms_of_frame): DEFSYM it.
12 * lisp.h (Qnone): New declaration.
13 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
14 * xfns.c: Remove duplication. Adjust users.
15
65e8ee52
DA
162012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
17
18 Remove unused macros from intervals.h.
19 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
20 * intervals.c: Adjust comment.
21
9b855fd6
EZ
222012-08-10 Eli Zaretskii <eliz@gnu.org>
23
24 * w32fns.c <w32_unicode_gui>: New static variable.
25 (globals_of_w32fns): Initialize it according to os_subtype.
26 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
27 testing os_subtype.
28
39cb9e56 292012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
30 Eli Zaretskii <eliz@gnu.org>
31
32 Fix bug #10299 with Unicode characters sent by customized
33 keyboards created by MSKLC.
34 * w32fns.c (INIT_WINDOW_CLASS): New macro.
35 (w32_init_class): Use it to initialize the Emacs class with either
36 ANSI or Unicode API calls.
37 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
38 later.
39 (w32_wnd_proc): If the character code sent by WM_CHAR or
40 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
41 original message. Call DefWindowProcW on NT and later.
42
9374581a
GM
432012-08-10 Glenn Morris <rgm@gnu.org>
44
4b94e8cf
GM
45 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
46
9374581a
GM
47 * lisp.h (DIRECTORY_SEP): Let configure set it.
48
a2752828
DA
492012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
50
51 Use TSET for write access to Lisp_Object slots of struct terminal.
52 * termhooks.h (TSET): New macro.
53 * coding.c, terminal.c, xselect.c: Adjust users.
54
cc92c454
SM
552012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
56
57 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
58 the failing expression, include them in the error message.
59 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
60 * lisp.h (internal_condition_case_n): Update declaration.
61
4cb3e6b3
DA
622012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
63
64 Inline functions to examine and change buffer overlays.
65 * buffer.c (unchain_both): New function.
66 * buffer.h (buffer_get_overlays, buffer_set_overlays):
67 (buffer_has_overlays): New function.
68 (enum overlay_type): New enum.
69 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
70 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
71
8707c1e5
DA
722012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
73
74 Inline functions to examine and change buffer intervals.
75 * alloc.c (mark_interval_tree): Remove.
76 (MARK_INTERVAL_TREE): Simplify.
77 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
78 * intervals.c (buffer_balance_intervals): New function.
79 (graft_intervals_into_buffer): Adjust indentation.
80 (set_intervals_multibyte): Simplify.
81 * buffer.h (BUF_INTERVALS): Remove.
82 (buffer_get_intervals, buffer_set_intervals): New function.
83 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
84 * intervals.c, textprop.c: Adjust users.
85
ad8c997f
DA
862012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
87
88 Inline functions to examine and change string intervals.
89 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
90 (string_get_intervals, string_set_intervals): New function.
91 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
92 * lread.c, print.c, textprop.c: Adjust users.
93
32ac3a6b
GM
942012-08-08 Glenn Morris <rgm@gnu.org>
95
96 * lisp.mk (lisp): Remove language/persian.elc.
97
77c7bcb1
DA
982012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
99
100 Cleanup intervals.
101 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
102 (NULL_INTERVAL_P): Likewise. Adjust users.
103 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust
104 comment. Move under #if 0.
105 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
106 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
107
9c08a8d4
DA
1082012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
109
110 Check total length of intervals with eassert.
111 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
112 * intervals.c: Change all users to eassert.
113
26d16b35
EZ
1142012-08-07 Eli Zaretskii <eliz@gnu.org>
115
116 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist): Rename
117 fields to match removal of FGET and WGET and disuse of
118 INTERNAL_FIELD in Lisp_Cons.
119
c644523b
DA
1202012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
121
122 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
123 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
124 name since all xname users are fixed long time ago. Do not
125 use INTERNAL_FIELD.
126 (set_symbol_name, set_symbol_function, set_symbol_plist):
127 (set_symbol_next, set_overlay_plist): New function.
128 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
129 (struct Lisp_Overlay): Likewise.
130 (CVAR, MVAR, SVAR): Remove.
131 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
132 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
133 * xterm.c: Adjust users.
134 * .gdbinit: Change to use name field of struct Lisp_Symbol
135 where appropriate.
136
6a3d20cc
DA
1372012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
138
139 Basic functions to set Lisp_Object and pointer slots of intervals.
140 * intervals.h (interval_set_parent, interval_set_object):
141 (interval_set_left, interval_set_right, interval_set_plist):
142 (interval_copy_parent): New function.
143 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
144 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE): Adjust
145 indentation.
146 (INTERVAL_SIZE): Remove. Adjust users.
147 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
148
4d2b044c
DA
1492012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
150
151 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
152 * process.h (PGET): Remove.
153 (struct Lisp_Process): Do not use INTERNAL_FIELD.
154 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
155
d3d50620
DA
1562012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
157
158 Drop WGET and revert read access to Lisp_Objects slots of struct window.
159 * window.h (WGET): Remove.
160 (struct window): Do not use INTERNAL_FIELD.
161 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
162 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
163 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
164 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
165 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
166 Adjust users.
167
d10a51dc
CY
1682012-08-07 Chong Yidong <cyd@gnu.org>
169
170 * window.c (Fwindow_edges, Fwindow_pixel_edges)
171 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
172 (Fdelete_window_internal): Signal an error if the window is not on
173 a live frame (Bug#12025).
174
e69b0960
DA
1752012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
176
177 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
178 * frame.h (FGET): Remove.
179 (struct frame): Do not use INTERNAL_FIELD.
180 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
181 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
182 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
183 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
184
25a20a3a
JB
1852012-08-06 Juanma Barranquero <lekktu@gmail.com>
186
187 * w32.c: Silence compiler warnings.
188 (map_w32_filename): Remove unused variable `is_fat'.
189 (chase_symlinks): Add parentheses around expression.
190
1c6f11f4
GM
1912012-08-06 Glenn Morris <rgm@gnu.org>
192
1db4583a
GM
193 * sysdep.c: Respect BROKEN_GETWD.
194
1c6f11f4
GM
195 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
196 Let configure handle it.
197 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
198
2b90362b
DA
1992012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
200
201 Use GCALIGNMENT where appropriate.
202 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
203 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
204 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
205
5f50daf2
EZ
2062012-08-06 Eli Zaretskii <eliz@gnu.org>
207
208 * w32menu.c (set_frame_menubar, initialize_frame_menubar): Don't
209 use FRAME_MENU_BAR_ITEMS as an lvalue.
210
cbcc7007
SM
2112012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
212
213 * buffer.h (struct buffer): Revert `indirections' to a simple int;
214 that should be sufficient for everyone.
215
4d365fa4
JD
2162012-08-06 Jan Djärv <jan.h.d@swipnet.se>
217
218 * keyboard.c (timer_check_2): Add break so timer_check returns next
219 timeout.
220
dd86bd82
DA
2212012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
222
223 Fix Windows build errors introduced after converting to WGET and WSET.
224 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
225 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
226
054e1668
JD
2272012-08-06 Jan Djärv <jan.h.d@swipnet.se>
228
229 * nsterm.m (ns_frame_rehighlight): Use FSET.
230
231 * nsmenu.m (ns_update_menubar): Use FSET.
232
21238f11
DA
2332012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
234
235 Separate read and write access to Lisp_Object slots of Lisp_Process.
236 * process.h (PGET, PSET): New macros similar to AREF and ASET.
237 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
238
077288cf
DA
2392012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
240
241 Separate read and write access to Lisp_Object slots of struct window.
242 * window.h (WGET, WSET): New macros similar to AREF and ASET.
243 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
244 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
245 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
246 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
247 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
248 Adjust users.
249
71688bd7
DA
2502012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
251
252 Fix Windows build errors introduced after converting to FGET and FSET.
253 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
254 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
255 (w32_judge_scroll_bars): Change to use FSET.
256 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
257
f99bac93
DA
2582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
259
260 Fix replacement typo.
261 * window.c (replace_window): Set root_window instead of
262 selected_window. This fixes a total window subsystem
263 malfunction reported by Bastien Guerry <bzg@gnu.org>.
264
8c2a0f2d
GM
2652012-08-06 Glenn Morris <rgm@gnu.org>
266
267 * lisp.mk (lisp): Add language/persian.elc.
268
edd74c35
DA
2692012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
270
271 Separate read and write access to Lisp_Object slots of struct frame.
272 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
273 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
274 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
275 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
276 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
277
8671676c
AS
2782012-08-05 Andreas Schwab <schwab@linux-m68k.org>
279
280 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
281
663e2b3f
DA
2822012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
283
284 Generalize common compile-time constants.
285 * lisp.h (header_size, bool_header_size, word_size): Now here.
286 (struct Lisp_Vector): Add comment.
287 (struct Lisp_Bool_Vector): Move up to define handy constants.
288 (VECSIZE, PSEUDOVECSIZE): Simplify.
289 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
290 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
291 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
292 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
293 * xfont.c, xmenu.c: Use word_size where appropriate.
294
d32e47af
LM
2952012-08-05 Lawrence Mitchell <wence@gmx.li>
296
297 * search.c (Freplace_match): Treat \? in the replacement text
298 literally (Bug#8161).
299
e5d9c0d1
CY
3002012-08-05 Chong Yidong <cyd@gnu.org>
301
302 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
303 * frame.c (Vdelete_frame_functions):
304 * emacs.c (Vkill_emacs_hook): Doc fix.
305
8da0576b
EZ
3062012-08-04 Eli Zaretskii <eliz@gnu.org>
307
308 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
309 --with-x-toolkit=no builds.
310 Reported by Carsten Mattner <carstenmattner@gmail.com>.
311
02676e5d
CY
3122012-08-04 Chong Yidong <cyd@gnu.org>
313
314 * syntax.c (Fmodify_syntax_entry): Doc fix.
315
97147da9
EZ
3162012-08-04 Eli Zaretskii <eliz@gnu.org>
317
76151e2c
EZ
318 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
319 * w32.c (init_environment): Change the default values of many
320 environment variables in dflt_envvars[] to NULL, to avoid pushing
321 them into environment when they were not already defined. Remove
322 the code that deletes site-lisp subdirectories from the default
323 value of EMACSLOADPATH, as it is no longer needed.
324 (check_windows_init_file): Now external, not static. Use
325 Vload_path as is, without adding anything, as this function is now
326 called when Vload_path is already set up.
327
328 * w32.h (check_windows_init_file): Add prototype.
329
330 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
331 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
332 compatibility with Posix platforms.
333 (main): Move the call to check_windows_init_file to here from
334 w32.c.
335 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
336 any, in the DEFALT argument into the root of the Emacs build or
337 installation tree, as appropriate.
338
339 * callproc.c (init_callproc_1): Call decode_env_path instead of
340 doing its equivalent by hand.
341 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
342 the code that sets Vexec_path run on MS-Windows.
343
344 * lread.c (init_lread): Add comments to #ifdef's.
345
97147da9
EZ
346 * msdos.c (dos_set_window_size, IT_update_begin)
347 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
348 instead of direct references.
349
185ee146
PE
3502012-08-04 Paul Eggert <eggert@cs.ucla.edu>
351
352 Export DEFAULT_REHASH_* to GDB.
353 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
354 Now constants, not macros.
355
8834c57a
PE
3562012-08-03 Paul Eggert <eggert@cs.ucla.edu>
357
98c6f1e3
PE
358 Remove unnecessary casts involving pointers.
359 These casts are no longer needed now that we assume C89 or later,
360 since they involve casting to or from void *.
361 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
362 (make_pure_float, make_pure_vector):
363 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
364 * macros.c (Fstart_kbd_macro):
365 * menu.c (find_and_return_menu_selection):
366 * minibuf.c (read_minibuf_noninteractive):
367 * sysdep.c (closedir):
368 * xdisp.c (x_produce_glyphs):
369 * xfaces.c (compare_fonts_by_sort_order):
370 * xfns.c (x_real_positions, select_visual):
371 * xselect.c (x_stop_queuing_selection_requests)
372 (x_get_window_property, x_get_window_property_as_lisp_data):
373 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
374 Remove unnecessary pointer casts.
375 * alloc.c (record_xmalloc): New function.
376 * lisp.h (record_xmalloc): New decl.
377 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
378 more like a function. This is because the pointer cast is not
379 needed. All uses changed.
380 * print.c (print_string, print_error_message): Avoid length recalc.
381
8834c57a
PE
382 Improve fix for macroexp crash with debugging (Bug#12118).
383 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
384 ARRAY_MARK_FLAG when checking subscripts, because ASET is
385 not supposed to be invoked from the garbage collector.
386 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
387 (gc_aset): New function, which is like ASET but can be
388 used in the garbage collector.
389 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
390 (set_hash_index): Use it instead of ASET.
391
6dad7178
EZ
3922012-08-03 Eli Zaretskii <eliz@gnu.org>
393
394 Support symlinks on latest versions of MS-Windows.
395 * w32.c: Include winioctl.h and aclapi.h.
396 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
397 (revert_to_self): Forward declarations of static functions.
398 <static BOOL g_b_init_get_security_info>:
399 <g_b_init_create_symbolic_link>: New static flags.
400 (globals_of_w32): Initialize them to zero.
401 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
402 (map_w32_filename): Improve commentary. Simplify switch.
403 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
404 headers (most versions of MinGW w32api don't).
405 (get_security_info, create_symbolic_link)
406 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
407 New functions.
408 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
409 in the argument file name.
410 (sys_access): Call unc_volume_file_attributes only if
411 GetFileAttributes fails with network-related error codes.
412 (sys_rename): Diagnose renaming of a symlink when the user doesn't
413 have the required privileges.
414 (get_file_security_desc_by_name): Renamed from
415 get_file_security_desc.
416 (stat_worker): New function, with most of the guts of 'stat', and
417 with addition of handling of symlinks and support for 'lstat'. If
418 possible, get file's attributes and security information by
419 handle, not by name. Produce S_IFLNK bit for symlinks, when
420 called from 'lstat'.
421 (stat, lstat): New functions, call 'stat_worker'.
422 (symlink, readlink, careadlinkat): Rewritten to create and resolve
423 symlinks when the underlying filesystem supports them.
424
f162bcc3
PE
4252012-08-02 Paul Eggert <eggert@cs.ucla.edu>
426
79ea6c20
PE
427 Fix macroexp crash on Windows with debugging (Bug#12118).
428 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
429 checking subscripts; problem introduced with the recent
430 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
431 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
432 since it's used in non-static inline functions now.
433
c0ce93fd
PE
434 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
435 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 436
f162bcc3
PE
437 Use C99-style 'extern inline' if available.
438 * buffer.h (BUFFER_INLINE):
439 * category.h (CATEGORY_INLINE):
440 * character.h (CHARACTER_INLINE):
441 * charset.h (CHARSET_INLINE):
442 * composite.h (COMPOSITE_INLINE):
443 * dispextern.h (DISPEXTERN_INLINE):
444 * lisp.h (LISP_INLINE):
445 * systime.h (SYSTIME_INLINE):
446 New macro, replacing 'static inline' in this header.
447 * buffer.h, category.h, character.h, charset.h, composite.h:
448 * dispextern.h, lisp.h, systime.h:
449 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
450 * alloc.c (LISP_INLINE):
451 * buffer.c (BUFFER_INLINE):
452 * category.c (CATEGORY_INLINE):
453 * character.c (CHARACTER_INLINE):
454 * charset.c (CHARSET_INLINE):
455 * composite.c (COMPOSITE_INLINE):
456 * dispnew.c (DISPEXTERN_INLINE):
457 * sysdep.c (SYSTIME_INLINE):
458 Define to EXTERN_INLINE, so that the corresponding functions
459 are compiled into code.
460 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
461 (INLINE_HEADER_END): New macros.
462 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
463 since it's used in non-static inline functions now.
a8333d03 464 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 465
837b365b
GM
4662012-08-02 Glenn Morris <rgm@gnu.org>
467
d66b744d
GM
468 * s/: Remove empty directory.
469
837b365b
GM
470 * s/ms-w32.h: Move to ../nt/inc.
471 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
472 Update for new ms-w32.h location.
473
13294f95
PE
4742012-08-02 Paul Eggert <eggert@cs.ucla.edu>
475
476 Port to Solaris 8.
477 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
478
90df0db3
GM
4792012-08-02 Glenn Morris <rgm@gnu.org>
480
481 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
482 hard-coding the path separator.
483
4939150c
PE
4842012-08-01 Paul Eggert <eggert@cs.ucla.edu>
485
486 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
487 This how ASET and AREF are supposed to work, and makes
488 it easier to think about future improvements. See
489 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
490 * charset.h (set_charset_attr): New function.
491 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
492 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
493 (aref_addr): New function. All uses of &AREF(...) changed.
494 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
495 (set_hash_index): New functions. All lvalue-style uses of
496 HASH_KEY etc. changed.
497 * keyboard.c (set_prop): New function. All lvalue-style uses
498 of PROP changed.
499
947b2afd
AA
5002012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
501
502 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
503 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
504 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
505 * nsfns.m (ns_set_name_as_filename): Likewise.
506 * nsmenu.m (ns_update_menubar): Likewise.
507 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
508
4f5d0325
EZ
5092012-08-01 Eli Zaretskii <eliz@gnu.org>
510
2008beae
EZ
511 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
512 Adapt to latest changes in field names of the corresponding Lisp
288479f6 513 objects.
2008beae 514
4f5d0325
EZ
515 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
516
fe3cc771
GM
5172012-08-01 Glenn Morris <rgm@gnu.org>
518
519 * s/msdos.h: Remove file.
520 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
521 * Makefile.in (S_FILE): Remove.
522 (config_h): Remove S_FILE.
523
c90acc54
JB
5242012-08-01 Juanma Barranquero <lekktu@gmail.com>
525
526 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
527 Remove; moved to nt/config.nt.
528
d8a05828
DA
5292012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
530
531 Use INTERNAL_FIELD for conses and overlays.
532 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
533 Remove obsolete comment.
534 (MVAR): New macro.
535 (struct Lisp_Overlay): Use INTERNAL_FIELD.
536 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
537
8271d590
DA
5382012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
539
540 Use INTERNAL_FIELD for symbols.
541 * lisp.h (SVAR): New macro. Adjust users.
542 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
543 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
544
3193acd2
DA
5452012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
546
547 Use INTERNAL_FIELD for processes.
548 * process.h (PVAR): New macro. Adjust style.
549 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
550 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
551
3a45383a
DA
5522012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
553
554 Use INTERNAL_FIELD for windows.
555 * window.h (WVAR): New macro.
556 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
557 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
558 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
559 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
560 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
561 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
562
c1dbc63c
PE
5632012-08-01 Paul Eggert <eggert@cs.ucla.edu>
564
565 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
566
5c0c0e8a
GM
5672012-08-01 Glenn Morris <rgm@gnu.org>
568
569 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
570 Move to configure.ac.
571
552a99b4
JB
5722012-08-01 Juanma Barranquero <lekktu@gmail.com>
573
574 * makefile.w32-in (CONFIG_H): Update dependencies.
575 (CONF_POST_H): New macro.
576
577 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
578
8d8e2dfe
GM
5792012-07-31 Glenn Morris <rgm@gnu.org>
580
bc96620a
GM
581 * Makefile.in (S_FILE): No longer set by configure.
582
476b1b2d
GM
583 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
584 is available.
585 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
586
b2c7a106
GM
587 * process.h (NULL_DEVICE):
588 * emacs.c (SEPCHAR):
589 * editfns.c (USER_FULL_NAME): Let configure set them.
590
d53d062a
GM
591 * s/README, s/template.h: Remove files.
592
4515017f
GM
593 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
594
8d8e2dfe
GM
595 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
596 Move to configure.ac.
597
5b20b3cc
EZ
5982012-07-31 Eli Zaretskii <eliz@gnu.org>
599
1e0afd9a
EZ
600 * .gdbinit (xframe): Adapt to introduction of FVAR and the
601 resulting renaming of 'struct frame' members.
602
5b20b3cc
EZ
603 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
604
605 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
606 after introduction of FVAR.
607
f1310128
JD
6082012-07-31 Jan Djärv <jan.h.d@swipnet.se>
609
79e721e0
JD
610 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
611
612 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
613 instead of compositeToPoint.
614 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
615
8d7c7eed 616 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 617
e34f7f79
DA
6182012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
619
620 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
621 * lisp.h (INTERNAL_FIELD): New macro.
622 * buffer.h (BUFFER_INTERNAL_FIELD): Removed.
623 (BVAR): Change to use INTERNAL_FIELD.
624 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
625 (KVAR): Change to use INTERNAL_FIELD.
626 * frame.h (FVAR): New macro.
627 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
628 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
629 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
630 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
631 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
632
c09bfb2f
DA
6332012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
634
635 Miscellaneous fixes for non-default X toolkits.
636 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
637 * xterm.c (x_frame_of_widget): Remove redundant prototype.
638 Move under #ifdef USE_LUCID.
639 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
640 definition and usage to avoid warnings.
641
14c114ae
JD
6422012-07-31 Jan Djärv <jan.h.d@swipnet.se>
643
644 * nsterm.m (openFiles): Fix previous checkin.
645
3bd21e82
PE
6462012-07-31 Paul Eggert <eggert@cs.ucla.edu>
647
648 * indent.c (compute_motion): Remove unused local.
649
c1529ded
GM
6502012-07-31 Glenn Morris <rgm@gnu.org>
651
400d5621
GM
652 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
653
268e2432
GM
654 * conf_post.h [USG5_4]:
655 Move remaining contents of s/usg5-4-common.h here.
656 * s/usg5-4-common.h: Remove file.
657
7552f3ee
GM
658 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
659 * s/irix6-5.h: Remove file.
660
6a381852
GM
661 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
662 * s/darwin.h: Remove file.
663
c1529ded
GM
664 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
665 * s/hpux10-20.h: Remove file, which is now empty.
666
b429a4ee
GM
6672012-07-30 Glenn Morris <rgm@gnu.org>
668
669 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
670 * Makefile.in (config_h): Add conf_post.h.
671 * makefile.w32-in (CONFIG_H): Add conf_post.h.
672
adff3182
JD
6732012-07-30 Jan Djärv <jan.h.d@swipnet.se>
674
675 * nsterm.m (ns_do_open_file): New variable.
b9031d69 676 (ns_term_init): Set ns_do_open_file to YES after run returns.
adff3182
JD
677 (openFile, openTempFile, openFileWithoutUI, openFiles): Open
678 files only if ns_do_open_file.
679
c32af1e4
PE
6802012-07-30 Paul Eggert <eggert@cs.ucla.edu>
681
7393bcbb
PE
682 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
683 This no-op macro hasn't been needed for many years.
684 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
685
c32af1e4
PE
686 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
687 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
688 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
689 gdb_make_enums_visible.
690 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
691 (DIRECTORY_SEP): Now a constant, not a macro.
692
302fc036
EZ
6932012-07-30 Eli Zaretskii <eliz@gnu.org>
694
695 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
696 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
697
698 * w32term.c <w32_keyboard_codepage>: Renamed from
699 keyboard_codepage and now external. All users changed.
700
701 * w32term.h: Add declaration of w32_keyboard_codepage.
702
703 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
704 the codepage to translate keys to Unicode. If this argument is
705 -1, use the value returned by GetConsoleCP. All callers changed.
706
88fb40b4
PE
7072012-07-30 Paul Eggert <eggert@cs.ucla.edu>
708
0aee6912
PE
709 Update .PHONY listings in makefiles.
710 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
711 bootstrap-clean, distclean, maintainer-clean, versioclean,
712 extraclean, frc.
713
88fb40b4
PE
714 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
715 This is a bit clearer. Fix some commentary typos.
716
0a763bd1
GM
7172012-07-30 Glenn Morris <rgm@gnu.org>
718
32bac6d6
GM
719 * s/netbsd.h: Let configure include signal.h if needed.
720 Remove file, which is now empty.
721
b65e7c46
GM
722 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
723 Let configure set them.
724 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
725 No more need to undefine.
0a763bd1 726
169304bd
AS
7272012-07-30 Andreas Schwab <schwab@linux-m68k.org>
728
729 * keymap.c (Fkey_description): Don't remove 0x80 bit from
730 non-single-byte char when adding meta modifier. (Bug#12090)
731
6cd7a139
DA
7322012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
733
734 Convert safe_call to use variable number of arguments.
735 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
736 (safe_call2): Fix comment.
737 * lisp.h (safe_call): Adjust prototype.
738 * coding.c (encode_coding_object): Change to use safe_call2.
739 * xfaces.c (merge_face_heights): Change to use safe_call1.
740
d34d6ffc
GM
7412012-07-30 Glenn Morris <rgm@gnu.org>
742
7b8a48e4 743 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 744 does that unconditionally. Remove file, which is now empty.
7b8a48e4 745
d34d6ffc
GM
746 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
747 Remove empty files.
748
03a660a6
PE
7492012-07-30 Paul Eggert <eggert@cs.ucla.edu>
750
751 Export to GDB most of lisp.h's remaining object-like macros.
752 * lisp.h (min, max): Move earlier, because they're used earlier now.
753 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
754 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
755 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
756 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
757 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
758 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
759 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
760 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
761 Now constants, for GDB. They need not be macros.
762 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
763 Now constants, for GDB, as well as macros, for static initializers.
764 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
765 Move to after the definition of struct Lisp_Char_Table,
766 since the former now needs that type defined.
767 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
768 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
769 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
770 New enums, for gdb_make_enums_visible.
771 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 772 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
773 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
774 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
775 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
776 enum maxargs, enum MAX_ALLOCA.
777 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
778 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
779 no longer needed, now that they are done in lisp.h.
780
e499d0ee
DA
7812012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
782
783 Cleanup string bytes checking.
784 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
785 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
786 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
787 (check_sblock, compact_small_strings): Simplify.
788
d5040d2d
PE
7892012-07-29 Paul Eggert <eggert@cs.ucla.edu>
790
791 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
792 These macros are confusing and no longer need to be defined, as
793 the enum values now suffice. All uses replaced with definiens.
794 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
795
7f259ae6
JB
7962012-07-29 Juanma Barranquero <lekktu@gmail.com>
797
798 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
799 ($(BLD)/w32console.$(O)): Update dependencies.
800
7e63e0c3
DA
8012012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
802
803 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
804 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
805 time. Adjust users.
806 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
807
ffd817eb
JD
8082012-07-29 Jan Djärv <jan.h.d@swipnet.se>
809
810 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
811 setting sitelisp (Bug#12010).
812
417a7a0e
EZ
8132012-07-29 Eli Zaretskii <eliz@gnu.org>
814
815 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
816
817 * w32heap.c (cache_system_info):
818 * w32.c (sys_rename):
819 * w32proc.c (find_child_console, sys_kill): All users changed.
820
387d4d92
PE
8212012-07-29 Paul Eggert <eggert@cs.ucla.edu>
822
823 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
824
55a6cca6
EZ
8252012-07-29 Eli Zaretskii <eliz@gnu.org>
826
827 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
828
dbcf001c
DA
8292012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
830
831 Cleanup statistics calculation in Fgarbage_collect.
832 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
833 zombies percentage calculation. Simplify elapsed time calculation.
834
e2688e4a
DA
8352012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
836
837 Generalize marker debugging code under MARKER_DEBUG and use eassert.
838 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
839 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
840 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
841 (replace_range, replace_range_2, del_range_2): Change to eassert.
842 * marker.c (byte_char_debug_check): Adjust style.
843
b46a6a83
PE
8442012-07-29 Paul Eggert <eggert@cs.ucla.edu>
845
846 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
847 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
848 long-ago-commented-out code that talks about "WIN32".
849 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
850 All uses changed.
851
e32a5799
PE
8522012-07-28 Paul Eggert <eggert@cs.ucla.edu>
853
854 Use Gnulib stdalign module (Bug#9772, Bug#9960).
855 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
856 Simplify by using alignof.
857 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
858 * lisp.h: Include <stdalign.h>.
859 (GCALIGNMENT): New macro and constant.
860 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
861 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
862 (stdalign): New macro, if not already defined.
863
df81cd29
EZ
8642012-07-28 Eli Zaretskii <eliz@gnu.org>
865
01bd1b0d
EZ
866 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
867 * w32inevt.c: Include w32inevt.h.
868 (w32_read_console_input): New inline function, calls either
869 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
870 w32_console_unicode_input.
871 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
872 (w32_kbd_patch_key, key_event): Use the codepage returned by
873 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
874 (key_event): use uChar.UnicodeChar only if
875 w32_console_unicode_input is non-zero.
876
877 * w32console.c: Include w32heap.h.
878 <w32_console_unicode_input>: New global variable.
879 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
880 family of Windows, zero otherwise.
881
882 * w32inevt.h: Declare w32_console_unicode_input.
883
df81cd29
EZ
884 * xdisp.c (init_iterator): Don't reference tip_frame in a build
885 --without-x. (Bug#11742)
886
c20fdd9e
PE
8872012-07-27 Paul Eggert <eggert@cs.ucla.edu>
888
889 Adjust GDB to reflect pvec_type changes (Bug#12036).
890 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
891 2012-07-04 changes to pseudovector representation. Problem
892 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
893
32770973 8942012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
895
896 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
897 bus address.
898 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
899
3438fe21
EZ
9002012-07-27 Eli Zaretskii <eliz@gnu.org>
901
bcfbc9de
EZ
902 * alloc.c (listn): Fix the order the arguments are consed onto the
903 list.
904
3438fe21
EZ
905 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
906 enumeration constants, as PURE and HEAP are too general, and clash
907 with other headers and sources, such as gmalloc.c and the
908 MS-Windows system headers. All users changed.
909
eeaea515
DA
9102012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
911
912 Revert last save_excursion_save and save_excursion_restore changes.
913 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
914 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
915
073c88c2
DA
9162012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
917
918 Fix recently-introduced typos in Windows port.
919 Reported by Martin Rudalics <rudalics@gmx.at>.
920 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 921 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 922
4706125e
PE
9232012-07-27 Paul Eggert <eggert@cs.ucla.edu>
924
925 Improve GDB symbol export (Bug#12036).
926 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
927 arms of an 'if', not using conditional expressions; otherwise GDB
928 complains about the types in the unevaluated arm when the argument
929 is an integer literal.
930 (xgetint): Simplify expression.
931 * alloc.c (gdb_make_enums_visible): New constant. This ports to
932 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
933 Zaretskii in <http://bugs.gnu.org/12036#13>.
934 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
935 needed now that we have gdb_make_enums_visible.
936 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
937 (enum enum_USE_LSB_TAG):
938 New enum types, packaging up enums that need to be exported to GDB.
939
694b6c97
DA
9402012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
941
942 Utility function to make a list from specified amount of objects.
943 * lisp.h (enum constype): New datatype.
944 (listn): New prototype.
945 * alloc.c (listn): New function.
946 (Fmemory_use_count, syms_of_alloc): Use it.
947 * buffer.c (syms_of_buffer): Likewise.
948 * callint.c (syms_of_callint): Likewise.
949 * charset.c (define_charset_internal): Likewise.
950 * coding.c (syms_of_coding): Likewise.
951 * keymap.c (syms_of_keymap): Likewise.
952 * search.c (syms_of_search): Likewise.
953 * syntax.c (syms_of_syntax): Likewise.
954 * w32.c (init_environment): Likewise.
955 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
956 * xdisp.c (syms_of_xdisp): Likewise.
957 * xfns.c (syms_of_xfns): Likewise.
958
6195f384
DA
9592012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
960
961 Fast save_excursion_save and save_excursion_restore.
962 * lisp.h (struct Lisp_Excursion): New data type.
963 (PVEC_EXCURSION): New pseudovector type.
964 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
965 to deal with it. Adjust comments.
966 (init_marker, attach_marker): New prototype.
967 (unchain_marker): Adjust prototype.
968 * marker.c (attach_marker): Change to global.
969 (init_marker): New function.
970 * alloc.c (Fmake_marker, build_marker): Use it.
971 (build_marker): More easserts.
972 (mark_object): Handle struct Lisp_Excursion.
973 * editfns.c (save_excursion_save, save_excursion_restore):
974 Reimplement to use struct Lisp_Excursion. Add comments.
975
5eceb8fb
PE
9762012-07-26 Paul Eggert <eggert@cs.ucla.edu>
977
978 Fix export of symbols to GDB (Bug#12036).
979 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
980 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
981 emacs.c, as this is a more-suitable home. Had this been done earlier
982 the fix for 12036 would have avoided some of the problems noted in
983 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
984 would have been more obvious.
562157c8
PE
985 * emacs.c: Do not include <verify.h>; no longer needed.
986 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
987 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
988 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
989 Remove; now done in lisp.h.
990 * lisp.h (PUBLISH_TO_GDB): New macro.
991 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
992 (DATA_SEG_BITS): Use it.
993 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
994 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
995 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
996 not be usable in #if. This simplifies things.
997
d6749401
JB
9982012-07-26 Juanma Barranquero <lekktu@gmail.com>
999
1000 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1001
1781b9e9
PE
10022012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1003
d89518db 1004 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
1005 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1006 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1007 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1008 Adjust to changes in lisp.h and emacs.c, by using
1009 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1010 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1011 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1012 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1013 instead of gdb_valbits.
1014 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1015 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1016 instead of gdb_array_mark_flag.
1017 (xboolvector): Get size from $->size, not $->header.size.
1018 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1019 (xreload, hook-run, hookpost-run): Remove.
1020 * emacs.c: Include <verify.h>.
1021 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1022 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1023 Remove.
1024 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1025 (gdb_USE_LSB_TAG): New enum constants.
1026 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1027 Also define these as enum constants, so they're visible to GDB.
1028 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1029 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1030 as constants, so they're visible to GDB.
1031 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1032 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1033 Now enum constants, not macros, so they're visible to GDB.
1034 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1035 more convenient now. All uses changed.
1036 (VALMASK) [USE_LSB_TAG]: Also define in this case.
1037 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1038
3628596a
DA
10392012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
1040
1041 Explicitly free restriction data that are not needed anymore.
1042 * editfns.c (save_restriction_restore): Free restriction data.
1043
7abaf5cc
SM
10442012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
1045
1046 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
1047 add argument, tune behavior, and adjust all callers.
1048
71f88e00
PE
10492012-07-25 Paul Eggert <eggert@cs.ucla.edu>
1050
1051 Use typedef for EMACS_INT, EMACS_UINT.
1052 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
1053 than macros. This simplifies debugging in the usual case, since
1054 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
1055 and it allows expressions involving EMACS_INT casts.
1056 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
1057
57ec3034
JD
10582012-07-25 Jan Djärv <jan.h.d@swipnet.se>
1059
1060 * nsterm.m (ns_read_socket): Return early if there is a modal
1061 window (Bug#12043).
1062
8137e7b3
MR
10632012-07-25 Martin Rudalics <rudalics@gmx.at>
1064
1065 * frame.c (Fredirect_frame_focus): In doc-string don't mention
1066 that FOCUS-FRAME can be omitted.
1067
04e9897c
DA
10682012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
1069
1070 Adjust buffer text indirection counters at the end of Fkill_buffer.
1071 * buffer.c (Fkill_buffer): Adjust indirection counters when the
1072 buffer is definitely dead. This should really fix an issue reported
1073 by Christoph Scholtes again. (Bug#12007).
1074 (init_buffer_once): Initialize indirection counters of
1075 buffer_defaults and buffer_local_symbols (for sanity and safety).
1076
8a0484e1
EZ
10772012-07-24 Eli Zaretskii <eliz@gnu.org>
1078
1079 * xdisp.c (init_iterator): Don't compute dimensions of truncation
1080 and continuation glyphs on tooltip frames, leave them at zero.
1081 Avoids continued lines in tooltips. (Bug#11832)
1082
fa691a83
DA
10832012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
1084
1085 Simplify copy_overlay.
04e9897c 1086 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
1087 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
1088
436bc8e0
EZ
10892012-07-23 Eli Zaretskii <eliz@gnu.org>
1090
1091 * print.c (print_object): Don't crash when a frame's name is nil
1092 or invalid. (Bug#12025)
1093
1094 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
1095 it signals an error when a tooltip frame is being created.
1096
d7a7fda3
DA
10972012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1098
1099 Cleanup miscellaneous objects allocation and initialization.
1100 * alloc.c (allocate_misc): Change to static. Add argument to
1101 specify the subtype. Adjust comment and users.
1102 (build_overlay): New function.
1103 * buffer.c (copy_overlays, Fmake_overlay): Use it.
1104 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
1105 (allocate_misc): Remove prototype.
1106 (build_overlay): Add prototype.
1107
11082012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
1109
1110 Swap buffer text indirection counters in Fbuffer_swap_text.
1111 * buffer.c (Fbuffer_swap_text): Swap indirections too.
1112 This avoids crash reported by Christoph Scholtes at
1113 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
1114
9d7fa573
JD
11152012-07-22 Jan Djärv <jan.h.d@swipnet.se>
1116
1117 * nsmenu.m (Popdown_data): New struct.
1118 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
1119 free Popdown_data.
1120 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
1121 (initWithContentRect): Make imgView and contentView non-static
1122 and autorelease them. Also autorelease img and matrix (Bug#12005).
1123 (dealloc): Remove (Bug#12005).
1124
0dd6d66d
DA
11252012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1126
1127 Adjust consing_since_gc when objects are explicitly freed.
1128 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
1129 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
1130 (free_cons, free_misc): Subtract object size from consing_since_gc.
1131
d36d71df
DA
11322012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1133
1134 Simplify and cleanup markers positioning code.
1135 * marker.c (attach_marker): More useful eassert.
1136 (live_buffer, set_marker_internal): New function.
1137 (Fset_marker, set_marker_restricted): Use set_marker_internal.
1138 (set_marker_both, set_marker_restricted_both): Use live_buffer.
1139
fb9ea40f
PE
11402012-07-22 Paul Eggert <eggert@cs.ucla.edu>
1141
1142 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
1143 as it's limited by the amount of memory, not by INT_MAX.
1144
2d5c5f7d
EZ
11452012-07-21 Eli Zaretskii <eliz@gnu.org>
1146
07fb592e
EZ
1147 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
1148 in special-event-map. See the discussion at
1149 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
1150 for the reasons.
1151
37a9eac8 1152 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2d5c5f7d
EZ
1153 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
1154 Fabrice Popineau <fabrice.popineau@supelec.fr>.
1155
c4328746
JD
11562012-07-21 Jan Djärv <jan.h.d@swipnet.se>
1157
1158 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 1159 (conversationIdentifier): Return value is NSInteger.
784051c4 1160 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 1161
6e5d1c12
CY
11622012-07-21 Chong Yidong <cyd@gnu.org>
1163
1164 * window.c (decode_any_window): Signal an error if the window is
1165 on a dead frame (Bug#11984).
1166
9928463d
DA
11672012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1168
1169 Add indirection counting to speed up Fkill_buffer.
1170 * buffer.h (struct buffer): New member.
1171 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
1172 (Fmake_indirect_buffer): Set indirection counter to -1, increment
1173 base buffer indirection counter.
1174 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
1175 (Fkill_buffer): Adjust indirection counters as needed, don't walk
1176 through buffer list if indirection counter is 0.
1177
f8643a6b
DA
11782012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1179
1180 Extend the value returned by Fgarbage_collect with heap statistics.
1181 * alloc.c (Qheap): New symbol.
1182 (syms_of_alloc): DEFSYM it.
1183 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
1184 (Fmemory_free): Remove.
1185 (syms_of_alloc): Don't defsubr it.
1186 * buffer.c (Fcompact_buffer): Remove.
1187 (syms_of_buffer): Don't defsubr it.
1188
dac616ff
DA
11892012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1190
1191 Make maybe_gc inline.
1192 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
1193 * lisp.h (consing_since_gc, gc_relative_threshold)
1194 (memory_full_cons_threshold): Revert declaration.
1195 (maybe_gc): Remove prototype, define as inline.
1196 * alloc.c: Remove old commented-out code.
1197 (consing_since_gc, gc_relative_threshold)
1198 (memory_full_cons_threshold): Revert to global.
1199 (maybe_gc): Remove.
1200
d7ea76b4
DA
12012012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1202
1203 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
1204 * lisp.h (build_unibyte_string): New function.
1205 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
1206 * sysdep.c, w32fns.c, xfns.c: Use it.
1207 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
1208 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
1209 Adjust users accordingly.
1210 * font.h (font_open_by_name): Adjust prototype.
1211
765e61e3
DA
12122012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1213
1214 Cleanup calls to Fgarbage_collect.
1215 * lisp.h (maybe_gc): New prototype.
1216 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1217 Remove declarations.
1218 * alloc.c (maybe_gc): New function.
1219 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1220 Make them static.
1221 * bytecode.c (MAYBE_GC): Use maybe_gc.
1222 * eval.c (eval_sub, Ffuncall): Likewise.
1223 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
1224 to avoid dependency from auto-save feature.
1225
52b852c7
PE
12262012-07-19 Paul Eggert <eggert@cs.ucla.edu>
1227
1228 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
1229 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
1230 'for_each_per_buffer_object_at'.
1231 All uses changed. It's better to use upper-case for macros that
1232 cannot be implemented as functions, to give the reader a clue
1233 that they're special.
1234
5db81e33
SM
12352012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
1236
1237 * alloc.c (Fgarbage_collect): Tweak docstring.
1238
5b835e1d
DA
12392012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1240
1241 Tweak the value returned from Fgarbage_collect again.
1242 * alloc.c (Fgarbage_collect): New return value, as confirmed in
1243 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
1244 Adjust documentation.
1245 (total_vector_bytes): Rename to total_vector_slots, adjust
1246 accounting.
1247 (total_free_vector_bytes): Rename to total_free_vector_slots,
1248 adjust accounting.
1249 (Qstring_bytes, Qvector_slots): New symbols.
1250 (syms_of_alloc): DEFSYM them.
1251
9cd47b72
DA
12522012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1253
1254 Buffer compaction primitive which may be used from Lisp.
1255 * buffer.c (compact_buffer, Fcompact_buffer): New function.
1256 (syms_of_buffer): Register Fcompact_buffer.
1257 * alloc.c (Fgarbage_collect): Use compact_buffer.
1258 * buffer.h (compact_buffer): New prototype.
1259 (struct buffer_text): New member.
1260
d17337e5
DA
12612012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1262
1263 New macro to iterate over all buffers, miscellaneous cleanups.
1264 * lisp.h (all_buffers): Remove declaration.
1265 * buffer.h (all_buffers): Add declaration, with comment.
1266 (for_each_buffer): New macro.
1267 * alloc.c (Fgarbage_collect, mark_object): Use it.
1268 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
1269 (init_buffer): Likewise.
1270 * data.c (Fset_default): Likewise.
1271 * coding.c (code_conversion_restore): Remove redundant check
1272 for dead buffer.
1273 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
1274
60cfd278
AS
12752012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1276
1277 Fix bug that created negative-length intervals.
1278 * intervals.c (merge_interval_right, merge_interval_left):
1279 Do not zero out this interval if it is absorbed by its children,
1280 as this interval's total length doesn't change in that case. See
1281 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
1282
d06714cb
PE
12832012-07-18 Paul Eggert <eggert@cs.ucla.edu>
1284
83713154
PE
1285 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
1286 when invoking (make-bool-vector N t) and N is a positive
1287 multiple of 8 -- the last 8 bits were mistakenly cleared.
1288
d06714cb
PE
1289 Remove some struct layout assumptions in bool vectors.
1290 * alloc.c (bool_header_size): New constant.
1291 (header_size, word_size): Move earlier, as they're now used earlier.
1292 Use 'word_size' in a few more places, where it's appropriate.
1293 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
1294 padding before the data member of a bool vector.
1295 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
1296 than doing the check by hand with an abort ().
1297
464d5a5e
SM
12982012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
1299
5fbc0409
SM
1300 * eval.c (Fdefvar): Don't check constants since we only set the var if
1301 it's not yet defined anyway (bug#11904).
1302
464d5a5e
SM
1303 * lisp.h (last_undo_boundary): Declare new var.
1304 * keyboard.c (command_loop_1): Set it.
1305 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
1306 were auto-added by the command loop (bug#11774).
1307
8dc2e44a
AS
13082012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1309
1310 * w32font.c (Qsymbol): Remove local definition.
1311 (syms_of_w32font): Don't DEFSYM it.
1312
169925ec
DA
13132012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1314
1315 Fix sweep_vectors to handle large bool vectors correctly.
1316 * alloc.c (sweep_vectors): Account total_vector_bytes for
1317 bool vectors larger than VBLOCK_BYTES_MAX.
1318
5fbfb018
CY
13192012-07-18 Chong Yidong <cyd@gnu.org>
1320
1321 * frame.c (x_set_frame_parameters): Revert bogus change introduced
1322 in 2012-05-25 commit by Paul Eggert (Bug#11738).
1323
3ab6e069
DA
13242012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1325
1326 Return more descriptive data from Fgarbage_collect.
1327 Suggested by Stefan Monnier in
1328 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
1329 * alloc.c (bounded_number): New function.
1330 (total_buffers, total_vectors): New variable.
1331 (total_string_size): Rename to total_string_bytes, adjust users.
1332 (total_vector_size): Rename to total_vector_bytes, adjust users.
1333 (sweep_vectors): Account total_vectors and total_vector_bytes.
1334 (Fgarbage_collect): New return value. Adjust documentation.
1335 (gc_sweep): Account total_buffers.
1336 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
1337 (VECTOR_SIZE): Remove.
1338 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
1339 (Qinterval, Qmisc): New symbols.
1340 (syms_of_data): Initialize them.
1341 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
1342 (Qcons, Qbuffer): New declarations.
1343
6d02fe5b
PE
13442012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1345
1346 * alloc.c (Fmemory_free): Account for memory-free's own storage.
1347 Round up, not down. Improve doc.
1348
b7ffe040
DA
13492012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1350
1351 Restore old code in allocate_string_data to avoid Faset breakage.
1352 Reported by Julien Danjou <julien@danjou.info> in
1353 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
1354 * alloc.c (allocate_string_data): Restore old code with minor
1355 adjustments, fix comment to explain this subtle issue.
1356
4dc7c8d5
SM
13572012-07-17 Eli Zaretskii <eliz@gnu.org>
1358
1359 Remove FILE_SYSTEM_CASE.
1360 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
1361
1362 * fileio.c (FILE_SYSTEM_CASE): Don't define.
1363 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
1364 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
1365 call-process-region passes it through expand-file-name.
1366
1367 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
1368
13692012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1370
1371 Fix crash when creating indirect buffer (Bug#11917)
1372 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
1373 Don't handle unbound variables specially if non-zero.
1374 (Fbuffer_local_variables): Pass zero.
1375 (clone_per_buffer_values): Pass non-zero.
1376
13772012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1378
1379 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
1380 to make the loop interruptible.
1381
13822012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1383
1384 * gnutls.c (emacs_gnutls_handshake): Only retry if
1385 GNUTLS_E_INTERRUPTED.
1386
cce7fefc
DA
13872012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1388
1389 Cleanup and convert miscellaneous checks to eassert.
1390 * alloc.c (mark_interval): Fix comment, partially rephrase
1391 old comment from intervals.h (see below).
1392 * intervals.c (find_interval, adjust_intervals_for_insertion)
1393 (delete_interval, adjust_intervals_for_deletion)
1394 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
1395 Convert to eassert.
1396 (adjust_intervals_for_insertion, make_new_interval):
1397 Remove obsolete and unused code.
1398 * intervals.h (struct interval): Remove obsolete comment.
1399 * textprotp.c (erase_properties): Remove unused code.
1400 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
1401 (Fremove_list_of_text_properties): Convert to eassert.
1402
9ea10cc3
CY
14032012-07-17 Chong Yidong <cyd@gnu.org>
1404
1405 * editfns.c (Finsert_char): Doc fix.
1406
3900d5de
DA
14072012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1408
1409 Fix previous change to make Fmemory_free always accurate.
1410 * alloc.c (make_interval): Update total_free_intervals.
1411 (make_float): Likewise for total_free_floats.
1412 (free_cons, Fcons): Likewise for total_free_conses.
1413 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
1414 Likewise for total_free_vector_bytes.
1415 (Fmake_symbol): Likewise for total_free_symbols.
1416 (bytes_free): Remove.
1417
7098646f
DA
14182012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1419
1420 Simple free memory accounting feature.
1421 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
1422 (sweep_vectors): Accumulate size of free vectors.
1423 (Fgarbage_collect): Setup bytes_free.
1424 (Fmemory_free): New function.
1425 (syms_of_alloc): Register it.
1426
22657b40
DA
14272012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1428
1429 Cleanup overlays checking.
1430 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
1431 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
1432 eassert and OVERLAYP.
1433 (sort_overlays): Change to use OVERLAYP.
1434
ddfc8813
RK
14352012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
1436
1437 * editfns.c (Finsert_char): Make it interactive, and make the
1438 second arg optional. Copy interactive spec and docstring from
1439 ucs-insert.
1440
7c26cf3c
PE
14412012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1442
1443 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
1444 Unlike the other wrapped functions, fabs has an unspecified
1445 effect on errno.
1446
5d127af9
JD
14472012-07-16 Jan Djärv <jan.h.d@swipnet.se>
1448
1449 * nsterm.m (keyDown): Interpret flags without left/right bits
1450 as the left key (Bug#11670).
1451
6a0dd1d7
DA
14522012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1453
1454 Remove empty and useless init functions.
1455 * lisp.h (init_character_once, init_fns, init_image)
1456 (init_filelock, init_sound): Remove prototype.
1457 * character.c (init_character_once): Remove.
1458 * filelock.c (init_filelock): Likewise.
1459 * fns.c (init_fns): Likewise.
1460 * image.c (init_image): Likewise.
1461 * sound.c (init_sound): Likewise.
1462 * emacs.c (main): Adjust accordingly.
1463
7a6136fd
DA
14642012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1465
1466 * gtkutil.h: Tiny cleanups.
1467 (use_old_gtk_file_dialog): Remove useless declaration.
1468 (xg_uses_old_file_dialog): Add suggested const attribute.
1469
ce811ad9
EZ
14702012-07-15 Eli Zaretskii <eliz@gnu.org>
1471
1472 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
1473 (bidi_paragraph_init): Use it to limit search forward for a strong
1474 directional character in abnormally large paragraphs full of
1475 neutral or weak characters. (Bug#11943)
1476
c9adfeaa
SF
14772012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
1478
1479 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
1480 the toolbar (Bug#9451).
1481 (xg_make_tool_item): Give the widget event box a transparent
1482 background.
1483
fff62aa9
DA
14842012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1485
1486 Cleanup basic allocation variables and functions.
1487 * alloc.c (ignore_warnings, init_intervals, init_float)
1488 (init_cons, init_symbol, init_marker): Remove.
1489 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
1490 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
1491 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
1492 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
1493 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
1494 (staticidx, init_alloc_once, init_strings, free_ablock):
1495 Remove redundant initialization.
1496 * fns.c (init_weak_hash_tables): Remove.
1497 * lisp.h (init_weak_hash_tables): Remove prototype.
1498
9730daca
DA
14992012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1500
1501 Use zero_vector where appropriate.
1502 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
1503 accordingly.
1504 * lisp.h (zero_vector): New declaration.
1505 * font.c (null_vector): Remove.
1506 (syms_of_font): Remove initialization and staticpro.
1507 (font_list_entities, font_find_for_lface): Change to use zero_vector.
1508 * keymap.c (Faccessible_keymaps): Likewise.
1509
2e2d2a13
LL
15102012-07-15 Leo Liu <sdl.web@gmail.com>
1511
1512 * fringe.c: Fix typo in comments.
1513
cd276f6e
LL
15142012-07-14 Leo Liu <sdl.web@gmail.com>
1515
1516 * fringe.c: Add a new bitmap exclamation-mark.
1517
5a1131d9
EZ
15182012-07-14 Eli Zaretskii <eliz@gnu.org>
1519
1520 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
1521
1522 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
1523 (HAVE_MENUS): Don't define, defined by editing config.in with
1524 msdos/sed2v2.inp.
1525 (GMALLOC_INHIBIT_VALLOC): Don't define.
1526 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
1527
22e983b7
JB
15282012-07-14 Juanma Barranquero <lekktu@gmail.com>
1529
1530 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
1531
5b3f250f
GM
15322012-07-14 Glenn Morris <rgm@gnu.org>
1533
1534 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
1535 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
1536 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
1537
33d63ff4
GM
15382012-07-13 Glenn Morris <rgm@gnu.org>
1539
5b633342
GM
1540 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
1541
33d63ff4
GM
1542 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
1543 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
1544
b55b9f85
JD
15452012-07-13 Jan Djärv <jan.h.d@swipnet.se>
1546
0dc8cf50
JD
1547 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
1548 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
1549 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
1550 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
1551 where appropriate.
1552 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
1553 as boolean expression.
1554 (x_set_window_size): Remove unused variable toolbar.
1555 (ns_get_color_default, ns_mod_to_lisp): Remove.
1556 (ns_mouse_position): Remove unused variables xchar and ychar.
1557 (ns_compute_glyph_string_overhangs): Remove unused variable face.
1558 (ns_set_vertical_scroll_bar): Remove unused variable count.
1559 (ns_delete_terminal): Remove unused variable i.
1560 (ns_term_init): Remove unused variables r, g and b.
1561 (mouseDown): Remove unused variable window.
1562 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
1563 (initFrameFromEmacs): Remove unused variable vbextra.
1564 (mouseEntered): Remove unused variables p and dpyinfo.
1565 (mouseExited): Remove unused variables p and r.
1566 (ns_define_frame_cursor, ns_clear_frame_area)
1567 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
1568 (menuDown): Assign [sender tag] to variable and cast the variable.
1569
1570 * nsterm.h (menuDown): Add id as type to argument sender.
1571 (ns_display_info_for_name): Add Lisp_Object argument.
1572 (ns_term_init): Add Lisp_Object argument.
1573 (ns_map_event_to_object): Add void argument.
1574 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
1575 prototype with arguments and only declare if __OBJC__.
1576 (nxatoms_of_nsselect): Add void argument.
1577 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
1578 (ns_alloc_autorelease_pool): Add void argument.
1579 (ns_release_autorelease_pool): Add void* argument.
1580 (ns_get_defaults_value): Add const char* argument.
1581
1582 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
1583 (initFromContents): Use SSDATA where appropriate.
1584 (ns_update_menubar): Add braces to ambigous if-else.
1585 (initWithTitle): Put () around assignment in if statement.
1586 (ns_menu_show): Remove unused variables window and keymap.
1587 (update_frame_tool_bar): Remove unused variable selected_p.
1588 (initWithContentRect): Remove unused variable this_cmd_name.
1589
1590 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
1591 appropriate.
1592 (setXBMColor): Remove unused variable len.
1593 (setPixmapData): Put () around assignment in loop statement.
1594
1595 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
1596 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
1597 where appropriate.
1598 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
1599 around assignment in loop statement.
1600 (nsfont_open): Remove unused variable i.
1601 (nsfont_open): Remove unused variable len.
1602 (nsfont_draw): Remove unused variable cs.
1603
1604 * nsfns.m (x_set_icon_name, ns_set_name_internal)
1605 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
1606 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
1607 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
1608 (Fns_font_name, Fns_perform_service)
1609 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
1610 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
1611 (ns_set_name): Remove unused variable view.
1612 (x_set_menu_bar_lines): Remove unused variable olines.
1613 (x_set_tool_bar_lines): Remove unused variable root_window.
1614 (Fns_list_colors): Put () around assignment in while statement.
1615 (Fns_perform_service): Remove unused variable len.
1616 (Fns_display_usable_bounds): Remove unused variable top.
1617 (syms_of_nsfns): Remove unused variable i.
1618
b55b9f85
JD
1619 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1620 memcpy (Bug#11907).
1621
ed9265fc 16222012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
1623
1624 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1625 and free it with DestroyExceptionInfo (Bug#11558).
1626
ef099b57
JB
16272012-07-13 Juanma Barranquero <lekktu@gmail.com>
1628
1629 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1630 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1631 Set here, not in nt/config.nt.
1632
ea814a5d
EZ
16332012-07-13 Eli Zaretskii <eliz@gnu.org>
1634
1635 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1636 cursor overflow into the last glyph on display line when the right
1637 fringe is off. (Bug#11832)
1638
1a952767
PE
16392012-07-13 Paul Eggert <eggert@cs.ucla.edu>
1640
1641 * xdisp.c (produce_special_glyphs): Now static.
1642 * dispextern.h (produce_special_glyphs): Remove decl.
1643
983188fd
GM
16442012-07-13 Glenn Morris <rgm@gnu.org>
1645
8d7c7eed 1646 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
1647 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1648
983188fd
GM
1649 * s/usg5-4-common.h (USG, USG5):
1650 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1651 * s/sol2-6.h (SOLARIS2):
1652 * s/irix6-5.h (IRIX6_5):
1653 * s/hpux10-20.h (USG, USG5, HPUX):
1654 * s/gnu-linux.h (USG, GNU_LINUX):
1655 * s/freebsd.h (BSD_SYSTEM):
1656 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1657 * s/cygwin.h (CYGWIN):
1658 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1659 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1660
d1e68667 16612012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
1662
1663 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 1664
6de0e799
GM
16652012-07-13 Glenn Morris <rgm@gnu.org>
1666
739ae010
GM
1667 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1668
dbee5793
GM
1669 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1670
6de0e799
GM
1671 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1672 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1673
b82da769
GM
16742012-07-12 Glenn Morris <rgm@gnu.org>
1675
4fae5a7a 1676 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
1677
1678 * process.c (init_process_emacs): Rename from init_process.
1679 The old name is also the name of a Mach system call.
1680 * lisp.h, emacs.c: Update for this name change.
1681 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1682 longer needed.
1683
5a979817
EZ
16842012-07-12 Eli Zaretskii <eliz@gnu.org>
1685
1686 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1687 memmove call that removes glyphs covered by the left truncation
1688 glyph. Improve commentary.
1689 (display_line): Fix display of continuation glyphs on GUI frames
1690 when the right fringe is turned off and variable-size fonts are
1691 used in the window. Move the code that appends a stretch glyph to
1692 produce_special_glyphs, so that it could be used for truncation
1693 and continuation glyphs alike.
1694 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1695 glyph of a suitably computed width, to align the special glyphs at
1696 the window margin. Code moved from display_line. (Bug#11832)
1697
3e91a053
GM
16982012-07-12 Glenn Morris <rgm@gnu.org>
1699
ba9e4b84
GM
1700 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1701
1702 * s/gnu-linux.h, s/hpux10-20.h:
1703 Do not unconditionally define HAVE_XRMSETDATABASE.
1704
3e91a053
GM
1705 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1706
b300b1f4
PE
17072012-07-12 Paul Eggert <eggert@cs.ucla.edu>
1708
1709 Fix typos that broke OS X build.
1710 Reported by Randal L. Schwartz in
1711 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1712 * nsterm.m (ns_timeout): Add missing local decl.
1713 (ns_get_color): snprintf -> sprintf, to fix typo.
1714
6e777848
GM
17152012-07-12 Glenn Morris <rgm@gnu.org>
1716
3f922c37
GM
1717 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1718 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1719 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1720 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1721
0ab7b23a
GM
1722 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1723 Move PTY_OPEN to configure.
1724
6e777848
GM
1725 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1726 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1727 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1728
4a7edc24
DA
17292012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
1730
1731 Use empty_unibyte_string where applicable.
1732 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1733 * lread.c (read1): Likewise.
1734 * xsettings.c (syms_of_xsettings): Likewise.
1735
308aab79
GM
17362012-07-12 Glenn Morris <rgm@gnu.org>
1737
42bd1719
GM
1738 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1739 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
1740 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1741 * s/hpux10-20.h (RUN_TIME_REMAP):
1742 * s/bsd-common.h (TABDLY): Move to configure.
1743
1744 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1745
1746 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1747
ea0bbd17 1748 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 1749 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
1750
1751 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 1752
308aab79
GM
1753 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1754 * s/template.h: Move NARROWPROTO to configure.
1755
ee1cf5cf
GM
17562012-07-11 Glenn Morris <rgm@gnu.org>
1757
30fe9bf4
GM
1758 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
1759 unused since 2011-01-17 change to systty.h.
1760
ee1cf5cf
GM
1761 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
1762 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1763 Move HAVE_PTYS and HAVE_SOCKETS to configure.
1764
63e47e07
PE
17652012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1766
1767 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
1768
c43fb4c3
GM
17692012-07-11 Glenn Morris <rgm@gnu.org>
1770
1771 * s/darwin.h, s/gnu-linux.h, s/template.h:
1772 Move INTERRUPT_INPUT to configure.
1773
e8df9267
DA
17742012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1775
1776 Minor adjustments to interning code.
1777 * lisp.h (intern, intern_c_string): Redefine as static inline
1778 wrappers for intern_1 and intern_c_string_1, respectively.
1779 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
1780 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1781 Vobarray checking.
e8df9267
DA
1782 * font.c (font_intern_prop): Likewise. Adjust comment.
1783 * w32font.c (intern_font_name): Likewise.
1784
34348bd4
AS
17852012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1786
d96a1e0c
AS
1787 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1788
34348bd4
AS
1789 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1790 of Fcar/Fcdr if possible.
1791 * font.c (check_otf_features): Likewise.
1792 * fontset.c (Fnew_fontset): Likewise.
1793 * gnutls.c (Fgnutls_boot): Likewise.
1794 * minibuf.c (read_minibuf): Likewise.
1795 * msdos.c (IT_set_frame_parameters): Likewise.
1796 * xmenu.c (Fx_popup_dialog): Likewise.
1797 * w32menu.c (Fx_popup_dialog): Likewise.
1798
c8add24e
GM
17992012-07-11 Glenn Morris <rgm@gnu.org>
1800
4b575b3c
GM
1801 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1802 since nothing has defined it on these platforms.
1803
09f4e3b0
GM
1804 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1805 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1806
172bedef
GM
1807 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1808 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1809 Move CLASH_DETECTION to configure.
1810
249685df
GM
1811 * s/gnu.h: Remove file, which is now empty.
1812
c8add24e
GM
1813 * s/gnu.h, s/gnu-linux.h:
1814 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1815
b41253a3
JW
18162012-07-11 John Wiegley <johnw@newartisans.com>
1817
1818 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1819 function attribute, so we only use it if it exists in the
1820 compiler.
1821
d923b542
DA
18222012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1823
1824 Avoid call to strlen in fast_c_string_match_ignore_case.
1825 * search.c (fast_c_string_match_ignore_case): Change to use
1826 length argument. Adjust users accordingly.
1827 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1828
5ebbef1d
PE
18292012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1830
bb352260
PE
1831 Assume mkdir, rmdir.
1832 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1833 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1834
57054ddd
PE
1835 Assume rename.
1836 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1837
b747d3f7
PE
1838 Assume perror.
1839 * s/hpux10-20.h (HAVE_PERROR): Remove.
1840 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1841 Remove dummy definition, as this problem was obsolete long ago.
1842
5ebbef1d
PE
1843 Assume strerror.
1844 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1845
984e7f30
DA
18462012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1847
1848 Avoid calls to strlen in font processing functions.
1849 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 1850 (font_open_by_name): Change to use length argument. Adjust
984e7f30 1851 users accordingly.
d923b542
DA
1852 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1853 Adjust prototypes.
1854 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1855 Change to return ptrdiff_t.
984e7f30
DA
1856 (xfont_list_pattern, xfont_match): Use length returned by
1857 xfont_decode_coding_xlfd.
1858 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1859
20e94fdd
GM
18602012-07-11 Glenn Morris <rgm@gnu.org>
1861
9d596af3
GM
1862 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1863 Move DONT_REOPEN_PTY to configure.
1864
20e94fdd
GM
1865 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1866 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1867
e99a530f
PE
18682012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1869
22ffb973
PE
1870 Remove "#define unix" that is no longer needed (Bug#11905).
1871 * s/aix4-2.h (unix): Remove; no longer needed.
1872
e9a9ae03
PE
1873 EMACS_TIME simplification (Bug#11875).
1874 This replaces macros (which typically do not work in GDB)
1875 with functions, typedefs and enums, making the code easier to debug.
1876 The functional style also makes code easier to read and maintain.
1877 * systime.h: Include <sys/time.h> on all hosts, not just if
1878 WINDOWSNT, since 'struct timeval' is needed in general.
1879 (EMACS_TIME): Now a typedef, not a macro.
1880 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1881 not macros.
1882 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1883 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1884 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1885 (EMACS_TIME_LE): Now functions, not macros.
1886 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1887 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1888 which are not functions. All uses rewritten to use:
1889 (make_emacs_time): New function.
1890 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1891 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1892 not functions. All uses rewritten to use the following, respectively:
1893 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1894 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 1895 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
1896 * fileio.c (Fcopy_file):
1897 * xterm.c (XTflash): Get the current time closer to when it's used.
1898 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1899
ffacb126
PE
1900 * bytecode.c (targets): Suppress -Woverride-init warnings.
1901
e99a530f
PE
1902 Simplify by avoiding confusing use of strncpy etc.
1903 * doc.c (Fsnarf_documentation):
1904 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1905 * frame.c (Fmake_terminal_frame):
1906 * gtkutil.c (get_utf8_string):
1907 * lread.c (openp):
1908 * nsmenu.m (ns_update_menubar):
1909 * regex.c (regerror):
1910 Prefer memcpy to strncpy and strncat when either will do.
1911 * fileio.c (Fsubstitute_in_file_name):
1912 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1913 (menu_separator_name_p):
1914 * nsmenu.m (ns_update_menubar):
1915 Prefer memcmp to strncmp when either will do.
1916 * nsterm.m: Include <ftoastr.h>.
1917 (ns_get_color):
1918 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1919 Prefer snprintf to strncpy.
1920 * nsterm.m (ns_term_init):
1921 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1922 * nsterm.m (ns_term_init):
1923 Avoid the need for strncpy, by using build_string or
1924 make_unibyte_string directly. Use dtoastr, not snprintf.
1925 * process.c (Fmake_network_process): Diagnose service names that
1926 are too long, rather than silently truncating them or creating
1927 non-null-terminated names.
1928 (Fnetwork_interface_info): Likewise, for interface names.
1929 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1930 Prefer sprintf to strncat.
1931 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1932 Prefer vsnprintf to vsprintf + strncpy.
1933
c59592b3
GM
19342012-07-10 Glenn Morris <rgm@gnu.org>
1935
1936 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1937 Clarify fallback case.
1938
7d7bbefd
DA
19392012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1940
1941 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1942 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1943 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 1944 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
1945 where argument type is known to be a Lisp_Cons.
1946
3a4c8000
TT
19472012-07-10 Tom Tromey <tromey@redhat.com>
1948
1949 * bytecode.c (BYTE_CODE_THREADED): New macro.
1950 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1951 (enum byte_code_op): New type.
1952 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1953 (exec_byte_code): Use them. Use token threading when applicable.
1954
2a0213a6
DA
19552012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1956
1957 Optimize pure C strings initialization.
1958 * lisp.h (make_pure_string): Fix prototype.
1959 (build_pure_c_string): New function, defined as static inline. This
1960 provides a better opportunity to optimize away calls to strlen when
1961 the function is called with compile-time constant argument.
1962 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1963 argument, adjust users accordingly. Use build_pure_c_string where
1964 appropriate.
1965 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1966 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1967 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1968
cb1caeaf
DA
19692012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1970
1971 Avoid calls to strlen in miscellaneous functions.
1972 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1973 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1974 * lread.c (openp): Likewise.
1975
c293e30c
DA
19762012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1977
1978 Avoid calls to strlen in path processing functions.
1979 * fileio.c (file_name_as_directory): Add comment. Change to add
1980 srclen argument and return the length of result. Adjust users
1981 accordingly.
1982 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 1983 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
1984 users accordingly.
1985 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1986
9e059e3f
GM
19872012-07-10 Glenn Morris <rgm@gnu.org>
1988
d02eb359
GM
1989 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1990 Move PENDING_OUTPUT_COUNT definition to configure.
1991
882cf227
GM
1992 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1993 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1994 * s/gnu.h (DATA_START): Move definitions to configure.
1995
af6e839f
GM
1996 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1997 We include usg5-4-common.h, which defines them both.
1998
40289a12
GM
1999 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2000 O_RDONLY already includes it).
2001
9e059e3f
GM
2002 Stop ns builds setting the EMACSLOADPATH environment variable.
2003 * nsterm.m (ns_load_path): Rename from ns_init_paths.
2004 Now it does not set EMACSLOADPATH, just returns the load-path string.
2005 * nsterm.h: Update accordingly.
2006 * lread.c [HAVE_NS]: Include nsterm.h.
2007 (init_lread) [HAVE_NS]: Use ns_load_path.
2008 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2009
7c4e8ec0
GM
20102012-07-09 Glenn Morris <rgm@gnu.org>
2011
d4f600ff
GM
2012 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2013 since the included bsd-common.h does so.
2014
cbb31951
GM
2015 Stop ns builds setting the EMACSPATH environment variable.
2016 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2017 (ns_init_paths): Do not set EMACSPATH.
2018 * nsterm.h (ns_exec_path): Add it.
2019 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2020 Use ns_exec_path.
2021
7c4e8ec0
GM
2022 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2023
26bccfae
PE
20242012-07-09 Paul Eggert <eggert@cs.ucla.edu>
2025
a0bee46f
PE
2026 * process.c (wait_reading_process_output): 'waitchannels' was unset
2027 when read_kbd || !NILP (wait_for_cell); fix this.
2028
5994c183
PE
2029 Add GCC-style 'const' attribute to functions that can use it.
2030 * character.h (char_resolve_modifier_mask):
2031 * keyboard.h (make_ctrl_char):
2032 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2033 (init_character_once, next_almost_prime, init_fns, init_image)
2034 (flush_pending_output, init_sound):
2035 * mem-limits.h (start_of_data):
2036 * menu.h (finish_menu_items):
2037 Add ATTRIBUTE_CONST.
2038 * emacs.c (DEFINE_DUMMY_FUNCTION):
2039 Declare the dummy function with ATTRIBUTE_CONST.
2040 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2041 Add decls with ATTRIBUTE_CONST.
2042
26bccfae
PE
2043 Minor improvements to make_formatted_string.
2044 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2045 where int is good enough, as vsprintf returns an int.
2046 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
2047
a8290ec3
DA
20482012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2049
2050 Use make_formatted_string to avoid double length calculation.
2051 * lisp.h (make_formatted_string): New prototype.
2052 * alloc.c (make_formatted_string): New function.
2053 * buffer.c (Fgenerate_new_buffer_name): Use it.
2054 * dbus.c (syms_of_dbusbind): Likewise.
2055 * editfns.c (Fcurrent_time_zone): Likewise.
2056 * filelock.c (get_boot_time): Likewise.
2057 * frame.c (make_terminal_frame, set_term_frame_name)
2058 (x_report_frame_params): Likewise.
2059 * image.c (gs_load): Likewise.
2060 * minibuf.c (get_minibuffer): Likewise.
2061 * msdos.c (dos_set_window_size): Likewise.
2062 * process.c (make_process): Likewise.
2063 * xdisp.c (ensure_echo_area_buffers): Likewise.
2064 * xsettings.c (apply_xft_settings): Likewise.
2065
d01ba2f1
GM
20662012-07-09 Glenn Morris <rgm@gnu.org>
2067
2068 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
2069 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
2070 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
2071 * nsterm.h (ns_etc_directory): Add it.
2072 * callproc.c [HAVE_NS]: Include nsterm.h.
2073 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
2074
f1f924b6
DA
20752012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2076
2077 Move marker debugging code under MARKER_DEBUG.
2078 * marker.c (MARKER_DEBUG): Move marker debugging code under
2079 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
2080 for bootstrap with --enable-checking (~3x slowdown reported
2081 by Juanma Barranquero <lekktu@gmail.com>).
2082 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
2083
ab531b66
PE
20842012-07-08 Paul Eggert <eggert@cs.ucla.edu>
2085
2086 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
2087 See <http://bugs.gnu.org/11825#29>.
2088
c4b3bc8a
EZ
20892012-07-08 Eli Zaretskii <eliz@gnu.org>
2090
2091 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
2092 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
2093 (display_line): Add commentary about displaying truncation glyphs
2094 on GUI frames.
2095 (produce_special_glyphs): Move here from term.c.
2096
2097 * term.c (produce_special_glyphs): Move to xdisp.c.
2098
2099 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
2100 section.
c4b3bc8a 2101
b676b881
AS
21022012-07-07 Andreas Schwab <schwab@linux-m68k.org>
2103
f17c5273
AS
2104 * xdisp.c (display_line): Avoid warning about implicit declaration
2105 of FRAME_FONT.
2106
298819b9
AS
2107 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
2108
b676b881
AS
2109 * lisp.h: Remove empty conditional.
2110
6045c4fd
PE
21112012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2112
b3350bf9
PE
2113 * lread.c (load_path_check): Now static.
2114
6045c4fd
PE
2115 Fix some minor --with-ns problems found by static checking.
2116 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
2117 (x_set_font) [!HAVE_X_WINDOWS]:
2118 * image.c (xpm_load_image) [HAVE_NS]:
2119 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
2120 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
2121 Remove unused local.
2122 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
2123 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
2124 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
2125 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
2126 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
2127 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
2128 Fix pointer signedness problem.
2129 * xfaces.c (FRAME_X_FONT_TABLE):
2130 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
2131
929e7845
GM
21322012-07-07 Glenn Morris <rgm@gnu.org>
2133
2134 * lread.c (load_path_check): New function, split from init_lread.
2135 (init_lread): Reorganize. Motivation:
2136 If EMACSLOADPATH is set, check/warn about that rather than the
2137 defaults, which we are not going to use. Hence we can remove
2138 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
2139 Don't warn if site-lisp directories are missing.
2140 If not installed, start from a blank load-path, since
2141 PATH_LOADSEARCH refers to the eventual installation directories.
2142
58dd0aa4
EZ
21432012-07-07 Eli Zaretskii <eliz@gnu.org>
2144
2145 Support truncation and continuation glyphs on GUI frames, when
2146 fringes are disabled. (Bug#11832)
2147 * xdisp.c (init_iterator): Get dimensions of truncation and
2148 continuation glyphs even if on GUI frames. Adjust
2149 it->last_visible_x on GUI frames when the left or right fringes,
2150 or both, are absent.
2151 (start_display, move_it_in_display_line_to): Handle the case of a
2152 GUI frame without a fringe to display continuation or truncation
2153 glyphs.
2154 (insert_left_trunc_glyphs): Support GUI frames: make sure
2155 truncation glyphs overwrite enough glyphs from the current line to
2156 have sufficient space in pixels.
2157 (display_line): Support truncation and continuation glyphs on GUI
2158 frames. If some spare pixels are left on the line after inserting
2159 the truncation glyphs, fill that space with a stretch glyph of a
2160 suitably computed width.
2161
2162 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
2163 produce_glyphs, to support GUI sessions.
2164
31571fd7
PE
21652012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2166
5a16b9bc
PE
2167 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
2168
f3047c75
PE
2169 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
2170
31571fd7
PE
2171 Do not require float-time's arg to fit in time_t (Bug#11825).
2172 This works better on hosts where time_t is unsigned, and where
2173 float-time is applied to the (negative) difference between two times.
2174 * editfns.c (decode_time_components): Last arg is now double *,
2175 not int *, and means to store all the result as a double, without
2176 worrying about whether the seconds part fits in time_t.
2177 All callers changed.
2178 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
2179 All callers changed.
2180 (Ffloat_time): Do not fail merely because the specified time falls
2181 outside of time_t range.
2182
4516fbef
GM
21832012-07-07 Glenn Morris <rgm@gnu.org>
2184
2185 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
2186 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
2187 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
2188
07adc2c6
JB
21892012-07-07 Juanma Barranquero <lekktu@gmail.com>
2190
2191 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
2192 Update dependencies.
2193
2194 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
2195
fd573f31
PE
21962012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2197
fee5959d
PE
2198 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
2199 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
2200 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
2201 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
2202 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
2203 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
2204
fd573f31
PE
2205 * xfont.c (compare_font_names): Redo to omit the need for casts.
2206
ddadbc0e
AS
22072012-07-06 Andreas Schwab <schwab@linux-m68k.org>
2208
fca8d6b6
AS
2209 * xfns.c (Fx_change_window_property): Doc fix.
2210 * w32fns.c (Fx_change_window_property): Doc fix.
2211
ddadbc0e
AS
2212 * w32fns.c (Fx_window_property): Accept the same arguments as the
2213 X Windows version. Doc fix.
2214 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
2215
ed9265fc 22162012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
2217 Eli Zaretskii <eliz@gnu.org>
2218
2219 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
2220 Windows-specific code from nt/config.nt moved here.
2221 Obsolete settings removed.
2222
216ee680
PE
22232012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2224
2225 * process.c: Avoid unnecessary calls to gettime.
2226 (wait_reading_process_output): Don't get the time of day
2227 when gobbling data immediately and not waiting, as there's no need
2228 for it in that case. This removes a FIXME.
2229
bdd091e4
JD
22302012-07-06 Jan Djärv <jan.h.d@swipnet.se>
2231
2232 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
2233 is defined (Bug#11768).
2234
9d44f8ce
DA
22352012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2236
2237 Fix marker debugging code.
2238 * marker.c (byte_char_debug_check): Do not perform the check
2239 if buffer is not multibyte.
090bd7cb
JB
2240 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2241 Call byte_char_debug_check with correct arguments.
9d44f8ce 2242
90fc4786
DA
22432012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2244
2245 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
2246 * marker.c (byte_char_debug_check, count_markers):
2247 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
2248 (byte_debug_flag): Remove.
2249 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2250 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
2251
7b7ae965
DA
22522012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2253
4e57b342
DA
2254 Avoid code repetition in marker-related functions.
2255 * marker.c (attach_marker): New function.
2256 (Fset_marker, set_marker_restricted, set_marker_both)
2257 (set_marker_restricted_both): Use it.
2258 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
2259 Consistently rename charno to charpos.
2260 (marker_position): Add eassert.
2261 (marker_byte_position): Convert to eassert.
2262
22632012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2264
2265 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 2266 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 2267 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 2268
657924ff
DA
22692012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2270
2271 Introduce fast path for the widely used marker operation.
2272 * alloc.c (build_marker): New function.
2273 * lisp.h (build_marker): New prototype.
2274 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
2275 * composite.c (autocmp_chars): Likewise.
2276 * editfns.c (buildmark): Remove.
2277 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
2278 (save_restriction_save): Use build_marker.
2279 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
2280 * window.c (save_window_save): Likewise.
2281
041a49a6
DA
22822012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2283
2284 Do not use Fdelete_overlay in delete_all_overlays
2285 to avoid redundant calls to unchain_overlay.
2286 * buffer.c (drop_overlay): New function.
2287 (delete_all_overlays, Fdelete_overlay): Use it.
2288 * minibuf.c (get_minibuffer): Fix comment.
2289
7dca65a4
PE
22902012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2291
2292 Port to OpenBSD 5.1 amd64.
2293 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
2294 This is needed for OpenBSD, and should be harmless on all BSD systems.
2295 Also, include <sys/sysctl.h>, as it should be available on all
2296 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
2297 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
2298 use p_pid member, not kp_proc.pid.
2299
8eb876e2
GM
23002012-07-06 Glenn Morris <rgm@gnu.org>
2301
2302 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
2303
38182d90
PE
23042012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2305
2306 More xmalloc and related cleanup.
2307 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
2308 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
2309 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
2310 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
2311 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
2312 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
2313 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
2314 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
2315 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
2316 * xterm.c:
2317 Omit needless casts involving void * pointers and allocation.
2318 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
2319 as the former is more robust if P's type is changed.
2320 Prefer xzalloc to xmalloc + memset 0.
2321 Simplify malloc-or-realloc to realloc.
2322 Don't worry about xmalloc returning a null pointer.
2323 Prefer xstrdup to xmalloc + strcpy.
2324 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
2325 growing it.
2326 * keyboard.c (apply_modifiers_uncached): Prefer local array to
2327 alloca of a constant.
2328
6dd5a677
EZ
23292012-07-05 Eli Zaretskii <eliz@gnu.org>
2330
2331 * xdisp.c (display_line): Fix horizontal pixel coordinates when
2332 hscroll is larger than the line width. Fixes long and futile
2333 looping inside extend_face_to_end_of_line (on a TTY) producing
2334 glyphs that are not needed and thrown away.
2335
6b312f0f
DA
23362012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2337
2338 * marker.c (set_marker_restricted_both): Simplify by using
2339 clip_to_bounds.
2340
f520ef9b
PE
23412012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2342
2343 * editfns.c (region_limit): Simplify by using clip_to_bounds.
2344
383b7c95
JD
23452012-07-05 Jan Djärv <jan.h.d@swipnet.se>
2346
2347 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
2348 not defined (Bug#11768).
2349 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
2350 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
2351 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
2352 followed by gtk_box_set_homogeneous (Bug#11768).
2353 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
2354 (update_theme_scrollbar_width, xg_create_scroll_bar):
2355 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
2356 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
2357 (is_box_type): New function (Bug#11768).
2358 (xg_tool_item_stale_p): Call is_box_type.
5293d758 2359 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
2360 with default display (Bug#11768).
2361
d6e7bf45
EZ
23622012-07-05 Eli Zaretskii <eliz@gnu.org>
2363
2364 * xdisp.c (window_hscroll_limited): New function.
2365 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
2366 coordinates when window's hscroll is set to insanely large
2367 values. (Bug#11857)
2368
431391ec
JB
23692012-07-05 Juanma Barranquero <lekktu@gmail.com>
2370
2371 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
2372 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
2373
23f86fce
DA
23742012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2375
2376 Cleanup xmalloc.
2377 * lisp.h (xzalloc): New prototype. Omit needless casts.
2378 * alloc.c (xzalloc): New function. Omit needless casts.
2379 * charset.c: Omit needless casts. Convert all calls to
2380 xmalloc with following memset to xzalloc.
2381 * dispnew.c: Likewise.
2382 * fringe.c: Likewise.
2383 * image.c: Likewise.
2384 * sound.c: Likewise.
2385 * term.c: Likewise.
2386 * w32fns.c: Likewise.
2387 * w32font.c: Likewise.
2388 * w32term.c: Likewise.
2389 * xfaces.c: Likewise.
2390 * xfns.c: Likewise.
2391 * xterm.c: Likewise.
2392 * atimer.c: Omit needless casts.
2393 * buffer.c: Likewise.
2394 * callproc.c: Likewise.
2395 * ccl.c: Likewise.
2396 * coding.c: Likewise.
2397 * composite.c: Likewise.
2398 * doc.c: Likewise.
2399 * doprnt.c: Likewise.
2400 * editfns.c: Likewise.
2401 * emacs.c: Likewise.
2402 * eval.c: Likewise.
2403 * filelock.c: Likewise.
2404 * fns.c: Likewise.
2405 * gtkutil.c: Likewise.
2406 * keyboard.c: Likewise.
2407 * lisp.h: Likewise.
2408 * lread.c: Likewise.
2409 * minibuf.c: Likewise.
2410 * msdos.c: Likewise.
2411 * print.c: Likewise.
2412 * process.c: Likewise.
2413 * region-cache.c: Likewise.
2414 * search.c: Likewise.
2415 * sysdep.c: Likewise.
2416 * termcap.c: Likewise.
2417 * terminal.c: Likewise.
2418 * tparam.c: Likewise.
2419 * w16select.c: Likewise.
2420 * w32.c: Likewise.
2421 * w32reg.c: Likewise.
2422 * w32select.c: Likewise.
2423 * w32uniscribe.c: Likewise.
2424 * widget.c: Likewise.
2425 * xdisp.c: Likewise.
2426 * xmenu.c: Likewise.
2427 * xrdb.c: Likewise.
2428 * xselect.c: Likewise.
2429
0497dc44
PE
24302012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2431
2432 * fileio.c (time_error_value): Check the right error number.
2433 Problem reported by Troels Nielsen in
2434 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
2435
356e7178
PE
24362012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2437
4e71fd89
PE
2438 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
2439 This should be fixed in a better way; see Eli Zaretskii in
2440 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
2441 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
2442
f0941253
PE
2443 * fileio.c (time_error_value): Rename from special_mtime.
2444 The old name's problems were noted by Eli Zaretskii in
2445 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
2446
065c9eb4
PE
2447 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
2448 This variable's comment says Emacs needs at least one GDB-visible
2449 symbol of type enum pvec_type, to work around GDB problems.
2450 The symbol's value doesn't matter.
2451
356e7178
PE
2452 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
2453 that causes compilation to fail on pre-C99 compilers.
2454
ed9265fc 24552012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
2456
2457 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
2458 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
2459
3884d954
DA
24602012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2461
d209e2fb 2462 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
2463 headers for buffer_defaults and buffer_local_symbols.
2464 Reported by Juanma Barranquero <lekktu@gmail.com>.
2465
ee28be33
SM
24662012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
2467
2468 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
2469 * lisp.h (enum pvec_type): Use fewer bits.
2470 (PSEUDOVECTOR_SIZE_BITS): New constant.
2471 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
2472 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
2473 change in pvec_type.
2474 (PSEUDOVECTOR_TYPEP): New macro.
2475 (TYPED_PSEUDOVECTORP): Use it.
2476 * fns.c (internal_equal): Adapt code to extract pvectype.
2477 * emacs.c (gdb_pvec_type): Update type.
2478 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
2479 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
2480 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
2481 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
2482 (sweep_vectors): Use it. Use local var `total_bytes' instead of
2483 abusing vector->header.next.nbytes.
2484 (live_vector_p): Use PVEC_TYPE.
2485 (mark_object): Adapt code to extract pvectype. Use switch.
2486
c7f2cd7f
PE
24872012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2488
2489 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
2490 Tighten new eassert a bit.
2491
8ce70ed2
DA
24922012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2493
2494 Fix compilation with --enable-gcc-warnings and -O1
2495 optimization level.
2496 * doprnt.c (doprnt): Change type of tem to int, initialize
2497 to avoid compiler warning. Add eassert.
2498 * search.c (simple_search): Initialize match_byte to avoid
2499 compiler warning. Add eassert.
2500
dea7f1e5
PE
25012012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2502
24a212eb
PE
2503 Avoid weird behavior with large horizontal scrolls.
2504 Without this change, for example, large hscroll values would
2505 mess up Emacs's display on Fedora 15 x86, presumably due to
2506 overflows in int calculations in the display code.
2507 Also, if buffers had long lines, Emacs would freeze.
2508 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
2509 (set_window_hscroll): New function, containing the old guts of
2510 Fset_window_hscroll. Return the clipped value.
2511 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
2512 This avoids the need to check against PTRDIFF_MAX.
2513
dea7f1e5
PE
2514 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
2515
76046526
DA
25162012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2517
2518 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
2519
39adff0d
PE
25202012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2521
63807d47
PE
2522 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
2523 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
2524 since GCC 4.4.6 issues a bogus warning for them.
2525
39adff0d
PE
2526 Fix bugs in file timestamp newness comparisons.
2527 * fileio.c (Ffile_newer_than_file_p):
2528 * lread.c (Fload): Use full timestamp resolution of files,
2529 not just the 1-second resolution, so that files that are only
2530 slightly newer still count as newer.
2531 * fileio.c (Ffile_newer_than_file_p): Don't assume file
2532 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
2533
dbeed9a6
PE
25342012-07-03 Paul Eggert <eggert@cs.ucla.edu>
2535
2536 * fileio.c: Improve handling of file time marker. (Bug#11852)
2537 (special_mtime): New function.
2538 (Finsert_file_contents, Fverify_visited_file_modtime):
2539 Use it to set special mtime values consistently.
2540
636334d6
AS
25412012-07-03 Andreas Schwab <schwab@linux-m68k.org>
2542
2543 * fileio.c (Finsert_file_contents): Properly handle st_mtime
2544 marker for non-existing file. (Bug#11852)
2545
e2017fe2
GM
25462012-07-03 Glenn Morris <rgm@gnu.org>
2547
2548 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
2549 and did not make it into globals.h).
2550
404dbd37
TT
25512012-07-03 Tom Tromey <tromey@redhat.com>
2552
2553 * window.c (Fset_window_margins, Fset_window_fringes)
2554 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
2555 * textprop.c (Fprevious_property_change): No longer static.
2556 * syntax.c (Fsyntax_table_p): No longer static.
2557 * process.c (Fget_process, Fprocess_datagram_address): No longer
2558 static.
2559 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
2560 * keyboard.c (Fcommand_execute): No longer static.
2561 Remove EXFUN.
2562 * insdel.c (Fcombine_after_change_execute): No longer static.
2563 * image.c (Finit_image_library): No longer static.
2564 * fileio.c (Fmake_symbolic_link): No longer static.
2565 * eval.c (Ffetch_bytecode): No longer static.
2566 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
2567 * doc.c (Fdocumentation_property, Fsnarf_documentation):
2568 No longer static.
404dbd37
TT
2569 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
2570 static.
2571 * dired.c (Ffile_attributes): No longer static.
2572 * composite.c (Fcomposition_get_gstring): No longer static.
2573 * callproc.c (Fgetenv_internal): No longer static.
2574
2575 * ccl.h: Remove EXFUNs.
2576 * buffer.h: Remove EXFUNs.
2577 * dispextern.h: Remove EXFUNs.
2578 * intervals.h: Remove EXFUNs.
2579 * fontset.h: Remove EXFUN.
2580 * font.h: Remove EXFUNs.
2581 * dosfns.c (system_process_attributes): Remove EXFUN.
2582 * keymap.h: Remove EXFUNs.
2583 * lisp.h: Remove EXFUNs.
2584 * w32term.h: Remove EXFUNs.
2585 * window.h: Remove EXFUNs.
2586 * xsettings.h: Remove EXFUN.
2587 * xterm.h: Remove EXFUN.
2588
8e4fd1e1
GM
25892012-07-03 Glenn Morris <rgm@gnu.org>
2590
2591 * lisp.h (Frandom): Make it visible to C.
2592 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
2593 buffer for invisible buffers. (Bug#1229)
2594
ca95b3eb
DA
25952012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2596
2597 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
2598 values which aren't power of 2.
2599 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
2600 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
2601 accordingly.
2602
7555c33f
SM
26032012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
2604
2605 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
2606
2607 * alloc.c (mark_object): Revert part of last patch to use `switch'.
2608
d12e8f5a
DA
26092012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2610
2611 * alloc.c (allocate_vector_block): Remove redundant
2612 calls to mallopt if DOUG_LEA_MALLOC is defined.
2613 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
2614 avoid calls to mallopt if zero_vector is returned.
2615
296094c3
DA
26162012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2617
2618 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2619 is enabled, avoid dereferencing NULL current_sblock if
2620 running undumped.
2621
36429c89
DA
26222012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2623
2624 Cleanup basic buffer management.
2625 * buffer.h (struct buffer): Change layout to use generic vector
2626 marking code. Fix some comments. Change type of 'clip_changed'
2627 to bitfield. Remove unused #ifndef old.
2628 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2629 (GET_OVERLAYS_AT): Fix indentation.
2630 (for_each_per_buffer_object_at): New macro.
2631 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2632 (Fbuffer_local_variables): Use it.
2633 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2634 * alloc.c (allocate_buffer): Adjust to match new layout of
2635 struct buffer. Fix comment.
2636 (mark_overlay): New function.
2637 (mark_buffer): Use it. Use mark_vectorlike to mark normal
2638 Lisp area of struct buffer.
2639 (mark_object): Use it. Adjust marking of misc objects
2640 and related comments.
2641
3b3e4cac
PE
26422012-07-02 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2645 wrapper that is not needed because the wrapped code is a no-op (zero
2646 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2647 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2648
cf5c0175
DA
26492012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
2650
2651 * alloc.c (mark_buffer): Simplify. Remove prototype.
2652 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 2653 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
2654 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
2655 redundant calls to mark_vectorlike for bool vectors.
2656
ca26824c
GM
26572012-06-30 Glenn Morris <rgm@gnu.org>
2658
2e4c5312
GM
2659 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2660
ca26824c
GM
2661 * epaths.in (PATH_SITELOADSEARCH): New.
2662 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2663 This is rather than relying on --enable-locallisppath elements
2664 having "site-lisp" in their names. (Bug#10208#25, 11658)
2665
0d23c240
EZ
26662012-06-30 Eli Zaretskii <eliz@gnu.org>
2667
c9240d7a
EZ
2668 * w32proc.c (sys_select): Accept and ignore one more argument.
2669
2670 * w32.c (emacs_gnutls_pull): Call select with one more argument.
2671
0d23c240 2672 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 2673 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
2674
2675 * sysdep.c: Don't include dos.h and dosfns.h.
2676
2677 * process.c (sys_select):
2678 * msdos.c (sys_select): Accept one more argument and ignore it.
2679
2680 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2681 adapt data types and code to that.
2682
2683 * dosfns.c:
2684 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2685 which clashes with the gnulib function of the same name.
2686
af5a5a98
AS
26872012-06-30 Andreas Schwab <schwab@linux-m68k.org>
2688
c5e4379c
AS
2689 * font.c (font_style_to_value, font_style_symbolic)
2690 (font_prop_validate_style): Add type checks for values in
2691 font_style_table.
2692
af5a5a98
AS
2693 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2694 argument.
2695 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2696 uses.
2697
8d38f461
EZ
26982012-06-29 Eli Zaretskii <eliz@gnu.org>
2699
2e5a6631
EZ
2700 * xdisp.c (try_window_id): Undo last change.
2701
8d38f461
EZ
2702 * w32.c (getwd): Adjust commentary about startup_dir.
2703 (init_environment): Always call sys_access, even in non-MSVC
2704 builds. Don't chdir to the directory of the Emacs executable.
2705 This undoes code from 1997 which was justified by the need to
2706 "avoid conflicts when removing and renaming directories". But its
2707 downside was that every relative file name was being interpreted
2708 relative to the directory of the Emacs executable, which can never
2709 be TRT. In particular, it broke sys_access when called with
2710 relative file names.
2711 (sys_access): Map GetLastError to errno.
2712
2af3565e
DA
27132012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2714
2715 * window.h (struct window): Change type of 'fringes_outside_margins'
2716 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 2717 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
2718 Adjust comment.
2719 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2720 to ptrdiff_t.
2721
c8d3a25c 27222012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 2723
c8d3a25c
GM
2724 * gnutls.c (emacs_gnutls_handshake):
2725 Add QUIT to make the loop interruptible.
57570cd3 2726
c8d3a25c 27272012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 2728
c8d3a25c
GM
2729 * charset.c (init_charset): Make lack of etc/charsets fatal.
2730
3e984ee8
DA
27312012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2732
2733 * editfns.c (region_limit): Fix type mismatch.
2734
ef884f23
DA
27352012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2736
2737 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2738 undefined. Convert from xassert to eassert.
2739 * nsmenu.m: Convert from xassert to eassert.
2740 * nsterm.m: Likewise.
2741
7d7e0027
SM
27422012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
2743
2744 * editfns.c (region_limit): Clip to narrowing (bug#11770).
2745
aa754e6a
PE
27462012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2747
2748 Avoid integer overflow on scroll-left and scroll-right.
2749 * window.c (HSCROLL_MAX): New macro.
2750 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2751 overflow when requested scroll falls outside ptrdiff_t range.
2752
80b00b08
DA
27532012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2754
2755 * window.h (struct window): Change type of 'hscroll',
2756 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2757 'last_modified' and 'last_overlay_modified' to EMACS_INT.
2758 Adjust users accordingly.
2759 * xdisp.c (try_cursor_movement): Replace type check with eassert.
2760 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
2761 from EMACS_INT to ptrdiff_t.
2762 (make_window): Omit redundant initialization.
2763
62b2bcf6
JB
27642012-06-28 Juanma Barranquero <lekktu@gmail.com>
2765
2766 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2767
45942c7d
DA
27682012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2769
2770 * window.h (struct window): Change type of 'use_time' and
2771 'sequence_number' from Lisp_Object to int.
2772 * frame.c (make_frame): Adjust users accordingly.
2773 * print.c (print_object): Likewise.
2774 * window.c (select_window, Fwindow_use_time, make_parent_window)
2775 (make_window): Likewise.
2776
e509cfa6
DA
27772012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2778
2779 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2780 enabled with --enable-checking=[all,glyphs] configure option.
2781 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2782 adjust comments accordingly.
2783 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2784 undefined, adjust comments accordingly.
2785 * image.c: Likewise.
2786 * scroll.c: Likewise.
2787 * w32fns.c: Likewise.
2788 * w32term.c: Likewise.
2789 * xdisp.c: Likewise.
2790 * xfaces.c: Likewise.
2791 * xfns.c: Likewise.
2792 * xterm.c: Likewise.
2793
a54e2c05
DA
27942012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2795
2796 Generalize run-time debugging checks.
2797 * dispextern.h (XASSERTS): Remove.
2798 * fontset.c (xassert): Remove.
2799 Convert from xassert to eassert.
2800 * alloc.c: Convert from xassert to eassert.
2801 * bidi.c: Likewise.
2802 * dispnew.c: Likewise.
2803 * fns.c: Likewise.
2804 * fringe.c: Likewise.
2805 * ftfont.c: Likewise.
2806 * gtkutil.c: Likewise.
2807 * image.c: Likewise.
2808 * keyboard.c: Likewise.
2809 * menu.c: Likewise.
2810 * process.c: Likewise.
2811 * scroll.c: Likewise.
2812 * sound.c: Likewise.
2813 * term.c: Likewise.
2814 * w32console.c: Likewise.
2815 * w32fns.c: Likewise.
2816 * w32term.c: Likewise.
2817 * window.c: Likewise.
2818 * xdisp.c: Likewise.
2819 * xfaces.c: Likewise.
2820 * xfns.c: Likewise.
2821 * xselect.c: Likewise.
2822 * xterm.c: Likewise.
2823
1ec4b7b2
SM
28242012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2825
2826 * fns.c (maybe_resize_hash_table): Output message when growing the
2827 purify-hashtable.
2828
2014308a
DA
28292012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2830
2831 * alloc.c (allocate_string_data): Remove dead code.
2832 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2833 avoid GCC warning about unused macro.
2834
246155eb
DA
28352012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2836
2837 * alloc.c (allocate_string): Omit intervals initialization.
2838 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2839 as in make_pure_string and make_pure_c_string.
2840
43184b7b
DA
28412012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2842
d209e2fb 2843 * alloc.c (allocate_string): Fix last change.
43184b7b 2844
3fe6dd74
DA
28452012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2846
d209e2fb 2847 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
2848 to memset, add explicit initialization where appropriate.
2849
1ba6038a
GM
28502012-06-27 Glenn Morris <rgm@gnu.org>
2851
2852 * lisp.mk (lisp): Remove paths.elc.
2853
c89926a5
CY
28542012-06-27 Chong Yidong <cyd@gnu.org>
2855
2856 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2857
ed6b3510
JW
28582012-06-26 John Wiegley <johnw@newartisans.com>
2859
1ec4b7b2 2860 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
2861 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2862
ed6b3510
JW
2863 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2864 when building with Clang.
2865
8edd4a2b
SM
28662012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2867
2868 * eval.c (Fapply): Allow calling it with a single argument.
2869
f6f62d1b
EZ
28702012-06-26 Eli Zaretskii <eliz@gnu.org>
2871
2872 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2873 _stricmp and _strnicmp.
2874 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2875
62efea5e
DA
28762012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2879 allocated window.
2880 (allocate_process): Likewise for new process.
8edd4a2b 2881 (allocate_terminal): Change to use offsetof.
62efea5e
DA
2882 (allocate_frame): Likewise.
2883 * frame.c (make_frame): Omit redundant initialization.
2884 * window.c (make_parent_window): Use memset.
2885 (make_window): Omit redundant initialization.
2886 * process.c (make_process): Omit redundant initialization.
2887 * terminal.c (create_terminal): Likewise.
2888
42997f4d
DA
28892012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2890
2891 * term.c (delete_tty): Remove redundant call to memset.
2892
1130ecfc
DA
28932012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2894
2895 * alloc.c: Remove build_string.
2896 * lisp.h: Define build_string as static inline. This provides
2897 a better opportunity to optimize away calls to strlen when the
2898 function is called with compile-time constant argument.
2899 * image.c (imagemagick_error): Convert to build_string.
2900 * w32proc.c (sys_spawnve): Likewise.
2901 * xterm.c (x_term_init): Likewise.
2902
cf38a720
PE
29032012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2904
99027bdd
PE
2905 Use sprintf return value instead of invoking strlen on result.
2906 In the old days this wasn't portable, since some sprintf
2907 implementations returned char *. But they died out years ago and
2908 Emacs already assumes sprintf returns int.
2909 Similarly for float_to_string.
2910 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2911 * ccl.c (ccl_driver):
2912 * character.c (string_escape_byte8):
2913 * data.c (Fnumber_to_string):
2914 * doprnt.c (doprnt):
2915 * print.c (print_object):
2916 * xdisp.c (message_dolog):
2917 * xfns.c (syms_of_xfns):
2918 Use sprintf or float_to_string result to avoid need to call strlen.
2919 * data.c (Fnumber_to_string):
2920 Use make_unibyte_string, since the string must be ASCII.
2921 * lisp.h, print.c (float_to_string): Now returns int length.
2922 * term.c (produce_glyphless_glyph):
2923 Use sprintf result rather than recomputing it.
2924
cf38a720
PE
2925 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2926 * Makefile.in (ALL_CFLAGS):
2927 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2928 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2929
3511c784
DA
29302012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2931
0a08eb21 2932 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
2933 strcasecmp if available.
2934 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2935
fb7da12e
AS
29362012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2937
2938 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2939 Avoid comma operator.
2940 * menu.c (push_submenu_start, push_submenu_end)
2941 (push_left_right_boundary, push_menu_pane): Likewise.
2942 * msdos.c (dos_rawgetc): Likewise.
2943
afa2ffd8
DA
29442012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2945
2946 * xfns.c (xic_create_fontsetname): Remove redundant calls
2947 to memset.
2948
b3b4476b
PE
29492012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2950
4495ff38
PE
2951 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2952 sprintf already null-terminates its output.
2953
b3b4476b
PE
2954 * xfns.c (x_window): Remove redundant cast.
2955
b00876c9
DA
29562012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2957
2958 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2959 `const char *' to `char *' to avoid compiler warning.
2960
d188e26b
PE
29612012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2962
885d1d74
PE
2963 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2964 instead of truncating it to 63 (admittedly a generous limit).
2965
d188e26b
PE
2966 * process.c: Fix spelling and caps in comments.
2967
e2f560b1
DN
29682012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2969
e86db54b 2970 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
2971 * sysdep.c (setpgrp): Remove definition, not used in this file.
2972
7583a3a1
JB
29732012-06-24 Juanma Barranquero <lekktu@gmail.com>
2974
2975 * makefile.w32-in: Update dependencies.
2976
696056c2
EZ
29772012-06-24 Eli Zaretskii <eliz@gnu.org>
2978
2979 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2980 (SYSTIME_H): Add nt/inc/sys/time.h.
2981
2982 * systime.h [WINDOWSNT]: Include sys/time.h.
2983
2984 * s/ms-w32.h (struct timespec): Definition moved from
2985 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2986
845ca893
PE
29872012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2988
2989 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2990 * buffer.h (buffer_slot_type_mismatch):
2991 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2992 * eval.c (unwind_to_catch):
2993 * image.c (my_png_error, my_error_exit):
2994 * keyboard.c (quit_throw_to_read_char, user_error)
2995 (Fexit_recursive_edit, Fabort_recursive_edit):
2996 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2997 (wrong_type_argument, buffer_overflow, __executable_start)
2998 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2999 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3000 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3001 (fatal):
3002 (child_setup) [!DOS_NT]:
3003 * lread.c (end_of_file_error, invalid_syntax):
3004 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3005 * puresize.h (pure_write_error):
3006 * search.c (matcher_overflow):
3007 * sound.c (sound_perror, alsa_sound_perror):
3008 * sysdep.c, syssignal.h (croak):
3009 * term.c (maybe_fatal, vfatal):
3010 * textprop.c (text_read_only):
3011 * undo.c (user_error):
3012 * unexmacosx.c (unexec_error):
3013 * xterm.c (x_ins_del_lines, x_delete_glyphs):
3014 Use _Noreturn rather than NO_RETURN.
3015 No need for separate decl merely because of _Noreturn.
3016 * sound.c (sound_warning, parse_sound):
3017 Remove unnecessary forward decls.
3018
f1dd8073
PE
30192012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3020
3021 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3022 * lisp.h (WAIT_READING_MAX): New macro.
3023 * dispnew.c (Fsleep_for, sit_for):
3024 * keyboard.c (kbd_buffer_get_event):
3025 * process.c (Faccept_process_output):
3026 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3027 This improves on the previous patch, which introduced a bug
3028 when time_t is unsigned and as wide as intmax_t.
3029 See <http://bugs.gnu.org/9000#51>.
3030
b82c1755
EZ
30312012-06-23 Eli Zaretskii <eliz@gnu.org>
3032
3033 * dispnew.c (sit_for, Fsleep_for):
3034 * keyboard.c (kbd_buffer_get_event):
3035 * process.c (Faccept_process_output): Avoid compiler warnings when
3036 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3037
ca300656
JB
30382012-06-23 Juanma Barranquero <lekktu@gmail.com>
3039
049ec95b
JB
3040 * makefile.w32-in: Update dependencies.
3041
ca300656
JB
3042 * w32.c (ltime): Add return type and declare static.
3043 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3044
db7b8d06
PE
30452012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3046
3047 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
3048 Privately reported by Herbert J. Skuhra.
3049 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
3050 All uses changed.
3051 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
3052 not make_lisp_timeval, when the argument is of type EMACS_TIME.
3053
0bd8297f
EZ
30542012-06-23 Eli Zaretskii <eliz@gnu.org>
3055
96512555
EZ
3056 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
3057 last argument of make_unibyte_string.
3058
0bd8297f
EZ
3059 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
3060 language ID in the event parameters.
3061
3062 * w32term.c (w32_read_socket): Put the new keyboard codepage into
3063 event.code, not the obscure "character set ID".
3064
63def6b6
CY
30652012-06-23 Chong Yidong <cyd@gnu.org>
3066
3067 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
3068
e8a02204
EZ
30692012-06-23 Eli Zaretskii <eliz@gnu.org>
3070
388cdec0
EZ
3071 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
3072 * w32.c (fdutimens): New function.
3073
3074 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
3075
3076 * s/ms-w32.h (pselect): Redirect to sys_select.
3077
3078 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
3079
e8a02204
EZ
3080 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
3081 in the logic of incrementing and decrementing the value of
3082 use_relocatable_buffers.
3083
d054f3fb
PE
30842012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3085
3086 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
3087 Privately reported by Herbert J. Skuhra.
3088 [__FreeBSD__]: Remove "*/" typo after "#include".
3089 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
3090 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
3091 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
3092 Don't assume EMACS_TIME and struct timeval are the same type.
3093
d35af63c
PE
30942012-06-22 Paul Eggert <eggert@cs.ucla.edu>
3095
3096 Support higher-resolution time stamps (Bug#9000).
3097 The time stamps are only nanosecond-resolution at the C level,
3098 since that's the best that any real-world system supports now.
3099 But they are picosecond-resolution at the Lisp level, as that's
3100 easy, and leaves room for future OS improvements.
3101
3102 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
3103 (LIBES): Use it.
3104
3105 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
3106 Don't get current time unless it's needed.
3107
3108 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
3109 now provides it if it's absent.
3110 (start_atimer): Port to higher-res time stamps.
3111 Check for time stamp overflow. Don't get current time more
3112 often than is needed.
3113
3114 * buffer.h (struct buffer): Buffer modtime now has high resolution.
3115 Include systime.h, not time.h.
3116 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
3117
3118 * dired.c: Include stat-time.h.
3119 (Ffile-attributes): File times now have higher resolution.
3120
3121 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
3122 (struct image): Timestamp now has higher resolution.
3123
3124 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
3125 has at least microseconds now. All uses removed.
3126 (update_frame, update_single_window, update_window, update_frame_1)
3127 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
3128
3129 * editfns.c (time_overflow): Now extern.
3130 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
3131 (float-time, Fformat_time_string, Fcurrent_time_string)
3132 (Fcurrent_time_zone): Accept and generate higher-resolution
3133 time stamps.
3134 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
3135 (decode_time_components, lisp_seconds_argument): New functions.
3136 (make_time): Now static.
3137 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
3138 Report an error if the time is invalid, rather than having the caller
3139 do that.
3140
3141 * fileio.c: Include <stat-time.h>
3142 (Fcopy_file): Copy higher-resolution time stamps.
3143 Prefer to set the time stamp via a file descriptor if that works.
3144 (Fset_file_times, Finsert_file_contents, Fwrite_region)
3145 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
3146 (Fvisited_file_modtime, Fset_visited_file_modtime):
3147 Support higher-resolution time stamps.
3148
3149 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
3150
3151 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
3152
3153 * image.c (prepare_image_for_display, clear_image_cache)
3154 (lookup_image): Port to higer-resolution time stamps.
3155
3156 * keyboard.c (start_polling, bind_polling_period):
3157 Check for time stamp overflow.
3158 (read_char, kbd_buffer_get_event, timer_start_idle)
3159 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
3160 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
3161 Port to higher-resolution time stamps. Do not assume time_t is signed.
3162 (decode_timer): New function. Timers are now vectors of length 9,
3163 not 8, to accommodate the picosecond component.
3164 (timer_check_2): Use it.
3165
3166 * nsterm.m (select_timeout, timeval_subtract): Remove.
3167 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
3168 as they're a bit more accurate and handle overflow better.
3169 (ns_select): Change prototype to be compatible with pselect.
3170 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
3171 * nsterm.h (ns_select): Adjust prototype.
3172
3173 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
3174 us-resolution time stamps.
3175 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
3176
3177 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
3178
3179 * lisp.h (time_overflow): New decl.
3180 (wait_reading_process_output): First arg is now intmax_t, not int,
3181 to accommodate larger waits.
3182
3183 * process.h (struct Lisp_Process.read_output_delay):
3184 Now counts nanoseconds, not microseconds.
3185 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
3186 EMACS_HAS_USECS.
3187 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
3188 (wait_reading_process_output):
3189 Port to ns-resolution time stamps.
3190 (Faccept_process_output, wait_reading_process_output):
3191 Check for time stamp overflow. Do not assume time_t is signed.
3192 (select_wrapper): Remove; we now use pselect.
3193 (Fprocess_attributes): Now generates ns-resolution time stamps.
3194
3195 * sysdep.c: Include utimens.h. Don't include utime.h
3196 or worry about struct utimbuf; gnulib does that for us now.
3197 (gettimeofday): Remove; gnulib provides a substitute.
3198 (make_timeval): New function.
3199 (set_file_times): Now sets ns-resolution time stamps.
3200 New arg FD; all uses changed.
3201 (time_from_jiffies, ltime_from_jiffies, get_up_time)
3202 (system_process_attributes):
3203 Now returns ns-resolution time stamp. All uses changed.
3204 Check for time stamp overflow.
3205
3206 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
3207 provides a substitute now.
3208
3209 * systime.h: Include timespec.h rather than sys/time.h and time.h,
3210 since it guarantees struct timespec.
3211 (EMACS_TIME): Now struct timespec, so that we can support
3212 ns-resolution time stamps.
3213 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
3214 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
3215 (EMACS_USECS): Remove.
3216 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
3217 so multiply the arg by 1000 before storing it.
3218 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
3219 New macros.
3220 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
3221 Port to ns-resolution time stamps.
3222 (EMACS_TIME_NEG_P): Remove; replaced by....
3223 (EMACS_TIME_SIGN): New macro.
3224 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
3225 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
3226 (set_file_times, make_time, lisp_time_argument): Adjust signature.
3227 (make_timeval, make_lisp_time, decode_time_components): New decls.
3228 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
3229 that it mishandled time_t overflow. You can't compare by subtracting!
3230 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
3231 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
3232
3233 * term.c: Include <sys/time.h>.
3234 (timeval_to_Time): New function, for proper overflow wraparound.
3235 (term_mouse_position, term_mouse_click): Use it.
3236
3237 * undo.c (record_first_change): Support higher-resolution time stamps
3238 in the undo buffer.
3239 (Fprimitive_undo): Use them when restoring time stamps.
3240
3241 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
3242 (w32_get_internal_run_time):
3243 Port to higher-resolution Emacs time stamps.
3244 (ltime): Now accepts single 64-bit integer, as that's more convenient
3245 for callers.
3246
3247 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
3248
3249 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
3250 for compatibility with pselect. Support ns-resolution time stamps.
3251
3252 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
3253
3254 * xselect.c (wait_for_property_change, x_get_foreign_selection):
3255 Check for time stamp overflow, and support ns-resolution time stamps.
3256
3257 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
3258 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
3259 (timeval_subtract): Remove; no longer needed.
3260 (XTflash, XTring_bell, x_wait_for_event):
3261 Port to ns-resolution time stamps. Don't assume time_t is signed.
3262
b6a92dfe
CY
32632012-06-22 Chong Yidong <cyd@gnu.org>
3264
3265 * xdisp.c (x_consider_frame_title): Revert last change.
3266
d251c37c
EZ
32672012-06-22 Eli Zaretskii <eliz@gnu.org>
3268
3269 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
3270 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
3271 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
3272 staticidx goes up to 1597 out of 1600 = 0x640.)
3273
f10deafb
PE
32742012-06-20 Paul Eggert <eggert@cs.ucla.edu>
3275
3276 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
3277 Otherwise, the umask might be mistakenly 0 while handling input signals.
3278
ec6de1e2
SM
32792012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
3280
3281 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
3282
28be1ada
DA
32832012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
3284
3285 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
3286 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
3287 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
3288 access to `contents' member of Lisp_Vector objects with AREF and ASET
3289 where appropriate.
3290
c6bf3022
CY
32912012-06-19 Chong Yidong <cyd@gnu.org>
3292
3293 * frame.c (delete_frame): When selecting a frame on a different
3294 text terminal, do not alter the terminal's top-frame.
3295
3296 * xdisp.c (format_mode_line_unwind_data): Record the target
3297 frame's selected window and its terminal's top-frame.
3298 (unwind_format_mode_line): Restore them.
3299 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
3300 Callers changed.
3301 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
3302 since tty frames can be explicitly named.
3303 (prepare_menu_bars): Likewise.
3304
3305 * term.c (Ftty_top_frame): New function.
3306
defd4196
PE
33072012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3308
3309 Port byte-code-meter to modern targets.
3310 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
3311 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 3312 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
3313 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
3314 (METER_1, METER_2): Simplify.
3315
1053a871
SM
33162012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
3317
3318 * data.c (Fdefalias): Return `symbol' (bug#11686).
3319
b7e8d081
MR
33202012-06-18 Martin Rudalics <rudalics@gmx.at>
3321
3322 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
3323 gets killed during executing of this function (Bug#11665).
3324 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
3325 (Vkill_buffer_query_functions): In doc-string say that functions
3326 run by this hook should not change the current buffer.
3327
7ea2b339
PE
33282012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3329
3330 Fix recently-introduced process.c problems found by static checking.
3331 * process.c (write_queue_push, write_queue_pop, send_process):
3332 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
3333 (write_queue_pop): Fix pointer signedness problem.
3334 (send_process): Remove unused local.
3335
96a313a1
CY
33362012-06-17 Chong Yidong <cyd@gnu.org>
3337
3338 * xdisp.c (redisplay_internal): No need to redisplay terminal
3339 frames that are not on top.
3340
20ca2e94
TN
33412012-06-17 Troels Nielsen <bn.troels@gmail.com>
3342
3343 * process.c (make_process): Initialize write_queue.
3344 (write_queue_push, write_queue_pop): New functions.
3345 (send_process): Use them to maintain correct ordering of process
3346 writes (Bug#10815).
3347
9a900ca9
PE
33482012-06-17 Paul Eggert <eggert@cs.ucla.edu>
3349
310fbfa8
PE
3350 * lisp.h (eassert): Assume C89 or later.
3351 This removes the need for CHECK.
3352 (CHECK): Remove. Its comments about always evaluating its
3353 argument were confusing, as 'eassert' typically does not evaluate
3354 its argument.
3355
27bb1ca4
PE
3356 * coding.c (produce_chars): Use ptrdiff_t, not int.
3357
9a900ca9
PE
3358 * xterm.c (x_draw_underwave): Check for integer overflow.
3359 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
3360
41b7f8bc 33612012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
3362
3363 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
3364 referenced (Bug#11583).
3365
9b0e3eba
AA
33662012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
3367
3368 Implement wave-style variant of underlining.
3369 * dispextern.h (face_underline_type): New enum.
3370 (face): Add field for underline type.
3371 * nsterm.m (ns_draw_underwave): New function.
3372 (ns_draw_text_decoration): Use it.
3373 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
3374 New functions.
3375 (x_draw_glyph_string): Use them.
3376 * xfaces.c (Qline, Qwave): New Lisp objects.
3377 (check_lface_attrs, merge_face_ref)
1053a871
SM
3378 (Finternal_set_lisp_face_attribute, realize_x_face):
3379 Handle wave-style underline face attributes.
9b0e3eba
AA
3380 * xterm.c (x_draw_underwave): New function.
3381 (x_draw_glyph_string): Use it.
3382
0fb52f11
JB
33832012-06-16 Juanma Barranquero <lekktu@gmail.com>
3384
3385 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
3386 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
3387 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
3388 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
3389 ($(BLD)/w32select.$(O)): Update dependencies.
3390
e5560ff7
AS
33912012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3392
3393 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
3394 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
3395 * character.c (_fetch_multibyte_char_p): Remove.
3396 * alloc.c: Include "character.h" before "buffer.h".
3397 * bidi.c: Likewise.
3398 * buffer.c: Likewise.
3399 * bytecode.c: Likewise.
3400 * callint.c: Likewise.
3401 * callproc.c: Likewise.
3402 * casefiddle.c: Likewise.
3403 * casetab.c: Likewise.
3404 * category.c: Likewise.
3405 * cmds.c: Likewise.
3406 * coding.c: Likewise.
3407 * composite.c: Likewise.
3408 * dired.c: Likewise.
3409 * dispnew.c: Likewise.
3410 * doc.c: Likewise.
3411 * dosfns.c: Likewise.
3412 * editfns.c: Likewise.
3413 * emacs.c: Likewise.
3414 * fileio.c: Likewise.
3415 * filelock.c: Likewise.
3416 * font.c: Likewise.
3417 * fontset.c: Likewise.
3418 * fringe.c: Likewise.
3419 * indent.c: Likewise.
3420 * insdel.c: Likewise.
3421 * intervals.c: Likewise.
3422 * keyboard.c: Likewise.
3423 * keymap.c: Likewise.
3424 * lread.c: Likewise.
3425 * macros.c: Likewise.
3426 * marker.c: Likewise.
3427 * minibuf.c: Likewise.
3428 * nsfns.m: Likewise.
3429 * nsmenu.m: Likewise.
3430 * print.c: Likewise.
3431 * process.c: Likewise.
3432 * regex.c: Likewise.
3433 * region-cache.c: Likewise.
3434 * search.c: Likewise.
3435 * syntax.c: Likewise.
3436 * term.c: Likewise.
3437 * textprop.c: Likewise.
3438 * undo.c: Likewise.
3439 * unexsol.c: Likewise.
3440 * w16select.c: Likewise.
3441 * w32fns.c: Likewise.
3442 * w32menu.c: Likewise.
3443 * window.c: Likewise.
3444 * xdisp.c: Likewise.
3445 * xfns.c: Likewise.
3446 * xmenu.c: Likewise.
3447 * xml.c: Likewise.
3448 * xselect.c: Likewise.
3449
2f07e6af
EZ
34502012-06-16 Eli Zaretskii <eliz@gnu.org>
3451
1053a871
SM
3452 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
3453 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 3454 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
3455 row.
3456 (handle_face_prop): Use chunk-relative overlay string index when
3457 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
3458 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
3459 the rightmost. (Bug#11720)
2f07e6af 3460
29b83cec
AS
34612012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3462
3463 * category.h (CHAR_HAS_CATEGORY): Define as inline.
3464 (CATEGORY_MEMBER): Enforce 1/0 value.
3465 * category.c (_temp_category_set): Remove.
3466
4c5501e9
EZ
34672012-06-16 Eli Zaretskii <eliz@gnu.org>
3468
3469 * window.c (Fdelete_other_windows_internal)
3470 (Fdelete_window_internal): Don't access frame's mouse highlight
3471 info of the initial frame. (Bug#11677)
3472
2b570124
PE
34732012-06-14 Paul Eggert <eggert@cs.ucla.edu>
3474
e93864f9
PE
3475 * .gdbinit (xgetint): Fix recently-introduced paren typo.
3476 Assume USE_2_TAGS_FOR_INTS.
3477 (xreload): Adjust $tagmask width to match recent lisp.h change.
3478
2b570124
PE
3479 Simplify lisp.h in minor ways that should not affect code.
3480 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
3481 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
3482 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
3483 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
3484 (INTTYPEBITS): New macro, for clarity.
3485 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
3486 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
3487 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
3488 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
3489 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
3490
81755f69
JB
34912012-06-13 Juanma Barranquero <lekktu@gmail.com>
3492
3493 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
3494
16192a57
GM
34952012-06-13 Glenn Morris <rgm@gnu.org>
3496
3497 * s/bsd-common.h (BSD4_3):
3498 * s/usg5-4-common.h (USG5_4): No longer define; unused.
3499
646b5f55
AS
35002012-06-13 Andreas Schwab <schwab@linux-m68k.org>
3501
3502 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
3503 instead of union.
3504 (XLI, XIL): Define.
1053a871
SM
3505 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
3506 Use them.
3507 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 3508 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 3509 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
3510 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
3511 * frame.c (delete_frame): Remove outdated comment.
3512 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
3513 USE_LISP_UNION_TYPE.
3514 (Fw32_unregister_hot_key): Likewise.
3515 (Fw32_toggle_lock_key): Likewise.
3516 * w32menu.c (add_menu_item): Likewise.
3517 (w32_menu_display_help): Use XIL instead of checking
3518 USE_LISP_UNION_TYPE.
3519 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
3520 (init_heap): Likewise.
3521 * w32term.c (w32_read_socket): Update comment.
3522
1d3823c9
GM
35232012-06-13 Glenn Morris <rgm@gnu.org>
3524
c62ff706
GM
3525 * s/usg5-4-common.h, src/s/unixware.h:
3526 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
3527
1d3823c9
GM
3528 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
3529
bfe3e0a2
PE
35302012-06-13 Paul Eggert <eggert@cs.ucla.edu>
3531
3532 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
3533 * alloc.c (make_number) [!defined make_number]:
3534 Remove, as lisp.h always defines this now.
3535 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
3536 (roundup_size): Verify that it is a power of 2.
3537 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
3538 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
3539 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
3540 -DUSE_LSB_TAG=0, to override the automatically-selected default.
3541 USE_LSB_TAG now is always defined to be either 0 or 1.
3542 All uses changed.
3543 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
3544 code works fine either way, and efficiency is not a concern here,
3545 as the union type is for debugging, not for production.
3546 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
3547 Use an inline function on all platforms when using the union type,
3548 since this is simpler and 'static inline' can be used portably
3549 within Emacs now.
3550 (LISP_INITIALLY_ZERO): New macro.
3551 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
3552 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
3553
45fa9c0f
GM
35542012-06-12 Glenn Morris <rgm@gnu.org>
3555
b4492cba
GM
3556 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
3557
3558 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 3559
45fa9c0f
GM
3560 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
3561 Move BROKEN_SIGIO to configure.
3562
3563 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
3564 Move NO_TERMIO to configure.
3565
0e25d334
CY
35662012-06-12 Chong Yidong <cyd@gnu.org>
3567
3568 * image.c (imagemagick_load_image): Use MagickFlattenImage if
3569 MagickMergeImageLayers is undefined. Use pixel pusher loop if
3570 MagickExportImagePixels is undefined.
3571
43682bb6
PE
35722012-06-12 Paul Eggert <eggert@cs.ucla.edu>
3573
3574 * image.c (imagemagick_load_image): Remove unused label.
3575
a9be7d2b
GM
35762012-06-11 Glenn Morris <rgm@gnu.org>
3577
3578 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3579 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
3580 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
3581 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
3582
3017f87f
SM
35832012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
3584
3585 * alloc.c (make_byte_code): New function.
3586 (Fmake_byte_code): Use it. Don't purify here.
3587 * lread.c (read1): Use it as well to avoid extra allocation.
3588
1b9b4cf4
CY
35892012-06-11 Chong Yidong <cyd@gnu.org>
3590
3591 * image.c (imagemagick_load_image): Implement transparency.
3592
95988fcf
AS
35932012-06-10 Andreas Schwab <schwab@linux-m68k.org>
3594
3595 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
3596 account for preceding backslashes. (Bug#11663)
3597
cd4eb164
CY
35982012-06-09 Chong Yidong <cyd@gnu.org>
3599
3600 * term.c: Support italics in capable terminals (Bug#9652).
3601 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
3602 (turn_on_face): Output using TS_enter_italic_mode if available.
3603 Don't handle unused blinking and alt-charset cases.
3604 (turn_off_face): Handle italic case; discard unused tty_blinking_p
3605 and tty_alt_charset_p cases.
3606 (tty_capable_p, init_tty): Support italics.
3607
3608 * termchar.h (struct tty_display_info): Add field for italics.
3609 Remove unused blink field.
3610
3611 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
3612 Handle slant.
3613
3614 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
3615 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
3616 tty_alt_charset_p. Add tty_italic_p.
3617
ff88beb8
MA
36182012-06-09 Michael Albinus <michael.albinus@gmx.de>
3619
3620 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3621 dbus_type_is_basic if available.
3622 (xd_extract_signed, xd_extract_unsigned): Rename from
3623 extract_signed and extract_unsigned, respectively. Adapt callers.
3624
44286096
CY
36252012-06-09 Chong Yidong <cyd@gnu.org>
3626
1682701f
CY
3627 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3628
44286096
CY
3629 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3630 case (Bug#9752).
3631
d86feb17
PE
36322012-06-08 Paul Eggert <eggert@cs.ucla.edu>
3633
3634 * xdisp.c (vmessage): Treat frame message as multibyte.
3635 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3636 would generate the diagnostic "Making \302\247 buffer-local while
3637 let-bound!".
3638
d5c20fe8
EZ
36392012-06-08 Eli Zaretskii <eliz@gnu.org>
3640
3641 * dispnew.c (showing_window_margins_p): Undo last change, which
3642 was done due to an inadvertent commit.
3643 (adjust_frame_glyphs_for_frame_redisplay): Do call
3644 showing_window_margins_p.
3645
513749ee
SM
36462012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3647
3648 * eval.c (Fmake_var_non_special): New primitive.
3649 (syms_of_eval): Defsubr it.
3650 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3651
d4a8f5c1
JB
36522012-06-08 Juanma Barranquero <lekktu@gmail.com>
3653
3654 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3655 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3656
8bbbc977
EZ
36572012-06-08 Eli Zaretskii <eliz@gnu.org>
3658
3659 * alloc.c (allocate_vectorlike): Fix last change.
3660
f3372c87
DA
36612012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
3662
3663 Block-based vector allocation of small vectors.
3664 * lisp.h (struct vectorlike_header): New field `nbytes',
3665 adjust comment accordingly.
3666 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3667 to denote vector blocks. Adjust users (live_vector_p,
3668 mark_maybe_pointer, valid_lisp_object_p) accordingly.
3669 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3670 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3671 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3672 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3673 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3674 (roundup_size): New constant.
3675 (struct vector_block): New data type.
3676 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 3677 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
3678 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3679 (sweep_vectors): New functions.
3680 (allocate_vectorlike): Return `zero_vector' as the only vector of
3681 0 items. Allocate new vector from block if vector size is less than
3682 or equal to VBLOCK_BYTES_MAX.
3683 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3684 (init_alloc_once): Add call to init_vectors.
3685
4f18a4ed
SM
36862012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3687
3688 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3689
86f158bc
PE
36902012-06-07 Paul Eggert <eggert@cs.ucla.edu>
3691
3692 * doprnt.c (doprnt): Truncate multibyte char correctly.
3693 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3694 would mishandle a string argument "Xc" if X was a multibyte
3695 character of length 2: it would truncate after X's first byte
3696 rather than including all of X.
3697
c5cfcbe0
CY
36982012-06-06 Chong Yidong <cyd@gnu.org>
3699
3700 * buffer.c (word_wrap): Doc fix.
3701
c05cf390
PE
37022012-06-04 Paul Eggert <eggert@cs.ucla.edu>
3703
3704 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3705
0c3461de
GM
37062012-06-03 Glenn Morris <rgm@gnu.org>
3707
3708 * xdisp.c (tool-bar-style): Doc fix.
3709
c71232db
UM
37102012-06-03 Ulrich Müller <ulm@gentoo.org>
3711
3712 * Makefile.in (PAXCTL): Define.
3713 (temacs$(EXEEXT)): Disable memory randomization for the temacs
3714 binary via PaX flags if the paxctl utility is available.
3715 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3716 Restore PaX flags to their default. (Bug#11398)
3717
383f7350
CY
37182012-06-03 Chong Yidong <cyd@gnu.org>
3719
3720 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3721 buffer (Bug#11226).
3722
5f2c76c6
CY
37232012-06-03 Chong Yidong <cyd@gnu.org>
3724
3725 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3726 (note_mode_line_or_margin_highlight): If there is no help echo,
3727 use mode-line-default-help-echo. Handle the case where the mouse
3728 position is past the end of the mode line string.
3729
3730 * buffer.c (buffer_local_value_1): New function, split from
3731 Fbuffer_local_value; can return Qunbound.
3732 (Fbuffer_local_value): Use it.
3733 (Vmode_line_format): Docstring tweaks.
3734
773d47f6
PE
37352012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3736
3737 * sysdep.c (system_process_attributes): Improve comment.
3738
f2d6a3df
SM
37392012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
3740
3741 * keyboard.c: Export real-this-command to Elisp.
3742 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3743 and DEFVAR it. Update all users.
3744
63810350
PE
37452012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3746
7bd5c1f4
PE
3747 * minibuf.c (Fassoc_string): Remove duplicate declaration.
3748
63810350
PE
3749 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3750 Convert pctcpu and pctmem to Lisp float properly.
3751 Let the compiler fold better, as 100.0/0x8000 is exact.
3752
a2821611
AS
37532012-06-02 Andreas Schwab <schwab@linux-m68k.org>
3754
3755 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3756 cons_block.
3757
5fceba1d
PE
37582012-06-01 Paul Eggert <eggert@cs.ucla.edu>
3759
3760 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
3761
c98ff5dd
DA
37622012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
3763
3764 For a 'struct window', replace some Lisp_Object fields to
3765 bitfields where appropriate, remove unused fields.
3766 * window.h (struct window): Remove unused 'last_mark_x' and
3767 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
3768 change it's type from Lisp_Object to bitfield.
3769 Change type of 'force_start', 'optional_new_start',
3770 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
3771 fields from Lisp_Object to bitfield. Adjust users accordingly.
3772
ca34e0be
PE
37732012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3774
3775 Pacify gcc -Wdouble-precision when using Xaw.
3776 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
3777 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
3778 Use 'float' consistently, rather than 'float' in most places
3779 and 'double' in a couple of places.
3780
efc00ab1 37812012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
3782
3783 * xdisp.c (handle_stop): Detect whether we have overlay strings
3784 loaded by testing it->current.overlay_string_index to be
3785 non-negative, instead of checking whether n_overlay_strings is
3786 positive. (Bug#11587)
3787
efc00ab1 37882012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
3789
3790 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3791
3792 * doc.c (Fsubstitute_command_keys): Doc fix.
3793
efc00ab1 37942012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
3795
3796 * search.c (search_buffer): Remove calls to
3797 r_alloc_inhibit_buffer_relocation, as it is now called by
3798 maybe_unify_char, which was the cause of relocation of buffer text
3799 in bug#11519.
3800
efc00ab1 38012012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
3802
3803 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3804 for the duration of call to load_charset, to avoid problems with
3805 callers of maybe_unify_char that access buffer text through C
3806 pointers.
3807
3808 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3809 decrement the inhibition flag, instead of just setting or
3810 resetting it.
3811
ba93a187
PE
38122012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3813
3814 Remove obsolete '#define static' cruft.
3815 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3816 This #undef was "temporary" in 2000; it is no longer needed
3817 now that '#define static' has gone away.
3818 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3819 (gray_bitmap_bits): Remove; no longer needed.
3820 All uses replaced with definiens.
3821 * xterm.c: Include "bitmaps/gray.xbm".
3822
9e4bf381
PE
38232012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3824
3825 Clean up __executable_start, monstartup when --enable-profiling.
3826 The following changes affect the code only when profiling.
3827 * dispnew.c (__executable_start): Rename from safe_bcopy.
3828 Define only on platforms that need it.
3829 * emacs.c: Include <sys/gmon.h> when profiling.
3830 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3831 (__executable_start): Remove decl, since lisp.h does it now.
3832 (safe_bcopy): Remove decl; no longer has that name.
3833 (main): Coalesce #if into single bit of code, for simplicity.
3834 Cast pointers to uintptr_t, since standard libraries want integers
3835 and not pointers.
3836 * lisp.h (__executable_start): New decl.
3837
32d72c2f
GM
38382012-05-31 Glenn Morris <rgm@gnu.org>
3839
3840 * image.c (Fimagemagick_types): Doc fix.
3841
baac5bc7
JM
38422012-05-30 Jim Meyering <meyering@redhat.com>
3843
3844 * callproc.c (Fcall_process_region): Include directory component
3845 in mkstemp error message (Bug#11586).
3846
72cb32cf
PE
38472012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 * alloc.c, lisp.h (make_pure_vector): Now static.
3850
61b108cc
SM
38512012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3852
3853 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3854 Move to byte-run.el.
3855 (Fautoload): Do the hash-doc more carefully.
3856 * data.c (Fdefalias): Purify definition, except for keymaps.
3857 (Qdefun): Move from eval.c.
3858 * lisp.h (Qdefun): Remove.
3859 * lread.c (read1): Tiny simplification.
3860
471fe23d
TN
38612012-05-29 Troels Nielsen <bn.troels@gmail.com>
3862
934f3f58 3863 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
3864 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3865 Bug#9642, but explicitly check that the buffer the overlay would
3866 be moved to is live and rearrange lines to make sure that errors
3867 will not put the overlay in an inconsistent state.
3868 (Fdelete_overlay): Cosmetics.
3869
85d0efd1
EZ
38702012-05-28 Eli Zaretskii <eliz@gnu.org>
3871
3872 * w32term.c (my_bring_window_to_top): New function.
3873 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
3874 could be different from the original one.
3875 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
3876 (Bug#11513)
3877
3878 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3879 by calling BringWindowToTop.
3880
3881 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3882 (WM_EMACS_END): Increase by one.
3883
da92a98c
PE
38842012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3885
3886 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3887 This avoids undefined behavior that might cause the eassert
3888 to not catch an out-of-range value.
3889
74d1f848
JB
38902012-05-28 Juanma Barranquero <lekktu@gmail.com>
3891
3892 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3893 Update dependencies.
3894
9e1a06fc
EZ
38952012-05-27 Eli Zaretskii <eliz@gnu.org>
3896
3897 * bidi.c (bidi_mirror_char): Fix last change.
3898
f3dd7312
AS
38992012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3900
3901 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3902 when referring to sectname field in printf format.
3903
81899c91
PE
39042012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3905
57b81a9f
PE
3906 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3907 Only r_alloc_inhibit_buffer_relocation needed to be added;
3908 the others were already declared.
3909
81899c91
PE
3910 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3911 before checking whether it's out of range. Put the check inside
3912 eassert. See
3913 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3914
33017faf 39152012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
3916
3917 * callproc.c (Fcall_process): Restore a line that was accidentally
3918 commented out in the 2011-02-13 change (bug#11547).
3919
33017faf 39202012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
3921
3922 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3923 defined on ralloc.c.
3924
3925 * buffer.c [REL_ALLOC]: Remove prototypes of
3926 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3927 they are now on lisp.h.
3928
3929 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3930
3931 * search.c (search_buffer): Use it to inhibit relocation of buffer
3932 text while re_search_2 is doing its job, because re_search_2 is
3933 passed C pointers to buffer text. (Bug#11519)
3934
23415acf
EZ
3935 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3936 Update value to 24.
3937
44e27368
EZ
3938 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3939 state after an additional call to move_it_in_display_line_to, keep
3940 the values of it->max_ascent and it->max_descent found for the
3941 entire line.
3942 (pos_visible_p): Revert the comparison against bottom_y to what it
3943 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3944 (Bug#11464)
3945
c1892f11
PE
39462012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3947
3948 Fix coding-related core dumps with gcc -ftrapv.
3949 The code was computing A - B, where A and B are pointers, and B is
3950 random garbage. This can lead to core dumps on platforms that
3951 have special pointer registers, and it also leads to core dumps on
3952 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3953 A - B only when B is initialized properly.
3954 * coding.c (coding_set_source, coding_set_destination): Return void.
3955 (coding_change_source, coding_change_destinations): New functions,
3956 with the old behaviors of coding_set_source and coding_set_destination.
3957 All callers that need an offset changed to use these new functions.
3958
eb7afdad
GM
39592012-05-26 Glenn Morris <rgm@gnu.org>
3960
3961 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3962
f12fdf02
EZ
39632012-05-26 Eli Zaretskii <eliz@gnu.org>
3964
53a63be6 3965 Extend mouse support on W32 text-mode console.
61b108cc
SM
3966 * xdisp.c (draw_row_with_mouse_face):
3967 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 3968
eb3f6f01 3969 * w32console.c: Include window.h.
61b108cc
SM
3970 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3971 New functions.
eb3f6f01
EZ
3972 (initialize_w32_display): Initialize mouse-highlight data.
3973
53a63be6
EZ
3974 * w32inevt.c: Include termchar.h and window.h.
3975 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3976 moves, call note_mouse_highlight. If help_echo changed, call
3977 gen_help_event to produce help-echo message in the echo area.
3978 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3979 highlight info.
3980
4cfd81f6
PE
39812012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3982
3983 * lread.c (read1): Simplify slightly to avoid an overflow warning
3984 with GCC 4.7.0 on x86-64.
3985
4446092a
EZ
39862012-05-26 Eli Zaretskii <eliz@gnu.org>
3987
3988 * bidi.c (bidi_mirror_char): Revert last change: an int is
3989 definitely wide enough here.
3990
42b2a986 39912012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 3992
42b2a986 3993 Fix integer width and related bugs (Bug#9874).
eb106a49 3994 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
3995 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3996 (string_bytes, check_sblock, allocate_string_data):
3997 (compact_small_strings, Fmake_bool_vector, make_string)
3998 (make_unibyte_string, make_multibyte_string)
3999 (make_string_from_bytes, make_specified_string)
4000 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4001 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4002 (mark_vectorlike):
4003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4004 (allocate_pseudovector):
4005 Use int, not EMACS_INT, where int is wide enough.
4006 (inhibit_garbage_collection, Fgarbage_collect):
4007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4008 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4009 int might not be wide enough.
4010 (bidi_cache_search, bidi_cache_find, bidi_init_it)
4011 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4012 (bidi_at_paragraph_end, bidi_find_paragraph_start)
4013 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4014 (bidi_level_of_next_char, bidi_move_to_visually_next):
4015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4016 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4017 (Fkill_buffer, Fset_buffer_major_mode)
4018 (advance_to_char_boundary, Fbuffer_swap_text)
4019 (Fset_buffer_multibyte, overlays_at, overlays_in)
4020 (overlay_touches_p, struct sortvec, record_overlay_string)
4021 (overlay_strings, recenter_overlay_lists)
4022 (adjust_overlays_for_insert, adjust_overlays_for_delete)
4023 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4024 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4025 (Foverlay_recenter, last_overlay_modification_hooks_used)
4026 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
4028 (validate_region): Omit unnecessary test for b <= e,
4029 since that's guaranteed by the previous test.
d311d28c
PE
4030 (adjust_overlays_for_delete): Avoid pos + length overflow.
4031 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4032 (report_overlay_modification):
4033 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4034 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4035 Omit pointer cast, which isn't needed anyway, and doesn't work
4036 after the EMACS_INT -> ptrdiff_t change.
02481186 4037 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
4038 * buffer.h: Adjust decls to match defn changes elsewhere.
4039 (struct buffer_text, struct buffer):
4040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4041 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
4042 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4043 not int, to avoid needless 32-bit limit on 64-bit hosts.
4044 (exec_byte_code): Use tighter memory-full test, one that checks
4045 for alloca overflow. Don't compute the address of the object just
4046 before an array, as that's not portable. Use EMACS_INT, not
4047 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
4048 * callint.c (Fcall_interactively):
4049 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4050 * callproc.c (call_process_kill, Fcall_process):
4051 Don't assume pid_t fits into an Emacs fixnum.
4052 (call_process_cleanup, Fcall_process, child_setup):
4053 Don't assume pid_t fits into int.
4054 (call_process_cleanup, Fcall_process, delete_temp_file)
4055 (Fcall_process_region):
4056 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4057 (Fcall_process): Simplify handling of volatile integers.
4058 Use int, not EMACS_INT, where int will do.
4059 * casefiddle.c (casify_object, casify_region, operate_on_word)
4060 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4062 (casify_object): Avoid integer overflow when overallocating buffer.
4063 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 4064 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
4065 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
4066 * category.h (CATEGORYP): Don't assume arg is nonnegative.
4067 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
4068 integers are now checked earlier. All uses replaced with XINT.
4069 (ccl_driver):
4070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4071 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
4072 (ccl_driver, Fregister_code_conversion_map):
4073 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
4074 (resolve_symbol_ccl_program): Check that vector header is in range.
4075 Always copy the vector, so that we can check its contents reliably
4076 now rather than having to recheck each instruction as it's being
4077 executed. Check that vector words fit in 'int'.
4078 (ccl_get_compiled_code, Fregister_ccl_program)
4079 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
4080 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
4081 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
4082 contents are in range.
4083 (Fccl_execute_on_string): Check that status is in range.
4084 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
4085 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
4086 Accept and return EMACS_INT, not int, because callers can pass values
4087 out of 'int' range.
4088 (c_string_width, strwidth, lisp_string_width, chars_in_text)
4089 (multibyte_chars_in_text, parse_str_as_multibyte)
4090 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
4091 (str_as_unibyte, str_to_unibyte, string_count_byte8)
4092 (string_escape_byte8, Fget_byte):
4093 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 4094 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
4095 avoid mishandling large integers.
4096 * character.h: Adjust decls to match defn changes elsewhere.
4097 * charset.c (load_charset_map_from_file, find_charsets_in_text)
4098 (Ffind_charset_region):
4099 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4100 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
4101 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 4102 Don't assume fixnum fits in int.
d311d28c
PE
4103 (load_charset_map_from_vector, Fmap_charset_chars):
4104 Remove now-unnecessary CHECK_NATNUMs.
4105 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
4106 Don't rely on undefined behavior with signed left shift overflow.
4107 Don't assume unsigned int fits into fixnum, or that fixnum fits
4108 into unsigned int. Don't require max_code to be a valid fixnum;
4109 that's not true for gb10830 4-byte on a 32-bit host. Allow
4110 invalid_code to be a cons, for the same reason. Require code_offset
4111 to be a character. Avoid int overflow if max_char is close
4112 to INT_MAX.
4113 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
4114 this is intended anyway and avoids some undefined behavior.
4115 (load_charset_map): Pass unsigned, not int, as 2nd arg of
4116 INDEX_TO_CODE_POINT, as that's what it expects.
4117 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
4118 * charset.h (DECODE_CHAR): Return int, not unsigned;
4119 this is what was intended anyway, and it avoids undefined behavior.
4120 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
4121 integer-overflow issues.
4122 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
4123 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
4124 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
4125 * chartab.c (Fmake_char_table, Fset_char_table_range)
4126 (uniprop_get_decoder, uniprop_get_encoder):
4127 Don't assume fixnum fits in int.
4128 * cmds.c (move_point): New function, that does the gist of
4129 Fforward_char and Fbackward_char, but does so while checking
4130 for integer overflow more accurately.
c96e5d6a 4131 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
4132 (Fforward_line, Fend_of_line, internal_self_insert)
4133 (internal_self_insert):
4134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4135 Fix a FIXME, by checking for integer overflow when calculating
4136 target_clm and actual_clm.
4137 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 4138 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
4139 (ASSURE_DESTINATION, coding_alloc_by_realloc)
4140 (coding_alloc_by_making_gap, alloc_destination)
4141 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
4142 (encode_coding_utf_16, detect_coding_emacs_mule)
4143 (decode_coding_emacs_mule, encode_coding_emacs_mule)
4144 (detect_coding_iso_2022, decode_coding_iso_2022)
4145 (encode_invocation_designation, encode_designation_at_bol)
4146 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4147 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
4148 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
4149 (encode_coding_ccl, encode_coding_raw_text)
4150 (detect_coding_charset, decode_coding_charset)
4151 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
4152 (produce_composition, produce_charset, produce_annotation)
4153 (decode_coding, handle_composition_annotation)
4154 (handle_charset_annotation, consume_chars, decode_coding_gap)
4155 (decode_coding_object, encode_coding_object, detect_coding_system)
4156 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
4157 (code_convert_region, code_convert_string)
8f50130c
PE
4158 (Fdefine_coding_system_internal)
4159 (coding_set_source, coding_set_destination):
d311d28c
PE
4160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4161 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
4162 (Fdefine_coding_system_internal):
4163 Don't assume fixnums fit in int.
4164 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 4165 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
4166 (Funencodable_char_position, Fcheck_coding_systems_region)
4167 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 4168 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 4169 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 4170 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 4171 Don't access memory outside of the args array.
d311d28c 4172 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
4173 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
4174 result of ENCODE_CHAR.
d311d28c
PE
4175 * coding.h: Adjust decls to match defn changes elsewhere.
4176 (struct coding_system):
4177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4178 * composite.c (get_composition_id, find_composition)
4179 (run_composition_function, update_compositions)
4180 (compose_text, composition_gstring_put_cache)
4181 (composition_gstring_p, composition_gstring_width)
4182 (fill_gstring_header, fill_gstring_body, autocmp_chars)
4183 (composition_compute_stop_pos, composition_reseat_it)
4184 (composition_update_it, struct position_record)
4185 (find_automatic_composition, composition_adjust_point)
4186 (Fcomposition_get_gstring, Ffind_composition_internal):
4187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4188 (update_compositions):
4189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4190 * composite.h: Adjust decls to match defn changes elsewhere.
4191 (struct composition):
4192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4193 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
4194 Do not attempt to compute the address of the object just before a
4195 buffer; this is not portable.
4196 (Faref, Faset):
4197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4198 (Faset): Use int, not EMACS_INT, where int is wide enough.
4199 (Fstring_to_number): Don't assume fixnums fit in int.
4200 (Frem): Don't assume arg is nonnegative.
4201 * dbusbind.c (xd_append_arg): Check for integers out of range.
4202 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 4203 (extract_signed, extract_unsigned): New functions.
243e0530
PE
4204 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
4205 (xd_get_connection_references): Return ptrdiff_t, not int.
4206 All uses changed.
4207 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
4208 (xd_read_message_1):
4209 Use int, not unsigned, where the dbus API uses int.
4210 (Fdbus_message_internal): Don't overflow mtype.
4211 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
4212 * dired.c (directory_files_internal, file_name_completion, scmp)
4213 (file_name_completion_stat):
4214 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4215 (file_name_completion): Don't overflow matchcount.
4216 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
4217 * dispextern.h: Adjust decls to match defn changes elsewhere.
4218 (struct text_pos, struct glyph, struct bidi_saved_info)
4219 (struct bidi_string_data, struct bidi_it, struct composition_it)
4220 (struct it):
4221 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4222 (struct display_pos, struct composition_it, struct it):
4223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4224 * dispnew.c (increment_matrix_positions)
4225 (increment_row_positions, mode_line_string)
4226 (marginal_area_string):
4227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 4228 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
4229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4230 (duration_to_sec_usec): New function, to check for overflow better.
4231 (Fsleep_for, sit_for): Use it.
4232 * doc.c (get_doc_string, store_function_docstring):
4233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4234 (get_doc_string, Fsnarf_documentation):
4235 Use int, not EMACS_INT, where int is wide enough.
4236 (get_doc_string):
4237 Use SAFE_ALLOCA, not alloca.
4238 Check for overflow when converting EMACS_INT to off_t.
4239 * doprnt.c (doprnt):
4240 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4241 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
4242 Don't assume uid_t fits into fixnum.
4243 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
4244 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
4245 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
4246 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
4247 (general_insert_function)
4248 (Finsert_char, make_buffer_string, make_buffer_string_both)
4249 (update_buffer_properties, Fbuffer_substring)
4250 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
4251 (Fsubst_char_in_region, check_translation)
4252 (Ftranslate_region_internal, save_restriction_restore, Fformat)
4253 (transpose_markers, Ftranspose_regions):
4254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4255 (clip_to_bounds): Move to lisp.h as an inline function).
4256 (Fconstrain_to_field): Don't assume integers are nonnegative.
4257 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
4258 (Fsubst_char_in_region, Fsave_restriction):
4259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4260 (Femacs_pid): Don't assume pid_t fits into fixnum.
4261 (lo_time): Use int, not EMACS_INT, when int suffices.
4262 (lisp_time_argument): Check for usec out of range.
4263 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
4264 (Fuser_login_name, Fuser_full_name): Signal an error
4265 if a uid argument is out of range, rather than relying on
4266 undefined behavior.
c8d5c857
PE
4267 (Fformat_time_string): Remove now-unnecessary check.
4268 lisp_time_argument checks for out-of-range usec now.
243e0530 4269 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
4270 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
4271 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
4272 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
4273 (init_cmdargs, Fdump_emacs):
4274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4275 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
4276 the bottom (typically) 32 bits of the fixnum.
4277 * eval.c (specpdl_size, call_debugger):
4278 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4279 (when_entered_debugger, Fbacktrace_debug):
4280 Don't assume fixnum can fit in int.
4281 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
4282 the object just before a buffer; this is not portable.
4283 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
4284 (grow_specpdl, unbind_to):
4285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4286 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
4287 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 4288 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
4289 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
4290 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
4291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4292 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
4293 (a_write, e_write):
4294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4295 (Fcopy_file, non_regular_nbytes, read_non_regular)
4296 (Finsert_file_contents):
4297 Use int, not EMACS_INT, where int is wide enough.
4298 (READ_BUF_SIZE): Verify that it fits in int.
4299 (Finsert_file_contents): Check that counts are in proper range,
4300 rather than assuming fixnums fit into ptrdiff_t etc.
4301 Don't assume fixnums fit into int.
125b3835 4302 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
4303 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
4304 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
4305 (string_char_to_byte, string_byte_to_char)
4306 (string_make_multibyte, string_to_multibyte)
4307 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
4308 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
4309 (substring_both, Fdelete, internal_equal, Ffillarray)
4310 (Fclear_string, mapcar1)
4311 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
4312 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
4313 (larger_vector, make_hash_table, maybe_resize_hash_table)
4314 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
4315 (Fmaphash, secure_hash):
4316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4317 (concat): Check for string index and length overflow.
4318 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
4319 (Frequire):
4320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4321 (larger_vector): New API (vec, incr_min, size_max) replaces old
4322 one (vec, new_size, init). This catches size overflow.
4323 INIT was removed because it was always Qnil.
4324 All callers changed.
4325 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
4326 the upper bound on a hash table index size.
4327 (make_hash_table, maybe_resize_hash_table): Use it.
4328 (secure_hash): Computer start_byte and end_byte only after
4329 they're known to be in ptrdiff_t range.
4330 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
4331 (Ffont_get_glyphs, Ffont_at):
4332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4333 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
4334 (Flist_fonts, Fopen_font):
4335 Don't assume fixnum can fit in int.
4336 (check_gstring): Don't assume index can fit in int.
4337 (font_match_p): Check that fixnum is a character, not a nonnegative
4338 fixnum, since the later code needs to stuff it into an int.
4339 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
4340 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
4341 conversion overflow issues.
4342 (Fopen_font): Check for integer out of range.
4343 (Ffont_get_glyphs): Don't assume index can fit in int.
4344 * font.h: Adjust decls to match defn changes elsewhere.
4345 * fontset.c (reorder_font_vector): Redo score calculation to avoid
4346 integer overflow.
4347 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
4348 printmax_t, where ptrdiff_t is wide enough.
4349 (Finternal_char_font):
4350 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4351 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
4352 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
4353 (Fset_frame_position, x_set_frame_parameters)
4354 (x_set_line_spacing, x_set_border_width)
4355 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
4356 Check that fixnums are in proper range for system types.
4357 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
4358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4359 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
4360 Use SAFE_ALLOCA_LISP, not alloca.
4361 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
4362 intptr_t is wide enough.
4363 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
4364 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
4365 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
4366 Check for fixnum out of range.
4367 * ftfont.c (ftfont_list): Don't assume index fits in int.
4368 Check that fixnums are in proper range for system types.
4369 (ftfont_shape_by_flt):
4370 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
4371 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4373 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
4374 Check that fixnums are in proper range for system types.
4375 * gnutls.h: Adjust decls to match defn changes elsewhere.
4376 * gtkutil.c (xg_dialog_run):
4377 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4378 (update_frame_tool_bar):
4379 Check that fixnums are in proper range for system types.
4380 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 4381 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
4382 * indent.c (last_known_column, last_known_column_point):
4383 (current_column_bol_cache):
4384 (skip_invisible, current_column, check_display_width):
4385 (check_display_width, scan_for_column, current_column_1)
4386 (Findent_to, Fcurrent_indentation, position_indentation)
4387 (indented_beyond_p, Fmove_to_column, compute_motion):
4388 (Fcompute_motion, Fvertical_motion):
4389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4390 (last_known_column_modified): Use EMACS_INT, not int.
4391 (check_display_width):
4392 (Fcompute_motion):
4393 Check that fixnums and floats are in proper range for system types.
4394 (compute_motion): Don't assume index or fixnum fits in int.
4395 (compute_motion, Fcompute_motion):
4396 Use int, not EMACS_INT, when it is wide enough.
4397 (vmotion): Omit local var start_hpos that is always 0; that way
4398 we don't need to worry about overflow in expressions involving it.
4399 * indent.h: Adjust decls to match defn changes elsewhere.
4400 (struct position):
4401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4402 Use int, not EMACS_INT, where int is wide enough.
4403 Remove unused members ovstring_chars_done and tab_offset;
4404 all uses removed.
4405 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
4406 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
4407 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
4408 (make_gap, copy_text, insert, insert_and_inherit)
4409 (insert_before_markers, insert_before_markers_and_inherit)
4410 (insert_1, count_combining_before, count_combining_after)
4411 (insert_1_both, insert_from_string)
4412 (insert_from_string_before_markers, insert_from_string_1)
4413 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
4414 (adjust_after_replace, adjust_after_insert, replace_range)
4415 (replace_range_2, del_range, del_range_1, del_range_byte)
4416 (del_range_both, del_range_2, modify_region)
4417 (prepare_to_modify_buffer, signal_before_change)
4418 (signal_after_change, Fcombine_after_change_execute):
4419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4420 * intervals.c (traverse_intervals, rotate_right, rotate_left)
4421 (balance_an_interval, split_interval_right, split_interval_left)
4422 (find_interval, next_interval, update_interval)
4423 (adjust_intervals_for_insertion, delete_node, delete_interval)
4424 (interval_deletion_adjustment, adjust_intervals_for_deletion)
4425 (static_offset_intervals, offset_intervals)
4426 (merge_interval_right, merge_interval_left, make_new_interval)
4427 (graft_intervals_into_buffer, temp_set_point_both)
4428 (temp_set_point, set_point, adjust_for_invis_intang)
4429 (set_point_both, move_if_not_intangible, get_property_and_range)
4430 (get_local_map, copy_intervals, copy_intervals_to_string)
4431 (compare_string_intervals, set_intervals_multibyte_1):
4432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4433 * intervals.h: Adjust decls to match defn changes elsewhere.
4434 (struct interval):
4435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4436 * keyboard.c (this_command_key_count, this_single_command_key_start)
4437 (before_command_key_count, before_command_echo_length, echo_now)
4438 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
4439 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
4440 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
4441 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
4442 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4443 (last_non_minibuf_size, last_point_position, echo_truncate)
4444 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
4445 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
4446 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
4447 (stuff_buffered_input):
4448 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4449 (last_auto_save, command_loop_1, read_char):
4450 Use EMACS_INT, not int, to avoid integer overflow.
4451 (record_char): Avoid overflow in total_keys computation.
4452 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
4453 * keyboard.h: Adjust decls to match defn changes elsewhere.
4454 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
4455 (Fkey_description, Fdescribe_vector, Flookup_key):
4456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4457 (click_position): New function, to check that positions are in range.
4458 (Fcurrent_active_maps):
4459 (describe_command):
4460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4461 (Faccessible_keymaps, Fkey_description):
4462 (preferred_sequence_p):
4463 Don't assume fixnum can fit into int.
4464 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
4465 Check for integer overflow in size calculations.
4466 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
4467 avoid mishandling large integers.
4468 * lisp.h: Adjust decls to match defn changes elsewhere.
4469 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
4470 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
4471 (struct Lisp_Marker):
4472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4473 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
4474 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
4475 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
4476 All callers changed.
4477 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
4478 Assume the arg has valid form, since it always does.
4479 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
4480 unsigned integer system type.
4481 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
4482 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
4483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4484 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
4485 (duration_to_sec_usec): New decl.
4486 * lread.c (read_from_string_index, read_from_string_index_byte)
4487 (read_from_string_limit, readchar, unreadchar, openp)
4488 (read_internal_start, read1, oblookup):
4489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4490 (Fload, readevalloop, Feval_buffer, Feval_region):
4491 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4492 (openp): Check for out-of-range argument to 'access'.
4493 (read1): Use int, not EMACS_INT, where int is wide enough.
4494 Don't assume fixnum fits into int.
6efdadfd 4495 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
4496 (read_filtered_event): Use duration_to_sec_usec
4497 to do proper overflow checking on durations.
d311d28c
PE
4498 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
4499 in size calculation.
4500 (Fexecute_kbd_macro):
4501 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4502 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
4503 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
4504 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
4505 (set_marker_both, set_marker_restricted_both, marker_position)
4506 (marker_byte_position, Fbuffer_has_markers_at):
4507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4508 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 4509 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
4510 It now merely ensures that the menu is large enough, without
4511 necessarily growing it, as this avoids some integer overflow issues.
4512 All callers changed.
4513 (keymap_panes, parse_single_submenu, Fx_popup_menu):
4514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4515 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
4516 Use SAFE_ALLOCA_LISP, not alloca.
4517 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
4518 to EMACS_INT. Check that fixnums are in proper range for system types.
4519 * minibuf.c (minibuf_prompt_width, string_to_object)
4520 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
4521 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
4522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4523 (get_minibuffer, read_minibuf_unwind):
4524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4525 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
4526 this simplifies overflow checking. All callers changed.
4527 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
4528 (Ftest_completion):
4529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4530 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
4531 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
4532 Check that fixnums are in proper range for system types.
4533 (Fx_create_frame, Fx_show_tip):
4534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4535 * nsfont.m (ns_findfonts, nsfont_list_family):
4536 Don't assume fixnum fits in long.
4537 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
4538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4539 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
4540 wide enough.
17fdb222 4541 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
4542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4543 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
4544 (PRINTDECLARE, PRINTPREPARE):
4545 (strout, print_string):
4546 (print, print_preprocess, print_check_string_charset_prop)
4547 (print_object):
4548 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4549 (PRINTDECLARE):
4550 (temp_output_buffer_setup, Fprin1_to_string, print_object):
4551 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4552 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 4553 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 4554 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
4555 (print_error_message): Use SAFE_ALLOCA, not alloca.
4556 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
4557 (print_depth, new_backquote_output, print_number_index):
4558 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
4559 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
4560 (Fset_process_window_size, Fformat_network_address)
4561 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 4562 (sigchld_handler):
d311d28c 4563 Check that fixnums are in proper range for system types.
d44287d4 4564 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
4565 Check for process-ids out of pid_t range rather than relying on
4566 undefined behavior.
e4d81efc 4567 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
4568 (Fformat_network_address, read_process_output, send_process)
4569 (Fprocess_send_region, status_notify):
4570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4571 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
4572 (wait_reading_process_output, read_process_output, exec_sentinel):
4573 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4574 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
4575 (Faccept_process_output): Use duration_to_sec_usec to do proper
4576 overflow checking on durations.
dde14581
PE
4577 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
4578 Don't assume pid_t fits in int.
02481186
PE
4579 * process.h (struct Lisp_Process): Members tick and update_tick
4580 are now of type EMACS_INT, not int.
b62b53e8
PE
4581 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
4582 configured --with-wide-int.
d311d28c
PE
4583 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
4584 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
4585 * search.c (looking_at_1, string_match_1):
4586 (fast_string_match, fast_c_string_match_ignore_case)
4587 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
4588 (scan_newline, find_before_next_newline, search_command)
4589 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
4590 (set_search_regs, wordify):
4591 (Freplace_match):
4592 (Fmatch_data):
4593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4594 (string_match_1, search_buffer, set_search_regs):
4595 (Fmatch_data):
4596 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4597 (wordify): Check for overflow in size calculation.
4598 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
4599 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
4600 Check that fixnums are in proper range for system types.
4601 * sound.c (struct sound_device)
4602 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
4603 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4604 (Fplay_sound_internal):
4605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 4606 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
4607 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
4608 (Fparse_partial_sexp):
4609 Don't assume fixnums can fit in int.
4610 (struct lisp_parse_state, find_start_pos, find_start_value)
4611 (find_start_value_byte, find_start_begv)
4612 (update_syntax_table, char_quoted, dec_bytepos)
4613 (find_defun_start, prev_char_comend_first, back_comment):
4614 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
4615 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
4616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4617 (Finternal_describe_syntax_value): Check that match_lisp is a
4618 character, not an integer, since the code stuffs it into int.
4619 (scan_words, scan_sexps_forward):
4620 Check that fixnums are in proper range for system types.
4621 (Fforward_word):
4622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4623 (scan_sexps_forward):
4624 Use CHARACTERP, not INTEGERP, since the value must fit into int.
4625 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4626 * syntax.h: Adjust decls to match defn changes elsewhere.
4627 (struct gl_state_s):
4628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
4629 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4630 MOST_POSITIVE_FIXNUM.
d311d28c
PE
4631 * sysdep.c (wait_for_termination_1, wait_for_termination)
4632 (interruptible_wait_for_termination, mkdir):
4633 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4634 (emacs_read, emacs_write):
4635 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
4636 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4637 and double all fit in int.
d311d28c
PE
4638 * term.c (set_tty_color_mode):
4639 Check that fixnums are in proper range for system types.
4640 * termhooks.h (struct input_event):
4641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4642 * textprop.c (validate_interval_range, interval_of)
4643 (Fadd_text_properties, set_text_properties_1)
4644 (Fremove_text_properties, Fremove_list_of_text_properties)
4645 (Ftext_property_any, Ftext_property_not_all)
4646 (copy_text_properties, text_property_list, extend_property_ranges)
4647 (verify_interval_modification):
4648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4649 (Fnext_single_char_property_change)
4650 (Fprevious_single_char_property_change):
4651 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
4652 (copy_text_properties):
4653 Check for integer overflow in index calculation.
d311d28c
PE
4654 * undo.c (last_boundary_position, record_point, record_insert)
4655 (record_delete, record_marker_adjustment, record_change)
4656 (record_property_change):
4657 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4658 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4659 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4660 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4661 (Fx_hide_tip, Fx_file_dialog):
4662 * w32menu.c (set_frame_menubar):
4663 Use ptrdiff_t, not int, for consistency with rest of code.
4664 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4665 (select_window, Fdelete_other_windows_internal)
4666 (window_scroll_pixel_based, window_scroll_line_based)
4667 (Frecenter, Fset_window_configuration):
4668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4669 (Fset_window_hscroll, run_window_configuration_change_hook)
4670 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 4671 (Fscroll_other_window, Frecenter):
d311d28c
PE
4672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4673 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4674 Don't assume fixnum fits in int.
4675 (Fset_window_scroll_bars):
4676 Check that fixnums are in proper range for system types.
4677 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4678 (string_pos, c_string_pos, number_of_chars, init_iterator)
4679 (in_ellipses_for_invisible_text_p, init_from_display_pos)
4680 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4681 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
4682 (face_before_or_after_it_pos, handle_invisible_prop)
4683 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
4684 (display_prop_intangible_p, string_buffer_position_lim)
4685 (string_buffer_position, handle_composition_prop, load_overlay_strings)
4686 (get_overlay_strings_1, get_overlay_strings)
4687 (iterate_out_of_display_property, forward_to_next_line_start)
4688 (back_to_previous_visible_line_start, reseat, reseat_to_string)
4689 (get_next_display_element, set_iterator_to_next)
4690 (get_visually_first_element, compute_stop_pos_backwards)
4691 (handle_stop_backwards, next_element_from_buffer)
4692 (move_it_in_display_line_to, move_it_in_display_line)
4693 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4694 (add_to_log, message_dolog, message_log_check_duplicate)
4695 (message2, message2_nolog, message3, message3_nolog
4696 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4697 (current_message_1, truncate_echo_area, truncate_message_1)
4698 (set_message, set_message_1, store_mode_line_noprop)
4699 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4700 (text_outside_line_unchanged_p, check_point_in_composition)
4701 (reconsider_clip_changes)
4702 (redisplay_internal, set_cursor_from_row, try_scrolling)
4703 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4704 (redisplay_window, find_last_unchanged_at_beg_row)
4705 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4706 (trailing_whitespace_p, find_row_edges, display_line)
4707 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4708 (display_mode_element, store_mode_line_string)
4709 (pint2str, pint2hrstr, decode_mode_spec)
4710 (display_count_lines, display_string, draw_glyphs)
4711 (x_produce_glyphs, x_insert_glyphs)
4712 (rows_from_pos_range, mouse_face_from_buffer_pos)
4713 (fast_find_string_pos, mouse_face_from_string_pos)
4714 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4716 (safe_call, init_from_display_pos, handle_fontified_prop)
4717 (handle_single_display_spec, load_overlay_strings)
4718 (with_echo_area_buffer, setup_echo_area_for_printing)
4719 (display_echo_area, echo_area_display)
4720 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4721 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
4722 (redisplay_window, dump_glyph_row, display_mode_line)
4723 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 4724 (handle_display_spec, display_prop_string_p):
d311d28c
PE
4725 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4726 (handle_single_display_spec, build_desired_tool_bar_string)
4727 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4728 (get_specified_cursor_type):
4729 Check that fixnums are in proper range for system types.
4730 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4731 (Flookup_image_map):
4732 Don't assume fixnums fit in int.
4733 (compare_overlay_entries):
4734 Avoid mishandling comparisons due to subtraction overflow.
4735 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4736 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4737 (handle_tool_bar_click):
4738 Use int, not unsigned, since we prefer signed and the signedness
4739 doesn't matter here.
4740 (get_next_display_element, next_element_from_display_vector):
4741 Use int, not EMACS_INT, when int is wide enough.
4742 (start_hourglass): Use duration_to_sec_usec to do proper
4743 overflow checking on durations.
4744 * xfaces.c (Fbitmap_spec_p):
4745 Check that fixnums are in proper range for system types.
4746 (compare_fonts_by_sort_order):
4747 Avoid mishandling comparisons due to subtraction overflow.
4748 (Fx_family_fonts, realize_basic_faces):
4749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4750 (Fx_family_fonts):
4751 Don't assume fixnum fits in int.
4752 Use SAFE_ALLOCA_LISP, not alloca.
4753 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4754 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4755 (face_at_buffer_position, face_for_overlay_string)
4756 (face_at_string_position):
4757 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4758 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
4759 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
4760 (Fx_show_tip):
4761 Check that fixnums are in proper range for system types.
4762 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4763 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
4764 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4765 (Fx_change_window_property): Don't assume fixnums fit in int.
4766 * xfont.c (xfont_chars_supported):
4767 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4768 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
4769 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
4770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4771 * xml.c (parse_region):
4772 * xrdb.c (magic_file_p):
4773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4774 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
4775 (x_get_local_selection, x_reply_selection_request)
4776 (x_handle_selection_request, wait_for_property_change):
4777 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4778 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
4779 short is wide enough.
4780 (x_send_client_event): Don't assume fixnum fits in int.
4781 * xterm.c (x_x_to_emacs_modifiers):
4782 Don't assume EMACS_INT overflows nicely into int.
4783 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4784 may come from Lisp.
4785 (handle_one_xevent): NATNUMP can eval its arg twice.
4786 (x_connection_closed):
4787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4788 * xterm.h: Adjust decls to match defn changes elsewhere.
4789 (struct scroll_bar): Use struct vectorlike_header
4790 rather than rolling our own approximation.
4791 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4792
c6574eb5
GM
47932012-05-25 Glenn Morris <rgm@gnu.org>
4794
4795 * lisp.mk (lisp): Update for more files being compiled now.
4796
e8d32c7e
SM
47972012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4798
48def666
SM
4799 * lread.c: Remove `read_pure' which makes no difference.
4800 (read_pure): Remove var.
4801 (unreadpure): Remove function.
4802 (readevalloop): Don't call read_list with -1 flag.
4803 (read1, read_vector): Don't test read_pure any more.
4804 (read_list): Simplify.
4805
e8d32c7e
SM
4806 * fileio.c, character.h: Minor style tweaks.
4807
4b2addb7
DA
48082012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4809
4810 * window.h (clip_changed): Remove useless declaration.
4811
584461b2
JB
48122012-05-22 Juanma Barranquero <lekktu@gmail.com>
4813
4814 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4815 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4816
34374650
PE
48172012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4818
4819 Remove src/m/*.
4820 This directory predates autoconf and is no longer needed nowadays.
4821 Move its few remaining bits of functionality to where they're needed.
4822 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4823 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4824 * m/template.h: Remove.
4825 * Makefile.in (M_FILE): Remove. All uses removed.
4826 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4827 * lisp.h (USE_LSB_TAG):
4828 * mem-limits.h (EXCEEDS_LISP_PTR):
4829 Use VAL_MAX, not VALBITS, in #if.
4830 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4831 (EMACS_UINT): Define unconditionally now.
4832 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4833 (BITS_PER_EMACS_INT): New constants, replacing
4834 what used to be in config.h, but not useful in #if.
4835 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4836 define them any more.
4837 (VAL_MAX): New macro.
4838 (VALMASK): Use it.
4839 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4840 BITS_PER_EMACS_INT, in #if.
4841 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4842 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4843 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4844 * s/ms-w32.h (DATA_START):
4845 Move here from removed file m/intel386.h.
4846 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4847 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4848
261cb4bb
PE
48492012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4850
4851 Assume C89 or later.
4852 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4853 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4854 (xrealloc):
4855 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4856 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4857 * textprop.c, tparam.c (NULL): Remove.
4858 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4859 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4860 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4861 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4862 * xterm.c (input_signal_count): Assume volatile works.
4863
ff23cd9f
KB
48642012-05-21 Ken Brown <kbrown@cornell.edu>
4865
4866 * xgselect.c (xg_select): Fix first argument in call to 'select'
4867 (bug#11508).
4868
1b170bc6
KB
48692012-05-20 Ken Brown <kbrown@cornell.edu>
4870
4871 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 4872 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 4873
b2f4d39f
KB
48742012-05-19 Ken Brown <kbrown@cornell.edu>
4875
4876 * xfns.c (x_in_use): Remove `static' qualifier.
4877 * xterm.h (x_in_use): Declare.
4878 * xgselect.c: Include xterm.h.
4879 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4880 and `display_arg' (bug#9754).
4881
003fdae2
PE
48822012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4883
9232a6d9
PE
4884 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4885
003fdae2
PE
4886 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4887 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4888
784b56e2
EZ
48892012-05-18 Eli Zaretskii <eliz@gnu.org>
4890
4891 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4892
4893 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 4894 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
4895
4896 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4897 reference to image_cache->refcount.
4898 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4899
a0a79cde
JL
49002012-05-17 Juri Linkov <juri@jurta.org>
4901
4902 * search.c (Fword_search_regexp, Fword_search_backward)
4903 (Fword_search_forward, Fword_search_backward_lax)
4904 (Fword_search_forward_lax): Move functions to isearch.el
4905 (bug#10145, bug#11381).
4906
b0572523
PE
49072012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4908
4909 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4910
9660f5fc
SM
49112012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4912
4913 * lread.c (init_obarray): Declare Qt and Qnil as special.
4914
4374de83
GM
49152012-05-14 Glenn Morris <rgm@gnu.org>
4916
4917 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 4918 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 4919
dc44c39a
PE
49202012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4921
078c97cb
PE
4922 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4923
dc44c39a
PE
4924 * unexaix.c: Port to more-recent AIX compilers.
4925 (report_error, report_error_1, make_hdr, copy_sym)
4926 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4927 Make arguments const char *, not char *, to avoid violations of C
4928 standard and to fix some AIX warnings reported by Gilles Pion.
4929
e18afed7 49302012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
4931
4932 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4933 already have overlays loaded.
4934 (handle_single_display_spec): Before returning without displaying
4935 fringe bitmap, synchronize the bidi iterator with the main display
4936 iterator, by calling iterate_out_of_display_property.
4937 (iterate_out_of_display_property): Detect buffer iteration by
4938 testing that it->string is a Lisp string.
4939 (get_next_display_element): When the current object is exhausted,
4940 and there's something on it->stack, call set_iterator_to_next to
4941 proceed with what's on the stack, instead of returning zero.
4942 (set_iterator_to_next): If called at the end of a Lisp string,
4943 proceed to consider_string_end without incrementing string
4944 position. Don't increment display vector index past the end of
4945 the display vector. (Bug#11417)
c8fb9dc6
EZ
4946 (pos_visible_p): Don't report a position visible when move_it_to
4947 stopped at the last line of window, which happens to be scanned
4948 backwards by the bidi iteration. (Bug#11464)
ac268e67 4949
e18afed7 49502012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
4951
4952 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4953 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
4954 are on a TTY, and thus unable to display on the fringes.
4955 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
4956 so we need to signal to the caller that this is a "replacing"
4957 display spec. This fixes display when the spec is invalid or we
4958 are on a TTY.
4959
e18afed7 49602012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
4961
4962 * unexaix.c (make_hdr): Fix typo in prototype.
4963 This bug broke the build on AIX. Problem reported by Gilles Pion.
4964
9d0a235a
MA
49652012-05-14 Michael Albinus <michael.albinus@gmx.de>
4966
4967 * keyboard.c (kbd_buffer_get_event): Read special events also in
4968 batch mode. (Bug#11415)
4969
9e6b06ed
GM
49702012-05-12 Glenn Morris <rgm@gnu.org>
4971
4972 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4973
c1a1d7a3
EZ
49742012-05-12 Eli Zaretskii <eliz@gnu.org>
4975
4976 * lisp.mk (lisp): Add newcomment.elc.
4977
3fe7cdc8
GM
49782012-05-12 Glenn Morris <rgm@gnu.org>
4979
4980 * Makefile.in (MKDIR_P): New, set by configure.
4981 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4982
53f7d2c0
PE
49832012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4984
4985 Remove unused function hourglass_started.
4986 * dispextern.h (hourglass_started):
4987 * w32fns.c (hourglass_started):
4988 * xdisp.c (hourglass_started): Remove.
4989
75aafb17
JB
49902012-05-10 Juanma Barranquero <lekktu@gmail.com>
4991
4992 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4993 Update dependencies.
4994
12959e8e
PE
49952012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4996
97107e2e
PE
4997 * xgselect.c (xg_select): Put maxfds+1 into a var.
4998 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4999
12959e8e
PE
5000 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5001
836d29b3
DA
50022012-05-10 Dave Abrahams <dave@boostpro.com>
5003
5004 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5005 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
5006
5cb67954
MA
50072012-05-09 Michael Albinus <michael.albinus@gmx.de>
5008
5009 * dbusbind.c (xd_registered_buses): New internal Lisp object.
5010 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5011 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5012 Initialize xd_registered_buses.
5013
3478ec45
PE
50142012-05-09 Paul Eggert <eggert@cs.ucla.edu>
5015
b263a6b0
PE
5016 Untag more efficiently if USE_LSB_TAG.
5017 This is based on a proposal by YAMAMOTO Mitsuharu in
5018 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5019 For an admittedly artificial (nth 8000 longlist) benchmark on
5020 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
5021 Emacs's overall text size by 1%.
5022 * lisp.h (XUNTAG): New macro.
5023 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5024 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5025 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5026 * eval.c (Fautoload):
5027 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5028 * frame.h (XFRAME): Use XUNTAG.
5029
3478ec45
PE
5030 Port recent dbusbind.c changes to 32-bit --with-wide-int.
5031 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5032 Remove unportable assumptions about print widths of types like
5033 dbus_uint32_t.
5034 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5035 intptr_t when converting between pointer and integer, to avoid GCC
5036 warnings about wrong width.
5037
666b903b 50382012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
5039
5040 * w32proc.c (new_child): Force Windows to reserve only 64KB of
5041 stack for each reader_thread, instead of defaulting to 8MB
5042 determined by the linker. This avoids failures in creating
5043 subprocesses on Windows 7, see the discussion in this thread:
5044 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5045
b120cc17
JC
50462012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
5047
5048 Fix up display of the *Minibuf-0* buffer in the mini window.
5049 * keyboard.c (read_char): Don't clear the echo area if there's no
5050 message to clear.
5051 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 5052 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 5053
9a4b36f8
MA
50542012-05-07 Michael Albinus <michael.albinus@gmx.de>
5055
5056 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
5057 batch mode.
5058
e5f9458f
CY
50592012-05-06 Chong Yidong <cyd@gnu.org>
5060
5061 * lisp.mk (lisp): Update.
5062
eceeb5fc 50632012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
5064
5065 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
5066
71873e2b
SM
50672012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
5068
5069 * data.c (PUT_ERROR): New macro.
5070 (syms_of_data): Use it. Add new error type `user-error'.
5071 * undo.c (user_error): New function.
5072 (Fprimitive_undo): Use it.
5073 * print.c (print_error_message): Adjust print style for `user-error'.
5074 * keyboard.c (user_error): New function.
5075 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
5076
ab0fa4e4
PE
50772012-05-03 Paul Eggert <eggert@cs.ucla.edu>
5078
5079 Do not limit current-time-string to years 1000..9999.
5080 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
5081 (Fcurrent_time_string): Support any year that is supported by the
5082 underlying localtime representation. Don't use asctime, as it
5083 has undefined behavior for years outside the range -999..9999.
5084
7ed806a7
PE
50852012-05-02 Paul Eggert <eggert@cs.ucla.edu>
5086
5087 Fix race conditions involving setenv, gmtime, localtime, asctime.
5088 Without this fix, interrupts could mess up code that uses these
5089 nonreentrant functions, since setting TZ invalidates existing
5090 tm_zone or tzname values, and since most of these functions return
5091 pointers to static storage.
5092 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
5093 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
5094 Grow the critical sections to include not just invoking
5095 localtime/gmtime, but also accessing these functions' results
5096 including their tm_zone values if any, and any related TZ setting.
5097 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
5098 so that the struct tm is saved in the critical section.
5099 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
5100 motivated by the fact that memory allocation needs to be outside
5101 the critical section.
5102
0c16dfed
DA
51032012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
5104
5105 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
5106 with RESET_INTERVAL.
5107
5108 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5109 Remove duplicated buffer name initialization.
5110
3f83ace8
JM
51112012-05-02 Jim Meyering <jim@meyering.net>
5112
5113 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
5114
c7b8541e
JM
5115 * xfns.c (x_window): Use xstrdup (Bug#11375).
5116
90207a15 51172012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
5118
5119 * xdisp.c (pos_visible_p): If already at a newline from the
5120 display string before the 'while' loop, don't walk back the glyphs
5121 from it3.glyph_row. Solves assertion violation when the display
5122 string begins with a newline (egg.el). (Bug#11367)
5123
b593d6a9
AH
51242012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
5125
5126 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
5127 Move to simple.el.
5128
4737362e
GM
51292012-05-01 Glenn Morris <rgm@gnu.org>
5130
99cf43f9
GM
5131 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
5132 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
5133 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
5134 All were removed before 23.1.
5135
9311dcff
GM
5136 * dispnew.c: Remove HAVE_LIBNCURSES test;
5137 it is always true on relevant platforms.
5138
4d5c6349
GM
5139 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
5140 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
5141
4737362e
GM
5142 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
5143
74dd3a6b
AS
51442012-04-30 Andreas Schwab <schwab@linux-m68k.org>
5145
5146 * .gdbinit (xpr): Remove checks for no longer existing misc types.
5147 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
5148 Remove.
5149
13c379ee
PE
51502012-04-28 Paul Eggert <eggert@cs.ucla.edu>
5151
5152 Do not avoid creating empty evaporating overlays (Bug#9642).
5153 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
5154 That is, do not delete an evaporating overlay if it becomes
5155 empty after its bounds are adjusted to fit within its buffer.
5156 This fix caused other problems, and I'm reverting it until we get
5157 to the bottom of them.
5158
a8e7d6d7 51592012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
5160
5161 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
5162
a8e7d6d7 51632012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
5164
5165 * xdisp.c (pos_visible_p): If the window start position is beyond
5166 ZV, start the display from buffer beginning. Prevents assertion
5167 violation in init_iterator when the minibuffer window is scrolled
5168 via the scroll bar.
5169
5170 * window.c (window_scroll_pixel_based): Likewise.
5171
a8e7d6d7 51722012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
5173
5174 * keymap.c (where_is_internal): Doc fix (Bug#10872).
5175
a8e7d6d7 51762012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
5177
5178 * fileio.c (Fcopy_file, Fset_file_selinux_context):
5179 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
5180
a8e7d6d7 51812012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 5182
b593d6a9
AH
5183 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
5184 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 5185
1c6900d9
EZ
51862012-04-26 Eli Zaretskii <eliz@gnu.org>
5187
4c3fa1d9
EZ
5188 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
5189 display element, check also the underlying string or buffer
5190 character. (Bug#11341)
5191
1c6900d9
EZ
5192 * w32menu.c: Include w32heap.h.
5193 (add_menu_item): If the call to AppendMenuW (via
5194 unicode_append_menu) fails, disable Unicode menus only if we are
5195 running on Windows 9X/Me.
5196
42bf8205
AS
51972012-04-24 Andreas Schwab <schwab@linux-m68k.org>
5198
5199 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
5200 (xgetint): Add missing shift for LSB tags.
5201
b1bac16e
MR
52022012-04-24 Martin Rudalics <rudalics@gmx.at>
5203
5204 * keyboard.c (read_char): Don't wipe echo area for select window
5205 events: These might get delayed via `mouse-autoselect-window'
5206 (Bug#11304).
5207
d69621cc
JB
52082012-04-24 Juanma Barranquero <lekktu@gmail.com>
5209
5210 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
5211 manipulation of :loaded-from data.
5212
02fd101b
JB
52132012-04-23 Juanma Barranquero <lekktu@gmail.com>
5214
5215 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
5216 now a cons (bug#11311).
5217
888bec30
PE
52182012-04-23 Paul Eggert <eggert@cs.ucla.edu>
5219
89a438bd
PE
5220 Do not create empty overlays with the evaporate property (Bug#9642).
5221 * buffer.c (Fmove_overlay): Delete an evaporating overlay
5222 if it becomes empty after its bounds are adjusted to fit within
5223 its buffer. Without this fix, in a nonempty buffer (let ((o
5224 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
5225 yields an empty overlay that has the evaporate property, which is
5226 not supposed to happen.
5227
1068fe4d
PE
5228 Fix minor GTK3 problems found by static checking.
5229 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5230 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5231 (struct _EmacsFixedClass, emacs_fixed_get_type):
5232 Move decls here from emacsgtkfixed.h, since they needn't be public.
5233 (emacs_fixed_get_type): Now static.
5234 (emacs_fixed_class_init): Omit unused local.
5235 (emacs_fixed_child_type): Remove; unused.
5236 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5237 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5238 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
5239 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
5240 (EMACS_FIXED_GET_CLASS): Remove; unused.
5241 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
5242
888bec30
PE
5243 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
5244 Problem reported by Juanma Barranquero for Windows -Wunused-function.
5245
de85e130
PE
52462012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5247
d0baac98 5248 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 5249 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
5250 (__malloc_size_t, __malloc_ptrdiff_t):
5251 Remove. All uses removed, replaced by the definiens if needed,
5252 since we can assume C89 or better now.
5253 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
5254 (protect_malloc_state, align, get_contiguous_space)
5255 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
5256 (malloc_atfork_handler_child, malloc_enable_thread)
5257 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
5258 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
5259 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
5260 (special_realloc, _realloc_internal_nolock, _realloc_internal)
5261 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
5262 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
5263 Define using prototypes, not old style.
5264 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
5265 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
5266 (align): Don't assume that signed integer overflow wraps around.
5267 Omit unused local var.
5268 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
5269 (_free_internal_nolock, memalign, mallochook, reallochook):
5270 Omit no-longer-needed casts.
5271 (valloc): Use getpagesize, not __getpagesize.
5272 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
5273 (struct hdr): The 'magic' member is now size_t, not unsigned long.
5274
de85e130
PE
5275 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
5276
dcbf5805
MA
52772012-04-22 Michael Albinus <michael.albinus@gmx.de>
5278
5279 Move functions from C to Lisp. Make non-blocking method calls
5280 the default. Implement further D-Bus standard interfaces.
5281
5282 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
5283 (QCdbus_request_name_allow_replacement)
5284 (QCdbus_request_name_replace_existing)
5285 (QCdbus_request_name_do_not_queue)
5286 (QCdbus_request_name_reply_primary_owner)
5287 (QCdbus_request_name_reply_in_queue)
5288 (QCdbus_request_name_reply_exists)
5289 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
5290 (QCdbus_registered_serial, QCdbus_registered_method)
5291 (QCdbus_registered_signal): New Lisp objects.
5292 (XD_DEBUG_MESSAGE): Use sizeof.
5293 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
5294 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
5295 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
5296 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
5297 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
5298 (xd_signature, xd_append_arg): Allow float for integer types.
5299 (xd_get_connection_references): New function.
b593d6a9
AH
5300 (xd_get_connection_address): Rename from xd_initialize.
5301 Return cached address.
dcbf5805
MA
5302 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
5303 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
5304 level.
5305 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 5306 Return number of refcounts.
dcbf5805
MA
5307 (Fdbus_get_unique_name): Make stronger parameter check.
5308 (Fdbus_message_internal): New defun.
5309 (Fdbus_call_method, Fdbus_call_method_asynchronously)
5310 (Fdbus_method_return_internal, Fdbus_method_error_internal)
5311 (Fdbus_send_signal, Fdbus_register_service)
5312 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
5313 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
5314 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
5315 (Vdbus_compiled_version, Vdbus_runtime_version)
5316 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
5317 (Vdbus_message_type_method_return, Vdbus_message_type_error)
5318 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
5319 (Vdbus_registered_buses, Vdbus_registered_objects_table):
5320 Adapt docstring.
dcbf5805 5321
52828e02
PE
53222012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5323
da05bc4c
PE
5324 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
5325 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
5326 Do not assume ptrdiff_t is the same width as 'int'.
5327
52828e02
PE
5328 * alloc.c: Handle unusual debugging option combinations.
5329 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5330 since the two debugging options are incompatible.
5331 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
5332 is defined.
5333 (mem_init, mem_insert, mem_insert_fixup):
5334 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
5335 (NEED_MEM_INSERT): Remove; no longer needed.
5336
f01769f9
LL
53372012-04-22 Leo Liu <sdl.web@gmail.com>
5338
5339 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
5340
5790543d
PE
53412012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5342
5343 * sysdep.c [__FreeBSD__]: Minor cleanups.
5344 (list_system_processes, system_process_attributes) [__FreeBSD__]:
5345 Use Emacs indenting style more consistently. Avoid some casts.
5346 Use 'double' consistently rather than mixing 'float' and 'double'.
5347
b91b7e4d
EW
53482012-04-21 Eduard Wiebe <usenet@pusto.de>
5349
b593d6a9
AH
5350 * sysdep.c (list_system_processes, system_process_attributes):
5351 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 5352
6114eb15
AS
53532012-04-21 Andreas Schwab <schwab@linux-m68k.org>
5354
5355 * lisp.mk (lisp): Update.
5356
2f38dff7
PE
53572012-04-20 Paul Eggert <eggert@cs.ucla.edu>
5358
5359 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
5360 It is never used otherwise.
5361
4ae29f89
SM
53622012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
5363
5364 * print.c (print_preprocess): Only check print_depth if print-circle
5365 is nil.
5366 (print_object): Check for cycles even when print-circle is nil and
5367 print-gensym is t, but only check print_depth if print-circle is nil.
5368
f30d612a
CY
53692012-04-20 Chong Yidong <cyd@gnu.org>
5370
5371 * process.c (wait_reading_process_output): If EIO occurs on a pty,
5372 set the status to "failed" and ensure that sentinel is run.
5373
c07a4c0b 53742012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
5375
5376 * process.c (Fset_process_inherit_coding_system_flag)
5377 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 5378 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 5379
c07a4c0b 53802012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
5381
5382 * xdisp.c (string_buffer_position_lim): Limit starting position to
5383 BEGV.
5384 (set_cursor_from_row): If called for a mode-line or header-line
5385 row, return zero immediately.
5386 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
5387 farther than the first row after the header line, if any.
5388 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
5389 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
5390
c07a4c0b 53912012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 5392
4ae29f89
SM
5393 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
5394 (bug#11238).
ad3a2b41 5395
c07a4c0b 53962012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 53972012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
5398
5399 configure: new option --enable-gcc-warnings (Bug#11207)
5400 * Makefile.in (C_WARNINGS_SWITCH): Remove.
5401 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
5402 (ALL_CFLAGS): Use new macros rather than old.
5403 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
5404 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
5405 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
5406 -Wunused-result, -Wunused-variable. This should go away once
5407 the Emacs and Gnulib regex code is merged.
5408 (xmalloc, xrealloc): Now static.
5409
aba027e8
PE
54102012-04-17 Paul Eggert <eggert@cs.ucla.edu>
5411
5412 * dired.c (Fsystem_groups): Remove unused local.
5413
e5a36063
GM
54142012-04-17 Glenn Morris <rgm@gnu.org>
5415
5416 * dired.c (Fsystem_users): Doc fix.
5417
316411f0
DA
54182012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
5419
5420 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
5421 (syms_of_dired): Add them.
5422
9426aba4
PE
54232012-04-16 Paul Eggert <eggert@cs.ucla.edu>
5424
b62a57be
PE
5425 Fix minor alloc.c problems found by static checking.
5426 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
5427 New extern decls, to avoid calling undeclared functions.
5428 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
5429 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
5430 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
5431 (NEED_MEM_INSERT): New macro.
5432 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 5433 Remove one incorrect comment and fix another.
b62a57be 5434
3539f31f
PE
5435 Fix minor ralloc.c problems found by static checking.
5436 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5437 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
5438 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
5439 (r_alloc_sbrk): Now static.
5440
a041960a
PE
5441 Improve ralloc.c interface checking.
5442 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5443 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
5444 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
5445 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
5446 [REL_ALLOC]: ... to here, to check interface.
5447 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
5448 Remove decls. This fixes an "It stinks!".
5449
9426aba4
PE
5450 * alloc.c (which_symbols): Fix alignment issue / type clash.
5451
d55c12ed
AS
54522012-04-15 Andreas Schwab <schwab@linux-m68k.org>
5453
5454 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
5455 (struct Lisp_Misc_Any): Likewise.
5456 (struct Lisp_Free): Likewise.
5457 * alloc.c (union aligned_Lisp_Symbol): Define.
5458 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
5459 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
5460 (union aligned_Lisp_Misc): Define.
5461 (MARKER_BLOCK_SIZE, struct marker_block): Use union
5462 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 5463 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 5464
b948ce8b
PE
54652012-04-14 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
5468 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
5469 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
5470 * s/netbsd.h, s/sol2-6.h:
5471 Remove definition of GC_MARK_STACK, since the default now works.
5472 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
5473 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
5474 no longer the default.
5475 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
5476
35dc09a1 54772012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 5478
35dc09a1
GM
5479 * lread.c (lisp_file_lexically_bound_p):
5480 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 5481
35dc09a1
GM
54822012-04-14 Eli Zaretskii <eliz@gnu.org>
5483
5484 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
5485 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
5486
54872012-04-14 Jan Djärv <jan.h.d@swipnet.se>
5488
5489 * nsterm.m (constrainFrameRect): Always constrain when there is only
5490 one screen (Bug#10962).
5491
bcd86815
KB
54922012-04-13 Ken Brown <kbrown@cornell.edu>
5493
5494 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
5495
c25df26e
RT
54962012-04-13 Reuben Thomas <rrt@sc3d.org>
5497
5498 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
5499
0fc59f1e
DC
55002012-04-11 Daniel Colascione <dancol@dancol.org>
5501
5502 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
5503 against is gone. It's better to use vfork now so that when Cygwin
5504 gains a new, working vfork, we use it automatically (bug#10398).
5505
de8c03dc
SM
55062012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5507
5508 * window.c (save_window_save): Obey window-point-insertion-type.
5509
2f097256
GM
55102012-04-11 Glenn Morris <rgm@gnu.org>
5511
5512 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
5513
453b951e
SM
55142012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5515
5516 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
5517
75f1671a 55182012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
5519
5520 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
5521 (force_quit_count): New var.
5522 (handle_interrupt): Use it.
5523
2a8ce227
JB
55242012-04-10 Juanma Barranquero <lekktu@gmail.com>
5525
5526 * w32.c (w32_delayed_load): Record the full path of the library
5527 being loaded (bug#10424).
5528
935396c0
GM
55292012-04-09 Glenn Morris <rgm@gnu.org>
5530
05920a43
GM
5531 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
5532 not just in the obarray, before snarfing them. (Bug#11036)
5533
935396c0
GM
5534 * Makefile.in ($(leimdir)/leim-list.el):
5535 Pass EMACS rather than BUILT_EMACS.
5536
a18ecafa
TZ
55372012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
5538
5539 * process.c (make_process):
5540 * process.h: Add integer `gnutls_handshakes_tried' member to
5541 process struct.
5542
6bbef4e5
JC
5543 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
5544 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
5545
5546 * gnutls.c (gnutls_log_function2i): Convenience log function.
5547 (emacs_gnutls_read): Use new log functions,
5548 `gnutls_handshakes_tried' process member, and
5549 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
5550 attempts per process (connection).
5551
b4d3bc10
CY
55522012-04-09 Chong Yidong <cyd@gnu.org>
5553
5554 * eval.c (Fuser_variable_p, user_variable_p_eh)
5555 (lisp_indirect_variable): Functions deleted.
5556 (Fdefvar): Caller changed.
5557
5558 * callint.c (Finteractive, Fcall_interactively):
5559 * minibuf.c (Fread_variable): Callers changed.
5560
70f4d973
EZ
55612012-04-09 Eli Zaretskii <eliz@gnu.org>
5562
5563 * xdisp.c (set_cursor_from_row): If the display string appears in
5564 the buffer at position that is closer to point than the position
5565 after the display string, display the cursor on the first glyph of
5566 the display string. Fixes cursor display when a 'display' text
5567 property immediately follows invisible text. (Bug#11094)
5568
cb3c2e3e
PE
55692012-04-09 Paul Eggert <eggert@cs.ucla.edu>
5570
5571 composite.c: use 'double' consistently
5572 * composite.c (get_composition_id): Use 'double' consistently
5573 instead of converting 'float' to 'double' and vice versa; this is
5574 easier to understand and avoids a GCC warning.
5575
fd06db5d
GM
55762012-04-09 Glenn Morris <rgm@gnu.org>
5577
50fe702a
GM
5578 * Makefile.in: Generate leim-list with bootstrap-emacs, in
5579 preparation for dumping it with emacs. (Bug#4789)
5580 (leimdir): New variable.
5581 ($(leimdir)/leim-list.el): New rule.
5582 (emacs$(EXEEXT)): Depend on leim-list.el.
5583
fd06db5d
GM
5584 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
5585 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
5586 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
5587
55c131ee
AS
55882012-04-08 Andreas Schwab <schwab@linux-m68k.org>
5589
5590 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
5591 proper alignment.
5592
9209588f
JB
55932012-04-07 Juanma Barranquero <lekktu@gmail.com>
5594
5595 * xml.c (init_libxml2_functions) [WINDOWSNT]:
5596 Remove unused local variable.
5597
e3fb2efb
PE
55982012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5599
5600 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
5601 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
5602 (mark_memory): Mark Lisp_Objects only if pointers might hide in
5603 objects, as mark_maybe_pointer will catch them otherwise.
5604 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
5605 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
5606
b5385551
PE
56072012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5608
5609 Fix typo that broke non-Windows builds.
5610 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
5611
9078ead6
EZ
56122012-04-07 Eli Zaretskii <eliz@gnu.org>
5613
5614 Support building on MS-Windows with libxml2.
5615
5616 * makefile.w32-in (OBJ2): Add xml.$(O).
5617 (GLOBAL_SOURCES): Add xml.c.
5618 ($(BLD)/xml.$(O)): New dependency list.
5619
5620 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5621 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5622 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5623 [!WINDOWSNT]: New macros.
5624 (init_libxml2_functions, libxml2_loaded_p): New functions.
5625 (parse_region): Call fn_xmlCheckVersion instead of using the macro
5626 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
5627 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5628 Calls xmlCleanupParser only if libxml2 was loaded (or statically
5629 linked in).
6bbef4e5
JC
5630 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5631 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
5632 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5633
5634 * emacs.c: Don't include libxml/parser.h.
5635 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5636 xmlCleanupParser directly.
5637
5638 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5639
3811fdf3
EZ
56402012-04-07 Eli Zaretskii <eliz@gnu.org>
5641
5642 * indent.c (Fvertical_motion): If there is a display string at
5643 point, use it.vpos to compute how many lines to backtrack after
5644 move_it_to point. (Bug#11133)
5645
2f8e16b2
EZ
56462012-04-06 Eli Zaretskii <eliz@gnu.org>
5647
5648 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5649 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5650 about subtle differences between FETCH_CHAR* and STRING_CHAR*
5651 macros related to unification of CJK characters. For the details,
5652 see the discussion following the message here:
5653 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5654
3d439cd1
CY
56552012-04-04 Chong Yidong <cyd@gnu.org>
5656
5657 * keyboard.c (Vdelayed_warnings_list): Doc fix.
5658
8bc53d00
EZ
56592012-04-01 Eli Zaretskii <eliz@gnu.org>
5660
5661 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5662 instead of alloca. (Bug#11138)
5663
3b0512a3
AS
56642012-04-01 Andreas Schwab <schwab@linux-m68k.org>
5665
5666 * w32menu.c (is_simple_dialog): Properly check lisp types.
5667 (Bug#11141)
5668
8427ddd2
EZ
56692012-03-31 Eli Zaretskii <eliz@gnu.org>
5670
979022ef
EZ
5671 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5672 position we get to after a call to move_it_to fails the
5673 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5674 only if we wind up in a string from display property. (Bug#11063)
5675
a6b1c7cc
EZ
5676 * window.c (Fdelete_other_windows_internal): Invalidate the row
5677 and column information about mouse highlight, so that redisplay
5678 restores it after reallocating the glyph matrices. (Bug#7464)
5679
8427ddd2
EZ
5680 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5681 string comes from a `display' text property, use the buffer
5682 position of that property as if we actually saw that position in
5683 the row's glyphs.
697ba24b
EZ
5684 (move_it_by_lines): Remove the assertion that
5685 "it->current_x == 0 && it->hpos == 0" which can be legitimately
5686 violated when there's a before-string at the beginning of a line.
5687 (Bug#11063)
8427ddd2 5688
65a0a738
EZ
56892012-03-30 Eli Zaretskii <eliz@gnu.org>
5690
5691 * xdisp.c (append_space_for_newline): If the default face was
5692 remapped, use the remapped face for the appended newline.
5693 (extend_face_to_end_of_line): Use the remapped default face for
5694 extending the face to the end of the line.
5695 (display_line): Call extend_face_to_end_of_line when the default
5696 face was remapped. (Bug#11068)
5697
581355cc
EZ
56982012-03-29 Eli Zaretskii <eliz@gnu.org>
5699
5700 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5701
e8fc049f
SM
57022012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5703
5704 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5705
4fb9a543
GM
57062012-03-27 Glenn Morris <rgm@gnu.org>
5707
5708 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5709 Doc fixes.
5710
679910f1
KH
57112012-03-26 Kenichi Handa <handa@m17n.org>
5712
5713 * dispextern.h (struct glyph): Fix previous change. Change the
5714 bit length of glyphless.ch to 25 (Bug#11082).
5715
90d49b7f
CY
57162012-03-26 Chong Yidong <cyd@gnu.org>
5717
5718 * keyboard.c (Vselection_inhibit_update_commands): New variable.
5719 (command_loop_1): Use it; inhibit selection update for
5720 handle-select-window too (Bug#8996).
5721
f514f6f0
FP
57222012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
5723
e8fc049f 5724 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 5725
bf43fa51
KH
57262012-03-25 Kenichi Handa <handa@m17n.org>
5727
5728 * dispextern.h (struct glyph): Change the bit length of
5729 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5730
8a0c01dd
EZ
57312012-03-24 Eli Zaretskii <eliz@gnu.org>
5732
5733 * s/ms-w32.h (tzname): Include time.h before redirecting to
5734 _tzname. Fixes the MSVC build. (Bug#9960)
5735
7d1c3a76
AS
57362012-03-24 Andreas Schwab <schwab@linux-m68k.org>
5737
8ed79523
AS
5738 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5739 characters.
5740
7d1c3a76
AS
5741 * xterm.c (XTread_socket): Only modify handling_signal if
5742 !SYNC_INPUT. (Bug#11080)
5743
e99a9b8b
EZ
57442012-03-23 Eli Zaretskii <eliz@gnu.org>
5745
5746 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5747 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
5748 when fetching a multibyte character consumes more bytes than
5749 CHAR_BYTES returns, due to unification of CJK characters in
5750 string_char. (Bug#11073)
5751
5063c0e1
TN
57522012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
5753
5754 * process.c (wait_reading_process_output): Handle pty disconnect
5755 by refraining from sending oneself a SIGCHLD (bug#10933).
5756
9f851fbd
CY
57572012-03-22 Chong Yidong <cyd@gnu.org>
5758
5759 * dispextern.h (struct it): New member string_from_prefix_prop_p.
5760
5063c0e1 5761 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
5762 Mark string as coming from a prefix property.
5763 (handle_face_prop): Use default face for prefix strings (Bug#4281).
5764 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
5765
fb5b8aca
CY
57662012-03-21 Chong Yidong <cyd@gnu.org>
5767
5768 * xfaces.c (Vface_remapping_alist): Doc fix.
5769
62356a1b
EZ
57702012-03-20 Eli Zaretskii <eliz@gnu.org>
5771
5772 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
5773 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
5774 Doc fixes.
62356a1b 5775
025de85b
CY
57762012-03-20 Chong Yidong <cyd@gnu.org>
5777
5778 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
5779 to reflect default non-nil value of redisplay-dont-pause.
5780
4827f94e
KH
57812012-03-19 Kenichi Handa <handa@m17n.org>
5782
5783 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5784 it fit in a valid range (Bug#11003).
5785
e50a24a2
EZ
57862012-03-18 Eli Zaretskii <eliz@gnu.org>
5787
5788 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5789 that is not from display property, accept the row as a "cursor
5790 row" if one of the string's character has a non-nil `cursor'
5791 property. Fixes cursor positioning when there are newlines in
5792 overlay strings, e.g. in icomplete.el. (Bug#11035)
5793
9af5ed87
PE
57942012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5795
5796 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5797
d1f55f16
CY
57982012-03-12 Chong Yidong <cyd@gnu.org>
5799
5800 * eval.c (inhibit_lisp_code): Rename from
5801 inhibit_window_configuration_change_hook; move from window.c.
5802
5803 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5804 * window.c (run_window_configuration_change_hook)
5805 (syms_of_window): Callers changed.
5806
66c5eebd
CY
58072012-03-11 Chong Yidong <cyd@gnu.org>
5808
413df973
CY
5809 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5810
66c5eebd
CY
5811 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5812
1de11f56
CY
58132012-03-10 Chong Yidong <cyd@gnu.org>
5814
5815 * frame.c (other_visible_frames): Don't assume the selected frame
5816 is visible (Bug#10955).
5817
cae07000
SM
58182012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5819
5820 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5821
89c94350
JD
58222012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5823
5824 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5825 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5826 zero (Bug#10954).
5827
999dd333
GM
58282012-03-03 Glenn Morris <rgm@gnu.org>
5829
01a6dcc8 5830 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 5831
de0100f2
EZ
58322012-03-02 Eli Zaretskii <eliz@gnu.org>
5833
5834 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5835 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
5836 (redisplay_window, next_element_from_string): Fix typos in
5837 comments.
3e441275
EZ
5838 (redisplay_window): Pass to move_it_vertically the margin in
5839 pixels, not in screen lines.
de0100f2 5840
96a72ee9
GM
58412012-03-02 Glenn Morris <rgm@gnu.org>
5842
5843 * buffer.c (buffer-list-update-hook): Doc fix.
5844
312508d7
EZ
58452012-02-29 Eli Zaretskii <eliz@gnu.org>
5846
5847 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5848 push_it before setting up the iterator for the first overlay
5849 string, even if we have an empty string loaded.
5850 (next_overlay_string): If there's an empty string on the iterator
5851 stack, pop the stack. (Bug#10903)
5852
27f3c637
PE
58532012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5856 Suggested by Stefan Monnier in
5857 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5858 * alloc.c (widen_to_Lisp_Object): New static function.
5859 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5860 and widening them to Lisp_Objects. This would work even if
5861 USE_LSB_TAG is defined and wide integers are used, which might
5862 happen in a future version of Emacs.
5863
3c9dfce6
CY
58642012-02-25 Chong Yidong <cyd@gnu.org>
5865
fa74b241
CY
5866 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5867 Doc fix.
5868
3c9dfce6
CY
5869 * xselect.c (Fx_selection_exists_p): Doc fix.
5870 (x_clipboard_manager_save_all): Print an informative message
5871 before saving to clipboard manager.
5872
9486df08
CY
58732012-02-24 Chong Yidong <cyd@gnu.org>
5874
5875 * keyboard.c (process_special_events): Handle all X selection
5876 requests in kbd_buffer, not just the next one (Bug#8869).
5877
f01d3321
CY
58782012-02-23 Chong Yidong <cyd@gnu.org>
5879
5880 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5881 call when setting menu-bar-lines and tool-bar-lines parameters.
5882 (unwind_create_frame_1): New helper function.
5883
5884 * window.c (inhibit_window_configuration_change_hook): New var.
5885 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 5886 (syms_of_window): Initialize it.
f01d3321 5887
86b847b6
CY
58882012-02-22 Chong Yidong <cyd@gnu.org>
5889
5890 * xterm.c (x_draw_image_relief): Add missing type check for
5891 Vtool_bar_button_margin (Bug#10743).
5892
a59225b1
CY
58932012-02-21 Chong Yidong <cyd@gnu.org>
5894
5895 * fileio.c (Vfile_name_handler_alist): Doc fix.
5896
5897 * buffer.c (Fget_file_buffer): Protect against invalid file
5898 handler return value.
5899
310f5bd4
PE
59002012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5901
cb3a28cc
PE
5902 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5903 when computing $valmask.
5904
310f5bd4
PE
5905 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5906 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5907 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5908 It's useless in that case, and it can cause problems on hosts
5909 that allocate halves of EMACS_INT values separately.
5910 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5911 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5912 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5913 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5914 it avoids undefined behavior on hosts where shifting right by more
5915 than the word width has undefined behavior.
5916
2375c96a
CY
59172012-02-19 Chong Yidong <cyd@gnu.org>
5918
5919 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5920 (Funhandled_file_name_directory, Ffile_name_as_directory)
5921 (Fdirectory_file_name, Fexpand_file_name)
5922 (Fsubstitute_in_file_name): Protect against invalid file handler
5923 return values (Bug#10845).
5924
3eb49e71
EZ
59252012-02-18 Eli Zaretskii <eliz@gnu.org>
5926
5927 * .gdbinit (pitx): Fix incorrect references to fields of the
5928 iterator stack.
5929
7b926f3f
CY
59302012-02-17 Chong Yidong <cyd@gnu.org>
5931
5932 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5933
11273115
PE
59342012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5935
5936 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5937 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5938
c3a70e2b
CY
59392012-02-15 Chong Yidong <cyd@gnu.org>
5940
5941 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5942 marked as special. Also, starting docstrings with * is obsolete.
5943
0ca43699
AS
59442012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5945
5946 * gnutls.c (emacs_gnutls_write): Fix last change.
5947
2e8f3c56
LI
59482012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5949
5950 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5951 send_process.
5952
af70074f
SM
59532012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5954
5955 * keymap.c (Fsingle_key_description): Handle char ranges.
5956
95986d52
CY
59572012-02-12 Chong Yidong <cyd@gnu.org>
5958
afd83bd1
CY
5959 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5960 as that creates a dangerous corner case.
5961
95986d52
CY
5962 * window.c (Fdelete_window_internal): Invalidate the mouse
5963 highlight (Bug#9904).
5964
bd7da63e
GM
59652012-02-12 Glenn Morris <rgm@gnu.org>
5966
5967 * xselect.c (Fx_own_selection_internal)
5968 (Fx_get_selection_internal, Fx_disown_selection_internal)
5969 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5970 * nsselect.m (Fx_own_selection_internal)
5971 (Fx_disown_selection_internal, Fx_selection_exists_p)
5972 (Fx_selection_owner_p, Fx_get_selection_internal):
5973 Sync docs and argument specs with the xselect.c versions.
5974
77abcbc2
LI
59752012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5976
5977 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5978
90b671e2
EZ
59792012-02-11 Eli Zaretskii <eliz@gnu.org>
5980
1c0ca0b7
EZ
5981 * w32select.c (Fx_selection_exists_p): Sync doc string and
5982 argument list with xselect.c. (Bug#10783)
5983
5984 * w16select.c (Fx_selection_exists_p): Sync doc string and
5985 argument list with xselect.c. (Bug#10783)
90b671e2 5986
49241268
GM
59872012-02-10 Glenn Morris <rgm@gnu.org>
5988
5989 * fns.c (Fsecure_hash): Doc fix.
5990
f998bbe7 59912012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
5992
5993 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5994
0992bd9c
CY
59952012-02-07 Chong Yidong <cyd@gnu.org>
5996
5997 * buffer.c (Fbuffer_local_variables)
5998 (buffer_lisp_local_variables): Handle unbound vars correctly;
5999 don't let Qunbound leak into Lisp.
6000
af008560
GM
60012012-02-07 Glenn Morris <rgm@gnu.org>
6002
dd605cc4
GM
6003 * image.c (Fimagemagick_types): Doc fix.
6004
af008560
GM
6005 * image.c (imagemagick-render-type): Change it from a lisp object
6006 to an integer. Move the doc here from the lisp manual.
6007 Treat all values not equal to 0 the same.
6008
1449fa1d
CY
60092012-02-06 Chong Yidong <cyd@gnu.org>
6010
6011 * doc.c (store_function_docstring): Avoid applying docstring of
6012 alias to base function (Bug#2603).
6013
3723ec07
AS
60142012-02-04 Andreas Schwab <schwab@linux-m68k.org>
6015
6016 * .gdbinit (pp1, pv1): Remove redundant defines.
6017 (pr): Use pp.
6018
79c1cc1e
CY
60192012-02-04 Chong Yidong <cyd@gnu.org>
6020
6021 * nsterm.m: Declare a global (Bug#10694).
6022
d7f29f8e
EZ
60232012-02-04 Eli Zaretskii <eliz@gnu.org>
6024
cae07000
SM
6025 * w32.c (get_emacs_configuration_options):
6026 Include --enable-checking, if specified, in the return value.
d7f29f8e 6027
3b95a6f9
MR
60282012-02-04 Martin Rudalics <rudalics@gmx.at>
6029
6030 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6031 after rounding frame sizes. (Bug#9723)
6032
d6fa96a6
EZ
60332012-02-04 Eli Zaretskii <eliz@gnu.org>
6034
6035 * keyboard.c (adjust_point_for_property): Don't position point
6036 before BEGV. (Bug#10696)
6037
df0b2940
PE
60382012-02-03 Paul Eggert <eggert@cs.ucla.edu>
6039
6040 Handle overflow when computing char display width (Bug#9496).
6041 * character.c (char_width): Return EMACS_INT, not int.
6042 (char_width, c_string_width): Check for overflow when
6043 computing the width; this is possible now that individual
6044 characters can have unbounded width. Problem introduced
6045 by merge from Emacs 23 on 2012-01-19.
6046
6bee44d6
MA
60472012-02-02 Michael Albinus <michael.albinus@gmx.de>
6048
6049 * dbusbind.c (Fdbus_register_method): Mention the return value
6050 :ignore in the docstring.
6051
44f92739
GM
60522012-02-02 Glenn Morris <rgm@gnu.org>
6053
1b9f60cc
GM
6054 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
6055
44f92739
GM
6056 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6057 Unconditionally set to t. (Bug#10673)
6058 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6059 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6060 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
6061
c5d3843c
KH
60622012-02-02 Kenichi Handa <handa@m17n.org>
6063
6064 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
6065 0, do not call append_composite_glyph.
6066
159462d4 60672012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
6068
6069 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
6070 NULL (Bug#6988).
6071 (x_produce_glyphs): If the component of a composition is a null
6072 string, set it->pixel_width to 1 to avoid zero-width glyph.
6073
78cef877
EZ
60742012-02-01 Eli Zaretskii <eliz@gnu.org>
6075
6076 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
6077 first 2 arguments are identical. This makes inserting large
6078 output from a subprocess an order of magnitude faster on
6079 MS-Windows, where all sbrk'ed memory is always contiguous.
6080
97897668
GM
60812012-01-31 Glenn Morris <rgm@gnu.org>
6082
6083 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 6084 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
6085 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
6086
31fd3586
GM
60872012-01-29 Glenn Morris <rgm@gnu.org>
6088
6089 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
6090
0e24a8b2
CY
60912012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
6092
6093 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
6094
cc0adcb0
CY
60952012-01-28 Chong Yidong <cyd@gnu.org>
6096
6097 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
6098
acc28cb9
CY
60992012-01-26 Chong Yidong <cyd@gnu.org>
6100
9c69cfb7
CY
6101 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
6102
acc28cb9
CY
6103 * search.c (Fsearch_forward, Fsearch_backward): Document negative
6104 repeat counts (Bug#10507).
6105
48da7392
GM
61062012-01-26 Glenn Morris <rgm@gnu.org>
6107
6108 * lread.c (syms_of_lread): Doc fix.
6109
14af5f7f
CY
61102012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
6111
6112 * coding.c (encode_designation_at_bol): Change return value to
6113 EMACS_INT.
6114
0b21c100
CY
61152012-01-25 Chong Yidong <cyd@gnu.org>
6116
6117 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
6118
3c2907f7
CY
61192012-01-21 Chong Yidong <cyd@gnu.org>
6120
6121 * floatfns.c (Fcopysign): Make the second argument non-optional,
6122 since nil is not allowed anyway.
6123
959ad23f
AS
61242012-01-21 Andreas Schwab <schwab@linux-m68k.org>
6125
6126 * process.c (read_process_output): Use p instead of XPROCESS (proc).
6127 (send_process): Likewise.
6128
34a02f46
MR
61292012-01-19 Martin Rudalics <rudalics@gmx.at>
6130
6131 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
6132 (Vwindow_persistent_parameters): Do not use Qstate.
6133 Rewrite doc-strings.
34a02f46 6134
1259009a 61352012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
6136
6137 * character.c (char_width): New function.
70d4fdf6
GM
6138 (Fchar_width, c_string_width, lisp_string_width):
6139 Use char_width (Bug#9496).
25ed9e61 6140
6a6ee00d
MR
61412012-01-16 Martin Rudalics <rudalics@gmx.at>
6142
6143 * window.c (Vwindow_persistent_parameters): New variable.
6144 (Fset_window_configuration, save_window_save): Handle persistent
6145 window parameters.
6146
c85efaf7
EZ
61472012-01-14 Eli Zaretskii <eliz@gnu.org>
6148
6149 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
6150 thrashing the stack of the thread. (Bug#9087)
6151
5944709e
PE
61522012-01-12 Paul Eggert <eggert@cs.ucla.edu>
6153
6154 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
6155
e71f5d99
EZ
61562012-01-11 Eli Zaretskii <eliz@gnu.org>
6157
6158 * xdisp.c (rows_from_pos_range): Handle the case where the
6159 highlight ends on a newline. (Bug#10464)
6160 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
6161 he end column for display of highlight that ends on a newline
6162 before a R2L line.
6163
ce316182
GM
61642012-01-11 Glenn Morris <rgm@gnu.org>
6165
6166 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
6167 from load-path also when installation-directory is nil. (Bug#10208)
6168
5b43da69
GM
61692012-01-10 Glenn Morris <rgm@gnu.org>
6170
74cc8ff9
GM
6171 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
6172
7d8d6e4e
GM
6173 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
6174 Update template values to be closer to their typical values these days.
5b43da69 6175
a0db8d43
EZ
61762012-01-09 Eli Zaretskii <eliz@gnu.org>
6177
6178 * xdisp.c (rows_from_pos_range): Accept additional argument
6179 DISP_STRING, and accept any glyph in a row whose object is that
6180 string as eligible for mouse highlight. Fixes mouse highlight of
6181 display strings from overlays. (Bug#10464)
6182
9a0115ab 61832012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 6184
b9110d6a 6185 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
6186 * fileio.c (auto_saving_dir_umask): New static var.
6187 (Fmake_directory_internal): Use it.
6188 (do_auto_save_make_dir): Set it, instead of invoking chmod after
6189 creating the directory. The old code temporarily assigns
6190 too-generous permissions to the directory.
6191 (do_auto_save_eh): Clear it.
b9110d6a 6192 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
6193 that the var is always cleared.
6194
6c1bd3f3
EZ
61952012-01-07 Eli Zaretskii <eliz@gnu.org>
6196
6197 * search.c (scan_buffer): Pass character positions to
6198 know_region_cache, not byte positions. (Bug#6540)
6199
069d2b50
L
62002012-01-07 LynX <_LynX@bk.ru> (tiny change)
6201
6202 * w32.c (sys_rename): Report EXDEV when rename of a directory
6203 fails because the target is on another logical disk. (Bug#10284)
6204
75bf0d33
DB
62052012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
6206
6207 * xterm.c (x_embed_request_focus): New function.
6208
6209 * xterm.h: Add prototype.
6210
6211 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
6212
1c6e5a32
GM
62132012-01-05 Glenn Morris <rgm@gnu.org>
6214
6215 * emacs.c (emacs_copyright): Update short copyright year to 2012.
6216
651e947e
EZ
62172012-01-01 Eli Zaretskii <eliz@gnu.org>
6218
6219 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
6220 Load gnutls_transport_set_lowat only if GnuTLS version is below
6221 2.11.1.
6222 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
6223 GnuTLS versions below 2.11.1.
6224
3778cdd8
AL
62252011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
6226
6227 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
6228 to the doc string advising against its use for altering the way
6229 windows are scrolled.
6230
0e5317f7
KH
62312011-12-28 Kenichi Handa <handa@m17n.org>
6232
6233 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
6234 coding-system ASCII compatible only when it does not produce BOM
6235 on encoding (Bug#10383).
6236
93d5ca1f
JD
62372011-12-26 Jan Djärv <jan.h.d@swipnet.se>
6238
6239 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
6240 can scroll.
6241 (create_and_show_popup_menu): Always use menu_position_func for
6242 Gtk3 (Bug#10361).
6243
ca22b785
AS
62442011-12-24 Andreas Schwab <schwab@linux-m68k.org>
6245
6246 * callint.c (Fcall_interactively): Don't truncate prompt string.
6247
d048e1e6
EZ
62482011-12-23 Eli Zaretskii <eliz@gnu.org>
6249
6250 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
6251 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 6252 resumed from there (after widening). (Bug#10360)
d048e1e6 6253
5ccaba1f
JD
62542011-12-22 Jan Djärv <jan.h.d@swipnet.se>
6255
6256 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
6257
204ee57f
JD
62582011-12-21 Jan Djärv <jan.h.d@swipnet.se>
6259
b81d40f0
JB
6260 * nsterm.m (x_free_frame_resources):
6261 Release f->output_data.ns->miniimage.
204ee57f
JD
6262 (ns_index_color): Fix indentation. Do not retain
6263 color_table->colors[i].
6264
6265 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
6266 before returning.
6267
6268 * nsfns.m (x_set_background_color): Assign return value from
6269 ns_index_color to face-background instead of NSColor*.
6270 (ns_implicitly_set_icon_type): Fix indentation.
6271 Change assignment in for loop to comparison.
6272
6273 * emacs.c (ns_pool): New variable.
6274 (main): Assign ns_pool.
6275 (Fkill_emacs): Call ns_release_autorelease_pool.
6276
6277 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
6278 autorelease fdesc, release fdAttrs and tdict.
6279 (ns_get_covering_families): Release charset.
6280 (ns_findfonts): Release NSFontDescriptor created with new.
6281 (ns_uni_to_glyphs): Fix indentation.
6282 (setString): Release attrStr before assigning new value.
6283
c803b2b7
JD
62842011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6285
678f4426
JD
6286 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
6287 and NS_IMPL_COCOA.
6288 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
6289 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
6290
cd394be1 62912011-12-18 David Reitter <reitter@cmu.edu>
678f4426 6292
5fecd5fc
JD
6293 * nsterm.m (ns_term_init): Subscribe for notifications
6294 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
6295 to method trackingNotification in EmacsMenu.
6296
6297 * nsmenu.m (trackingMenu): New variable.
3771cb17 6298 (trackingNotification): New method (from Aquamacs).
5fecd5fc 6299 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 6300 from Aquamacs (Bug#7030).
678f4426
JD
6301
63022011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 6303
c803b2b7
JD
6304 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
6305 (symbol_to_nsstring): Fix indentation.
6306 (ns_symbol_to_pb): New function.
cae07000
SM
6307 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
6308 (Fns_rotate_cut_buffers_internal): Remove.
6309 (Fns_store_selection_internal): Rename from
c803b2b7
JD
6310 Fns_store_cut_buffer_internal.
6311 (ns_get_foreign_selection, Fx_own_selection_internal)
6312 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
6313 (Fns_get_selection_internal, Fns_store_selection_internal):
6314 Use ns_symbol_to_pb and check if return value is nil.
6315 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
6316 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
6317 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
6318 renamed to Sns_store_selection_internal.
6319 (ns_handle_selection_request): Move code to Fx_own_selection_internal
6320 and remove this function.
6321 (ns_handle_selection_clear): Remove, never used.
6322 (Fx_own_selection_internal): Move code from ns_handle_selection_request
6323 here.
6324
e1b01a3a
KB
63252011-12-17 Ken Brown <kbrown@cornell.edu>
6326
6327 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
6328 GID is unknown (Bug#10257).
6329
2adb6e85
PE
63302011-12-17 Paul Eggert <eggert@cs.ucla.edu>
6331
6332 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
6333 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
6334 which caused a build failure on GNU/Linux IA-64. This problem was
6335 introduced by my 2011-10-07 patch.
6336
d1d7b339
JL
63372011-12-15 Juri Linkov <juri@jurta.org>
6338
6339 * image.c (imagemagick_error): New function. (Bug#10112)
6340 (imagemagick_load_image): Comment out `MagickSetResolution' call.
6341 Use `imagemagick_error' where ImageMagick functions return
6342 `MagickFalse'.
6343 (Fimagemagick_types): Add `Fnreverse' to return the list in the
6344 proper order.
6345
100d5755
KH
63462011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6347
6348 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
6349 fill background (Bug#8992).
6350
454592a6
MR
63512011-12-13 Martin Rudalics <rudalics@gmx.at>
6352
6353 * window.c (Vwindow_combination_resize)
6354 (Vwindow_combination_limit): Use t instead of non-nil in
6355 doc-strings.
61d4b438
MR
6356 (Vrecenter_redisplay): Add first sentence of doc-string on
6357 separate line.
53524d93 6358 (Frecenter): Fix doc-string typo.
454592a6 6359
3633e3aa
KH
63602011-12-11 Kenichi Handa <handa@m17n.org>
6361
6362 * coding.c (Funencodable_char_position): Pay attention to the
6363 buffer text relocation (Bug#9389).
6364
7b9d523a 63652011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 6366
7b9d523a
JD
6367 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
6368 gtk_init (Bug#10100).
6369
b73189c6
EZ
63702011-12-10 Eli Zaretskii <eliz@gnu.org>
6371
6372 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
6373 IT->string is nil. (Bug#10263)
6374
f7dfe5d6
JD
63752011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6376
83faebb4
JD
6377 * nsterm.h (x_free_frame_resources): Declare.
6378
f7dfe5d6
JD
6379 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
6380 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
6381
6382 * nsterm.h (ns_get_defaults_value): Declare.
6383
6384 * nsterm.m (ns_default): Call ns_get_defaults_value.
6385
7cd4e72c
EZ
63862011-12-09 Eli Zaretskii <eliz@gnu.org>
6387
6388 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
6389 (Bug#10170)
6390
b34d7317
YM
63912011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6392
6393 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
6394 that where the value of an _OBJC_* symbol points to is in the .bss
6395 section (Bug#10240).
6396
76470ad1
KH
63972011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6398
6399 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 6400 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 6401
745fff94
KH
64022011-12-08 Kenichi Handa <handa@m17n.org>
6403
6404 * ftfont.c (get_adstyle_property): Fix previous change
6405 (Bug#10233).
6406
6e44397c
JB
64072011-12-07 Juanma Barranquero <lekktu@gmail.com>
6408
6409 * w32.c (init_environment): If no_site_lisp, remove site-lisp
6410 dirs from the default value of EMACSLOADPATH (bug#10208).
6411
7efa6272
GM
64122011-12-07 Glenn Morris <rgm@gnu.org>
6413
6414 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
6415 installation and source directories as well. (Bug#10208)
6416
f6fc4d87
CY
64172011-12-06 Chong Yidong <cyd@gnu.org>
6418
6419 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
6420
2bf26180
GM
64212011-12-06 Glenn Morris <rgm@gnu.org>
6422
6423 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
6424 as an error, not just -1. (Bug#10217)
6425
3a6ad4f0
CY
64262011-12-05 Chong Yidong <cyd@gnu.org>
6427
6428 * keyboard.c (process_special_events): New function.
6429 (swallow_events, Finput_pending_p): Use it (Bug#10195).
6430
75a3b399
PE
64312011-12-05 Paul Eggert <eggert@cs.ucla.edu>
6432
6433 * coding.c (encode_designation_at_bol): Don't use uninitialized
6434 local variable (Bug#9318).
6435
c3c9e25e
KH
64362011-12-05 Kenichi Handa <handa@m17n.org>
6437
6438 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
6439 return Qnil (Bug#8046, Bug#10193).
6440
5eb05ea3
KH
64412011-12-05 Kenichi Handa <handa@m17n.org>
6442
6443 * coding.c (encode_designation_at_bol): New args charbuf_end and
6444 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
6445 (coding_set_source): Return how many bytes coding->source was
6446 relocated.
6447 (coding_set_destination): Return how many bytes
6448 coding->destination was relocated.
6449 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 6450 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
6451
64522011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6453
6454 * coding.c (CODING_CHAR_CHARSET_P): New macro.
6455 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
6456 macro (Bug#9318).
6457
64582011-12-05 Andreas Schwab <schwab@linux-m68k.org>
6459
6460 The following changes are to fix Bug#9318.
6461
a79703f5 6462 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
6463 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
6464 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 6465 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 6466
7dbda6df
JB
64672011-12-05 Juanma Barranquero <lekktu@gmail.com>
6468
6469 * lisp.h (process_quit_flag): Fix external declaration.
6470
6d5eb5b0
SM
64712011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
6472
6473 Don't macro-inline non-performance-critical code.
6474 * eval.c (process_quit_flag): New function.
6475 * lisp.h (QUIT): Use it.
6476
a0c3fad0
JD
64772011-12-04 Jan Djärv <jan.h.d@swipnet.se>
6478
6479 * nsfns.m (get_geometry_from_preferences): New function.
6480 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
6481
6c07aac2
AS
64822011-12-04 Andreas Schwab <schwab@linux-m68k.org>
6483
6484 * emacs.c (Qkill_emacs): Define.
6485 (syms_of_emacs): Initialize it.
6486 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
6487 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
6488 (quit_throw_to_read_char): Add parameter `from_signal'.
6489 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
6490 * lisp.h (QUIT): Call Fkill_emacs if requested.
6491
c052ead4
JD
64922011-12-03 Jan Djärv <jan.h.d@swipnet.se>
6493
6494 * widget.c (update_wm_hints): Return if wmshell is null.
6495 (widget_update_wm_size_hints): New function.
6496
6497 * widget.h (widget_update_wm_size_hints): Declare.
6498
6499 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
6500 widget_update_wm_size_hints (Bug#10104).
6501
9e49252b
EZ
65022011-12-03 Eli Zaretskii <eliz@gnu.org>
6503
6504 * xdisp.c (handle_invisible_prop): If the invisible text ends just
6505 before a newline, prepare the bidi iterator for consuming the
6506 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 6507 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 6508
02b16839
JL
65092011-12-02 Juri Linkov <juri@jurta.org>
6510
6511 * search.c (Fword_search_regexp): New Lisp function created from
6512 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
6513 (Fword_search_backward, Fword_search_forward)
6514 (Fword_search_backward_lax, Fword_search_forward_lax):
6515 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
6516 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
6517
0068070e
SM
65182011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
6519
6520 * fileio.c (Finsert_file_contents): Move after-change-function call
6521 to before the "handled:" label, since all "goto handled" appear in
6522 cases where the *-change-functions have already been properly called
6523 (bug#10117).
6524
3360a3fc
AS
65252011-12-01 Andreas Schwab <schwab@linux-m68k.org>
6526
6527 * keyboard.c (interrupt_signal): Don't call kill-emacs when
6528 waiting for input. (Bug#10169)
6529
73d6c093
EZ
65302011-11-30 Eli Zaretskii <eliz@gnu.org>
6531
6532 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
6533 verifies glyph row's hash code--we have just reallocated the
6534 glyphs, so their contents can be complete garbage. (Bug#10164)
6535
febe6bea
JB
65362011-11-30 Juanma Barranquero <lekktu@gmail.com>
6537
6538 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
6539
801a4313
EZ
65402011-11-30 Eli Zaretskii <eliz@gnu.org>
6541
6542 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
6543 attributes are tested _before_ calling verify_row_hash, to protect
6544 against GCC re-ordering of the tests. (Bug#10164)
6545
2b56b87e
JD
65462011-11-29 Jan Djärv <jan.h.d@swipnet.se>
6547
6548 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
6549
6550 * xterm.c (handle_one_xevent): Only set async_visible and friends
6551 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 6552 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
6553 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
6554
dbf31225
PE
65552011-11-28 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 Remove GCPRO-related macros that exist only to avoid shadowing locals.
6558 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
6559 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
6560 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6561 All uses changed to use GCPRO1 etc.
6562 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
6563 Revert to old implementation (i.e., before 2011-03-11).
6564
1305621b
YM
65652011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6566
6567 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
6568 of scroll runs so as to avoid assigning disabled bogus rows and
6569 unnecessary graphics copy operations.
6570
8c9afb46
EZ
65712011-11-27 Eli Zaretskii <eliz@gnu.org>
6572
6573 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
6574 (snprintf) [_MSC_VER]: Redirect to _snprintf.
6575 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
6576 (malloc, free, realloc, calloc): Redirect to e_* only when
6577 compiling Emacs.
6578
6579 * lisp.h (GCTYPEBITS): Move before first use.
6580 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
6581 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
6582 this macro definition.
6583
6584 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
6585 _MSC_VER.
6586
54e9e3bf
JD
65872011-11-27 Jan Djärv <jan.h.d@swipnet.se>
6588
6d5eb5b0
SM
6589 * gtkutil.c (xg_create_frame_widgets):
6590 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
6591 present with Gtk+ 2.0.
6592
83aca1cb
PE
65932011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6594
6595 * fileio.c (Finsert_file_contents): Undo previous change; see
6596 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6597
5b76caa4
PE
65982011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6599
6600 Rename locals to avoid shadowing.
6601 * fileio.c (Finsert_file_contents):
6602 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
6603 * process.c (wait_reading_process_output):
6604 Rename inner 'proc' to 'p' to avoid shadowing.
6605 Indent for consistency with usual Emacs style.
6606
8c535114
EZ
66072011-11-25 Eli Zaretskii <eliz@gnu.org>
6608
6609 * xdisp.c (redisplay_window): If cursor row is not fully visible
6610 after recentering, and scroll-conservatively is set to a large
6611 number, scroll window by a few more lines to make the cursor fully
6612 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
6613 (start_display): Don't move to the next line if the display should
6614 start at a newline that is part of a display vector or an overlay
6615 string. (Bug#10119)
8c535114 6616
fa4fdb5c
JL
66172011-11-24 Juri Linkov <juri@jurta.org>
6618
6619 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6620 after the `MagickPingImage' call. (Bug#10112)
6621
90ec88df
CY
66222011-11-23 Chong Yidong <cyd@gnu.org>
6623
6624 * window.c (Fcoordinates_in_window_p): Accept only live windows.
6625
56e2e794
MR
66262011-11-23 Martin Rudalics <rudalics@gmx.at>
6627
6628 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6629 making another buffer current. (Bug#10114)
6630
b6e64c41
GM
66312011-11-23 Glenn Morris <rgm@gnu.org>
6632
6633 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
6634
6b21de18
CY
66352011-11-23 Chong Yidong <cyd@gnu.org>
6636
6637 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6638 using it (Bug#5984).
6639
b12cd789
EZ
66402011-11-22 Eli Zaretskii <eliz@gnu.org>
6641
6642 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6643 and header-lines, as they don't have one computed for them.
6644 (Bug#10098)
6645
6646 * .gdbinit (prow): Make displayed values more self-explaining.
6647 Add row's hash code.
6648
261b6fd4
LMI
66492011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
6650
6651 * process.c (wait_reading_process_output): Fix asynchrounous
6652 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 6653 (wait_reading_process_output): Add comment and URL.
261b6fd4 6654
e7cfd277
JD
66552011-11-21 Jan Djärv <jan.h.d@swipnet.se>
6656
6657 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6658
a9b9b7f5
CY
66592011-11-21 Chong Yidong <cyd@gnu.org>
6660
6661 * window.c (Fnext_window, Fprevious_window): Doc fix.
6662
b0d15b4f
SM
66632011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6664
6665 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6666
fe7a3057
JB
66672011-11-20 Juanma Barranquero <lekktu@gmail.com>
6668
6669 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6670
d2999b1a
MR
66712011-11-20 Martin Rudalics <rudalics@gmx.at>
6672
6673 * window.c (Fset_window_combination_limit): Rename argument
6674 STATUS to LIMIT.
6675 (Vwindow_combination_limit): Remove "status" from doc-string.
6676
d5ff9cd0
AS
66772011-11-20 Andreas Schwab <schwab@linux-m68k.org>
6678
6679 * m/ibms390.h: Remove.
6680 * m/ibms390x.h: Don't include "ibms390.h".
6681
a5bb9bd3
SM
66822011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6683
6684 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6685 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6686
cd1181db
JB
66872011-11-20 Juanma Barranquero <lekktu@gmail.com>
6688
6689 * casetab.c (Fset_case_table):
6690 * charset.c (Fcharset_after): Fix typos.
6691
615a3b8d 66922011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 6693
17e845af
PE
6694 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6695 Otherwise, valgrind does not work on some platforms.
6696 Problem reported by Andreas Schwab in
6a0bf43d
PE
6697 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6698 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6699 is set, removing the need for VIRT_ADDRESS_VARIES.
6700 (PURE_P): Use a more-efficient implementation that needs just one
6701 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6702 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6703 to 4 (xorl, subq, cmpq, setbe).
6704 * alloc.c (pure): Always extern now, since that's the
6705 VIRT_ADDR_VARIES behavior.
6706 (PURE_POINTER_P): Use a single comparison, not two, for
6707 consistency with the new puresize.h.
6708 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6709 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6710 Remove VIRT_ADDR_VARIES no longer needed.
6711
f8fe6f96
EZ
67122011-11-19 Eli Zaretskii <eliz@gnu.org>
6713
6714 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6715 (erase_phys_cursor, update_window_cursor, show_mouse_face)
6716 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6717 behave as if the cursor position were at the window margin.
6718
6719 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6720 and the cursor position is out of bounds, behave as if the cursor
6721 position were at the window margin. (Bug#10075)
6722
df05a53c
CY
67232011-11-18 Chong Yidong <cyd@gnu.org>
6724
6725 * window.c (Fwindow_combination_limit): Make first argument
6726 non-optional, since it is meaningless for live windows like the
6727 selected window.
61ccba97 6728
2071918e
DA
67292011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
6730
6731 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6732
b50a28de
SM
67332011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
6734
6735 * intervals.c: Fix grafting over the whole buffer (bug#10071).
6736 (graft_intervals_into_buffer): Simplify.
6737
015137db
EZ
67382011-11-18 Eli Zaretskii <eliz@gnu.org>
6739
6740 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6741 hash values of the two rows.
6742 (copy_row_except_pointers): Preserve the used[] arrays and the
6743 hash values of the two rows. (Bug#10035)
68c95424 6744 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
6745
6746 * xdisp.c (row_hash): New function, body extracted from
6747 compute_line_metrics.
6748 (compute_line_metrics): Call row_hash, instead of computing the
6749 hash code inline.
6750
6751 * dispnew.c (verify_row_hash): Call row_hash for computing the
6752 hash code of a row, instead of duplicating code from xdisp.c.
6753
6754 * dispextern.h (row_hash): Add prototype.
6755
a2addb04
TH
67562011-11-18 Tassilo Horn <tassilo@member.fsf.org>
6757
6758 * frame.c (delete_frame): Don't delete the terminal when the last
6759 X frame is closed if emacs is built with GTK toolkit.
6760
df85d315
JB
67612011-11-17 Juanma Barranquero <lekktu@gmail.com>
6762
6763 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
6764
a0c2d0ae
MR
67652011-11-17 Martin Rudalics <rudalics@gmx.at>
6766
6767 * window.c (Vwindow_splits): Rename to
6768 Vwindow_combination_resize. Suggested by Juri Linkov.
6769 (Fsplit_window_internal): Use Vwindow_combination_resize instead
6770 of Vwindow_splits.
6771
58179cce
JB
67722011-11-16 Juanma Barranquero <lekktu@gmail.com>
6773
7877f373
JB
6774 * nsfns.m (Fns_font_name):
6775 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 6776
b6f67890
MR
67772011-11-16 Martin Rudalics <rudalics@gmx.at>
6778
6779 * window.h (window): Rename slot "nest" to "combination_limit".
6780 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6781 (Fset_window_nest): Rename to Fset_window_combination_limit.
6782 (Vwindow_nest): Rename to Vwindow_combination_limit.
6783 (recombine_windows, make_parent_window, make_window)
6784 (Fsplit_window_internal, saved_window)
6785 (Fset_window_configuration, save_window_save): Rename all
6786 occurrences of window_nest to window_combination_limit.
6787
c7015153
JB
67882011-11-15 Juanma Barranquero <lekktu@gmail.com>
6789
6790 * image.c (imagemagick_load_image): Fix typo.
6791
322ad6ec
EZ
67922011-11-14 Eli Zaretskii <eliz@gnu.org>
6793
6794 * xdisp.c (display_line): Move the call to
6795 highlight_trailing_whitespace before the call to
6796 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
6797 faces of all the glyphs to compute ROW's hash value.
6798 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 6799
f067b8ec
JB
68002011-11-14 Juanma Barranquero <lekktu@gmail.com>
6801
6802 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6803 just return (bug#10044).
6804
1e5b2111
EZ
68052011-11-12 Eli Zaretskii <eliz@gnu.org>
6806
7ef3cbd5
EZ
6807 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6808 with user-defined heap size. Bump the default size of the temacs
6809 heap to 27MB, to avoid memory warning when running temacs.
6810 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6811
1e5b2111
EZ
6812 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6813 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
6814 (verify_row_hash) [XASSERTS]: New function.
6815 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6816 that the hash value of glyph rows is correct.
1e5b2111 6817
89d61221
MR
68182011-11-12 Martin Rudalics <rudalics@gmx.at>
6819
6820 * window.h (window): Remove splits slot.
6821 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6822 (Fdelete_other_windows_internal, make_parent_window)
6823 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6824 (Fset_window_configuration, save_window_save): Don't deal with
6825 split status of windows.
6826 (saved_window): Remove splits slot.
6827 (Vwindow_splits): Rewrite doc-string.
6828
97f18cc8
JD
68292011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6830
6831 * xfns.c (unwind_create_frame):
6832 * nsfns.m (unwind_create_frame):
6833 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6834 Vframe_list (Bug#9999).
6835
22a648b4
DA
68362011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6837
0b381c7e 6838 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 6839
659afede
KH
68402011-11-11 Kenichi Handa <handa@m17n.org>
6841
6842 * callproc.c (Fcall_process): Set the member dst_multibyte of
6843 process_coding.
6844
9ac0394b
KH
68452011-11-11 Johan Bockgård <bojohan@gnu.org>
6846
6847 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6848 avoid a crash (bug#9496).
6849
2fbdc249
CY
68502011-11-09 Chong Yidong <cyd@gnu.org>
6851
6852 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6853 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6854
ac6b1f81
PE
68552011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6856
6857 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6858
09db192c
PE
68592011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6860
6861 Avoid some portability problems by eschewing 'extern inline' functions.
6862 The trivial performance wins aren't worth the portability hassles; see
6863 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6864 et seq.
6865 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6866 (window_box_width, window_box_left, window_box_left_offset)
6867 (window_box_right, window_box_right_offset): Undo previous change,
6868 by removing the "extern"s.
6869 * intervals.c (adjust_intervals_for_insertion)
6870 (adjust_intervals_for_deletion): Undo previous change,
6871 making these static again.
6872 (offset_intervals, temp_set_point_both, temp_set_point)
6873 (copy_intervals_to_string): No longer inline.
6874 * xdisp.c (window_text_bottom_y, window_box_width)
6875 (window_box_height, window_box_left_offset)
6876 (window_box_right_offset, window_box_left, window_box_right)
6877 (window_box): No longer inline.
6878
105216ed
CY
68792011-11-08 Chong Yidong <cyd@gnu.org>
6880
6881 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
6882 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6883 Signal an error if not a live window.
105216ed
CY
6884 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6885 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6886
ae9e237f
JB
68872011-11-07 Juanma Barranquero <lekktu@gmail.com>
6888
6889 * lisp.h (syms_of_abbrev): Remove declaration.
6890 Reported by CHENG Gao <chenggao@royau.me>.
6891
c7aa8333
EZ
68922011-11-07 Eli Zaretskii <eliz@gnu.org>
6893
6894 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6895 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6896 of temacs in GUI mode.
6897
be7f5545
MR
68982011-11-07 Martin Rudalics <rudalics@gmx.at>
6899
6900 * window.h: Declare delete_all_child_windows instead of
6901 delete_all_subwindows.
6902 * window.c (Fwindow_nest, Fset_window_nest)
6903 (Fset_window_new_total, Fset_window_new_normal)
6904 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6905 (delete_all_subwindows): Rename to delete_all_child_windows.
6906 (Fdelete_other_windows_internal, Fset_window_configuration):
6907 Call delete_all_child_windows instead of delete_all_subwindows.
6908 * frame.c (delete_frame): Call delete_all_child_windows instead
6909 of delete_all_subwindows.
6910
ca78dc43
PE
69112011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6914 This is also needed for porting to any host where GC_MARK_STACK is
6915 not GC_MAKE_GCPROS_NOOPS.
6916 (which_symbols): Use it.
6917
a0241d01
KH
69182011-11-07 Kenichi Handa <handa@m17n.org>
6919
6920 * coding.c (coding_set_destination): Check coding->src_pos only
6921 when coding->src_object is a buffer (bug#9910).
6922
6923 * process.c (send_process): Set the member src_multibyte of coding
6924 to 0 (bug#9911) when sending a unibyte text.
6925
6926 * callproc.c (Fcall_process): Set the member src_multibyte of
6927 process_coding to 0 (bug#9912).
6928
a64bfdfa 69292011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
6930
6931 * xmenu.c (cleanup_widget_value_tree): New function.
6932 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6933 calling free_menubar_widget_value_tree directly (Bug#9830).
6934
cb41b32a
PE
69352011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6936
6937 Fix some portability problems with 'inline'.
6938 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6939 (window_box_width, window_box_left, window_box_left_offset)
6940 (window_box_right, window_box_right_offset): Declare extern.
6941 Otherwise, these inline functions do not conform to C99 and
6942 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6943 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6944 * intervals.c (adjust_intervals_for_insertion)
6945 (adjust_intervals_for_deletion): Now extern, because otherwise the
6946 extern inline functions 'offset_intervals' couldn't refer to it.
6947 (static_offset_intervals): Remove.
6948 (offset_intervals): Rewrite using the old contents of
6949 static_offset_intervals. The old version didn't conform to C99
6950 because an extern inline function contained a reference to an
6951 identifier with static linkage.
6952
b7041366
AS
69532011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6954
6955 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6956 GC.
6957
88a37c4d
EZ
69582011-11-06 Eli Zaretskii <eliz@gnu.org>
6959
6960 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6961 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6962 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6963 return Qleft_to_right.
6964
49745b39
CY
69652011-11-06 Chong Yidong <cyd@gnu.org>
6966
6967 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6968 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6969 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6970 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6971 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6972 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6973 (Fwindow_vscroll): Doc fix.
6974 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6975 argument, since it makes no sense to pass a live window and for
6976 consistency with window-child.
6977
1f05cd82
CS
69782011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6979
6980 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6981 support MSVC.
6982
22610910
JR
69832011-11-05 Jason Rumney <jasonr@gnu.org>
6984
6985 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6986 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6987 fonts (Bug#6029).
6988 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6989 bitwise arithmetic preventing use of unicode-sip and non-truetype
6990 opentype fonts.
6991
a06776b2
EZ
69922011-11-05 Eli Zaretskii <eliz@gnu.org>
6993
3ad924ba
EZ
6994 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6995 "emacs"-only part.
6996
a06776b2
EZ
6997 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6998 initialization code to keep similarity to xfns.c after changes
6999 from 2011-11-05.
7000
c9e7db78
JD
70012011-11-05 Jan Djärv <jan.h.d@swipnet.se>
7002
a97f8f3f
JD
7003 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7004 (unwind_create_frame): New function (Bug#9943).
7005 (Fx_create_frame): Restructure code to be more similar to the one in
7006 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
7007 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7008 Move terminal->reference_count++ just before making the frame official
7009 (Bug#9943).
7010
7011 * nsterm.m (x_free_frame_resources): New function.
7012 (x_destroy_window): Move code to x_free_frame_resources.
7013
c9e7db78 7014 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
7015 (Fx_create_frame, x_create_tip_frame):
7016 Move terminal->reference_count++ just before making the frame
75f1671a 7017 official. Move initialization of image_cache_refcount and
c9e7db78
JD
7018 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7019
a6fc3b5c
EZ
70202011-11-05 Eli Zaretskii <eliz@gnu.org>
7021
7022 Support MSVC build with newer versions of Visual Studio.
7023 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7024 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
7025 nt/gmake.defs.
7026
7027 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7028 which are not supported by MSVC.
7029 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7030 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7031 bitfields.
7032 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7033 types in bitfields.
7034 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7035
7036 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7037
58179cce 70382011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
7039
7040 Support MSVC build with newer versions of Visual Studio.
7041 * w32.c: Don't include w32api.h for MSVC.
7042 (init_environment) [_MSC_VER]: Call sys_access, not _access.
7043
7044 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7045 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
7046 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
7047 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
7048 e_* cousins.
7049 (alloca) [_MSC_VER]: Define to _alloca.
7050
7051 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
7052
7053 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
7054
a58c13ed
EZ
70552011-11-04 Eli Zaretskii <eliz@gnu.org>
7056
7057 * xdisp.c (note_mouse_highlight): If either of
7058 previous/next-single-property-change returns nil, treat that as
7059 the beginning or the end of the buffer. (Bug#9955)
7060
fe0b6370
JD
70612011-11-04 Jan Djärv <jan.h.d@swipnet.se>
7062
a58c13ed 7063 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
7064 label is not null (Bug#9951).
7065 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
7066 may be NULL.
7067
89bd5ee1
EZ
70682011-11-04 Eli Zaretskii <eliz@gnu.org>
7069
7070 * window.c (Fwindow_body_size): Mention in the doc string that the
7071 return value is in frame's canonical units. (Bug#9949)
7072
84c3edb9
EZ
70732011-11-03 Eli Zaretskii <eliz@gnu.org>
7074
4e2fb5c7
EZ
7075 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
7076
84c3edb9 7077 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 7078 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 7079 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 7080
bc17a887
EZ
70812011-11-01 Eli Zaretskii <eliz@gnu.org>
7082
7083 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
7084 Don't stop backward scan on the continuation glyph, even though
7085 its CHARPOS is positive.
6d5eb5b0
SM
7086 (mouse_face_from_buffer_pos, note_mouse_highlight):
7087 Rename cover_string to disp_string.
bc17a887 7088
4ee88440
MR
70892011-11-01 Martin Rudalics <rudalics@gmx.at>
7090
7091 * window.c (temp_output_buffer_show): Don't use
7092 Vtemp_buffer_show_specifiers.
7093 (Vtemp_buffer_show_specifiers): Remove unused variable.
7094
c2ff3c02
EZ
70952011-10-30 Eli Zaretskii <eliz@gnu.org>
7096
7097 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
7098 past the beginning of the current glyph matrix.
7099
58179cce 71002011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
7101
7102 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
7103 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
7104 HAVE_GTK3 (Bug#9869).
b77a6a7f 7105
3b574623
JD
7106 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
7107 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
7108
b77a6a7f
JD
7109 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
7110
7111 * xterm.c: Declare x_handle_net_wm_state to return int.
7112 (handle_one_xevent): Check if we are iconified but don't have
7113 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
7114 (get_current_wm_state): Return non-zero if not hidden,
7115 check for _NET_WM_STATE_HIDDEN (Bug#9893).
7116 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
7117 (x_handle_net_wm_state): Return what get_current_wm_state returns.
7118 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
7119
196e41e4
PE
71202011-10-29 Paul Eggert <eggert@cs.ucla.edu>
7121
7122 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
7123 so that this new function doesn't get optimized away by a
7124 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
7125
021f2e1a
AS
71262011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7127
7128 * frame.h (MOUSE_HL_INFO): Remove excess parens.
7129
8b058d44
EZ
71302011-10-29 Eli Zaretskii <eliz@gnu.org>
7131
7132 Fix the `xbytecode' command.
7133 * .gdbinit (xprintbytestr): New command.
b50a28de 7134 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
7135 (xbytecode): Print the byte-code string as well.
7136
4452fb80
EZ
71372011-10-29 Kim Storm <storm@cua.dk>
7138
8b058d44
EZ
7139 * alloc.c (which_symbols): New function.
7140
21b72067
AS
71412011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7142
7143 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
7144 line. (Bug#9903)
7145
83ed7b5c
GM
71462011-10-29 Glenn Morris <rgm@gnu.org>
7147
7148 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
7149 Not clear what it was for, and it causes various bugs. (Bug#9839)
7150
5a7a728b
EZ
71512011-10-28 Eli Zaretskii <eliz@gnu.org>
7152
7153 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
7154 possible random value that matches one of those tested as
7155 condition to clear the mouse face.
7156
d3d0842f
CY
71572011-10-28 Chong Yidong <cyd@gnu.org>
7158
7159 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
7160
31b39d13
DN
71612011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
7162
7163 * window.c (make_window): Initialize phys_cursor_on_p.
7164
9aba6043
SM
71652011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
7166
7167 * lisp.h (struct Lisp_Symbol): Update comments.
7168
c20992f4
JB
71692011-10-28 Juanma Barranquero <lekktu@gmail.com>
7170
7171 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
7172
db4f02f2
EZ
71732011-10-28 Eli Zaretskii <eliz@gnu.org>
7174
7175 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
7176 <oslsachem@gmail.com> for helping to debug this.
7177
7178 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
7179 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
7180 (g_b_init_get_glyph_outline_w): New static variables.
7181 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
7182 (GetGlyphOutlineW_Proc): New typedefs.
7183 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
7184 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
7185 New functions.
7186 (w32font_open_internal, compute_metrics):
7187 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
7188 instead of calling the "wide" APIs directly.
7189
7190 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
7191
7192 * w32.h (syms_of_w32font): Add prototype.
7193
87e68db4
JB
71942011-10-27 Juanma Barranquero <lekktu@gmail.com>
7195
7196 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
7197 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
7198 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
7199 (Fmove_to_window_line): Doc fix.
7200
435c1d67
CY
72012011-10-27 Chong Yidong <cyd@gnu.org>
7202
7203 * process.c (make_process): Set gnutls_state to NULL.
7204
7205 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
7206 non-NULL, regardless of GNUTLS_INITSTAGE.
7207 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
7208 an error. Set process slots as soon as we allocate them.
7209
7210 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
7211
9c6c6f49
CY
72122011-10-27 Chong Yidong <cyd@gnu.org>
7213
9aba6043
SM
7214 * gnutls.c (emacs_gnutls_deinit): New function.
7215 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
7216 (Fgnutls_deinit, Fgnutls_boot): Use it.
7217
7218 * process.c (make_process): Initialize GnuTLS credentials to NULL.
7219 (deactivate_process): Call emacs_gnutls_deinit.
7220
657d08d3
JB
72212011-10-27 Juanma Barranquero <lekktu@gmail.com>
7222
7223 * image.c (x_create_x_image_and_pixmap):
7224 * w32.c (sys_rename, w32_delayed_load):
7225 * w32font.c (fill_in_logfont):
7226 * w32reg.c (x_get_string_resource): Silence compiler warnings.
7227
5430d399
JB
72282011-10-26 Juanma Barranquero <lekktu@gmail.com>
7229
7230 * w32fns.c (w32_default_color_map): New function,
7231 extracted from Fw32_default_color_map.
a7ef684b 7232 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 7233
fe0055fa
PE
72342011-10-25 Paul Eggert <eggert@cs.ucla.edu>
7235
7236 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
7237
e6346438
SM
72382011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
7239
7240 * keyboard.c (test_undefined): New function (bug#9751).
7241 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
7242
e112cc37
ET
72432011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
7244
7245 * sysdep.c (init_sys_modes): Fix the check for the controlling
7246 terminal (Bug#6649).
7247
7b5d6677
EZ
72482011-10-20 Eli Zaretskii <eliz@gnu.org>
7249
7250 * dispextern.h (struct bidi_it): New member next_en_type.
7251
7252 * bidi.c (bidi_line_init): Initialize the next_en_type member.
7253 (bidi_resolve_explicit_1): When next_en_pos is valid for the
7254 current character, check also for next_en_type being WEAK_EN.
7255 (bidi_resolve_weak): Don't enter the expensive loop if the current
7256 position is before next_en_pos. Record the bidi type of the first
7257 non-ET, non-BN character we find, in addition to its position.
7258 (bidi_level_of_next_char): Invalidate next_en_type when
7259 next_en_pos is over-stepped.
7260
7da0b018
PE
72612011-10-20 Paul Eggert <eggert@cs.ucla.edu>
7262
7263 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
7264 * editfns.c: Rewrite current-time-zone so that it invokes
7265 the equivalent of (format-time-string "%Z") to get the time zone name.
7266 This fixes a bug when the time zone name contains characters that
7267 need converting from the system time locale to Emacs internal format.
7268 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
7269 that patch fixed format-time-string to do the conversion, but
7270 I forgot to fix current-time-zone.
7271 (format_time_string): New function, containing most of
7272 what Fformat_time_string used to contain.
7273 (Fformat_time_string): Rewrite in terms of format_time_string.
7274 This doesn't change this function's behavior.
7275 (current-time-zone): Rewrite to use format_time_string.
7276 This fixes the bug reported by Michael Schierl in
7277 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
7278 Jason Rumney's 2007-06-07 change worked around this bug, but
7279 didn't fix it.
7280 * systime.h (tzname, timezone): Remove no-longer-used declarations.
7281
8547b010
EZ
72822011-10-19 Eli Zaretskii <eliz@gnu.org>
7283
7284 * xdisp.c (start_display): If the character at POS is displayed
7285 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
7286 (try_window_reusing_current_matrix): If a line ends in a display
7287 vector or the next line starts in a display vector, continue
7288 redrawing the window even though the character position of
7289 start_row was reached.
8547b010
EZ
7290 (Bug#9771, part 2)
7291
4e948d15
CY
72922011-10-18 Chong Yidong <cyd@gnu.org>
7293
7294 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
7295 with nobreak-char-display too.
7296
4787455f
EZ
72972011-10-18 Eli Zaretskii <eliz@gnu.org>
7298
7299 Fix part 3 of bug#9771.
7300 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
7301 (bidi_resolve_neutral): Don't enter the expensive loop looking for
7302 non-neutral characters if the current character is a paragraph
7303 separator (a.k.a. Newline). This avoids running the same
7304 expensive loop twice, once when we consume the preceding newline
7305 and the other time when the line actually needs to be displayed.
7306 Avoid the loop when we see neutrals on the base embedding level
7307 following a character whose directionality is the same as the
7308 paragraph's. This avoids running the expensive loop when a line
7309 ends in a long sequence of neutrals, like control characters.
7310 Add assertion against STRONG_AL type. Slightly rearrange code
7311 that determines the type of a neutral given the first non-neutral
7312 that follows it.
7313 (bidi_level_of_next_char): Set next_en_pos to zero when
7314 invalidating its info.
7315
2c91f553
EZ
73162011-10-17 Eli Zaretskii <eliz@gnu.org>
7317
7318 * xdisp.c (push_display_prop): Determine whether to record string
7319 or buffer position by IT->string, not by IT->method. Allow
7320 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
7321 (move_it_vertically_backward): Don't look for character position
7322 immediately after the newline when in a continuation line.
7323 (Bug#9771, part 1)
2c91f553 7324
c7b08b0d
MR
73252011-10-15 Martin Rudalics <rudalics@gmx.at>
7326
7327 * window.c (coordinates_in_window): Rewrite and delabelize
7328 vertical border check. (Bug#5357) (Bug#9618)
7329
6b02f655
SM
73302011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7331
7332 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
7333 errors in XSetWindowBorder (bug#9310).
7334
81d40c92
DA
73352011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
7336
7337 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
7338 avoid crash when xmalloc overrun checking is enabled.
7339
d4172c3b
EZ
73402011-10-13 Eli Zaretskii <eliz@gnu.org>
7341
7342 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
7343 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
7344 cursor motion with <left> and <right> arrow keys.
7345
7346 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
7347 some callers set that themselves.
7348
b00eea75
EZ
73492011-10-12 Eli Zaretskii <eliz@gnu.org>
7350
7351 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
7352 display string and the previous row comes from the same string and
7353 is empty. (Bug#9739) (Bug#9738)
7354
8fe012c4
SM
73552011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
7356
7357 * doc.c (get_doc_string): Encode file name (bug#9735).
7358
0074aef2
EZ
73592011-10-12 Eli Zaretskii <eliz@gnu.org>
7360
79beb178
EZ
7361 * bidi.c (bidi_level_of_next_char):
7362 * xdisp.c (get_visually_first_element): Remove old incorrect
7363 comments regarding the Unicode Line Separator character.
7364
0074aef2
EZ
7365 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
7366
6e4b3fbe
DA
73672011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
7368
7369 * alloc.c (Fgc_status): Do not access beyond zombies array
7370 boundary if nzombies > MAX_ZOMBIES.
7371 * alloc.c (dump_zombies): Add missing format specifier.
7372
0324f3af
PE
73732011-10-12 Paul Eggert <eggert@cs.ucla.edu>
7374
b5525cac
PE
7375 * xdisp.c (set_cursor_from_row): Simplify conditionals,
7376 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
7377
0324f3af
PE
7378 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
7379 Some packages use them to denote characters with modifiers.
7380
e9b5f888
AS
73812011-10-11 Andreas Schwab <schwab@linux-m68k.org>
7382
7383 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
7384 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
7385 matching a pp-number. Rename parameter var to var1.
7386
127827c0
SM
73872011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
7388
7389 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
7390
c8fd3bd0
GM
73912011-10-08 Glenn Morris <rgm@gnu.org>
7392
7393 * callint.c (Fcall_interactively): Give a more explicit error for the
7394 'c' case with a non-character input. (Bug#8479)
7395
352ec8ff
EZ
73962011-10-08 Eli Zaretskii <eliz@gnu.org>
7397
03669ccb
EZ
7398 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
7399 lines.
7061c986
EZ
7400 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
7401 lines that are hscrolled on the left.
03669ccb 7402
352ec8ff
EZ
7403 * dispnew.c (buffer_posn_from_coords): Account for a possible
7404 presence of header-line. (Bug#4426)
7405
a66cfb1c
SM
74062011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
7407
6b02f655
SM
7408 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
7409 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 7410
7c5ee88e
PE
74112011-10-07 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
7414 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
7415 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
7416 this makes Emacs dump core during garbage collection on rare
7417 occasions. sizeof is obviously inferior to offsetof here, so
7418 stick with offsetof.
7419 (GC_POINTER_ALIGNMENT): New macro.
7420 (mark_memory): Omit 3rd (offset) arg; caller changed.
7421 Don't assume EMACS_INT alignment is the same as pointer alignment.
7422
df1bbe5b
SM
74232011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
7424
7425 * keyboard.c (read_key_sequence_remapped): New var.
7426 (read_key_sequence): Compute remapping in the right buffer.
7427 (command_loop_1): Use read_key_sequence's remapping directly.
7428
51553db6
SM
74292011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
7430
32c1fffd
SM
7431 * dired.c (file_name_completion): Don't expand file name.
7432 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
7433 before checking file name handler.
7434
51553db6
SM
7435 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
7436 they've been requested explicitly (bug#9591).
7437
b6bd1599 74382011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
7439
7440 * keymap.c (Fsingle_key_description): Use make_specified_string
7441 instead of build_string to build string from push_key_description.
7442 (Bug#5193)
7443
f701dc2a
PE
74442011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7445
4222c55d
PE
7446 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
7447 This fixes a Y2038 bug on 64-bit hosts.
7448 * buffer.c (reset_buffer):
7449 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
7450 (Fclear_buffer_auto_save_failure):
7451 Use 0, not -1, to represent an unset failure time, since time_t
7452 might not be signed.
7453
f701dc2a
PE
7454 Remove dependency on glibc malloc internals.
7455 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7456 Move back here from lisp.h, but with their new implementations.
7457 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7458 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
7459 * charset.c (charset_table_init): New static var.
7460 (syms_of_charset): Use it instead of xmalloc. This removes a
7461 dependency on glibc malloc internals. See Eli Zaretskii's comment in
7462 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
7463 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7464 Move back to alloc.c.
7465 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7466 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
7467
9ceebf39
JD
74682011-09-30 Jan Djärv <jan.h.d@swipnet.se>
7469
7470 * nsterm.m (windowDidResize): Call x_set_window_size only when
7471 ns_in_resize is true. Otherwise set pixelwidth/height and
7472 call change_frame_size (Bug#9628).
7473
cb993c58
PE
74742011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7475
3930c88b
PE
7476 Port --enable-checking=all to Fedora 14 x86-64.
7477 * charset.c (syms_of_charset): Also account for glibc malloc's
7478 internal overhead when calculating the initial malloc maximum.
7479
cb993c58
PE
7480 Port --enable-checking=all to Fedora 14 x86.
7481 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7482 Move to lisp.h.
7483 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
7484 (overrun_check_realloc, overrun_check_free):
7485 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
7486 That way, xmalloc returns a properly-aligned pointer even if
7487 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
7488 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
7489 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
7490 into account when calculating the initial malloc maximum.
7491 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7492 Move here from alloc.c, so that charset.c can use it too.
7493 Properly align; the old code wasn't right for common 32-bit hosts
7494 when configured with --enable-checking=all.
7495 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7496 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
7497
31bed486
EZ
74982011-09-29 Eli Zaretskii <eliz@gnu.org>
7499
04c70788 7500 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
7501 use EDOM.
7502
fbcaa2f3
EZ
75032011-09-28 Eli Zaretskii <eliz@gnu.org>
7504
7505 * xdisp.c (compute_display_string_end): If there's no display
7506 string at CHARPOS, return -1.
7507
7508 * bidi.c (bidi_fetch_char): When compute_display_string_end
7509 returns a negative value, treat the character as a normal
7510 character not covered by a display string. (Bug#9624)
7511
a239d4e9
JB
75122011-09-28 Juanma Barranquero <lekktu@gmail.com>
7513
7514 * lread.c (Fread_from_string): Fix typo in docstring.
7515
88652fd5
EZ
75162011-09-27 Eli Zaretskii <eliz@gnu.org>
7517
7518 * xdisp.c (handle_invisible_prop): If invisible text ends on a
7519 newline, reseat the iterator instead of bidi-iterating there one
7520 character at a time. (Bug#9610)
32c1fffd
SM
7521 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
7522 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 7523
ed497dd4
AS
75242011-09-27 Andreas Schwab <schwab@linux-m68k.org>
7525
7526 * lread.c (readevalloop): Use correct code for NBSP.
7527 (read1): Likewise. (Bug#9608)
7528
b2bf61aa
MA
75292011-09-25 Michael Albinus <michael.albinus@gmx.de>
7530
7531 * dbusbind.c (Fdbus_register_signal): When service is not
7532 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
7533
32bbb17c
GM
75342011-09-25 Glenn Morris <rgm@gnu.org>
7535
7536 * buffer.c (truncate-lines): Doc fix.
7537
94e0933e
CY
75382011-09-24 Chong Yidong <cyd@stupidchicken.com>
7539
7540 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
7541 (Fset_window_next_buffers): Doc fix.
7542
cddde921
GM
75432011-09-24 Glenn Morris <rgm@gnu.org>
7544
7545 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
7546
1260aef1
PE
75472011-09-24 Paul Eggert <eggert@cs.ucla.edu>
7548
25b4bfa0
PE
7549 Fix minor problems found by static checking.
7550 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
7551 * indent.c (Fvertical_motion): Fix == vs = typo.
7552
e3cbd34b
EZ
75532011-09-24 Eli Zaretskii <eliz@gnu.org>
7554
a66cfb1c
SM
7555 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
7556 Default value is now t. Doc fix.
6bf7006f 7557
e3cbd34b 7558 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 7559 logic when moving up, not only when moving down. Fix the
e3cbd34b 7560 confusing name and values of the it_overshoot_expected variable;
32c1fffd 7561 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
7562
7563 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
7564 CHARPOS is covered by a display string which includes newlines.
7565 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
7566 is covered by a display string with embedded newlines.
7567
a3de0cbd
MA
75682011-09-24 Michael Albinus <michael.albinus@gmx.de>
7569
7570 * dbusbind.c (Fdbus_register_signal): Add match rule to
7571 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
7572 (Fdbus_register_method, Vdbus_registered_objects_table):
7573 Fix docstring.
a3de0cbd 7574
b260039d
JM
75752011-09-24 Jim Meyering <meyering@redhat.com>
7576
32c1fffd 7577 do not ignore write error for any output size
b260039d
JM
7578 The previous change was incomplete.
7579 While it makes emacs --batch detect the vast majority of stdout
7580 write failures, errors were still ignored whenever the output size is
7581 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
7582 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
7583 && echo FAIL: ignored write error
7584 FAIL: ignored write error
7585 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
7586 && echo FAIL: ignored write error
7587 FAIL: ignored write error
7588 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
7589
8eca8a7c
AS
75902011-09-23 Andreas Schwab <schwab@linux-m68k.org>
7591
7592 * emacs.c (Fkill_emacs): In noninteractive mode exit
7593 non-successfully if a write error occurred on stdout. (Bug#9574)
7594
3341db62
EZ
75952011-09-21 Eli Zaretskii <eliz@gnu.org>
7596
7597 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
7598 the xassert test.
7599
7600 * dispextern.h (struct it): Update the comment documenting what
7601 can it->OBJECT be.
7602
8c203dbf
EZ
76032011-09-20 Eli Zaretskii <eliz@gnu.org>
7604
7605 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
7606 a display string, extend search for cursor position to end of row.
7607 (find_row_edges): If the row ends in a newline from a display
7608 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
7609 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
7610 (Fcurrent_bidi_paragraph_direction): Fix search for previous
7611 non-empty line. Fixes confusing cursor motion with arrow keys at
7612 the beginning of a line that starts with whitespace.
8c203dbf 7613
a4824228
LMI
76142011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7615
7616 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7617 (bug#9493).
7618
33ed493b
CY
76192011-09-18 Chong Yidong <cyd@stupidchicken.com>
7620
7621 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7622 boolean (Bug#9154).
7623
56cd55c8
EZ
76242011-09-18 Eli Zaretskii <eliz@gnu.org>
7625
7626 * xdisp.c (display_line): Record maximum and minimum buffer
7627 positions even if no glyphs were produced (e.g., by a zero-width
7628 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
7629 buffer positions that will be removed from the glyph row because
7630 they don't fit.
c02dcedf
EZ
7631 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7632 column is beyond frame width: don't subtract 1 "pixel" when
7633 computing width of the stretch.
3e62b7e0
EZ
7634 (reseat_at_next_visible_line_start): Undo the change made on
7635 2011-09-17 that saved paragraph information and restored it after
7636 the call to `reseat'. (Bug#9545)
56cd55c8 7637
5ed99d36 76382011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
7639
7640 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7641 and turn window cursor on if cleared (Bug#9415).
7642
5ed99d36 76432011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
7644
7645 * search.c (boyer_moore): Take unibyte characters from pattern
7646 literally. (Bug#9458)
7647
9bade7b2
EZ
76482011-09-18 Eli Zaretskii <eliz@gnu.org>
7649
7650 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7651
e5e9d610
PE
76522011-09-18 Paul Eggert <eggert@cs.ucla.edu>
7653
87e4427a
PE
7654 Fix minor problem found by static checking.
7655 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7656 initialized, to pacify gcc -Wuninitialized.
7657
e5e9d610
PE
7658 * fileio.c: Report proper errno when syscall falls.
7659 (Finsert_file_contents): Save and restore errno,
7660 so that report_file_error outputs the correct diagnostic.
7661 (Fwrite_region) [CLASH_DETECTION]: Likewise.
7662
a1674f0b
EZ
76632011-09-18 Eli Zaretskii <eliz@gnu.org>
7664
7665 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7666
fbfb6dd4
EZ
76672011-09-17 Eli Zaretskii <eliz@gnu.org>
7668
7669 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7670 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
7671
bb187662
EZ
76722011-09-17 Eli Zaretskii <eliz@gnu.org>
7673
1137e8b8 7674 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 7675 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
7676
7677 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7678 (bidi_find_paragraph_start): Search back for paragraph beginning
7679 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7680 (bidi_move_to_visually_next): Only trigger paragraph-related
7681 computations when the last character is a newline or at EOB, not
7682 just any NEUTRAL_B. (Bug#9470)
7683
bb187662
EZ
7684 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7685 truncated lines if point is covered by a display string. (Bug#9524)
7686
2e621251
PE
76872011-09-16 Paul Eggert <eggert@cs.ucla.edu>
7688
7689 * xselect.c: Relax test for outgoing X longs (Bug#9498).
7690 (cons_to_x_long): New function.
7691 (lisp_data_to_selection_data): Use it. Correct the test for
7692 short-versus-long data; it was negated. Break out of vector
7693 loop, for efficiency, when a long datum is discovered.
7694
91a15bc6
SM
76952011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
7696
7697 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7698
b41c3a35
EZ
76992011-09-16 Eli Zaretskii <eliz@gnu.org>
7700
7701 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7702 GCC PR/17406) by declaring this function with external scope.
7703
7812ba2d
PE
77042011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7705
7706 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7707 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7708
cf7edc2a
AS
77092011-09-15 Andreas Schwab <schwab@linux-m68k.org>
7710
7711 * editfns.c (Fformat): Correctly handle text properties on "%%".
7712
bd01620e
EZ
77132011-09-15 Eli Zaretskii <eliz@gnu.org>
7714
7715 * xterm.c (x_draw_composite_glyph_string_foreground):
7716 * w32term.c (x_draw_composite_glyph_string_foreground):
7717 * term.c (encode_terminal_code):
7718 * composite.c (composition_update_it, get_composition_id):
7719 * xdisp.c (get_next_display_element)
7720 (fill_composite_glyph_string): Add comments about special meaning
7721 of TAB characters in a composition.
7722
a02719a3
PE
77232011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7724
7725 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
7726 This occurs when processing a multibyte format.
7727 Problem reported by Wolfgang Jenker.
a02719a3 7728
72589a3c
JB
77292011-09-15 Johan Bockgård <bojohan@gnu.org>
7730
7731 * xdisp.c (try_cursor_movement): Only check for exact match if
7732 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
7733
1c14176c
PE
77342011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7735
7736 Remove unused external symbols.
7737 * dispextern.h (calc_pixel_width_or_height): Remove decl.
7738 * xdisp.c (calc_pixel_width_or_height): Now static.
7739 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7740 * indent.c (check_display_width):
7741 * w32term.c: Fix comment to match code.
7742 * xterm.c, xterm.h (x_catching_errors): Remove.
7743
d2eea5b5
PE
77442011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7745
7746 * xselect.c: Use signed conversions more consistently (Bug#9498).
7747 (selection_data_to_lisp_data): Assume incoming selection data are
7748 signed integers, not unsigned. This is to be consistent with
7749 outgoing selection data, which was modified to use signed integers
7750 in as part of the fix to Bug#9196 in response to Jan D.'s comment
7751 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7752 expects long, not unsigned long.
7753
46888499
EZ
77542011-09-14 Eli Zaretskii <eliz@gnu.org>
7755
7756 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7757 computation of loop end. Reported by Johan Bockgård
7758 <bojohan@gnu.org>.
7759
ef8ef9fb
CY
77602011-09-13 Chong Yidong <cyd@stupidchicken.com>
7761
7762 * frame.c (Fother_visible_frames_p): Function deleted.
7763
fa819fed
EZ
77642011-09-12 Eli Zaretskii <eliz@gnu.org>
7765
7766 * indent.c (compute_motion): Process display vector front to back
7767 rather than the other way around. (Bug#2496)
7768
2ba8e008
SM
77692011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7770
7771 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
7772
20f53c69
CY
77732011-09-11 Chong Yidong <cyd@stupidchicken.com>
7774
7775 * minibuf.c (Fread_from_minibuffer): Doc fix.
7776
d562d7a4
EZ
77772011-09-11 Eli Zaretskii <eliz@gnu.org>
7778
7779 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7780 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7781
1c4d7f3d
LMI
77822011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7783
7784 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7785 value for non-existent files.
7786
b885bf36
EZ
77872011-09-11 Eli Zaretskii <eliz@gnu.org>
7788
7789 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7790 set its "size" to -1. This will set the modtime_size field of
7791 the corresponding buffer to -1, which is what
7792 verify-visited-file-modtime expects for files that do not exist.
7793 (Bug#9139)
7794
6612f0bf
PE
77952011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7796
7797 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7798 here ...
7799 * lisp.h: ... from here. push_key_description is no longer
7800 defined in keyboard.c, so its declaration should not be in
7801 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7802 logically belongs with push_key_description.
7803
dfb3f755
PE
78042011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7805
7806 * buffer.h: Include <sys/types.h> instead of <time.h>.
7807 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7808 Problem reported by Herbert J. Skuhra.
7809
3134906c
LMI
78102011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7811
7812 * xml.c (parse_region): Make the parsing work for
7813 non-comment-starting XML files again (bug#9144).
7814
8d903f4e
AS
78152011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7816
7817 * image.c (gif_load): Fix calculation of bottom and right corner.
7818 (Bug#9468)
7819
80ad64f4
EZ
78202011-09-10 Eli Zaretskii <eliz@gnu.org>
7821
7822 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7823 redisplay in small windows.
7824
208a048d
EZ
78252011-09-09 Eli Zaretskii <eliz@gnu.org>
7826
7827 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7828
9b1c252e
MR
78292011-09-08 Martin Rudalics <rudalics@gmx.at>
7830
7831 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7832 Operate on live windows only.
7833
2949f33b
JB
78342011-09-08 Juanma Barranquero <lekktu@gmail.com>
7835
7836 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7837
e08dcafd
EZ
78382011-09-07 Eli Zaretskii <eliz@gnu.org>
7839
7840 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7841 only under bidi iteration.
7842
115b96bd
JD
78432011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7844
7845 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7846
c8199d0f
PE
78472011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7848
7849 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7850 Without this fix, the command to link temacs failed due to an
7851 undefined symbol __builtin_isnan. This is because
7852 /usr/include/iso/math_c99.h #defines isnan(x) to
7853 __builtin_isnan(x), but the bundled gcc, which identifies itself
7854 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7855 a __builtin_isnan.
7856 * floatfns.c (isnan): #undef, and then #define to a clone of
7857 what's in data.c.
7858 (Fisnan): Always define, since it's always available now.
7859 (syms_of_floatfns): Always define isnan at the Lisp level.
7860
e39b275c 78612011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
7862
7863 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7864
b2db44d9 78652011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 7866
f4af5137 7867 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
7868 The previous code assumed that file offsets (off_t values) fit in
7869 EMACS_INT variables, which is not true on typical 32-bit hosts.
7870 The code messed up by falsely reporting buffer overflow in cases
7871 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7872 when "big" contains more than 2**29 bytes, even though this
7873 inserts just one byte and does not overflow the buffer.
7874 (Finsert_file_contents): Store file offsets as off_t
7875 values, not as EMACS_INT values. Check for overflow when
7876 converting between EMACS_INT and off_t. When checking for
7877 buffer overflow or for overlap, take the offsets into account.
7878 Don't use EMACS_INT for small values where int suffices.
7879 When checking for overlap, fix a typo: ZV was used where
7880 ZV_BYTE was intended.
7881 (Fwrite_region): Don't assume off_t fits into 'long'.
7882 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7883
ecfc0a49
MA
78842011-09-05 Michael Albinus <michael.albinus@gmx.de>
7885
7886 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7887
6511acf2 78882011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 7889
0999621a 7890 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
7891
7892 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 7893 (esprintf, exprintf, evxprintf): New functions.
62f19c19 7894 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 7895 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
7896 (modify_event_symbol): Do not assume that the length of
7897 name_alist_or_stem is safe to alloca and fits in int.
7898 (Fexecute_extended_command): Likewise for function name and binding.
7899 (Frecursion_depth): Wrap around reliably on integer overflow.
7900 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7901 since some callers pass EMACS_INT values.
7902 (Fsingle_key_description): Don't crash if symbol name contains more
7903 than MAX_ALLOCA bytes.
7904 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7905 (get_minibuffer): Arg is now EMACS_INT, not int.
7906 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 7907 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
7908 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7909
2be7d702
PE
7910 * dbusbind.c (signature_cat): New function.
7911 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
7912 Do not overrun buffer; instead, report string overflow.
7913
9d1df220
PE
7914 * dispnew.c (add_window_display_history): Don't overrun buffer.
7915 Truncate instead; this is OK since it's just a log.
7916
33ef5c64
PE
7917 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7918 even if the time zone offset is outlandishly large.
7919 Don't mishandle offset == INT_MIN.
7920
66c6fdd5
PE
7921 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7922 when creating daemon; the previous buffer-overflow check was incorrect.
7923
d749b01b
PE
7924 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7925 which has the guts of the old verror function.
7926
b5cd1905
PE
7927 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7928 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7929
6e1a67fb
PE
7930 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7931 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 7932 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 7933 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
7934 length of string rather than counting it via multiple sprintfs;
7935 that's simpler and more reliable.
c21721cc
PE
7936 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7937 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7938 sprintf, in case result does not fit in int.
7939
c57b67fc
PE
7940 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7941 (fontset_from_font): Print it.
7942
8a401434
PE
7943 * frame.c (tty_frame_count): Now printmax_t, not int.
7944 (make_terminal_frame, set_term_frame_name): Print it.
7945 (x_report_frame_params): In X, window IDs are unsigned long,
7946 not signed long, so print them as unsigned.
7947 (validate_x_resource_name): Check for implausibly long names,
7948 and don't assume name length fits in 'int'.
7949 (x_get_resource_string): Don't blindly alloca invocation name;
7950 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7951 not fit in int.
7952
6e1a67fb
PE
7953 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7954 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
7955 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7956
0df02bf3
PE
7957 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7958 Use esprintf, not sprintf, in case result does not fit in int.
7959
48e30793
PE
7960 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7961 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7962 it as a large positive number.
7963 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7964 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7965
a66ff6d8
PE
7966 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7967 in case result does not fit in int.
7968
aca216ff
PE
7969 * print.c (float_to_string): Detect width overflow more reliably.
7970 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7971 buffer overrun. Don't assume list length fits in 'int'. Treat
7972 print length of 0 as 0, not as infinity; to be consistent with other
7973 uses of print length in this function. Don't overflow print length
7974 index. Don't assume hash table size fits in 'long', or that
7975 vectorlike size fits in 'unsigned long'.
7976
31c286f7
PE
7977 * process.c (make_process): Use printmax_t, not int, to format
7978 process-name gensyms.
7979
55e5faa1
PE
7980 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7981
80f2e268
PE
7982 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7983 to avoid potential buffer overrun.
7984
670741ab
PE
7985 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7986 if X resource line is longer than 512 bytes.
7987
b7163a50
PE
7988 * xfns.c (x_window): Make sprintf buffer a bit bigger
7989 to avoid potential buffer overrun.
7990
ae58ff1f
PE
7991 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7992
c43c8a6a
PE
7993 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7994
3f8236f4
PE
79952011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7996
53e9fe90 7997 Integer overflow fixes for scrolling, etc.
6511acf2
PE
7998 Without these, Emacs silently mishandles large integers sometimes.
7999 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
8000 it were "C-u 1 M-x recenter" on a typical 64-bit host.
8001
6511acf2
PE
8002 * xdisp.c (try_window_id): Check Emacs fixnum range before
8003 converting to 'int'.
806add1d 8004
6511acf2 8005 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
8006 Check that an Emacs fixnum is in range before assigning it to 'int'.
8007 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8008 values converted from Emacs fixnums.
8009 (Frecenter): Don't wrap around a line count if it is out of 'int'
8010 range; instead, treat it as an extreme value.
8011 (Fset_window_configuration, compare_window_configurations):
8012 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8013
6511acf2
PE
8014 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8015 that can exceed INT_MAX. Check that EMACS_INT value is in range
8016 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
8017 (match_limit): Don't assume that a fixnum can fit in 'int'.
8018
6511acf2 8019 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
8020 exceed INT_MAX.
8021
6511acf2 8022 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
8023 (Fvertical_motion): Don't wrap around LINES values that don't fit
8024 in 'int'. Instead, treat them as extreme values. This is good
8025 enough for windows, which can't have more than INT_MAX lines anyway.
8026
fcb901a7
LMI
80272011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8028
0f2f6b6d
LMI
8029 * Require libxml/parser.h to avoid compilation warning.
8030
fcb901a7
LMI
8031 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8032
8033 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8034 since this reportedly can destroy thread storage.
8035
6e20a0d4
CY
80362011-08-30 Chong Yidong <cyd@stupidchicken.com>
8037
8038 * syntax.c (find_defun_start): Update all cache variables if
8039 exiting early (Bug#9401).
8040
148ae00e
EZ
80412011-08-30 Eli Zaretskii <eliz@gnu.org>
8042
f6cfbd8f
EZ
8043 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8044
148ae00e
EZ
8045 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
8046 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
8047 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
8048
8049 * term.c (tty_append_glyph): New function.
8050 (produce_stretch_glyph): Static function and its prototype deleted.
8051
a66cfb1c
SM
8052 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
8053 Add prototypes.
148ae00e 8054
c4a07a4c
PE
80552011-08-29 Paul Eggert <eggert@cs.ucla.edu>
8056
8057 * image.c (parse_image_spec): Check for nonnegative, not for positive,
8058 when checking :margin (Bug#9390).
8059 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 8060 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
8061 so that the name doesn't mislead. All uses changed.
8062
6bc8cd65
JB
80632011-08-28 Johan Bockgård <bojohan@gnu.org>
8064
8065 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
8066 set_tty_hooks.
8067
dca4927e
EZ
80682011-08-27 Eli Zaretskii <eliz@gnu.org>
8069
8070 * xdisp.c (move_it_to): Don't bail out early when reaching
8071 position beyond to_charpos, if we are scanning backwards.
8072 (move_it_vertically_backward): When DY == 0, make sure we get to
8073 the first character in the line after the newline.
8074
f2cad773
PE
80752011-08-27 Paul Eggert <eggert@cs.ucla.edu>
8076
8077 * ccl.c: Improve and simplify overflow checking (Bug#9196).
8078 (ccl_driver): Do not generate an out-of-range pointer.
8079 (Fccl_execute_on_string): Remove unnecessary check for
8080 integer overflow, noted by Stefan Monnier in
8081 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
8082 Remove a FIXME that didn't need fixing.
8083 Simplify the newly-introduced buffer reallocation code.
8084
0cae2cdb
JB
80852011-08-27 Juanma Barranquero <lekktu@gmail.com>
8086
8087 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
8088
5fc295a4 80892011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 8090
70c60eb2 8091 Integer and memory overflow issues (Bug#9196).
726e0ab1 8092
d31850da
PE
8093 * doc.c (get_doc_string): Rework so that
8094 get_doc_string_buffer_size is the actual buffer size, rather than
8095 being 1 less than the actual buffer size; this makes xpalloc more
8096 convenient.
8097
a69fbedb
PE
8098 * image.c (x_allocate_bitmap_record, cache_image):
8099 * xselect.c (Fx_register_dnd_atom):
8100 Simplify previous changes by using xpalloc.
8101
fe5c5d37
PE
8102 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
8103 since either will do and ptrdiff_t is convenient with xpalloc.
8104
0065d054
PE
8105 * charset.c (charset_table_size)
8106 (struct charset_sort_data.priority): Now ptrdiff_t.
8107 (charset_compare): Don't overflow if priorities differ greatly.
8108 (Fsort_charsets): Don't assume list length fits in int.
8109 Check for size-calculation overflow when allocating sort data.
8110 (syms_of_charset): Allocate an initial charset table that is
8111 just under 64 KiB, to avoid problems with glibc malloc and mmap.
8112
8113 * cmds.c (internal_self_insert): Check for size-calculation overflow.
8114
8115 * composite.h (struct composition.glyph_len): Now int, not unsigned.
8116 The actual value is always <= INT_MAX, and leaving it unsigned made
8117 overflow checking harder.
8118
8119 * dispextern.h (struct glyph_matrix.rows_allocated)
8120 (struct face_cache.size): Now ptrdiff_t, for convenience in use
8121 with xpalloc. The values are still always <= INT_MAX.
8122
8123 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
8124
8125 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
8126 (SAFE_NALLOCA): New macro.
8127
8128 * region-cache.c (struct boundary.pos, find_cache_boundary)
8129 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
8130 (set_cache_region, invalidate_region_cache)
8131 (revalidate_region_cache, know_region_cache, region_cache_forward)
8132 (region_cache_backward, pp_cache):
8133 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
8134 so that ptrdiff_t * can be passed to xpalloc.
8135 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
8136 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
8137 (pp_cache): Don't assume cache_len fits in int.
8138 * region-cache.h: Adjust extern decls to match.
8139
8140 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
8141 EMACS_INT, since either will do, for xpalloc.
8142
8143 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
8144 (xnmalloc, xnrealloc, xpalloc): New functions.
8145
726e0ab1
PE
8146 * bidi.c (bidi_shelve_header_size): New constant.
8147 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
8148 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
8149
51f30bc5 8150 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
8151 * buffer.c (overlays_at, overlays_in, record_overlay_string)
8152 (overlay_strings):
8153 Don't update size of array until after memory allocation succeeds,
8154 because xmalloc/xrealloc may not return.
0065d054
PE
8155 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
8156 now that we have proper integer overflow checking.
8157 (record_overlay_string, overlay_strings): Catch overflows when
8158 calculating size of overlay_str_buf.
726e0ab1 8159
0065d054
PE
8160 * callproc.c (Fcall_process): Check for size overflow when
8161 calculating size of args2.
8162 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
8163 Normally we prefer signed values, but sticking with ptrdiff_t would
8164 require adding more-complicated checks.
726e0ab1
PE
8165
8166 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
8167 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
8168 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 8169 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
8170
8171 * character.c (Fstring): Check for size-calculation overflow.
8172
8173 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
8174 unnecessary integer overflow. Check for size overflow.
8175 (encode_coding_object): Don't update size until xmalloc succeeds.
8176
8177 * composite.c (get_composition_id): Check for overflow in glyph
8178 length calculations.
8179
8180 Integer and memory overflow fixes for display code.
8181 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
8182 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
8183 (scrolling_window): Check for overflow in size calculations.
8184 (line_draw_cost, realloc_glyph_pool, add_row_entry):
8185 Don't assume glyph table len fits in int.
8186 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
8187 (row_table_size): Now ptrdiff_t, not int.
8188 (scrolling_window): Avoid overflow in size calculations.
8189 Don't update size until allocation succeeds.
8190 * fns.c (concat): Check for overflow in size calculations.
8191 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
8192 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8193 (NEXT_ALMOST_PRIME_LIMIT): New constant.
8194
8195 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
8196 (get_doc_string): Check for size calculation overflow.
8197 Don't update size until allocation succeeds.
8198 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
8199 EMACS_INT, where ptrdiff_t will do.
8200 (Fsubstitute_command_keys): Check for string overflow.
8201
8202 * editfns.c (set_time_zone_rule): Don't assume environment length
8203 fits in int.
8204 (message_length): Now ptrdiff_t, not int.
8205 (Fmessage_box): Don't update size until allocation succeeds.
8206 Don't assume message length fits in int.
8207 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
8208
0065d054
PE
8209 * emacs.c (main): Do not reallocate argv, since there is a null at
8210 the end that can be overwritten, and this way there's no need to
8211 worry about size-calculation overflow.
8212 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
8213
8214 * eval.c (init_eval_once, grow_specpdl): Don't update size until
8215 alloc succeeds.
8216 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
8217
8218 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
8219 (x_set_scroll_bar_width, x_figure_window_size):
8220 Check for integer overflow.
8221 (x_set_alpha): Do not assume XINT fits in int.
8222
8223 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
8224 This is for the members text_lines, text_cols, total_lines, total_cols,
8225 where the system imposes an 'int' limit.
8226
8227 * fringe.c (Fdefine_fringe_bitmap):
8228 Don't update size until alloc works.
8229
8230 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
8231 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
8232
8233 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
8234 Check for size-calculation overflow.
8235 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
8236 do, as we prefer signed integers.
8237 (id_to_widget.max_size, id_to_widget.used)
8238 (xg_store_widget_in_map, xg_remove_widget_from_map)
8239 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
8240 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
8241 Use and return ptrdiff_t, not int.
8242 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
8243 * gtkutil.h: Change prototypes to match the above.
8244
8245 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
8246 are duplicate now that they've been promoted to lisp.h.
8247 (x_allocate_bitmap_record, x_alloc_image_color)
8248 (make_image_cache, cache_image, xpm_load):
8249 Don't update size until alloc is done.
8250 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
8251 (x_detect_edges):
3256efce 8252 Check for size calculation overflow.
726e0ab1
PE
8253 (ct_colors_allocated_max): New constant.
8254 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
8255 overflow.
3256efce 8256
726e0ab1
PE
8257 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
8258 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
8259 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
8260 Use ptrdiff_t, not int, to count maps.
8261 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
8262 calculations. Don't update size until allocation succeeds.
8263 Redo calculations to avoid overflow.
726e0ab1
PE
8264 * keyboard.h: Change prototypes to match the above.
8265
8266 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
8267 to count maps.
8268 (current_minor_maps): Check for size calculation overflow.
8269 * keymap.h: Change prototypes to match the above.
8270
8271 * lread.c (read1, init_obarray): Don't update size until alloc done.
8272
8273 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
8274 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
8275
726e0ab1
PE
8276 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
8277 Now ptrdiff_t, not int.
8278 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
8279 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
8280
8281 * process.c (Fnetwork_interface_list): Check for overflow
8282 in size calculation.
8283
8284 * region-cache.c (move_cache_gap): Check for size calculation overflow.
8285
8286 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
8287 overflow. Don't bother calling xmalloc when xrealloc will do.
8288
8289 * search.c (Freplace_match): Check for size calculation overflow.
8290 (Fset_match_data): Don't assume list lengths fit in 'int'.
8291
8292 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
8293 for command line length. Do not attempt to address one before the
8294 beginning of an array, as that's not portable.
8295
8296 * term.c (max_frame_lines): Remove; unused.
8297 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
8298 not int.
8299 (encode_terminal_code, calculate_costs): Check for size
8300 calculation overflow.
8301 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
8302 table lengths and related sizes. Don't update size until alloc
8303 done. Redo calculations to avoid overflow.
8304 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
8305
8306 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
8307 subtracting pointers.
8308 (gobble_line): Check for overflow more carefully. Don't update size
8309 until alloc done.
8310
8311 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
8312 Don't update size until alloc done.
8313 Redo size calculations to avoid overflow.
8314 Check for size calculation overflow.
0065d054 8315 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
8316
8317 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
8318 Use ptrdiff_t, not int, for sizes.
8319 (store_mode_line_noprop_char): Don't update size until alloc done.
8320
0065d054
PE
8321 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
8322 Use ptrdiff_t, not int, for sizes.
8323 (Finternal_make_lisp_face, cache_face):
8324 Check for size calculation overflow.
8325 (cache_face): Treat size calculation overflows as if they were
8326 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
8327
8328 * xfns.c (x_encode_text, x_set_name_internal)
8329 (Fx_change_window_property): Use ptrdiff_t, not int, to count
8330 sizes, since they can exceed INT_MAX in size. Check for size
8331 calculation overflow.
8332
0065d054
PE
8333 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
8334 (xg_select): Check for size calculation overflow.
726e0ab1
PE
8335 Don't update size until alloc done.
8336
0065d054 8337 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 8338 as sprintf is limited to int lengths.
1d526e2f 8339
252c5ee1
PE
8340 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
8341 (X_LONG_MIN): New macros.
864d7ce7
PE
8342 Use them to make the following changes clearer.
8343 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
8344 This change doesn't affect the value now, but it may help remind
8345 future maintainers not to raise the value too much later.
8346 (SELECTION_QUANTUM): Remove, replacing with ...
8347 (selection_quantum): ... new function, which avoids overflow.
8348 All uses changed.
8349 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
8350 assumption that selection length fits in 'int'.
8351 (x_reply_selection_request, x_handle_selection_request)
8352 (x_get_window_property, receive_incremental_selection)
8353 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
8354 (lisp_data_to_selection_data, clean_local_selection_data):
8355 Use ptrdiff_t, not int, to record length of selection.
8356 (x_reply_selection_request, x_get_window_property)
8357 (receive_incremental_selection, x_property_data_to_lisp):
8358 Redo calculations to avoid overflow.
8359 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 8360 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
8361 something.
8362 (x_get_window_property, receive_incremental_selection)
8363 (lisp_data_to_selection_data, x_property_data_to_lisp):
8364 Check for size-calculation overflow.
8365 (x_get_window_property, receive_incremental_selection)
8366 (lisp_data_to_selection_data, Fx_register_dnd_atom):
8367 Don't store size until memory allocation succeeds.
8368 (x_get_window_property): Plug memory leak on memory exhaustion.
8369 Don't double-block input; malloc is safe here. Don't assume 2**34
8370 - 4 fits in unsigned long. Add an xassert to check
8371 XGetWindowProperty overflow. Be more careful about overflow
8372 calculations, and distinguish size from memory overflow better.
8373 (receive_incremental_selection): When tracing, don't assume
8374 unsigned int is less than INT_MAX.
8375 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
8376 harmful) conversions of unsigned short to int.
8377 (lisp_data_to_selection_data): Don't assume that integers
8378 in the range -65535 through -1 fit in an X unsigned short.
8379 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
8380 result parameters unless successful. Rely on cons_to_unsigned
8381 to report problems with elements; the old code wasn't right anyway.
8382 (x_check_property_data): Check for int overflow; we cannot use
8383 a wider type due to X limits.
8384 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
8385
726e0ab1 8386 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 8387
0065d054
PE
8388 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
8389 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
8390 (x_color_cells): Don't store size until memory allocation succeeds.
8391 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 8392 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
8393 (x_term_init): Don't assume length fits in int (sprintf is limited
8394 to int size).
bc18e09d 8395
ebfa62c0
PE
8396 Use ptrdiff_t for composition IDs.
8397 * character.c (lisp_string_width):
8398 * composite.c (composition_table_size, n_compositions)
8399 (get_composition_id, composition_gstring_from_id):
8400 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
8401 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
8402 * window.c (Frecenter):
8403 Use ptrdiff_t, not int, for composition IDs.
8404 * composite.c (get_composition_id): Check for integer overflow.
8405 * composite.h: Adjust prototypes to match the above changes.
8406
d3411f89
PE
8407 Use ptrdiff_t for hash table indexes.
8408 * category.c (hash_get_category_set):
8409 * ccl.c (ccl_driver):
8410 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
8411 * coding.c (coding_system_charset_list, detect_coding_system):
8412 * coding.h (struct coding_system.id):
8413 * composite.c (get_composition_id, gstring_lookup_cache):
8414 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
8415 * image.c (xpm_get_color_table_h):
8416 * lisp.h (hash_lookup, hash_put):
8417 * minibuf.c (Ftest_completion):
8418 Use ptrdiff_t for hash table indexes, not int (which is too
8419 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
8420 32-bit --with-wide-int hosts).
8421
e097a6fa
PE
8422 * charset.c (Fdefine_charset_internal): Check for integer overflow.
8423 Add a FIXME comment about memory leaks.
8424 (syms_of_charset): Don't assume xmalloc returns.
8425
5637687f
PE
8426 Don't assume that stated character widths fit in int.
8427 * character.c (Fchar_width, c_string_width, lisp_string_width):
8428 * character.h (CHAR_WIDTH):
8429 * indent.c (MULTIBYTE_BYTES_WIDTH):
8430 Use sanitize_char_width to avoid undefined and/or bad behavior
8431 with outlandish widths.
a66cfb1c 8432 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
8433 now that we have two such functions. All uses changed.
8434 (sanitize_char_width): New inline function.
8435
a2271ba2
PE
8436 Don't assume that tab-width fits in int.
8437 * character.h (sanitize_width): New inline function.
8438 (SANE_TAB_WIDTH): New macro.
8439 (ASCII_CHAR_WIDTH): Use it.
8440 * indent.c (sane_tab_width): Remove. All uses replaced by
8441 SANE_TAB_WIDTH (current_buffer).
8442 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
8443
18c52557
PE
8444 * fileio.c: Integer overflow issues with file modes.
8445 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
8446
caeeedc1
PE
8447 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
8448 Remove unreachable code.
8449 (read_hex, load_charset_map_from_file): Check for integer overflow.
8450
6df6ae42 8451 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
8452 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
8453 (x_send_scroll_bar_event): Likewise. Check that the size does not
8454 exceed limits imposed by XClientMessageEvent, as well as the usual
8455 ptrdiff_t and size_t limits.
8456
b13995db
PE
8457 * keyboard.c: Overflow, signedness and related fixes.
8458 (make_lispy_movement): Use same integer type in forward decl
8459 that is used in the definition.
8460 (read_key_sequence, keyremap_step):
8461 Change bufsize argument back to int, undoing my 2011-03-30 change.
8462 We prefer signed types, and int is wide enough here.
8463 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
8464 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
8465 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
8466 length, not size_t. Use ptrdiff_t for index, not int.
8467 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
8468 possibility of integer overflow.
8469
13464394
PE
8470 Overflow, signedness and related fixes for images.
8471
8472 * dispextern.h (struct it.stack[0].u.image.image_id)
8473 (struct_it.image_id, struct image.id, struct image_cache.size)
8474 (struct image_cache.used, struct image_cache.ref_count):
8475 * gtkutil.c (update_frame_tool_bar):
8476 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
8477 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
8478 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
8479 * nsmenu.m (update_frame_tool_bar):
8480 * xdisp.c (calc_pixel_width_or_height):
8481 * xfns.c (image_cache_refcount):
8482 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
8483 on typical 64-bit hosts.
8484
8485 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8486 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
8487 Omit unnecessary casts to int.
8488 (parse_image_spec): Check that integers fall into 'int' range
8489 when the callers expect that.
8490 (image_ascent): Redo ascent calculation to avoid int overflow.
8491 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
8492 (lookup_image): Remove unnecessary tests.
8493 (xbm_image_p): Locals are now of int, not EMACS_INT,
8494 since parse_image_check makes sure they fit into int.
8495 (png_load, gif_load, svg_load_image):
8496 Prefer int to unsigned where either will do.
8497 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
8498 old tiff_error_handler and tiff_warning_handler.
8499 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
8500 stack buffer overflows. It uses only the features of vsnprintf
8501 that are common to both POSIX and native Microsoft.
8502 (tiff_error_handler, tiff_warning_handler): Use it.
8503 (tiff_load, gif_load, imagemagick_load_image):
8504 Don't assume :index value fits in 'int'.
8505 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
8506 (imagemagick_load_image): Check that crop parameters fit into
8507 the integer types that MagickCropImage accepts. Don't assume
8508 Vimagemagick_render_type has a nonnegative value. Don't assume
8509 size_t fits in 'long'.
8510 (gs_load): Use printmax_t to print the widest integers possible.
8511 Check for integer overflow when computing image height and width.
8512
c11821d4
EZ
85132011-08-26 Eli Zaretskii <eliz@gnu.org>
8514
8515 * xdisp.c (redisplay_window): Don't force window start if point
8516 will be invisible in the resulting window. (Bug#9324)
8517
0c95fcf7
EZ
85182011-08-25 Eli Zaretskii <eliz@gnu.org>
8519
8520 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
8521 the display spec is of the form `(space ...)'.
8522 (handle_display_spec): Return the value returned by
8523 handle_single_display_spec, not just 1 or zero.
8524 (handle_single_display_spec): If the display spec is of the form
8525 `(space ...)', and specifies display in the text area, return 2
8526 rather than 1.
fee65a97 8527 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
8528 accurately, and prefer exact match for point under bidi.
8529 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
8530
8531 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
8532 into disp_prop; all users changed.
8533
8534 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
8535 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
8536 for the text covered by the display property.
8537
e4ed06f1
CY
85382011-08-25 Chong Yidong <cyd@stupidchicken.com>
8539
8540 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
8541 Change return value to nil.
8542 (Frecord_buffer): Delete unused function.
8543
f67cdd7f
EZ
85442011-08-24 Eli Zaretskii <eliz@gnu.org>
8545
5980d4c6
EZ
8546 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
8547 buffers, return left-to-right.
8610fe8b
EZ
8548 (set_cursor_from_row): Consider candidate row a win if its glyph
8549 represents a newline and point is on that newline. Fixes cursor
8550 positioning on the newline at EOL of R2L text within L2R
8551 paragraph, and vice versa.
8552 (try_cursor_movement): Check continued rows, in addition to
8553 continuation rows. Fixes unwarranted scroll when point enters a
8554 continued line of R2L text within an L2R paragraph, or vice versa.
8555 (cursor_row_p): Consider the case of point being equal to
8556 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
8557 from the end of a short line to the beginning of a continued line
8558 of R2L text within L2R paragraph.
8559 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
8560 composed characters.
5980d4c6 8561
f67cdd7f
EZ
8562 * bidi.c (bidi_check_type): Use xassert.
8563 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
8564 members.
8565
bca633fb
EZ
85662011-08-23 Eli Zaretskii <eliz@gnu.org>
8567
8568 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
8569 a character.
8570
4a5885a7
CY
85712011-08-23 Chong Yidong <cyd@stupidchicken.com>
8572
8573 * nsfont.m (ns_otf_to_script): Fix typo.
8574
0902a04e
KH
85752011-08-22 Kenichi Handa <handa@m17n.org>
8576
8577 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
8578 extra slot even if the purpose is char-code-property-table.
8579
1a2e6670
EZ
85802011-08-23 Eli Zaretskii <eliz@gnu.org>
8581
8ddde651
EZ
8582 * xdisp.c (redisplay_window): When computing centering_position,
8583 account for the height of the header line. (Bug#8874)
8584
425cc014
EZ
8585 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
8586 instead of CHAR_TO_BYTE. Fixes a crash when a completion
8587 candidate is selected by the mouse, and that candidate has a
8588 composed character under the mouse.
8589
1a2e6670
EZ
8590 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
8591 coordinates reported by pos-visible-in-window-p for a composed
8592 character in column zero.
8593
8b76d6f8
SM
85942011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
8595
8596 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
8597
dac347dd
EZ
85982011-08-22 Eli Zaretskii <eliz@gnu.org>
8599
8600 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
8601 consider it a hit if to_charpos is anywhere in the range of the
8602 composed buffer positions.
8603
e013fb34
CY
86042011-08-22 Chong Yidong <cyd@stupidchicken.com>
8605
8606 * image.c (gif_load): Don't assume that each subimage has the same
8607 dimensions as the base image. Handle disposal method that is
8608 "undefined" by the gif spec (Bug#9335).
8609
bd1ba3e8
CY
86102011-08-20 Chong Yidong <cyd@stupidchicken.com>
8611
8612 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 8613 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 8614
54a1215b
EZ
86152011-08-19 Eli Zaretskii <eliz@gnu.org>
8616
823564e5
EZ
8617 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8618 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8619 from an Org mode buffer to a Speedbar frame.
8620
54a1215b
EZ
8621 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8622 a composition, take its buffer position from IT->cmp_it.charpos.
8623 Fixes cursor positioning at the beginning of a line that begins
8624 with a composed character.
8625
9778ebcc
EZ
86262011-08-18 Eli Zaretskii <eliz@gnu.org>
8627
0be6ee06
EZ
8628 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8629 character bidirectional type, use STRONG_L instead. Fixes crashes
8630 in a buffer produced by `describe-categories'.
8631
9778ebcc
EZ
8632 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8633 members before the level stack, so they would be saved and
8634 restored when copying iterator state. Fixes incorrect reordering
8635 around TABs covered by display properties.
8636
156bffbe
AS
86372011-08-18 Andreas Schwab <schwab@linux-m68k.org>
8638
6b02f655 8639 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 8640
72ad093b
CY
86412011-08-17 Chong Yidong <cyd@stupidchicken.com>
8642
8643 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
8644 (internal_condition_case_2, internal_condition_case_n):
8645 Remove unnecessary aborts (Bug#9081).
72ad093b 8646
35774242
EZ
86472011-08-17 Eli Zaretskii <eliz@gnu.org>
8648
8649 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8650 has no `load' handler, try opening the file locally. (Bug#9311)
8651
db76dd85
KB
86522011-08-16 Ken Brown <kbrown@cornell.edu>
8653
8654 * gmalloc.c: Expand comment.
8655
b215eee5
EZ
86562011-08-16 Eli Zaretskii <eliz@gnu.org>
8657
8658 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8659 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
8660
a4579d33
KB
86612011-08-16 Ken Brown <kbrown@cornell.edu>
8662
8663 Fix memory allocation problems in Cygwin build (Bug#9273).
8664
8665 * unexcw.c ( __malloc_initialized): Declare external variable.
8666 (fixup_executable): Force the dumped emacs to reinitialize malloc.
8667
8b76d6f8
SM
8668 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8669 New variables.
a4579d33
KB
8670 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8671 dumped emacs.
8672 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8673 in the static heap.
8674 [CYGWIN] (special_realloc): New function.
8675 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8676 requests to realloc storage in the static heap.
8677
3ebec551
PE
86782011-08-15 Paul Eggert <eggert@cs.ucla.edu>
8679
8680 * bidi.c (bidi_initialize): Remove unused local.
8681
9fd8be00
EZ
86822011-08-15 Eli Zaretskii <eliz@gnu.org>
8683
6b02f655
SM
8684 * bidimirror.h:
8685 * biditype.h: Remove file.
8686 * makefile.w32-in ($(BLD)/bidi.$(O)):
8687 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
8688
8689 * dispextern.h: Fix a typo in the comment to bidi_type_t.
8690
8691 * chartab.c: Improve commentary for the uniprop_table API.
8692
32413314
EZ
8693 * bidi.c (bidi_paragraph_init): Support zero value of
8694 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
8695 (bidi_initialize): Use uniprop_table instead of including
8696 biditype.h and bidimirror.h.
32413314 8697
9fd8be00
EZ
8698 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8699 coordinates of the iterator when restoring from ppos_it.
8700 (Bug#9296)
8701
5cf2b69b
KH
87022011-08-14 Kenichi Handa <handa@m17n.org>
8703
8704 * process.c (create_process): Call setup_process_coding_systems
72ad093b 8705 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 8706
daf17d00
EZ
87072011-08-14 Eli Zaretskii <eliz@gnu.org>
8708
8709 * xdisp.c (move_it_in_display_line_to): Don't invoke
8710 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8711 ppos_it. Fixes vertical cursor motion when line beginning is
8712 covered by an image. (Bug#9296)
8713
08e3161a
JD
87142011-08-14 Jan Djärv <jan.h.d@swipnet.se>
8715
8716 * nsterm.h (ns_run_ascript): Declare.
8717 (NSAPP_DATA2_RUNASSCRIPT): Define.
8718
8719 * nsfns.m (as_script, as_result, as_status): New static variables.
8720 (ns_run_ascript): New function.
5e617bc2 8721 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
8722 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8723 the event loop. Get status from as_status (Bug#7276).
8724
8725 * nsterm.m (sendEvent): If event is NSApplicationDefined and
8726 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8727 the event loop (Bug#7276).
8728
a3720aa2
AS
87292011-08-14 Andreas Schwab <schwab@linux-m68k.org>
8730
8731 * gnutls.c (QCgnutls_bootprop_priority)
8732 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8733 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8734 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8735 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8736 (QCgnutls_bootprop_verify_hostname_error)
8737 (QCgnutls_bootprop_callbacks_verify): Rename from
8738 Qgnutls_bootprop_..., all uses changed.
8739
8740 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8741 uses changed.
8742
0a0d27fb
PE
87432011-08-14 Paul Eggert <eggert@cs.ucla.edu>
8744
19d5c50c
PE
8745 * xfaces.c (Qframe_set_background_mode): Now static.
8746 * dispextern.h (Qframe_set_background_mode): Remove decl.
8747
0a0d27fb
PE
8748 * process.c (Fnetwork_interface_info): Declare local only if needed.
8749
377538cb
JD
87502011-08-13 Jan Djärv <jan.h.d@swipnet.se>
8751
8752 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8753 (Fnetwork_interface_list): Allocate in increments of bytes instead
8754 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
8755 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
8756 sockaddr.
8757 (struct ifflag_def): notrailers is smart on OSX.
8758 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
8759 Get hardware address with getifaddrs if available.
8760
08fff70c
EZ
87612011-08-12 Eli Zaretskii <eliz@gnu.org>
8762
8763 * xdisp.c (iterate_out_of_display_property): xassert that
8764 IT->position is set to within IT->object's boundaries. Break from
8765 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
8766 when IT->position is set up wrongly due to some bug.
8767 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
8768 (push_display_prop): Allow GET_FROM_STRING as IT->method on
8769 entry. Force push_it to save on the stack the current
8770 buffer/string position, to be restored by pop_it. Fix flags in
8771 the iterator structure wrt the object coming from a display
8772 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
8773 properties. (Bug#9284)
8774
7be1c708 87752011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 8776
7be1c708
CY
8777 * fontset.c (fontset_get_font_group): Add proper type checks.
8778 (Bug#9172)
aac0c6e3 8779
7be1c708 87802011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 8781
7be1c708
CY
8782 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8783 and LC_VERSION_MIN_MACOSX.
8784 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8785 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 8786
97bb72a6
EZ
87872011-08-08 Eli Zaretskii <eliz@gnu.org>
8788
8789 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
8790 no-display-properties-and-no-overlays under bidi display.
8791 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 8792 properties and overlays.
97bb72a6 8793
d5617611
CY
87942011-08-08 Chong Yidong <cyd@stupidchicken.com>
8795
37e11a63
CY
8796 * editfns.c (Fset_time_zone_rule): Document relationship with the
8797 setenv function.
8798
d5617611
CY
8799 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8800 the font entity extracted from the cache (Bug#8109).
8801
58872834
CY
88022011-08-07 Chong Yidong <cyd@stupidchicken.com>
8803
8804 * composite.c (autocmp_chars): Don't reset point. That is done by
8805 restore_point_unwind (Bug#5984).
8806
75bfc667
JL
88072011-08-07 Juri Linkov <juri@jurta.org>
8808
8809 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8810 to show the arg `TIME' instead of `TIMEVAL'.
8811
d1410150
EZ
88122011-08-06 Eli Zaretskii <eliz@gnu.org>
8813
8814 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8815 display property strides EOL and includes a newline, as in
8816 longlines-mode. (Bug#9254)
75b771e4
EZ
8817 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8818 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
8819
8820 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8821 is non-zero, even if the data buffer is NULL. Fixes a crash in
8822 vertical-motion with longlines-mode. (Bug#9254)
8823
35928349
EZ
88242011-08-05 Eli Zaretskii <eliz@gnu.org>
8825
ec7cc85b
EZ
8826 * bidi.c <bidi_cache_total_alloc>: Now static.
8827 (bidi_initialize): Initialize bidi_cache_total_alloc.
8828
8b76d6f8 8829 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
8830 cache. (Bug#9221)
8831
8832 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8833 amount allocated this far in `bidi_cache_total_alloc'.
8834 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8835 non-zero, only free the data buffer without restoring the cache
8836 contents. All callers changed.
8837
8838 * dispextern.h (bidi_unshelve_cache): Update prototype.
8839
8840 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8841 (move_it_in_display_line, move_it_to)
8842 (move_it_vertically_backward, move_it_by_lines): Replace the call
8843 to xfree to an equivalent call to bidi_unshelve_cache.
8844 (move_it_in_display_line_to): Fix logic of returning
412b6358 8845 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 8846
e2e2423b
EZ
88472011-08-05 Eli Zaretskii <eliz@gnu.org>
8848
8849 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8850 came from a string character with a `cursor' property. (Bug#9229)
8851
ae9e757a
JD
88522011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8853
8854 * Makefile.in (LIB_PTHREAD): New variable.
8855 (LIBES): Add LIB_PTHREAD (Bug#9216).
8856
8857 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8858 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8859
213bd7f2
AS
88602011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8861
6b02f655 8862 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 8863
99aaf75f
JD
88642011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8865
8866 * xterm.c (x_find_topmost_parent): New function.
8867 (x_set_frame_alpha): Find topmost parent window with
8868 x_find_topmost_parent and set the property there also (bug#9181).
8869 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8870
c74e9d86
PE
88712011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8872
8873 * callproc.c (Fcall_process): Avoid vfork clobbering
8874 the local vars buffer, coding_systems, current_dir.
8875
640c8776
SM
88762011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8877
8878 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8879
f26d0e4c
PE
88802011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8881
8a10d76c
PE
8882 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8883 so that it is not optimized away.
8884
f26d0e4c
PE
8885 * xdisp.c (compute_display_string_pos): Remove unused local.
8886
55439c61
EZ
88872011-08-02 Eli Zaretskii <eliz@gnu.org>
8888
8889 Fix slow cursor motion and scrolling in large buffers with
8890 selective display, like Org Mode buffers. (Bug#9218)
8891
8892 * dispextern.h (struct bidi_it): New member disp_prop_p.
8893
8894 * xdisp.c: Remove one-slot cache of display string positions.
8895 (compute_display_string_pos): Accept an additional argument
5e617bc2 8896 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
8897 for a display string or property. If found, set DISP_PROP_P
8898 non-zero.
8899
8900 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
8901 DISP_PROP_P, and pass it to compute_display_string_pos.
8902 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
8903 non-zero. All callers of bidi_fetch_char changed.
8904
fb33fa43
SM
89052011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8906
8907 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8908
b099e063
DM
89092010-12-03 Don March <don@ohspite.net>
8910
8911 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8912 last character M-[char] is translated to ESC [char] (bug#7541).
8913
5cc7f7af
KH
89142011-08-02 Kenichi Handa <handa@m17n.org>
8915
d0fffa3f 8916 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
8917
8918 * chartab.c (uniprop_table): Make it non-static.
8919
525d5e6e
EZ
89202011-08-01 Eli Zaretskii <eliz@gnu.org>
8921
8922 * xdisp.c (forward_to_next_line_start): Accept additional argument
8923 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8924 on the newline.
8925 (reseat_at_next_visible_line_start): Use the bidi iterator state
8926 returned by forward_to_next_line_start to restore the state of
8927 it->bidi_it after backing up to previous newline. (Bug#9212)
8928
31011111
AS
89292011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8930
8931 * regex.c (re_comp): Protoize.
8932 (re_exec): Fix return type.
8933 (regexec): Fix type of `ret'. (Bug#9203)
8934
476371c4
PE
89352011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8936
e5d76069
PE
8937 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8938 This is needed if max-image-size is a floating-point number.
8939
9a79b20c
AS
89402011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8941
8942 * print.c (print_object): Print empty symbol as ##.
8943
8944 * lread.c (read1): Read ## as empty symbol.
8945
d8c2fa78
AA
89462011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8947
8948 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8949 setting frame foreground color (Bug#9175).
8950 (x_set_background_color): Likewise.
8951
ffe57a7a
AA
8952 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8953 contents (Bug#9176).
8954 (EmacsTooltip -init): Remove bezels and add shadows to
8955 tooltip windows.
8956
bf3492a5
AA
8957 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8958 or scroll bar (Bug#8470).
8959
d55e9c53
AA
8960 * nsfont.m (nsfont_open): Remove assignment to voffset and
8961 unnecessary vars hshink, expand, hd, full_height, min_height.
8962 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8963
8964 * nsterm.h (nsfont_info): Remove voffset field.
8965
d8c2fa78 89662011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
8967
8968 Implement strike-through and overline on NextStep (Bug#8863).
8969
8970 * nsfont.m (nsfont_open): Use underline position provided by font,
8971 instead of hard-coded value of 2.
8972 (nsfont_draw): Call ns_draw_text_decoration instead.
8973
8974 * nsterm.h: Add declaration for ns_draw_text_decoration.
8975
8976 * nsterm.m (ns_draw_text_decoration): New function for drawing
8977 underline, overline, and strike-through.
8978 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8979 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 8980 accommodate underlining, etc.
4843aac3 8981
4cc60b9b
EZ
89822011-07-28 Eli Zaretskii <eliz@gnu.org>
8983
bc7ece87
EZ
8984 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8985 default.
4cc60b9b 8986
476371c4
PE
89872011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8988
66606eea
PE
8989 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8990 Without this fix, if a signal arrives just after memory fills up,
8991 'malloc' might be invoked reentrantly.
8992
476371c4
PE
8993 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8994 In other words, assume that every image size is allowed, on non-X
8995 hosts. This assumption is probably wrong, but it lets Emacs compile.
8996
f3fcc40d
AS
89972011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8998
8999 * regex.c (re_iswctype): Convert return values to boolean.
9000
350c992f
EZ
90012011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
9002
9003 * xdisp.c (compute_display_string_pos): Don't use cached display
9004 string position if the buffer had its restriction changed.
9005 (Bug#9184)
9006
5266b4bb
PE
90072011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9008
9009 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9010
2573a837 90112011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 9012
41f55ccd 9013 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 9014
39e378da
PE
9015 * bidi.c: Integer size and overflow fixes.
9016 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9017 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9018 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9019 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9020 (bidi_find_other_level_edge):
9021 Use ptrdiff_t instead of EMACS_INT where either will do.
9022 This works better on 32-bit hosts configured --with-wide-int.
9023 (bidi_cache_ensure_space): Check for size-calculation overflow.
9024 Use % rather than repeated addition, for better worst-case speed.
9025 Don't set bidi_cache_size until after xrealloc returns, because it
9026 might not return.
9027 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
9028 (bidi_cache_ensure_space): Also check that the bidi cache size
9029 does not exceed that of the largest Lisp string or buffer. See Eli
9030 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 9031
5e927815
PE
9032 * alloc.c (__malloc_size_t): Remove.
9033 All uses replaced by size_t. See Andreas Schwab's note
9034 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9035
ca4aa935
PE
9036 * image.c: Improve checking for integer overflow.
9037 (check_image_size): Assume that f is nonnull, since
9038 it is always nonnull in practice. This is one less thing to
9039 worry about when checking for integer overflow later.
9040 (x_check_image_size): New function, which checks for integer
9041 overflow issues inside X.
9042 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9043 This removes the need for a memory_full check.
9044 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9045 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
9046 (xbm_read_bitmap_data): Change locals back to 'int', since
9047 their values must fit in 'int'.
9048 (xpm_load_image, png_load, tiff_load):
9049 Invoke x_create_x_image_and_pixmap earlier,
9050 to avoid much needless work if the image is too large.
9051 (tiff_load): Treat overly large images as if
9052 x_create_x_image_and_pixmap failed, not as malloc failures.
9053 (gs_load): Use x_check_image_size.
9054
5f8f9cc2
PE
9055 * gtkutil.c: Omit integer casts.
9056 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
9057 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
9058
5adf60bc
PE
9059 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
9060
c8907a93
PE
9061 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
9062 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
9063 would wrongly return t on a 64-bit host.
9064
e3c25c68
PE
9065 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
9066 The plain *_OVERFLOW macros run afoul of GCC bug 49705
9067 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
9068 and therefore cause GCC to emit a bogus diagnostic in some cases.
9069
3f791afe
PE
9070 * image.c: Integer signedness and overflow and related fixes.
9071 This is not an exhaustive set of fixes, but it's time to
9072 record what I've got.
9073 (lookup_pixel_color, check_image_size): Remove redundant decls.
9074 (check_image_size): Don't assume that arbitrary EMACS_INT values
9075 fit in 'int', or that arbitrary 'double' values fit in 'int'.
9076 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
9077 (tiff_load, imagemagick_load_image):
9078 Check for overflow in size calculations.
9079 (x_create_x_image_and_pixmap): Remove unnecessary test for
9080 xmalloc returning NULL; that can't happen.
9081 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
9082 (xpm_color_bucket): Use better integer hashing function.
9083 (xpm_cache_color): Don't possibly over-allocate memory.
9084 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
9085 (gif_memory_source):
9086 Use ptrdiff_t, not int or size_t, to record sizes.
9087 (png_load): Don't assume values greater than 2**31 fit in 'int'.
9088 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
9089 either works, as we prefer signed integers.
9090 (tiff_read_from_memory, tiff_write_from_memory):
9091 Return tsize_t, not size_t, since that's what the TIFF API wants.
9092 (tiff_read_from_memory): Don't fail simply because the read would
9093 go past EOF; instead, return a short read.
9094 (tiff_load): Omit no-longer-needed casts.
9095 (Fimagemagick_types): Don't assume size fits into 'int'.
9096
3cc5a532
PE
9097 Improve hashing quality when configured --with-wide-int.
9098 * fns.c (hash_string): New function, taken from sxhash_string.
9099 Do not discard information about ASCII character case; this
9100 discarding is no longer needed.
9101 (sxhash-string): Use it. Change sig to match it. Caller changed.
9102 * lisp.h: Declare it.
9103 * lread.c (hash_string): Remove, since we now use fns.c's version.
9104 The fns.c version returns a wider integer if --with-wide-int is
9105 specified, so this should help the quality of the hashing a bit.
9106
b312a492
PE
9107 * emacs.c: Integer overflow minor fix.
9108 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
9109 Define only if GNU_LINUX.
9110 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
9111
dfd153ae
PE
9112 * dispnew.c: Integer signedness and overflow fixes.
9113 Remove unnecessary forward decls, that were a maintenance hassle.
9114 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
9115 All uses changed.
9116 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
9117 (scrolling_window): Use ptrdiff_t, not int, for byte count.
9118 (prepare_desired_row, line_draw_cost):
9119 Use int, not unsigned, where either works.
9120 (save_current_matrix, restore_current_matrix):
9121 Use ptrdiff_t, not size_t, where either works.
9122 (init_display): Check for overflow more accurately, and without
9123 relying on undefined behavior.
9124
a81d11a3
PE
9125 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
9126 Remove, replacing with the new symbols in lisp.h. All uses changed.
9127 * fileio.c (make_temp_name):
9128 * filelock.c (lock_file_1, lock_file):
9129 * xdisp.c (message_dolog):
9130 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
9131 Use pMd etc. instead.
9132 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
9133 replacing the pWIDE etc. symbols removed from editfns.c.
9134
3300e6fd
PE
9135 * keyboard.h (num_input_events): Now uintmax_t.
9136 This is (very slightly) less likely to mess up due to wraparound.
9137 All uses changed.
9138
fd05c7e9
PE
9139 * buffer.c: Integer signedness fixes.
9140 (alloc_buffer_text, enlarge_buffer_text):
9141 Use ptrdiff_t rather than size_t when either will do, as we prefer
9142 signed integers.
9143
903fe15d
PE
9144 * alloc.c: Integer signedness and overflow fixes.
9145 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
9146 (__malloc_size_t): Default to size_t, not to int.
9147 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
9148 (Fgarbage_collect, mark_object_loop_halt, mark_object):
9149 Prefer ptrdiff_t to size_t when either would do, as we prefer
9150 signed integers.
9151 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
9152 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
9153 Now const. Initialize with values that are in range even if char
9154 is signed.
9155 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
9156 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
9157 These functions do the right thing with sizes > 2**32.
9158 (check_depth): Now ptrdiff_t, not int.
9159 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
9160 Adjust to new way of storing sizes. Check for size overflow bugs
9161 in rest of code.
9162 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
9163 slightly wrong anyway, as it missed one instance of
9164 XMALLOC_OVERRUN_CHECK_OVERHEAD.
9165 (refill_memory_reserve): Omit needless cast to size_t.
9166 (mark_object_loop_halt): Mark as externally visible.
9167
ac82cc6a
PE
9168 * xselect.c: Integer signedness and overflow fixes.
9169 (Fx_register_dnd_atom, x_handle_dnd_message):
9170 Use ptrdiff_t, not size_t, since we prefer signed.
9171 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
9172 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
9173 x_dnd_atoms_size and x_dnd_atoms_length.
9174
c2d1e36d
PE
9175 * doprnt.c: Prefer signed to unsigned when either works.
9176 * eval.c (verror):
9177 * doprnt.c (doprnt):
9178 * lisp.h (doprnt):
9179 * xdisp.c (vmessage):
9180 Use ptrdiff_t, not size_t, when using or implementing doprnt,
9181 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
9182 prefer signed arithmetic to avoid comparison confusion.
9183 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
9184 but is a bit tricky.
9185
0e926e56
PE
9186 Assume freestanding C89 headers, string.h, stdlib.h.
9187 * data.c, doprnt.c, floatfns.c, print.c:
9188 Include float.h unconditionally.
9189 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
9190 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
9191 * regex.c: Likewise for stddef.h, string.h.
9192 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
9193 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
9194 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
9195 (STDC_HEADERS): Remove obsolete defines.
9196 * sysdep.c: Include limits.h unconditionally.
9197
9cfdb3ec
PE
9198 Assume support for memcmp, memcpy, memmove, memset.
9199 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
9200 * regex.c (memcmp, memcpy):
9201 Remove; we assume C89 now.
9202
9203 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
9204 (__malloc_safe_bcopy): Remove; no longer needed.
9205
cf950e6b 9206 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
9207 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
9208 well either way, and we prefer signed to unsigned.
9209
dbf38e02
LMI
92102011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
9211
9212 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
9213 closes the connection while we're reading (bug#9182).
9214
d6f0886c 92152011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 9216
d6f0886c
JD
9217 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
9218 are specified (Bug#9168).
24e0f6b1 9219
2eb1f9e6
PE
92202011-07-25 Paul Eggert <eggert@cs.ucla.edu>
9221
9222 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
9223 Found by GCC static checking and --with-wide-int on a 32-bit host.
9224
22381272 92252011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
9226
9227 * xdisp.c (compute_display_string_pos): Fix logic of caching
9228 previous display string position. Initialize cached_prev_pos to
9229 -1. Fixes slow-down at the beginning of a buffer.
9230
f25e39b4
EZ
92312011-07-24 Eli Zaretskii <eliz@gnu.org>
9232
9233 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
9234 for attrs[LFACE_FONTSET_INDEX].
9235
04c4b52e
PE
92362011-07-23 Paul Eggert <eggert@cs.ucla.edu>
9237
9238 * xml.c (parse_region): Remove unused local
9239 that was recently introduced.
9240
c1734fbd
EZ
92412011-07-23 Eli Zaretskii <eliz@gnu.org>
9242
be18c5a5
EZ
9243 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
9244 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
9245
c1734fbd
EZ
9246 * xdisp.c (move_it_in_display_line_to): Record the best matching
9247 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
9248 exit if none of the characters scanned was an exact match.
9249 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
9250 when exact match is impossible due to invisible text, and the
9251 lines are truncated.
9252
a258d627
JD
92532011-07-23 Jan Djärv <jan.h.d@swipnet.se>
9254
9255 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
9256 for OSX >= 10.7.
9257
b6d5a689
EZ
92582011-07-22 Eli Zaretskii <eliz@gnu.org>
9259
0f74f785
EZ
9260 Fix a significant slow-down of cursor motion with C-n, C-p,
9261 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
9262 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 9263 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
9264 (next_element_from_buffer): Call compute_stop_pos_backwards to
9265 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
9266 base_level_stop.
9267 (reseat): Don't look for prev_stop, as that could mean a very long
9268 run.
9269 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
9270 <cached_disp_overlay_modiff>: Cache for last found display string
9271 position.
551918c1 9272 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
9273 about the same buffer in the same area of character positions, and
9274 the buffer wasn't changed since the time the display string
9275 position was cached.
551918c1 9276
b2d0c91a
EZ
92772011-07-22 Eli Zaretskii <eliz@gnu.org>
9278
9279 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
9280 is an integer, which is important for empty lines. (Bug#9149)
9281
043604ee
CY
92822011-07-22 Chong Yidong <cyd@stupidchicken.com>
9283
9284 * frame.c (Fmodify_frame_parameters): In tty case, update the
9285 default face if necessary (Bug#4238).
9286
da4adb04
CY
92872011-07-21 Chong Yidong <cyd@stupidchicken.com>
9288
9289 * editfns.c (Fstring_to_char): No need to explain what a character
9290 is in the docstring (Bug#6576).
9291
9abd0532
LMI
92922011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9293
9294 * xml.c (parse_region): Make sure we always return a tree.
9295
36881d16
HK
92962011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
9297
9298 * xml.c (parse_region): If a document contains only comments,
9299 return that, too.
9300
1e98674d
LMI
93012011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9302
9303 * xml.c (make_dom): Return comments, too.
9304
590bd467
PE
93052011-07-19 Paul Eggert <eggert@cs.ucla.edu>
9306
9307 Port to OpenBSD.
9308 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
9309 and the surrounding thread.
9310 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
9311 rather than fgets, and retry after EINTR. Otherwise, 'emacs
9312 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
9313 timer goes off.
9314 * s/openbsd.h (BROKEN_SIGIO): Define.
9315 * unexelf.c (unexec) [__OpenBSD__]:
9316 Don't update the .mdebug section of the Alpha COFF symbol table.
9317
f41628b2
LMI
93182011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9319
9320 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
9321 (bug#8460).
9322
b59b67c5
PE
93232011-07-18 Paul Eggert <eggert@cs.ucla.edu>
9324
15e3a074
PE
9325 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
9326 This fixes some race conditions on the permissions of any newly
9327 created file.
9328
41bed37d
PE
9329 * alloc.c (valid_pointer_p): Use pipe, not open.
9330 This fixes some permissions issues when debugging.
9331
b59b67c5
PE
9332 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
9333 If fchown fails to set both uid and gid, try to set just gid,
9334 as that is sometimes allowed. Adjust the file's mode to eliminate
9335 setuid or setgid bits that are inappropriate if fchown fails.
9336
925a6be7
SM
93372011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9338
9339 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
9340 to compare Lisp_Objects.
9341 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
9342 global_gnutls_log_level, don't mistake it for a Lisp_Object.
9343 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9344
52968808
AS
93452011-07-17 Andreas Schwab <schwab@linux-m68k.org>
9346
0a6a104b
AS
9347 * lread.c (read_integer): Unread even EOF character.
9348 (read1): Likewise. Properly record start position of symbol.
9349
52968808
AS
9350 * lread.c (read1): Read `#:' as empty uninterned symbol if no
9351 symbol character follows.
9352
9e381cdd
PE
93532011-07-17 Paul Eggert <eggert@cs.ucla.edu>
9354
9355 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
9356 This works around a problem with the previous change to Fcopy_file.
9357 Recent glibc declares fchown with __attribute__((warn_unused_result)),
9358 and without this change, GCC might complain about discarding
9359 fchown's return value.
9360
b5641435
JB
93612011-07-16 Juanma Barranquero <lekktu@gmail.com>
9362
9363 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
9364
a8031457
PE
93652011-07-16 Paul Eggert <eggert@cs.ucla.edu>
9366
9367 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
9368
dd889327
LMI
93692011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
9370
750c33f7
LMI
9371 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
9372 it's used from the C level.
9373
dd889327
LMI
9374 * process.c: Use the same condition for POLL_FOR_INPUT in both
9375 keyboard.c and process.c (bug#1858).
9376
87e86684
LM
93772011-07-09 Lawrence Mitchell <wence@gmx.li>
9378
9379 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
9380 (Fgnutls_boot): Use it.
9381
64348f40
AS
93822011-07-15 Andreas Schwab <schwab@linux-m68k.org>
9383
9384 * doc.c (Fsubstitute_command_keys): Revert last change.
9385
1d698799
LMI
93862011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
9387
f863868c
LMI
9388 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
9389 quotes the next character, and doesn't affect other longer
9390 sequences (bug#8935).
9391
1d698799
LMI
9392 * lread.c (syms_of_lread): Clarify that is isn't only
9393 `eval-buffer' and `eval-defun' that's affected by
9394 `lexical-binding' (bug#8460).
9395
aa4b6df6
EZ
93962011-07-15 Eli Zaretskii <eliz@gnu.org>
9397
9398 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 9399 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 9400
5d856da6
PE
94012011-07-14 Paul Eggert <eggert@cs.ucla.edu>
9402
ad6042bb
PE
9403 Fix minor problems found by static checking.
9404 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
9405 (elsz): Now a signed constant, not a size_t var. We prefer signed
9406 types to unsigned, to avoid integer comparison confusion. Without
9407 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
9408 "cannot optimize loop, the loop counter may overflow", a symptom
9409 of the confusion.
f00bbb22 9410 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
9411 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
9412
6468f31c
LMI
94132011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9414
49080b10
LMI
9415 * search.c (Fre_search_backward): Mention `case-fold-search' in
9416 all the re_search_* functions (bug#8138).
9417
6468f31c
LMI
9418 * keyboard.c (Fopen_dribble_file): Document when the file is
9419 closed (bug#8056).
9420
c965adc5
EZ
94212011-07-14 Eli Zaretskii <eliz@gnu.org>
9422
df9733bf
EZ
9423 * bidi.c (bidi_dump_cached_states): Fix format of displaying
9424 bidi_cache_idx.
9425
0bb23927
EZ
9426 Support bidi reordering of display and overlay strings.
9427 * xdisp.c (compute_display_string_pos)
9428 (compute_display_string_end): Accept additional argument STRING.
9429 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
9430 (reseat_to_string): Initialize bidi_it->string.s and
9431 bidi_it->string.schars.
9432 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
9433 NULL (avoids a crash in bidi_paragraph_init).
9434 Initialize itb.string.lstring.
0bb23927
EZ
9435 (init_iterator): Call bidi_init_it only of a valid
9436 buffer position was specified. Initialize paragraph_embedding to
9437 L2R.
9438 (reseat_to_string): Initialize the bidi iterator.
9439 (display_string): If we need to ignore text properties of
9440 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
9441 original value of -1 will not work with bidi.)
9442 (compute_display_string_pos): First arg is now struct
9443 `text_pos *'; all callers changed. Support display properties on
9444 Lisp strings.
9445 (compute_display_string_end): Support display properties on Lisp
9446 strings.
9447 (init_iterator, reseat_1, reseat_to_string): Initialize the
9448 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
9449 when iterating on a string not from display properties).
640c8776
SM
9450 (compute_display_string_pos, compute_display_string_end):
9451 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
9452 arrow keys.
9453 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
9454 base_level_stop; instead, set base_level_stop to BEGV.
9455 Fixes crashes in vertical-motion.
0bb23927
EZ
9456 (next_element_from_buffer): Improve commentary for when
9457 the iterator is before prev_stop.
9458 (init_iterator): Initialize bidi_p from the default value of
9459 bidi-display-reordering, not from buffer-local value. Use the
9460 buffer-local value only if initializing for buffer iteration.
9461 (handle_invisible_prop): Support invisible properties on strings
9462 that are being bidi-reordered.
9463 (set_iterator_to_next): Support bidi reordering of C strings and
9464 Lisp strings.
9465 (next_element_from_string): Support bidi reordering of Lisp
9466 strings.
9467 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
9468 (display_string): Support display of R2L glyph rows.
9469 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
9470 (init_iterator): Don't initialize it->bidi_p for strings
9471 here.
9472 (reseat_to_string): Initialize it->bidi_p for strings here.
9473 (next_element_from_string, next_element_from_c_string)
9474 (next_element_from_buffer): Add xassert's for correspondence
9475 between IT's object being iterated and it->bidi_it.string
9476 structure.
9477 (face_before_or_after_it_pos): Support bidi iteration.
9478 (next_element_from_c_string): Handle the case of the first string
9479 character that is not the first one in the visual order.
9480 (get_visually_first_element): New function, refactored from common
9481 parts of next_element_from_buffer, next_element_from_string, and
9482 next_element_from_c_string.
9483 (tool_bar_lines_needed, redisplay_tool_bar)
9484 (display_menu_bar): Force left-to-right direction. Add a FIXME
9485 comment for making that be controlled by a user option.
9486 (push_it, pop_it): Save and restore the state of the
9487 bidi iterator. Save and restore the bidi_p flag.
9488 (pop_it): Iterate out of display property for string iteration as
9489 well.
9490 (iterate_out_of_display_property): Support iteration over strings.
9491 (handle_single_display_spec): Set up it->bidi_it for iteration
9492 over a display string, and call bidi_init_it.
9493 (handle_single_display_spec, next_overlay_string)
9494 (get_overlay_strings_1, push_display_prop): Set up the bidi
9495 iterator for displaying display or overlay strings.
9496 (forward_to_next_line_start): Don't use the shortcut if
9497 bidi-iterating.
9498 (back_to_previous_visible_line_start): If handle_display_prop
9499 pushed the iterator stack, restore the internal state of the bidi
9500 iterator by calling bidi_pop_it same number of times.
9501 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
9502 and we are bidi-iterating, don't decrement the iterator position;
9503 instead, set the first_elt flag in the bidi iterator, to produce
9504 the same effect.
9505 (reseat_1): Remove redundant setting of string_from_display_prop_p.
9506 (push_display_prop): xassert that we are iterating a buffer.
9507 (push_it, pop_it): Save and restore paragraph_embedding member.
9508 (handle_single_display_spec, next_overlay_string)
9509 (get_overlay_strings_1, reseat_1, reseat_to_string)
9510 (push_display_prop): Set up the `unibyte' member of bidi_it.string
9511 correctly. Don't assume unibyte strings are not bidi-reordered.
9512 (compute_display_string_pos)
9513 (compute_display_string_end): Fix handling the case of C string.
9514 (push_it, pop_it): Save and restore from_disp_prop_p.
9515 (handle_single_display_spec, push_display_prop): Set the
9516 from_disp_prop_p flag.
9517 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
9518 (pop_it): Call iterate_out_of_display_property only if we are
9519 popping after iteration over a string that came from a display
9520 property. Fix a typo in popping stretch info. Add an assertion
9521 for verifying that the iterator position is in sync with the bidi
9522 iterator.
9523 (handle_single_display_spec, get_overlay_strings_1)
9524 (push_display_prop): Fix initialization of paragraph direction for
9525 string when that of the parent object is not yet determined.
9526 (reseat_1): Call bidi_init_it to resync the bidi
9527 iterator with IT's position. (Bug#7616)
9528 (find_row_edges): If ROW->start.pos gives position
9529 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
9530 (handle_stop, back_to_previous_visible_line_start, reseat_1):
9531 Reset the from_disp_prop_p flag.
9532 (SAVE_IT, RESTORE_IT): New macros.
9533 (pos_visible_p, face_before_or_after_it_pos)
9534 (back_to_previous_visible_line_start)
9535 (move_it_in_display_line_to, move_it_in_display_line)
9536 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9537 (try_scrolling, redisplay_window, display_line): Use them when
9538 saving a temporary copy of the iterator and restoring it back.
9539 (back_to_previous_visible_line_start, reseat_1)
9540 (init_iterator): Empty the bidi cache "stack".
9541 (move_it_in_display_line_to): If iterator ended up at
9542 EOL, but we never saw any buffer positions smaller than
9543 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
9544 motion in bidi-reordered lines.
9545 (move_it_in_display_line_to): Record prev_method and prev_pos
9546 immediately before the call to set_iterator_to_next. Fixes cursor
9547 motion in bidi-reordered lines with stretch glyphs and strings
9548 displayed in margins. (Bug#8133) (Bug#8867)
9549 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
9550 TO_CHARPOS.
640c8776
SM
9551 (pos_visible_p): Support positions in bidi-reordered lines.
9552 Save and restore bidi cache.
0bb23927
EZ
9553
9554 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
9555 (bidi_paragraph_info): Delete unused struct.
9556 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
9557 (bidi_cache_start): New variable.
9558 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
9559 to zero.
9560 (bidi_cache_fetch_state, bidi_cache_search)
9561 (bidi_cache_find_level_change, bidi_cache_iterator_state)
9562 (bidi_cache_find, bidi_peek_at_next_level)
9563 (bidi_level_of_next_char, bidi_find_other_level_edge)
9564 (bidi_move_to_visually_next): Compare cache index with
9565 bidi_cache_start rather than with zero.
9566 (bidi_fetch_char): Accept new argument STRING; all callers
9567 changed. Support iteration over a string. Support strings with
9568 display properties. Support unibyte strings. Fix the type of
9569 `len' according to what STRING_CHAR_AND_LENGTH expects.
9570 (bidi_paragraph_init, bidi_resolve_explicit_1)
9571 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
9572 (bidi_level_of_next_char, bidi_move_to_visually_next):
9573 Support iteration over a string.
0bb23927
EZ
9574 (bidi_set_sor_type, bidi_resolve_explicit_1)
9575 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
9576 can now be zero (for strings); special values 0 and -1 were
9577 changed to -1 and -2, respectively.
9578 (bidi_char_at_pos): New function.
9579 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
9580 Call it instead of FETCH_MULTIBYTE_CHAR.
9581 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
9582 initialized to valid values.
9583 (bidi_init_it): Don't initialize charpos and bytepos with invalid
9584 values.
9585 (bidi_level_of_next_char): Allow the sentinel "position" to pass
9586 the test for valid cached positions. Fix the logic for looking up
9587 the sentinel state in the cache. GCPRO the Lisp string we are
9588 iterating.
9589 (bidi_push_it, bidi_pop_it): New functions.
9590 (bidi_initialize): Initialize the bidi cache start stack pointer.
9591 (bidi_cache_ensure_space): New function, refactored from part of
9592 bidi_cache_iterator_state. Don't assume the required size is just
9593 one BIDI_CACHE_CHUNK away.
9594 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
9595 (bidi_count_bytes, bidi_char_at_pos): New functions.
9596 (bidi_cache_search): Don't assume bidi_cache_last_idx is
9597 always valid if bidi_cache_idx is valid.
9598 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
9599 is valid if it's going to be used.
9600 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
9601 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
9602 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9603 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
9604 (bidi_find_other_level_edge, bidi_cache_start_stack):
9605 All variables related to cache indices are now EMACS_INT.
c965adc5 9606
0bb23927
EZ
9607 * dispextern.h (struct bidi_string_data): New structure.
9608 (struct bidi_it): New member `string'. Make flag members be 1-bit
9609 fields, and put them last in the struct.
640c8776
SM
9610 (compute_display_string_pos, compute_display_string_end):
9611 Update prototypes.
0bb23927
EZ
9612 (bidi_push_it, bidi_pop_it): Add prototypes.
9613 (struct iterator_stack_entry): New members bidi_p,
9614 paragraph_embedding, and from_disp_prop_p.
9615 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
9616 (bidi_shelve_cache, bidi_unshelve_cache):
9617 Declare prototypes.
0bb23927
EZ
9618
9619 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9620 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9621 and vector-like objects.
9622
9623 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9624 cache around display iteration.
9625
9626 * window.c (Fwindow_end, window_scroll_pixel_based)
9627 (displayed_window_lines, Frecenter): Save and restore the bidi
9628 cache around display iteration.
9629
3bbd2265
LMI
96302011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9631
9632 * editfns.c (Fdelete_region): Clarify the use of the named
9633 parameters (bug#6788).
9634
adc47434
MR
96352011-07-14 Martin Rudalics <rudalics@gmx.at>
9636
9637 * indent.c (Fvertical_motion): Set and restore w->pointm when
9638 saving and restoring the window's buffer (Bug#9006).
9639
837c31f8
LMI
96402011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
9641
9642 * editfns.c (Fstring_to_char): Clarify just what is returned
9643 (bug#6576). Text by Eli Zaretskii.
9644
ac389d0c
JB
96452011-07-13 Juanma Barranquero <lekktu@gmail.com>
9646
9647 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9648
0be0ce47
EZ
96492011-07-13 Eli Zaretskii <eliz@gnu.org>
9650
9651 * buffer.c (mmap_find): Fix a typo.
9652
cd18e7e3
JB
96532011-07-13 Johan Bockgård <bojohan@gnu.org>
9654
9655 Fix execution of x selection hooks.
9656 * xselect.c (Qx_lost_selection_functions)
9657 (Qx_sent_selection_functions): New vars.
9658 (syms_of_xselect): DEFSYM them.
9659 (x_handle_selection_request): Pass Qx_sent_selection_functions
9660 rather than Vx_sent_selection_functions to Frun_hook_with_args.
9661 (x_handle_selection_clear,x_clear_frame_selections):
9662 Pass Qx_lost_selection_functions rather than
9663 Vx_lost_selection_functions to Frun_hook_with_args.
9664
47ea7f44
PE
96652011-07-13 Paul Eggert <eggert@cs.ucla.edu>
9666
ac389d0c 9667 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
9668 The old code sometimes used this field without initializing it.
9669
47ea7f44
PE
9670 * alloc.c (gc_sweep): Don't read past end of array.
9671 In theory, the old code could also have corrupted Emacs internals,
9672 though it'd be very unlikely.
9673
bc985c87
AS
96742011-07-12 Andreas Schwab <schwab@linux-m68k.org>
9675
9676 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 9677 argument. (Bug#4026)
bc985c87 9678
0cf34688
LMI
96792011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
9680
b3dadd76
LMI
9681 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9682 key" (bug#4257).
9683
0cf34688
LMI
9684 * window.c (Fset_window_start): Doc fix (bug#4199).
9685 (Fset_window_hscroll): Ditto.
9686
270768cd
PE
96872011-07-12 Paul Eggert <eggert@cs.ucla.edu>
9688
077e3dda 9689 Fix minor new problems caught by GCC 4.6.1.
270768cd 9690 * term.c (init_tty): Remove unused local.
490011a6 9691 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 9692 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 9693 not used otherwise.
270768cd 9694
b1f58454
CY
96952011-07-12 Chong Yidong <cyd@stupidchicken.com>
9696
9697 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9698
22b9578d
LMI
96992011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9700
6e70ab07
LMI
9701 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9702 are the mini-buffer and the echo area (bug#3320).
9703
22b9578d
LMI
9704 * term.c (init_tty): Remove support for supdup, c10 and perq
9705 terminals, which are no longer supported (bug#1482).
9706
8974cc9f
JB
97072011-07-10 Johan Bockgård <bojohan@gnu.org>
9708
9709 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9710
a560d974
JD
97112011-07-10 Jan Djärv <jan.h.d@swipnet.se>
9712
9713 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9714 for non-popups (Bug#3642).
9715
1dae0f0a
AS
97162011-07-10 Andreas Schwab <schwab@linux-m68k.org>
9717
268c2c36 9718 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 9719 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
9720 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9721 * cm.c (losecursor): Likewise.
1dae0f0a
AS
9722 * data.c (fmod): Likewise.
9723 * dispnew.c (swap_glyphs_in_rows): Likewise.
9724 * emacs.c (memory_warning_signal): Likewise.
9725 * floatfns.c (float_error): Likewise.
9726 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9727 (otf_open, font_otf_capability, generate_otf_features)
9728 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9729 Likewise.
9730 * image.c (pbm_read_file): Likewise.
9731 * indent.c (string_display_width): Likewise.
9732 * intervals.c (check_for_interval, search_for_interval)
9733 (inc_interval_count, count_intervals, root_interval)
9734 (adjust_intervals_for_insertion, make_new_interval): Likewise.
9735 * lread.c (defalias): Likewise.
268c2c36 9736 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
9737 * regex.c (set_image_of_range_1, set_image_of_range)
9738 (regex_grow_registers): Likewise.
9739 * sysdep.c (strerror): Likewise.
9740 * termcap.c (valid_filename_p, tprint, main): Likewise.
9741 * tparam.c (main): Likewise.
9742 * unexhp9k800.c (run_time_remap, save_data_space)
9743 (update_file_ptrs, read_header, write_header, calculate_checksum)
9744 (copy_file, copy_rest, display_header): Likewise.
9745 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9746 Likewise.
9747 * xdisp.c (check_it): Likewise.
9748 * xfaces.c (register_color, unregister_color, unregister_colors):
9749 Likewise.
9750 * xfns.c (print_fontset_result): Likewise.
9751 * xrdb.c (member, fatal, main): Likewise.
9752
99033785
PE
97532011-07-10 Paul Eggert <eggert@cs.ucla.edu>
9754
9755 Fix minor problems found by static checking (Bug#9031).
9756 * chartab.c (char_table_set_range, map_sub_char_table):
9757 Remove unused locals.
9758 (uniprop_table): Now static.
9759 * composite.c (_work_char): Remove unused static var.
9760
9cb2ac56
JB
97612011-07-09 Juanma Barranquero <lekktu@gmail.com>
9762
9763 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
9764
f25661f0
JD
97652011-07-09 Jan Djärv <jan.h.d@swipnet.se>
9766
9767 * gtkutil.c (qttip_cb): Remove code without function.
9768
8278c4fe
EZ
97692011-07-09 Eli Zaretskii <eliz@gnu.org>
9770
9771 * w32.c (pthread_sigmask): New stub.
9772
1692ae2d 97732011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 9774
8a6ebd58 9775 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
9776 sigprocmask is portable only for single-threaded applications, and
9777 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
9778 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
9779 (LIBES): Use it.
9780 * callproc.c (Fcall_process):
9781 * process.c (create_process):
9782 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9783 Use pthread_sigmask, not sigprocmask.
123403e4 9784
1b854618
JD
97852011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9786
9787 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9788 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9789 wrong (Bug#8591).
9790
3fe4b549
JD
97912011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9792
0ce7e563
JD
9793 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9794 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9795 (xg_hide_tooltip): Fix comment.
9796
3fe4b549
JD
9797 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9798 in registerServicesMenuSendTypes.
9799 (validRequestorForSendType): Don't check ns_return_types.
9800
9801 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9802 ns_return_type.
9803
5df75e47
JR
98042011-07-08 Jason Rumney <jasonr@gnu.org>
9805
22610910
JR
9806 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9807 SH_SHOW for hidden windows (Bug#5482).
9808
5df75e47
JR
9809 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9810 frame struct members of non-existent frames (Bug#6284).
9811
699c10bd
JD
98122011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9813
4393663b
JD
9814 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9815 variable firstTime not needed on OSX >= 10.6.
9816 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9817 >= 10.5. Use setKnobProportion, setDoubleValue.
9818
9819 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9820 (MAC_OS_X_VERSION_10_5): Define if not defined.
9821 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9822 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9823 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9824
9825 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 9826 cString and lossyCString on OSX >= 10.4.
4393663b 9827
58179cce 9828 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
9829 sizeToFit on OSX >= 10.2.
9830
9831 * nsimage.m (allocInitFromFile): Don't use deprecated method
9832 bestRepresentationForDevice on OSX >= 10.6.
9833
9834 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9835 to avoid warning.
9836
9837 * emacs.c: Declare unexec_init_emacs_zone.
9838
a63e0781
JD
9839 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9840
699c10bd
JD
9841 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9842
9843 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9844 on svcsMenu (Bug#8842).
9845
9846 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9847 ns_return_types.
9848 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9849
9850 * nsterm.m (QUTF8_STRING): Declare.
9851 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9852 (validRequestorForSendType): Return type is (id).
9853 Change indexOfObjectIdenticalTo to indexOfObject.
9854 Check if we have local selection before returning self (Bug#8842).
9855 (writeSelectionToPasteboard): Put local selection into paste board
9856 if we have a local selection (Bug#8842).
9857 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9858
9859 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9860 (ns_get_local_selection): Declare.
9861
54e10184
LMI
98622011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9863
9888ff71
LMI
9864 * keymap.c (describe_map_tree): Don't insert a double newline at
9865 the end of the buffer (bug#1169) and return whether we inserted
9866 something.
9867
54e10184
LMI
9868 * callint.c (Fcall_interactively): Change "reading args" to
9869 "providing args" to try to clarify what it does (bug#1010).
9870
15fa4783
KH
98712011-07-07 Kenichi Handa <handa@m17n.org>
9872
9873 * composite.c (composition_compute_stop_pos): Ignore a static
9874 composition starting before CHARPOS (Bug#8915).
9875
9876 * xdisp.c (handle_composition_prop): Likewise.
9877
a8815b00
EZ
98782011-07-07 Eli Zaretskii <eliz@gnu.org>
9879
9880 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9881 (Bug#9015)
9882
ef7b981d 98832011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
9884
9885 * character.h (unicode_category_t): New enum type.
9886
9887 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9888 (Qchar_code_property_table): New variable.
9889 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9890 (UNIPROP_COMPRESSED_FORM_P): New macros.
9891 (char_table_ascii): Uncompress the compressed values.
9892 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9893 Uncompress the compressed values.
ac389d0c 9894 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
9895 (char_table_ref_and_range): Uncompress the compressed values.
9896 (sub_char_table_set): New arg is_uniprop. Callers changed.
9897 Uncompress the compressed values.
9898 (sub_char_table_set_range): Args changed. Callers changed.
9899 (char_table_set_range): Adjuted for the above change.
9900 (map_sub_char_table): Delete args default_val and parent. Add arg
9901 top. Give decoded values to a Lisp function.
640c8776 9902 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
9903 values to a Lisp function. Gcpro more variables.
9904 (uniprop_table_uncompress)
9905 (uniprop_decode_value_run_length): New functions.
9906 (uniprop_decoder, uniprop_decoder_count): New variables.
9907 (uniprop_get_decoder, uniprop_encode_value_character)
9908 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9909 New functions.
9910 (uniprop_encoder, uniprop_encoder_count): New variables.
9911 (uniprop_get_encoder, uniprop_table)
9912 (Funicode_property_table_internal, Fget_unicode_property_internal)
9913 (Fput_unicode_property_internal): New functions.
9914 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9915 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 9916 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
9917 char-code-property-alist.
9918
640c8776 9919 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
9920 Vunicode_category_table.
9921
640c8776 9922 * font.c (font_range): Adjust for the change of
c805dec0
KH
9923 Vunicode_category_table.
9924
76b397fb
DN
99252011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9926
9927 * m/iris4d.h: Remove file, move contents ...
9928 * s/irix6-5.h: ... here.
9929
22b4128e
PE
99302011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9931
9932 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
9933 * alloc.c (mark_buffer):
9934 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9935 (clone_per_buffer_values): Don't assume that
22b4128e
PE
9936 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9937 This isn't true in general, and it's particularly not true
9938 if Emacs is configured with --with-wide-int.
9939 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9940 New macros, used in the buffer.c change.
9941
869795d6
JD
99422011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9943
9944 * xsettings.c: Use both GConf and GSettings if both are available.
9945 (store_config_changed_event): Add comment.
9946 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9947 (store_tool_bar_style_changed): New functions.
5e617bc2 9948 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
9949 (struct xsettings): Move font inside HAVE_XFT.
9950 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 9951 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 9952 Move inside HAVE_XFT.
640c8776 9953 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
9954 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9955 also.
9956 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 9957 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 9958 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
9959 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9960 (parse_settings): Move check for font inside HAVE_XFT.
9961 (read_settings, apply_xft_settings): Add comment.
9962 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9963 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9964 call store_font_name_changed.
9965 (xft_settings_event): Add comment.
9966 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9967 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9968 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9969 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9970 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
9971 (xsettings_get_system_font, xsettings_get_system_normal_font):
9972 Add comment.
869795d6 9973
d8ed26bd
PE
99742011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9975
9976 Random fixes. E.g., (random) never returned negative values.
9977 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9978 subseconds part to the entropy, as that's a bit more random.
9979 Prefer signed to unsigned, since the signedness doesn't matter and
9980 in general we prefer signed. When given a limit, use a
9981 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9982 latter isn't right if USE_2_TAGS_FOR_INTS.
9983 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9984 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9985
cabf1cac
SM
99862011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9987
9988 * textprop.c (text_property_stickiness):
9989 Obey Vtext_property_default_nonsticky.
9990 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9991 * w32fns.c (syms_of_w32fns):
9992 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9993
6e9b2be9
PE
99942011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9995
9996 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9997 This is more efficient than Ffile_directory_p and avoids a minor race.
9998
90186c68
LMI
99992011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
10000
7c301272
LMI
10001 * buffer.c (Foverlay_put): Say what the return value is
10002 (bug#7835).
10003
c4f2d8d4
LMI
10004 * fileio.c (barf_or_query_if_file_exists): Check first if the file
10005 is a directory before asking whether to use the file name
10006 (bug#7564).
ad637907
LMI
10007 (barf_or_query_if_file_exists): Make the "File is a directory"
10008 error be more correct.
c4f2d8d4 10009
90186c68
LMI
10010 * fns.c (Frequire): Remove the mention of the .gz files, since
10011 that's installation-specific, but keep the mention of
10012 `get-load-suffixes'.
10013
da64016e
PE
100142011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10015
10016 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10017 Report string overflow if the output is too long.
10018
7d47b580
JB
100192011-07-04 Juanma Barranquero <lekktu@gmail.com>
10020
a555cb87
JB
10021 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10022 (syms_of_gnutls): Remove duplicate DEFSYM for
10023 Qgnutls_bootprop_verify_hostname_error, an error for
10024 Qgnutls_bootprop_verify_error (which is no longer used).
10025
7d47b580
JB
10026 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10027 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
10028 Also (re)move comments that are misplaced or no longer relevant.
10029
1e49bfab
LMI
100302011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10031
10032 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10033
1485f4c0
CY
100342011-07-03 Chong Yidong <cyd@stupidchicken.com>
10035
10036 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10037 and background color parameters if they have been changed.
10038
a9ab721e
LMI
100392011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10040
10041 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10042
cf7cff57
PE
100432011-07-03 Paul Eggert <eggert@cs.ucla.edu>
10044
2e13213d
PE
10045 * xsettings.c (SYSTEM_FONT): Define only when used.
10046 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
10047
cf7cff57
PE
10048 * keymap.c (access_keymap_1): Now static.
10049
7a8e04f7
CY
100502011-07-02 Chong Yidong <cyd@stupidchicken.com>
10051
10052 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
10053 leave any prefix arg for the up event (Bug#1586).
10054
61352f62
LMI
100552011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
10056
69bb1ef7
LMI
10057 * lread.c (syms_of_lread): Mention single symbols defined by
10058 `defvar' or `defconst' (bug#7154).
10059
61352f62 10060 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 10061 (Frequire): Mention get-load-suffixes.
61352f62 10062
28545e04
MR
100632011-07-02 Martin Rudalics <rudalics@gmx.at>
10064
10065 * window.h (window): Remove clone_number slot.
10066 * window.c (Fwindow_clone_number, Fset_window_clone_number):
10067 Remove.
10068 (make_parent_window, make_window, saved_window)
10069 (Fset_window_configuration, save_window_save): Don't deal with
10070 clone numbers.
10071 * buffer.c (Qclone_number): Remove declaration.
10072 (sort_overlays, overlay_strings): Don't deal with clone numbers.
10073
3349e122
SM
100742011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
10075
10076 Add multiple inheritance to keymaps.
10077 * keymap.c (Fmake_composed_keymap): New function.
10078 (Fset_keymap_parent): Simplify.
10079 (fix_submap_inheritance): Remove.
10080 (access_keymap_1): New function extracted from access_keymap to handle
10081 embedded parents and handle lists of maps.
10082 (access_keymap): Use it.
10083 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
10084 (Fcopy_keymap): Handle embedded parents.
10085 (Fcommand_remapping, define_as_prefix): Simplify.
10086 (Fkey_binding): Simplify.
10087 (syms_of_keymap): Move minibuffer-local-completion-map,
10088 minibuffer-local-filename-completion-map,
10089 minibuffer-local-must-match-map, and
10090 minibuffer-local-filename-must-match-map to Elisp.
10091 (syms_of_keymap): Defsubr make-composed-keymap.
10092 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
10093 (parse_menu_item): Trivial simplification.
10094
3279eb87
GM
100952011-07-01 Glenn Morris <rgm@gnu.org>
10096
10097 * Makefile.in (SETTINGS_LIBS): Fix typo.
10098
39cb9e56 100992011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
10100
10101 * coding.c (Fencode_coding_string): Record the last coding system
10102 used, as the function doc string says (bug#8738).
10103
0949d2b6
JD
101042011-07-01 Jan Djärv <jan.h.d@swipnet.se>
10105
10106 * xsettings.c (store_monospaced_changed): Take new font as arg and
10107 check for change against current_mono_font.
10108 (EMACS_TYPE_SETTINGS): Remove this and related defines.
10109 (emacs_settings_constructor, emacs_settings_get_property)
10110 (emacs_settings_set_property, emacs_settings_class_init)
10111 (emacs_settings_init, gsettings_obj): Remove.
10112 (something_changedCB): New function for HAVE_GSETTINGS.
10113 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
10114 with value as argument.
10115 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
10116 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 10117 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
10118 "changed".
10119
10120 * xgselect.c: Add defined (HAVE_GSETTINGS).
10121 (xgselect_initialize): Ditto.
10122
10123 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
10124 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
10125 xg_select.
10126
bbc6b304
PE
101272011-07-01 Paul Eggert <eggert@cs.ucla.edu>
10128
10129 * eval.c (struct backtrace): Simplify and port the data structure.
10130 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
10131 signed bit field, as this assumption is not portable and it makes
10132 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
10133 "char debug_on_exit : 1" as this is not portable either; instead,
10134 use the portable "unsigned int debug_on_exit : 1". Remove unused
10135 member evalargs. Remove obsolete comments about cc bombing out.
10136
9851bfc5
JD
101372011-06-30 Jan Djärv <jan.h.d@swipnet.se>
10138
51bb811f 10139 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
10140 Let HAVE_GSETTINGS override HAVE_GCONF.
10141 (store_monospaced_changed): New function.
10142 (EMACS_SETTINGS): A new type derived from GObject to handle
10143 GSettings notifications.
10144 (emacs_settings_constructor, emacs_settings_get_property)
10145 (emacs_settings_set_property, emacs_settings_class_init):
10146 New functions.
10147 (gsettings_client, gsettings_obj): New variables.
10148 (GSETTINGS_SCHEMA): New define.
10149 (something_changedCB): Call store_monospaced_changed.
10150 (init_gsettings): New function.
10151 (xsettings_initialize): Call init_gsettings.
10152 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
10153 to NULL.
10154
640c8776 10155 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
10156 GCONF_CFLAGS/LIBS.
10157
5386012d
MR
101582011-06-29 Martin Rudalics <rudalics@gmx.at>
10159
10160 * window.c (resize_root_window, grow_mini_window)
10161 (shrink_mini_window): Rename Qresize_root_window to
10162 Qwindow_resize_root_window and Qresize_root_window_vertically to
10163 Qwindow_resize_root_window_vertically.
10164
f13e0b08
PE
101652011-06-28 Paul Eggert <eggert@cs.ucla.edu>
10166
10167 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
10168
94515237
JB
101692011-06-27 Juanma Barranquero <lekktu@gmail.com>
10170
10171 * makefile.w32-in: Redesign dependencies so they reflect more
10172 clearly which files are directly included by each source file,
10173 and not through other includes.
10174
e43b6e43
MR
101752011-06-27 Martin Rudalics <rudalics@gmx.at>
10176
10177 * buffer.c (Qclone_number): Declare static and DEFSYM it.
10178 (sort_overlays, overlay_strings): When an overlay's clone number
10179 matches the window's clone number process the overlay even if
10180 the overlay's window property doesn't match the current window.
10181
d68443dc
MR
10182 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
10183 (Fwindow_hchild): Rename to Fwindow_left_child.
10184 (Fwindow_next): Rename to Fwindow_next_sibling.
10185 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
10186 (resize_window_check): Rename to window_resize_check.
10187 (resize_window_apply): Rename to window_resize_apply.
10188 (Fresize_window_apply): Rename to Fwindow_resize_apply.
10189 (Fdelete_other_windows_internal, resize_frame_windows)
10190 (Fsplit_window_internal, Fdelete_window_internal)
10191 (grow_mini_window, shrink_mini_window)
10192 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 10193
c7e73be5
JD
101942011-06-26 Jan Djärv <jan.h.d@swipnet.se>
10195
10196 * emacsgtkfixed.h: State that this is only used with Gtk+3.
10197 (emacs_fixed_set_min_size): Remove.
10198 (emacs_fixed_new): Take frame as argument.
10199
10200 * emacsgtkfixed.c: State that this is only used with Gtk+3.
10201 (_EmacsFixedPrivate): Remove minwidth/height.
10202 Add struct frame *f.
10203 (emacs_fixed_init): Initialize priv->f.
10204 (get_parent_class, emacs_fixed_set_min_size): Remove.
10205 (emacs_fixed_new): Set priv->f to argument.
10206 (emacs_fixed_get_preferred_width)
10207 (emacs_fixed_get_preferred_height): Use min_width/height from
10208 frames size_hint to set minimum and natural (Bug#8919).
10209 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
10210 and use min_width/height from frames size_hint to set
10211 min_width/height (Bug#8919).
10212
10213 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
10214 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
10215 Fix indentation.
c7e73be5 10216
cf99dcf8
EZ
102172011-06-26 Eli Zaretskii <eliz@gnu.org>
10218
10219 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
10220 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
10221 called at ZV.
10222
029529ac
CY
102232011-06-26 Chong Yidong <cyd@stupidchicken.com>
10224
10225 * process.c (wait_reading_process_output): Bypass select if
10226 waiting for a cell while ignoring keyboard input, and input is
10227 pending. Suggested by Jan Djärv (Bug#8869).
10228
7a7ef429
PE
102292011-06-25 Paul Eggert <eggert@cs.ucla.edu>
10230
10231 Use gnulib's dup2 module instead of rolling our own.
10232 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
10233
11fdef7d 102342011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
10235
10236 * dispnew.c (scrolling_window): Before scrolling, turn off a
10237 mouse-highlight in the window being scrolled.
10238
cd3520a4
JB
102392011-06-24 Juanma Barranquero <lekktu@gmail.com>
10240
10241 Move DEFSYM to lisp.h and use everywhere.
10242
10243 * character.h (DEFSYM): Move declaration...
10244 * lisp.h (DEFSYM): ...here.
10245
10246 * gnutls.c:
10247 * minibuf.c:
10248 * w32menu.c:
10249 * w32proc.c:
10250 * w32select.c: Don't include character.h.
10251
10252 * alloc.c (syms_of_alloc):
10253 * buffer.c (syms_of_buffer):
10254 * bytecode.c (syms_of_bytecode):
10255 * callint.c (syms_of_callint):
10256 * casefiddle.c (syms_of_casefiddle):
10257 * casetab.c (init_casetab_once):
10258 * category.c (init_category_once, syms_of_category):
10259 * ccl.c (syms_of_ccl):
10260 * cmds.c (syms_of_cmds):
10261 * composite.c (syms_of_composite):
10262 * dbusbind.c (syms_of_dbusbind):
10263 * dired.c (syms_of_dired):
10264 * dispnew.c (syms_of_display):
10265 * doc.c (syms_of_doc):
10266 * editfns.c (syms_of_editfns):
10267 * emacs.c (syms_of_emacs):
10268 * eval.c (syms_of_eval):
10269 * fileio.c (syms_of_fileio):
10270 * fns.c (syms_of_fns):
10271 * frame.c (syms_of_frame):
10272 * fringe.c (syms_of_fringe):
10273 * insdel.c (syms_of_insdel):
10274 * keymap.c (syms_of_keymap):
10275 * lread.c (init_obarray, syms_of_lread):
10276 * macros.c (syms_of_macros):
10277 * msdos.c (syms_of_msdos):
10278 * print.c (syms_of_print):
10279 * process.c (syms_of_process):
10280 * search.c (syms_of_search):
10281 * sound.c (syms_of_sound):
10282 * syntax.c (init_syntax_once, syms_of_syntax):
10283 * terminal.c (syms_of_terminal):
10284 * textprop.c (syms_of_textprop):
10285 * undo.c (syms_of_undo):
10286 * w32.c (globals_of_w32):
10287 * window.c (syms_of_window):
10288 * xdisp.c (syms_of_xdisp):
10289 * xfaces.c (syms_of_xfaces):
10290 * xfns.c (syms_of_xfns):
10291 * xmenu.c (syms_of_xmenu):
10292 * xsettings.c (syms_of_xsettings):
10293 * xterm.c (syms_of_xterm): Use DEFSYM.
10294
4228cf16
TZ
102952011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
10296
cd3520a4 10297 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 10298
7fcccf1e
PE
102992011-06-23 Paul Eggert <eggert@cs.ucla.edu>
10300
7efb4e0e
PE
10301 Integer and buffer overflow fixes (Bug#8873).
10302
ff5844ad
PE
10303 * print.c (printchar, strout): Check for string overflow.
10304 (PRINTPREPARE, printchar, strout):
10305 Don't set size unless allocation succeeds.
10306
90532f02
PE
10307 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
10308 for sizes. Check for string overflow more accurately.
10309 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
10310
6d84508d
PE
10311 * macros.c: Integer and buffer overflow fixes.
10312 * keyboard.h (struct keyboard.kbd_macro_bufsize):
10313 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
10314 Use ptrdiff_t, not int, for sizes.
10315 Don't increment bufsize until after realloc succeeds.
10316 Check for size-calculation overflow.
10317 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
10318
437b2cb4
PE
10319 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
10320
8b9ac8b4
PE
10321 * lread.c: Integer overflow fixes.
10322 (read_integer): Radix is now EMACS_INT, not int,
10323 to improve quality of diagnostics for out-of-range radices.
10324 Calculate buffer size correctly for out-of-range radices.
10325 (read1): Check for integer overflow in radices, and in
10326 read-circle numbers.
82cb60d3
PE
10327 (read_escape): Avoid int overflow.
10328 (Fload, openp, read_buffer_size, read1)
10329 (substitute_object_recurse, read_vector, read_list, map_obarray):
10330 Use ptrdiff_t, not int, for sizes.
10331 (read1): Use EMACS_INT, not int, for sizes.
20270765 10332 Check for size overflow.
8b9ac8b4 10333
7fcccf1e
PE
10334 * image.c (cache_image): Check for size arithmetic overflow.
10335
bfbbd7e7
PE
10336 * lread.c: Integer overflow issues.
10337 (saved_doc_string_size, saved_doc_string_length)
10338 (prev_saved_doc_string_size, prev_saved_doc_string_length):
10339 Now ptrdiff_t, not int.
10340 (read1): Don't assume doc string length fits in int. Check for
10341 out-of-range doc string lengths.
10342 (read_list): Don't assume file position fits in int.
39019e54 10343 (read_escape): Check for hex character overflow.
bfbbd7e7 10344
4e323265
LL
103452011-06-22 Leo Liu <sdl.web@gmail.com>
10346
10347 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
10348 Move to minibuffer.el.
10349
85fece3e
PE
103502011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10351
20b84ce9 10352 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
10353 The following patches are for when GLYPH_DEBUG && !XASSERT.
10354 * dispextern.h (trace_redisplay_p, dump_glyph_string):
10355 * dispnew.c (flush_stdout):
10356 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
10357 Mark as externally visible.
10358 * dispnew.c (check_window_matrix_pointers): Now static.
10359 * dispnew.c (window_to_frame_vpos):
10360 * xfns.c (unwind_create_frame):
10361 * xterm.c (x_check_font): Remove unused local.
10362 * scroll.c (CHECK_BOUNDS):
10363 * xfaces.c (cache_fache): Rename local to avoid shadowing.
10364 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
10365 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
10366 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
10367 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
10368 Now static.
10369 (debug_method_add): Use va_list and vsprintf rather than relying
10370 on undefined behavior with wrong number of arguments.
10371 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
10372 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
10373 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
10374 since we're not interested in debugging glyphs with old libraries.
10375 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
10376 GCC 4.6.0's static checking.
10377
0766b489
PE
103782011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10379
31fd4b32
PE
10380 Integer overflow and signedness fixes (Bug#8873).
10381 A few related buffer overrun fixes, too.
10382
b79e8648
PE
10383 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
10384
0766b489
PE
10385 * dispextern.h (struct face.stipple):
10386 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
10387 (x_bitmap_mask, x_allocate_bitmap_record)
10388 (x_create_bitmap_from_data, x_create_bitmap_from_file)
10389 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
10390 (x_create_bitmap_from_xpm_data):
10391 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
10392 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
10393 (.bitmaps_last):
10394 * xfaces.c (load_pixmap):
10395 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
10396 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
10397 (.bitmaps_last, struct x_output.icon_bitmap):
10398 Use ptrdiff_t, not int, for bitmap indexes.
10399 (x_allocate_bitmap_record): Check for size overflow.
10400 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
10401
b081724f
PE
10402 Use ptrdiff_t, not int, for overlay counts.
10403 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
10404 * editfns.c (overlays_around, get_pos_property):
10405 * textprop.c (get_char_property_and_overlay):
10406 * xdisp.c (next_overlay_change, note_mouse_highlight):
10407 * xfaces.c (face_at_buffer_position):
21514da7
PE
10408 * buffer.c (OVERLAY_COUNT_MAX): New macro.
10409 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
10410 (Fnext_overlay_change, Fprevious_overlay_change)
10411 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 10412 Use ptrdiff_t, not int, for sizes.
21514da7 10413 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 10414
3de73e5e
PE
10415 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
10416
2606c57b
PE
10417 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
10418 (x_session_initialize): Do not assume string length fits in int.
10419
aaafe47a
PE
10420 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
10421 This is unlikely, but can occur if DPI is outlandish.
10422
2674ddc8 10423 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
10424 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
10425
28154962
PE
10426 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
10427 * xrdb.c (magic_file_p, search_magic_path):
10428 Omit last arg SUFFIX; it was always 0. All callers changed.
10429 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
10430
7de51af5
PE
10431 * xfont.c (xfont_match): Avoid need for strlen.
10432
25ed6cc3
PE
10433 * xfns.c: Don't assume strlen fits in int.
10434 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
10435
4eab31dd
PE
10436 * xdisp.c (message_log_check_duplicate): Return intmax_t,
10437 not unsigned long, as we prefer signed integers. All callers changed.
10438 Detect integer overflow in repeat count.
10439 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 10440 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 10441
171e2a58
PE
10442 * termcap.c: Don't assume sizes fit in int and never overflow.
10443 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
10444 (gobble_line): Check for size-calculation overflow.
10445
ad39faca 10446 * minibuf.c (Fread_buffer):
6e5bb2dc 10447 * lread.c (intern, intern_c_string):
74ca2eb3
PE
10448 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
10449 Don't assume string length fits in int.
10450
52c61c22 10451 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
10452 * gtkutil.c (style_changed_cb): Avoid need for strlen.
10453
b5b8c9e5
PE
10454 * font.c: Don't assume string length fits in int.
10455 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
10456 Use ptrdiff_t, not int.
ccd6111c
PE
10457 (font_intern_prop): Don't assume string length fits in int.
10458 Don't assume integer property fits in fixnum.
10459 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 10460
882f0d81 10461 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 10462 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
10463 Reformulate so as not to need the command string.
10464 Invoke gzip -cd rather than gunzip, as it's more portable.
10465 (lock_info_type, lock_file_1, lock_file):
10466 Don't assume pid_t and time_t fit in unsigned long.
10467 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
10468 (current_lock_owner): Prefer signed type for sizes.
10469 Use memcpy, not strncpy, where memcpy is what is really wanted.
10470 Don't assume (via atoi) that time_t and pid_t fit in int.
10471 Check for time_t and/or pid_t out of range, e.g., via a network share.
10472 Don't alloca where an auto var works fine.
10473
93f4cf88
PE
10474 * fileio.c: Fix some integer overflow issues.
10475 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
10476 Don't assume string length fits in int.
10477 (directory_file_name): Don't assume string length fits in long.
10478 (make_temp_name): Don't assume pid fits in int, or that its print
10479 length is less than 20.
10480
f3e92b69
PE
10481 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
10482
1bfdaf10
PE
10483 * coding.c (make_subsidiaries): Don't assume string length fits in int.
10484
35016e9a
PE
10485 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
10486
3d1e65a1
PE
10487 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
10488 We prefer signed integers, even for size calculations.
10489
0b963a93
PE
10490 * emacs.c: Don't assume string length fits in 'int'.
10491 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
10492 (main): Don't invoke strlen when not needed.
10493
573f4b54
PE
10494 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
10495 (XD_DEBUG_MESSAGE): Don't waste a byte.
10496
989f33ba
PE
10497 * callproc.c (getenv_internal_1, getenv_internal)
10498 (Fgetenv_internal):
965d34eb
PE
10499 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
10500
e4d29b33
PE
10501 * lread.c (invalid_syntax): Omit length argument.
10502 All uses changed. This doesn't fix a bug, but it simplifies the
10503 code away from its former Hollerith-constant appearance, and it's
10504 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 10505 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 10506
eb49b136
PE
10507 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
10508 This didn't break anything, but it didn't help either.
10509 It's confusing to put a bogus integer in a place where the actual
10510 value does not matter.
9f62aeb1 10511 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 10512 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 10513
15375a22
PE
10514 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
10515 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
10516 implementation.
b61cc01c
PE
10517 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
10518 We prefer signed types, and the value cannot exceed the EMACS_INT
10519 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
10520 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
10521 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
10522 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 10523
53b2623d
PE
10524 * indent.c (sane_tab_width): New function.
10525 (current_column, scan_for_column, Findent_to, position_indentation)
10526 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 10527 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 10528
51cab52b 10529 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 10530
f2ed8a70
PE
10531 * lisp.h (lint_assume): New macro.
10532 * composite.c (composition_gstring_put_cache):
10533 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
10534
abe80cc6
PE
10535 * editfns.c, insdel.c:
10536 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 10537
b02c740e
PE
10538 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
10539
ebc96716
PE
10540 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
10541
b4e50fa0 10542 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 10543 Use much-faster test for byte-length change.
311d5d7c 10544 Don't assume string byte-length fits in 'int'.
a4cf38e4 10545 Check that character arg fits in 'int'.
85461888 10546 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 10547
c0c1ee9f
PE
10548 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
10549
a498d7f4
PE
10550 * fns.c (concat): Catch string overflow earlier.
10551 Do not rely on integer wraparound.
10552
51cab52b
PE
10553 * dispextern.h (struct it.overlay_strings_charpos)
10554 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
10555 * xdisp.c (forward_to_next_line_start)
10556 (back_to_previous_visible_line_start)
10557 (reseat_at_next_visible_line_start, next_element_from_buffer):
10558 Don't arbitrarily truncate the value of 'selective' to int.
10559
76031fad
PE
10560 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
10561
5eb55db9
PE
10562 * composite.c: Don't truncate sizes to 'int'.
10563 (composition_gstring_p, composition_reseat_it)
10564 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
10565 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
10566 not EMACS_UINT, for indexes.
5eb55db9 10567
0703a717
PE
10568 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
10569
d6202519
PE
10570 * buffer.c: Include <verify.h>.
10571 (struct sortvec.priority, struct sortstr.priority):
8961a454 10572 Now EMACS_INT, not int.
c20998a7 10573 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
10574 (struct sortstr.size, record_overlay_string)
10575 (struct sortstrlist.size, struct sortlist.used):
10576 Don't truncate size to int.
10577 (record_overlay_string): Check for size-calculation overflow.
d6202519 10578 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 10579
d5a19415
JM
105802011-06-22 Jim Meyering <meyering@redhat.com>
10581
029529ac 10582 Don't leak an XBM-image-sized buffer
d5a19415
JM
10583 * image.c (xbm_load): Free the image buffer after using it.
10584
a9041e6c
PE
105852011-06-21 Paul Eggert <eggert@cs.ucla.edu>
10586
10587 Port to Sun C.
10588 * composite.c (find_automatic_composition): Omit needless 'return 0;'
10589 that Sun C diagnosed.
10590 * fns.c (secure_hash): Fix pointer signedness issue.
10591 * intervals.c (static_offset_intervals): New function.
10592 (offset_intervals): Use it.
10593
7f3f739f
LL
105942011-06-21 Leo Liu <sdl.web@gmail.com>
10595
10596 * deps.mk (fns.o):
10597 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
10598 sha512.h.
10599
10600 * fns.c (secure_hash): Rename from crypto_hash_function and change
10601 the first arg to accept symbols.
5b66d427 10602 (Fsecure_hash): New primitive.
7f3f739f
LL
10603 (syms_of_fns): New symbols.
10604
76147d94
DD
106052011-06-20 Deniz Dogan <deniz@dogan.se>
10606
10607 * process.c (Fset_process_buffer): Clarify return value in
10608 docstring.
10609
7d7d0045
CY
106102011-06-18 Chong Yidong <cyd@stupidchicken.com>
10611
10612 * dispnew.c (add_window_display_history): Use BVAR.
10613
10614 * xdisp.c (debug_method_add): Use BVAR.
10615 (check_window_end, dump_glyph_matrix, dump_glyph)
10616 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10617
10618 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10619 Likewise.
10620
10621 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10622 check till after the cache is created in init_frame_faces.
10623
ff2bc410
SM
106242011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
10625
10626 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10627
28177add
PE
106282011-06-16 Paul Eggert <eggert@cs.ucla.edu>
10629
dd3482fe
PE
10630 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10631 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10632 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10633
393d71f3 10634 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
10635 * fileio.c (Finsert_file_contents):
10636 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10637 Remove the old (too-loose) buffer overflow checks.
10638 They weren't needed, since make_gap checks for buffer overflow.
10639 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10640 The old code merely checked for Emacs fixnum overflow, and relied
10641 on undefined (wraparound) behavior. The new code avoids undefined
10642 behavior, and also checks for ptrdiff_t and/or size_t overflow.
10643
2e6813b0 10644 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
10645 Tune. Don't use wider integers than needed. Don't use alloca.
10646 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 10647
599a9e4f
PE
10648 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10649
99561444
PE
10650 * insdel.c, lisp.h (buffer_overflow): New function.
10651 (insert_from_buffer_1, replace_range, replace_range_2):
10652 * insdel.c (make_gap_larger):
10653 * editfns.c (Finsert_char):
10654 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10655
28177add
PE
10656 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10657
e69dafad
PE
106582011-06-15 Paul Eggert <eggert@cs.ucla.edu>
10659
4baa020d 10660 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 10661
b1c46f02
PE
10662 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10663 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10664
e69dafad
PE
10665 * fileio.c: Don't assume EMACS_INT fits in off_t.
10666 (emacs_lseek): New static function.
10667 (Finsert_file_contents, Fwrite_region): Use it.
10668 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10669
566684ea
PE
10670 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10671
e6966cd6
PE
10672 * fns.c: Don't overflow int when computing a list length.
10673 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10674 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10675 truncation on 64-bit hosts. Check for QUIT every
10676 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10677 faster and is responsive enough.
10678 (Flength): Report an error instead of overflowing an integer.
10679 (Fsafe_length): Return a float if the value is not representable
10680 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 10681 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 10682 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 10683
dd0b0efb
PE
10684 * alloc.c: Check that resized vectors' lengths fit in fixnums.
10685 (header_size, word_size): New constants.
10686 (allocate_vectorlike): Don't check size overflow here.
10687 (allocate_vector): Check it here instead, since this is the only
10688 caller of allocate_vectorlike that could cause overflow.
10689 Check that the new vector's length is representable as a fixnum.
10690
86fe5cfe
PE
10691 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10692 The previous code was bogus. For example, next_almost_prime (32)
10693 returned 39, which is undesirable as it is a multiple of 3; and
10694 next_almost_prime (24) returned 25, which is a multiple of 5 so
10695 why was the code bothering to check for multiples of 7?
10696
80e88859
PE
10697 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10698
4a2f0ad6
PE
10699 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10700
f66c7cf8
PE
10701 Variadic C functions now count arguments with ptrdiff_t.
10702 This partly undoes my 2011-03-30 change, which replaced int with size_t.
10703 Back then I didn't know that the Emacs coding style prefers signed int.
10704 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
10705 were being counted with int, which may truncate counts on 64-bit
10706 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
10707 * lisp.h (struct Lisp_Subr.function.aMANY)
10708 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10709 Arg counts are now ptrdiff_t, not size_t.
10710 All variadic functions and their callers changed accordingly.
10711 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
10712 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10713 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
10714 * callint.c (Fcall_interactively): Check arg count for overflow,
10715 to avoid potential buffer overrun. Use signed char, not 'int',
10716 for 'varies' array, so that we needn't bother to check its size
10717 calculation for overflow.
10718 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10719 * eval.c (apply_lambda):
10720 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10721 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
10722 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10723
a1759b76
PE
10724 * callint.c (Fcall_interactively): Don't use index var as event count.
10725
d96be9fc
PE
10726 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10727 * mem-limits.h (SIZE): Remove; no longer used.
10728
a690a978 10729 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 10730
578c21e6
PE
10731 Remove unnecessary casts.
10732 * xterm.c (x_term_init):
10733 * xfns.c (x_set_border_pixel):
10734 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10735 These aren't needed now that we assume ANSI C.
10736
96f53c6c
PE
10737 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10738 It's more likely to cause problems (due to unsigned overflow)
10739 than to cure them.
10740
83c77d31
PE
10741 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10742
ee2079f1
PE
10743 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10744
6da65536
PE
10745 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10746
7147c4a4
PE
10747 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10748
193e32d9
PE
10749 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10750
e5533da6
PE
10751 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10752
9910e595
PE
10753 GLYPH_CODE_FACE returns EMACS_INT, not int.
10754 * dispextern.h (merge_faces):
10755 * xfaces.c (merge_faces):
01103c44
PE
10756 * xdisp.c (get_next_display_element, next_element_from_display_vector):
10757 Don't assume EMACS_INT fits in int.
9910e595 10758
2638320e
PE
10759 * character.h (CHAR_VALID_P): Remove unused parameter.
10760 * fontset.c, lisp.h, xdisp.c: All uses changed.
10761
045eb8d9
PE
10762 * editfns.c (Ftranslate_region_internal): Omit redundant test.
10763
c1f134b5
PE
10764 * fns.c (concat): Minor tuning based on overflow analysis.
10765 This doesn't fix any bugs. Use int to hold character, instead
10766 of constantly refetching from Emacs object. Use XFASTINT, not
10767 XINT, for value known to be a character. Don't bother comparing
10768 a single byte to 0400, as it's always less.
10769
395fcb93 10770 * floatfns.c (Fexpt):
327eeec8
PE
10771 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
10772
abbd3d23
PE
10773 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
10774 for characters.
10775
684a03ef
PE
10776 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
10777
0fed43f3
PE
10778 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
10779 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10780 incorrectly succeed when S was a string, because 4294967386 was
10781 truncated before it was used.
10782
8fd02eb7
PE
10783 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10784 Otherwise, an out-of-range integer could cause undefined behavior
10785 on a 64-bit host.
10786
f8c86b69
PE
10787 * composite.c: Use int, not EMACS_INT, for characters.
10788 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10789 EMACS_INT, for values that are known to be in character range.
10790 This doesn't fix any bugs but is the usual style inside Emacs and
10791 may generate better code on 32-bit machines.
10792
34206dd2
PE
10793 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10794 This is for reasons similar to the recent CHAR_STRING fix.
10795 * charset.c (Fencode_char): Check that character arg is actually
10796 a character. Pass an int to ENCODE_CHAR.
10797 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10798 wider than 'int', as a compile-time check to prevent future regressions
10799 in this area.
10800
c5958d4c 10801 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
10802
10803 Make sure a 64-bit char is never passed to CHAR_STRING.
10804 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10805 by silently ignoring the top 32 bits, allowing some values
10806 that were far too large to be valid characters.
10807 * character.h: Include <verify.h>.
10808 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10809 arguments are no wider than unsigned, as a compile-time check
10810 to prevent future regressions in this area.
10811 * data.c (Faset):
01103c44 10812 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
10813 (Fsubst_char_in_region):
10814 * fns.c (concat):
10815 * xdisp.c (decode_mode_spec_coding):
10816 Adjust to CHAR_STRING's new requirement.
10817 * editfns.c (Finsert_char, Fsubst_char_in_region):
10818 * fns.c (concat): Check that character args are actually
10819 characters. Without this test, these functions did the wrong
10820 thing with wildly out-of-range values on 64-bit hosts.
10821
d37ca623
PE
10822 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10823 These casts should not be needed on 32-bit hosts, either.
10824 * keyboard.c (read_char):
10825 * lread.c (Fload): Remove casts to unsigned.
10826
ea204efb
PE
10827 * lisp.h (UNSIGNED_CMP): New macro.
10828 This fixes comparison bugs on 64-bit hosts.
10829 (ASCII_CHAR_P): Use it.
10830 * casefiddle.c (casify_object):
01103c44 10831 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
10832 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10833 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10834 * dispextern.h (FACE_FROM_ID):
10835 * keyboard.c (read_char): Use UNSIGNED_CMP.
10836
41cb286c
PE
10837 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10838 not to EMACS_INT, to avoid GCC warning.
10839
4a1b9832
PE
10840 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10841
55daad71
PE
10842 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10843 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10844 isn't needed on 32-bit machines.
8f95c75c 10845
01103c44
PE
10846 * buffer.c (Fgenerate_new_buffer_name):
10847 Use EMACS_INT for count, not int.
0ceccced 10848 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
10849
10850 * data.c (Qcompiled_function): Now static.
10851
c6f072e7
PE
10852 * window.c (window_body_lines): Now static.
10853
20ce5912
PE
10854 * image.c (gif_load): Rename local to avoid shadowing.
10855
9c4c5f81
PE
10856 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10857 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10858 * alloc.c (make_save_value): Integer argument is now of type
10859 ptrdiff_t, not int.
10860 (mark_object): Use ptrdiff_t, not int.
10861 * lisp.h (pD): New macro.
10862 * print.c (print_object): Use it.
10863
c0c5c8ae
PE
10864 * alloc.c: Use EMACS_INT, not int, to count objects.
10865 (total_conses, total_markers, total_symbols, total_vector_size)
10866 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
10867 (total_free_floats, total_floats, total_free_intervals)
10868 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
10869 Now EMACS_INT, not int. All uses changed.
10870 (Fgarbage_collect): Compute overall total using a double, so that
10871 integer overflow is less likely to be a problem. Check for overflow
10872 when converting back to an integer.
5a25e253
PE
10873 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10874 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10875 These were 'int' variables that could overflow on 64-bit hosts;
10876 they were never used, so remove them instead of repairing them.
211a0b2a 10877 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
10878 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10879 Previously, this ceilinged at INT_MAX, but that doesn't work on
10880 64-bit machines.
e46bb31a 10881 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 10882
c78baabf 10883 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 10884 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
10885 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10886 when a (possibly-narrower) signed value would do just as well.
10887 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 10888
c9d624c6
PE
10889 * alloc.c: Catch some string size overflows that we were missing.
10890 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10891 for convenience in STRING_BYTES_MAX.
10892 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10893 The definition here is exact; the one in lisp.h was approximate.
10894 (allocate_string_data): Check for string overflow. This catches
10895 some instances we weren't catching before. Also, it catches
10896 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10897 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10898 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 10899
c9d624c6
PE
10900 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10901 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 10902 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 10903
353032ce
PE
10904 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10905
2bccce07
PE
10906 * alloc.c (Fmake_string): Check for out-of-range init.
10907
0ac30604
SM
109082011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10909
10910 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10911
c195f2de
JD
109122011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10913
10914 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10915 xg_get_default_scrollbar_width.
10916
10917 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10918 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10919 (style_changed_cb): Call update_theme_scrollbar_width and call
10920 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10921 all frames (Bug#8505).
10922 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10923 Call gtk_window_set_resizable if HAVE_GTK3.
10924 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10925 and height if HAVE_GTK3 (Bug#8505).
10926 (scroll_bar_width_for_theme): New variable.
10927 (update_theme_scrollbar_width): New function.
10928 (xg_get_default_scrollbar_width): Move code to
10929 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10930 (xg_initialize): Call update_theme_scrollbar_width.
10931
10932 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10933
10934 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10935
e10ac9f1
MR
109362011-06-12 Martin Rudalics <rudalics@gmx.at>
10937
10938 * frame.c (make_frame): Call other_buffer_safely instead of
10939 other_buffer.
10940
10941 * window.c (temp_output_buffer_show): Call display_buffer with
10942 second argument Vtemp_buffer_show_specifiers and reset latter
10943 immediately after the call.
10944 (Vtemp_buffer_show_specifiers): New variable.
10945 (auto_window_vscroll_p, next_screen_context_lines)
10946 (Vscroll_preserve_screen_position): Remove leading asterisks from
10947 doc-strings.
10948
2d3c217e 109492011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 10950
7b7f97e8 10951 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
10952 * buffer.c (Qclone_number): Remove for now, as it's unused.
10953 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10954 (record_buffer): Remove unused local.
10955 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10956 (set_frame_buffer_list): Remove; unused.
10957 * frame.h (other_visible_frames): Remove decl.
10958 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10959 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10960 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10961 if HAVE_GPM.
10962 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10963 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10964 Define only if HAVE_GPM.
10965 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10966 (update_hints_inhibit): Remove; never set. All uses removed.
10967 * widgetprv.h (emacsFrameClassRec): Remove decl.
10968 * window.c (delete_deletable_window): Now returns void, since it
10969 wasn't returning anything.
10970 (compare_window_configurations): Remove unused locals.
10971 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10972 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
10973 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10974 the same widths as pointers. This follows up on the 2011-05-06 patch.
10975 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10976 * xterm.h: Likewise.
10977 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10978
1384b89e
JB
109792011-06-12 Juanma Barranquero <lekktu@gmail.com>
10980
10981 * makefile.w32-in: Update dependencies.
10982 (LISP_H): Add lib/intprops.h.
10983
1100a63c
CY
109842011-06-11 Chong Yidong <cyd@stupidchicken.com>
10985
10986 * image.c (gif_load): Add animation frame delay to the metadata.
10987 (syms_of_image): Use DEFSYM. New symbol `delay'.
10988
6198ccd0
MR
109892011-06-11 Martin Rudalics <rudalics@gmx.at>
10990
10991 * window.c (delete_deletable_window): Re-add.
10992 (Fset_window_configuration): Rewrite to handle dead buffers and
10993 consequently deletable windows.
10994 (window_tree, Fwindow_tree): Remove. Supply functionality in
10995 window.el.
10996 (compare_window_configurations): Simplify code.
10997
b6e3633c
AS
109982011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10999
1ab0dee5
AS
11000 * image.c (imagemagick_load_image): Fix type mismatch.
11001 (Fimagemagick_types): Likewise.
11002
b6e3633c
AS
11003 * window.h (replace_buffer_in_windows): Declare.
11004
9397e56f
MR
110052011-06-11 Martin Rudalics <rudalics@gmx.at>
11006
11007 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11008 Qclone_number. Remove external declaration of Qdelete_window.
11009 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
11010 code.
640c8776
SM
11011 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11012 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
11013 (Fother_buffer): Rewrite doc-string. Major rewrite for new
11014 buffer list implementation.
11015 (other_buffer_safely): New function.
11016 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11017 calls to replace_buffer_in_windows and
11018 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
11019 if allowed.
11020 (record_buffer): Inhibit quitting and rewrite using quittable
11021 functions. Run Qbuffer_list_update_hook if allowed.
11022 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
11023 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11024 Move switch-to-buffer to window.el.
9397e56f
MR
11025 (bury-buffer): Move to window.el.
11026 (Vbuffer_list_update_hook): New variable.
11027
11028 * lisp.h (other_buffer_safely): Add prototype in buffer.c
11029 section.
11030
11031 * window.h (resize_frame_windows): Move up in code.
11032 (Fwindow_frame): Remove EXFUN.
11033 (replace_buffer_in_all_windows): Remove prototype.
11034 (replace_buffer_in_windows_safely): Add prototype.
11035
11036 * window.c: Declare Qdelete_window static again. Move down
11037 declaration of select_count.
11038 (Fnext_window, Fprevious_window): Rewrite doc-strings.
11039 (Fother_window): Move to window.el.
11040 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11041 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11042 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11043 window.el.
11044 (replace_buffer_in_windows): Implement by calling
11045 Qreplace_buffer_in_windows.
11046 (replace_buffer_in_all_windows): Remove with some functionality
11047 moved into replace_buffer_in_windows_safely.
11048 (replace_buffer_in_windows_safely): New function.
11049 (select_window_norecord, select_frame_norecord): Move in front
11050 of run_window_configuration_change_hook. Remove now obsolete
11051 declarations.
640c8776
SM
11052 (Fset_window_buffer): Rewrite doc-string.
11053 Call Qrecord_window_buffer.
9397e56f
MR
11054 (keys_of_window): Move binding for other-window to window.el.
11055
b50691aa
CY
110562011-06-11 Chong Yidong <cyd@stupidchicken.com>
11057
11058 * dispextern.h (struct image): Replace data member, whose int_val
11059 and ptr_val fields were not used by anything, with a single
11060 lisp_val object.
11061
11062 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
11063 (gif_clear_image, gif_load, imagemagick_load_image)
11064 (gs_clear_image, gs_load): Callers changed.
11065
3f754b86
PE
110662011-06-10 Paul Eggert <eggert@cs.ucla.edu>
11067
cca69397
PE
11068 * buffer.h: Include <time.h>, for time_t.
11069 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
11070
109e28d0
PE
11071 Fix minor problems found by static checking.
11072
60737f02
PE
11073 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
11074
4b66faf3
PE
11075 Make identifiers static if they are not used in other modules.
11076 * data.c (Qcompiled_function, Qframe, Qvector):
11077 * image.c (QimageMagick, Qsvg):
11078 * minibuf.c (Qmetadata):
11079 * window.c (resize_window_check, resize_root_window): Now static.
11080 * window.h (resize_window_check, resize_root_window): Remove decls.
11081
109e28d0
PE
11082 * window.c (window_deletion_count, delete_deletable_window):
11083 Remove; unused.
46a4ce9e
PE
11084 (window_body_lines): Now static.
11085 (Fdelete_other_windows_internal): Mark vars as initialized.
11086 Make sure 'resize_failed' is initialized.
11087 (run_window_configuration_change_hook): Rename local to avoid shadowing.
11088 (resize_window_apply): Remove unused local.
11089 * window.h (delete_deletable_window): Remove decl.
11090
109e28d0 11091 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
11092 (imagemagick_load_image): Fix pointer signedness problem by changing
11093 last arg from unsigned char * to char *. All uses changed.
11094 Also, fix a local for similar reasons.
11095 Remove unused locals. Remove locals to avoid shadowing.
11096 (fn_rsvg_handle_free): Remove; unused.
11097 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 11098 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 11099
3f754b86
PE
11100 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
11101
2547adb1
CY
111022011-06-10 Chong Yidong <cyd@stupidchicken.com>
11103
11104 * image.c (gif_load): Fix omitted cast error introduced by
11105 2011-06-06 change.
11106
2c8e37d4
MR
111072011-06-10 Martin Rudalics <rudalics@gmx.at>
11108
11109 * window.h (resize_proportionally, orig_total_lines)
11110 (orig_top_line): Remove from window structure.
11111 (set_window_height, set_window_width, change_window_heights)
11112 (Fdelete_window): Remove prototypes.
11113 (resize_frame_windows): Remove duplicate declaration.
11114
440a42e3
EZ
111152011-06-10 Eli Zaretskii <eliz@gnu.org>
11116
11117 * window.h (resize_frame_windows, resize_window_check)
11118 (delete_deletable_window, resize_root_window)
11119 (resize_frame_windows): Declare prototypes.
11120
11121 * window.c (resize_window_apply): Make definition be "static" to
11122 match the prototype.
11123
562dd5e9
MR
111242011-06-10 Martin Rudalics <rudalics@gmx.at>
11125
11126 * window.c: Remove declarations of Qwindow_size_fixed,
11127 window_min_size_1, window_min_size_2, window_min_size,
11128 size_window, window_fixed_size_p, enlarge_window, delete_window.
11129 Remove static from declaration of Qdelete_window, it's
11130 temporarily needed by Fbury_buffer.
11131 (replace_window): Don't assign orig_top_line and
11132 orig_total_lines.
11133 (Fdelete_window, delete_window): Remove. Window deletion is
11134 handled by window.el.
640c8776
SM
11135 (window_loop): Remove DELETE_OTHER_WINDOWS case.
11136 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
11137 (Fdelete_other_windows): Remove. Deleting other windows is
11138 handled by window.el.
11139 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
11140 handled in window.el.
11141 (window_min_size_2, window_min_size_1, window_min_size): Remove.
11142 Window minimum sizes are handled in window.el.
11143 (shrink_windows, size_window, set_window_height)
11144 (set_window_width, change_window_heights, window_height)
11145 (window_width, CURBEG, CURSIZE, enlarge_window)
11146 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
11147 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
11148 handled in window.el.
11149 (make_dummy_parent): Rename to make_parent_window and give it a
11150 second argument horflag.
11151 (make_window): Don't set resize_proportionally any more.
11152 (Fsplit_window): Remove. Windows are split in window.el.
11153 (save_restore_action, save_restore_orig_size)
11154 (shrink_window_lowest_first, save_restore_orig_size): Remove.
11155 Resize mini windows in window.el.
11156 (grow_mini_window, shrink_mini_window): Implement by calling
11157 Qresize_root_window_vertically, resize_window_check and
11158 resize_window_apply.
640c8776
SM
11159 (saved_window, Fset_window_configuration, save_window_save):
11160 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
11161 resize_proportionally.
11162 (window_min_height, window_min_width): Move to window.el.
11163 (keys_of_window): Move bindings for delete-other-windows,
11164 split-window, delete-window and enlarge-window to window.el.
11165
11166 * buffer.c: Temporarily extern Qdelete_window.
11167 (Fbury_buffer): Temporarily call Qdelete_window instead of
11168 Fdelete_window (Fbury_buffer will move to window.el soon).
11169
11170 * frame.c (set_menu_bar_lines_1): Remove code handling
11171 orig_top_line and orig_total_lines.
11172
11173 * dispnew.c (adjust_frame_glyphs_initially): Don't use
11174 set_window_height but set heights directly.
11175 (change_frame_size_1): Use resize_frame_windows.
11176
11177 * xdisp.c (init_xdisp): Don't use set_window_height but set
11178 heights directly.
11179
640c8776
SM
11180 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
11181 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
11182 run_window_configuration_change_hook.
11183
11184 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
11185 instead of change_window_heights and run
11186 run_window_configuration_change_hook.
11187
1a13852e
MR
111882011-06-09 Martin Rudalics <rudalics@gmx.at>
11189
11190 * window.c (replace_window): Rename second argument REPLACEMENT to
11191 NEW. New third argument SETFLAG. Rewrite.
11192 (delete_window, make_dummy_parent): Call replace_window with
11193 third argument 1.
11194 (window_list_1): Move down in code.
11195 (run_window_configuration_change_hook): Move set_buffer part
11196 before select_frame_norecord part in order to unwind correctly.
11197 Rename count1 to count.
11198 (recombine_windows, delete_deletable_window, resize_root_window)
11199 (Fdelete_other_windows_internal)
11200 (Frun_window_configuration_change_hook, make_parent_window)
11201 (resize_window_check, resize_window_apply, Fresize_window_apply)
11202 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
11203 (Fdelete_window_internal, Fresize_mini_window_internal):
11204 New functions.
1a13852e
MR
11205 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
11206
f3d1777e
MR
112072011-06-08 Martin Rudalics <rudalics@gmx.at>
11208
496e208e
MR
11209 * window.h (window): Add some new members to window structure -
11210 normal_lines, normal_cols, new_total, new_normal, clone_number,
11211 splits, nest, prev_buffers, next_buffers.
11212 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 11213 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 11214
f3d1777e
MR
11215 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
11216 Remove.
496e208e
MR
11217 (make_dummy_parent): Set new members of windows structure.
11218 (make_window): Move down in code. Handle new members of window
11219 structure.
11220 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
11221 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
11222 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
11223 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
11224 (Fset_window_next_buffers, Fset_window_clone_number):
11225 New functions.
496e208e
MR
11226 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
11227 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
11228 Doc-string fixes.
11229 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
11230 Argument WINDOW can be now internal window too.
11231 (Fwindow_use_time): Move up in code.
11232 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
11233 Rewrite doc-string.
11234 (Fset_window_configuration, saved_window)
11235 (Fcurrent_window_configuration, save_window_save): Handle new
11236 members of window structure.
b9e809c2
MR
11237 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
11238 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
11239 (syms_of_window): New Lisp objects Qrecord_window_buffer,
11240 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
11241 Qget_mru_window, Qresize_root_window,
11242 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
11243 Qauto_buffer_name; staticpro them.
f3d1777e 11244
abde8f8c
MR
112452011-06-07 Martin Rudalics <rudalics@gmx.at>
11246
11247 * window.c (Fwindow_total_size, Fwindow_left_column)
11248 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
11249 (Fwindow_list_1): New functions.
11250 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
11251 (Fwindow_width, Fscroll_left, Fscroll_right):
11252 Use window_body_cols instead of window_box_text_cols.
11253 (delete_window, Fset_window_configuration):
11254 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
11255 (delete_all_subwindows): Take a window as argument and not a
11256 structure. Rewrite.
190b47e6
MR
11257 (window_loop): Remove handling of GET_LRU_WINDOW and
11258 GET_LARGEST_WINDOW.
11259 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
11260
11261 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
11262 window_box_text_cols. delete_all_subwindows now takes a
11263 Lisp_Object as argument.
abde8f8c 11264
640c8776
SM
11265 * indent.c (compute_motion, Fcompute_motion):
11266 Use window_body_cols instead of window_box_text_cols.
abde8f8c 11267
fa8a67e6
MR
11268 * frame.c (delete_frame): Call delete_all_subwindows with root
11269 window as argument.
11270
a54e3482
DC
112712011-06-07 Daniel Colascione <dan.colascione@gmail.com>
11272
11273 * fns.c (Fputhash): Document return value.
11274
60002bf5
CY
112752011-06-06 Chong Yidong <cyd@stupidchicken.com>
11276
11277 * image.c (gif_load): Implement gif89a spec "no disposal" method.
11278
0c671da6 112792011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 11280
b862a52a 11281 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 11282
be44ca6c
PE
11283 Check for overflow when converting integer to cons and back.
11284 * charset.c (Fdefine_charset_internal, Fdecode_char):
11285 Use cons_to_unsigned to catch overflow.
11286 (Fencode_char): Use INTEGER_TO_CONS.
11287 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
11288 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
11289 * data.c (long_to_cons, cons_to_long): Remove.
11290 (cons_to_unsigned, cons_to_signed): New functions.
11291 These signal an error for invalid or out-of-range values.
11292 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
11293 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
11294 * font.c (Ffont_variation_glyphs):
11295 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
11296 * lisp.h: Include <intprops.h>.
11297 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
11298 (cons_to_signed, cons_to_unsigned): New decls.
11299 (long_to_cons, cons_to_long): Remove decls.
11300 * undo.c (record_first_change): Use INTEGER_TO_CONS.
11301 (Fprimitive_undo): Use CONS_TO_INTEGER.
11302 * xfns.c (Fx_window_property): Likewise.
11303 * xselect.c: Include <limits.h>.
11304 (x_own_selection, selection_data_to_lisp_data):
11305 Use INTEGER_TO_CONS.
11306 (x_handle_selection_request, x_handle_selection_clear)
11307 (x_get_foreign_selection, Fx_disown_selection_internal)
11308 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
11309 (lisp_data_to_selection_data): Use cons_to_unsigned.
11310 (x_fill_property_data): Use cons_to_signed.
11311 Report values out of range.
11312
d1f3d2af
PE
11313 Check for buffer and string overflow more precisely.
11314 * buffer.h (BUF_BYTES_MAX): New macro.
11315 * lisp.h (STRING_BYTES_MAX): New macro.
11316 * alloc.c (Fmake_string):
11317 * character.c (string_escape_byte8):
11318 * coding.c (coding_alloc_by_realloc):
11319 * doprnt.c (doprnt):
11320 * editfns.c (Fformat):
11321 * eval.c (verror):
11322 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
11323 since they may not be the same number.
11324 * editfns.c (Finsert_char):
11325 * fileio.c (Finsert_file_contents):
11326 Likewise for BUF_BYTES_MAX.
11327
dd52fcea
PE
11328 * image.c: Use ptrdiff_t, not int, for sizes.
11329 (slurp_file): Switch from int to ptrdiff_t.
11330 All uses changed.
11331 (slurp_file): Check that file size fits in both size_t (for
11332 malloc) and ptrdiff_t (for sanity and safety).
11333
7f9bbdbb
PE
11334 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
11335 if b->modtime has its maximal value.
11336
dfe18f82
PE
11337 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
11338
84acfcf0
PE
11339 Don't assume time_t can fit into int.
11340 * buffer.h (struct buffer.modtime): Now time_t, not int.
11341 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
11342 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
11343
ccd9a01a
PE
11344 Minor fixes for signed vs unsigned integers.
11345 * character.h (MAYBE_UNIFY_CHAR):
11346 * charset.c (maybe_unify_char):
11347 * keyboard.c (read_char, reorder_modifiers):
11348 XINT -> XFASTINT, since the integer must be nonnegative.
11349 * ftfont.c (ftfont_spec_pattern):
11350 * keymap.c (access_keymap, silly_event_symbol_error):
11351 XUINT -> XFASTINT, since the integer must be nonnegative.
11352 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
11353 since it makes no difference and we prefer signed.
11354 * keyboard.c (record_char): Use XUINT when all the neighbors do.
11355 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
11356 nonnegative.
11357
d6d100dd
SM
113582011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
11359
11360 * window.h (Fwindow_frame): Declare.
11361
2b6148e4
PE
113622011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11363
11364 * alloc.c: Simplify handling of large-request failures (Bug#8800).
11365 (SPARE_MEMORY): Always define.
11366 (LARGE_REQUEST): Remove.
11367 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
11368
f230ecc9
MR
113692011-06-06 Martin Rudalics <rudalics@gmx.at>
11370
727e958e
MR
11371 * lisp.h: Move EXFUNS for Fframe_root_window,
11372 Fframe_first_window and Fset_frame_selected_window to window.h.
11373
11374 * window.h: Move EXFUNS for Fframe_root_window,
11375 Fframe_first_window and Fset_frame_selected_window here from
11376 lisp.h.
11377
11378 * frame.c (Fwindow_frame, Fframe_first_window)
11379 (Fframe_root_window, Fframe_selected_window)
11380 (Fset_frame_selected_window): Move to window.c.
11381 (Factive_minibuffer_window): Move to minibuf.c.
11382 (Fother_visible_frames_p): New function.
11383
11384 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
11385
f230ecc9
MR
11386 * window.c (decode_window, decode_any_window): Move up in code.
11387 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
11388 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
11389 (Fwindow_buffer): Move up and rewrite doc-string.
11390 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
11391 (Fwindow_prev): New functions.
727e958e
MR
11392 (Fwindow_frame): Move here from frame.c. Accept any window as
11393 argument.
11394 (Fframe_root_window, Fframe_first_window)
11395 (Fframe_selected_window): Move here from frame.c. Accept frame
11396 or arbitrary window as argument. Update doc-strings.
11397 (Fminibuffer_window): Move up in code.
11398 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
11399 (Fset_frame_selected_window): Move here from frame.c.
11400 Marginal rewrite.
727e958e
MR
11401 (Fselected_window, select_window, Fselect_window): Move up in
11402 code. Minor doc-string fixes.
f230ecc9 11403
4d09bcf6
PE
114042011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11405
11406 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
11407 Do not assume that spare memory exists; that assumption is valid
11408 only if SYSTEM_MALLOC.
11409 (LARGE_REQUEST): New macro, so that the issue of large requests
11410 is separated from the issue of spare memory.
11411
810928a2
AS
114122011-06-05 Andreas Schwab <schwab@linux-m68k.org>
11413
172418ad
AS
11414 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
11415 format. (Bug#8806)
11416
43f862f7
AS
11417 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
11418
810928a2
AS
11419 * xfns.c (x_set_scroll_bar_default_width): Move declarations
11420 before statements.
11421
a059fe24
JD
114222011-06-05 Jan Djärv <jan.h.d@swipnet.se>
11423
11424 * gtkutil.c (xg_get_default_scrollbar_width): New function.
11425
11426 * gtkutil.h: Declare xg_get_default_scrollbar_width.
11427
11428 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
11429 min width by calling x_set_scroll_bar_default_width (Bug#8505).
11430
989bf368
JB
114312011-06-05 Juanma Barranquero <lekktu@gmail.com>
11432
11433 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
11434
4b80f674
CY
114352011-06-04 Chong Yidong <cyd@stupidchicken.com>
11436
11437 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
11438 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
11439 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
11440 New error handlers.
4b80f674
CY
11441 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
11442 Obey Vx_select_enable_clipboard_manager. Catch errors in
11443 x_clipboard_manager_save (Bug#8779).
11444 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 11445 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 11446
99a33b77 114472011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
11448
11449 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
11450
99a33b77 114512011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
11452
11453 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
11454 in the current matrix if keep_current_p is non-zero.
11455
8264569d
EZ
114562011-06-04 Eli Zaretskii <eliz@gnu.org>
11457
11458 * bidi.c (bidi_level_of_next_char): Fix last change.
11459
57f97249
EZ
114602011-06-03 Eli Zaretskii <eliz@gnu.org>
11461
fec2107c 11462 Support bidi reordering of text covered by display properties.
57f97249 11463
fec2107c
EZ
11464 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
11465 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
11466 (bidi_cache_search, bidi_cache_iterator_state)
11467 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
11468 (bidi_level_of_next_char, bidi_move_to_visually_next):
11469 Support character positions inside a run of characters covered by a
fec2107c
EZ
11470 display string.
11471 (bidi_paragraph_init, bidi_resolve_explicit_1)
11472 (bidi_level_of_next_char): Call bidi_fetch_char and
11473 bidi_fetch_char_advance instead of FETCH_CHAR and
11474 FETCH_CHAR_ADVANCE.
11475 (bidi_init_it): Initialize new members.
11476 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
11477 definitions.
11478 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
11479 instead of using explicit *_CHAR codes.
d6d100dd
SM
11480 (bidi_resolve_explicit, bidi_resolve_weak):
11481 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
11482 bidirectional text is supported only in multibyte buffers.
11483 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
11484 it to initialize the frame_window_p member of struct bidi_it.
11485 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
11486 (bidi_resolve_explicit, bidi_resolve_weak)
11487 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
11488 bidi_it->nchars is non-positive.
11489 (bidi_level_of_next_char): Don't try to lookup the cache for the
11490 next/previous character if nothing is cached there yet, or if we
11491 were just reseat()'ed to a new position.
c40e2fb2 11492
0e14fe90
EZ
11493 * xdisp.c (set_cursor_from_row): Set start and stop points
11494 according to the row's direction when priming the loop that looks
11495 for the glyph on which to display cursor.
11496 (single_display_spec_intangible_p): Function deleted.
11497 (display_prop_intangible_p): Reimplement to call
11498 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
11499 Accept 3 additional arguments needed by handle_display_spec.
11500 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
11501 values: lists, `(when COND...)' forms, etc.
11502 (single_display_spec_string_p): Support property values that are
11503 lists with the argument STRING its top-level element.
11504 (display_prop_string_p): Fix the condition for processing a
11505 property that is a list to be consistent with handle_display_spec.
fec2107c 11506 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
11507 last portion of handle_display_prop.
11508 (compute_display_string_pos): Accept additional argument
11509 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
11510 value of a `display' property is a "replacing spec".
11511 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
11512 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
11513 the display property, but just return a value indicating whether
11514 the display property will replace the characters it covers.
11515 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
11516 frame_window_p members of struct bidi_it.
d6d100dd
SM
11517 (compute_display_string_pos, compute_display_string_end):
11518 New functions.
fec2107c
EZ
11519 (push_it): Accept second argument POSITION, where pop_it should
11520 jump to continue iteration.
11521 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 11522
fec2107c
EZ
11523 * keyboard.c (adjust_point_for_property): Adjust the call to
11524 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
11525
11526 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
11527 (bidi_init_it): Update prototypes.
11528 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
11529 (compute_display_string_pos, compute_display_string_end):
11530 Declare prototypes.
fec2107c
EZ
11531 (struct bidi_it): New members nchars and disp_pos. ch_len is now
11532 EMACS_INT.
fc6f18ce 11533
40087514 115342011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 11535
57f53182
PE
11536 Malloc failure behavior now depends on size of allocation.
11537 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
11538 * lisp.h: Change signatures accordingly.
11539 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
11540 All callers changed. (Bug#8762)
11541
11542 * gnutls.c: Use Emacs's memory allocators.
11543 Without this change, the gnutls library would invoke malloc etc.
11544 directly, which causes problems on non-SYNC_INPUT hosts, and which
11545 runs afoul of improving memory_full behavior. (Bug#8761)
11546 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
11547 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
11548 xfree instead of the default malloc, realloc, free.
11549 (Fgnutls_boot): No need to check for memory allocation failure,
11550 since xmalloc does that for us.
11551
ac32cd99 11552 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
11553 * category.c (hash_get_category_set):
11554 * ccl.c (ccl_driver):
11555 * charset.c (Fdefine_charset_internal):
11556 * charset.h (struct charset.hash_index):
11557 * composite.c (get_composition_id, gstring_lookup_cache)
11558 (composition_gstring_put_cache):
11559 * composite.h (struct composition.hash_index):
11560 * dispextern.h (struct image.hash):
11561 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
11562 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
11563 (hashfn_equal, hashfn_user_defined, make_hash_table)
11564 (maybe_resize_hash_table, hash_lookup, hash_put)
11565 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
11566 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
11567 (Fsxhash, Fgethash, Fputhash, Fmaphash):
11568 * image.c (make_image, search_image_cache, lookup_image)
11569 (xpm_put_color_table_h):
11570 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 11571 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 11572 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 11573 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
11574 * alloc.c (allocate_vectorlike):
11575 Check for overflow in vector size calculations.
11576 * ccl.c (ccl_driver):
11577 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
11578 * fns.c, image.c: Remove unnecessary static decls that would otherwise
11579 need to be updated by these changes.
40087514
PE
11580 * fns.c (make_hash_table, maybe_resize_hash_table):
11581 Check for integer overflow with large hash tables.
0de4bb68
PE
11582 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
11583 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
11584 (SXHASH_REDUCE): New macro.
11585 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
11586 Use it instead of discarding useful hash info with large hash values.
11587 (sxhash_float): New function.
11588 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
11589 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
11590 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
11591 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
11592 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
11593 Adjust signatures to match updated version of code.
11594 (consing_since_gc): Now EMACS_INT, since a single hash table can
11595 use more than INT_MAX bytes.
11596
698d32e2
DN
115972011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
11598
11599 Make it possible to build with GCC-4.6+ -O2 -flto.
11600
11601 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
11602
fd6fa53f
SM
116032011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
11604
11605 * minibuf.c (get_minibuffer, read_minibuf_unwind):
11606 Call minibuffer-inactive-mode.
11607
864db017
JB
116082011-05-31 Juanma Barranquero <lekktu@gmail.com>
11609
11610 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
11611 Update dependencies.
11612
2ad0baf4
DN
116132011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11614
11615 * data.c (init_data): Remove code for UTS, this system is not
11616 supported anymore.
11617
4fcc2638
DN
116182011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11619
11620 Don't force ./temacs to start in terminal mode.
11621
11622 * frame.c (make_initial_frame): Initialize faces in all cases, not
11623 only when CANNOT_DUMP is defined.
11624 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11625
c56e0fd5
DN
116262011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11627
11628 * dispnew.c (add_window_display_history): Use const for the string
11629 pointer. Remove declaration, not needed.
11630
333d54da 116312011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 11632
55d4c1b2 11633 Use 'inline', not 'INLINE'.
333d54da 11634 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
11635 * alloc.c, fontset.c (INLINE): Remove.
11636 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11637 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11638 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11639 * gmalloc.c (register_heapinfo): Use inline unconditionally.
11640 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11641
738db178
DN
116422011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11643
11644 Make it possible to run ./temacs.
11645
11646 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11647 syms_of_callproc does the same thing. Remove test for
11648 "initialized", do it in the caller.
11649 * emacs.c (main): Avoid calling set_initial_environment when dumping.
11650
620c53a6
SM
116512011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
11652
11653 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11654 (read_minibuf): Use get_minibuffer.
11655 (syms_of_minibuf): Use DEFSYM.
11656 (Qmetadata): New var.
11657 * data.c (Qbuffer): Don't make it static.
11658 (syms_of_data): Use DEFSYM.
11659
e003a292
PE
116602011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11661
11662 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
11663 (CCL_CODE_MIN): New macro.
11664
ed008a6d
PE
116652011-05-30 Paul Eggert <eggert@cs.ucla.edu>
11666
3687c2ef
PE
11667 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11668
ed008a6d
PE
11669 * eval.c (Qdebug): Now static.
11670 * lisp.h (Qdebug): Remove decl. This reverts a part of the
11671 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11672 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11673
d66c4c7c
CY
116742011-05-29 Chong Yidong <cyd@stupidchicken.com>
11675
11676 * image.c: Various fixes to ImageMagick code comments.
11677 (Fimagemagick_types): Doc fix.
11678
5fbc2025
PE
116792011-05-29 Paul Eggert <eggert@cs.ucla.edu>
11680
0196f88a
PE
11681 Minor fixes prompted by GCC 4.6.0 warnings.
11682
11683 * xselect.c (converted_selections, conversion_fail_tag): Now static.
11684
5fbc2025
PE
11685 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11686 (x_clipboard_manager_save_all): Move extern decl to ...
11687 * xterm.h: ... here, so that it can be checked for consistency.
11688
1dd3c2d9
CY
116892011-05-29 Chong Yidong <cyd@stupidchicken.com>
11690
11691 * xselect.c (x_clipboard_manager_save_frame)
11692 (x_clipboard_manager_save_all): New functions.
11693 (Fx_clipboard_manager_save): Lisp function deleted.
11694
11695 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11696 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11697
11698 * xterm.h: Update prototype.
11699
5ba6571d
WX
117002011-05-28 William Xu <william.xwl@gmail.com>
11701
11702 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11703 exiting (Bug#8239).
11704
3eaff834
JM
117052011-05-28 Jim Meyering <meyering@redhat.com>
11706
e1900994 11707 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
11708 * fns.c (to_uchar): Define.
11709 (crypto_hash_function): Use it to convert some newly-signed
11710 variables to unsigned, to avoid sign-extension bugs. For example,
11711 without this change, (md5 "truc") would evaluate to
11712 45723a2aff78ff4fff7fff1114760e62 rather than the expected
11713 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 11714 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 11715
0f6990a7
PE
117162011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11717
11718 Integer overflow fixes.
c8a9ca5a 11719
08686060
PE
11720 * dbusbind.c: Serial number integer overflow fixes.
11721 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
11722 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11723 to hold a serial number that is too large for a fixnum.
11724 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11725 Check for serial numbers out of range. Decode any serial number
59568bf0 11726 that was so large that it became a float. (Bug#8722)
08686060 11727
2d1fc3c7
PE
11728 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11729 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11730 Use XFASTINT rather than XUINT when numbers are nonnegative.
11731 (xd_append_arg, Fdbus_method_return_internal):
11732 (Fdbus_method_error_internal): Likewise. Also, for unsigned
11733 arguments, check that Lisp number is nonnegative, rather than
59568bf0 11734 silently wrapping negative numbers around. (Bug#8722)
30217ff0 11735 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 11736 (Bug#8722)
2d1fc3c7 11737
c8a9ca5a
PE
11738 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11739
519e1d69
PE
11740 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11741
6df6ae42 11742 ccl: Add integer overflow checks.
30569699
PE
11743 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11744 (IN_INT_RANGE): New macros.
11745 (ccl_driver): Use them to check for integer overflow when
11746 decoding a CCL program. Many of the new checks are whether XINT (x)
11747 fits in int; it doesn't always, on 64-bit hosts. The new version
11748 doesn't catch all possible integer overflows, but it's an
847044ea 11749 improvement. (Bug#8719)
30569699 11750
c11285dc
PE
11751 * alloc.c (make_event_array): Use XINT, not XUINT.
11752 There's no need for unsigned here.
11753
fdccd48e
PE
11754 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11755 This follows up to the 2011-05-06 change that substituted uintptr_t
11756 for EMACS_INT. This case wasn't caught back then.
11757
37910ab2
PE
11758 Rework Fformat to avoid integer overflow issues.
11759 * editfns.c: Include <float.h> unconditionally, as it's everywhere
11760 now (part of C89). Include <verify.h>.
11761 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
11762 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
11763 (Fformat): Avoid the prepass trying to compute sizes; it was only
11764 approximate and thus did not catch overflow reliably. Instead, walk
11765 through the format just once, formatting and computing sizes as we go,
11766 checking for integer overflow at every step, and allocating a larger
11767 buffer as needed. Keep track separately whether the format is
11768 multibyte. Keep only the most-recently calculated precision, rather
11769 than them all. Record whether each argument has been converted to
11770 string. Use EMACS_INT, not int, for byte and char and arg counts.
11771 Support field widths and precisions larger than INT_MAX. Avoid
11772 sprintf's undefined behavior with conversion specifications such as %#d
11773 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
11774 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
11775 formatting out-of-range floating point numbers with int
9173deec 11776 formats. (Bug#8668)
37910ab2 11777
2e6578fb
PE
11778 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
11779
0ae6bdee
PE
11780 * data.c: Avoid integer truncation in expressions involving floats.
11781 * data.c: Include <intprops.h>.
11782 (arith_driver): When there's an integer overflow in an expression
11783 involving floating point, convert the integers to floating point
11784 so that the resulting value does not suffer from catastrophic
11785 integer truncation. For example, on a 64-bit host (* 4
11786 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11787 Do not rely on undefined behavior after integer overflow.
11788
de883a70
PE
11789 merge count_size_as_multibyte, parse_str_to_multibyte
11790 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 11791 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
11792 Check for integer overflow.
11793 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11794 since it's now a duplicate of the other. This is more of
11795 a character than a buffer op, so better that it's in character.c.
11796 * fns.c, print.c: Adjust to above changes.
11797
2ff916cb
PE
117982011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11799
11800 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11801
f1b54466
PE
118022011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11803
fb1ac845
PE
11804 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11805 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11806 (x_clipboard_manager_save): Now static.
11807 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11808
f1b54466
PE
11809 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11810 (crypto_hash_function): Now static.
11811 Fix pointer signedness problems. Avoid unnecessary initializations.
11812
a9f737ee
CY
118132011-05-27 Chong Yidong <cyd@stupidchicken.com>
11814
11815 * termhooks.h (Vselection_alist): Make it terminal-local.
11816
11817 * terminal.c (create_terminal): Initialize it.
11818
11819 * xselect.c: Support for clipboard managers.
11820 (Vselection_alist): Move to termhooks.h as terminal-local var.
11821 (LOCAL_SELECTION): New macro.
11822 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11823 (symbol_to_x_atom): Remove gratuitous arg.
11824 (x_handle_selection_request, lisp_data_to_selection_data)
11825 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
11826 (x_own_selection, x_get_local_selection, x_convert_selection):
11827 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
11828 (some_frame_on_display): Delete unused function.
11829 (Fx_own_selection_internal, Fx_get_selection_internal)
11830 (Fx_disown_selection_internal, Fx_selection_owner_p)
11831 (Fx_selection_exists_p): New optional frame arg.
11832 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11833 (x_handle_selection_clear): Don't treat other terminals with the
11834 same keyboard specially. Use the terminal-local Vselection_alist.
11835 (x_clear_frame_selections): Use Frun_hook_with_args.
11836
11837 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11838
11839 * xterm.h: Add support for those atoms.
11840
e067f0c1
CY
118412011-05-26 Chong Yidong <cyd@stupidchicken.com>
11842
11843 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11844 (converted_selections, conversion_fail_tag): New global variables.
11845 (x_selection_request_lisp_error): Free the above.
11846 (x_get_local_selection): Remove unnecessary code.
11847 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
11848 of converted selections stored in converted_selections.
11849 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
11850 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11851 (x_convert_selection): New function.
11852 (x_handle_selection_event): Simplify.
11853 (x_get_foreign_selection): Don't ignore incoming requests while
11854 waiting for an answer; this will fail when we implement
11855 SAVE_TARGETS, and seems unnecessary anyway.
11856 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11857 (Vx_sent_selection_functions): Doc fix.
11858
0f4aebc0
LL
118592011-05-26 Leo Liu <sdl.web@gmail.com>
11860
11861 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11862
e61124cd
YM
118632011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11864
11865 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11866
11867 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11868 for fringe update if it has periodic bitmap.
ac389d0c 11869 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
11870 and fringe_bitmap_periodic_p.
11871
11872 * fringe.c (get_fringe_bitmap_data): New function.
11873 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11874 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11875 row. Mark glyph row for fringe update if periodicity changed.
11876
11877 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11878 for fringe update unless it has periodic bitmap.
11879
f16d9837
KH
118802011-05-25 Kenichi Handa <handa@m17n.org>
11881
11882 * xdisp.c (get_next_display_element): Set correct it->face_id for
11883 a static composition.
11884
e1b90ef6
LL
118852011-05-24 Leo Liu <sdl.web@gmail.com>
11886
11887 * deps.mk (fns.o):
11888 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11889
11890 * fns.c (crypto_hash_function, Fsha1): New function.
11891 (Fmd5): Use crypto_hash_function.
11892 (syms_of_fns): Add Ssha1.
11893
7400048f
PE
118942011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11895
11896 * gnutls.c: Remove unused macros.
11897 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11898 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11899 Remove macros that are defined and never used.
11900 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11901
abb71cf4
CY
119022011-05-22 Chong Yidong <cyd@stupidchicken.com>
11903
11904 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11905 (Fx_get_selection_internal): Minor cleanup.
11906 (Fx_own_selection_internal): Rename arguments for consistency with
11907 select.el.
11908
6307db39
PE
119092011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11910
11911 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11912
f3d4e0a4
CY
119132011-05-22 Chong Yidong <cyd@stupidchicken.com>
11914
11915 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11916
4d8ade89
YM
119172011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11918
11919 * dispnew.c (scrolling_window): Don't exclude the case that the
11920 last enabled row in the desired matrix touches the bottom boundary.
11921
32078c8d
GM
119222011-05-21 Glenn Morris <rgm@gnu.org>
11923
11924 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
11925 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11926 and add some more files.
32078c8d 11927
7285dc67
EZ
119282011-05-20 Eli Zaretskii <eliz@gnu.org>
11929
11930 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11931 report_file_error introduced by the change from 2011-05-07.
11932
89d1bd22
PE
119332011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11934
11935 * systime.h (Time): Define only if emacs is defined.
11936 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11937 where the include path doesn't have X11/X.h by default. See
11938 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11939
cd394be1 119402011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
11941
11942 * composite.c (find_automatic_composition): Fix previous change.
11943
b9704ad9
GM
119442011-05-20 Glenn Morris <rgm@gnu.org>
11945
11946 * lisp.mk: New file, split from Makefile.in.
11947 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11948 (shortlisp): Remove.
11949 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11950
4a720484
GM
119512011-05-19 Glenn Morris <rgm@gnu.org>
11952
11953 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11954 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11955 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11956 (lisp): Set the order to that of loadup.el.
11957 (shortlisp): Make it a copy of $lisp.
11958 (SOME_MACHINE_LISP): Remove.
11959 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11960 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11961
a28d4396
KH
119622011-05-18 Kenichi Handa <handa@m17n.org>
11963
11964 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11965 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11966 (find_automatic_composition): Mostly rewrite for efficiency.
11967
a2b1fa8e
JB
119682011-05-18 Juanma Barranquero <lekktu@gmail.com>
11969
11970 * makefile.w32-in: Update dependencies.
11971
8e1f5610
CS
119722011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11973
11974 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 11975 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 11976
7025ee00 119772011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 11978
cdfa6eab
PE
11979 Fix some integer overflow issues, such as string length overflow.
11980
06d6db33
PE
11981 * insdel.c (count_size_as_multibyte): Check for string overflow.
11982
2b4560a8
PE
11983 * character.c (lisp_string_width): Check for string overflow.
11984 Use EMACS_INT, not int, for string indexes and lengths; in
11985 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11986 the resulting string length overflows an EMACS_INT; instead,
11987 report a string overflow if no precision given. When checking for
11988 precision exhaustion, use a check that cannot possibly have
11989 integer overflow. (Bug#8675)
11990 * character.h (lisp_string_width): Adjust to new signature.
11991
cb93f9be
PE
11992 * alloc.c (string_overflow): New function.
11993 (Fmake_string): Use it. This doesn't change behavior, but saves
11994 a few bytes and will simplify future changes.
11995 * character.c (string_escape_byte8): Likewise.
11996 * lisp.h (string_overflow): New decl.
11997
1a1f3366
PE
11998 Fixups, following up to the user-interface timestamp change.
11999 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12000 for UI timestamps, instead of unsigned long.
9fbd6841
PE
12001 * msdos.c (mouse_get_pos): Likewise.
12002 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
12003 * w32gui.h (Time): Define by including "systime.h" rather than by
12004 declaring it ourselves. (Bug#8664)
12005
d4e3e4d3
PE
12006 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12007 * image.c (clear_image_cache): Likewise.
12008
f6a24d19
PE
12009 * term.c (term_mouse_position): Don't assume time_t wraparound.
12010
08dc5ae6
PE
12011 Be more systematic about user-interface timestamps.
12012 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
12013 and sometimes 'EMACS_UINT', to represent these timestamps.
12014 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
12015 This makes the code easier to follow, and makes it easier to catch
12016 integer overflow bugs such as Bug#8664.
12017 * frame.c (Fmouse_position, Fmouse_pixel_position):
12018 Use Time, not unsigned long, for user-interface timestamps.
12019 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12020 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12021 * keyboard.h (last_event_timestamp): Likewise.
12022 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12023 * menu.h (xmenu_show): Likewise.
12024 * term.c (term_mouse_position): Likewise.
12025 * termhooks.h (struct input_event.timestamp): Likewise.
12026 (struct terminal.mouse_position_hook): Likewise.
12027 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12028 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12029 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
12030 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12031 what it was before.
12032 * menu.h, termhooks.h: Include "systime.h", for Time.
12033
8e55734a
PE
12034 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12035 Don't assume that the difference between two unsigned long values
12036 can fit into an integer. At this point, we know button_down_time
12037 <= event->timestamp, so the difference must be nonnegative, so
12038 there's no need to cast the result if double-click-time is
12039 nonnegative, as it should be; check that it's nonnegative, just in
12040 case. This bug is triggered when events are more than 2**31 ms
86db42d2 12041 apart (about 25 days). (Bug#8664)
8e55734a 12042
841f1b75 12043 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 12044 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 12045
3e26f69c
PE
12046 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
12047 that always fit in int. Use a sentinel instead of a counter, to
12048 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
12049 * frame.h (struct frame): Use int for menu_bar_items_used
12050 instead of EMACS_INT, since it always fits in int.
3e26f69c 12051
5cc152c0
PE
12052 * menu.c (grow_menu_items): Check for int overflow.
12053
d89eb65e
PE
12054 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
12055
5235bd3e
PE
12056 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
12057 Before, the code was not consistent. These values cannot exceed
12058 2**31 - 1 so there's no need to make them unsigned.
12059 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
12060 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
12061 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
12062 as modifiers.
12063 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
12064
bc827e23
PE
12065 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
12066 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
12067 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
12068 presumably because the widths might not match.
12069
78eb494e
PE
12070 * window.c (size_window): Avoid needless test at loop start.
12071
04f2d78b
CB
120722011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
12073
12074 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
12075
d2fc7e3d 120762011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
12077
12078 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
12079
d2fc7e3d 120802011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
12081
12082 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
12083 `width' to `bar_area_x' and `bar_area_width', respectively.
12084 (x_scroll_run): Take account of fringe background extension.
12085
04f2d78b
CB
12086 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
12087 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
12088 `bar_area_width', respectively.
12089 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
12090 background extension.
12091
79b70037
GM
120922011-05-10 Jim Meyering <meyering@redhat.com>
12093
12094 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
12095
2f142cc5
JB
120962011-05-10 Juanma Barranquero <lekktu@gmail.com>
12097
12098 * image.c (Finit_image_library): Return t for built-in image types,
12099 like pbm and xbm. (Bug#8640)
12100
57679c86
AS
121012011-05-09 Andreas Schwab <schwab@linux-m68k.org>
12102
12103 * w32menu.c (set_frame_menubar): Fix submenu allocation.
12104
888c9e86
EZ
121052011-05-07 Eli Zaretskii <eliz@gnu.org>
12106
b0512a1d
EZ
12107 * w32console.c (Fset_screen_color): Doc fix.
12108 (Fget_screen_color): New function.
12109 (syms_of_ntterm): Defsubr it.
12110
7285dc67
EZ
12111 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
12112 unlink the temporary file if Fcall_process didn't create it in the
12113 first place.
12114 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
12115 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
12116 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
12117 cue to call_process_cleanup not to close that handle.
12118
4d3fcc8e
BK
121192011-05-07 Ben Key <bkey76@gmail.com>
12120
12121 * makefile.w32-in: The bootstrap-temacs rule now makes use of
12122 one of two shell specific rules, either bootstrap-temacs-CMD or
12123 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
12124 to the previous implementation of the bootstrap-temacs rule.
12125 The bootstrap-temacs-CMD rule is similar to the previous
12126 implementation of the bootstrap-temacs rule except that it
12127 makes use of the ESC_CFLAGS variable instead of the CFLAGS
12128 variable.
12129
12130 These changes, along with some changes to nt/configure.bat,
12131 nt/gmake.defs, and nt/nmake.defs, are required to extend my
12132 earlier fix to add support for --cflags and --ldflags options
12133 that include quotes so that it works whether make uses cmd or
12134 sh as the shell.
12135
b4289b64
MA
121362011-05-06 Michael Albinus <michael.albinus@gmx.de>
12137
12138 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
12139 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
12140 is a constant.
12141 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
12142 a string. Handle both cases.
12143 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
12144 (Fdbus_register_method): Use Qinvalid_function.
12145
af4c0e28
JB
121462011-05-06 Juanma Barranquero <lekktu@gmail.com>
12147
12148 * makefile.w32-in: Update dependencies.
12149 (LISP_H): Add inttypes.h and stdin.h.
12150 (PROCESS_H): Add unistd.h.
12151
c51453d9
EZ
121522011-05-06 Eli Zaretskii <eliz@gnu.org>
12153
12154 * lread.c: Include limits.h (fixes the MS-Windows build broken by
12155 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
12156
8ff0ac3c 121572011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 12158
4c4b566b
PE
12159 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
12160
aab2b9b5
PE
12161 * term.c (vfatal): Remove stray call to va_end.
12162 It's not needed and the C Standard doesn't allow it here anyway.
12163
c378da0b
PE
12164 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
12165 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
12166
288b08c7
PE
12167 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
12168 bytes.
12169
e3601888
PE
12170 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
12171
db6c0e74
PE
12172 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12173
dd5963ea
PE
12174 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
12175
88c9450f
PE
12176 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
12177
2f9442b8
PE
12178 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
12179
c032b5f8
PE
12180 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
12181 * charset.c (Fdefine_charset_internal): Don't initialize
12182 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 12183 32-bit int (Bug#8600).
a108c10b
PE
12184
12185 * lread.c (read_integer): Be more consistent with string-to-number.
12186 Use string_to_number to do the actual conversion; this avoids
12187 rounding errors and fixes some other screwups. Without this fix,
12188 for example, #x1fffffffffffffff was misread as -2305843009213693952.
12189 (digit_to_number): Move earlier, for benefit of read_integer.
12190 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 12191 not a digit in any supported base. (Bug#8602)
a108c10b 12192
ad5f9eea
PE
12193 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
12194
aec1708a
PE
12195 * dispnew.c (scrolling_window): Return 1 if we scrolled,
12196 to match comment at start of function. This also removes a
12197 GCC warning about overflow in a 32+64-bit port.
12198
47be4ab5
PE
12199 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
12200
371cac43
PE
12201 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
12202 Reported by Stefan Monnier in
12203 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
12204 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12205 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 12206
d01a7826
PE
12207 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
12208 (EMACS_UINTPTR): Likewise, with uintptr_t.
12209
7fd47d5c
PE
12210 * lisp.h: Prefer 64-bit EMACS_INT if available.
12211 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
12212 on 32-bit hosts that have 64-bit int, so that they can access
12213 large files.
122b0c86
PE
12214 However, temporarily disable this change unless the temporary
12215 symbol WIDE_EMACS_INT is defined.
7fd47d5c 12216
8727937b
PE
12217 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
12218
8ac068ac
PE
12219 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
12220 This removes an assumption that EMACS_INT and long are the same
12221 width as pointers. The assumption is true for Emacs porting targets
12222 now, but we want to make other targets possible.
12223 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
12224 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
12225 In the rest of the code, change types of integers that hold casted
12226 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
12227 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
12228 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
12229 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
12230 No need to cast type when ORing.
12231 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
12232 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
12233 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
12234 assume EMACS_INT is the same width as char *.
12235 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
12236 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
12237 Remove no-longer-needed casts.
12238 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
12239 (xg_tool_bar_help_callback, xg_make_tool_item):
12240 Use EMACS_INTPTR to hold an integer
12241 that will be cast to void *; this can avoid a GCC warning
12242 if EMACS_INT is not the same width as void *.
12243 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
12244 * xdisp.c (display_echo_area_1, resize_mini_window_1):
12245 (current_message_1, set_message_1):
12246 Use a local to convert to proper width without a cast.
12247 * xmenu.c (dialog_selection_callback): Likewise.
12248
ede49d71
PE
12249 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
12250 Also, don't assume VALBITS / RAND_BITS is less than 5,
12251 and don't rely on undefined behavior when shifting a 1 left into
12252 the sign bit.
12253 * lisp.h (get_random): Change signature to match.
12254
2f30ecd0
PE
12255 * lread.c (hash_string): Use size_t, not int, for hash computation.
12256 Normally we prefer signed values; but hashing is special, because
12257 it's better to use unsigned division on hash table sizes so that
12258 the remainder is nonnegative. Also, size_t is the natural width
12259 for hashing into memory. The previous code used 'int', which doesn't
12260 retain enough info to hash well into very large tables.
12261 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
12262
2a866e7b
PE
12263 * dbusbind.c: Don't possibly lose pointer info when converting.
12264 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12265 Use XPNTR rather than XHASH, so that the high-order bits of
12266 the pointer aren't lost when converting through void *.
12267
51639eac
PE
12268 * eval.c (Fautoload): Don't double-shift a pointer.
12269
92394119
PE
12270 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
12271
dbdb9a7c
JB
122722011-05-06 Juanma Barranquero <lekktu@gmail.com>
12273
12274 * gnutls.c (DEF_GNUTLS_FN):
12275 * image.c (DEF_IMGLIB_FN): Make function pointers static.
12276
db7a0b4f
AS
122772011-05-05 Andreas Schwab <schwab@linux-m68k.org>
12278
12279 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
12280 marker. (Bug#8610)
12281
cd394be1 122822011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
12283
12284 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
12285 New version that can reserve upto 2GB of heap space.
12286
f7ff1b0f 122872011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
12288
12289 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
12290
639c109b
TZ
122912011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
12292
12293 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
12294 `gnutls_certificate_set_x509_key_file'.
12295
d2127135
JB
122962011-05-05 Juanma Barranquero <lekktu@gmail.com>
12297
12298 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
12299 Update dependencies.
12300
e968f4f3
JB
123012011-05-04 Juanma Barranquero <lekktu@gmail.com>
12302
12303 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
12304 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12305 Remove unused parameter `fildes'.
12306 * process.c (read_process_output, send_process): Don't pass it.
12307
84d358f0
JB
123082011-05-04 Juanma Barranquero <lekktu@gmail.com>
12309
12310 Fix previous change: the library cache is defined in w32.c.
12311 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
12312 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
12313
0898ca10
JB
123142011-05-04 Juanma Barranquero <lekktu@gmail.com>
12315
12316 Implement dynamic loading of GnuTLS on Windows.
12317
12318 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
12319 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
12320 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12321 Declare.
12322
12323 * gnutls.c (Qgnutls_dll): Define.
12324 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
12325 (gnutls_*): Declare function pointers.
12326 (init_gnutls_functions): New function to initialize function pointers.
12327 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
12328 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
12329 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12330 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
12331 (emacs_gnutls_write, emacs_gnutls_read)
12332 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
12333 (Fgnutls_available_p): New function.
12334 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
12335 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
12336 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
12337
12338 * image.c: Include w32.h.
12339 (Vimage_type_cache): Delete.
12340 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
12341 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
12342 (w32_delayed_load): Move to w32.c.
12343
12344 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
12345
12346 * w32.c (QCloaded_from, Vlibrary_cache): Define.
12347 (w32_delayed_load): Move from image.c. When loading a library, record
12348 its filename in the :loaded-from property of the library id.
12349 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
12350 Initialize and staticpro them.
12351 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
12352
12353 * process.c: Include lisp.h before w32.h, not after.
12354 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
12355 instead of gnutls_record_check_pending.
12356
12357 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
12358
ff4de4aa
TZ
123592011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
12360
12361 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
12362 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
12363 as passed in.
12364
abe95abb
JD
123652011-05-03 Jan Djärv <jan.h.d@swipnet.se>
12366
12367 * xterm.c (x_set_frame_alpha): Do not set property on anything
12368 else than FRAME_X_OUTER_WINDOW (Bug#8608).
12369
e16e55d4
JB
123702011-05-02 Juanma Barranquero <lekktu@gmail.com>
12371
12372 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
12373
bafcf6a5
JB
123742011-05-02 Juanma Barranquero <lekktu@gmail.com>
12375
12376 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
12377 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
12378 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
12379 (gnutls_global_initialized, Qgnutls_bootprop_priority)
12380 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
12381 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
12382 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
12383 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
12384 (Qgnutls_bootprop_callbacks_verify): Make static.
12385
e7a6747f
AS
123862011-05-01 Andreas Schwab <schwab@linux-m68k.org>
12387
19ed11ba
AS
12388 * callproc.c: Indentation fixup.
12389
e7a6747f 12390 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
12391 (wait_for_termination, interruptible_wait_for_termination):
12392 Move after wait_for_termination_1.
e7a6747f 12393
1ef14cb4
LMI
123942011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
12395
12396 * sysdep.c (interruptible_wait_for_termination): New function
12397 which is like wait_for_termination, but allows keyboard
12398 interruptions.
12399
12400 * callproc.c (Fcall_process): Add (:file "file") as an option for
12401 the STDOUT buffer.
12402 (Fcall_process_region): Ditto.
12403
330d880c
EZ
124042011-04-30 Eli Zaretskii <eliz@gnu.org>
12405
8db90b73
EZ
12406 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
12407 rather than `XVECTOR (FOO)->size'.
12408
330d880c
EZ
12409 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
12410 inttypes.h, as a gnulib replacement is used if it not available in
12411 system headers.
12412
15cbd324
EZ
124132011-04-21 Eli Zaretskii <eliz@gnu.org>
12414
12415 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
12416 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
12417 of MOST_POSITIVE_FIXNUM. (Bug#8528)
12418
12419 * coding.c (coding_alloc_by_realloc): Error out if destination
12420 will grow beyond MOST_POSITIVE_FIXNUM.
12421 (decode_coding_emacs_mule): Abort if there isn't enough place in
12422 charbuf for the composition carryover bytes. Reserve an extra
12423 space for up to 2 characters produced in a loop.
12424 (decode_coding_iso_2022): Abort if there isn't enough place in
12425 charbuf for the composition carryover bytes.
12426
124272011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 12428
ae940cca
EZ
12429 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
12430 aborting when %lld or %lll format is passed.
12431 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
12432 %llo or %llx format is passed. (Bug#8545)
12433
03ab8921
EZ
12434 * window.c (window_scroll_line_based): Use a marker instead of
12435 simple variables to record original value of point. (Bug#7952)
12436
afda1437
EZ
12437 * doprnt.c (doprnt): Fix the case where a multibyte sequence
12438 produced by %s or %c overflows available buffer space. (Bug#8545)
12439
f76dee0c
PE
124402011-04-28 Paul Eggert <eggert@cs.ucla.edu>
12441
12442 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 12443 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 12444
fdc5744d
JB
124452011-04-28 Juanma Barranquero <lekktu@gmail.com>
12446
12447 * w32.c (init_environment): Warn about defaulting HOME to C:\.
12448
638f053a
JB
124492011-04-28 Juanma Barranquero <lekktu@gmail.com>
12450
12451 * keyboard.c (Qdelayed_warnings_hook): Define.
12452 (command_loop_1): Run `delayed-warnings-hook'
12453 if Vdelayed_warnings_list is non-nil.
12454 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
12455 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
12456
d178f871
EZ
124572011-04-28 Eli Zaretskii <eliz@gnu.org>
12458
12459 * doprnt.c (doprnt): Don't return value smaller than the buffer
12460 size if the message was truncated. (Bug#8545).
12461
b124fd93
JB
124622011-04-28 Juanma Barranquero <lekktu@gmail.com>
12463
12464 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
12465 (Fx_window_property): #if-0 the whole functions, not just the bodies.
12466
e810457d
PE
124672011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12468
12469 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
12470
ea51cceb
JB
124712011-04-27 Juanma Barranquero <lekktu@gmail.com>
12472
12473 * makefile.w32-in: Update dependencies.
12474
94dcfacf
EZ
124752011-04-27 Eli Zaretskii <eliz@gnu.org>
12476
12477 Improve `doprnt' and its usage. (Bug#8545)
12478 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
12479 `format_end'. Remove support for %l as a conversion specifier.
12480 Don't use xrealloc. Improve diagnostics when the %l size modifier
12481 is used. Update the commentary.
12482
12483 * eval.c (verror): Simplify calculation of size_t.
12484
12485 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
12486 messages.
12487
f61f41d7
PE
124882011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
12489
12490 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
12491 change.
12492
96fb4434
PE
124932011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12494
12495 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
12496 This makes this file independent of the recent pseudovector change.
12497
671875da 124982011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 12499
69e9b5a3
PE
12500 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
12501
b5f869a7 12502 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 12503 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 12504 Remove unused local.
c8926152 12505 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 12506
841a1577 12507 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
12508 GCC 4.6.0 optimizes based on type-based alias analysis.
12509 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
12510 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
12511 != &v->size, and therefore "v->size = 1; b->size = 2; return
12512 v->size;" must therefore return 1. This assumption is incorrect
12513 for Emacs, since it type-puns struct Lisp_Vector * with many other
12514 types. To fix this problem, this patch adds a new type struct
f904488f 12515 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
12516 and pseudovectors, and helps optimizing compilers not get fooled
12517 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
12518 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
12519 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
12520 the size member.
eab3844f
PE
12521 (XSETPVECTYPE): Rewrite in terms of new macro.
12522 (XSETPVECTYPESIZE): New macro, specifying both type and size.
12523 This is a bit clearer, and further avoids the possibility of
12524 undesirable aliasing.
12525 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 12526 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
12527 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
12528 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
12529 (ASIZE): Now uses header.size rather than size.
12530 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
12531 to avoid the hassle of writing XVECTOR (foo)->header.size.
12532 (struct vectorlike_header): New type.
eab3844f
PE
12533 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
12534 object, to help avoid aliasing.
12535 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
12536 (SUBRP): Likewise, since Lisp_Subr is a special case.
12537 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
12538 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
12539 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 12540 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
12541 changed to be "header.size" and "header.next".
12542 * buffer.h (struct buffer): Likewise.
12543 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
12544 * frame.h (struct frame): Likewise.
12545 * process.h (struct Lisp_Process): Likewise.
12546 * termhooks.h (struct terminal): Likewise.
12547 * window.c (struct save_window_data, struct saved_window): Likewise.
12548 * window.h (struct window): Likewise.
12549 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
12550 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
12551 * buffer.c (init_buffer_once): Likewise.
12552 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
12553 special case.
12554 * process.c (Fformat_network_address): Use local var for size,
12555 for brevity.
12556
0df1eac5
PE
12557 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
12558
847ab9d1 12559 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
12560 * data.c (atof): Remove decl; no longer used or needed.
12561 (digit_to_number): Move to lread.c.
12562 (Fstring_to_number): Use new string_to_number function, to be
12563 consistent with how the Lisp reader treats infinities and NaNs.
12564 Do not assume that floating-point numbers represent EMACS_INT
12565 without losing information; this is not true on most 64-bit hosts.
12566 Avoid double-rounding errors, by insisting on integers when
12567 parsing non-base-10 numbers, as the documentation specifies.
12568 * lisp.h (string_to_number): New decl, replacing ...
12569 (isfloat_string): Remove.
bc0a5c13 12570 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 12571 (read1): Do not accept +. and -. as integers; this
452f4150
PE
12572 appears to have been a coding error. Similarly, do not accept
12573 strings like +-1e0 as floating point numbers. Do not report
12574 overflow for integer overflows unless the base is not 10 which
12575 means we have no simple and reliable way to continue.
12576 Break out the floating-point parsing into a new
12577 function string_to_number, so that Fstring_to_number parses
12578 floating point numbers consistently with the Lisp reader.
04f2d78b 12579 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
12580 (E_CHAR, EXP_INT): Remove, replacing with ...
12581 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
12582 (string_to_number): New function, replacing isfloat_string.
12583 This function checks for valid syntax and produces the resulting
12584 Lisp float number too. Rework it so that string-to-number
bc0a5c13 12585 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
12586 so that overflow for non-base-10 numbers is reported only when
12587 there's no portable and simple way to convert to floating point.
452f4150 12588
67769ffc
PE
12589 * textprop.c (set_text_properties_1): Rewrite for clarity,
12590 and to avoid GCC warning about integer overflow.
12591
c20db43f
PE
12592 * intervals.h (struct interval): Use EMACS_INT for members
12593 where EMACS_UINT might cause problems. See
12594 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
12595 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
12596 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
12597 All uses changed.
37aa2f85
PE
12598 (offset_intervals): Tell GCC not to worry about length overflow
12599 when negating a negative length.
c20db43f 12600
2538aa2f
PE
12601 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
12602 (overrun_check_free): Likewise.
12603
f2d3008d
PE
12604 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
12605 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
12606 word size.
12607
ec8df744
PE
12608 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12609 (gnutls_make_error): Rename local to avoid shadowing.
12610 (gnutls_emacs_global_deinit): ifdef out; not used.
12611 (Fgnutls_boot): Use const for pointer to readonly storage.
12612 Comment out unused local. Fix pointer signedness problems.
12613
640ee02d
PE
12614 * lread.c (openp): Don't stuff size_t into an 'int'.
12615 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
12616 about possible signed overflow.
12617
6048fb2a
PE
12618 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12619 (GDK_KEY_g): Don't define if already defined.
12620 (xg_prepare_tooltip): Avoid pointer signedness problem.
12621 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12622
fa3c87e1
PE
12623 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12624 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
12625
2172544b
PE
12626 * xfns.c (Fx_window_property): Simplify a bit,
12627 to make a bit faster and to avoid GCC 4.6.0 warning.
12628 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12629
9b821a21
PE
12630 * fns.c (internal_equal): Don't assume size_t fits in int.
12631
3c616cfa
PE
12632 * alloc.c (compact_small_strings): Tighten assertion a little.
12633
c2982e87
PE
12634 Replace pEd with more-general pI, and fix some printf arg casts.
12635 * lisp.h (pI): New macro, generalizing old pEd macro to other
12636 conversion specifiers. For example, use "...%"pI"d..." rather
12637 than "...%"pEd"...".
12638 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 12639 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
12640 * alloc.c (check_pure_size): Don't overflow by converting size to int.
12641 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12642 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12643 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12644 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12645 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12646 64-bit hosts.
12647 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12648 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12649 * print.c (safe_debug_print, print_object): Likewise.
12650 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12651 to int.
6f04d126
PE
12652 Use pI instead of if-then-else-abort. Use %p to avoid casts,
12653 avoiding the 0 flag, which is not portable.
c2982e87
PE
12654 * process.c (Fmake_network_process): Use pI to avoid cast.
12655 * region-cache.c (pp_cache): Likewise.
12656 * xdisp.c (decode_mode_spec): Likewise.
12657 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12658 behavior on 64-bit hosts with printf arg.
6f04d126 12659 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
12660 (x_stop_queuing_selection_requests): Likewise.
12661 (x_get_window_property): Don't truncate byte count to an 'int'
12662 when tracing.
0b432f21 12663
5e073ec7
PE
12664 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12665 here, since it parses constructs like leading '-' and spaces,
12666 which are not wanted; and it overflows with large numbers.
12667 Instead, simply match F[0-9]+, which is what is wanted anyway.
12668
36372bf9
PE
12669 * alloc.c: Remove unportable assumptions about struct layout.
12670 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12671 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12672 (allocate_vectorlike, make_pure_vector): Use the new macros,
12673 plus offsetof, to remove unportable assumptions about struct layout.
12674 These assumptions hold on all porting targets that I know of, but
12675 they are not guaranteed, they're easy to remove, and removing them
12676 makes further changes easier.
12677
0b432f21
PE
12678 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12679 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
12680 (string_overrun_cookie): Now const. Use initializers that
12681 don't formally overflow signed char, to avoid warnings.
000098c1
PE
12682 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12683 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
12684 (allocate_buffer): Don't assume sizeof (struct buffer) is a
12685 multiple of sizeof (EMACS_INT); it need not be, if
12686 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 12687 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 12688
895009e1
JB
126892011-04-26 Juanma Barranquero <lekktu@gmail.com>
12690
12691 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
12692
6a7a1b0b
TZ
126932011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
12694
12695 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 12696 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
12697 Reported by Paul Eggert <eggert@cs.ucla.edu>.
12698
841a1577 126992011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
12700
12701 * lisp.h (Qdebug): List symbol.
895009e1 12702 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
12703 * keyboard.c (debug-on-event): New variable.
12704 (handle_user_signal): Break into debugger when debug-on-event
12705 matches the current signal symbol.
12706
f2d3ba6f
DN
127072011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
12708
12709 * alloc.c (check_sblock, check_string_bytes)
12710 (check_string_free_list): Convert to standard C.
12711
42ce4c63
TZ
127122011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
12713
12714 * w32.c (emacs_gnutls_push): Fix typo.
12715
825cd63c
EZ
127162011-04-25 Eli Zaretskii <eliz@gnu.org>
12717
fb11d64d
EZ
12718 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12719 "cast to pointer from integer of different size".
12720
825cd63c
EZ
12721 Improve doprnt and its use in verror. (Bug#8545)
12722 * doprnt.c (doprnt): Document the set of format control sequences
12723 supported by the function. Use SAFE_ALLOCA instead of always
12724 using `alloca'.
12725
12726 * eval.c (verror): Don't limit the buffer size at size_max-1, that
12727 is one byte too soon. Don't use xrealloc; instead xfree and
12728 xmalloc anew.
12729
e061a11b
TZ
127302011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
12731
12732 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12733 callbacks stage.
12734
12735 * gnutls.c: Renamed global_initialized to
12736 gnutls_global_initialized. Added internals for the
12737 :verify-hostname-error, :verify-error, and :verify-flags
12738 parameters of `gnutls-boot' and documented those parameters in the
12739 docstring. Start callback support.
9173deec
JB
12740 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
12741 unless a fatal error occurred. Call gnutls_alert_send_appropriate
12742 on error. Return error code.
e061a11b
TZ
12743 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12744 (emacs_gnutls_read): Likewise.
12745 (Fgnutls_boot): Return handshake error code.
12746 (emacs_gnutls_handle_error): New function.
12747 (wsaerror_to_errno): Likewise.
12748
12749 * w32.h (emacs_gnutls_pull): Add prototype.
12750 (emacs_gnutls_push): Likewise.
12751
12752 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12753 (emacs_gnutls_push): Likewise.
12754
127552011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
12756
12757 * process.c (wait_reading_process_output): Check if GnuTLS
12758 buffered some data internally if no FDs are set for TLS
12759 connections.
12760
12761 * makefile.w32-in (OBJ2): Add gnutls.$(O).
12762 (LIBS): Link to USER_LIBS.
12763 ($(BLD)/gnutls.$(0)): New target.
12764
fa6996bc
EZ
127652011-04-24 Eli Zaretskii <eliz@gnu.org>
12766
eb35682e
EZ
12767 * xdisp.c (handle_single_display_spec): Rename the
12768 display_replaced_before_p argument into display_replaced_p, to
12769 make it consistent with the commentary. Fix typos in the
12770 commentary.
12771
e2ad650c
EZ
12772 * textprop.c (syms_of_textprop): Remove dead code.
12773 (copy_text_properties): Delete obsolete commentary about an
12774 interface that was deleted long ago. Fix typos in the description
12775 of arguments.
12776
1b2de274
EZ
12777 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
12778 to changes in oldXMenu/XMenu.h from 2011-04-16.
12779 <menu_help_message, prev_menu_help_message>: Constify.
12780 (IT_menu_make_room): menu->help_text is now `const char **';
12781 adjust.
12782
12783 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12784 to changes in oldXMenu/XMenu.h from 2011-04-16.
12785 (struct XMenu): Declare `help_text' `const char **'.
12786
12787 * xfaces.c <Qunspecified>: Make extern again.
12788
12789 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 12790 required by POSIX.
1b2de274 12791
762b15be
EZ
12792 * doc.c (get_doc_string): Improve the format passed to `error'.
12793
12794 * doprnt.c (doprnt): Improve commentary.
12795
12796 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12797
12798 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12799 them with etags.
12800
f1052e5d
EZ
12801 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12802 changes in globals.h immediately force recompilation.
762b15be
EZ
12803 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12804 $(CURDIR)/s/ms-w32.h.
12805 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 12806
fa6996bc
EZ
12807 * character.c (Fchar_direction): Function deleted.
12808 (syms_of_character): Don't defsubr it.
12809 <char-direction-table>: Deleted.
12810
e6c3da20
EZ
128112011-04-23 Eli Zaretskii <eliz@gnu.org>
12812
12813 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12814 * doprnt.c: Include limits.h.
12815 (SIZE_MAX): New macro.
04f2d78b
CB
12816 (doprnt): Return a size_t value. 2nd arg is now size_t.
12817 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
12818 Improve overflow protection. Support `l' modifier for integer
12819 conversions. Support %l conversion. Don't assume an EMACS_INT
12820 argument for integer conversions and for %c.
12821
12822 * lisp.h (doprnt): Restore prototype.
12823
12824 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12825 $(SRC)/character.h.
12826
12827 * Makefile.in (base_obj): Add back doprnt.o.
12828
12829 * deps.mk (doprnt.o): Add back prerequisites.
12830 (callint.o): Depend on character.h.
12831
12832 * eval.c (internal_lisp_condition_case): Include the handler
12833 representation in the error message.
12834 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12835 when breaking from the loop.
12836
12837 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12838
12839 * callint.c (Fcall_interactively): When displaying error message
12840 about invalid control letter, pass the character's codepoint, not
12841 a pointer to its multibyte form. Improve display of the character
12842 in octal and display also its hex code.
12843
12844 * character.c (char_string): Use %x to display the (unsigned)
12845 codepoint of an invalid character, to avoid displaying a bogus
12846 negative value.
12847
12848 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12849 `error', not SYMBOL_NAME itself.
12850
12851 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12852 character arguments to `error'.
12853
12854 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12855 to `error' in error message about FINAL_CHAR argument. Make sure
12856 FINAL_CHAR is a character, and use %c when it is passed as
12857 argument to `error'.
12858
4ffd0d6b 128592011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
12860
12861 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12862
12863 * w32.c: Include <time.h>.
12864 (sys_localtime): New function.
12865
4ffd0d6b 128662011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
12867
12868 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12869
4ffd0d6b 12870 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 12871
4ffd0d6b 128722011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 12873
4ffd0d6b
GM
12874 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12875 zombies (Bug#8467).
aac0c6e3 12876
04c56954
EZ
128772011-04-19 Eli Zaretskii <eliz@gnu.org>
12878
12879 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12880 gl_state.e_property when gl_state.object is Qt.
12881
12882 * insdel.c (make_gap_larger): Remove limitation of buffer size
12883 to <= INT_MAX.
12884
16a43933
CY
128852011-04-18 Chong Yidong <cyd@stupidchicken.com>
12886
12887 * xdisp.c (lookup_glyphless_char_display)
12888 (produce_glyphless_glyph): Handle cons cell entry in
12889 glyphless-char-display.
12890 (Vglyphless_char_display): Document it.
12891
12892 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12893 glyphless-char-display.
12894
4581706e
CY
128952011-04-17 Chong Yidong <cyd@stupidchicken.com>
12896
12897 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12898
12899 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12900
12901 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12902 definition for no-X builds.
12903
4887c6e2 129042011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 12905
fd35b6f9
PE
12906 Static checks with GCC 4.6.0 and non-default toolkits.
12907
5c1ccb01
PE
12908 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12909
006c5daa
PE
12910 * process.c (keyboard_bit_set): Define only if SIGIO.
12911 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12912 (send_process): Repair possible setjmp clobbering.
12913
efc736d3
PE
12914 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12915
4e2fe2e6
PE
12916 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12917
f97334a2
PE
12918 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12919
4e75f29d
PE
12920 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12921 Define only if needed.
12922
90efadd1
PE
12923 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12924 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 12925 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 12926
3c647824
PE
12927 * dispextern.h (struct redisplay_interface): Rename param
12928 to avoid shadowing.
e264f262 12929 * termhooks.h (struct terminal): Likewise.
761383f4 12930 * xterm.c (xembed_send_message): Likewise.
3c647824 12931
b58c5c4a
PE
12932 * insdel.c (make_gap_smaller): Define only if
12933 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12934
cad59032
PE
12935 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12936 it.
12937
c339dc2e
PE
12938 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12939 so that we aren't warned about unused symbols.
12940
91a3e27b
PE
12941 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12942
399c71d3 12943 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 12944
8ffc96f5
PE
12945 * xfns.c (x_real_positions): Mark locals as initialized.
12946
eef9bc79
PE
12947 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12948
098db9dd
PE
12949 * xterm.c: Fix problems found by static analysis with other toolkits.
12950 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
12951 (x_dispatch_event): Declare static if USE_GTK, and
12952 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 12953 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 12954 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
12955 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12956 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 12957
eb18f6cc
PE
12958 * xmenu.c (menu_help_callback): Pointer type fixes.
12959 Use const pointers when pointing at readonly data. Avoid pointer
12960 signedness clashes.
12961 (FALSE): Remove unused macro.
12962 (update_frame_menubar): Remove unused decl.
12963
1fe72bf8
PE
12964 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12965
60d9e1db
PE
12966 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12967 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12968 (single_menu_item): Rename local to avoid shadowing.
12969
39261c26
PE
12970 * keyboard.c (make_lispy_event): Remove unused local var.
12971
018c5e19
PE
12972 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12973 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12974
63d2b86e
PE
12975 * bitmaps: Change bitmaps from unsigned char back to the X11
12976 compatible char. Avoid the old compiler warnings about
12977 out-of-range initializers by using, for example, '\xab' rather
12978 than 0xab.
12979
aefd87e1
PE
12980 * xgselect.c (xgselect_initialize): Check vs interface
12981 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12982
bf501fb9
PE
12983 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12984
e9829fdf
PE
12985 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12986 to read-only memory.
12987
1086c095
PE
12988 * fns.c (vector): Remove; this old hack is no longer needed.
12989
2baccd04 12990 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 12991 Remove unused var.
dde42981 12992 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 12993
72391843 12994 * xrdb.c (x_load_resources): Omit unused local.
3565b346 12995
436c16df 12996 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 12997 (x_window): Rename locals to avoid shadowing.
dc5ddd85 12998 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 12999
92bb796d 13000 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 13001 (x_term_init): Remove local to avoid shadowing.
92bb796d 13002
764430a3 13003 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
13004
13005 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13006 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13007
d1dfb56c
EZ
130082011-04-16 Eli Zaretskii <eliz@gnu.org>
13009
c4354cb4
EZ
13010 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13011
d1dfb56c
EZ
13012 Fix regex.c, syntax.c and friends for buffers > 2GB.
13013 * syntax.h (struct gl_state_s): Declare character position members
13014 EMACS_INT.
13015
13016 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13017
04f2d78b
CB
13018 * textprop.c (verify_interval_modification, interval_of):
13019 Declare arguments EMACS_INT.
d1dfb56c
EZ
13020
13021 * intervals.c (adjust_intervals_for_insertion): Declare arguments
13022 EMACS_INT.
13023
13024 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13025
13026 * indent.c (Fvertical_motion): Local variable it_start is now
13027 EMACS_INT.
13028
13029 * regex.c (re_match, re_match_2, re_match_2_internal)
13030 (bcmp_translate, regcomp, regexec, print_double_string)
13031 (group_in_compile_stack, re_search, re_search_2, regex_compile)
13032 (re_compile_pattern, re_exec): Declare arguments and local
13033 variables `size_t' and `ssize_t' and return values `regoff_t', as
13034 appropriate.
13035 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13036 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13037 <compile_stack_type>: `size' and `avail' are now `size_t'.
13038
13039 * regex.h <regoff_t>: Use ssize_t, not int.
13040 (re_search, re_search_2, re_match, re_match_2): Arguments that
13041 specify buffer/string position and length are now ssize_t and
13042 size_t. Return type is regoff_t.
13043
613052cd
BK
130442011-04-16 Ben Key <bkey76@gmail.com>
13045
13046 * nsfont.m: Fixed bugs in ns_get_family and
13047 ns_descriptor_to_entity that were caused by using free to
13048 deallocate memory blocks that were allocated by xmalloc (via
13049 xstrdup). This caused Emacs to crash when compiled with
13050 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
13051 --enable-checking=xmallocoverrun). xfree is now used to
13052 deallocate these memory blocks.
13053
4170f62f 130542011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 13055
71b41406
PE
13056 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
13057
9587a89d
PE
13058 emacs_write: Accept and return EMACS_INT for sizes.
13059 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
13060 et seq.
13061 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
13062 Accept and return EMACS_INT.
13063 (emacs_gnutls_write): Return the number of bytes written on
13064 partial writes.
13065 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
13066 (emacs_read, emacs_write): Remove check for negative size, as the
13067 Emacs source code has been audited now.
9587a89d
PE
13068 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
13069 (emacs_read, emacs_write): Use it.
273a5f82
PE
13070 * process.c (send_process): Adjust to the new signatures of
13071 emacs_write and emacs_gnutls_write. Do not attempt to store
13072 a byte offset into an 'int'; it might overflow.
9587a89d 13073 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 13074
3e047f51
PE
13075 * sound.c: Don't assume sizes fit in 'int'.
13076 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 13077 Return EMACS_INT, not int.
3e047f51 13078 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
13079 Accept EMACS_INT, not int.
13080 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
13081 record read return values.
13082
cc39a9db
BK
130832011-04-15 Ben Key <bkey76@gmail.com>
13084
c9d0ec6d
JB
13085 * keyboard.c (Qundefined): Don't declare static since it is used
13086 in nsfns.m.
13087 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
13088 static since they are used in nsfont.m.
cc39a9db 13089
6c60eb9f
SM
130902011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
13091
13092 * process.c (Qprocessp): Don't declare static.
13093 * lisp.h (Qprocessp): Declare again.
13094
7990b61a
JB
130952011-04-15 Juanma Barranquero <lekktu@gmail.com>
13096
13097 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
13098
5d4cb038
PE
130992011-04-14 Paul Eggert <eggert@cs.ucla.edu>
13100
8bd7b830 13101 Improve C-level modularity by making more things 'static'.
cd64ea1d 13102
e3b27b31
PE
13103 Don't publish debugger-only interfaces to other modules.
13104 * lisp.h (safe_debug_print, debug_output_compilation_hack):
13105 (verify_bytepos, count_markers): Move decls to the only modules
13106 that need them.
13107 * region-cache.h (pp_cache): Likewise.
13108 * window.h (check_all_windows): Likewise.
13109 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
13110
5d4cb038
PE
13111 * sysdep.c (croak): Now static, if
13112 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
13113 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
13114
13115 * alloc.c (refill_memory_reserve): Now static if
13116 !defined REL_ALLOC || defined SYSTEM_MALLOC.
13117 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 13118
e87b6180
PE
13119 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
13120 Define only if USE_LUCID.
13121
ac64929e
PE
13122 * xrdb.c (x_customization_string, x_rm_string): Now static.
13123
6f37259d
PE
13124 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
13125 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
13126
1683e3ab
PE
13127 * xdisp.c (draw_row_with_mouse_face): Now static.
13128 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
13129
de9c2632
PE
13130 * window.h (check_all_windows): Mark externally visible.
13131
2b96acb7
PE
13132 * window.c (window_deletion_count): Now static.
13133
13134 * undo.c: Make symbols static if they're not exported.
13135 (last_undo_buffer, last_boundary_position, pending_boundary):
13136 Now static.
13137
50436f33
PE
13138 * textprop.c (interval_insert_behind_hooks): Now static.
13139 (interval_insert_in_front_hooks): Likewise.
13140
64520e5c
PE
13141 * term.c: Make symbols static if they're not exported.
13142 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
13143 (max_frame_lines, tty_set_terminal_modes):
13144 (tty_reset_terminal_modes, tty_turn_off_highlight):
13145 (get_tty_terminal): Now static.
13146 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
13147 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 13148 HAVE_WINDOW_SYSTEM.
64520e5c
PE
13149 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
13150 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
13151
1fa53021
PE
13152 * sysdep.c: Make symbols static if they're not exported.
13153 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
13154 Now static.
13155 (sigprocmask_set, full_mask): Remove; unused.
13156 (wait_debugging): Mark as visible.
13157 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
13158 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
13159
d4b43b22
PE
13160 * syntax.c (syntax_temp): Define only if !__GNUC__.
13161
b7c513d0
PE
13162 * sound.c (current_sound_device, current_sound): Now static.
13163
989b29ad
PE
13164 * search.c (searchbufs, searchbuf_head): Now static.
13165
13a55a78
PE
13166 * scroll.c (scroll_cost): Remove; unused.
13167 * dispextern.h (scroll_cost): Remove decl.
13168
de68a1fc
PE
13169 * region-cache.h (pp_cache): Mark as externally visible.
13170
40ccffa6
PE
13171 * process.c: Make symbols static if they're not exported.
13172 (process_tick, update_tick, create_process, chan_process):
13173 (Vprocess_alist, proc_buffered_char, datagram_access):
13174 (fd_callback_data, send_process_frame, process_sent_to): Now static.
13175 (deactivate_process): Mark defn as static, as well as decl.
13176 * lisp.h (create_process): Remove decl.
13177 * process.h (chan_process, Vprocess_alist): Remove decls.
13178
ad64fc97
PE
13179 * print.c: Make symbols static if they're not exported.
13180 (print_depth, new_backquote_output, being_printed, print_buffer):
13181 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
13182 (print_interval, print_number_index, initial_stderr_stream):
13183 Now static.
13184 * lisp.h (Fprinc): Remove decl.
13185 (debug_output_compilation_hack): Mark as externally visible.
13186
adddb265
PE
13187 * sysdep.c (croak): Move decl from here to syssignal.h.
13188 * syssignal.h (croak): Put it here, so the API can be checked when
13189 'croak' is called from dissociate_if_controlling_tty.
13190
1717ede2
PE
13191 * minibuf.c: Make symbols static if they're not exported.
13192 (minibuf_save_list, choose_minibuf_frame): Now static.
13193 * lisp.h (choose_minibuf_frame): Remove decl.
13194
fa5fb2bc
PE
13195 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
13196
1e3890d1
PE
13197 * lread.c: Make symbols static if they're not exported.
13198 (read_objects, initial_obarray, oblookup_last_bucket_number):
13199 Now static.
13200 (make_symbol): Remove; unused.
13201 * lisp.h (initial_obarray, make_symbol): Remove decls.
13202
8a1414fa
PE
13203 * keyboard.c: Make symbols static if they're not exported.
13204 (single_kboard, recent_keys_index, total_keys, recent_keys):
13205 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
13206 (this_single_command_key_start, echoing, last_auto_save):
13207 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
13208 (command_loop, echo_now, keyboard_init_hook, help_char_p):
13209 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
13210 (Vlispy_mouse_stem, double_click_count):
13211 Now static.
13212 (force_auto_save_soon): Define only if SIGDANGER.
13213 (ignore_mouse_drag_p): Now static if
13214 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
13215 (print_help): Remove; unused.
13216 (stop_character, last_timer_event): Mark as externally visible.
13217 * keyboard.h (ignore_mouse_drag_p): Declare only if
13218 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
13219 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
13220 * lisp.h (echoing): Remove decl.
13221 (force_auto_save_soon): Declare only if SIGDANGER.
13222 * xdisp.c (redisplay_window): Simplify code, to make it more
13223 obvious that ignore_mouse_drag_p is not accessed if !defined
13224 USE_GTK && !defined HAVE_NS.
13225
93ea6e8f
PE
13226 * intervals.c: Make symbols static if they're not exported.
13227 (merge_properties_sticky, merge_interval_right, delete_interval):
13228 Now static.
13229 * intervals.h (merge_interval_right, delete_interval): Remove decls.
13230
77382fcc
PE
13231 * insdel.c: Make symbols static if they're not exported.
13232 However, leave prepare_to_modify_buffer alone. It's never
13233 called from outside this function, but that appears to be a bug.
13234 (combine_after_change_list, combine_after_change_buffer):
4889fc82 13235 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
13236 (adjust_after_replace_noundo): Remove; unused.
13237 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 13238 (signal_before_change): Remove decls.
77382fcc 13239
9306c32e
PE
13240 * indent.c (val_compute_motion, val_vmotion): Now static.
13241
cd44d2eb
PE
13242 * image.c: Make symbols static if they're not exported.
13243 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
13244 if USE_GTK.
13245 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
13246 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
13247
ad9a7a06
PE
13248 * fringe.c (standard_bitmaps): Now static.
13249 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
13250
81626931
PE
13251 * frame.c: Make symbols static if they're not exported.
13252 (x_report_frame_params, make_terminal_frame): Now static.
13253 (get_frame_param): Now static, unless HAVE_NS.
13254 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
13255 (x_get_resource_string): Remove; not used.
13256 * frame.h (make_terminal_frame, x_report_frame_params):
13257 (x_get_resource_string); Remove decls.
13258 (x_fullscreen_adjust): Declare only if WINDOWSNT.
13259 * lisp.h (get_frame_param): Declare only if HAVE_NS.
13260
239f9db9
PE
13261 * font.c, fontset.c: Make symbols static if they're not exported.
13262 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
13263 (FACE_SUITABLE_FOR_CHAR_P): Use it.
13264 * font.c (font_close_object): Now static.
13265 * font.h (font_close_object): Remove.
13266 * fontset.c (FONTSET_OBJLIST): Remove.
13267 (free_realized_fontset) #if-0 the body, which does nothing.
13268 (face_suitable_for_char_p): #if-0, as it's never called.
13269 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
13270 * xfaces.c (face_at_string_position):
13271 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
13272 since 0 is always ASCII.
13273
dfcf3579
PE
13274 * fns.c (weak_hash_tables): Now static.
13275
5045092b
PE
13276 * fileio.c: Make symbols static if they're not exported.
13277 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
13278 (Vwrite_region_annotation_buffers): Now static.
13279
57a96f5c
PE
13280 * eval.c: Make symbols static if they're not exported.
13281 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
13282 * lisp.h (backtrace_list): Remove decl.
13283
35f08c38
PE
13284 * emacs.c: Make symbols static if they're not exported.
13285 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
13286 (fatal_error_code, fatal_error_signal_hook, standard_args):
13287 Now static.
13288 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
13289 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
13290 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
13291 * lisp.h (fatal_error_signal_hook): Remove decl.
13292 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
13293
f44bd759
PE
13294 * editfns.c: Move a (normally-unused) function to its only use.
13295 * editfns.c, lisp.h (get_operating_system_release): Remove.
13296 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
13297 worth the hassle of breaking this out.
13298
b532497d
PE
13299 * xterm.c: Make symbols static if they're not exported.
13300 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
13301 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
13302 (x_destroy_window, x_delete_display):
13303 Now static.
13304 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
13305 (x_mouse_leave): Remove; unused.
13306 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
13307 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
13308 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
13309 Remove decls.
13310 (x_mouse_leave): Declare only if WINDOWSNT.
13311 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
13312 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
13313 USE_X_TOOLKIT.
13314
1675728f
PE
13315 * ftxfont.c: Make symbols static if they're not exported.
13316 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
13317 HAVE_FREETYPE.
13318 * font.h (ftxfont_driver): Likewise.
13319
e4cebfca
PE
13320 * xfns.c: Make symbols static if they're not exported.
13321 (x_last_font_name, x_display_info_for_name):
13322 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
13323 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
13324 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
13325 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
13326 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
13327 (last_show_tip_args): Now static.
13328 (xic_defaut_fontset, xic_create_fontsetname): Define only if
13329 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
13330 (x_screen_planes): Remove; unused.
13331 * dispextern.h (x_screen_planes): Remove decl.
13332
5bf46f05
PE
13333 * dispnew.c: Make symbols static if they're not exported.
13334 * dispextern.h (redraw_garbaged_frames, scrolling):
13335 (increment_row_positions): Remove.
13336 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
13337 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
13338 Now static.
13339 (redraw_garbaged_frames): Remove; unused.
13340
435f4c28
PE
13341 * xfaces.c: Make symbols static if they're not exported.
13342 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
13343 Remove decls.
13344 * xterm.h (defined_color): Remove decls.
13345 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
13346 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
13347 (menu_face_changed_default, defined_color, free_realized_face):
13348 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
13349 (ascii_face_of_lisp_face): Remove; unused.
13350
8524aef3
PE
13351 * xdisp.c: Make symbols static if they're not exported.
13352 * dispextern.h (scratch_glyph_row, window_box_edges):
13353 (glyph_to_pixel_coords, set_cursor_from_row):
13354 (get_next_display_element, set_iterator_to_next):
13355 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
13356 (show_mouse_face): Remove decls
13357 * frame.h (message_buf_print): Likewise.
13358 * lisp.h (pop_message, set_message, check_point_in_composition):
13359 Likewise.
13360 * xterm.h (set_vertical_scroll_bar): Likewise.
13361 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
13362 (message_buf_print, scratch_glyph_row, displayed_buffer):
13363 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
13364 (get_next_display_element, show_mouse_face, window_box_edges):
13365 (frame_to_window_pixel_xy, check_point_in_composition):
13366 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
13367 (glyph_to_pixel_coords): Remove; unused.
13368
16390cd2
PE
13369 * dired.c (file_name_completion): Now static.
13370
13371 * dbusbind.c (xd_in_read_queued_messages): Now static.
13372
a25f4dfa
PE
13373 * lisp.h (circular_list_error, FOREACH): Remove; unused.
13374 * data.c (circular_list_error): Remove.
13375
14a9c8df
PE
13376 * commands.h (last_point_position, last_point_position_buffer):
13377 (last_point_position_window): Remove decls.
13378 * keyboard.c: Make these variables static.
13379
04f2d78b
CB
13380 * coding.h (coding, code_convert_region, encode_coding_gap):
13381 Remove decls.
74ab6df5
PE
13382 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
13383 (iso_code_class, detect_coding, code_convert_region): Now static.
13384 (encode_coding_gap): Remove; unused.
13385
38dfbee1
PE
13386 * chartab.c (chartab_chars, chartab_bits): Now static.
13387
a2cb4e63
PE
13388 * charset.h (charset_iso_8859_1): Remove decl.
13389 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
13390 Now static.
13391
127198fd
PE
13392 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
13393 * ccl.c (Vccl_program_table): Now static.
13394 (check_ccl_update): Remove; unused.
13395
d85b608f
PE
13396 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
13397 * category.h: ... from here.
13398 * category.c (check_category_table, set_category_set): Now static.
13399
31cd66f3
PE
13400 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
13401 * lisp.h: Remove these decls.
13402
c358e587
PE
13403 * buffer.c (buffer_count): Remove unused var.
13404
e78aecca
PE
13405 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
13406 so that it's not optimized away.
13407 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
13408 * dispextern.h (bidi_dump_cached_states): Remove, since it's
13409 exported only to the debugger.
13410
e192d7d3 13411 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 13412 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 13413
92470028
PE
13414 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
13415 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
13416 was inaccessible from Lisp.
13417 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
13418 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
13419
244ed907
PE
13420 alloc.c: Import and export fewer symbols, and remove unused items.
13421 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
13422 is defined.
13423 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
13424 it's not optimized away by whole-program optimization.
13425 (message_enable_multibyte, free_misc): Remove.
13426 (catchlist, handlerlist, mark_backtrace):
13427 Declare only if BYTE_MARK_STACK.
13428 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
13429 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13430 (message_enable_multibyte): Remove decl.
13431 (free_misc, interval_free_list, float_block, float_block_index):
13432 (n_float_blocks, float_free_list, cons_block, cons_block_index):
13433 (cons_free_list, last_marked_index):
13434 Now static.
13435 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
13436 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
13437 (mark_backtrace): Define only if BYTE_MARK_STACK.
13438 * xdisp.c (message_enable_multibyte): Now static.
13439
61c2b50e 13440 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
13441 This makes it easier for human readers (and static analyzers)
13442 to see whether these variables are used from other modules.
13443 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
13444 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
13445 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
13446 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
13447 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
13448 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
13449 * xmenu.c, xselect.c:
13450 Declare Q* vars static if they are not used in other modules.
13451 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
13452 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
13453 Remove decls of unexported vars.
13454 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
13455
95c82688
PE
13456 * lisp.h (DEFINE_FUNC): Make sname 'static'.
13457
16a97296
PE
13458 Make Emacs functions such as Fatom 'static' by default.
13459 This makes it easier for human readers (and static analyzers)
13460 to see whether these functions can be called from other modules.
13461 DEFUN now defines a static function. To make the function external
13462 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
13463 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
13464 (Finit_image_library):
16a97296
PE
13465 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
13466 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
13467 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
13468 Remove decls, since these functions are now static.
13469 (Funintern, Fget_internal_run_time): New decls, since these functions
13470 were already external.
95c82688 13471
16a97296
PE
13472 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
13473 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
13474 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
13475 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
13476 * keyboard.c, keymap.c, lread.c:
13477 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
13478 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
13479 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
13480 Mark functions with DEFUE instead of DEFUN,
13481 if they are used in other modules.
13482 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
13483 decls for now-static functions.
13484 * buffer.h (Fdelete_overlay): Remove decl.
13485 * callproc.c (Fgetenv_internal): Mark as internal.
13486 * composite.c (Fremove_list_of_text_properties): Remove decl.
13487 (Fcomposition_get_gstring): New forward static decl.
13488 * composite.h (Fcomposite_get_gstring): Remove decl.
13489 * dired.c (Ffile_attributes): New forward static decl.
13490 * doc.c (Fdocumntation_property): New forward static decl.
13491 * eval.c (Ffetch_bytecode): New forward static decl.
13492 (Funintern): Remove extern decl; now in .h file where it belongs.
13493 * fileio.c (Fmake_symbolic_link): New forward static decl.
13494 * image.c (Finit_image_library): New forward static decl.
13495 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
13496 * intervals.h (Fprevious_property_change):
13497 (Fremove_list_of_text_properties): Remove decls.
13498 * keyboard.c (Fthis_command_keys): Remove decl.
13499 (Fcommand_execute): New forward static decl.
13500 * keymap.c (Flookup_key): New forward static decl.
13501 (Fcopy_keymap): Now static.
13502 * keymap.h (Flookup_key): Remove decl.
13503 * process.c (Fget_process): New forward static decl.
13504 (Fprocess_datagram_address): Mark as internal.
13505 * syntax.c (Fsyntax_table_p): New forward static decl.
13506 (skip_chars): Remove duplicate decl.
13507 * textprop.c (Fprevious_property_change): New forward static decl.
13508 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
13509 Now internal.
13510 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
13511 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
13512
785bbd42
PE
13513 * editfns.c (Fformat): Remove unreachable code.
13514
8b913b57
AS
135152011-04-14 Andreas Schwab <schwab@linux-m68k.org>
13516
13517 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
13518 change. (Bug#8496)
13519
a6744a35
EZ
135202011-04-13 Eli Zaretskii <eliz@gnu.org>
13521
13522 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
13523 when at ZV. (Bug#8487)
13524
e7974947
AS
135252011-04-12 Andreas Schwab <schwab@linux-m68k.org>
13526
baad03f0
AS
13527 * charset.c (Fclear_charset_maps): Use xfree instead of free.
13528 (Bug#8437)
13529 * keyboard.c (parse_tool_bar_item): Likewise.
13530 * sound.c (sound_cleanup, alsa_close): Likewise.
13531 * termcap.c (tgetent): Likewise.
13532 * xfns.c (x_default_font_parameter): Likewise.
13533 * xsettings.c (read_and_apply_settings): Likewise.
13534
e7974947
AS
13535 * alloc.c (overrun_check_malloc, overrun_check_realloc)
13536 (overrun_check_free): Protoize.
13537
28272684
PE
135382011-04-12 Paul Eggert <eggert@cs.ucla.edu>
13539
13540 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
13541 since callers should never pass a negative size.
13542 Change the signature to match that of plain 'read' and 'write'; see
13543 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
13544 * lisp.h: Update prototypes of emacs_write and emacs_read.
13545
11997c76
EZ
135462011-04-11 Eli Zaretskii <eliz@gnu.org>
13547
13548 * xdisp.c (redisplay_window): Don't try to determine the character
13549 position of the scroll margin if the window start point w->startp
e896f03c 13550 is outside the buffer's accessible region. (Bug#8468)
11997c76 13551
8a2cbd72
EZ
135522011-04-10 Eli Zaretskii <eliz@gnu.org>
13553
13554 Fix write-region and its subroutines for buffers > 2GB.
13555 * fileio.c (a_write, e_write): Modify declaration of arguments and
13556 local variables to support buffers larger than 2GB.
13557 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
13558
13559 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
13560 argument, local variables, and return value.
13561
13562 * lisp.h: Update prototypes of emacs_write and emacs_read.
13563
13564 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
13565
4073e537 135662011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 13567
1ebfdcb6
PE
13568 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
13569
b2ded58d
PE
13570 Fix more problems found by GCC 4.6.0's static checks.
13571
7d66342c
PE
13572 * xdisp.c (vmessage): Use a better test for character truncation.
13573
bbf47d44
PE
13574 * charset.c (load_charset_map): <, not <=, for optimization,
13575 and to avoid potential problems with integer overflow.
9248994d 13576 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 13577 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 13578 * editfns.c (Fformat): Likewise.
1e69125e 13579 * syntax.c (skip_chars): Likewise.
3befa583 13580
e3019616
PE
13581 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
13582 This also lets GCC 4.6.0 generate slightly better loop code.
13583
becfa255
PE
13584 * callint.c (Fcall_interactively): <, not <=, for optimization.
13585 (Fcall_interactively): Count the number of arguments produced,
13586 not the number of arguments given. This is simpler and lets GCC
13587 4.6.0 generate slightly better code.
13588
dae0cd48
PE
13589 * ftfont.c: Distingish more carefully between FcChar8 and char.
13590 The previous code passed unsigned char * to a functions like
13591 strlen and xstrcasecmp that expect char *, which does not
13592 conform to the C standard.
13593 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
13594 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
13595 char * when the C standard requires it.
13596
76032d70
PE
13597 * keyboard.c (read_char): Remove unused var.
13598
eb3f1cc8
PE
13599 * eval.c: Port to Windows vsnprintf (Bug#8435).
13600 Include <limits.h>.
13601 (SIZE_MAX): Define if the headers do not.
13602 (verror): Do not give up if vsnprintf returns a negative count.
13603 Instead, grow the buffer. This ports to Windows vsnprintf, which
13604 does not conform to C99. Problem reported by Eli Zaretskii.
13605 Also, simplify the allocation scheme, by avoiding the need for
13606 calling realloc, and removing the ALLOCATED variable.
13607
70476b54
PE
13608 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
13609
12020a9e
PE
13610 Remove invocations of doprnt, as Emacs now uses vsnprintf.
13611 But keep the doprint source code for now, as we might revamp it
13612 and use it again (Bug#8435).
ea6c7ae6
PE
13613 * lisp.h (doprnt): Remove.
13614 * Makefile.in (base_obj): Remove doprnt.o.
13615 * deps.mk (doprnt.o): Remove.
13616
5fdb398c
PE
13617 error: Print 32- and 64-bit integers portably (Bug#8435).
13618 Without this change, on typical 64-bit hosts error ("...%d...", N)
13619 was used to print both 32- and 64-bit integers N, which relied on
13620 undefined behavior.
61bdb816 13621 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
13622 * lisp.h (error, verror): Mark as printf-like functions.
13623 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13624 Report overflow in size calculations when allocating printf buffer.
13625 Do not truncate output string at its first null byte.
13626 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13627 Truncate the output at a character boundary, since vsnprintf does not
13628 do that.
13629 * charset.c (check_iso_charset_parameter): Convert internal
13630 character to string before calling 'error', since %c now has the
13631 printf meaning.
13632 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13633 overflow when computing char to be passed to 'error'. Do not
13634 pass Lisp_Object to 'error'; pass the integer instead.
13635 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13636 formatted with plain %d.
13637
b189fa66
PE
13638 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13639
bff87ef0
PE
13640 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13641
7e2cac20
PE
13642 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13643
ce4d90b5
PE
13644 * xterm.c (x_catch_errors): Remove duplicate declaration.
13645
266c9547
PE
13646 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13647
79c49ad2
PE
13648 * xdisp.c, lisp.h (message_nolog): Remove; unused.
13649
368f4090
JM
136502011-04-10 Jim Meyering <meyering@redhat.com>
13651
13652 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13653 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13654 return ssize_t not "int", and use size_t as the buffer length.
13655 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13656 * gnutls.h: Update declarations.
13657 * process.c (read_process_output): Use ssize_t, to match.
13658 (send_process): Likewise.
13659
a32d4040
CY
136602011-04-09 Chong Yidong <cyd@stupidchicken.com>
13661
13662 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13663
8546720e 136642011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 13665
04f2d78b
CB
13666 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13667 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 13668
8546720e
GM
13669 * xterm.c (handle_one_xevent):
13670 * xmenu.c (create_and_show_popup_menu):
13671 * xselect.c (x_decline_selection_request)
13672 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 13673
0a2f5c1a 136742011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
13675
13676 Fix some uses of `int' instead of EMACS_INT.
13677 * search.c (string_match_1, fast_string_match)
13678 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13679 (scan_buffer, find_next_newline_no_quit)
13680 (find_before_next_newline, search_command, Freplace_match)
13681 (Fmatch_data): Make some `int' variables be EMACS_INT.
13682
13683 * xdisp.c (display_count_lines): 3rd argument and return value now
13684 EMACS_INT. All callers changed.
13685 (pint2hrstr): Last argument is now EMACS_INT.
13686
13687 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13688 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13689 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13690 (decode_coding_utf_16, decode_coding_emacs_mule)
13691 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13692 (decode_coding_ccl, decode_coding_charset)
13693 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13694 (decode_coding_iso_2022, decode_coding_emacs_mule)
13695 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13696 <char_offset, last_offset>: Declare EMACS_INT.
13697 (encode_coding_utf_8, encode_coding_utf_16)
13698 (encode_coding_emacs_mule, encode_invocation_designation)
13699 (encode_designation_at_bol, encode_coding_iso_2022)
13700 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13701 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13702 Declare EMACS_INT.
13703 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13704 (encode_invocation_designation): Last argument P_NCHARS is now
13705 EMACS_INT.
13706 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13707 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13708
13709 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13710 All users changed.
13711
13712 * ccl.c (Fccl_execute_on_string): Declare some variables
13713 EMACS_INT.
13714
8546720e 137152011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
13716
13717 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13718
4e19a977
CS
137192011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
13720
13721 * process.c (Fformat_network_address): Doc fix.
13722
87302331
R
137232011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
13724
ee7683eb 13725 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 13726
cbb59342
CY
137272011-04-08 Chong Yidong <cyd@stupidchicken.com>
13728
13729 * keyboard.c (read_char): Call Lisp function help-form-show,
13730 instead of using internal_with_output_to_temp_buffer.
13731 (Qhelp_form_show): New var.
e0d38eeb 13732 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
13733
13734 * print.c (internal_with_output_to_temp_buffer): Function deleted.
13735
13736 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13737
e67a13ab
CY
137382011-04-06 Chong Yidong <cyd@stupidchicken.com>
13739
04f2d78b
CB
13740 * process.c (Flist_processes): Remove to Lisp.
13741 (list_processes_1): Delete.
e67a13ab 13742
973f782d
EZ
137432011-04-06 Eli Zaretskii <eliz@gnu.org>
13744
7c106b1e
EZ
13745 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13746
973f782d
EZ
13747 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13748
41cf7d1a 137492011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 13750
ca23cc88
PE
13751 Fix more problems found by GCC 4.6.0's static checks.
13752
f390e2d5
PE
13753 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13754
42eea0d0
PE
13755 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13756
b69769da 13757 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 13758
f9541e84
PE
13759 * xdisp.c (vmessage): Mark as a printf-like function.
13760
13841b55
PE
13761 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
13762
c136c10f
PE
13763 * sound.c (sound_warning): Don't crash if arg contains a printf format.
13764
5e2d4a30
PE
13765 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
13766 printf-like functions.
13767 (tiff_load): Add casts to remove these marks before passing them
13768 to system-supplied API.
13769
583f48b9
PE
13770 * eval.c (Fsignal): Remove excess argument to 'fatal'.
13771
b25d760e
PE
13772 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
13773 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
13774 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
13775 directly, rather than having caller test rule sign. This avoids
13776 some unnecessary tests.
13777 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
13778 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
13779 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 13780
bc7b6697 13781 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 13782 (xfont_open): Avoid unnecessary tests.
bc7b6697 13783
27ccc379
PE
13784 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13785
dcd5c89a
PE
13786 * composite.h, composite.c (composition_gstring_put_cache):
13787 Use EMACS_INT, not int, for length.
13788
b13a45c6
PE
13789 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13790 breaking out part of COMPOSITION_DECODE_RULE.
13791 (COMPOSITION_DECODE_RULE): Use it.
13792 * composite.c (get_composition_id): Remove unused local vars,
13793 by using the new macro.
13794
1e792e4d
PE
13795 * textprop.c (set_text_properties_1): Change while to do-while,
13796 since the condition is always true at first.
13797
dc6c6455 13798 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
13799 (interval_deletion_adjustment): Return unsigned value.
13800 All uses changed.
dc6c6455 13801
aba7731a
PE
13802 * process.c (list_processes_1, create_pty, read_process_output):
13803 (exec_sentinel): Remove vars that were set but not used.
afd4052b 13804 (create_pty): Remove unnecessary "volatile"s.
bc57d757 13805 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 13806 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 13807 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 13808
fdfc4bf3
PE
13809 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13810
fca8fe46 13811 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 13812 (update_syntax_table): Use unsigned instead of int.
fca8fe46 13813
06a0259a 13814 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 13815 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 13816 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 13817
e7b9e80f
PE
13818 * print.c (print_error_message): Avoid int overflow.
13819
56201685
PE
13820 * font.c (font_list_entities): Redo for clarity,
13821 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13822
78834453 13823 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 13824 (font_score): Avoid potential overflow in diff calculation.
78834453 13825
0bc0b309 13826 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 13827 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 13828
e610eaca
PE
13829 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13830
b895abce
PE
13831 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13832 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13833 can always succeed if overflow has undefined behavior.
13834
1f1d9321 13835 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 13836 (wordify): Omit three unnecessary tests.
1f1d9321 13837
c59478bc
PE
13838 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13839 All callers changed. This avoids the need for an unused var.
13840
79b73827
PE
13841 * casefiddle.c (casify_region): Remove var that is set but not used.
13842
a4db5dfe
PE
13843 * dired.c (file_name_completion): Remove var that is set but not used.
13844
43aae36e
PE
13845 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13846
2a47c44d 13847 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 13848 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 13849
a37c69bf
PE
13850 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13851 Check for integer overflow on size calculations.
13852
328ab8e7
PE
13853 * buffer.c (Fprevious_overlay_change): Remove var that is set
13854 but not used.
13855
e5a2a5cb
PE
13856 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13857 Remove vars that are set but not used.
8d84a6eb 13858 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 13859 (timer_check_2): Mark vars as initialized.
e5a2a5cb 13860
a60e5f68
PE
13861 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13862
f661cb61 13863 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 13864 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 13865
f0397f5a
PE
13866 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13867 that are set but not used.
13868
8664db06 13869 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 13870 if XCreateBitmapFromData fails (Bug#8410).
8664db06 13871
6abdaa4a
PE
13872 * xselect.c (x_get_local_selection, x_handle_property_notify):
13873 Remove vars that are set but not used.
13874
0ce7538d 13875 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 13876 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 13877
9ae848fc
PE
13878 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13879 Remove var that is set but not used.
0b918413
PE
13880 (scroll_bar_windows_size): Now size_t, not int.
13881 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13882 Check for overflow.
9ae848fc 13883
a5a62657
PE
13884 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13885 (map_tty_color) [!defined MSDOS]: Likewise.
13886
5c5cdd39
PE
13887 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13888
66ebf983
PE
13889 * coding.c: Remove vars that are set but not used.
13890 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13891 All callers changed.
13892 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13893 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13894 (decode_coding_charset): Remove vars that are set but not used.
13895
1be4d761
PE
13896 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13897 that is set but not used.
13898
47553fa8
PE
13899 * print.c (print_object): Remove var that is set but not used.
13900
1f7196bf 13901 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
13902 The gnulib version avoids calling malloc in the usual case,
13903 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13904 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13905 * filelock.c (current_lock_owner): Likewise.
13906 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13907 * sysdep.c: Include allocator.h, careadlinkat.h.
13908 (emacs_no_realloc_allocator): New static constant.
13909 (emacs_readlink): New function.
fdb61804
PE
13910 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13911 ../lib/careadlinkat.h.
d1fdcab7 13912
f84c17c7
SM
139132011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13914
13915 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13916 first non-nil return value).
13917
ef3862ad
JD
139182011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13919
13920 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13921 if not defined (Bug#8403).
13922
376a7006
JB
139232011-04-02 Juanma Barranquero <lekktu@gmail.com>
13924
13925 * xdisp.c (display_count_lines): Remove parameter `start',
13926 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13927 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13928 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13929 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13930 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13931 and thereabouts. All callers changed.
13932 (get_per_char_metric): Remove parameter `f', unused since
13933 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13934
6ca3801d
JM
139352011-04-02 Jim Meyering <meyering@redhat.com>
13936
13937 do not dereference NULL upon failed strdup
13938 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13939 (ns_get_family): Likewise.
13940
d8e2b5ba
JB
139412011-04-02 Juanma Barranquero <lekktu@gmail.com>
13942
13943 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13944
8c74fcbd
JD
139452011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13946
13947 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13948 later (Bug#8403).
13949
7200d79c
SM
139502011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13951
03408648 13952 Add lexical binding.
7200d79c 13953
03408648
SM
13954 * window.c (Ftemp_output_buffer_show): New fun.
13955 (Fsave_window_excursion):
13956 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13957
13958 * lread.c (lisp_file_lexically_bound_p): New function.
13959 (Fload): Bind Qlexical_binding.
13960 (readevalloop): Remove `evalfun' arg.
13961 Bind Qinternal_interpreter_environment.
13962 (Feval_buffer): Bind Qlexical_binding.
13963 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13964 Mark as dynamic.
13965 (syms_of_lread): Declare `lexical-binding'.
13966
13967 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13968
13969 * keyboard.c (eval_dyn): New fun.
13970 (menu_item_eval_property): Use it.
ca105506
SM
13971
13972 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 13973
03408648
SM
13974 * fns.c (concat, mapcar1): Accept byte-code-functions.
13975
13976 * eval.c (Fsetq): Handle lexical vars.
13977 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13978 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13979 (FletX, Flet): Obey lexical binding.
13980 (Fcommandp): Handle closures.
13981 (Feval): New `lexical' arg.
13982 (eval_sub): New function extracted from Feval. Use it almost
13983 everywhere where Feval was used. Look up vars in lexical env.
13984 Handle closures.
13985 (Ffunctionp): Move from subr.el.
13986 (Ffuncall): Handle closures.
13987 (apply_lambda): Remove `eval_flags'.
13988 (funcall_lambda): Handle closures and new byte-code-functions.
13989 (Fspecial_variable_p): New function.
13990 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13991 but without exporting it to Lisp.
23aba0ea 13992
23aba0ea 13993 * doc.c (Fdocumentation, store_function_docstring):
03408648 13994 * data.c (Finteractive_form): Handle closures.
23aba0ea 13995
03408648
SM
13996 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13997 interactive spec.
ba83908c 13998
04f2d78b
CB
13999 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14000 New byte-codes.
03408648
SM
14001 (exec_byte_code): New function extracted from Fbyte_code to handle new
14002 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 14003
03408648 14004 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 14005
03408648 14006 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 14007
e2abce01
JB
140082011-03-31 Juanma Barranquero <lekktu@gmail.com>
14009
14010 * xdisp.c (redisplay_internal): Fix prototype.
14011
63696a73 140122011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 14013
63696a73 14014 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
14015 (try_scrolling): Use it when setting scroll_limit.
14016 Limit scrolling to 100 screen lines.
63696a73
EZ
14017 (redisplay_window): Even when falling back on "recentering",
14018 position point in the window according to scroll-conservatively,
14019 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
14020
14021 (try_scrolling): When point is above the window, allow searching
14022 as far as scroll_max, or one screenful, to compute vertical
14023 distance from PT to the scroll margin position. This prevents
14024 try_scrolling from unnecessarily failing when
14025 scroll-conservatively is set to a value slightly larger than the
14026 window height. Clean up the case of PT below the margin at bottom
14027 of window: scroll_max can no longer be INT_MAX. When aggressive
14028 scrolling is in use, don't let point enter the opposite scroll
14029 margin as result of the scroll.
14030 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
14031 threshold of 100 lines for never-recentering scrolling.
14032
e4cc2dfc
JB
140332011-03-31 Juanma Barranquero <lekktu@gmail.com>
14034
14035 * dispextern.h (move_it_by_lines):
14036 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14037 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
14038 (message_log_check_duplicate): Remove parameters `prev_bol' and
14039 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14040 (redisplay_internal): Remove parameter `preserve_echo_area',
14041 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
14042
14043 * indent.c (Fvertical_motion):
14044 * window.c (window_scroll_pixel_based, Frecenter):
14045 Don't pass `need_y_p' to `move_it_by_lines'.
14046
1c470562
SM
140472011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
14048
44f230aa
SM
14049 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
14050 steal a few bits to be more compact.
14051 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
14052 Remove unneeded casts.
14053
1c470562
SM
14054 * bytecode.c (Fbyte_code): CAR and CDR can GC.
14055
888adce9
ZK
140562011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
14057
14058 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
14059 binding" message (bug#7967).
14060
f838ed7b
PE
140612011-03-30 Paul Eggert <eggert@cs.ucla.edu>
14062
77861b95
PE
14063 Fix more problems found by GCC 4.6.0's static checks.
14064
de6dbc14
PE
14065 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
14066 Remove unused local var.
14067
f838ed7b
PE
14068 * editfns.c (Fmessage_box): Remove unused local var.
14069
792c7b2b
PE
14070 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
14071 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14072 Omit unused local vars.
c499e557 14073 * window.c (shrink_windows): Omit unused local var.
b01a1c29 14074 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
14075 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
14076 Omit unused local var.
14077
ba0165e1
PE
14078 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
14079 Don't assume string length fits in int.
32ad8845 14080 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 14081 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 14082
3c59b4c9
PE
14083 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
14084 instead of alloca (Bug#8344).
14085
a3eed478 14086 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 14087 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 14088
eb4d412d
PE
14089 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
14090
1658b401
PE
14091 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
14092 concerns.
14093
14094 * term.c (produce_glyphless_glyph): Remove unnecessary test.
14095
14096 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 14097
9a2c6e05
PE
14098 * keyboard.c (syms_of_keyboard): Use the same style as later
14099 in this function when indexing through an array. This also
14100 works around GCC bug 48267.
14101
03d0a109
PE
14102 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
14103
44f730c8
PE
14104 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
14105
fe75f926
PE
14106 * chartab.c (sub_char_table_ref_and_range): Redo for slight
14107 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
14108
ffa8c828
PE
14109 * keyboard.c, keyboard.h (num_input_events): Now size_t.
14110 This avoids undefined behavior on integer overflow, and is a bit
14111 more convenient anyway since it is compared to a size_t variable.
14112
c5101a77
PE
14113 Variadic C functions now count arguments with size_t, not int.
14114 This avoids an unnecessary limitation on 64-bit machines, which
14115 caused (substring ...) to crash on large vectors (Bug#8344).
14116 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
14117 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 14118 All variadic functions and their callers changed accordingly.
c5101a77
PE
14119 (struct gcpro.nvars): Now size_t, not int. All uses changed.
14120 * data.c (arith_driver, float_arith_driver): Likewise.
14121 * editfns.c (general_insert_function): Likewise.
14122 * eval.c (struct backtrace.nargs, interactive_p)
14123 (internal_condition_case_n, run_hook_with_args, apply_lambda)
14124 (funcall_lambda, mark_backtrace): Likewise.
14125 * fns.c (concat): Likewise.
14126 * frame.c (x_set_frame_parameters): Likewise.
14127 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
14128 0 if not found, not -1. All callers changed.
14129
dd3f25f7
PE
14130 * alloc.c (garbage_collect): Don't assume stack size fits in int.
14131 (stack_copy_size): Now size_t, not int.
14132 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
14133
461c2ab9
JB
141342011-03-28 Juanma Barranquero <lekktu@gmail.com>
14135
14136 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
14137 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14138 All callers changed.
14139
14140 * lisp.h (multibyte_char_to_unibyte):
14141 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
14142 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14143 * character.h (CHAR_TO_BYTE8):
14144 * cmds.c (internal_self_insert):
14145 * editfns.c (general_insert_function):
14146 * keymap.c (push_key_description):
14147 * search.c (Freplace_match):
14148 * xdisp.c (message_dolog, set_message_1): All callers changed.
14149
f6d62986
SM
141502011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14151
14152 * keyboard.c (safe_run_hook_funcall): New function.
14153 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
14154 don't set the hook to nil, but remove the offending function instead.
14155 (Qcommand_hook_internal): Remove, unused.
14156 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
14157 Vcommand_hook_internal.
14158
14159 * eval.c (enum run_hooks_condition): Remove.
14160 (funcall_nil, funcall_not): New functions.
14161 (run_hook_with_args): Call each function through a `funcall' argument.
14162 Remove `cond' argument, now redundant.
14163 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
14164 (Frun_hook_with_args_until_failure): Adjust accordingly.
14165 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
14166
1db5b1ad
JB
141672011-03-28 Juanma Barranquero <lekktu@gmail.com>
14168
14169 * dispextern.h (string_buffer_position): Remove declaration.
14170
14171 * print.c (strout): Remove parameter `multibyte', unused since
14172 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
14173
14174 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
14175 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
14176 All callers changed.
14177
14178 * w32.c (_wsa_errlist): Use braces for struct initializers.
14179
14180 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
14181 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
14182 All callers changed.
14183 (string_buffer_position): Likewise. Also, make static (it's never
14184 used outside xdisp.c).
14185 (cursor_row_p): Remove parameter `w', unused since
14186 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
14187 (decode_mode_spec): Remove parameter `precision', introduced during
14188 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
14189 All callers changed.
14190
5ffb62aa
JD
141912011-03-27 Jan Djärv <jan.h.d@swipnet.se>
14192
14193 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
14194
461c2ab9 141952011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
14196
14197 * nsterm.m (ns_menu_bar_is_hidden): New variable.
14198 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
14199 (ns_update_auto_hide_menu_bar): New functions.
14200 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
14201 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
14202 ns_constrain_all_frames.
14203 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
14204 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
14205
5c380ffb
JD
142062011-03-27 Jan Djärv <jan.h.d@swipnet.se>
14207
14208 * nsmenu.m (runDialogAt): Remove argument to timer_check.
14209
9af30bdf
GM
142102011-03-27 Glenn Morris <rgm@gnu.org>
14211
14212 * syssignal.h: Replace RETSIGTYPE with void.
14213 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
14214 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
14215 Replace SIGTYPE with void everywhere.
14216 * s/usg5-4-common.h (SIGTYPE): Remove definition.
14217 * s/template.h (SIGTYPE): Remove commented out definition.
14218
e2abce01
JB
142192011-03-26 Eli Zaretskii <eliz@gnu.org>
14220
14221 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
14222 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
14223
f868cd8a
JB
142242011-03-26 Juanma Barranquero <lekktu@gmail.com>
14225
59eb0929
JB
14226 * w32.c (read_unc_volume): Use parameter `henum', instead of
14227 global variable `wget_enum_handle'.
14228
14229 * keymap.c (describe_vector): Remove parameters `indices' and
14230 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
14231 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
14232
f868cd8a
JB
14233 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
14234
14235 * keyboard.c (timer_check): Remove parameter `do_it_now',
14236 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
14237 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
14238 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
14239
14240 * keyboard.c (read_char):
14241 * w32menu.c (w32_menu_display_help):
14242 * xmenu.c (show_help_event, menu_help_callback):
14243 Adjust calls to `show_help_echo'.
14244
14245 * gtkutil.c (xg_maybe_add_timer):
14246 * keyboard.c (readable_events):
14247 * process.c (wait_reading_process_output):
14248 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
14249
14250 * insdel.c (adjust_markers_gap_motion):
14251 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
14252 (gap_left, gap_right): Don't call it.
14253
2ecf6fdb
CY
142542011-03-25 Chong Yidong <cyd@stupidchicken.com>
14255
14256 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
14257 incurred during fontification.
14258
6b1f9ba4
JB
142592011-03-25 Juanma Barranquero <lekktu@gmail.com>
14260
14261 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
14262 (DEFVAR_PER_BUFFER): Don't pass it.
14263
14264 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
14265 (scrolling_window): Don't pass it.
14266
0f4a96b5
JB
142672011-03-25 Juanma Barranquero <lekktu@gmail.com>
14268
14269 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
14270
14271 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
14272 and `suffix'.
14273 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
14274 of variables specific to SELinux and computation of `encoded_absname'.
14275
14276 * image.c (XPutPixel): Remove unused variable `height'.
14277
14278 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
14279
14280 * unexw32.c (get_section_info): Remove unused variable `section'.
14281
14282 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
14283 (system_process_attributes): Remove unused variable `sess'.
14284 (sys_read): Remove unused variable `err'.
14285
14286 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
14287 (w32_wnd_proc): Remove unused variable `isdead'.
14288 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
14289 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
14290 (x_create_tip_frame): Remove unused variable `tem'.
14291
14292 * w32inevt.c (w32_console_read_socket):
14293 Remove unused variable `no_events'.
14294
14295 * w32term.c (x_draw_composite_glyph_string_foreground):
14296 Remove unused variable `width'.
14297
1149507c
JB
142982011-03-24 Juanma Barranquero <lekktu@gmail.com>
14299
14300 * w32term.c (x_set_glyph_string_clipping):
14301 Don't pass uninitialized region to CombineRgn.
14302
9c88f339
JB
143032011-03-23 Juanma Barranquero <lekktu@gmail.com>
14304
14305 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
14306 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
14307 (Fx_close_connection): Remove unused variable `i'.
14308
14309 * w32font.c (w32font_draw): Return number of glyphs.
14310 (w32font_open_internal): Remove unused variable `i'.
14311 (w32font_driver): Add missing initializer.
14312
14313 * w32menu.c (utf8to16): Remove unused variable `utf16'.
14314 (fill_in_menu): Remove unused variable `items_added'.
14315
14316 * w32term.c (last_mouse_press_frame): Remove static global variable.
14317 (w32_clip_to_row): Remove unused variable `f'.
14318 (x_delete_terminal): Remove unused variable `i'.
14319
14320 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
14321 (NOTHING): Remove unused static global variable.
14322 (uniscribe_check_otf): Remove unused variable `table'.
14323 (uniscribe_font_driver): Add missing initializers.
14324
dee091a3
JD
143252011-03-23 Julien Danjou <julien@danjou.info>
14326
14327 * term.c (Fsuspend_tty, Fresume_tty):
14328 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
14329 * window.c (temp_output_buffer_show):
14330 * insdel.c (signal_before_change):
14331 * frame.c (Fhandle_switch_frame):
14332 * fileio.c (Fdo_auto_save):
14333 * emacs.c (Fkill_emacs):
14334 * editfns.c (save_excursion_restore):
14335 * cmds.c (internal_self_insert):
14336 * callint.c (Fcall_interactively):
14337 * buffer.c (Fkill_all_local_variables):
14338 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
14339 Use Frun_hooks.
0f4a96b5 14340 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 14341 unconditionally since it does the check itself.
dee091a3 14342
2c520ab5 143432011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 14344
c9c49752
PE
14345 Fix more problems found by GCC 4.5.2's static checks.
14346
8abc3f12
PE
14347 * coding.c (encode_coding_raw_text): Avoid unnecessary test
14348 the first time through the loop, since we know p0 < p1 then.
14349 This also avoids a gcc -Wstrict-overflow warning.
14350
a2d26660
PE
14351 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
14352 leading to a memory leak, possible in functions like
14353 load_charset_map_from_file that can allocate an unbounded number
b12ef411 14354 of objects (Bug#8318).
a2d26660 14355
916c72e9
PE
14356 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
14357 that could (at least in theory) be that large.
14358
19ab8a18
PE
14359 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
14360 This is less likely to overflow, and avoids undefined behavior if
14361 overflow does occur. All callers changed. Use strtoul to scan
14362 for the unsigned long integer.
b7cbbd6f
PE
14363 (pint2hrstr): Simplify and tune code slightly.
14364 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 14365
f0641eff
PE
14366 * scroll.c (do_scrolling): Work around GCC bug 48228.
14367 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
14368
7f650bb9
PE
14369 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
14370 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
14371 (validate_x_resource_name): Simplify count usage.
14372 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 14373
37dd57d1
PE
14374 * fileio.c (Fcopy_file): Report error if fchown or fchmod
14375 fail (Bug#8306).
81e56e61 14376
699979fc 14377 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 14378
401bf9b4
PE
14379 * process.c (Fmake_network_process): Use socklen_t, not int,
14380 where POSIX says socklen_t is required in portable programs.
14381 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 14382 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
14383 (Fmake_network_process, server_accept_connection):
14384 (wait_reading_process_output, read_process_output):
14385 Likewise.
14386
b93aacde
PE
14387 * process.c: Rename or move locals to avoid shadowing.
14388 (list_processes_1, Fmake_network_process):
14389 (read_process_output_error_handler, exec_sentinel_error_handler):
14390 Rename or move locals.
4dc343ee 14391 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 14392 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 14393 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 14394 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 14395 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 14396
af8a867c 14397 Make tparam.h and terminfo.c consistent.
44f230aa
SM
14398 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
14399 Include tparam.h instead, since it declares them.
af8a867c
PE
14400 * cm.h (PC): Remove extern decl; tparam.h now does this.
14401 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
14402 * terminfo.c: Include tparam.h, to check interfaces.
14403 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
14404 (tparam): Adjust signature to match interface in tparam.h;
14405 this removes some undefined behavior. Check that outstring and len
14406 are zero, which they always are with Emacs.
14407 * tparam.h (PC, BC, UP): New extern decls.
14408
0248044d 14409 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 14410 (xftfont_open): Rename locals to avoid shadowing.
0248044d 14411
8ff096c1 14412 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
14413 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
14414 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 14415 (ftfont_list): Remove unused local.
49eaafba
PE
14416 (get_adstyle_property, ftfont_pattern_entity):
14417 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
14418 Rename locals to avoid shadowing.
8ff096c1 14419
e2be39f6
PE
14420 * xfont.c (xfont_list_family): Mark var as initialized.
14421
c9735e30
PE
14422 * xml.c (make_dom): Now static.
14423
8f5201ae
PE
14424 * composite.c (composition_compute_stop_pos): Rename local to
14425 avoid shadowing.
b246f932
PE
14426 (composition_reseat_it): Remove unused locals.
14427 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 14428 (composition_update_it): Mark var as initialized.
11b61122
PE
14429 (find_automatic_composition): Mark vars as initialized,
14430 with a FIXME (Bug#8290).
8f5201ae 14431
760fbc2c
PE
14432 character.h: Rename locals to avoid shadowing.
14433 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
14434 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
14435 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
14436 (BUF_DEC_POS): Be more systematic about renaming local temporaries
14437 to avoid shadowing.
14438
ff08eb85
PE
14439 * textprop.c (property_change_between_p): Remove; unused.
14440
fc7bf025
PE
14441 * intervals.c (interval_start_pos): Now static.
14442
235d7abc
PE
14443 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
14444
44f230aa
SM
14445 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
14446 Rename locals to avoid shadowing.
3e7d6594 14447
50060332
PE
14448 * sound.c (wav_play, au_play, Fplay_sound_internal):
14449 Fix pointer signedness.
d01f234b 14450 (alsa_choose_format): Remove unused local var.
c83b8872
PE
14451 (wav_play): Initialize a variable to 0, to prevent undefined
14452 behavior (Bug#8278).
50060332 14453
c4fc4e30
PE
14454 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
14455
918436ed
PE
14456 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
14457
c939f91b
PE
14458 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
14459 clobbering (Bug#8298).
b9c7f648
PE
14460 * sysdep.c (sys_subshell): Likewise.
14461 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 14462
6bd8c144
PE
14463 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
14464 This should get cleaned up, so that child_setup has the
14465 same signature on all platforms.
14466
7710357c 14467 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 14468 (relocate_fd): Rename locals to avoid shadowing.
7710357c 14469
c59da222
CY
144702011-03-22 Chong Yidong <cyd@stupidchicken.com>
14471
14472 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
14473 not to be necessary, and produces flickering.
14474
66b87493
GM
144752011-03-20 Glenn Morris <rgm@gnu.org>
14476
14477 * config.in: Remove file.
14478
45b6f6d5
JB
144792011-03-20 Juanma Barranquero <lekktu@gmail.com>
14480
14481 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
14482 are now in src/globals.h.
14483 (syms_of_minibuf): Remove spurious & from previous change.
14484
cd394be1 144852011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
14486
14487 * minibuf.c (completing-read-function): New variable.
14488 (completing-read-default): Rename from completing-read.
14489 (completing-read): Call completing-read-function.
14490
b14e3e21
CY
144912011-03-19 Juanma Barranquero <lekktu@gmail.com>
14492
14493 * xfaces.c (Fx_load_color_file):
14494 Read color file from absolute filename (bug#8250).
14495
f2b726e6
JB
144962011-03-19 Juanma Barranquero <lekktu@gmail.com>
14497
14498 * makefile.w32-in: Update dependencies.
14499
09f6ff02
EZ
145002011-03-17 Eli Zaretskii <eliz@gnu.org>
14501
14502 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
14503
29a6015a
PE
145042011-03-17 Paul Eggert <eggert@cs.ucla.edu>
14505
a3a6c54e
PE
14506 Fix more problems found by GCC 4.5.2's static checks.
14507
b766f867
PE
14508 * process.c (make_serial_process_unwind, send_process_trap):
14509 (sigchld_handler): Now static.
14510
be02381c
PE
14511 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
14512 That way, the code declares only the vars that it needs.
14513 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
14514 * s/cygwin.h (PTY_ITERATION): Likewise.
14515 * s/darwin.h (PTY_ITERATION): Likewise.
14516 * s/gnu-linux.h (PTY_ITERATION): Likewise.
14517
57048744
PE
14518 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
14519 * process.c (allocate_pty): Don't declare stb unless it's needed.
14520
7914961c 14521 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
14522 (CONSTANTLIM): Remove; unused.
14523 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
14524 Define only if needed.
7914961c 14525
b3967b18
PE
14526 * unexelf.c (unexec): Name an expression,
14527 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
14528 Use a different way to cause a compilation error if anyone uses
14529 n rather than nn, a way that does not involve shadowing.
73366a00 14530 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 14531
29a6015a
PE
14532 * deps.mk (unexalpha.o): Remove; unused.
14533
43cfc33e 14534 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 14535 * unexec.h: New file.
ce701a33
PE
14536 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
14537 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
14538 Depend on unexec.h.
14539 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
14540 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
14541 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 14542 Change as necessary to match prototype in unexec.h.
ce701a33 14543
01f44d5a
PE
14544 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
14545 shadowing.
4f63c6bb 14546 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 14547
a6670b0b
PE
14548 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
14549 Rename locals to avoid shadowing.
14550
cef2010d 14551 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 14552 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 14553
d4d7173a
PE
14554 * print.c (Fredirect_debugging_output): Fix pointer signedess.
14555
f08b802a
PE
14556 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
14557 warning when compiling print.c.
14558
3ddb0639
PE
14559 * font.c (font_unparse_fcname): Abort in an "impossible" situation
14560 instead of using an uninitialized var.
5ad03b97 14561 (font_sort_entities): Mark var as initialized.
3ddb0639 14562
170a2692
PE
14563 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
14564
e663c700
PE
14565 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
14566 pointers to constants.
89bc529a 14567 (font_parse_fcname): Remove unused vars.
7b81e2d0 14568 (font_delete_unmatched): Now static.
ea838e10 14569 (font_get_spec): Remove; unused.
13a547c6
PE
14570 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
14571 (font_update_drivers, Ffont_get_glyphs, font_add_log):
14572 Rename or move locals to avoid shadowing.
e663c700 14573
2a80c887 14574 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 14575 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 14576
1384fa33 14577 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 14578 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 14579
8b2c52e9
PE
14580 * alloc.c (mark_backtrace): Move decl from here ...
14581 * lisp.h: ... to here, so that it can be checked.
14582
475545b5 14583 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 14584 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
14585 (lisp_indirect_variable): Name an expression,
14586 to avoid gcc -Wbad-function-cast warning.
1faed8ae 14587 (Fdefvar): Rename locals to avoid shadowing.
475545b5 14588
b1349114 14589 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 14590 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 14591 Use const pointer when appropriate.
b1349114 14592
a2928364
PE
14593 * lisp.h (get_system_name, get_operating_system_release):
14594 Move decls here, to check interfaces.
14595 * process.c (get_operating_system_release): Move decl to lisp.h.
14596 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
14597 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
14598 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
14599 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
14600 (Fformat_time_string, Fencode_time, Finsert_char):
14601 (Ftranslate_region_internal, Fformat):
14602 Rename or remove local vars to avoid shadowing.
9710023e 14603 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 14604
a415e694
PE
14605 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
14606 avoid shadowing.
14607
8ef4622d
PE
14608 * lisp.h (eassert): Check that the argument compiles, even if
14609 ENABLE_CHECKING is not defined.
14610
946f9a5b
PE
14611 * data.c (Findirect_variable): Name an expression, to avoid
14612 gcc -Wbad-function-cast warning.
112396d6 14613 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 14614 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
14615 (Fmake_variable_buffer_local, Fmake_local_variable):
14616 Mark variables as initialized.
52746918 14617 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 14618
e5aab7e7 14619 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
14620 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14621 Rename locals to avoid shadowing.
dff45157
PE
14622 (mark_stack): Move local variables into the #ifdef region where
14623 they're used.
7bc26fdb
PE
14624 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14625 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14626 needed otherwise.
14627 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14628 (GC_STRING_CHARS): Remove; not used.
d40d4be1 14629 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 14630
e5aab7e7
PE
14631 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14632 avoids undefined behavior in theory.
14633
4da60324
PE
14634 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14635
88043301
PE
14636 Use functions, not macros, for up- and down-casing (Bug#8254).
14637 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14638 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
14639 to use the following functions instead of these macros.
14640 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
14641 EMACS_INT, since callers assume the returned value fits in int.
14642 (upcase1): Likewise, for UPCASE_TABLE.
14643 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 14644 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 14645 the race-condition problem in the old DOWNCASE.
88043301 14646
19ed5445
PE
14647 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14648 Rename locals to avoid shadowing.
14649 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
14650 (regex_compile, re_search_2, re_match_2_internal):
14651 Remove unused local vars.
952db0d7
PE
14652 (FREE_VAR): Rewrite so as not to use empty "else",
14653 which gcc can warn about.
da053e48 14654 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
14655 (RETALLOC_IF): Define only if needed.
14656 (WORDCHAR_P): Likewise. This one is never needed, but is used
14657 only in a comment talking about a compiler bug, so put inside
14658 the #if 0 of that comment.
14659 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14660 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14661 Remove; unused.
19ed5445 14662
1f3561e4 14663 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
14664 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14665 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 14666
ded6f8f7
PE
14667 * search.c (simple_search): Remove unused var.
14668
dbd37a95
PE
14669 * dired.c (compile_pattern): Move decl from here ...
14670 * lisp.h: ... to here, so that it can be checked.
14671 (struct re_registers): New forward decl.
14672
7e47afad
PE
14673 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14674
85f24f61
PE
14675 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14676 All uses changed.
14677 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14678 Rename locals to avoid shadowing.
5671df8f 14679 (Fvertical_motion): Mark locals as initialized.
85f24f61 14680
181aa2be 14681 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 14682 (casify_region): Mark local as initialized.
181aa2be 14683
930d429c
PE
14684 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14685
7082eac6
PE
14686 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14687 New macros, so that the caller can use some names other than
14688 gcpro1, gcpro2, etc.
14689 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14690 of the new macros.
14691 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14692 argument, for consistency with GCPRO2_VAR, etc: it is now the
14693 prefix of the variable, not the variable itself. All uses
14694 changed.
38b2c076
PE
14695 * dired.c (directory_files_internal, file_name_completion):
14696 Rename locals to avoid shadowing.
14697
15206ed9
PE
14698 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14699 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14700 dired.c's scmp function, had undefined behavior.
14701 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14702 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14703 * buffer.h: ... to here, because these macros use current_buffer,
14704 and the new implementation with inline functions needs to have
14705 current_buffer in scope now, rather than later when the macros
14706 are used.
14707 (downcase, upcase1): New static inline functions.
14708 (DOWNCASE, UPCASE1): Reimplement using these functions.
14709 This avoids undefined behavior in expressions like
14710 DOWNCASE (x) == DOWNCASE (y), which previously suffered
14711 from race conditions in accessing the global variables
14712 case_temp1 and case_temp2.
14713 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14714 * lisp.h (case_temp1, case_temp2): Remove their decls.
14715 * character.h (ASCII_CHAR_P): Move from here ...
14716 * lisp.h: ... to here, so that the inline functions mentioned
14717 above can use them.
14718
4a6bea26
PE
14719 * dired.c (directory_files_internal_unwind): Now static.
14720
f14b7e14
PE
14721 * fileio.c (file_name_as_directory, directory_file_name):
14722 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14723 Now static.
2893f146
PE
14724 (file_name_as_directory): Use const pointers when appropriate.
14725 (Fexpand_file_name): Likewise. In particular, newdir might
14726 point at constant storage, so make it a const pointer.
fd4ead52 14727 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
14728 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14729 signedness issues.
f839df0c
PE
14730 (Fset_file_times, Finsert_file_contents, auto_save_error):
14731 Rename locals to avoid shadowing.
f14b7e14 14732
5716756e 14733 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
14734 (Ftry_completion, Fall_completions): Rename or remove locals
14735 to avoid shadowing.
5716756e 14736
b4c3046a
PE
14737 * marker.c (bytepos_to_charpos): Remove; unused.
14738
b45db522
PE
14739 * lisp.h (verify_bytepos, count_markers): New decls,
14740 so that gcc does not warn that these functions aren't declared.
14741
85876d07
PE
14742 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14743 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 14744 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 14745 (copy_text): Remove unused local var.
85876d07 14746
03d78a21 14747 * filelock.c (within_one_second): Now static.
b3dd38ab 14748 (lock_file_1): Rename local to avoid shadowing.
03d78a21 14749
5df8f01b
PE
14750 * buffer.c (fix_overlays_before): Mark locals as initialized.
14751 (fix_start_end_in_overlays): Likewise. This function should be
14752 simplified by using pointers-to-pointers, but that's a different
14753 matter.
b1d876f1 14754 (switch_to_buffer_1): Now static.
8f54f30a
PE
14755 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14756 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 14757
a70072c9 14758 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 14759 Fix pointer signedness issue.
edced198
PE
14760 (sys_subshell): Mark local as volatile if checking for lint,
14761 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 14762 (MAXPATHLEN): Define only if needed.
a70072c9 14763
a0977c44
PE
14764 * process.c (serial_open, serial_configure): Move decls from here ...
14765 * systty.h: ... to here, so that they can be checked.
14766
a884fdcc
PE
14767 * fns.c (get_random, seed_random): Move extern decls from here ...
14768 * lisp.h: ... to here, so that they can be checked.
14769
604efe86 14770 * sysdep.c (reset_io): Now static.
b8950c94 14771 (wait_for_termination_signal): Remove; unused.
604efe86 14772
38fc62d9
PE
14773 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
14774 (copy_keymap_item, append_key, push_text_char_description):
14775 Now static.
1004a21a 14776 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 14777 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
14778 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
14779 (describe_map_tree):
14780 Rename locals to avoid shadowing.
38fc62d9 14781
2f2650da
PE
14782 * keyboard.c: Declare functions static if they are not used elsewhere.
14783 (echo_char, echo_dash, cmd_error, top_level_2):
14784 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
14785 (read_char, kbd_buffer_get_event, make_lispy_position):
14786 (make_lispy_event, make_lispy_movement, apply_modifiers):
14787 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14788 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14789 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 14790 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 14791 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 14792
a053e86c 14793 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
14794 (mark_kboards): Move decl here ...
14795 * alloc.c (mark_kboards): ... from here.
a053e86c 14796
4752793e
PE
14797 * lisp.h (force_auto_save_soon): New decl.
14798
74f10ca7 14799 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
14800 (DEFINE_DUMMY_FUNCTION): New macro.
14801 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14802 Use it.
c03cd23f
PE
14803 (main): Add casts to avoid warnings
14804 if GCC considers string literals to be constants.
74f10ca7 14805
022e70d4
PE
14806 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14807
59d6fe83
PE
14808 * dbusbind.c: Pointer signedness fixes.
14809 (xd_signature, xd_append_arg, xd_initialize):
14810 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14811 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14812 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14813 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14814
78320123
PE
14815 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14816 if GCC considers string literals to be constants.
49cebcca 14817 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 14818
35ac2a97
SM
148192011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14820
fb103ca9
SM
14821 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14822 (print_preprocess, print_object): New macro to fix last change.
14823
35ac2a97
SM
14824 * print.c (print_preprocess): Don't forget font objects.
14825
62973b41
JB
148262011-03-16 Juanma Barranquero <lekktu@gmail.com>
14827
14828 * emacs.c (USAGE3): Doc fixes.
14829
0e48bb22
AS
148302011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14831
14832 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14833 structure.
14834
7684e57b
JB
148352011-03-14 Juanma Barranquero <lekktu@gmail.com>
14836
14837 * lisp.h (VWindow_system, Qfile_name_history):
14838 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14839 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14840 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14841
14842 * w32select.c: Don't #include "keyboard.h".
c96bbc66 14843 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
14844
14845 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14846 * w32console.c (detect_input_pending, read_input_pending)
14847 (encode_terminal_code):
14848 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14849 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14850 (w32_system_caret_y, Qfile_name_history):
14851 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14852 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14853 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14854 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14855 * w32proc.c (Qlocal, report_file_error):
14856 * w32term.c (Vwindow_system, updating_frame):
14857 * w32uniscribe.c (initialized, uniscribe_font_driver):
14858 Remove unneeded extern declarations.
14859
2aa46d6c
CY
148602011-03-14 Chong Yidong <cyd@stupidchicken.com>
14861
c96bbc66 14862 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 14863
cffc6f3b
CY
148642011-03-13 Chong Yidong <cyd@stupidchicken.com>
14865
14866 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14867 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14868 These macros can no longer be used for assignment.
14869
44f230aa
SM
14870 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14871 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
14872 (record_buffer_markers, fetch_buffer_markers): New functions for
14873 recording and fetching special buffer markers.
14874 (set_buffer_internal_1, set_buffer_temp): Use them.
14875
14876 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14877
14878 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14879
14880 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14881 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14882
14883 * xdisp.c (hscroll_window_tree):
14884 (reconsider_clip_changes): Use PT instead of BUF_PT.
14885
d251f04b
EZ
148862011-03-13 Eli Zaretskii <eliz@gnu.org>
14887
14888 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14889 $(EMACS_ROOT)/lib/intprops.h.
14890
f0c77cd1
PE
148912011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14892
3eca4629
PE
14893 Fix more problems found by GCC 4.5.2's static checks.
14894
7c86ee98
PE
14895 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14896 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
14897 (xg_free_frame_widgets): Make it clear that a local variable is
14898 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
14899 (gdk_window_get_screen): Make it clear that this macro is needed
14900 only if USE_GTK_TOOLTIP.
1e5524e7
PE
14901 (int_gtk_range_get_value): New function, which avoids a diagnostic
14902 from gcc -Wbad-function-cast.
14903 (xg_set_toolkit_scroll_bar_thumb): Use it.
14904 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14905 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
14906 (get_utf8_string, xg_get_file_with_chooser):
14907 Rename locals to avoid shadowing.
14908 (create_dialog): Move locals to avoid shadowing.
7c86ee98 14909
41729b81
PE
14910 * xgselect.c (xg_select): Remove unused var.
14911
f0c77cd1
PE
14912 * image.c (four_corners_best): Mark locals as initialized.
14913 (gif_load): Initialize transparent_p to zero (Bug#8238).
14914 Mark another local as initialized.
ec6cf4c6 14915 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 14916
ce0ad53d 14917 * image.c (clear_image_cache): Now static.
d5d5a617 14918 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 14919 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
14920 (x_edge_detection): Remove unnecessary cast that
14921 gcc -Wbad-function-cast diagnoses.
2037898d 14922 (gif_load): Fix pointer signedness.
6ae141d6
PE
14923 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14924 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 14925
33383987 149262011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 14927
d32df629
PE
14928 Improve quality of tests for time stamp overflow.
14929 For example, without this patch (encode-time 0 0 0 1 1
14930 1152921504606846976) returns the obviously-bogus value (-948597
14931 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14932 reports time overflow. See
14933 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
14934 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14935 * editfns.c: Include limits.h and intprops.h.
14936 (TIME_T_MIN, TIME_T_MAX): New macros.
14937 (time_overflow): Move earlier, to before first use.
14938 (hi_time, lo_time): New functions, for an accurate test for
14939 out-of-range times.
14940 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14941 (Fget_internal_run_time): Don't assume time_t fits in int.
14942 (make_time): Use list2 instead of Fcons twice.
14943 (Fdecode_time): More accurate test for out-of-range times.
14944 (check_tm_member): New function.
14945 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
14946 (lisp_time_argument): Don't rely on undefined left-shift and
14947 right-shift behavior when checking for time stamp overflow.
8be6f318 14948
fe31d94c
PE
14949 * editfns.c (time_overflow): New function, refactoring common code.
14950 (Fformat_time_string, Fdecode_time, Fencode_time):
14951 (Fcurrent_time_string): Use it.
14952
8be6f318
PE
14953 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14954 * dired.c (make_time): Move to ...
14955 * editfns.c (make_time): ... here.
14956 * systime.h: Note the move.
14957
09d9db2c 149582011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 14959
126bc0dc
YM
14960 * fringe.c (update_window_fringes): Remove unused variables.
14961
c47cbdfd
YM
14962 * unexmacosx.c (copy_data_segment): Also copy __got section.
14963 (Bug#8223)
14964
7ac80be9
EZ
149652011-03-12 Eli Zaretskii <eliz@gnu.org>
14966
c96bbc66 14967 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
14968 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14969 Constify `char *' arguments and their references according to
14970 prototypes in tparam.h.
14971
ecb0f94d 14972 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 14973
7ac80be9
EZ
14974 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14975 Adapt all references accordingly.
14976
14977 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14978
ef1fd07e
TT
149792011-03-11 Tom Tromey <tromey@redhat.com>
14980
14981 * buffer.c (syms_of_buffer): Remove obsolete comment.
14982
7ef4b50c
EZ
149832011-03-11 Eli Zaretskii <eliz@gnu.org>
14984
14985 * termhooks.h (encode_terminal_code): Declare prototype.
14986
14987 * msdos.c (encode_terminal_code): Don't declare prototype.
14988
14989 * term.c (encode_terminal_code): Now external again, used by
14990 w32console.c and msdos.c.
14991
44f230aa
SM
14992 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14993 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 14994
4b1ec863 149952011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 14996
1714f52b 14997 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 14998
4b1ec863
PE
14999 * fringe.c (update_window_fringes): Mark locals as initialized
15000 (Bug#8227).
15001 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 15002
524c7aa6
PE
15003 * alloc.c (mark_fringe_data): Move decl from here ...
15004 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15005 to check its interface.
15006 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15007
a5c0af81 15008 * fontset.c (free_realized_fontset): Now static.
7519b8cd 15009 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 15010 (fontset_font): Mark local as initialized.
a9a06e0b 15011 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 15012
b4716021
PE
15013 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15014
811e9bac 15015 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 15016 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
15017 (x_own_selection, Fx_disown_selection_internal): Rename locals
15018 to avoid shadowing.
15019 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 15020
7e3ab302
PE
15021 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15022 so that the caller can use some name other than gcpro1.
15023 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
15024 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15025 (Fx_backspace_delete_keys_p):
15026 Use them to avoid shadowing, and rename vars to avoid shadowing.
15027 (x_decode_color, x_set_name, x_window): Now static.
6b437900 15028 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 15029 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
15030 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15031 Remove unused locals.
7e3ab302
PE
15032 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15033 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15034 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15035 macros.
f78faa98 15036
e2b13473
PE
15037 * xterm.h (x_mouse_leave): New decl.
15038
77f23912
PE
15039 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15040 Remove unused functions.
cdf4ba58
PE
15041 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15042 (x_calc_absolute_position): Now static.
7411c686 15043 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 15044 Don't declare local "event" unless it's used.
ed7bf3a5
PE
15045 (x_iconify_frame, x_free_frame_resources): Don't declare locals
15046 unless they are used.
38d0b34a
PE
15047 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
15048 (x_fatal_error_signal): Remove; not used.
a6067996
PE
15049 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
15050 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
15051 (x_error_catcher, x_connection_closed, x_error_handler):
15052 (x_error_quitter, xembed_send_message, x_iconify_frame):
15053 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 15054 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 15055 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 15056
44f230aa
SM
15057 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
15058 Rename or move locals to avoid shadowing.
6b463e58 15059 (tty_defined_color, merge_face_heights): Now static.
5967d051 15060 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
15061 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
15062 does not deduce is never used uninitialized.
73719eba
PE
15063 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
15064 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 15065
426994c3 15066 * terminal.c (store_terminal_param): Now static.
5489860b 15067
032f1620 15068 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 15069 (set_frame_menubar): Remove unused local.
d4323972 15070 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
15071 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
15072 since they might point to immutable storage.
281585b0
PE
15073 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
15074 since it's unused otherwise.
032f1620 15075
367c19e5 15076 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 15077 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
15078 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
15079 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 15080 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
15081 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
15082 does not deduce are never used uninitialized.
70739cbe 15083
07b48fa9
PE
15084 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
15085
8868a238 15086 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
15087 * window.c (window_loop, size_window):
15088 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 15089
7e5cf297 15090 * window.c (display_buffer): Now static.
d6550a9f
PE
15091 (size_window): Mark variables that gcc -Wuninitialized
15092 does not deduce are never used uninitialized.
a586633d
PE
15093 * window.h (check_all_windows): New decl, to forestall
15094 gcc -Wmissing-prototypes diagnostic.
5b555da1 15095 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 15096
f6095868
PE
15097 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
15098 shadowing.
15099 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
15100 Include <limits.h>.
15101 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
15102 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
15103 (load_charset_map): Mark variables that gcc -Wuninitialized
15104 does not deduce are never used uninitialized.
53df7c11 15105 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 15106
f38b440c
PE
15107 * coding.c (coding_set_source, coding_set_destination):
15108 Use "else { /* comment */ }" rather than "else /* comment */;"
15109 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
15110 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
15111 a block, when the outer 'i' will do.
15112 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
15113 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
15114 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
15115 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
15116 (Fdecode_sjis_char, Fdefine_coding_system_internal):
15117 Rename locals to avoid shadowing.
15118 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
15119 * coding.c (emacs_mule_char, encode_invocation_designation):
15120 Now static, since they're not used elsewhere.
413bb2db 15121 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 15122 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
15123 (decode_coding_emacs_mule): Mark variables that gcc
15124 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
15125 (detect_coding_iso_2022): Initialize a local variable that might
15126 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 15127 this initialization is needed. (Bug#8211)
5f58e762
PE
15128 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
15129 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
15130 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
15131 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
15132 Remove unused macros.
f38b440c 15133
232b38b9 15134 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 15135 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 15136 * character.c (string_count_byte8): Likewise.
232b38b9 15137
fb90da1b
PE
15138 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
15139 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
15140
fb93dbc2
PE
15141 * chartab.c (copy_sub_char_table): Now static, since it's not used
15142 elsewhere.
5c156ace
PE
15143 (sub_char_table_ref_and_range, char_table_ref_and_range):
15144 Rename locals to avoid shadowing.
bbcd0949 15145 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 15146
7d3b3862 15147 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 15148 (BIDI_BOB): Remove unused macro.
7d3b3862 15149
6be7d3da
PE
15150 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
15151 deduce are never used uninitialized.
c2ed9c8b 15152 * term.c (encode_terminal_code): Likewise.
6be7d3da 15153
75f8807f 15154 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 15155
50938595
PE
15156 * tparam.h: New file.
15157 * term.c, tparam.h: Include it.
15158 * deps.mk (term.o, tparam.o): Depend on tparam.h.
15159 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
15160 Move these decls to tparam.h, and make them agree with what
15161 is actually in tparam.c. The previous trick of using incompatible
15162 decls in different modules does not conform to the C standard.
15163 All callers of tparam changed to use tparam's actual API.
15164 * tparam.c (tparam1, tparam, tgoto):
15165 Use const pointers where appropriate.
15166
fbceeba2
PE
15167 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
15168 * cm.h (struct cm): Likewise.
15169 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
15170 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
15171 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
15172 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
15173 (turn_on_face, init_tty): Likewise.
15174 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 15175
7f3f1250
PE
15176 * term.c (term_mouse_position): Rename local to avoid shadowing.
15177
e6ca6543
PE
15178 * alloc.c (mark_ttys): Move decl from here ...
15179 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
15180
c40f8d15
AS
151812011-03-11 Andreas Schwab <schwab@linux-m68k.org>
15182
15183 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
15184
cfe0661d
JB
151852011-03-09 Juanma Barranquero <lekktu@gmail.com>
15186
15187 * search.c (compile_pattern_1): Remove argument regp, unused since
15188 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
15189 (compile_pattern): Don't pass it.
15190
0afb4571
J
151912011-03-08 Jan Djärv <jan.h.d@swipnet.se>
15192
15193 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
15194 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
15195 for ! HAVE_GTK3.
15196 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
15197
15198 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
15199
15200 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
15201 gdk_window_get_screen, gdk_window_get_geometry,
15202 gdk_x11_window_lookup_for_display and GDK_KEY_g.
15203 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
15204 (xg_get_pixbuf_from_pixmap): New function.
15205 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
15206 to Pixmap, take frame as parameter, remove GdkColormap parameter.
15207 Call xg_get_pixbuf_from_pixmap instead of
15208 gdk_pixbuf_get_from_drawable.
15209 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
15210 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
15211 (xg_check_special_colors): Use GtkStyleContext and its functions
15212 for HAVE_GTK3.
15213 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
15214 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
15215 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
15216 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
15217 Call gtk_widget_get_preferred_size.
0afb4571
J
15218 (xg_frame_resized): gdk_window_get_geometry only takes 5
15219 parameters.
44f230aa
SM
15220 (xg_win_to_widget, xg_event_is_for_menubar):
15221 Call gdk_x11_window_lookup_for_display.
0afb4571
J
15222 (xg_set_widget_bg): New function.
15223 (delete_cb): New function.
895009e1 15224 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 15225 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
15226 (xg_set_background_color): Call xg_set_widget_bg.
15227 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
15228 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
15229 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
15230 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
15231 if ! HAVE_GTK3.
15232 (update_frame_tool_bar): Call gtk_widget_hide.
15233 (xg_initialize): Use GDK_KEY_g.
15234
15235 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
15236 if ! HAVE_GTK3
15237 (x_session_initialize): Call gdk_x11_set_sm_client_id.
15238
15239 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
15240 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
15241 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
15242
1c2cc4ef
JB
152432011-03-08 Juanma Barranquero <lekktu@gmail.com>
15244
15245 * w32xfns.c (select_palette): Check success of RealizePalette against
15246 GDI_ERROR, not zero.
15247
33383987 15248See ChangeLog.11 for earlier changes.
aac0c6e3
MR
15249
15250;; Local Variables:
15251;; coding: utf-8
aac0c6e3
MR
15252;; End:
15253
2f097256 15254 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
15255
15256 This file is part of GNU Emacs.
15257
15258 GNU Emacs is free software: you can redistribute it and/or modify
15259 it under the terms of the GNU General Public License as published by
15260 the Free Software Foundation, either version 3 of the License, or
15261 (at your option) any later version.
15262
15263 GNU Emacs is distributed in the hope that it will be useful,
15264 but WITHOUT ANY WARRANTY; without even the implied warranty of
15265 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15266 GNU General Public License for more details.
15267
15268 You should have received a copy of the GNU General Public License
15269 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.