Separate read and write access to Lisp_Object slots of struct window.
[bpt/emacs.git] / src / ChangeLog
1 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Separate read and write access to Lisp_Object slots of struct window.
4 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
10 Adjust users.
11
12 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
13
14 Fix Windows build errors introduced after converting to FGET and FSET.
15 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
16 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
17 (w32_judge_scroll_bars): Change to use FSET.
18 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
19
20 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
21
22 Fix replacement typo.
23 * window.c (replace_window): Set root_window instead of
24 selected_window. This fixes a total window subsystem
25 malfunction reported by Bastien Guerry <bzg@gnu.org>.
26
27 2012-08-06 Glenn Morris <rgm@gnu.org>
28
29 * lisp.mk (lisp): Add language/persian.elc.
30
31 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
32
33 Separate read and write access to Lisp_Object slots of struct frame.
34 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
35 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
36 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
37 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
38 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
39
40 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
41
42 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
43
44 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
45
46 Generalize common compile-time constants.
47 * lisp.h (header_size, bool_header_size, word_size): Now here.
48 (struct Lisp_Vector): Add comment.
49 (struct Lisp_Bool_Vector): Move up to define handy constants.
50 (VECSIZE, PSEUDOVECSIZE): Simplify.
51 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
52 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
53 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
54 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
55 * xfont.c, xmenu.c: Use word_size where appropriate.
56
57 2012-08-05 Lawrence Mitchell <wence@gmx.li>
58
59 * search.c (Freplace_match): Treat \? in the replacement text
60 literally (Bug#8161).
61
62 2012-08-05 Chong Yidong <cyd@gnu.org>
63
64 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
65 * frame.c (Vdelete_frame_functions):
66 * emacs.c (Vkill_emacs_hook): Doc fix.
67
68 2012-08-04 Eli Zaretskii <eliz@gnu.org>
69
70 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
71 --with-x-toolkit=no builds.
72 Reported by Carsten Mattner <carstenmattner@gmail.com>.
73
74 2012-08-04 Chong Yidong <cyd@gnu.org>
75
76 * syntax.c (Fmodify_syntax_entry): Doc fix.
77
78 2012-08-04 Eli Zaretskii <eliz@gnu.org>
79
80 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
81 * w32.c (init_environment): Change the default values of many
82 environment variables in dflt_envvars[] to NULL, to avoid pushing
83 them into environment when they were not already defined. Remove
84 the code that deletes site-lisp subdirectories from the default
85 value of EMACSLOADPATH, as it is no longer needed.
86 (check_windows_init_file): Now external, not static. Use
87 Vload_path as is, without adding anything, as this function is now
88 called when Vload_path is already set up.
89
90 * w32.h (check_windows_init_file): Add prototype.
91
92 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
93 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
94 compatibility with Posix platforms.
95 (main): Move the call to check_windows_init_file to here from
96 w32.c.
97 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
98 any, in the DEFALT argument into the root of the Emacs build or
99 installation tree, as appropriate.
100
101 * callproc.c (init_callproc_1): Call decode_env_path instead of
102 doing its equivalent by hand.
103 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
104 the code that sets Vexec_path run on MS-Windows.
105
106 * lread.c (init_lread): Add comments to #ifdef's.
107
108 * msdos.c (dos_set_window_size, IT_update_begin)
109 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
110 instead of direct references.
111
112 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
113
114 Export DEFAULT_REHASH_* to GDB.
115 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
116 Now constants, not macros.
117
118 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
119
120 Remove unnecessary casts involving pointers.
121 These casts are no longer needed now that we assume C89 or later,
122 since they involve casting to or from void *.
123 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
124 (make_pure_float, make_pure_vector):
125 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
126 * macros.c (Fstart_kbd_macro):
127 * menu.c (find_and_return_menu_selection):
128 * minibuf.c (read_minibuf_noninteractive):
129 * sysdep.c (closedir):
130 * xdisp.c (x_produce_glyphs):
131 * xfaces.c (compare_fonts_by_sort_order):
132 * xfns.c (x_real_positions, select_visual):
133 * xselect.c (x_stop_queuing_selection_requests)
134 (x_get_window_property, x_get_window_property_as_lisp_data):
135 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
136 Remove unnecessary pointer casts.
137 * alloc.c (record_xmalloc): New function.
138 * lisp.h (record_xmalloc): New decl.
139 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
140 more like a function. This is because the pointer cast is not
141 needed. All uses changed.
142 * print.c (print_string, print_error_message): Avoid length recalc.
143
144 Improve fix for macroexp crash with debugging (Bug#12118).
145 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
146 ARRAY_MARK_FLAG when checking subscripts, because ASET is
147 not supposed to be invoked from the garbage collector.
148 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
149 (gc_aset): New function, which is like ASET but can be
150 used in the garbage collector.
151 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
152 (set_hash_index): Use it instead of ASET.
153
154 2012-08-03 Eli Zaretskii <eliz@gnu.org>
155
156 Support symlinks on latest versions of MS-Windows.
157 * w32.c: Include winioctl.h and aclapi.h.
158 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
159 (revert_to_self): Forward declarations of static functions.
160 <static BOOL g_b_init_get_security_info>:
161 <g_b_init_create_symbolic_link>: New static flags.
162 (globals_of_w32): Initialize them to zero.
163 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
164 (map_w32_filename): Improve commentary. Simplify switch.
165 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
166 headers (most versions of MinGW w32api don't).
167 (get_security_info, create_symbolic_link)
168 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
169 New functions.
170 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
171 in the argument file name.
172 (sys_access): Call unc_volume_file_attributes only if
173 GetFileAttributes fails with network-related error codes.
174 (sys_rename): Diagnose renaming of a symlink when the user doesn't
175 have the required privileges.
176 (get_file_security_desc_by_name): Renamed from
177 get_file_security_desc.
178 (stat_worker): New function, with most of the guts of 'stat', and
179 with addition of handling of symlinks and support for 'lstat'. If
180 possible, get file's attributes and security information by
181 handle, not by name. Produce S_IFLNK bit for symlinks, when
182 called from 'lstat'.
183 (stat, lstat): New functions, call 'stat_worker'.
184 (symlink, readlink, careadlinkat): Rewritten to create and resolve
185 symlinks when the underlying filesystem supports them.
186
187 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
188
189 Fix macroexp crash on Windows with debugging (Bug#12118).
190 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
191 checking subscripts; problem introduced with the recent
192 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
193 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
194 since it's used in non-static inline functions now.
195
196 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
197 Don't assume buffer size fits in 'int'. Remove unused local.
198
199 Use C99-style 'extern inline' if available.
200 * buffer.h (BUFFER_INLINE):
201 * category.h (CATEGORY_INLINE):
202 * character.h (CHARACTER_INLINE):
203 * charset.h (CHARSET_INLINE):
204 * composite.h (COMPOSITE_INLINE):
205 * dispextern.h (DISPEXTERN_INLINE):
206 * lisp.h (LISP_INLINE):
207 * systime.h (SYSTIME_INLINE):
208 New macro, replacing 'static inline' in this header.
209 * buffer.h, category.h, character.h, charset.h, composite.h:
210 * dispextern.h, lisp.h, systime.h:
211 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
212 * alloc.c (LISP_INLINE):
213 * buffer.c (BUFFER_INLINE):
214 * category.c (CATEGORY_INLINE):
215 * character.c (CHARACTER_INLINE):
216 * charset.c (CHARSET_INLINE):
217 * composite.c (COMPOSITE_INLINE):
218 * dispnew.c (DISPEXTERN_INLINE):
219 * sysdep.c (SYSTIME_INLINE):
220 Define to EXTERN_INLINE, so that the corresponding functions
221 are compiled into code.
222 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
223 (INLINE_HEADER_END): New macros.
224 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
225 since it's used in non-static inline functions now.
226 (VALMASK) [!USE_LSB_TAG]: Likewise.
227
228 2012-08-02 Glenn Morris <rgm@gnu.org>
229
230 * s/: Remove empty directory.
231
232 * s/ms-w32.h: Move to ../nt/inc.
233 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
234 Update for new ms-w32.h location.
235
236 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
237
238 Port to Solaris 8.
239 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
240
241 2012-08-02 Glenn Morris <rgm@gnu.org>
242
243 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
244 hard-coding the path separator.
245
246 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
247
248 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
249 This how ASET and AREF are supposed to work, and makes
250 it easier to think about future improvements. See
251 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
252 * charset.h (set_charset_attr): New function.
253 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
254 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
255 (aref_addr): New function. All uses of &AREF(...) changed.
256 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
257 (set_hash_index): New functions. All lvalue-style uses of
258 HASH_KEY etc. changed.
259 * keyboard.c (set_prop): New function. All lvalue-style uses
260 of PROP changed.
261
262 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
263
264 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
265 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
266 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
267 * nsfns.m (ns_set_name_as_filename): Likewise.
268 * nsmenu.m (ns_update_menubar): Likewise.
269 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
270
271 2012-08-01 Eli Zaretskii <eliz@gnu.org>
272
273 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
274 Adapt to latest changes in field names of the corresponding Lisp
275 objects.
276
277 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
278
279 2012-08-01 Glenn Morris <rgm@gnu.org>
280
281 * s/msdos.h: Remove file.
282 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
283 * Makefile.in (S_FILE): Remove.
284 (config_h): Remove S_FILE.
285
286 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
287
288 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
289 Remove; moved to nt/config.nt.
290
291 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
292
293 Use INTERNAL_FIELD for conses and overlays.
294 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
295 Remove obsolete comment.
296 (MVAR): New macro.
297 (struct Lisp_Overlay): Use INTERNAL_FIELD.
298 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
299
300 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
301
302 Use INTERNAL_FIELD for symbols.
303 * lisp.h (SVAR): New macro. Adjust users.
304 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
305 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
306
307 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
308
309 Use INTERNAL_FIELD for processes.
310 * process.h (PVAR): New macro. Adjust style.
311 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
312 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
313
314 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
315
316 Use INTERNAL_FIELD for windows.
317 * window.h (WVAR): New macro.
318 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
319 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
320 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
321 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
322 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
323 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
324
325 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
326
327 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
328
329 2012-08-01 Glenn Morris <rgm@gnu.org>
330
331 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
332 Move to configure.ac.
333
334 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
335
336 * makefile.w32-in (CONFIG_H): Update dependencies.
337 (CONF_POST_H): New macro.
338
339 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
340
341 2012-07-31 Glenn Morris <rgm@gnu.org>
342
343 * Makefile.in (S_FILE): No longer set by configure.
344
345 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
346 is available.
347 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
348
349 * process.h (NULL_DEVICE):
350 * emacs.c (SEPCHAR):
351 * editfns.c (USER_FULL_NAME): Let configure set them.
352
353 * s/README, s/template.h: Remove files.
354
355 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
356
357 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
358 Move to configure.ac.
359
360 2012-07-31 Eli Zaretskii <eliz@gnu.org>
361
362 * .gdbinit (xframe): Adapt to introduction of FVAR and the
363 resulting renaming of 'struct frame' members.
364
365 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
366
367 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
368 after introduction of FVAR.
369
370 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
371
372 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
373
374 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
375 instead of compositeToPoint.
376 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
377
378 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
379
380 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
381
382 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
383 * lisp.h (INTERNAL_FIELD): New macro.
384 * buffer.h (BUFFER_INTERNAL_FIELD): Removed.
385 (BVAR): Change to use INTERNAL_FIELD.
386 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
387 (KVAR): Change to use INTERNAL_FIELD.
388 * frame.h (FVAR): New macro.
389 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
390 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
391 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
392 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
393 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
394
395 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
396
397 Miscellaneous fixes for non-default X toolkits.
398 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
399 * xterm.c (x_frame_of_widget): Remove redundant prototype.
400 Move under #ifdef USE_LUCID.
401 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
402 definition and usage to avoid warnings.
403
404 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
405
406 * nsterm.m (openFiles): Fix previous checkin.
407
408 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
409
410 * indent.c (compute_motion): Remove unused local.
411
412 2012-07-31 Glenn Morris <rgm@gnu.org>
413
414 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
415
416 * conf_post.h [USG5_4]:
417 Move remaining contents of s/usg5-4-common.h here.
418 * s/usg5-4-common.h: Remove file.
419
420 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
421 * s/irix6-5.h: Remove file.
422
423 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
424 * s/darwin.h: Remove file.
425
426 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
427 * s/hpux10-20.h: Remove file, which is now empty.
428
429 2012-07-30 Glenn Morris <rgm@gnu.org>
430
431 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
432 * Makefile.in (config_h): Add conf_post.h.
433 * makefile.w32-in (CONFIG_H): Add conf_post.h.
434
435 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
436
437 * nsterm.m (ns_do_open_file): New variable.
438 (ns_term_init): Set ns_do_open_file to YES after run returns.
439 (openFile, openTempFile, openFileWithoutUI, openFiles): Open
440 files only if ns_do_open_file.
441
442 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
443
444 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
445 This no-op macro hasn't been needed for many years.
446 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
447
448 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
449 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
450 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
451 gdb_make_enums_visible.
452 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
453 (DIRECTORY_SEP): Now a constant, not a macro.
454
455 2012-07-30 Eli Zaretskii <eliz@gnu.org>
456
457 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
458 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
459
460 * w32term.c <w32_keyboard_codepage>: Renamed from
461 keyboard_codepage and now external. All users changed.
462
463 * w32term.h: Add declaration of w32_keyboard_codepage.
464
465 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
466 the codepage to translate keys to Unicode. If this argument is
467 -1, use the value returned by GetConsoleCP. All callers changed.
468
469 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
470
471 Update .PHONY listings in makefiles.
472 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
473 bootstrap-clean, distclean, maintainer-clean, versioclean,
474 extraclean, frc.
475
476 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
477 This is a bit clearer. Fix some commentary typos.
478
479 2012-07-30 Glenn Morris <rgm@gnu.org>
480
481 * s/netbsd.h: Let configure include signal.h if needed.
482 Remove file, which is now empty.
483
484 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
485 Let configure set them.
486 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
487 No more need to undefine.
488
489 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
490
491 * keymap.c (Fkey_description): Don't remove 0x80 bit from
492 non-single-byte char when adding meta modifier. (Bug#12090)
493
494 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
495
496 Convert safe_call to use variable number of arguments.
497 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
498 (safe_call2): Fix comment.
499 * lisp.h (safe_call): Adjust prototype.
500 * coding.c (encode_coding_object): Change to use safe_call2.
501 * xfaces.c (merge_face_heights): Change to use safe_call1.
502
503 2012-07-30 Glenn Morris <rgm@gnu.org>
504
505 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
506 does that unconditionally. Remove file, which is now empty.
507
508 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
509 Remove empty files.
510
511 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
512
513 Export to GDB most of lisp.h's remaining object-like macros.
514 * lisp.h (min, max): Move earlier, because they're used earlier now.
515 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
516 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
517 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
518 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
519 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
520 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
521 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
522 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
523 Now constants, for GDB. They need not be macros.
524 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
525 Now constants, for GDB, as well as macros, for static initializers.
526 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
527 Move to after the definition of struct Lisp_Char_Table,
528 since the former now needs that type defined.
529 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
530 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
531 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
532 New enums, for gdb_make_enums_visible.
533 (GLYPH_MODE_LINE_FACE): Remove; unused.
534 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
535 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
536 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
537 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
538 enum maxargs, enum MAX_ALLOCA.
539 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
540 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
541 no longer needed, now that they are done in lisp.h.
542
543 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
544
545 Cleanup string bytes checking.
546 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
547 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
548 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
549 (check_sblock, compact_small_strings): Simplify.
550
551 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
552
553 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
554 These macros are confusing and no longer need to be defined, as
555 the enum values now suffice. All uses replaced with definiens.
556 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
557
558 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
559
560 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
561 ($(BLD)/w32console.$(O)): Update dependencies.
562
563 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
564
565 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
566 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
567 time. Adjust users.
568 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
569
570 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
571
572 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
573 setting sitelisp (Bug#12010).
574
575 2012-07-29 Eli Zaretskii <eliz@gnu.org>
576
577 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
578
579 * w32heap.c (cache_system_info):
580 * w32.c (sys_rename):
581 * w32proc.c (find_child_console, sys_kill): All users changed.
582
583 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
584
585 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
586
587 2012-07-29 Eli Zaretskii <eliz@gnu.org>
588
589 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
590
591 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
592
593 Cleanup statistics calculation in Fgarbage_collect.
594 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
595 zombies percentage calculation. Simplify elapsed time calculation.
596
597 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
598
599 Generalize marker debugging code under MARKER_DEBUG and use eassert.
600 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
601 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
602 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
603 (replace_range, replace_range_2, del_range_2): Change to eassert.
604 * marker.c (byte_char_debug_check): Adjust style.
605
606 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
607
608 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
609 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
610 long-ago-commented-out code that talks about "WIN32".
611 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
612 All uses changed.
613
614 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
615
616 Use Gnulib stdalign module (Bug#9772, Bug#9960).
617 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
618 Simplify by using alignof.
619 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
620 * lisp.h: Include <stdalign.h>.
621 (GCALIGNMENT): New macro and constant.
622 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
623 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
624 (stdalign): New macro, if not already defined.
625
626 2012-07-28 Eli Zaretskii <eliz@gnu.org>
627
628 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
629 * w32inevt.c: Include w32inevt.h.
630 (w32_read_console_input): New inline function, calls either
631 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
632 w32_console_unicode_input.
633 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
634 (w32_kbd_patch_key, key_event): Use the codepage returned by
635 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
636 (key_event): use uChar.UnicodeChar only if
637 w32_console_unicode_input is non-zero.
638
639 * w32console.c: Include w32heap.h.
640 <w32_console_unicode_input>: New global variable.
641 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
642 family of Windows, zero otherwise.
643
644 * w32inevt.h: Declare w32_console_unicode_input.
645
646 * xdisp.c (init_iterator): Don't reference tip_frame in a build
647 --without-x. (Bug#11742)
648
649 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
650
651 Adjust GDB to reflect pvec_type changes (Bug#12036).
652 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
653 2012-07-04 changes to pseudovector representation. Problem
654 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
655
656 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
657
658 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
659 bus address.
660 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
661
662 2012-07-27 Eli Zaretskii <eliz@gnu.org>
663
664 * alloc.c (listn): Fix the order the arguments are consed onto the
665 list.
666
667 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
668 enumeration constants, as PURE and HEAP are too general, and clash
669 with other headers and sources, such as gmalloc.c and the
670 MS-Windows system headers. All users changed.
671
672 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
673
674 Revert last save_excursion_save and save_excursion_restore changes.
675 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
676 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
677
678 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
679
680 Fix recently-introduced typos in Windows port.
681 Reported by Martin Rudalics <rudalics@gmx.at>.
682 * w32.c (init_environment): Replace comma with semicolon.
683 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
684
685 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
686
687 Improve GDB symbol export (Bug#12036).
688 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
689 arms of an 'if', not using conditional expressions; otherwise GDB
690 complains about the types in the unevaluated arm when the argument
691 is an integer literal.
692 (xgetint): Simplify expression.
693 * alloc.c (gdb_make_enums_visible): New constant. This ports to
694 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
695 Zaretskii in <http://bugs.gnu.org/12036#13>.
696 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
697 needed now that we have gdb_make_enums_visible.
698 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
699 (enum enum_USE_LSB_TAG):
700 New enum types, packaging up enums that need to be exported to GDB.
701
702 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
703
704 Utility function to make a list from specified amount of objects.
705 * lisp.h (enum constype): New datatype.
706 (listn): New prototype.
707 * alloc.c (listn): New function.
708 (Fmemory_use_count, syms_of_alloc): Use it.
709 * buffer.c (syms_of_buffer): Likewise.
710 * callint.c (syms_of_callint): Likewise.
711 * charset.c (define_charset_internal): Likewise.
712 * coding.c (syms_of_coding): Likewise.
713 * keymap.c (syms_of_keymap): Likewise.
714 * search.c (syms_of_search): Likewise.
715 * syntax.c (syms_of_syntax): Likewise.
716 * w32.c (init_environment): Likewise.
717 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
718 * xdisp.c (syms_of_xdisp): Likewise.
719 * xfns.c (syms_of_xfns): Likewise.
720
721 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
722
723 Fast save_excursion_save and save_excursion_restore.
724 * lisp.h (struct Lisp_Excursion): New data type.
725 (PVEC_EXCURSION): New pseudovector type.
726 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
727 to deal with it. Adjust comments.
728 (init_marker, attach_marker): New prototype.
729 (unchain_marker): Adjust prototype.
730 * marker.c (attach_marker): Change to global.
731 (init_marker): New function.
732 * alloc.c (Fmake_marker, build_marker): Use it.
733 (build_marker): More easserts.
734 (mark_object): Handle struct Lisp_Excursion.
735 * editfns.c (save_excursion_save, save_excursion_restore):
736 Reimplement to use struct Lisp_Excursion. Add comments.
737
738 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
739
740 Fix export of symbols to GDB (Bug#12036).
741 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
742 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
743 emacs.c, as this is a more-suitable home. Had this been done earlier
744 the fix for 12036 would have avoided some of the problems noted in
745 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
746 would have been more obvious.
747 * emacs.c: Do not include <verify.h>; no longer needed.
748 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
749 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
750 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
751 Remove; now done in lisp.h.
752 * lisp.h (PUBLISH_TO_GDB): New macro.
753 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
754 (DATA_SEG_BITS): Use it.
755 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
756 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
757 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
758 not be usable in #if. This simplifies things.
759
760 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
761
762 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
763
764 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
765
766 Simplify export of symbols to GDB (Bug#12036).
767 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
768 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
769 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
770 Adjust to changes in lisp.h and emacs.c, by using
771 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
772 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
773 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
774 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
775 instead of gdb_valbits.
776 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
777 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
778 instead of gdb_array_mark_flag.
779 (xboolvector): Get size from $->size, not $->header.size.
780 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
781 (xreload, hook-run, hookpost-run): Remove.
782 * emacs.c: Include <verify.h>.
783 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
784 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
785 Remove.
786 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
787 (gdb_USE_LSB_TAG): New enum constants.
788 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
789 Also define these as enum constants, so they're visible to GDB.
790 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
791 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
792 as constants, so they're visible to GDB.
793 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
794 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
795 Now enum constants, not macros, so they're visible to GDB.
796 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
797 more convenient now. All uses changed.
798 (VALMASK) [USE_LSB_TAG]: Also define in this case.
799 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
800
801 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
802
803 Explicitly free restriction data that are not needed anymore.
804 * editfns.c (save_restriction_restore): Free restriction data.
805
806 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
807
808 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
809 add argument, tune behavior, and adjust all callers.
810
811 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
812
813 Use typedef for EMACS_INT, EMACS_UINT.
814 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
815 than macros. This simplifies debugging in the usual case, since
816 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
817 and it allows expressions involving EMACS_INT casts.
818 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
819
820 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
821
822 * nsterm.m (ns_read_socket): Return early if there is a modal
823 window (Bug#12043).
824
825 2012-07-25 Martin Rudalics <rudalics@gmx.at>
826
827 * frame.c (Fredirect_frame_focus): In doc-string don't mention
828 that FOCUS-FRAME can be omitted.
829
830 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
831
832 Adjust buffer text indirection counters at the end of Fkill_buffer.
833 * buffer.c (Fkill_buffer): Adjust indirection counters when the
834 buffer is definitely dead. This should really fix an issue reported
835 by Christoph Scholtes again. (Bug#12007).
836 (init_buffer_once): Initialize indirection counters of
837 buffer_defaults and buffer_local_symbols (for sanity and safety).
838
839 2012-07-24 Eli Zaretskii <eliz@gnu.org>
840
841 * xdisp.c (init_iterator): Don't compute dimensions of truncation
842 and continuation glyphs on tooltip frames, leave them at zero.
843 Avoids continued lines in tooltips. (Bug#11832)
844
845 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
846
847 Simplify copy_overlay.
848 * buffer.c (copy_overlay): Simplify. Use build_marker.
849 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
850
851 2012-07-23 Eli Zaretskii <eliz@gnu.org>
852
853 * print.c (print_object): Don't crash when a frame's name is nil
854 or invalid. (Bug#12025)
855
856 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
857 it signals an error when a tooltip frame is being created.
858
859 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
860
861 Cleanup miscellaneous objects allocation and initialization.
862 * alloc.c (allocate_misc): Change to static. Add argument to
863 specify the subtype. Adjust comment and users.
864 (build_overlay): New function.
865 * buffer.c (copy_overlays, Fmake_overlay): Use it.
866 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
867 (allocate_misc): Remove prototype.
868 (build_overlay): Add prototype.
869
870 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
871
872 Swap buffer text indirection counters in Fbuffer_swap_text.
873 * buffer.c (Fbuffer_swap_text): Swap indirections too.
874 This avoids crash reported by Christoph Scholtes at
875 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
876
877 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
878
879 * nsmenu.m (Popdown_data): New struct.
880 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
881 free Popdown_data.
882 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
883 (initWithContentRect): Make imgView and contentView non-static
884 and autorelease them. Also autorelease img and matrix (Bug#12005).
885 (dealloc): Remove (Bug#12005).
886
887 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
888
889 Adjust consing_since_gc when objects are explicitly freed.
890 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
891 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
892 (free_cons, free_misc): Subtract object size from consing_since_gc.
893
894 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
895
896 Simplify and cleanup markers positioning code.
897 * marker.c (attach_marker): More useful eassert.
898 (live_buffer, set_marker_internal): New function.
899 (Fset_marker, set_marker_restricted): Use set_marker_internal.
900 (set_marker_both, set_marker_restricted_both): Use live_buffer.
901
902 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
903
904 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
905 as it's limited by the amount of memory, not by INT_MAX.
906
907 2012-07-21 Eli Zaretskii <eliz@gnu.org>
908
909 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
910 in special-event-map. See the discussion at
911 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
912 for the reasons.
913
914 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
915 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
916 Fabrice Popineau <fabrice.popineau@supelec.fr>.
917
918 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
919
920 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
921 (conversationIdentifier): Return value is NSInteger.
922 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
923
924 2012-07-21 Chong Yidong <cyd@gnu.org>
925
926 * window.c (decode_any_window): Signal an error if the window is
927 on a dead frame (Bug#11984).
928
929 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
930
931 Add indirection counting to speed up Fkill_buffer.
932 * buffer.h (struct buffer): New member.
933 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
934 (Fmake_indirect_buffer): Set indirection counter to -1, increment
935 base buffer indirection counter.
936 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
937 (Fkill_buffer): Adjust indirection counters as needed, don't walk
938 through buffer list if indirection counter is 0.
939
940 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
941
942 Extend the value returned by Fgarbage_collect with heap statistics.
943 * alloc.c (Qheap): New symbol.
944 (syms_of_alloc): DEFSYM it.
945 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
946 (Fmemory_free): Remove.
947 (syms_of_alloc): Don't defsubr it.
948 * buffer.c (Fcompact_buffer): Remove.
949 (syms_of_buffer): Don't defsubr it.
950
951 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
952
953 Make maybe_gc inline.
954 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
955 * lisp.h (consing_since_gc, gc_relative_threshold)
956 (memory_full_cons_threshold): Revert declaration.
957 (maybe_gc): Remove prototype, define as inline.
958 * alloc.c: Remove old commented-out code.
959 (consing_since_gc, gc_relative_threshold)
960 (memory_full_cons_threshold): Revert to global.
961 (maybe_gc): Remove.
962
963 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
964
965 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
966 * lisp.h (build_unibyte_string): New function.
967 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
968 * sysdep.c, w32fns.c, xfns.c: Use it.
969 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
970 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
971 Adjust users accordingly.
972 * font.h (font_open_by_name): Adjust prototype.
973
974 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
975
976 Cleanup calls to Fgarbage_collect.
977 * lisp.h (maybe_gc): New prototype.
978 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
979 Remove declarations.
980 * alloc.c (maybe_gc): New function.
981 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
982 Make them static.
983 * bytecode.c (MAYBE_GC): Use maybe_gc.
984 * eval.c (eval_sub, Ffuncall): Likewise.
985 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
986 to avoid dependency from auto-save feature.
987
988 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
989
990 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
991 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
992 'for_each_per_buffer_object_at'.
993 All uses changed. It's better to use upper-case for macros that
994 cannot be implemented as functions, to give the reader a clue
995 that they're special.
996
997 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
998
999 * alloc.c (Fgarbage_collect): Tweak docstring.
1000
1001 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1002
1003 Tweak the value returned from Fgarbage_collect again.
1004 * alloc.c (Fgarbage_collect): New return value, as confirmed in
1005 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
1006 Adjust documentation.
1007 (total_vector_bytes): Rename to total_vector_slots, adjust
1008 accounting.
1009 (total_free_vector_bytes): Rename to total_free_vector_slots,
1010 adjust accounting.
1011 (Qstring_bytes, Qvector_slots): New symbols.
1012 (syms_of_alloc): DEFSYM them.
1013
1014 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1015
1016 Buffer compaction primitive which may be used from Lisp.
1017 * buffer.c (compact_buffer, Fcompact_buffer): New function.
1018 (syms_of_buffer): Register Fcompact_buffer.
1019 * alloc.c (Fgarbage_collect): Use compact_buffer.
1020 * buffer.h (compact_buffer): New prototype.
1021 (struct buffer_text): New member.
1022
1023 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1024
1025 New macro to iterate over all buffers, miscellaneous cleanups.
1026 * lisp.h (all_buffers): Remove declaration.
1027 * buffer.h (all_buffers): Add declaration, with comment.
1028 (for_each_buffer): New macro.
1029 * alloc.c (Fgarbage_collect, mark_object): Use it.
1030 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
1031 (init_buffer): Likewise.
1032 * data.c (Fset_default): Likewise.
1033 * coding.c (code_conversion_restore): Remove redundant check
1034 for dead buffer.
1035 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
1036
1037 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1038
1039 Fix bug that created negative-length intervals.
1040 * intervals.c (merge_interval_right, merge_interval_left):
1041 Do not zero out this interval if it is absorbed by its children,
1042 as this interval's total length doesn't change in that case. See
1043 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
1044
1045 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
1046
1047 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
1048 when invoking (make-bool-vector N t) and N is a positive
1049 multiple of 8 -- the last 8 bits were mistakenly cleared.
1050
1051 Remove some struct layout assumptions in bool vectors.
1052 * alloc.c (bool_header_size): New constant.
1053 (header_size, word_size): Move earlier, as they're now used earlier.
1054 Use 'word_size' in a few more places, where it's appropriate.
1055 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
1056 padding before the data member of a bool vector.
1057 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
1058 than doing the check by hand with an abort ().
1059
1060 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
1061
1062 * eval.c (Fdefvar): Don't check constants since we only set the var if
1063 it's not yet defined anyway (bug#11904).
1064
1065 * lisp.h (last_undo_boundary): Declare new var.
1066 * keyboard.c (command_loop_1): Set it.
1067 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
1068 were auto-added by the command loop (bug#11774).
1069
1070 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1071
1072 * w32font.c (Qsymbol): Remove local definition.
1073 (syms_of_w32font): Don't DEFSYM it.
1074
1075 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1076
1077 Fix sweep_vectors to handle large bool vectors correctly.
1078 * alloc.c (sweep_vectors): Account total_vector_bytes for
1079 bool vectors larger than VBLOCK_BYTES_MAX.
1080
1081 2012-07-18 Chong Yidong <cyd@gnu.org>
1082
1083 * frame.c (x_set_frame_parameters): Revert bogus change introduced
1084 in 2012-05-25 commit by Paul Eggert (Bug#11738).
1085
1086 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1087
1088 Return more descriptive data from Fgarbage_collect.
1089 Suggested by Stefan Monnier in
1090 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
1091 * alloc.c (bounded_number): New function.
1092 (total_buffers, total_vectors): New variable.
1093 (total_string_size): Rename to total_string_bytes, adjust users.
1094 (total_vector_size): Rename to total_vector_bytes, adjust users.
1095 (sweep_vectors): Account total_vectors and total_vector_bytes.
1096 (Fgarbage_collect): New return value. Adjust documentation.
1097 (gc_sweep): Account total_buffers.
1098 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
1099 (VECTOR_SIZE): Remove.
1100 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
1101 (Qinterval, Qmisc): New symbols.
1102 (syms_of_data): Initialize them.
1103 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
1104 (Qcons, Qbuffer): New declarations.
1105
1106 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1107
1108 * alloc.c (Fmemory_free): Account for memory-free's own storage.
1109 Round up, not down. Improve doc.
1110
1111 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1112
1113 Restore old code in allocate_string_data to avoid Faset breakage.
1114 Reported by Julien Danjou <julien@danjou.info> in
1115 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
1116 * alloc.c (allocate_string_data): Restore old code with minor
1117 adjustments, fix comment to explain this subtle issue.
1118
1119 2012-07-17 Eli Zaretskii <eliz@gnu.org>
1120
1121 Remove FILE_SYSTEM_CASE.
1122 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
1123
1124 * fileio.c (FILE_SYSTEM_CASE): Don't define.
1125 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
1126 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
1127 call-process-region passes it through expand-file-name.
1128
1129 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
1130
1131 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1132
1133 Fix crash when creating indirect buffer (Bug#11917)
1134 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
1135 Don't handle unbound variables specially if non-zero.
1136 (Fbuffer_local_variables): Pass zero.
1137 (clone_per_buffer_values): Pass non-zero.
1138
1139 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1140
1141 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
1142 to make the loop interruptible.
1143
1144 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1145
1146 * gnutls.c (emacs_gnutls_handshake): Only retry if
1147 GNUTLS_E_INTERRUPTED.
1148
1149 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1150
1151 Cleanup and convert miscellaneous checks to eassert.
1152 * alloc.c (mark_interval): Fix comment, partially rephrase
1153 old comment from intervals.h (see below).
1154 * intervals.c (find_interval, adjust_intervals_for_insertion)
1155 (delete_interval, adjust_intervals_for_deletion)
1156 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
1157 Convert to eassert.
1158 (adjust_intervals_for_insertion, make_new_interval):
1159 Remove obsolete and unused code.
1160 * intervals.h (struct interval): Remove obsolete comment.
1161 * textprotp.c (erase_properties): Remove unused code.
1162 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
1163 (Fremove_list_of_text_properties): Convert to eassert.
1164
1165 2012-07-17 Chong Yidong <cyd@gnu.org>
1166
1167 * editfns.c (Finsert_char): Doc fix.
1168
1169 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1170
1171 Fix previous change to make Fmemory_free always accurate.
1172 * alloc.c (make_interval): Update total_free_intervals.
1173 (make_float): Likewise for total_free_floats.
1174 (free_cons, Fcons): Likewise for total_free_conses.
1175 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
1176 Likewise for total_free_vector_bytes.
1177 (Fmake_symbol): Likewise for total_free_symbols.
1178 (bytes_free): Remove.
1179
1180 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1181
1182 Simple free memory accounting feature.
1183 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
1184 (sweep_vectors): Accumulate size of free vectors.
1185 (Fgarbage_collect): Setup bytes_free.
1186 (Fmemory_free): New function.
1187 (syms_of_alloc): Register it.
1188
1189 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1190
1191 Cleanup overlays checking.
1192 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
1193 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
1194 eassert and OVERLAYP.
1195 (sort_overlays): Change to use OVERLAYP.
1196
1197 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
1198
1199 * editfns.c (Finsert_char): Make it interactive, and make the
1200 second arg optional. Copy interactive spec and docstring from
1201 ucs-insert.
1202
1203 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1204
1205 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
1206 Unlike the other wrapped functions, fabs has an unspecified
1207 effect on errno.
1208
1209 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
1210
1211 * nsterm.m (keyDown): Interpret flags without left/right bits
1212 as the left key (Bug#11670).
1213
1214 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1215
1216 Remove empty and useless init functions.
1217 * lisp.h (init_character_once, init_fns, init_image)
1218 (init_filelock, init_sound): Remove prototype.
1219 * character.c (init_character_once): Remove.
1220 * filelock.c (init_filelock): Likewise.
1221 * fns.c (init_fns): Likewise.
1222 * image.c (init_image): Likewise.
1223 * sound.c (init_sound): Likewise.
1224 * emacs.c (main): Adjust accordingly.
1225
1226 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1227
1228 * gtkutil.h: Tiny cleanups.
1229 (use_old_gtk_file_dialog): Remove useless declaration.
1230 (xg_uses_old_file_dialog): Add suggested const attribute.
1231
1232 2012-07-15 Eli Zaretskii <eliz@gnu.org>
1233
1234 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
1235 (bidi_paragraph_init): Use it to limit search forward for a strong
1236 directional character in abnormally large paragraphs full of
1237 neutral or weak characters. (Bug#11943)
1238
1239 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
1240
1241 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
1242 the toolbar (Bug#9451).
1243 (xg_make_tool_item): Give the widget event box a transparent
1244 background.
1245
1246 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1247
1248 Cleanup basic allocation variables and functions.
1249 * alloc.c (ignore_warnings, init_intervals, init_float)
1250 (init_cons, init_symbol, init_marker): Remove.
1251 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
1252 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
1253 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
1254 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
1255 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
1256 (staticidx, init_alloc_once, init_strings, free_ablock):
1257 Remove redundant initialization.
1258 * fns.c (init_weak_hash_tables): Remove.
1259 * lisp.h (init_weak_hash_tables): Remove prototype.
1260
1261 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1262
1263 Use zero_vector where appropriate.
1264 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
1265 accordingly.
1266 * lisp.h (zero_vector): New declaration.
1267 * font.c (null_vector): Remove.
1268 (syms_of_font): Remove initialization and staticpro.
1269 (font_list_entities, font_find_for_lface): Change to use zero_vector.
1270 * keymap.c (Faccessible_keymaps): Likewise.
1271
1272 2012-07-15 Leo Liu <sdl.web@gmail.com>
1273
1274 * fringe.c: Fix typo in comments.
1275
1276 2012-07-14 Leo Liu <sdl.web@gmail.com>
1277
1278 * fringe.c: Add a new bitmap exclamation-mark.
1279
1280 2012-07-14 Eli Zaretskii <eliz@gnu.org>
1281
1282 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
1283
1284 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
1285 (HAVE_MENUS): Don't define, defined by editing config.in with
1286 msdos/sed2v2.inp.
1287 (GMALLOC_INHIBIT_VALLOC): Don't define.
1288 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
1289
1290 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
1291
1292 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
1293
1294 2012-07-14 Glenn Morris <rgm@gnu.org>
1295
1296 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
1297 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
1298 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
1299
1300 2012-07-13 Glenn Morris <rgm@gnu.org>
1301
1302 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
1303
1304 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
1305 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
1306
1307 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
1308
1309 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
1310 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
1311 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
1312 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
1313 where appropriate.
1314 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
1315 as boolean expression.
1316 (x_set_window_size): Remove unused variable toolbar.
1317 (ns_get_color_default, ns_mod_to_lisp): Remove.
1318 (ns_mouse_position): Remove unused variables xchar and ychar.
1319 (ns_compute_glyph_string_overhangs): Remove unused variable face.
1320 (ns_set_vertical_scroll_bar): Remove unused variable count.
1321 (ns_delete_terminal): Remove unused variable i.
1322 (ns_term_init): Remove unused variables r, g and b.
1323 (mouseDown): Remove unused variable window.
1324 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
1325 (initFrameFromEmacs): Remove unused variable vbextra.
1326 (mouseEntered): Remove unused variables p and dpyinfo.
1327 (mouseExited): Remove unused variables p and r.
1328 (ns_define_frame_cursor, ns_clear_frame_area)
1329 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
1330 (menuDown): Assign [sender tag] to variable and cast the variable.
1331
1332 * nsterm.h (menuDown): Add id as type to argument sender.
1333 (ns_display_info_for_name): Add Lisp_Object argument.
1334 (ns_term_init): Add Lisp_Object argument.
1335 (ns_map_event_to_object): Add void argument.
1336 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
1337 prototype with arguments and only declare if __OBJC__.
1338 (nxatoms_of_nsselect): Add void argument.
1339 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
1340 (ns_alloc_autorelease_pool): Add void argument.
1341 (ns_release_autorelease_pool): Add void* argument.
1342 (ns_get_defaults_value): Add const char* argument.
1343
1344 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
1345 (initFromContents): Use SSDATA where appropriate.
1346 (ns_update_menubar): Add braces to ambigous if-else.
1347 (initWithTitle): Put () around assignment in if statement.
1348 (ns_menu_show): Remove unused variables window and keymap.
1349 (update_frame_tool_bar): Remove unused variable selected_p.
1350 (initWithContentRect): Remove unused variable this_cmd_name.
1351
1352 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
1353 appropriate.
1354 (setXBMColor): Remove unused variable len.
1355 (setPixmapData): Put () around assignment in loop statement.
1356
1357 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
1358 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
1359 where appropriate.
1360 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
1361 around assignment in loop statement.
1362 (nsfont_open): Remove unused variable i.
1363 (nsfont_open): Remove unused variable len.
1364 (nsfont_draw): Remove unused variable cs.
1365
1366 * nsfns.m (x_set_icon_name, ns_set_name_internal)
1367 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
1368 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
1369 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
1370 (Fns_font_name, Fns_perform_service)
1371 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
1372 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
1373 (ns_set_name): Remove unused variable view.
1374 (x_set_menu_bar_lines): Remove unused variable olines.
1375 (x_set_tool_bar_lines): Remove unused variable root_window.
1376 (Fns_list_colors): Put () around assignment in while statement.
1377 (Fns_perform_service): Remove unused variable len.
1378 (Fns_display_usable_bounds): Remove unused variable top.
1379 (syms_of_nsfns): Remove unused variable i.
1380
1381 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1382 memcpy (Bug#11907).
1383
1384 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
1385
1386 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1387 and free it with DestroyExceptionInfo (Bug#11558).
1388
1389 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
1390
1391 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1392 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1393 Set here, not in nt/config.nt.
1394
1395 2012-07-13 Eli Zaretskii <eliz@gnu.org>
1396
1397 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1398 cursor overflow into the last glyph on display line when the right
1399 fringe is off. (Bug#11832)
1400
1401 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
1402
1403 * xdisp.c (produce_special_glyphs): Now static.
1404 * dispextern.h (produce_special_glyphs): Remove decl.
1405
1406 2012-07-13 Glenn Morris <rgm@gnu.org>
1407
1408 * s/bsd-common.h, s/cygwin.h: Remove empty files.
1409 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1410
1411 * s/usg5-4-common.h (USG, USG5):
1412 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1413 * s/sol2-6.h (SOLARIS2):
1414 * s/irix6-5.h (IRIX6_5):
1415 * s/hpux10-20.h (USG, USG5, HPUX):
1416 * s/gnu-linux.h (USG, GNU_LINUX):
1417 * s/freebsd.h (BSD_SYSTEM):
1418 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1419 * s/cygwin.h (CYGWIN):
1420 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1421 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1422
1423 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
1424
1425 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
1426
1427 2012-07-13 Glenn Morris <rgm@gnu.org>
1428
1429 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1430
1431 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1432
1433 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1434 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1435
1436 2012-07-12 Glenn Morris <rgm@gnu.org>
1437
1438 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
1439
1440 * process.c (init_process_emacs): Rename from init_process.
1441 The old name is also the name of a Mach system call.
1442 * lisp.h, emacs.c: Update for this name change.
1443 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1444 longer needed.
1445
1446 2012-07-12 Eli Zaretskii <eliz@gnu.org>
1447
1448 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1449 memmove call that removes glyphs covered by the left truncation
1450 glyph. Improve commentary.
1451 (display_line): Fix display of continuation glyphs on GUI frames
1452 when the right fringe is turned off and variable-size fonts are
1453 used in the window. Move the code that appends a stretch glyph to
1454 produce_special_glyphs, so that it could be used for truncation
1455 and continuation glyphs alike.
1456 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1457 glyph of a suitably computed width, to align the special glyphs at
1458 the window margin. Code moved from display_line. (Bug#11832)
1459
1460 2012-07-12 Glenn Morris <rgm@gnu.org>
1461
1462 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1463
1464 * s/gnu-linux.h, s/hpux10-20.h:
1465 Do not unconditionally define HAVE_XRMSETDATABASE.
1466
1467 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1468
1469 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 Fix typos that broke OS X build.
1472 Reported by Randal L. Schwartz in
1473 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1474 * nsterm.m (ns_timeout): Add missing local decl.
1475 (ns_get_color): snprintf -> sprintf, to fix typo.
1476
1477 2012-07-12 Glenn Morris <rgm@gnu.org>
1478
1479 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1480 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1481 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1482 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1483
1484 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1485 Move PTY_OPEN to configure.
1486
1487 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1488 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1489 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1490
1491 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
1492
1493 Use empty_unibyte_string where applicable.
1494 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1495 * lread.c (read1): Likewise.
1496 * xsettings.c (syms_of_xsettings): Likewise.
1497
1498 2012-07-12 Glenn Morris <rgm@gnu.org>
1499
1500 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1501 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
1502 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1503 * s/hpux10-20.h (RUN_TIME_REMAP):
1504 * s/bsd-common.h (TABDLY): Move to configure.
1505
1506 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1507
1508 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1509
1510 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1511 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
1512
1513 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
1514
1515 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1516 * s/template.h: Move NARROWPROTO to configure.
1517
1518 2012-07-11 Glenn Morris <rgm@gnu.org>
1519
1520 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
1521 unused since 2011-01-17 change to systty.h.
1522
1523 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
1524 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1525 Move HAVE_PTYS and HAVE_SOCKETS to configure.
1526
1527 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
1530
1531 2012-07-11 Glenn Morris <rgm@gnu.org>
1532
1533 * s/darwin.h, s/gnu-linux.h, s/template.h:
1534 Move INTERRUPT_INPUT to configure.
1535
1536 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1537
1538 Minor adjustments to interning code.
1539 * lisp.h (intern, intern_c_string): Redefine as static inline
1540 wrappers for intern_1 and intern_c_string_1, respectively.
1541 (intern_1, intern_c_string_1): Rename prototypes.
1542 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1543 Vobarray checking.
1544 * font.c (font_intern_prop): Likewise. Adjust comment.
1545 * w32font.c (intern_font_name): Likewise.
1546
1547 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1548
1549 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1550
1551 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1552 of Fcar/Fcdr if possible.
1553 * font.c (check_otf_features): Likewise.
1554 * fontset.c (Fnew_fontset): Likewise.
1555 * gnutls.c (Fgnutls_boot): Likewise.
1556 * minibuf.c (read_minibuf): Likewise.
1557 * msdos.c (IT_set_frame_parameters): Likewise.
1558 * xmenu.c (Fx_popup_dialog): Likewise.
1559 * w32menu.c (Fx_popup_dialog): Likewise.
1560
1561 2012-07-11 Glenn Morris <rgm@gnu.org>
1562
1563 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1564 since nothing has defined it on these platforms.
1565
1566 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1567 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1568
1569 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1570 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1571 Move CLASH_DETECTION to configure.
1572
1573 * s/gnu.h: Remove file, which is now empty.
1574
1575 * s/gnu.h, s/gnu-linux.h:
1576 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1577
1578 2012-07-11 John Wiegley <johnw@newartisans.com>
1579
1580 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1581 function attribute, so we only use it if it exists in the
1582 compiler.
1583
1584 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1585
1586 Avoid call to strlen in fast_c_string_match_ignore_case.
1587 * search.c (fast_c_string_match_ignore_case): Change to use
1588 length argument. Adjust users accordingly.
1589 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1590
1591 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1592
1593 Assume mkdir, rmdir.
1594 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1595 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1596
1597 Assume rename.
1598 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1599
1600 Assume perror.
1601 * s/hpux10-20.h (HAVE_PERROR): Remove.
1602 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1603 Remove dummy definition, as this problem was obsolete long ago.
1604
1605 Assume strerror.
1606 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1607
1608 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1609
1610 Avoid calls to strlen in font processing functions.
1611 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
1612 (font_open_by_name): Change to use length argument. Adjust
1613 users accordingly.
1614 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1615 Adjust prototypes.
1616 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1617 Change to return ptrdiff_t.
1618 (xfont_list_pattern, xfont_match): Use length returned by
1619 xfont_decode_coding_xlfd.
1620 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1621
1622 2012-07-11 Glenn Morris <rgm@gnu.org>
1623
1624 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1625 Move DONT_REOPEN_PTY to configure.
1626
1627 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1628 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1629
1630 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1631
1632 Remove "#define unix" that is no longer needed (Bug#11905).
1633 * s/aix4-2.h (unix): Remove; no longer needed.
1634
1635 EMACS_TIME simplification (Bug#11875).
1636 This replaces macros (which typically do not work in GDB)
1637 with functions, typedefs and enums, making the code easier to debug.
1638 The functional style also makes code easier to read and maintain.
1639 * systime.h: Include <sys/time.h> on all hosts, not just if
1640 WINDOWSNT, since 'struct timeval' is needed in general.
1641 (EMACS_TIME): Now a typedef, not a macro.
1642 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1643 not macros.
1644 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1645 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1646 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1647 (EMACS_TIME_LE): Now functions, not macros.
1648 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1649 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1650 which are not functions. All uses rewritten to use:
1651 (make_emacs_time): New function.
1652 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1653 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1654 not functions. All uses rewritten to use the following, respectively:
1655 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1656 (add_emacs_time, sub_emacs_time): New functions.
1657 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
1658 * fileio.c (Fcopy_file):
1659 * xterm.c (XTflash): Get the current time closer to when it's used.
1660 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1661
1662 * bytecode.c (targets): Suppress -Woverride-init warnings.
1663
1664 Simplify by avoiding confusing use of strncpy etc.
1665 * doc.c (Fsnarf_documentation):
1666 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1667 * frame.c (Fmake_terminal_frame):
1668 * gtkutil.c (get_utf8_string):
1669 * lread.c (openp):
1670 * nsmenu.m (ns_update_menubar):
1671 * regex.c (regerror):
1672 Prefer memcpy to strncpy and strncat when either will do.
1673 * fileio.c (Fsubstitute_in_file_name):
1674 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1675 (menu_separator_name_p):
1676 * nsmenu.m (ns_update_menubar):
1677 Prefer memcmp to strncmp when either will do.
1678 * nsterm.m: Include <ftoastr.h>.
1679 (ns_get_color):
1680 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1681 Prefer snprintf to strncpy.
1682 * nsterm.m (ns_term_init):
1683 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1684 * nsterm.m (ns_term_init):
1685 Avoid the need for strncpy, by using build_string or
1686 make_unibyte_string directly. Use dtoastr, not snprintf.
1687 * process.c (Fmake_network_process): Diagnose service names that
1688 are too long, rather than silently truncating them or creating
1689 non-null-terminated names.
1690 (Fnetwork_interface_info): Likewise, for interface names.
1691 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1692 Prefer sprintf to strncat.
1693 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1694 Prefer vsnprintf to vsprintf + strncpy.
1695
1696 2012-07-10 Glenn Morris <rgm@gnu.org>
1697
1698 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1699 Clarify fallback case.
1700
1701 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1702
1703 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1704 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1705 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
1706 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
1707 where argument type is known to be a Lisp_Cons.
1708
1709 2012-07-10 Tom Tromey <tromey@redhat.com>
1710
1711 * bytecode.c (BYTE_CODE_THREADED): New macro.
1712 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1713 (enum byte_code_op): New type.
1714 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1715 (exec_byte_code): Use them. Use token threading when applicable.
1716
1717 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1718
1719 Optimize pure C strings initialization.
1720 * lisp.h (make_pure_string): Fix prototype.
1721 (build_pure_c_string): New function, defined as static inline. This
1722 provides a better opportunity to optimize away calls to strlen when
1723 the function is called with compile-time constant argument.
1724 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1725 argument, adjust users accordingly. Use build_pure_c_string where
1726 appropriate.
1727 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1728 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1729 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1730
1731 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1732
1733 Avoid calls to strlen in miscellaneous functions.
1734 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1735 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1736 * lread.c (openp): Likewise.
1737
1738 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1739
1740 Avoid calls to strlen in path processing functions.
1741 * fileio.c (file_name_as_directory): Add comment. Change to add
1742 srclen argument and return the length of result. Adjust users
1743 accordingly.
1744 (directory_file_name): Fix comment. Change to add srclen argument,
1745 swap 1st and 2nd arguments to obey the common convention. Adjust
1746 users accordingly.
1747 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1748
1749 2012-07-10 Glenn Morris <rgm@gnu.org>
1750
1751 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1752 Move PENDING_OUTPUT_COUNT definition to configure.
1753
1754 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1755 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1756 * s/gnu.h (DATA_START): Move definitions to configure.
1757
1758 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1759 We include usg5-4-common.h, which defines them both.
1760
1761 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
1762 O_RDONLY already includes it).
1763
1764 Stop ns builds setting the EMACSLOADPATH environment variable.
1765 * nsterm.m (ns_load_path): Rename from ns_init_paths.
1766 Now it does not set EMACSLOADPATH, just returns the load-path string.
1767 * nsterm.h: Update accordingly.
1768 * lread.c [HAVE_NS]: Include nsterm.h.
1769 (init_lread) [HAVE_NS]: Use ns_load_path.
1770 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
1771
1772 2012-07-09 Glenn Morris <rgm@gnu.org>
1773
1774 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
1775 since the included bsd-common.h does so.
1776
1777 Stop ns builds setting the EMACSPATH environment variable.
1778 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
1779 (ns_init_paths): Do not set EMACSPATH.
1780 * nsterm.h (ns_exec_path): Add it.
1781 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
1782 Use ns_exec_path.
1783
1784 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
1785
1786 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
1787
1788 * process.c (wait_reading_process_output): 'waitchannels' was unset
1789 when read_kbd || !NILP (wait_for_cell); fix this.
1790
1791 Add GCC-style 'const' attribute to functions that can use it.
1792 * character.h (char_resolve_modifier_mask):
1793 * keyboard.h (make_ctrl_char):
1794 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
1795 (init_character_once, next_almost_prime, init_fns, init_image)
1796 (flush_pending_output, init_sound):
1797 * mem-limits.h (start_of_data):
1798 * menu.h (finish_menu_items):
1799 Add ATTRIBUTE_CONST.
1800 * emacs.c (DEFINE_DUMMY_FUNCTION):
1801 Declare the dummy function with ATTRIBUTE_CONST.
1802 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
1803 Add decls with ATTRIBUTE_CONST.
1804
1805 Minor improvements to make_formatted_string.
1806 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
1807 where int is good enough, as vsprintf returns an int.
1808 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
1809
1810 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1811
1812 Use make_formatted_string to avoid double length calculation.
1813 * lisp.h (make_formatted_string): New prototype.
1814 * alloc.c (make_formatted_string): New function.
1815 * buffer.c (Fgenerate_new_buffer_name): Use it.
1816 * dbus.c (syms_of_dbusbind): Likewise.
1817 * editfns.c (Fcurrent_time_zone): Likewise.
1818 * filelock.c (get_boot_time): Likewise.
1819 * frame.c (make_terminal_frame, set_term_frame_name)
1820 (x_report_frame_params): Likewise.
1821 * image.c (gs_load): Likewise.
1822 * minibuf.c (get_minibuffer): Likewise.
1823 * msdos.c (dos_set_window_size): Likewise.
1824 * process.c (make_process): Likewise.
1825 * xdisp.c (ensure_echo_area_buffers): Likewise.
1826 * xsettings.c (apply_xft_settings): Likewise.
1827
1828 2012-07-09 Glenn Morris <rgm@gnu.org>
1829
1830 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
1831 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
1832 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
1833 * nsterm.h (ns_etc_directory): Add it.
1834 * callproc.c [HAVE_NS]: Include nsterm.h.
1835 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
1836
1837 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1838
1839 Move marker debugging code under MARKER_DEBUG.
1840 * marker.c (MARKER_DEBUG): Move marker debugging code under
1841 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
1842 for bootstrap with --enable-checking (~3x slowdown reported
1843 by Juanma Barranquero <lekktu@gmail.com>).
1844 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
1845
1846 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
1849 See <http://bugs.gnu.org/11825#29>.
1850
1851 2012-07-08 Eli Zaretskii <eliz@gnu.org>
1852
1853 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
1854 has no font, use the frame's font. (Bug#11813)
1855 (display_line): Add commentary about displaying truncation glyphs
1856 on GUI frames.
1857 (produce_special_glyphs): Move here from term.c.
1858
1859 * term.c (produce_special_glyphs): Move to xdisp.c.
1860
1861 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
1862 section.
1863
1864 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
1865
1866 * xdisp.c (display_line): Avoid warning about implicit declaration
1867 of FRAME_FONT.
1868
1869 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1870
1871 * lisp.h: Remove empty conditional.
1872
1873 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1874
1875 * lread.c (load_path_check): Now static.
1876
1877 Fix some minor --with-ns problems found by static checking.
1878 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1879 (x_set_font) [!HAVE_X_WINDOWS]:
1880 * image.c (xpm_load_image) [HAVE_NS]:
1881 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1882 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1883 Remove unused local.
1884 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1885 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1886 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1887 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1888 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1889 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1890 Fix pointer signedness problem.
1891 * xfaces.c (FRAME_X_FONT_TABLE):
1892 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1893
1894 2012-07-07 Glenn Morris <rgm@gnu.org>
1895
1896 * lread.c (load_path_check): New function, split from init_lread.
1897 (init_lread): Reorganize. Motivation:
1898 If EMACSLOADPATH is set, check/warn about that rather than the
1899 defaults, which we are not going to use. Hence we can remove
1900 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1901 Don't warn if site-lisp directories are missing.
1902 If not installed, start from a blank load-path, since
1903 PATH_LOADSEARCH refers to the eventual installation directories.
1904
1905 2012-07-07 Eli Zaretskii <eliz@gnu.org>
1906
1907 Support truncation and continuation glyphs on GUI frames, when
1908 fringes are disabled. (Bug#11832)
1909 * xdisp.c (init_iterator): Get dimensions of truncation and
1910 continuation glyphs even if on GUI frames. Adjust
1911 it->last_visible_x on GUI frames when the left or right fringes,
1912 or both, are absent.
1913 (start_display, move_it_in_display_line_to): Handle the case of a
1914 GUI frame without a fringe to display continuation or truncation
1915 glyphs.
1916 (insert_left_trunc_glyphs): Support GUI frames: make sure
1917 truncation glyphs overwrite enough glyphs from the current line to
1918 have sufficient space in pixels.
1919 (display_line): Support truncation and continuation glyphs on GUI
1920 frames. If some spare pixels are left on the line after inserting
1921 the truncation glyphs, fill that space with a stretch glyph of a
1922 suitably computed width.
1923
1924 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1925 produce_glyphs, to support GUI sessions.
1926
1927 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1928
1929 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1930
1931 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1932
1933 Do not require float-time's arg to fit in time_t (Bug#11825).
1934 This works better on hosts where time_t is unsigned, and where
1935 float-time is applied to the (negative) difference between two times.
1936 * editfns.c (decode_time_components): Last arg is now double *,
1937 not int *, and means to store all the result as a double, without
1938 worrying about whether the seconds part fits in time_t.
1939 All callers changed.
1940 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1941 All callers changed.
1942 (Ffloat_time): Do not fail merely because the specified time falls
1943 outside of time_t range.
1944
1945 2012-07-07 Glenn Morris <rgm@gnu.org>
1946
1947 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1948 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1949 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1950
1951 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
1952
1953 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1954 Update dependencies.
1955
1956 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1957
1958 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1959
1960 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1961 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1962 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1963 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1964 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1965 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1966
1967 * xfont.c (compare_font_names): Redo to omit the need for casts.
1968
1969 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1970
1971 * xfns.c (Fx_change_window_property): Doc fix.
1972 * w32fns.c (Fx_change_window_property): Doc fix.
1973
1974 * w32fns.c (Fx_window_property): Accept the same arguments as the
1975 X Windows version. Doc fix.
1976 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1977
1978 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
1979 Eli Zaretskii <eliz@gnu.org>
1980
1981 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1982 Windows-specific code from nt/config.nt moved here.
1983 Obsolete settings removed.
1984
1985 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1986
1987 * process.c: Avoid unnecessary calls to gettime.
1988 (wait_reading_process_output): Don't get the time of day
1989 when gobbling data immediately and not waiting, as there's no need
1990 for it in that case. This removes a FIXME.
1991
1992 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1993
1994 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
1995 is defined (Bug#11768).
1996
1997 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1998
1999 Fix marker debugging code.
2000 * marker.c (byte_char_debug_check): Do not perform the check
2001 if buffer is not multibyte.
2002 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2003 Call byte_char_debug_check with correct arguments.
2004
2005 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2006
2007 Compile marker debugging code only if ENABLE_CHECKING is defined.
2008 * marker.c (byte_char_debug_check, count_markers):
2009 Use only if ENABLE_CHECKING is defined.
2010 (byte_debug_flag): Remove.
2011 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2012 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
2013
2014 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2015
2016 Avoid code repetition in marker-related functions.
2017 * marker.c (attach_marker): New function.
2018 (Fset_marker, set_marker_restricted, set_marker_both)
2019 (set_marker_restricted_both): Use it.
2020 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
2021 Consistently rename charno to charpos.
2022 (marker_position): Add eassert.
2023 (marker_byte_position): Convert to eassert.
2024
2025 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2026
2027 Simplify list operations in unchain_overlay and unchain_marker.
2028 * buffer.c (unchain_overlay): Simplify. Add comment.
2029 * marker.c (unchain_marker): Simplify. Fix comments.
2030
2031 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2032
2033 Introduce fast path for the widely used marker operation.
2034 * alloc.c (build_marker): New function.
2035 * lisp.h (build_marker): New prototype.
2036 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
2037 * composite.c (autocmp_chars): Likewise.
2038 * editfns.c (buildmark): Remove.
2039 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
2040 (save_restriction_save): Use build_marker.
2041 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
2042 * window.c (save_window_save): Likewise.
2043
2044 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2045
2046 Do not use Fdelete_overlay in delete_all_overlays
2047 to avoid redundant calls to unchain_overlay.
2048 * buffer.c (drop_overlay): New function.
2049 (delete_all_overlays, Fdelete_overlay): Use it.
2050 * minibuf.c (get_minibuffer): Fix comment.
2051
2052 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2053
2054 Port to OpenBSD 5.1 amd64.
2055 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
2056 This is needed for OpenBSD, and should be harmless on all BSD systems.
2057 Also, include <sys/sysctl.h>, as it should be available on all
2058 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
2059 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
2060 use p_pid member, not kp_proc.pid.
2061
2062 2012-07-06 Glenn Morris <rgm@gnu.org>
2063
2064 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
2065
2066 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2067
2068 More xmalloc and related cleanup.
2069 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
2070 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
2071 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
2072 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
2073 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
2074 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
2075 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
2076 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
2077 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
2078 * xterm.c:
2079 Omit needless casts involving void * pointers and allocation.
2080 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
2081 as the former is more robust if P's type is changed.
2082 Prefer xzalloc to xmalloc + memset 0.
2083 Simplify malloc-or-realloc to realloc.
2084 Don't worry about xmalloc returning a null pointer.
2085 Prefer xstrdup to xmalloc + strcpy.
2086 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
2087 growing it.
2088 * keyboard.c (apply_modifiers_uncached): Prefer local array to
2089 alloca of a constant.
2090
2091 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2092
2093 * xdisp.c (display_line): Fix horizontal pixel coordinates when
2094 hscroll is larger than the line width. Fixes long and futile
2095 looping inside extend_face_to_end_of_line (on a TTY) producing
2096 glyphs that are not needed and thrown away.
2097
2098 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2099
2100 * marker.c (set_marker_restricted_both): Simplify by using
2101 clip_to_bounds.
2102
2103 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2104
2105 * editfns.c (region_limit): Simplify by using clip_to_bounds.
2106
2107 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
2108
2109 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
2110 not defined (Bug#11768).
2111 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
2112 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
2113 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
2114 followed by gtk_box_set_homogeneous (Bug#11768).
2115 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
2116 (update_theme_scrollbar_width, xg_create_scroll_bar):
2117 Use gtk_scrollbar_new (Bug#11768).
2118 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
2119 (is_box_type): New function (Bug#11768).
2120 (xg_tool_item_stale_p): Call is_box_type.
2121 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
2122 with default display (Bug#11768).
2123
2124 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2125
2126 * xdisp.c (window_hscroll_limited): New function.
2127 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
2128 coordinates when window's hscroll is set to insanely large
2129 values. (Bug#11857)
2130
2131 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
2132
2133 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
2134 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
2135
2136 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2137
2138 Cleanup xmalloc.
2139 * lisp.h (xzalloc): New prototype. Omit needless casts.
2140 * alloc.c (xzalloc): New function. Omit needless casts.
2141 * charset.c: Omit needless casts. Convert all calls to
2142 xmalloc with following memset to xzalloc.
2143 * dispnew.c: Likewise.
2144 * fringe.c: Likewise.
2145 * image.c: Likewise.
2146 * sound.c: Likewise.
2147 * term.c: Likewise.
2148 * w32fns.c: Likewise.
2149 * w32font.c: Likewise.
2150 * w32term.c: Likewise.
2151 * xfaces.c: Likewise.
2152 * xfns.c: Likewise.
2153 * xterm.c: Likewise.
2154 * atimer.c: Omit needless casts.
2155 * buffer.c: Likewise.
2156 * callproc.c: Likewise.
2157 * ccl.c: Likewise.
2158 * coding.c: Likewise.
2159 * composite.c: Likewise.
2160 * doc.c: Likewise.
2161 * doprnt.c: Likewise.
2162 * editfns.c: Likewise.
2163 * emacs.c: Likewise.
2164 * eval.c: Likewise.
2165 * filelock.c: Likewise.
2166 * fns.c: Likewise.
2167 * gtkutil.c: Likewise.
2168 * keyboard.c: Likewise.
2169 * lisp.h: Likewise.
2170 * lread.c: Likewise.
2171 * minibuf.c: Likewise.
2172 * msdos.c: Likewise.
2173 * print.c: Likewise.
2174 * process.c: Likewise.
2175 * region-cache.c: Likewise.
2176 * search.c: Likewise.
2177 * sysdep.c: Likewise.
2178 * termcap.c: Likewise.
2179 * terminal.c: Likewise.
2180 * tparam.c: Likewise.
2181 * w16select.c: Likewise.
2182 * w32.c: Likewise.
2183 * w32reg.c: Likewise.
2184 * w32select.c: Likewise.
2185 * w32uniscribe.c: Likewise.
2186 * widget.c: Likewise.
2187 * xdisp.c: Likewise.
2188 * xmenu.c: Likewise.
2189 * xrdb.c: Likewise.
2190 * xselect.c: Likewise.
2191
2192 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2193
2194 * fileio.c (time_error_value): Check the right error number.
2195 Problem reported by Troels Nielsen in
2196 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
2197
2198 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2199
2200 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
2201 This should be fixed in a better way; see Eli Zaretskii in
2202 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
2203 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
2204
2205 * fileio.c (time_error_value): Rename from special_mtime.
2206 The old name's problems were noted by Eli Zaretskii in
2207 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
2208
2209 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
2210 This variable's comment says Emacs needs at least one GDB-visible
2211 symbol of type enum pvec_type, to work around GDB problems.
2212 The symbol's value doesn't matter.
2213
2214 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
2215 that causes compilation to fail on pre-C99 compilers.
2216
2217 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
2218
2219 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
2220 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
2221
2222 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2223
2224 * buffer.c (init_buffer_once): Fix initialization of
2225 headers for buffer_defaults and buffer_local_symbols.
2226 Reported by Juanma Barranquero <lekktu@gmail.com>.
2227
2228 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
2229
2230 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
2231 * lisp.h (enum pvec_type): Use fewer bits.
2232 (PSEUDOVECTOR_SIZE_BITS): New constant.
2233 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
2234 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
2235 change in pvec_type.
2236 (PSEUDOVECTOR_TYPEP): New macro.
2237 (TYPED_PSEUDOVECTORP): Use it.
2238 * fns.c (internal_equal): Adapt code to extract pvectype.
2239 * emacs.c (gdb_pvec_type): Update type.
2240 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
2241 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
2242 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
2243 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
2244 (sweep_vectors): Use it. Use local var `total_bytes' instead of
2245 abusing vector->header.next.nbytes.
2246 (live_vector_p): Use PVEC_TYPE.
2247 (mark_object): Adapt code to extract pvectype. Use switch.
2248
2249 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
2252 Tighten new eassert a bit.
2253
2254 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2255
2256 Fix compilation with --enable-gcc-warnings and -O1
2257 optimization level.
2258 * doprnt.c (doprnt): Change type of tem to int, initialize
2259 to avoid compiler warning. Add eassert.
2260 * search.c (simple_search): Initialize match_byte to avoid
2261 compiler warning. Add eassert.
2262
2263 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2264
2265 Avoid weird behavior with large horizontal scrolls.
2266 Without this change, for example, large hscroll values would
2267 mess up Emacs's display on Fedora 15 x86, presumably due to
2268 overflows in int calculations in the display code.
2269 Also, if buffers had long lines, Emacs would freeze.
2270 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
2271 (set_window_hscroll): New function, containing the old guts of
2272 Fset_window_hscroll. Return the clipped value.
2273 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
2274 This avoids the need to check against PTRDIFF_MAX.
2275
2276 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
2277
2278 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2279
2280 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
2281
2282 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2283
2284 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
2285 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
2286 since GCC 4.4.6 issues a bogus warning for them.
2287
2288 Fix bugs in file timestamp newness comparisons.
2289 * fileio.c (Ffile_newer_than_file_p):
2290 * lread.c (Fload): Use full timestamp resolution of files,
2291 not just the 1-second resolution, so that files that are only
2292 slightly newer still count as newer.
2293 * fileio.c (Ffile_newer_than_file_p): Don't assume file
2294 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
2295
2296 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
2297
2298 * fileio.c: Improve handling of file time marker. (Bug#11852)
2299 (special_mtime): New function.
2300 (Finsert_file_contents, Fverify_visited_file_modtime):
2301 Use it to set special mtime values consistently.
2302
2303 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
2304
2305 * fileio.c (Finsert_file_contents): Properly handle st_mtime
2306 marker for non-existing file. (Bug#11852)
2307
2308 2012-07-03 Glenn Morris <rgm@gnu.org>
2309
2310 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
2311 and did not make it into globals.h).
2312
2313 2012-07-03 Tom Tromey <tromey@redhat.com>
2314
2315 * window.c (Fset_window_margins, Fset_window_fringes)
2316 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
2317 * textprop.c (Fprevious_property_change): No longer static.
2318 * syntax.c (Fsyntax_table_p): No longer static.
2319 * process.c (Fget_process, Fprocess_datagram_address): No longer
2320 static.
2321 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
2322 * keyboard.c (Fcommand_execute): No longer static.
2323 Remove EXFUN.
2324 * insdel.c (Fcombine_after_change_execute): No longer static.
2325 * image.c (Finit_image_library): No longer static.
2326 * fileio.c (Fmake_symbolic_link): No longer static.
2327 * eval.c (Ffetch_bytecode): No longer static.
2328 * editfns.c (Fuser_full_name): No longer static.
2329 * doc.c (Fdocumentation_property, Fsnarf_documentation):
2330 No longer static.
2331 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
2332 static.
2333 * dired.c (Ffile_attributes): No longer static.
2334 * composite.c (Fcomposition_get_gstring): No longer static.
2335 * callproc.c (Fgetenv_internal): No longer static.
2336
2337 * ccl.h: Remove EXFUNs.
2338 * buffer.h: Remove EXFUNs.
2339 * dispextern.h: Remove EXFUNs.
2340 * intervals.h: Remove EXFUNs.
2341 * fontset.h: Remove EXFUN.
2342 * font.h: Remove EXFUNs.
2343 * dosfns.c (system_process_attributes): Remove EXFUN.
2344 * keymap.h: Remove EXFUNs.
2345 * lisp.h: Remove EXFUNs.
2346 * w32term.h: Remove EXFUNs.
2347 * window.h: Remove EXFUNs.
2348 * xsettings.h: Remove EXFUN.
2349 * xterm.h: Remove EXFUN.
2350
2351 2012-07-03 Glenn Morris <rgm@gnu.org>
2352
2353 * lisp.h (Frandom): Make it visible to C.
2354 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
2355 buffer for invisible buffers. (Bug#1229)
2356
2357 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2358
2359 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
2360 values which aren't power of 2.
2361 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
2362 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
2363 accordingly.
2364
2365 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
2366
2367 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
2368
2369 * alloc.c (mark_object): Revert part of last patch to use `switch'.
2370
2371 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2372
2373 * alloc.c (allocate_vector_block): Remove redundant
2374 calls to mallopt if DOUG_LEA_MALLOC is defined.
2375 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
2376 avoid calls to mallopt if zero_vector is returned.
2377
2378 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2381 is enabled, avoid dereferencing NULL current_sblock if
2382 running undumped.
2383
2384 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2385
2386 Cleanup basic buffer management.
2387 * buffer.h (struct buffer): Change layout to use generic vector
2388 marking code. Fix some comments. Change type of 'clip_changed'
2389 to bitfield. Remove unused #ifndef old.
2390 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2391 (GET_OVERLAYS_AT): Fix indentation.
2392 (for_each_per_buffer_object_at): New macro.
2393 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2394 (Fbuffer_local_variables): Use it.
2395 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2396 * alloc.c (allocate_buffer): Adjust to match new layout of
2397 struct buffer. Fix comment.
2398 (mark_overlay): New function.
2399 (mark_buffer): Use it. Use mark_vectorlike to mark normal
2400 Lisp area of struct buffer.
2401 (mark_object): Use it. Adjust marking of misc objects
2402 and related comments.
2403
2404 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
2405
2406 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2407 wrapper that is not needed because the wrapped code is a no-op (zero
2408 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2409 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2410
2411 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
2412
2413 * alloc.c (mark_buffer): Simplify. Remove prototype.
2414 (mark_object): Add comment. Reorganize marking of vector-like
2415 objects. Use CHECK_LIVE for all vector-like objects except buffers
2416 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
2417 redundant calls to mark_vectorlike for bool vectors.
2418
2419 2012-06-30 Glenn Morris <rgm@gnu.org>
2420
2421 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2422
2423 * epaths.in (PATH_SITELOADSEARCH): New.
2424 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2425 This is rather than relying on --enable-locallisppath elements
2426 having "site-lisp" in their names. (Bug#10208#25, 11658)
2427
2428 2012-06-30 Eli Zaretskii <eliz@gnu.org>
2429
2430 * w32proc.c (sys_select): Accept and ignore one more argument.
2431
2432 * w32.c (emacs_gnutls_pull): Call select with one more argument.
2433
2434 * sysselect.h [DOS_NT]: Don't include sys/select.h.
2435 (pselect) [!MS_DOS]: Redirect to sys_select.
2436
2437 * sysdep.c: Don't include dos.h and dosfns.h.
2438
2439 * process.c (sys_select):
2440 * msdos.c (sys_select): Accept one more argument and ignore it.
2441
2442 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2443 adapt data types and code to that.
2444
2445 * dosfns.c:
2446 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2447 which clashes with the gnulib function of the same name.
2448
2449 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
2450
2451 * font.c (font_style_to_value, font_style_symbolic)
2452 (font_prop_validate_style): Add type checks for values in
2453 font_style_table.
2454
2455 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2456 argument.
2457 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2458 uses.
2459
2460 2012-06-29 Eli Zaretskii <eliz@gnu.org>
2461
2462 * xdisp.c (try_window_id): Undo last change.
2463
2464 * w32.c (getwd): Adjust commentary about startup_dir.
2465 (init_environment): Always call sys_access, even in non-MSVC
2466 builds. Don't chdir to the directory of the Emacs executable.
2467 This undoes code from 1997 which was justified by the need to
2468 "avoid conflicts when removing and renaming directories". But its
2469 downside was that every relative file name was being interpreted
2470 relative to the directory of the Emacs executable, which can never
2471 be TRT. In particular, it broke sys_access when called with
2472 relative file names.
2473 (sys_access): Map GetLastError to errno.
2474
2475 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2476
2477 * window.h (struct window): Change type of 'fringes_outside_margins'
2478 to bitfield. Fix comment. Adjust users accordingly.
2479 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2480 Adjust comment.
2481 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2482 to ptrdiff_t.
2483
2484 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
2485
2486 * gnutls.c (emacs_gnutls_handshake):
2487 Add QUIT to make the loop interruptible.
2488
2489 2012-06-29 Glenn Morris <rgm@gnu.org>
2490
2491 * charset.c (init_charset): Make lack of etc/charsets fatal.
2492
2493 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 * editfns.c (region_limit): Fix type mismatch.
2496
2497 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2498
2499 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2500 undefined. Convert from xassert to eassert.
2501 * nsmenu.m: Convert from xassert to eassert.
2502 * nsterm.m: Likewise.
2503
2504 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
2505
2506 * editfns.c (region_limit): Clip to narrowing (bug#11770).
2507
2508 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2509
2510 Avoid integer overflow on scroll-left and scroll-right.
2511 * window.c (HSCROLL_MAX): New macro.
2512 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2513 overflow when requested scroll falls outside ptrdiff_t range.
2514
2515 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2516
2517 * window.h (struct window): Change type of 'hscroll',
2518 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2519 'last_modified' and 'last_overlay_modified' to EMACS_INT.
2520 Adjust users accordingly.
2521 * xdisp.c (try_cursor_movement): Replace type check with eassert.
2522 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
2523 from EMACS_INT to ptrdiff_t.
2524 (make_window): Omit redundant initialization.
2525
2526 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
2527
2528 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2529
2530 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2531
2532 * window.h (struct window): Change type of 'use_time' and
2533 'sequence_number' from Lisp_Object to int.
2534 * frame.c (make_frame): Adjust users accordingly.
2535 * print.c (print_object): Likewise.
2536 * window.c (select_window, Fwindow_use_time, make_parent_window)
2537 (make_window): Likewise.
2538
2539 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2540
2541 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2542 enabled with --enable-checking=[all,glyphs] configure option.
2543 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2544 adjust comments accordingly.
2545 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2546 undefined, adjust comments accordingly.
2547 * image.c: Likewise.
2548 * scroll.c: Likewise.
2549 * w32fns.c: Likewise.
2550 * w32term.c: Likewise.
2551 * xdisp.c: Likewise.
2552 * xfaces.c: Likewise.
2553 * xfns.c: Likewise.
2554 * xterm.c: Likewise.
2555
2556 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2557
2558 Generalize run-time debugging checks.
2559 * dispextern.h (XASSERTS): Remove.
2560 * fontset.c (xassert): Remove.
2561 Convert from xassert to eassert.
2562 * alloc.c: Convert from xassert to eassert.
2563 * bidi.c: Likewise.
2564 * dispnew.c: Likewise.
2565 * fns.c: Likewise.
2566 * fringe.c: Likewise.
2567 * ftfont.c: Likewise.
2568 * gtkutil.c: Likewise.
2569 * image.c: Likewise.
2570 * keyboard.c: Likewise.
2571 * menu.c: Likewise.
2572 * process.c: Likewise.
2573 * scroll.c: Likewise.
2574 * sound.c: Likewise.
2575 * term.c: Likewise.
2576 * w32console.c: Likewise.
2577 * w32fns.c: Likewise.
2578 * w32term.c: Likewise.
2579 * window.c: Likewise.
2580 * xdisp.c: Likewise.
2581 * xfaces.c: Likewise.
2582 * xfns.c: Likewise.
2583 * xselect.c: Likewise.
2584 * xterm.c: Likewise.
2585
2586 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2587
2588 * fns.c (maybe_resize_hash_table): Output message when growing the
2589 purify-hashtable.
2590
2591 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2592
2593 * alloc.c (allocate_string_data): Remove dead code.
2594 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2595 avoid GCC warning about unused macro.
2596
2597 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2598
2599 * alloc.c (allocate_string): Omit intervals initialization.
2600 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2601 as in make_pure_string and make_pure_c_string.
2602
2603 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2604
2605 * alloc.c (allocate_string): Fix last change.
2606
2607 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2608
2609 * alloc.c (allocate_string): Remove two redundant calls
2610 to memset, add explicit initialization where appropriate.
2611
2612 2012-06-27 Glenn Morris <rgm@gnu.org>
2613
2614 * lisp.mk (lisp): Remove paths.elc.
2615
2616 2012-06-27 Chong Yidong <cyd@gnu.org>
2617
2618 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2619
2620 2012-06-26 John Wiegley <johnw@newartisans.com>
2621
2622 * unexmacosx.c (copy_data_segment): Add two section names used
2623 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2624
2625 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2626 when building with Clang.
2627
2628 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2629
2630 * eval.c (Fapply): Allow calling it with a single argument.
2631
2632 2012-06-26 Eli Zaretskii <eliz@gnu.org>
2633
2634 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2635 _stricmp and _strnicmp.
2636 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2637
2638 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2639
2640 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2641 allocated window.
2642 (allocate_process): Likewise for new process.
2643 (allocate_terminal): Change to use offsetof.
2644 (allocate_frame): Likewise.
2645 * frame.c (make_frame): Omit redundant initialization.
2646 * window.c (make_parent_window): Use memset.
2647 (make_window): Omit redundant initialization.
2648 * process.c (make_process): Omit redundant initialization.
2649 * terminal.c (create_terminal): Likewise.
2650
2651 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 * term.c (delete_tty): Remove redundant call to memset.
2654
2655 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2656
2657 * alloc.c: Remove build_string.
2658 * lisp.h: Define build_string as static inline. This provides
2659 a better opportunity to optimize away calls to strlen when the
2660 function is called with compile-time constant argument.
2661 * image.c (imagemagick_error): Convert to build_string.
2662 * w32proc.c (sys_spawnve): Likewise.
2663 * xterm.c (x_term_init): Likewise.
2664
2665 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2666
2667 Use sprintf return value instead of invoking strlen on result.
2668 In the old days this wasn't portable, since some sprintf
2669 implementations returned char *. But they died out years ago and
2670 Emacs already assumes sprintf returns int.
2671 Similarly for float_to_string.
2672 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2673 * ccl.c (ccl_driver):
2674 * character.c (string_escape_byte8):
2675 * data.c (Fnumber_to_string):
2676 * doprnt.c (doprnt):
2677 * print.c (print_object):
2678 * xdisp.c (message_dolog):
2679 * xfns.c (syms_of_xfns):
2680 Use sprintf or float_to_string result to avoid need to call strlen.
2681 * data.c (Fnumber_to_string):
2682 Use make_unibyte_string, since the string must be ASCII.
2683 * lisp.h, print.c (float_to_string): Now returns int length.
2684 * term.c (produce_glyphless_glyph):
2685 Use sprintf result rather than recomputing it.
2686
2687 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2688 * Makefile.in (ALL_CFLAGS):
2689 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2690 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2691
2692 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2693
2694 * dispextern.h (xstrcasecmp): Define to library function
2695 strcasecmp if available.
2696 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2697
2698 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2699
2700 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2701 Avoid comma operator.
2702 * menu.c (push_submenu_start, push_submenu_end)
2703 (push_left_right_boundary, push_menu_pane): Likewise.
2704 * msdos.c (dos_rawgetc): Likewise.
2705
2706 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2707
2708 * xfns.c (xic_create_fontsetname): Remove redundant calls
2709 to memset.
2710
2711 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2712
2713 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2714 sprintf already null-terminates its output.
2715
2716 * xfns.c (x_window): Remove redundant cast.
2717
2718 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2719
2720 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2721 `const char *' to `char *' to avoid compiler warning.
2722
2723 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2724
2725 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2726 instead of truncating it to 63 (admittedly a generous limit).
2727
2728 * process.c: Fix spelling and caps in comments.
2729
2730 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2731
2732 * emacs.c (setpgrp): Remove definition, unused.
2733 * sysdep.c (setpgrp): Remove definition, not used in this file.
2734
2735 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
2736
2737 * makefile.w32-in: Update dependencies.
2738
2739 2012-06-24 Eli Zaretskii <eliz@gnu.org>
2740
2741 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2742 (SYSTIME_H): Add nt/inc/sys/time.h.
2743
2744 * systime.h [WINDOWSNT]: Include sys/time.h.
2745
2746 * s/ms-w32.h (struct timespec): Definition moved from
2747 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2748
2749 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2750
2751 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2752 * buffer.h (buffer_slot_type_mismatch):
2753 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2754 * eval.c (unwind_to_catch):
2755 * image.c (my_png_error, my_error_exit):
2756 * keyboard.c (quit_throw_to_read_char, user_error)
2757 (Fexit_recursive_edit, Fabort_recursive_edit):
2758 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2759 (wrong_type_argument, buffer_overflow, __executable_start)
2760 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2761 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
2762 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
2763 (fatal):
2764 (child_setup) [!DOS_NT]:
2765 * lread.c (end_of_file_error, invalid_syntax):
2766 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2767 * puresize.h (pure_write_error):
2768 * search.c (matcher_overflow):
2769 * sound.c (sound_perror, alsa_sound_perror):
2770 * sysdep.c, syssignal.h (croak):
2771 * term.c (maybe_fatal, vfatal):
2772 * textprop.c (text_read_only):
2773 * undo.c (user_error):
2774 * unexmacosx.c (unexec_error):
2775 * xterm.c (x_ins_del_lines, x_delete_glyphs):
2776 Use _Noreturn rather than NO_RETURN.
2777 No need for separate decl merely because of _Noreturn.
2778 * sound.c (sound_warning, parse_sound):
2779 Remove unnecessary forward decls.
2780
2781 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2782
2783 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
2784 * lisp.h (WAIT_READING_MAX): New macro.
2785 * dispnew.c (Fsleep_for, sit_for):
2786 * keyboard.c (kbd_buffer_get_event):
2787 * process.c (Faccept_process_output):
2788 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
2789 This improves on the previous patch, which introduced a bug
2790 when time_t is unsigned and as wide as intmax_t.
2791 See <http://bugs.gnu.org/9000#51>.
2792
2793 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2794
2795 * dispnew.c (sit_for, Fsleep_for):
2796 * keyboard.c (kbd_buffer_get_event):
2797 * process.c (Faccept_process_output): Avoid compiler warnings when
2798 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
2799
2800 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
2801
2802 * makefile.w32-in: Update dependencies.
2803
2804 * w32.c (ltime): Add return type and declare static.
2805 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
2806
2807 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2808
2809 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
2810 Privately reported by Herbert J. Skuhra.
2811 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
2812 All uses changed.
2813 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
2814 not make_lisp_timeval, when the argument is of type EMACS_TIME.
2815
2816 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2817
2818 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
2819 last argument of make_unibyte_string.
2820
2821 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
2822 language ID in the event parameters.
2823
2824 * w32term.c (w32_read_socket): Put the new keyboard codepage into
2825 event.code, not the obscure "character set ID".
2826
2827 2012-06-23 Chong Yidong <cyd@gnu.org>
2828
2829 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
2830
2831 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2832
2833 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
2834 * w32.c (fdutimens): New function.
2835
2836 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
2837
2838 * s/ms-w32.h (pselect): Redirect to sys_select.
2839
2840 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
2841
2842 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
2843 in the logic of incrementing and decrementing the value of
2844 use_relocatable_buffers.
2845
2846 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
2849 Privately reported by Herbert J. Skuhra.
2850 [__FreeBSD__]: Remove "*/" typo after "#include".
2851 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
2852 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
2853 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
2854 Don't assume EMACS_TIME and struct timeval are the same type.
2855
2856 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2857
2858 Support higher-resolution time stamps (Bug#9000).
2859 The time stamps are only nanosecond-resolution at the C level,
2860 since that's the best that any real-world system supports now.
2861 But they are picosecond-resolution at the Lisp level, as that's
2862 easy, and leaves room for future OS improvements.
2863
2864 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
2865 (LIBES): Use it.
2866
2867 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
2868 Don't get current time unless it's needed.
2869
2870 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2871 now provides it if it's absent.
2872 (start_atimer): Port to higher-res time stamps.
2873 Check for time stamp overflow. Don't get current time more
2874 often than is needed.
2875
2876 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2877 Include systime.h, not time.h.
2878 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2879
2880 * dired.c: Include stat-time.h.
2881 (Ffile-attributes): File times now have higher resolution.
2882
2883 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2884 (struct image): Timestamp now has higher resolution.
2885
2886 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2887 has at least microseconds now. All uses removed.
2888 (update_frame, update_single_window, update_window, update_frame_1)
2889 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2890
2891 * editfns.c (time_overflow): Now extern.
2892 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2893 (float-time, Fformat_time_string, Fcurrent_time_string)
2894 (Fcurrent_time_zone): Accept and generate higher-resolution
2895 time stamps.
2896 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2897 (decode_time_components, lisp_seconds_argument): New functions.
2898 (make_time): Now static.
2899 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2900 Report an error if the time is invalid, rather than having the caller
2901 do that.
2902
2903 * fileio.c: Include <stat-time.h>
2904 (Fcopy_file): Copy higher-resolution time stamps.
2905 Prefer to set the time stamp via a file descriptor if that works.
2906 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2907 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2908 (Fvisited_file_modtime, Fset_visited_file_modtime):
2909 Support higher-resolution time stamps.
2910
2911 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2912
2913 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2914
2915 * image.c (prepare_image_for_display, clear_image_cache)
2916 (lookup_image): Port to higer-resolution time stamps.
2917
2918 * keyboard.c (start_polling, bind_polling_period):
2919 Check for time stamp overflow.
2920 (read_char, kbd_buffer_get_event, timer_start_idle)
2921 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2922 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2923 Port to higher-resolution time stamps. Do not assume time_t is signed.
2924 (decode_timer): New function. Timers are now vectors of length 9,
2925 not 8, to accommodate the picosecond component.
2926 (timer_check_2): Use it.
2927
2928 * nsterm.m (select_timeout, timeval_subtract): Remove.
2929 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2930 as they're a bit more accurate and handle overflow better.
2931 (ns_select): Change prototype to be compatible with pselect.
2932 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2933 * nsterm.h (ns_select): Adjust prototype.
2934
2935 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2936 us-resolution time stamps.
2937 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2938
2939 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2940
2941 * lisp.h (time_overflow): New decl.
2942 (wait_reading_process_output): First arg is now intmax_t, not int,
2943 to accommodate larger waits.
2944
2945 * process.h (struct Lisp_Process.read_output_delay):
2946 Now counts nanoseconds, not microseconds.
2947 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2948 EMACS_HAS_USECS.
2949 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2950 (wait_reading_process_output):
2951 Port to ns-resolution time stamps.
2952 (Faccept_process_output, wait_reading_process_output):
2953 Check for time stamp overflow. Do not assume time_t is signed.
2954 (select_wrapper): Remove; we now use pselect.
2955 (Fprocess_attributes): Now generates ns-resolution time stamps.
2956
2957 * sysdep.c: Include utimens.h. Don't include utime.h
2958 or worry about struct utimbuf; gnulib does that for us now.
2959 (gettimeofday): Remove; gnulib provides a substitute.
2960 (make_timeval): New function.
2961 (set_file_times): Now sets ns-resolution time stamps.
2962 New arg FD; all uses changed.
2963 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2964 (system_process_attributes):
2965 Now returns ns-resolution time stamp. All uses changed.
2966 Check for time stamp overflow.
2967
2968 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2969 provides a substitute now.
2970
2971 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2972 since it guarantees struct timespec.
2973 (EMACS_TIME): Now struct timespec, so that we can support
2974 ns-resolution time stamps.
2975 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2976 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2977 (EMACS_USECS): Remove.
2978 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2979 so multiply the arg by 1000 before storing it.
2980 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2981 New macros.
2982 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2983 Port to ns-resolution time stamps.
2984 (EMACS_TIME_NEG_P): Remove; replaced by....
2985 (EMACS_TIME_SIGN): New macro.
2986 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2987 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2988 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2989 (make_timeval, make_lisp_time, decode_time_components): New decls.
2990 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2991 that it mishandled time_t overflow. You can't compare by subtracting!
2992 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2993 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
2994
2995 * term.c: Include <sys/time.h>.
2996 (timeval_to_Time): New function, for proper overflow wraparound.
2997 (term_mouse_position, term_mouse_click): Use it.
2998
2999 * undo.c (record_first_change): Support higher-resolution time stamps
3000 in the undo buffer.
3001 (Fprimitive_undo): Use them when restoring time stamps.
3002
3003 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
3004 (w32_get_internal_run_time):
3005 Port to higher-resolution Emacs time stamps.
3006 (ltime): Now accepts single 64-bit integer, as that's more convenient
3007 for callers.
3008
3009 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
3010
3011 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
3012 for compatibility with pselect. Support ns-resolution time stamps.
3013
3014 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
3015
3016 * xselect.c (wait_for_property_change, x_get_foreign_selection):
3017 Check for time stamp overflow, and support ns-resolution time stamps.
3018
3019 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
3020 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
3021 (timeval_subtract): Remove; no longer needed.
3022 (XTflash, XTring_bell, x_wait_for_event):
3023 Port to ns-resolution time stamps. Don't assume time_t is signed.
3024
3025 2012-06-22 Chong Yidong <cyd@gnu.org>
3026
3027 * xdisp.c (x_consider_frame_title): Revert last change.
3028
3029 2012-06-22 Eli Zaretskii <eliz@gnu.org>
3030
3031 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
3032 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
3033 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
3034 staticidx goes up to 1597 out of 1600 = 0x640.)
3035
3036 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
3037
3038 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
3039 Otherwise, the umask might be mistakenly 0 while handling input signals.
3040
3041 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
3042
3043 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
3044
3045 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
3046
3047 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
3048 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
3049 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
3050 access to `contents' member of Lisp_Vector objects with AREF and ASET
3051 where appropriate.
3052
3053 2012-06-19 Chong Yidong <cyd@gnu.org>
3054
3055 * frame.c (delete_frame): When selecting a frame on a different
3056 text terminal, do not alter the terminal's top-frame.
3057
3058 * xdisp.c (format_mode_line_unwind_data): Record the target
3059 frame's selected window and its terminal's top-frame.
3060 (unwind_format_mode_line): Restore them.
3061 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
3062 Callers changed.
3063 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
3064 since tty frames can be explicitly named.
3065 (prepare_menu_bars): Likewise.
3066
3067 * term.c (Ftty_top_frame): New function.
3068
3069 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3070
3071 Port byte-code-meter to modern targets.
3072 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
3073 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
3074 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
3075 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
3076 (METER_1, METER_2): Simplify.
3077
3078 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
3079
3080 * data.c (Fdefalias): Return `symbol' (bug#11686).
3081
3082 2012-06-18 Martin Rudalics <rudalics@gmx.at>
3083
3084 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
3085 gets killed during executing of this function (Bug#11665).
3086 Try to always return Qt when the buffer has been actually killed.
3087 (Vkill_buffer_query_functions): In doc-string say that functions
3088 run by this hook should not change the current buffer.
3089
3090 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 Fix recently-introduced process.c problems found by static checking.
3093 * process.c (write_queue_push, write_queue_pop, send_process):
3094 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
3095 (write_queue_pop): Fix pointer signedness problem.
3096 (send_process): Remove unused local.
3097
3098 2012-06-17 Chong Yidong <cyd@gnu.org>
3099
3100 * xdisp.c (redisplay_internal): No need to redisplay terminal
3101 frames that are not on top.
3102
3103 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
3104
3105 * process.c (make_process): Initialize write_queue.
3106 (write_queue_push, write_queue_pop): New functions.
3107 (send_process): Use them to maintain correct ordering of process
3108 writes (Bug#10815).
3109
3110 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
3111
3112 * lisp.h (eassert): Assume C89 or later.
3113 This removes the need for CHECK.
3114 (CHECK): Remove. Its comments about always evaluating its
3115 argument were confusing, as 'eassert' typically does not evaluate
3116 its argument.
3117
3118 * coding.c (produce_chars): Use ptrdiff_t, not int.
3119
3120 * xterm.c (x_draw_underwave): Check for integer overflow.
3121 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
3122
3123 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
3124
3125 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
3126 referenced (Bug#11583).
3127
3128 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
3129
3130 Implement wave-style variant of underlining.
3131 * dispextern.h (face_underline_type): New enum.
3132 (face): Add field for underline type.
3133 * nsterm.m (ns_draw_underwave): New function.
3134 (ns_draw_text_decoration): Use it.
3135 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
3136 New functions.
3137 (x_draw_glyph_string): Use them.
3138 * xfaces.c (Qline, Qwave): New Lisp objects.
3139 (check_lface_attrs, merge_face_ref)
3140 (Finternal_set_lisp_face_attribute, realize_x_face):
3141 Handle wave-style underline face attributes.
3142 * xterm.c (x_draw_underwave): New function.
3143 (x_draw_glyph_string): Use it.
3144
3145 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
3146
3147 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
3148 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
3149 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
3150 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
3151 ($(BLD)/w32select.$(O)): Update dependencies.
3152
3153 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3154
3155 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
3156 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
3157 * character.c (_fetch_multibyte_char_p): Remove.
3158 * alloc.c: Include "character.h" before "buffer.h".
3159 * bidi.c: Likewise.
3160 * buffer.c: Likewise.
3161 * bytecode.c: Likewise.
3162 * callint.c: Likewise.
3163 * callproc.c: Likewise.
3164 * casefiddle.c: Likewise.
3165 * casetab.c: Likewise.
3166 * category.c: Likewise.
3167 * cmds.c: Likewise.
3168 * coding.c: Likewise.
3169 * composite.c: Likewise.
3170 * dired.c: Likewise.
3171 * dispnew.c: Likewise.
3172 * doc.c: Likewise.
3173 * dosfns.c: Likewise.
3174 * editfns.c: Likewise.
3175 * emacs.c: Likewise.
3176 * fileio.c: Likewise.
3177 * filelock.c: Likewise.
3178 * font.c: Likewise.
3179 * fontset.c: Likewise.
3180 * fringe.c: Likewise.
3181 * indent.c: Likewise.
3182 * insdel.c: Likewise.
3183 * intervals.c: Likewise.
3184 * keyboard.c: Likewise.
3185 * keymap.c: Likewise.
3186 * lread.c: Likewise.
3187 * macros.c: Likewise.
3188 * marker.c: Likewise.
3189 * minibuf.c: Likewise.
3190 * nsfns.m: Likewise.
3191 * nsmenu.m: Likewise.
3192 * print.c: Likewise.
3193 * process.c: Likewise.
3194 * regex.c: Likewise.
3195 * region-cache.c: Likewise.
3196 * search.c: Likewise.
3197 * syntax.c: Likewise.
3198 * term.c: Likewise.
3199 * textprop.c: Likewise.
3200 * undo.c: Likewise.
3201 * unexsol.c: Likewise.
3202 * w16select.c: Likewise.
3203 * w32fns.c: Likewise.
3204 * w32menu.c: Likewise.
3205 * window.c: Likewise.
3206 * xdisp.c: Likewise.
3207 * xfns.c: Likewise.
3208 * xmenu.c: Likewise.
3209 * xml.c: Likewise.
3210 * xselect.c: Likewise.
3211
3212 2012-06-16 Eli Zaretskii <eliz@gnu.org>
3213
3214 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
3215 If all the glyphs of the glyph row came from strings, and we have no
3216 cursor positioning clues, put the cursor on the first glyph of the
3217 row.
3218 (handle_face_prop): Use chunk-relative overlay string index when
3219 indexing into it->string_overlays array. (Bug#11653)
3220 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
3221 the rightmost. (Bug#11720)
3222
3223 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3224
3225 * category.h (CHAR_HAS_CATEGORY): Define as inline.
3226 (CATEGORY_MEMBER): Enforce 1/0 value.
3227 * category.c (_temp_category_set): Remove.
3228
3229 2012-06-16 Eli Zaretskii <eliz@gnu.org>
3230
3231 * window.c (Fdelete_other_windows_internal)
3232 (Fdelete_window_internal): Don't access frame's mouse highlight
3233 info of the initial frame. (Bug#11677)
3234
3235 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
3236
3237 * .gdbinit (xgetint): Fix recently-introduced paren typo.
3238 Assume USE_2_TAGS_FOR_INTS.
3239 (xreload): Adjust $tagmask width to match recent lisp.h change.
3240
3241 Simplify lisp.h in minor ways that should not affect code.
3242 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
3243 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
3244 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
3245 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
3246 (INTTYPEBITS): New macro, for clarity.
3247 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
3248 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
3249 Simplify now that USE_LSB_TAG is always defined.
3250 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
3251 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
3252
3253 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
3254
3255 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
3256
3257 2012-06-13 Glenn Morris <rgm@gnu.org>
3258
3259 * s/bsd-common.h (BSD4_3):
3260 * s/usg5-4-common.h (USG5_4): No longer define; unused.
3261
3262 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
3263
3264 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
3265 instead of union.
3266 (XLI, XIL): Define.
3267 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
3268 Use them.
3269 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
3270 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
3271 * alloc.c (widen_to_Lisp_Object): Remove.
3272 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
3273 * frame.c (delete_frame): Remove outdated comment.
3274 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
3275 USE_LISP_UNION_TYPE.
3276 (Fw32_unregister_hot_key): Likewise.
3277 (Fw32_toggle_lock_key): Likewise.
3278 * w32menu.c (add_menu_item): Likewise.
3279 (w32_menu_display_help): Use XIL instead of checking
3280 USE_LISP_UNION_TYPE.
3281 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
3282 (init_heap): Likewise.
3283 * w32term.c (w32_read_socket): Update comment.
3284
3285 2012-06-13 Glenn Morris <rgm@gnu.org>
3286
3287 * s/usg5-4-common.h, src/s/unixware.h:
3288 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
3289
3290 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
3291
3292 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
3293
3294 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
3295 * alloc.c (make_number) [!defined make_number]:
3296 Remove, as lisp.h always defines this now.
3297 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
3298 (roundup_size): Verify that it is a power of 2.
3299 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
3300 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
3301 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
3302 -DUSE_LSB_TAG=0, to override the automatically-selected default.
3303 USE_LSB_TAG now is always defined to be either 0 or 1.
3304 All uses changed.
3305 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
3306 code works fine either way, and efficiency is not a concern here,
3307 as the union type is for debugging, not for production.
3308 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
3309 Use an inline function on all platforms when using the union type,
3310 since this is simpler and 'static inline' can be used portably
3311 within Emacs now.
3312 (LISP_INITIALLY_ZERO): New macro.
3313 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
3314 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
3315
3316 2012-06-12 Glenn Morris <rgm@gnu.org>
3317
3318 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
3319
3320 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
3321
3322 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
3323 Move BROKEN_SIGIO to configure.
3324
3325 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
3326 Move NO_TERMIO to configure.
3327
3328 2012-06-12 Chong Yidong <cyd@gnu.org>
3329
3330 * image.c (imagemagick_load_image): Use MagickFlattenImage if
3331 MagickMergeImageLayers is undefined. Use pixel pusher loop if
3332 MagickExportImagePixels is undefined.
3333
3334 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
3335
3336 * image.c (imagemagick_load_image): Remove unused label.
3337
3338 2012-06-11 Glenn Morris <rgm@gnu.org>
3339
3340 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3341 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
3342 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
3343 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
3344
3345 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
3346
3347 * alloc.c (make_byte_code): New function.
3348 (Fmake_byte_code): Use it. Don't purify here.
3349 * lread.c (read1): Use it as well to avoid extra allocation.
3350
3351 2012-06-11 Chong Yidong <cyd@gnu.org>
3352
3353 * image.c (imagemagick_load_image): Implement transparency.
3354
3355 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
3356
3357 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
3358 account for preceding backslashes. (Bug#11663)
3359
3360 2012-06-09 Chong Yidong <cyd@gnu.org>
3361
3362 * term.c: Support italics in capable terminals (Bug#9652).
3363 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
3364 (turn_on_face): Output using TS_enter_italic_mode if available.
3365 Don't handle unused blinking and alt-charset cases.
3366 (turn_off_face): Handle italic case; discard unused tty_blinking_p
3367 and tty_alt_charset_p cases.
3368 (tty_capable_p, init_tty): Support italics.
3369
3370 * termchar.h (struct tty_display_info): Add field for italics.
3371 Remove unused blink field.
3372
3373 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
3374 Handle slant.
3375
3376 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
3377 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
3378 tty_alt_charset_p. Add tty_italic_p.
3379
3380 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
3381
3382 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3383 dbus_type_is_basic if available.
3384 (xd_extract_signed, xd_extract_unsigned): Rename from
3385 extract_signed and extract_unsigned, respectively. Adapt callers.
3386
3387 2012-06-09 Chong Yidong <cyd@gnu.org>
3388
3389 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3390
3391 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3392 case (Bug#9752).
3393
3394 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * xdisp.c (vmessage): Treat frame message as multibyte.
3397 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3398 would generate the diagnostic "Making \302\247 buffer-local while
3399 let-bound!".
3400
3401 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3402
3403 * dispnew.c (showing_window_margins_p): Undo last change, which
3404 was done due to an inadvertent commit.
3405 (adjust_frame_glyphs_for_frame_redisplay): Do call
3406 showing_window_margins_p.
3407
3408 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3409
3410 * eval.c (Fmake_var_non_special): New primitive.
3411 (syms_of_eval): Defsubr it.
3412 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3413
3414 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
3415
3416 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3417 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3418
3419 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3420
3421 * alloc.c (allocate_vectorlike): Fix last change.
3422
3423 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
3424
3425 Block-based vector allocation of small vectors.
3426 * lisp.h (struct vectorlike_header): New field `nbytes',
3427 adjust comment accordingly.
3428 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3429 to denote vector blocks. Adjust users (live_vector_p,
3430 mark_maybe_pointer, valid_lisp_object_p) accordingly.
3431 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3432 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3433 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3434 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3435 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3436 (roundup_size): New constant.
3437 (struct vector_block): New data type.
3438 (vector_blocks, vector_free_lists, zero_vector): New variables.
3439 (all_vectors): Rename to `large_vectors'.
3440 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3441 (sweep_vectors): New functions.
3442 (allocate_vectorlike): Return `zero_vector' as the only vector of
3443 0 items. Allocate new vector from block if vector size is less than
3444 or equal to VBLOCK_BYTES_MAX.
3445 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3446 (init_alloc_once): Add call to init_vectors.
3447
3448 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3449
3450 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3451
3452 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
3453
3454 * doprnt.c (doprnt): Truncate multibyte char correctly.
3455 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3456 would mishandle a string argument "Xc" if X was a multibyte
3457 character of length 2: it would truncate after X's first byte
3458 rather than including all of X.
3459
3460 2012-06-06 Chong Yidong <cyd@gnu.org>
3461
3462 * buffer.c (word_wrap): Doc fix.
3463
3464 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
3465
3466 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3467
3468 2012-06-03 Glenn Morris <rgm@gnu.org>
3469
3470 * xdisp.c (tool-bar-style): Doc fix.
3471
3472 2012-06-03 Ulrich Müller <ulm@gentoo.org>
3473
3474 * Makefile.in (PAXCTL): Define.
3475 (temacs$(EXEEXT)): Disable memory randomization for the temacs
3476 binary via PaX flags if the paxctl utility is available.
3477 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3478 Restore PaX flags to their default. (Bug#11398)
3479
3480 2012-06-03 Chong Yidong <cyd@gnu.org>
3481
3482 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3483 buffer (Bug#11226).
3484
3485 2012-06-03 Chong Yidong <cyd@gnu.org>
3486
3487 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3488 (note_mode_line_or_margin_highlight): If there is no help echo,
3489 use mode-line-default-help-echo. Handle the case where the mouse
3490 position is past the end of the mode line string.
3491
3492 * buffer.c (buffer_local_value_1): New function, split from
3493 Fbuffer_local_value; can return Qunbound.
3494 (Fbuffer_local_value): Use it.
3495 (Vmode_line_format): Docstring tweaks.
3496
3497 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3498
3499 * sysdep.c (system_process_attributes): Improve comment.
3500
3501 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
3502
3503 * keyboard.c: Export real-this-command to Elisp.
3504 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3505 and DEFVAR it. Update all users.
3506
3507 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3508
3509 * minibuf.c (Fassoc_string): Remove duplicate declaration.
3510
3511 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3512 Convert pctcpu and pctmem to Lisp float properly.
3513 Let the compiler fold better, as 100.0/0x8000 is exact.
3514
3515 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
3516
3517 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3518 cons_block.
3519
3520 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
3521
3522 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
3523
3524 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
3525
3526 For a 'struct window', replace some Lisp_Object fields to
3527 bitfields where appropriate, remove unused fields.
3528 * window.h (struct window): Remove unused 'last_mark_x' and
3529 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
3530 change it's type from Lisp_Object to bitfield.
3531 Change type of 'force_start', 'optional_new_start',
3532 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
3533 fields from Lisp_Object to bitfield. Adjust users accordingly.
3534
3535 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3536
3537 Pacify gcc -Wdouble-precision when using Xaw.
3538 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
3539 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
3540 Use 'float' consistently, rather than 'float' in most places
3541 and 'double' in a couple of places.
3542
3543 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3544
3545 * xdisp.c (handle_stop): Detect whether we have overlay strings
3546 loaded by testing it->current.overlay_string_index to be
3547 non-negative, instead of checking whether n_overlay_strings is
3548 positive. (Bug#11587)
3549
3550 2012-05-31 Chong Yidong <cyd@gnu.org>
3551
3552 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3553
3554 * doc.c (Fsubstitute_command_keys): Doc fix.
3555
3556 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3557
3558 * search.c (search_buffer): Remove calls to
3559 r_alloc_inhibit_buffer_relocation, as it is now called by
3560 maybe_unify_char, which was the cause of relocation of buffer text
3561 in bug#11519.
3562
3563 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3564
3565 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3566 for the duration of call to load_charset, to avoid problems with
3567 callers of maybe_unify_char that access buffer text through C
3568 pointers.
3569
3570 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3571 decrement the inhibition flag, instead of just setting or
3572 resetting it.
3573
3574 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3575
3576 Remove obsolete '#define static' cruft.
3577 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3578 This #undef was "temporary" in 2000; it is no longer needed
3579 now that '#define static' has gone away.
3580 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3581 (gray_bitmap_bits): Remove; no longer needed.
3582 All uses replaced with definiens.
3583 * xterm.c: Include "bitmaps/gray.xbm".
3584
3585 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 Clean up __executable_start, monstartup when --enable-profiling.
3588 The following changes affect the code only when profiling.
3589 * dispnew.c (__executable_start): Rename from safe_bcopy.
3590 Define only on platforms that need it.
3591 * emacs.c: Include <sys/gmon.h> when profiling.
3592 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3593 (__executable_start): Remove decl, since lisp.h does it now.
3594 (safe_bcopy): Remove decl; no longer has that name.
3595 (main): Coalesce #if into single bit of code, for simplicity.
3596 Cast pointers to uintptr_t, since standard libraries want integers
3597 and not pointers.
3598 * lisp.h (__executable_start): New decl.
3599
3600 2012-05-31 Glenn Morris <rgm@gnu.org>
3601
3602 * image.c (Fimagemagick_types): Doc fix.
3603
3604 2012-05-30 Jim Meyering <meyering@redhat.com>
3605
3606 * callproc.c (Fcall_process_region): Include directory component
3607 in mkstemp error message (Bug#11586).
3608
3609 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 * alloc.c, lisp.h (make_pure_vector): Now static.
3612
3613 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3614
3615 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3616 Move to byte-run.el.
3617 (Fautoload): Do the hash-doc more carefully.
3618 * data.c (Fdefalias): Purify definition, except for keymaps.
3619 (Qdefun): Move from eval.c.
3620 * lisp.h (Qdefun): Remove.
3621 * lread.c (read1): Tiny simplification.
3622
3623 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
3624
3625 Do not create empty overlays with the evaporate property (Bug#9642).
3626 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3627 Bug#9642, but explicitly check that the buffer the overlay would
3628 be moved to is live and rearrange lines to make sure that errors
3629 will not put the overlay in an inconsistent state.
3630 (Fdelete_overlay): Cosmetics.
3631
3632 2012-05-28 Eli Zaretskii <eliz@gnu.org>
3633
3634 * w32term.c (my_bring_window_to_top): New function.
3635 (x_raise_frame): Use handle returned by DeferWindowPos, which
3636 could be different from the original one.
3637 Call my_bring_window_to_top instead of my_set_foreground_window.
3638 (Bug#11513)
3639
3640 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3641 by calling BringWindowToTop.
3642
3643 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3644 (WM_EMACS_END): Increase by one.
3645
3646 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3647
3648 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3649 This avoids undefined behavior that might cause the eassert
3650 to not catch an out-of-range value.
3651
3652 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
3653
3654 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3655 Update dependencies.
3656
3657 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3658
3659 * bidi.c (bidi_mirror_char): Fix last change.
3660
3661 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3662
3663 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3664 when referring to sectname field in printf format.
3665
3666 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3667
3668 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3669 Only r_alloc_inhibit_buffer_relocation needed to be added;
3670 the others were already declared.
3671
3672 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3673 before checking whether it's out of range. Put the check inside
3674 eassert. See
3675 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3676
3677 2012-05-27 Ken Brown <kbrown@cornell.edu>
3678
3679 * callproc.c (Fcall_process): Restore a line that was accidentally
3680 commented out in the 2011-02-13 change (bug#11547).
3681
3682 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3683
3684 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3685 defined on ralloc.c.
3686
3687 * buffer.c [REL_ALLOC]: Remove prototypes of
3688 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3689 they are now on lisp.h.
3690
3691 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3692
3693 * search.c (search_buffer): Use it to inhibit relocation of buffer
3694 text while re_search_2 is doing its job, because re_search_2 is
3695 passed C pointers to buffer text. (Bug#11519)
3696
3697 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3698 Update value to 24.
3699
3700 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3701 state after an additional call to move_it_in_display_line_to, keep
3702 the values of it->max_ascent and it->max_descent found for the
3703 entire line.
3704 (pos_visible_p): Revert the comparison against bottom_y to what it
3705 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3706 (Bug#11464)
3707
3708 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3709
3710 Fix coding-related core dumps with gcc -ftrapv.
3711 The code was computing A - B, where A and B are pointers, and B is
3712 random garbage. This can lead to core dumps on platforms that
3713 have special pointer registers, and it also leads to core dumps on
3714 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3715 A - B only when B is initialized properly.
3716 * coding.c (coding_set_source, coding_set_destination): Return void.
3717 (coding_change_source, coding_change_destinations): New functions,
3718 with the old behaviors of coding_set_source and coding_set_destination.
3719 All callers that need an offset changed to use these new functions.
3720
3721 2012-05-26 Glenn Morris <rgm@gnu.org>
3722
3723 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3724
3725 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3726
3727 Extend mouse support on W32 text-mode console.
3728 * xdisp.c (draw_row_with_mouse_face):
3729 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
3730
3731 * w32console.c: Include window.h.
3732 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3733 New functions.
3734 (initialize_w32_display): Initialize mouse-highlight data.
3735
3736 * w32inevt.c: Include termchar.h and window.h.
3737 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3738 moves, call note_mouse_highlight. If help_echo changed, call
3739 gen_help_event to produce help-echo message in the echo area.
3740 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3741 highlight info.
3742
3743 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3744
3745 * lread.c (read1): Simplify slightly to avoid an overflow warning
3746 with GCC 4.7.0 on x86-64.
3747
3748 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3749
3750 * bidi.c (bidi_mirror_char): Revert last change: an int is
3751 definitely wide enough here.
3752
3753 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 Fix integer width and related bugs (Bug#9874).
3756 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
3757 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3758 (string_bytes, check_sblock, allocate_string_data):
3759 (compact_small_strings, Fmake_bool_vector, make_string)
3760 (make_unibyte_string, make_multibyte_string)
3761 (make_string_from_bytes, make_specified_string)
3762 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
3763 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
3764 (mark_vectorlike):
3765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3766 (allocate_pseudovector):
3767 Use int, not EMACS_INT, where int is wide enough.
3768 (inhibit_garbage_collection, Fgarbage_collect):
3769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3770 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
3771 int might not be wide enough.
3772 (bidi_cache_search, bidi_cache_find, bidi_init_it)
3773 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3774 (bidi_at_paragraph_end, bidi_find_paragraph_start)
3775 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
3776 (bidi_level_of_next_char, bidi_move_to_visually_next):
3777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3778 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
3779 (Fkill_buffer, Fset_buffer_major_mode)
3780 (advance_to_char_boundary, Fbuffer_swap_text)
3781 (Fset_buffer_multibyte, overlays_at, overlays_in)
3782 (overlay_touches_p, struct sortvec, record_overlay_string)
3783 (overlay_strings, recenter_overlay_lists)
3784 (adjust_overlays_for_insert, adjust_overlays_for_delete)
3785 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
3786 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
3787 (Foverlay_recenter, last_overlay_modification_hooks_used)
3788 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
3789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3790 (validate_region): Omit unnecessary test for b <= e,
3791 since that's guaranteed by the previous test.
3792 (adjust_overlays_for_delete): Avoid pos + length overflow.
3793 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
3794 (report_overlay_modification):
3795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3796 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
3797 Omit pointer cast, which isn't needed anyway, and doesn't work
3798 after the EMACS_INT -> ptrdiff_t change.
3799 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
3800 * buffer.h: Adjust decls to match defn changes elsewhere.
3801 (struct buffer_text, struct buffer):
3802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3803 Use EMACS_INT, not int, where int might not be wide enough.
3804 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
3805 not int, to avoid needless 32-bit limit on 64-bit hosts.
3806 (exec_byte_code): Use tighter memory-full test, one that checks
3807 for alloca overflow. Don't compute the address of the object just
3808 before an array, as that's not portable. Use EMACS_INT, not
3809 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
3810 * callint.c (Fcall_interactively):
3811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3812 * callproc.c (call_process_kill, Fcall_process):
3813 Don't assume pid_t fits into an Emacs fixnum.
3814 (call_process_cleanup, Fcall_process, child_setup):
3815 Don't assume pid_t fits into int.
3816 (call_process_cleanup, Fcall_process, delete_temp_file)
3817 (Fcall_process_region):
3818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3819 (Fcall_process): Simplify handling of volatile integers.
3820 Use int, not EMACS_INT, where int will do.
3821 * casefiddle.c (casify_object, casify_region, operate_on_word)
3822 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
3823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3824 (casify_object): Avoid integer overflow when overallocating buffer.
3825 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
3826 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
3827 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
3828 * category.h (CATEGORYP): Don't assume arg is nonnegative.
3829 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
3830 integers are now checked earlier. All uses replaced with XINT.
3831 (ccl_driver):
3832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3833 For CCL_MapSingle, check that content and value are in int range.
3834 (ccl_driver, Fregister_code_conversion_map):
3835 Check that Vcode_version_map_vector is a vector.
3836 (resolve_symbol_ccl_program): Check that vector header is in range.
3837 Always copy the vector, so that we can check its contents reliably
3838 now rather than having to recheck each instruction as it's being
3839 executed. Check that vector words fit in 'int'.
3840 (ccl_get_compiled_code, Fregister_ccl_program)
3841 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
3842 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
3843 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
3844 contents are in range.
3845 (Fccl_execute_on_string): Check that status is in range.
3846 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
3847 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
3848 Accept and return EMACS_INT, not int, because callers can pass values
3849 out of 'int' range.
3850 (c_string_width, strwidth, lisp_string_width, chars_in_text)
3851 (multibyte_chars_in_text, parse_str_as_multibyte)
3852 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
3853 (str_as_unibyte, str_to_unibyte, string_count_byte8)
3854 (string_escape_byte8, Fget_byte):
3855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3856 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
3857 avoid mishandling large integers.
3858 * character.h: Adjust decls to match defn changes elsewhere.
3859 * charset.c (load_charset_map_from_file, find_charsets_in_text)
3860 (Ffind_charset_region):
3861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3862 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
3863 (load_charset_map_from_vector, Fdefine_charset_internal):
3864 Don't assume fixnum fits in int.
3865 (load_charset_map_from_vector, Fmap_charset_chars):
3866 Remove now-unnecessary CHECK_NATNUMs.
3867 (Fdefine_charset_internal): Check ranges here, more carefully.
3868 Don't rely on undefined behavior with signed left shift overflow.
3869 Don't assume unsigned int fits into fixnum, or that fixnum fits
3870 into unsigned int. Don't require max_code to be a valid fixnum;
3871 that's not true for gb10830 4-byte on a 32-bit host. Allow
3872 invalid_code to be a cons, for the same reason. Require code_offset
3873 to be a character. Avoid int overflow if max_char is close
3874 to INT_MAX.
3875 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3876 this is intended anyway and avoids some undefined behavior.
3877 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3878 INDEX_TO_CODE_POINT, as that's what it expects.
3879 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
3880 * charset.h (DECODE_CHAR): Return int, not unsigned;
3881 this is what was intended anyway, and it avoids undefined behavior.
3882 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3883 integer-overflow issues.
3884 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3885 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3886 where the argument is EMACS_INT, and this behavior is not intended.
3887 * chartab.c (Fmake_char_table, Fset_char_table_range)
3888 (uniprop_get_decoder, uniprop_get_encoder):
3889 Don't assume fixnum fits in int.
3890 * cmds.c (move_point): New function, that does the gist of
3891 Fforward_char and Fbackward_char, but does so while checking
3892 for integer overflow more accurately.
3893 (Fforward_char, Fbackward_char): Use it.
3894 (Fforward_line, Fend_of_line, internal_self_insert)
3895 (internal_self_insert):
3896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3897 Fix a FIXME, by checking for integer overflow when calculating
3898 target_clm and actual_clm.
3899 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
3900 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
3901 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3902 (coding_alloc_by_making_gap, alloc_destination)
3903 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3904 (encode_coding_utf_16, detect_coding_emacs_mule)
3905 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3906 (detect_coding_iso_2022, decode_coding_iso_2022)
3907 (encode_invocation_designation, encode_designation_at_bol)
3908 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3909 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3910 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3911 (encode_coding_ccl, encode_coding_raw_text)
3912 (detect_coding_charset, decode_coding_charset)
3913 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3914 (produce_composition, produce_charset, produce_annotation)
3915 (decode_coding, handle_composition_annotation)
3916 (handle_charset_annotation, consume_chars, decode_coding_gap)
3917 (decode_coding_object, encode_coding_object, detect_coding_system)
3918 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3919 (code_convert_region, code_convert_string)
3920 (Fdefine_coding_system_internal)
3921 (coding_set_source, coding_set_destination):
3922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3923 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3924 (Fdefine_coding_system_internal):
3925 Don't assume fixnums fit in int.
3926 (decode_coding_gap, decode_coding_object, encode_coding_object)
3927 (Fread_coding_system, Fdetect_coding_region)
3928 (Funencodable_char_position, Fcheck_coding_systems_region)
3929 (get_translation, handle_composition_annotation, consume_chars):
3930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3931 (consume_chars): Rewrite to not calculate an address outside buffer.
3932 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
3933 Don't access memory outside of the args array.
3934 (Fdefine_coding_system_internal): Check for charset-id overflow.
3935 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3936 result of ENCODE_CHAR.
3937 * coding.h: Adjust decls to match defn changes elsewhere.
3938 (struct coding_system):
3939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3940 * composite.c (get_composition_id, find_composition)
3941 (run_composition_function, update_compositions)
3942 (compose_text, composition_gstring_put_cache)
3943 (composition_gstring_p, composition_gstring_width)
3944 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3945 (composition_compute_stop_pos, composition_reseat_it)
3946 (composition_update_it, struct position_record)
3947 (find_automatic_composition, composition_adjust_point)
3948 (Fcomposition_get_gstring, Ffind_composition_internal):
3949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3950 (update_compositions):
3951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3952 * composite.h: Adjust decls to match defn changes elsewhere.
3953 (struct composition):
3954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3955 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3956 Do not attempt to compute the address of the object just before a
3957 buffer; this is not portable.
3958 (Faref, Faset):
3959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3960 (Faset): Use int, not EMACS_INT, where int is wide enough.
3961 (Fstring_to_number): Don't assume fixnums fit in int.
3962 (Frem): Don't assume arg is nonnegative.
3963 * dbusbind.c (xd_append_arg): Check for integers out of range.
3964 (Fdbus_call_method): Don't overflow the timeout int.
3965 (extract_signed, extract_unsigned): New functions.
3966 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3967 (xd_get_connection_references): Return ptrdiff_t, not int.
3968 All uses changed.
3969 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3970 (xd_read_message_1):
3971 Use int, not unsigned, where the dbus API uses int.
3972 (Fdbus_message_internal): Don't overflow mtype.
3973 (syms_of_dbusbind): Allocate right-sized buffer for integers.
3974 * dired.c (directory_files_internal, file_name_completion, scmp)
3975 (file_name_completion_stat):
3976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3977 (file_name_completion): Don't overflow matchcount.
3978 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3979 * dispextern.h: Adjust decls to match defn changes elsewhere.
3980 (struct text_pos, struct glyph, struct bidi_saved_info)
3981 (struct bidi_string_data, struct bidi_it, struct composition_it)
3982 (struct it):
3983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3984 (struct display_pos, struct composition_it, struct it):
3985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3986 * dispnew.c (increment_matrix_positions)
3987 (increment_row_positions, mode_line_string)
3988 (marginal_area_string):
3989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3990 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
3991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3992 (duration_to_sec_usec): New function, to check for overflow better.
3993 (Fsleep_for, sit_for): Use it.
3994 * doc.c (get_doc_string, store_function_docstring):
3995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3996 (get_doc_string, Fsnarf_documentation):
3997 Use int, not EMACS_INT, where int is wide enough.
3998 (get_doc_string):
3999 Use SAFE_ALLOCA, not alloca.
4000 Check for overflow when converting EMACS_INT to off_t.
4001 * doprnt.c (doprnt):
4002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4003 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
4004 Don't assume uid_t fits into fixnum.
4005 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
4006 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
4007 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
4008 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
4009 (general_insert_function)
4010 (Finsert_char, make_buffer_string, make_buffer_string_both)
4011 (update_buffer_properties, Fbuffer_substring)
4012 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
4013 (Fsubst_char_in_region, check_translation)
4014 (Ftranslate_region_internal, save_restriction_restore, Fformat)
4015 (transpose_markers, Ftranspose_regions):
4016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4017 (clip_to_bounds): Move to lisp.h as an inline function).
4018 (Fconstrain_to_field): Don't assume integers are nonnegative.
4019 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
4020 (Fsubst_char_in_region, Fsave_restriction):
4021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4022 (Femacs_pid): Don't assume pid_t fits into fixnum.
4023 (lo_time): Use int, not EMACS_INT, when int suffices.
4024 (lisp_time_argument): Check for usec out of range.
4025 (Fencode_time): Don't assume fixnum fits in int.
4026 (Fuser_login_name, Fuser_full_name): Signal an error
4027 if a uid argument is out of range, rather than relying on
4028 undefined behavior.
4029 (Fformat_time_string): Remove now-unnecessary check.
4030 lisp_time_argument checks for out-of-range usec now.
4031 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
4032 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
4033 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
4034 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
4035 (init_cmdargs, Fdump_emacs):
4036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4037 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
4038 the bottom (typically) 32 bits of the fixnum.
4039 * eval.c (specpdl_size, call_debugger):
4040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4041 (when_entered_debugger, Fbacktrace_debug):
4042 Don't assume fixnum can fit in int.
4043 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
4044 the object just before a buffer; this is not portable.
4045 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
4046 (grow_specpdl, unbind_to):
4047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4048 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
4049 (grow_specpdl): Simplify allocation by using xpalloc.
4050 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
4051 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
4052 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
4053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4054 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
4055 (a_write, e_write):
4056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4057 (Fcopy_file, non_regular_nbytes, read_non_regular)
4058 (Finsert_file_contents):
4059 Use int, not EMACS_INT, where int is wide enough.
4060 (READ_BUF_SIZE): Verify that it fits in int.
4061 (Finsert_file_contents): Check that counts are in proper range,
4062 rather than assuming fixnums fit into ptrdiff_t etc.
4063 Don't assume fixnums fit into int.
4064 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
4065 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
4066 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
4067 (string_char_to_byte, string_byte_to_char)
4068 (string_make_multibyte, string_to_multibyte)
4069 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
4070 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
4071 (substring_both, Fdelete, internal_equal, Ffillarray)
4072 (Fclear_string, mapcar1)
4073 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
4074 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
4075 (larger_vector, make_hash_table, maybe_resize_hash_table)
4076 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
4077 (Fmaphash, secure_hash):
4078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4079 (concat): Check for string index and length overflow.
4080 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
4081 (Frequire):
4082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4083 (larger_vector): New API (vec, incr_min, size_max) replaces old
4084 one (vec, new_size, init). This catches size overflow.
4085 INIT was removed because it was always Qnil.
4086 All callers changed.
4087 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
4088 the upper bound on a hash table index size.
4089 (make_hash_table, maybe_resize_hash_table): Use it.
4090 (secure_hash): Computer start_byte and end_byte only after
4091 they're known to be in ptrdiff_t range.
4092 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
4093 (Ffont_get_glyphs, Ffont_at):
4094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4095 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
4096 (Flist_fonts, Fopen_font):
4097 Don't assume fixnum can fit in int.
4098 (check_gstring): Don't assume index can fit in int.
4099 (font_match_p): Check that fixnum is a character, not a nonnegative
4100 fixnum, since the later code needs to stuff it into an int.
4101 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
4102 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
4103 conversion overflow issues.
4104 (Fopen_font): Check for integer out of range.
4105 (Ffont_get_glyphs): Don't assume index can fit in int.
4106 * font.h: Adjust decls to match defn changes elsewhere.
4107 * fontset.c (reorder_font_vector): Redo score calculation to avoid
4108 integer overflow.
4109 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
4110 printmax_t, where ptrdiff_t is wide enough.
4111 (Finternal_char_font):
4112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4113 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
4114 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
4115 (Fset_frame_position, x_set_frame_parameters)
4116 (x_set_line_spacing, x_set_border_width)
4117 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
4118 Check that fixnums are in proper range for system types.
4119 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
4120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4121 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
4122 Use SAFE_ALLOCA_LISP, not alloca.
4123 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
4124 intptr_t is wide enough.
4125 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
4126 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
4127 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
4128 Check for fixnum out of range.
4129 * ftfont.c (ftfont_list): Don't assume index fits in int.
4130 Check that fixnums are in proper range for system types.
4131 (ftfont_shape_by_flt):
4132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4133 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4135 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
4136 Check that fixnums are in proper range for system types.
4137 * gnutls.h: Adjust decls to match defn changes elsewhere.
4138 * gtkutil.c (xg_dialog_run):
4139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4140 (update_frame_tool_bar):
4141 Check that fixnums are in proper range for system types.
4142 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
4143 (lookup_image): Check that fixnums are in range for system types.
4144 * indent.c (last_known_column, last_known_column_point):
4145 (current_column_bol_cache):
4146 (skip_invisible, current_column, check_display_width):
4147 (check_display_width, scan_for_column, current_column_1)
4148 (Findent_to, Fcurrent_indentation, position_indentation)
4149 (indented_beyond_p, Fmove_to_column, compute_motion):
4150 (Fcompute_motion, Fvertical_motion):
4151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4152 (last_known_column_modified): Use EMACS_INT, not int.
4153 (check_display_width):
4154 (Fcompute_motion):
4155 Check that fixnums and floats are in proper range for system types.
4156 (compute_motion): Don't assume index or fixnum fits in int.
4157 (compute_motion, Fcompute_motion):
4158 Use int, not EMACS_INT, when it is wide enough.
4159 (vmotion): Omit local var start_hpos that is always 0; that way
4160 we don't need to worry about overflow in expressions involving it.
4161 * indent.h: Adjust decls to match defn changes elsewhere.
4162 (struct position):
4163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4164 Use int, not EMACS_INT, where int is wide enough.
4165 Remove unused members ovstring_chars_done and tab_offset;
4166 all uses removed.
4167 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
4168 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
4169 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
4170 (make_gap, copy_text, insert, insert_and_inherit)
4171 (insert_before_markers, insert_before_markers_and_inherit)
4172 (insert_1, count_combining_before, count_combining_after)
4173 (insert_1_both, insert_from_string)
4174 (insert_from_string_before_markers, insert_from_string_1)
4175 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
4176 (adjust_after_replace, adjust_after_insert, replace_range)
4177 (replace_range_2, del_range, del_range_1, del_range_byte)
4178 (del_range_both, del_range_2, modify_region)
4179 (prepare_to_modify_buffer, signal_before_change)
4180 (signal_after_change, Fcombine_after_change_execute):
4181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4182 * intervals.c (traverse_intervals, rotate_right, rotate_left)
4183 (balance_an_interval, split_interval_right, split_interval_left)
4184 (find_interval, next_interval, update_interval)
4185 (adjust_intervals_for_insertion, delete_node, delete_interval)
4186 (interval_deletion_adjustment, adjust_intervals_for_deletion)
4187 (static_offset_intervals, offset_intervals)
4188 (merge_interval_right, merge_interval_left, make_new_interval)
4189 (graft_intervals_into_buffer, temp_set_point_both)
4190 (temp_set_point, set_point, adjust_for_invis_intang)
4191 (set_point_both, move_if_not_intangible, get_property_and_range)
4192 (get_local_map, copy_intervals, copy_intervals_to_string)
4193 (compare_string_intervals, set_intervals_multibyte_1):
4194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4195 * intervals.h: Adjust decls to match defn changes elsewhere.
4196 (struct interval):
4197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4198 * keyboard.c (this_command_key_count, this_single_command_key_start)
4199 (before_command_key_count, before_command_echo_length, echo_now)
4200 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
4201 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
4202 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
4203 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
4204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4205 (last_non_minibuf_size, last_point_position, echo_truncate)
4206 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
4207 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
4208 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
4209 (stuff_buffered_input):
4210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4211 (last_auto_save, command_loop_1, read_char):
4212 Use EMACS_INT, not int, to avoid integer overflow.
4213 (record_char): Avoid overflow in total_keys computation.
4214 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
4215 * keyboard.h: Adjust decls to match defn changes elsewhere.
4216 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
4217 (Fkey_description, Fdescribe_vector, Flookup_key):
4218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4219 (click_position): New function, to check that positions are in range.
4220 (Fcurrent_active_maps):
4221 (describe_command):
4222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4223 (Faccessible_keymaps, Fkey_description):
4224 (preferred_sequence_p):
4225 Don't assume fixnum can fit into int.
4226 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
4227 Check for integer overflow in size calculations.
4228 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
4229 avoid mishandling large integers.
4230 * lisp.h: Adjust decls to match defn changes elsewhere.
4231 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
4232 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
4233 (struct Lisp_Marker):
4234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4235 (clip_to_bounds): Now an inline function, moved here from editfns.c.
4236 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
4237 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
4238 All callers changed.
4239 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
4240 Assume the arg has valid form, since it always does.
4241 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
4242 unsigned integer system type.
4243 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
4244 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
4245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4246 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
4247 (duration_to_sec_usec): New decl.
4248 * lread.c (read_from_string_index, read_from_string_index_byte)
4249 (read_from_string_limit, readchar, unreadchar, openp)
4250 (read_internal_start, read1, oblookup):
4251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4252 (Fload, readevalloop, Feval_buffer, Feval_region):
4253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4254 (openp): Check for out-of-range argument to 'access'.
4255 (read1): Use int, not EMACS_INT, where int is wide enough.
4256 Don't assume fixnum fits into int.
4257 Fix off-by-one error that can read outside a buffer.
4258 (read_filtered_event): Use duration_to_sec_usec
4259 to do proper overflow checking on durations.
4260 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
4261 in size calculation.
4262 (Fexecute_kbd_macro):
4263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4264 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
4265 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
4266 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
4267 (set_marker_both, set_marker_restricted_both, marker_position)
4268 (marker_byte_position, Fbuffer_has_markers_at):
4269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4270 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
4271 * menu.c (ensure_menu_items): Rename from grow_menu_items.
4272 It now merely ensures that the menu is large enough, without
4273 necessarily growing it, as this avoids some integer overflow issues.
4274 All callers changed.
4275 (keymap_panes, parse_single_submenu, Fx_popup_menu):
4276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4277 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
4278 Use SAFE_ALLOCA_LISP, not alloca.
4279 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
4280 to EMACS_INT. Check that fixnums are in proper range for system types.
4281 * minibuf.c (minibuf_prompt_width, string_to_object)
4282 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
4283 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
4284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4285 (get_minibuffer, read_minibuf_unwind):
4286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4287 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
4288 this simplifies overflow checking. All callers changed.
4289 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
4290 (Ftest_completion):
4291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4292 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
4293 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
4294 Check that fixnums are in proper range for system types.
4295 (Fx_create_frame, Fx_show_tip):
4296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4297 * nsfont.m (ns_findfonts, nsfont_list_family):
4298 Don't assume fixnum fits in long.
4299 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
4300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4301 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
4302 wide enough.
4303 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
4304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4305 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
4306 (PRINTDECLARE, PRINTPREPARE):
4307 (strout, print_string):
4308 (print, print_preprocess, print_check_string_charset_prop)
4309 (print_object):
4310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4311 (PRINTDECLARE):
4312 (temp_output_buffer_setup, Fprin1_to_string, print_object):
4313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4314 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
4315 (printchar, strout): Use xpalloc to catch size calculation overflow.
4316 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
4317 (print_error_message): Use SAFE_ALLOCA, not alloca.
4318 (print_object): Use int, not EMACS_INT, where int is wide enough.
4319 (print_depth, new_backquote_output, print_number_index):
4320 Use ptrdiff_t, not int, where int might not be wide enough.
4321 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
4322 (Fset_process_window_size, Fformat_network_address)
4323 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
4324 (sigchld_handler):
4325 Check that fixnums are in proper range for system types.
4326 (Fsignal_process): Simplify by avoiding a goto.
4327 Check for process-ids out of pid_t range rather than relying on
4328 undefined behavior.
4329 (process_tick, update_tick): Use EMACS_INT, not int.
4330 (Fformat_network_address, read_process_output, send_process)
4331 (Fprocess_send_region, status_notify):
4332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4333 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
4334 (wait_reading_process_output, read_process_output, exec_sentinel):
4335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4336 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
4337 (Faccept_process_output): Use duration_to_sec_usec to do proper
4338 overflow checking on durations.
4339 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
4340 Don't assume pid_t fits in int.
4341 * process.h (struct Lisp_Process): Members tick and update_tick
4342 are now of type EMACS_INT, not int.
4343 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
4344 configured --with-wide-int.
4345 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
4346 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
4347 * search.c (looking_at_1, string_match_1):
4348 (fast_string_match, fast_c_string_match_ignore_case)
4349 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
4350 (scan_newline, find_before_next_newline, search_command)
4351 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
4352 (set_search_regs, wordify):
4353 (Freplace_match):
4354 (Fmatch_data):
4355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4356 (string_match_1, search_buffer, set_search_regs):
4357 (Fmatch_data):
4358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4359 (wordify): Check for overflow in size calculation.
4360 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
4361 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
4362 Check that fixnums are in proper range for system types.
4363 * sound.c (struct sound_device)
4364 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
4365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4366 (Fplay_sound_internal):
4367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4368 * syntax.c (struct lisp_parse_state, find_start_modiff)
4369 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
4370 (Fparse_partial_sexp):
4371 Don't assume fixnums can fit in int.
4372 (struct lisp_parse_state, find_start_pos, find_start_value)
4373 (find_start_value_byte, find_start_begv)
4374 (update_syntax_table, char_quoted, dec_bytepos)
4375 (find_defun_start, prev_char_comend_first, back_comment):
4376 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
4377 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
4378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4379 (Finternal_describe_syntax_value): Check that match_lisp is a
4380 character, not an integer, since the code stuffs it into int.
4381 (scan_words, scan_sexps_forward):
4382 Check that fixnums are in proper range for system types.
4383 (Fforward_word):
4384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4385 (scan_sexps_forward):
4386 Use CHARACTERP, not INTEGERP, since the value must fit into int.
4387 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4388 * syntax.h: Adjust decls to match defn changes elsewhere.
4389 (struct gl_state_s):
4390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4391 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4392 MOST_POSITIVE_FIXNUM.
4393 * sysdep.c (wait_for_termination_1, wait_for_termination)
4394 (interruptible_wait_for_termination, mkdir):
4395 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4396 (emacs_read, emacs_write):
4397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4398 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4399 and double all fit in int.
4400 * term.c (set_tty_color_mode):
4401 Check that fixnums are in proper range for system types.
4402 * termhooks.h (struct input_event):
4403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4404 * textprop.c (validate_interval_range, interval_of)
4405 (Fadd_text_properties, set_text_properties_1)
4406 (Fremove_text_properties, Fremove_list_of_text_properties)
4407 (Ftext_property_any, Ftext_property_not_all)
4408 (copy_text_properties, text_property_list, extend_property_ranges)
4409 (verify_interval_modification):
4410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4411 (Fnext_single_char_property_change)
4412 (Fprevious_single_char_property_change):
4413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4414 (copy_text_properties):
4415 Check for integer overflow in index calculation.
4416 * undo.c (last_boundary_position, record_point, record_insert)
4417 (record_delete, record_marker_adjustment, record_change)
4418 (record_property_change):
4419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4420 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4422 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4423 (Fx_hide_tip, Fx_file_dialog):
4424 * w32menu.c (set_frame_menubar):
4425 Use ptrdiff_t, not int, for consistency with rest of code.
4426 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4427 (select_window, Fdelete_other_windows_internal)
4428 (window_scroll_pixel_based, window_scroll_line_based)
4429 (Frecenter, Fset_window_configuration):
4430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4431 (Fset_window_hscroll, run_window_configuration_change_hook)
4432 (set_window_buffer, temp_output_buffer_show, scroll_command)
4433 (Fscroll_other_window, Frecenter):
4434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4435 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4436 Don't assume fixnum fits in int.
4437 (Fset_window_scroll_bars):
4438 Check that fixnums are in proper range for system types.
4439 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4440 (string_pos, c_string_pos, number_of_chars, init_iterator)
4441 (in_ellipses_for_invisible_text_p, init_from_display_pos)
4442 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4443 (compute_display_string_end, handle_face_prop)
4444 (face_before_or_after_it_pos, handle_invisible_prop)
4445 (handle_display_prop, handle_display_spec, handle_single_display_spec)
4446 (display_prop_intangible_p, string_buffer_position_lim)
4447 (string_buffer_position, handle_composition_prop, load_overlay_strings)
4448 (get_overlay_strings_1, get_overlay_strings)
4449 (iterate_out_of_display_property, forward_to_next_line_start)
4450 (back_to_previous_visible_line_start, reseat, reseat_to_string)
4451 (get_next_display_element, set_iterator_to_next)
4452 (get_visually_first_element, compute_stop_pos_backwards)
4453 (handle_stop_backwards, next_element_from_buffer)
4454 (move_it_in_display_line_to, move_it_in_display_line)
4455 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4456 (add_to_log, message_dolog, message_log_check_duplicate)
4457 (message2, message2_nolog, message3, message3_nolog
4458 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4459 (current_message_1, truncate_echo_area, truncate_message_1)
4460 (set_message, set_message_1, store_mode_line_noprop)
4461 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4462 (text_outside_line_unchanged_p, check_point_in_composition)
4463 (reconsider_clip_changes)
4464 (redisplay_internal, set_cursor_from_row, try_scrolling)
4465 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4466 (redisplay_window, find_last_unchanged_at_beg_row)
4467 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4468 (trailing_whitespace_p, find_row_edges, display_line)
4469 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4470 (display_mode_element, store_mode_line_string)
4471 (pint2str, pint2hrstr, decode_mode_spec)
4472 (display_count_lines, display_string, draw_glyphs)
4473 (x_produce_glyphs, x_insert_glyphs)
4474 (rows_from_pos_range, mouse_face_from_buffer_pos)
4475 (fast_find_string_pos, mouse_face_from_string_pos)
4476 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4478 (safe_call, init_from_display_pos, handle_fontified_prop)
4479 (handle_single_display_spec, load_overlay_strings)
4480 (with_echo_area_buffer, setup_echo_area_for_printing)
4481 (display_echo_area, echo_area_display)
4482 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4483 (update_tool_bar, hscroll_window_tree, redisplay_internal)
4484 (redisplay_window, dump_glyph_row, display_mode_line)
4485 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
4486 (handle_display_spec, display_prop_string_p):
4487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4488 (handle_single_display_spec, build_desired_tool_bar_string)
4489 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4490 (get_specified_cursor_type):
4491 Check that fixnums are in proper range for system types.
4492 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4493 (Flookup_image_map):
4494 Don't assume fixnums fit in int.
4495 (compare_overlay_entries):
4496 Avoid mishandling comparisons due to subtraction overflow.
4497 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4498 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4499 (handle_tool_bar_click):
4500 Use int, not unsigned, since we prefer signed and the signedness
4501 doesn't matter here.
4502 (get_next_display_element, next_element_from_display_vector):
4503 Use int, not EMACS_INT, when int is wide enough.
4504 (start_hourglass): Use duration_to_sec_usec to do proper
4505 overflow checking on durations.
4506 * xfaces.c (Fbitmap_spec_p):
4507 Check that fixnums are in proper range for system types.
4508 (compare_fonts_by_sort_order):
4509 Avoid mishandling comparisons due to subtraction overflow.
4510 (Fx_family_fonts, realize_basic_faces):
4511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4512 (Fx_family_fonts):
4513 Don't assume fixnum fits in int.
4514 Use SAFE_ALLOCA_LISP, not alloca.
4515 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4516 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4517 (face_at_buffer_position, face_for_overlay_string)
4518 (face_at_string_position):
4519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4520 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
4521 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
4522 (Fx_show_tip):
4523 Check that fixnums are in proper range for system types.
4524 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4525 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
4526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4527 (Fx_change_window_property): Don't assume fixnums fit in int.
4528 * xfont.c (xfont_chars_supported):
4529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4530 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
4531 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
4532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4533 * xml.c (parse_region):
4534 * xrdb.c (magic_file_p):
4535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4536 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
4537 (x_get_local_selection, x_reply_selection_request)
4538 (x_handle_selection_request, wait_for_property_change):
4539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4540 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
4541 short is wide enough.
4542 (x_send_client_event): Don't assume fixnum fits in int.
4543 * xterm.c (x_x_to_emacs_modifiers):
4544 Don't assume EMACS_INT overflows nicely into int.
4545 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4546 may come from Lisp.
4547 (handle_one_xevent): NATNUMP can eval its arg twice.
4548 (x_connection_closed):
4549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4550 * xterm.h: Adjust decls to match defn changes elsewhere.
4551 (struct scroll_bar): Use struct vectorlike_header
4552 rather than rolling our own approximation.
4553 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4554
4555 2012-05-25 Glenn Morris <rgm@gnu.org>
4556
4557 * lisp.mk (lisp): Update for more files being compiled now.
4558
4559 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4560
4561 * lread.c: Remove `read_pure' which makes no difference.
4562 (read_pure): Remove var.
4563 (unreadpure): Remove function.
4564 (readevalloop): Don't call read_list with -1 flag.
4565 (read1, read_vector): Don't test read_pure any more.
4566 (read_list): Simplify.
4567
4568 * fileio.c, character.h: Minor style tweaks.
4569
4570 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4571
4572 * window.h (clip_changed): Remove useless declaration.
4573
4574 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
4575
4576 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4577 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4578
4579 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 Remove src/m/*.
4582 This directory predates autoconf and is no longer needed nowadays.
4583 Move its few remaining bits of functionality to where they're needed.
4584 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4585 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4586 * m/template.h: Remove.
4587 * Makefile.in (M_FILE): Remove. All uses removed.
4588 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4589 * lisp.h (USE_LSB_TAG):
4590 * mem-limits.h (EXCEEDS_LISP_PTR):
4591 Use VAL_MAX, not VALBITS, in #if.
4592 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4593 (EMACS_UINT): Define unconditionally now.
4594 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4595 (BITS_PER_EMACS_INT): New constants, replacing
4596 what used to be in config.h, but not useful in #if.
4597 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4598 define them any more.
4599 (VAL_MAX): New macro.
4600 (VALMASK): Use it.
4601 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4602 BITS_PER_EMACS_INT, in #if.
4603 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4604 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4605 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4606 * s/ms-w32.h (DATA_START):
4607 Move here from removed file m/intel386.h.
4608 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4609 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4610
4611 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 Assume C89 or later.
4614 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4615 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4616 (xrealloc):
4617 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4618 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4619 * textprop.c, tparam.c (NULL): Remove.
4620 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4621 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4622 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4623 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4624 * xterm.c (input_signal_count): Assume volatile works.
4625
4626 2012-05-21 Ken Brown <kbrown@cornell.edu>
4627
4628 * xgselect.c (xg_select): Fix first argument in call to 'select'
4629 (bug#11508).
4630
4631 2012-05-20 Ken Brown <kbrown@cornell.edu>
4632
4633 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
4634 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
4635
4636 2012-05-19 Ken Brown <kbrown@cornell.edu>
4637
4638 * xfns.c (x_in_use): Remove `static' qualifier.
4639 * xterm.h (x_in_use): Declare.
4640 * xgselect.c: Include xterm.h.
4641 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4642 and `display_arg' (bug#9754).
4643
4644 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4645
4646 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4647
4648 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4649 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4650
4651 2012-05-18 Eli Zaretskii <eliz@gnu.org>
4652
4653 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4654
4655 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
4656 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
4657
4658 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4659 reference to image_cache->refcount.
4660 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4661
4662 2012-05-17 Juri Linkov <juri@jurta.org>
4663
4664 * search.c (Fword_search_regexp, Fword_search_backward)
4665 (Fword_search_forward, Fword_search_backward_lax)
4666 (Fword_search_forward_lax): Move functions to isearch.el
4667 (bug#10145, bug#11381).
4668
4669 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4670
4671 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4672
4673 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4674
4675 * lread.c (init_obarray): Declare Qt and Qnil as special.
4676
4677 2012-05-14 Glenn Morris <rgm@gnu.org>
4678
4679 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
4680 Put "libexec" before "bin", for the sake of init_callproc_1.
4681
4682 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4683
4684 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4685
4686 * unexaix.c: Port to more-recent AIX compilers.
4687 (report_error, report_error_1, make_hdr, copy_sym)
4688 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4689 Make arguments const char *, not char *, to avoid violations of C
4690 standard and to fix some AIX warnings reported by Gilles Pion.
4691
4692 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4693
4694 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4695 already have overlays loaded.
4696 (handle_single_display_spec): Before returning without displaying
4697 fringe bitmap, synchronize the bidi iterator with the main display
4698 iterator, by calling iterate_out_of_display_property.
4699 (iterate_out_of_display_property): Detect buffer iteration by
4700 testing that it->string is a Lisp string.
4701 (get_next_display_element): When the current object is exhausted,
4702 and there's something on it->stack, call set_iterator_to_next to
4703 proceed with what's on the stack, instead of returning zero.
4704 (set_iterator_to_next): If called at the end of a Lisp string,
4705 proceed to consider_string_end without incrementing string
4706 position. Don't increment display vector index past the end of
4707 the display vector. (Bug#11417)
4708 (pos_visible_p): Don't report a position visible when move_it_to
4709 stopped at the last line of window, which happens to be scanned
4710 backwards by the bidi iteration. (Bug#11464)
4711
4712 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4713
4714 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4715 and right-margin display specs even if the spec is invalid or we
4716 are on a TTY, and thus unable to display on the fringes.
4717 That's because the text with the property will not be displayed anyway,
4718 so we need to signal to the caller that this is a "replacing"
4719 display spec. This fixes display when the spec is invalid or we
4720 are on a TTY.
4721
4722 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4723
4724 * unexaix.c (make_hdr): Fix typo in prototype.
4725 This bug broke the build on AIX. Problem reported by Gilles Pion.
4726
4727 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
4728
4729 * keyboard.c (kbd_buffer_get_event): Read special events also in
4730 batch mode. (Bug#11415)
4731
4732 2012-05-12 Glenn Morris <rgm@gnu.org>
4733
4734 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4735
4736 2012-05-12 Eli Zaretskii <eliz@gnu.org>
4737
4738 * lisp.mk (lisp): Add newcomment.elc.
4739
4740 2012-05-12 Glenn Morris <rgm@gnu.org>
4741
4742 * Makefile.in (MKDIR_P): New, set by configure.
4743 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4744
4745 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4746
4747 Remove unused function hourglass_started.
4748 * dispextern.h (hourglass_started):
4749 * w32fns.c (hourglass_started):
4750 * xdisp.c (hourglass_started): Remove.
4751
4752 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
4753
4754 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4755 Update dependencies.
4756
4757 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4758
4759 * xgselect.c (xg_select): Put maxfds+1 into a var.
4760 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4761
4762 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4763
4764 2012-05-10 Dave Abrahams <dave@boostpro.com>
4765
4766 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
4767 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
4768
4769 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
4770
4771 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4772 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
4773 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
4774 Initialize xd_registered_buses.
4775
4776 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
4777
4778 Untag more efficiently if USE_LSB_TAG.
4779 This is based on a proposal by YAMAMOTO Mitsuharu in
4780 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
4781 For an admittedly artificial (nth 8000 longlist) benchmark on
4782 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
4783 Emacs's overall text size by 1%.
4784 * lisp.h (XUNTAG): New macro.
4785 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
4786 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
4787 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
4788 * eval.c (Fautoload):
4789 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
4790 * frame.h (XFRAME): Use XUNTAG.
4791
4792 Port recent dbusbind.c changes to 32-bit --with-wide-int.
4793 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
4794 Remove unportable assumptions about print widths of types like
4795 dbus_uint32_t.
4796 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
4797 intptr_t when converting between pointer and integer, to avoid GCC
4798 warnings about wrong width.
4799
4800 2012-05-09 Eli Zaretskii <eliz@gnu.org>
4801
4802 * w32proc.c (new_child): Force Windows to reserve only 64KB of
4803 stack for each reader_thread, instead of defaulting to 8MB
4804 determined by the linker. This avoids failures in creating
4805 subprocesses on Windows 7, see the discussion in this thread:
4806 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
4807
4808 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
4809
4810 Fix up display of the *Minibuf-0* buffer in the mini window.
4811 * keyboard.c (read_char): Don't clear the echo area if there's no
4812 message to clear.
4813 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
4814 contents of *Minibuf-0*) if there's no message displayed in its stead.
4815
4816 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
4817
4818 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
4819 batch mode.
4820
4821 2012-05-06 Chong Yidong <cyd@gnu.org>
4822
4823 * lisp.mk (lisp): Update.
4824
4825 2012-05-05 Jim Meyering <meyering@redhat.com>
4826
4827 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
4828
4829 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4830
4831 * data.c (PUT_ERROR): New macro.
4832 (syms_of_data): Use it. Add new error type `user-error'.
4833 * undo.c (user_error): New function.
4834 (Fprimitive_undo): Use it.
4835 * print.c (print_error_message): Adjust print style for `user-error'.
4836 * keyboard.c (user_error): New function.
4837 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
4838
4839 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 Do not limit current-time-string to years 1000..9999.
4842 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
4843 (Fcurrent_time_string): Support any year that is supported by the
4844 underlying localtime representation. Don't use asctime, as it
4845 has undefined behavior for years outside the range -999..9999.
4846
4847 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
4848
4849 Fix race conditions involving setenv, gmtime, localtime, asctime.
4850 Without this fix, interrupts could mess up code that uses these
4851 nonreentrant functions, since setting TZ invalidates existing
4852 tm_zone or tzname values, and since most of these functions return
4853 pointers to static storage.
4854 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
4855 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
4856 Grow the critical sections to include not just invoking
4857 localtime/gmtime, but also accessing these functions' results
4858 including their tm_zone values if any, and any related TZ setting.
4859 (format_time_string): Last arg is now struct tm *, not struct tm **,
4860 so that the struct tm is saved in the critical section.
4861 All callers changed. Simplify allocation of initial buffer, partly
4862 motivated by the fact that memory allocation needs to be outside
4863 the critical section.
4864
4865 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
4866
4867 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
4868 with RESET_INTERVAL.
4869
4870 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4871 Remove duplicated buffer name initialization.
4872
4873 2012-05-02 Jim Meyering <jim@meyering.net>
4874
4875 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4876
4877 * xfns.c (x_window): Use xstrdup (Bug#11375).
4878
4879 2012-05-02 Eli Zaretskii <eliz@gnu.org>
4880
4881 * xdisp.c (pos_visible_p): If already at a newline from the
4882 display string before the 'while' loop, don't walk back the glyphs
4883 from it3.glyph_row. Solves assertion violation when the display
4884 string begins with a newline (egg.el). (Bug#11367)
4885
4886 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4887
4888 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4889 Move to simple.el.
4890
4891 2012-05-01 Glenn Morris <rgm@gnu.org>
4892
4893 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4894 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4895 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4896 All were removed before 23.1.
4897
4898 * dispnew.c: Remove HAVE_LIBNCURSES test;
4899 it is always true on relevant platforms.
4900
4901 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4902 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4903
4904 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4905
4906 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4907
4908 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4909 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4910 Remove.
4911
4912 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 Do not avoid creating empty evaporating overlays (Bug#9642).
4915 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4916 That is, do not delete an evaporating overlay if it becomes
4917 empty after its bounds are adjusted to fit within its buffer.
4918 This fix caused other problems, and I'm reverting it until we get
4919 to the bottom of them.
4920
4921 2012-04-27 Chong Yidong <cyd@gnu.org>
4922
4923 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4924
4925 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4926
4927 * xdisp.c (pos_visible_p): If the window start position is beyond
4928 ZV, start the display from buffer beginning. Prevents assertion
4929 violation in init_iterator when the minibuffer window is scrolled
4930 via the scroll bar.
4931
4932 * window.c (window_scroll_pixel_based): Likewise.
4933
4934 2012-04-27 Chong Yidong <cyd@gnu.org>
4935
4936 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4937
4938 2012-04-27 Glenn Morris <rgm@gnu.org>
4939
4940 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4941 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4942
4943 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4944
4945 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4946 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
4947
4948 2012-04-26 Eli Zaretskii <eliz@gnu.org>
4949
4950 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4951 display element, check also the underlying string or buffer
4952 character. (Bug#11341)
4953
4954 * w32menu.c: Include w32heap.h.
4955 (add_menu_item): If the call to AppendMenuW (via
4956 unicode_append_menu) fails, disable Unicode menus only if we are
4957 running on Windows 9X/Me.
4958
4959 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4960
4961 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4962 (xgetint): Add missing shift for LSB tags.
4963
4964 2012-04-24 Martin Rudalics <rudalics@gmx.at>
4965
4966 * keyboard.c (read_char): Don't wipe echo area for select window
4967 events: These might get delayed via `mouse-autoselect-window'
4968 (Bug#11304).
4969
4970 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
4971
4972 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4973 manipulation of :loaded-from data.
4974
4975 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
4976
4977 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4978 now a cons (bug#11311).
4979
4980 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4981
4982 Do not create empty overlays with the evaporate property (Bug#9642).
4983 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4984 if it becomes empty after its bounds are adjusted to fit within
4985 its buffer. Without this fix, in a nonempty buffer (let ((o
4986 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4987 yields an empty overlay that has the evaporate property, which is
4988 not supposed to happen.
4989
4990 Fix minor GTK3 problems found by static checking.
4991 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4992 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4993 (struct _EmacsFixedClass, emacs_fixed_get_type):
4994 Move decls here from emacsgtkfixed.h, since they needn't be public.
4995 (emacs_fixed_get_type): Now static.
4996 (emacs_fixed_class_init): Omit unused local.
4997 (emacs_fixed_child_type): Remove; unused.
4998 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4999 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5000 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
5001 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
5002 (EMACS_FIXED_GET_CLASS): Remove; unused.
5003 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
5004
5005 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
5006 Problem reported by Juanma Barranquero for Windows -Wunused-function.
5007
5008 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
5011 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
5012 (__malloc_size_t, __malloc_ptrdiff_t):
5013 Remove. All uses removed, replaced by the definiens if needed,
5014 since we can assume C89 or better now.
5015 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
5016 (protect_malloc_state, align, get_contiguous_space)
5017 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
5018 (malloc_atfork_handler_child, malloc_enable_thread)
5019 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
5020 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
5021 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
5022 (special_realloc, _realloc_internal_nolock, _realloc_internal)
5023 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
5024 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
5025 Define using prototypes, not old style.
5026 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
5027 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
5028 (align): Don't assume that signed integer overflow wraps around.
5029 Omit unused local var.
5030 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
5031 (_free_internal_nolock, memalign, mallochook, reallochook):
5032 Omit no-longer-needed casts.
5033 (valloc): Use getpagesize, not __getpagesize.
5034 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
5035 (struct hdr): The 'magic' member is now size_t, not unsigned long.
5036
5037 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
5038
5039 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
5040
5041 Move functions from C to Lisp. Make non-blocking method calls
5042 the default. Implement further D-Bus standard interfaces.
5043
5044 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
5045 (QCdbus_request_name_allow_replacement)
5046 (QCdbus_request_name_replace_existing)
5047 (QCdbus_request_name_do_not_queue)
5048 (QCdbus_request_name_reply_primary_owner)
5049 (QCdbus_request_name_reply_in_queue)
5050 (QCdbus_request_name_reply_exists)
5051 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
5052 (QCdbus_registered_serial, QCdbus_registered_method)
5053 (QCdbus_registered_signal): New Lisp objects.
5054 (XD_DEBUG_MESSAGE): Use sizeof.
5055 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
5056 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
5057 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
5058 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
5059 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
5060 (xd_signature, xd_append_arg): Allow float for integer types.
5061 (xd_get_connection_references): New function.
5062 (xd_get_connection_address): Rename from xd_initialize.
5063 Return cached address.
5064 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
5065 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
5066 level.
5067 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
5068 Return number of refcounts.
5069 (Fdbus_get_unique_name): Make stronger parameter check.
5070 (Fdbus_message_internal): New defun.
5071 (Fdbus_call_method, Fdbus_call_method_asynchronously)
5072 (Fdbus_method_return_internal, Fdbus_method_error_internal)
5073 (Fdbus_send_signal, Fdbus_register_service)
5074 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
5075 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
5076 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
5077 (Vdbus_compiled_version, Vdbus_runtime_version)
5078 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
5079 (Vdbus_message_type_method_return, Vdbus_message_type_error)
5080 (Vdbus_message_type_signal): New defvars.
5081 (Vdbus_registered_buses, Vdbus_registered_objects_table):
5082 Adapt docstring.
5083
5084 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5085
5086 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
5087 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
5088 Do not assume ptrdiff_t is the same width as 'int'.
5089
5090 * alloc.c: Handle unusual debugging option combinations.
5091 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5092 since the two debugging options are incompatible.
5093 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
5094 is defined.
5095 (mem_init, mem_insert, mem_insert_fixup):
5096 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
5097 (NEED_MEM_INSERT): Remove; no longer needed.
5098
5099 2012-04-22 Leo Liu <sdl.web@gmail.com>
5100
5101 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
5102
5103 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5104
5105 * sysdep.c [__FreeBSD__]: Minor cleanups.
5106 (list_system_processes, system_process_attributes) [__FreeBSD__]:
5107 Use Emacs indenting style more consistently. Avoid some casts.
5108 Use 'double' consistently rather than mixing 'float' and 'double'.
5109
5110 2012-04-21 Eduard Wiebe <usenet@pusto.de>
5111
5112 * sysdep.c (list_system_processes, system_process_attributes):
5113 Add implementation for FreeBSD (Bug#5243).
5114
5115 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
5116
5117 * lisp.mk (lisp): Update.
5118
5119 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
5122 It is never used otherwise.
5123
5124 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
5125
5126 * print.c (print_preprocess): Only check print_depth if print-circle
5127 is nil.
5128 (print_object): Check for cycles even when print-circle is nil and
5129 print-gensym is t, but only check print_depth if print-circle is nil.
5130
5131 2012-04-20 Chong Yidong <cyd@gnu.org>
5132
5133 * process.c (wait_reading_process_output): If EIO occurs on a pty,
5134 set the status to "failed" and ensure that sentinel is run.
5135
5136 2012-04-20 Glenn Morris <rgm@gnu.org>
5137
5138 * process.c (Fset_process_inherit_coding_system_flag)
5139 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
5140 (Fmake_network_process, Fmake_serial_process): Doc fix.
5141
5142 2012-04-20 Eli Zaretskii <eliz@gnu.org>
5143
5144 * xdisp.c (string_buffer_position_lim): Limit starting position to
5145 BEGV.
5146 (set_cursor_from_row): If called for a mode-line or header-line
5147 row, return zero immediately.
5148 (try_cursor_movement): If inside continuation line, don't back up
5149 farther than the first row after the header line, if any.
5150 Don't consider the header-line row as "partially visible", even if
5151 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
5152
5153 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
5154
5155 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
5156 (bug#11238).
5157
5158 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
5159 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
5160
5161 configure: new option --enable-gcc-warnings (Bug#11207)
5162 * Makefile.in (C_WARNINGS_SWITCH): Remove.
5163 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
5164 (ALL_CFLAGS): Use new macros rather than old.
5165 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
5166 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
5167 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
5168 -Wunused-result, -Wunused-variable. This should go away once
5169 the Emacs and Gnulib regex code is merged.
5170 (xmalloc, xrealloc): Now static.
5171
5172 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
5173
5174 * dired.c (Fsystem_groups): Remove unused local.
5175
5176 2012-04-17 Glenn Morris <rgm@gnu.org>
5177
5178 * dired.c (Fsystem_users): Doc fix.
5179
5180 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
5181
5182 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
5183 (syms_of_dired): Add them.
5184
5185 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
5186
5187 Fix minor alloc.c problems found by static checking.
5188 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
5189 New extern decls, to avoid calling undeclared functions.
5190 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
5191 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
5192 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
5193 (NEED_MEM_INSERT): New macro.
5194 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
5195 Remove one incorrect comment and fix another.
5196
5197 Fix minor ralloc.c problems found by static checking.
5198 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5199 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
5200 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
5201 (r_alloc_sbrk): Now static.
5202
5203 Improve ralloc.c interface checking.
5204 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5205 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
5206 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
5207 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
5208 [REL_ALLOC]: ... to here, to check interface.
5209 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
5210 Remove decls. This fixes an "It stinks!".
5211
5212 * alloc.c (which_symbols): Fix alignment issue / type clash.
5213
5214 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
5215
5216 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
5217 (struct Lisp_Misc_Any): Likewise.
5218 (struct Lisp_Free): Likewise.
5219 * alloc.c (union aligned_Lisp_Symbol): Define.
5220 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
5221 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
5222 (union aligned_Lisp_Misc): Define.
5223 (MARKER_BLOCK_SIZE, struct marker_block): Use union
5224 aligned_Lisp_Misc instead of union Lisp_Misc.
5225 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
5226
5227 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
5228
5229 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
5230 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
5231 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
5232 * s/netbsd.h, s/sol2-6.h:
5233 Remove definition of GC_MARK_STACK, since the default now works.
5234 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
5235 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
5236 no longer the default.
5237 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
5238
5239 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
5240
5241 * lread.c (lisp_file_lexically_bound_p):
5242 Fix hang at ";-*-\n" (bug#11238).
5243
5244 2012-04-14 Eli Zaretskii <eliz@gnu.org>
5245
5246 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
5247 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
5248
5249 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
5250
5251 * nsterm.m (constrainFrameRect): Always constrain when there is only
5252 one screen (Bug#10962).
5253
5254 2012-04-13 Ken Brown <kbrown@cornell.edu>
5255
5256 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
5257
5258 2012-04-13 Reuben Thomas <rrt@sc3d.org>
5259
5260 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
5261
5262 2012-04-11 Daniel Colascione <dancol@dancol.org>
5263
5264 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
5265 against is gone. It's better to use vfork now so that when Cygwin
5266 gains a new, working vfork, we use it automatically (bug#10398).
5267
5268 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5269
5270 * window.c (save_window_save): Obey window-point-insertion-type.
5271
5272 2012-04-11 Glenn Morris <rgm@gnu.org>
5273
5274 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
5275
5276 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5277
5278 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
5279
5280 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
5281
5282 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
5283 (force_quit_count): New var.
5284 (handle_interrupt): Use it.
5285
5286 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
5287
5288 * w32.c (w32_delayed_load): Record the full path of the library
5289 being loaded (bug#10424).
5290
5291 2012-04-09 Glenn Morris <rgm@gnu.org>
5292
5293 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
5294 not just in the obarray, before snarfing them. (Bug#11036)
5295
5296 * Makefile.in ($(leimdir)/leim-list.el):
5297 Pass EMACS rather than BUILT_EMACS.
5298
5299 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
5300
5301 * process.c (make_process):
5302 * process.h: Add integer `gnutls_handshakes_tried' member to
5303 process struct.
5304
5305 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
5306 Add convenience `GNUTLS_LOG2i' macro.
5307
5308 * gnutls.c (gnutls_log_function2i): Convenience log function.
5309 (emacs_gnutls_read): Use new log functions,
5310 `gnutls_handshakes_tried' process member, and
5311 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
5312 attempts per process (connection).
5313
5314 2012-04-09 Chong Yidong <cyd@gnu.org>
5315
5316 * eval.c (Fuser_variable_p, user_variable_p_eh)
5317 (lisp_indirect_variable): Functions deleted.
5318 (Fdefvar): Caller changed.
5319
5320 * callint.c (Finteractive, Fcall_interactively):
5321 * minibuf.c (Fread_variable): Callers changed.
5322
5323 2012-04-09 Eli Zaretskii <eliz@gnu.org>
5324
5325 * xdisp.c (set_cursor_from_row): If the display string appears in
5326 the buffer at position that is closer to point than the position
5327 after the display string, display the cursor on the first glyph of
5328 the display string. Fixes cursor display when a 'display' text
5329 property immediately follows invisible text. (Bug#11094)
5330
5331 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
5332
5333 composite.c: use 'double' consistently
5334 * composite.c (get_composition_id): Use 'double' consistently
5335 instead of converting 'float' to 'double' and vice versa; this is
5336 easier to understand and avoids a GCC warning.
5337
5338 2012-04-09 Glenn Morris <rgm@gnu.org>
5339
5340 * Makefile.in: Generate leim-list with bootstrap-emacs, in
5341 preparation for dumping it with emacs. (Bug#4789)
5342 (leimdir): New variable.
5343 ($(leimdir)/leim-list.el): New rule.
5344 (emacs$(EXEEXT)): Depend on leim-list.el.
5345
5346 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
5347 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
5348 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
5349
5350 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
5351
5352 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
5353 proper alignment.
5354
5355 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
5356
5357 * xml.c (init_libxml2_functions) [WINDOWSNT]:
5358 Remove unused local variable.
5359
5360 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5361
5362 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
5363 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
5364 (mark_memory): Mark Lisp_Objects only if pointers might hide in
5365 objects, as mark_maybe_pointer will catch them otherwise.
5366 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
5367 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
5368
5369 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5370
5371 Fix typo that broke non-Windows builds.
5372 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
5373
5374 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5375
5376 Support building on MS-Windows with libxml2.
5377
5378 * makefile.w32-in (OBJ2): Add xml.$(O).
5379 (GLOBAL_SOURCES): Add xml.c.
5380 ($(BLD)/xml.$(O)): New dependency list.
5381
5382 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5383 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5384 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5385 [!WINDOWSNT]: New macros.
5386 (init_libxml2_functions, libxml2_loaded_p): New functions.
5387 (parse_region): Call fn_xmlCheckVersion instead of using the macro
5388 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
5389 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5390 Calls xmlCleanupParser only if libxml2 was loaded (or statically
5391 linked in).
5392 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5393 Call init_libxml2_functions before calling libxml2 functions.
5394 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5395
5396 * emacs.c: Don't include libxml/parser.h.
5397 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5398 xmlCleanupParser directly.
5399
5400 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5401
5402 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5403
5404 * indent.c (Fvertical_motion): If there is a display string at
5405 point, use it.vpos to compute how many lines to backtrack after
5406 move_it_to point. (Bug#11133)
5407
5408 2012-04-06 Eli Zaretskii <eliz@gnu.org>
5409
5410 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5411 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5412 about subtle differences between FETCH_CHAR* and STRING_CHAR*
5413 macros related to unification of CJK characters. For the details,
5414 see the discussion following the message here:
5415 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5416
5417 2012-04-04 Chong Yidong <cyd@gnu.org>
5418
5419 * keyboard.c (Vdelayed_warnings_list): Doc fix.
5420
5421 2012-04-01 Eli Zaretskii <eliz@gnu.org>
5422
5423 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5424 instead of alloca. (Bug#11138)
5425
5426 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
5427
5428 * w32menu.c (is_simple_dialog): Properly check lisp types.
5429 (Bug#11141)
5430
5431 2012-03-31 Eli Zaretskii <eliz@gnu.org>
5432
5433 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5434 position we get to after a call to move_it_to fails the
5435 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5436 only if we wind up in a string from display property. (Bug#11063)
5437
5438 * window.c (Fdelete_other_windows_internal): Invalidate the row
5439 and column information about mouse highlight, so that redisplay
5440 restores it after reallocating the glyph matrices. (Bug#7464)
5441
5442 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5443 string comes from a `display' text property, use the buffer
5444 position of that property as if we actually saw that position in
5445 the row's glyphs.
5446 (move_it_by_lines): Remove the assertion that
5447 "it->current_x == 0 && it->hpos == 0" which can be legitimately
5448 violated when there's a before-string at the beginning of a line.
5449 (Bug#11063)
5450
5451 2012-03-30 Eli Zaretskii <eliz@gnu.org>
5452
5453 * xdisp.c (append_space_for_newline): If the default face was
5454 remapped, use the remapped face for the appended newline.
5455 (extend_face_to_end_of_line): Use the remapped default face for
5456 extending the face to the end of the line.
5457 (display_line): Call extend_face_to_end_of_line when the default
5458 face was remapped. (Bug#11068)
5459
5460 2012-03-29 Eli Zaretskii <eliz@gnu.org>
5461
5462 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5463
5464 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5465
5466 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5467
5468 2012-03-27 Glenn Morris <rgm@gnu.org>
5469
5470 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5471 Doc fixes.
5472
5473 2012-03-26 Kenichi Handa <handa@m17n.org>
5474
5475 * dispextern.h (struct glyph): Fix previous change. Change the
5476 bit length of glyphless.ch to 25 (Bug#11082).
5477
5478 2012-03-26 Chong Yidong <cyd@gnu.org>
5479
5480 * keyboard.c (Vselection_inhibit_update_commands): New variable.
5481 (command_loop_1): Use it; inhibit selection update for
5482 handle-select-window too (Bug#8996).
5483
5484 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
5485
5486 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
5487
5488 2012-03-25 Kenichi Handa <handa@m17n.org>
5489
5490 * dispextern.h (struct glyph): Change the bit length of
5491 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5492
5493 2012-03-24 Eli Zaretskii <eliz@gnu.org>
5494
5495 * s/ms-w32.h (tzname): Include time.h before redirecting to
5496 _tzname. Fixes the MSVC build. (Bug#9960)
5497
5498 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
5499
5500 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5501 characters.
5502
5503 * xterm.c (XTread_socket): Only modify handling_signal if
5504 !SYNC_INPUT. (Bug#11080)
5505
5506 2012-03-23 Eli Zaretskii <eliz@gnu.org>
5507
5508 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5509 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
5510 when fetching a multibyte character consumes more bytes than
5511 CHAR_BYTES returns, due to unification of CJK characters in
5512 string_char. (Bug#11073)
5513
5514 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
5515
5516 * process.c (wait_reading_process_output): Handle pty disconnect
5517 by refraining from sending oneself a SIGCHLD (bug#10933).
5518
5519 2012-03-22 Chong Yidong <cyd@gnu.org>
5520
5521 * dispextern.h (struct it): New member string_from_prefix_prop_p.
5522
5523 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
5524 Mark string as coming from a prefix property.
5525 (handle_face_prop): Use default face for prefix strings (Bug#4281).
5526 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
5527
5528 2012-03-21 Chong Yidong <cyd@gnu.org>
5529
5530 * xfaces.c (Vface_remapping_alist): Doc fix.
5531
5532 2012-03-20 Eli Zaretskii <eliz@gnu.org>
5533
5534 * w32proc.c (Fw32_set_console_codepage)
5535 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
5536 Doc fixes.
5537
5538 2012-03-20 Chong Yidong <cyd@gnu.org>
5539
5540 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
5541 to reflect default non-nil value of redisplay-dont-pause.
5542
5543 2012-03-19 Kenichi Handa <handa@m17n.org>
5544
5545 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5546 it fit in a valid range (Bug#11003).
5547
5548 2012-03-18 Eli Zaretskii <eliz@gnu.org>
5549
5550 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5551 that is not from display property, accept the row as a "cursor
5552 row" if one of the string's character has a non-nil `cursor'
5553 property. Fixes cursor positioning when there are newlines in
5554 overlay strings, e.g. in icomplete.el. (Bug#11035)
5555
5556 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5557
5558 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5559
5560 2012-03-12 Chong Yidong <cyd@gnu.org>
5561
5562 * eval.c (inhibit_lisp_code): Rename from
5563 inhibit_window_configuration_change_hook; move from window.c.
5564
5565 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5566 * window.c (run_window_configuration_change_hook)
5567 (syms_of_window): Callers changed.
5568
5569 2012-03-11 Chong Yidong <cyd@gnu.org>
5570
5571 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5572
5573 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5574
5575 2012-03-10 Chong Yidong <cyd@gnu.org>
5576
5577 * frame.c (other_visible_frames): Don't assume the selected frame
5578 is visible (Bug#10955).
5579
5580 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5581
5582 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5583
5584 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5585
5586 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5587 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5588 zero (Bug#10954).
5589
5590 2012-03-03 Glenn Morris <rgm@gnu.org>
5591
5592 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
5593
5594 2012-03-02 Eli Zaretskii <eliz@gnu.org>
5595
5596 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5597 position past the first glyph_row that ends at ZV. (Bug#10902)
5598 (redisplay_window, next_element_from_string): Fix typos in
5599 comments.
5600 (redisplay_window): Pass to move_it_vertically the margin in
5601 pixels, not in screen lines.
5602
5603 2012-03-02 Glenn Morris <rgm@gnu.org>
5604
5605 * buffer.c (buffer-list-update-hook): Doc fix.
5606
5607 2012-02-29 Eli Zaretskii <eliz@gnu.org>
5608
5609 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5610 push_it before setting up the iterator for the first overlay
5611 string, even if we have an empty string loaded.
5612 (next_overlay_string): If there's an empty string on the iterator
5613 stack, pop the stack. (Bug#10903)
5614
5615 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5616
5617 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5618 Suggested by Stefan Monnier in
5619 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5620 * alloc.c (widen_to_Lisp_Object): New static function.
5621 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5622 and widening them to Lisp_Objects. This would work even if
5623 USE_LSB_TAG is defined and wide integers are used, which might
5624 happen in a future version of Emacs.
5625
5626 2012-02-25 Chong Yidong <cyd@gnu.org>
5627
5628 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5629 Doc fix.
5630
5631 * xselect.c (Fx_selection_exists_p): Doc fix.
5632 (x_clipboard_manager_save_all): Print an informative message
5633 before saving to clipboard manager.
5634
5635 2012-02-24 Chong Yidong <cyd@gnu.org>
5636
5637 * keyboard.c (process_special_events): Handle all X selection
5638 requests in kbd_buffer, not just the next one (Bug#8869).
5639
5640 2012-02-23 Chong Yidong <cyd@gnu.org>
5641
5642 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5643 call when setting menu-bar-lines and tool-bar-lines parameters.
5644 (unwind_create_frame_1): New helper function.
5645
5646 * window.c (inhibit_window_configuration_change_hook): New var.
5647 (run_window_configuration_change_hook): Obey it.
5648 (syms_of_window): Initialize it.
5649
5650 2012-02-22 Chong Yidong <cyd@gnu.org>
5651
5652 * xterm.c (x_draw_image_relief): Add missing type check for
5653 Vtool_bar_button_margin (Bug#10743).
5654
5655 2012-02-21 Chong Yidong <cyd@gnu.org>
5656
5657 * fileio.c (Vfile_name_handler_alist): Doc fix.
5658
5659 * buffer.c (Fget_file_buffer): Protect against invalid file
5660 handler return value.
5661
5662 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5665 when computing $valmask.
5666
5667 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5668 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5669 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5670 It's useless in that case, and it can cause problems on hosts
5671 that allocate halves of EMACS_INT values separately.
5672 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5673 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5674 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5675 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5676 it avoids undefined behavior on hosts where shifting right by more
5677 than the word width has undefined behavior.
5678
5679 2012-02-19 Chong Yidong <cyd@gnu.org>
5680
5681 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5682 (Funhandled_file_name_directory, Ffile_name_as_directory)
5683 (Fdirectory_file_name, Fexpand_file_name)
5684 (Fsubstitute_in_file_name): Protect against invalid file handler
5685 return values (Bug#10845).
5686
5687 2012-02-18 Eli Zaretskii <eliz@gnu.org>
5688
5689 * .gdbinit (pitx): Fix incorrect references to fields of the
5690 iterator stack.
5691
5692 2012-02-17 Chong Yidong <cyd@gnu.org>
5693
5694 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5695
5696 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5697
5698 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5699 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5700
5701 2012-02-15 Chong Yidong <cyd@gnu.org>
5702
5703 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5704 marked as special. Also, starting docstrings with * is obsolete.
5705
5706 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5707
5708 * gnutls.c (emacs_gnutls_write): Fix last change.
5709
5710 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5711
5712 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5713 send_process.
5714
5715 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5716
5717 * keymap.c (Fsingle_key_description): Handle char ranges.
5718
5719 2012-02-12 Chong Yidong <cyd@gnu.org>
5720
5721 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5722 as that creates a dangerous corner case.
5723
5724 * window.c (Fdelete_window_internal): Invalidate the mouse
5725 highlight (Bug#9904).
5726
5727 2012-02-12 Glenn Morris <rgm@gnu.org>
5728
5729 * xselect.c (Fx_own_selection_internal)
5730 (Fx_get_selection_internal, Fx_disown_selection_internal)
5731 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5732 * nsselect.m (Fx_own_selection_internal)
5733 (Fx_disown_selection_internal, Fx_selection_exists_p)
5734 (Fx_selection_owner_p, Fx_get_selection_internal):
5735 Sync docs and argument specs with the xselect.c versions.
5736
5737 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5738
5739 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5740
5741 2012-02-11 Eli Zaretskii <eliz@gnu.org>
5742
5743 * w32select.c (Fx_selection_exists_p): Sync doc string and
5744 argument list with xselect.c. (Bug#10783)
5745
5746 * w16select.c (Fx_selection_exists_p): Sync doc string and
5747 argument list with xselect.c. (Bug#10783)
5748
5749 2012-02-10 Glenn Morris <rgm@gnu.org>
5750
5751 * fns.c (Fsecure_hash): Doc fix.
5752
5753 2012-02-09 Kenichi Handa <handa@m17n.org>
5754
5755 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5756
5757 2012-02-07 Chong Yidong <cyd@gnu.org>
5758
5759 * buffer.c (Fbuffer_local_variables)
5760 (buffer_lisp_local_variables): Handle unbound vars correctly;
5761 don't let Qunbound leak into Lisp.
5762
5763 2012-02-07 Glenn Morris <rgm@gnu.org>
5764
5765 * image.c (Fimagemagick_types): Doc fix.
5766
5767 * image.c (imagemagick-render-type): Change it from a lisp object
5768 to an integer. Move the doc here from the lisp manual.
5769 Treat all values not equal to 0 the same.
5770
5771 2012-02-06 Chong Yidong <cyd@gnu.org>
5772
5773 * doc.c (store_function_docstring): Avoid applying docstring of
5774 alias to base function (Bug#2603).
5775
5776 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
5777
5778 * .gdbinit (pp1, pv1): Remove redundant defines.
5779 (pr): Use pp.
5780
5781 2012-02-04 Chong Yidong <cyd@gnu.org>
5782
5783 * nsterm.m: Declare a global (Bug#10694).
5784
5785 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5786
5787 * w32.c (get_emacs_configuration_options):
5788 Include --enable-checking, if specified, in the return value.
5789
5790 2012-02-04 Martin Rudalics <rudalics@gmx.at>
5791
5792 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
5793 after rounding frame sizes. (Bug#9723)
5794
5795 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5796
5797 * keyboard.c (adjust_point_for_property): Don't position point
5798 before BEGV. (Bug#10696)
5799
5800 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
5801
5802 Handle overflow when computing char display width (Bug#9496).
5803 * character.c (char_width): Return EMACS_INT, not int.
5804 (char_width, c_string_width): Check for overflow when
5805 computing the width; this is possible now that individual
5806 characters can have unbounded width. Problem introduced
5807 by merge from Emacs 23 on 2012-01-19.
5808
5809 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
5810
5811 * dbusbind.c (Fdbus_register_method): Mention the return value
5812 :ignore in the docstring.
5813
5814 2012-02-02 Glenn Morris <rgm@gnu.org>
5815
5816 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
5817
5818 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5819 Unconditionally set to t. (Bug#10673)
5820 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5821 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5822 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
5823
5824 2012-02-02 Kenichi Handa <handa@m17n.org>
5825
5826 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
5827 0, do not call append_composite_glyph.
5828
5829 2012-02-02 Kenichi Handa <handa@m17n.org>
5830
5831 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
5832 NULL (Bug#6988).
5833 (x_produce_glyphs): If the component of a composition is a null
5834 string, set it->pixel_width to 1 to avoid zero-width glyph.
5835
5836 2012-02-01 Eli Zaretskii <eliz@gnu.org>
5837
5838 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
5839 first 2 arguments are identical. This makes inserting large
5840 output from a subprocess an order of magnitude faster on
5841 MS-Windows, where all sbrk'ed memory is always contiguous.
5842
5843 2012-01-31 Glenn Morris <rgm@gnu.org>
5844
5845 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5846 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5847 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
5848
5849 2012-01-29 Glenn Morris <rgm@gnu.org>
5850
5851 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
5852
5853 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
5854
5855 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
5856
5857 2012-01-28 Chong Yidong <cyd@gnu.org>
5858
5859 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
5860
5861 2012-01-26 Chong Yidong <cyd@gnu.org>
5862
5863 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
5864
5865 * search.c (Fsearch_forward, Fsearch_backward): Document negative
5866 repeat counts (Bug#10507).
5867
5868 2012-01-26 Glenn Morris <rgm@gnu.org>
5869
5870 * lread.c (syms_of_lread): Doc fix.
5871
5872 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5873
5874 * coding.c (encode_designation_at_bol): Change return value to
5875 EMACS_INT.
5876
5877 2012-01-25 Chong Yidong <cyd@gnu.org>
5878
5879 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5880
5881 2012-01-21 Chong Yidong <cyd@gnu.org>
5882
5883 * floatfns.c (Fcopysign): Make the second argument non-optional,
5884 since nil is not allowed anyway.
5885
5886 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5887
5888 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5889 (send_process): Likewise.
5890
5891 2012-01-19 Martin Rudalics <rudalics@gmx.at>
5892
5893 * window.c (save_window_save, Fcurrent_window_configuration)
5894 (Vwindow_persistent_parameters): Do not use Qstate.
5895 Rewrite doc-strings.
5896
5897 2012-01-19 Kenichi Handa <handa@m17n.org>
5898
5899 * character.c (char_width): New function.
5900 (Fchar_width, c_string_width, lisp_string_width):
5901 Use char_width (Bug#9496).
5902
5903 2012-01-16 Martin Rudalics <rudalics@gmx.at>
5904
5905 * window.c (Vwindow_persistent_parameters): New variable.
5906 (Fset_window_configuration, save_window_save): Handle persistent
5907 window parameters.
5908
5909 2012-01-14 Eli Zaretskii <eliz@gnu.org>
5910
5911 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5912 thrashing the stack of the thread. (Bug#9087)
5913
5914 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5915
5916 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5917
5918 2012-01-11 Eli Zaretskii <eliz@gnu.org>
5919
5920 * xdisp.c (rows_from_pos_range): Handle the case where the
5921 highlight ends on a newline. (Bug#10464)
5922 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5923 he end column for display of highlight that ends on a newline
5924 before a R2L line.
5925
5926 2012-01-11 Glenn Morris <rgm@gnu.org>
5927
5928 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5929 from load-path also when installation-directory is nil. (Bug#10208)
5930
5931 2012-01-10 Glenn Morris <rgm@gnu.org>
5932
5933 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5934
5935 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5936 Update template values to be closer to their typical values these days.
5937
5938 2012-01-09 Eli Zaretskii <eliz@gnu.org>
5939
5940 * xdisp.c (rows_from_pos_range): Accept additional argument
5941 DISP_STRING, and accept any glyph in a row whose object is that
5942 string as eligible for mouse highlight. Fixes mouse highlight of
5943 display strings from overlays. (Bug#10464)
5944
5945 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
5946
5947 emacs: fix an auto-save permissions race condition (Bug#10400)
5948 * fileio.c (auto_saving_dir_umask): New static var.
5949 (Fmake_directory_internal): Use it.
5950 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5951 creating the directory. The old code temporarily assigns
5952 too-generous permissions to the directory.
5953 (do_auto_save_eh): Clear it.
5954 (Fdo_auto_save): Catch all errors, not just file errors, so
5955 that the var is always cleared.
5956
5957 2012-01-07 Eli Zaretskii <eliz@gnu.org>
5958
5959 * search.c (scan_buffer): Pass character positions to
5960 know_region_cache, not byte positions. (Bug#6540)
5961
5962 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
5963
5964 * w32.c (sys_rename): Report EXDEV when rename of a directory
5965 fails because the target is on another logical disk. (Bug#10284)
5966
5967 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5968
5969 * xterm.c (x_embed_request_focus): New function.
5970
5971 * xterm.h: Add prototype.
5972
5973 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5974
5975 2012-01-05 Glenn Morris <rgm@gnu.org>
5976
5977 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5978
5979 2012-01-01 Eli Zaretskii <eliz@gnu.org>
5980
5981 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5982 Load gnutls_transport_set_lowat only if GnuTLS version is below
5983 2.11.1.
5984 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5985 GnuTLS versions below 2.11.1.
5986
5987 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5988
5989 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5990 to the doc string advising against its use for altering the way
5991 windows are scrolled.
5992
5993 2011-12-28 Kenichi Handa <handa@m17n.org>
5994
5995 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
5996 coding-system ASCII compatible only when it does not produce BOM
5997 on encoding (Bug#10383).
5998
5999 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
6000
6001 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
6002 can scroll.
6003 (create_and_show_popup_menu): Always use menu_position_func for
6004 Gtk3 (Bug#10361).
6005
6006 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
6007
6008 * callint.c (Fcall_interactively): Don't truncate prompt string.
6009
6010 2011-12-23 Eli Zaretskii <eliz@gnu.org>
6011
6012 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
6013 property that ends at ZV, so that the bidi iteration could be
6014 resumed from there (after widening). (Bug#10360)
6015
6016 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
6017
6018 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
6019
6020 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
6021
6022 * nsterm.m (x_free_frame_resources):
6023 Release f->output_data.ns->miniimage.
6024 (ns_index_color): Fix indentation. Do not retain
6025 color_table->colors[i].
6026
6027 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
6028 before returning.
6029
6030 * nsfns.m (x_set_background_color): Assign return value from
6031 ns_index_color to face-background instead of NSColor*.
6032 (ns_implicitly_set_icon_type): Fix indentation.
6033 Change assignment in for loop to comparison.
6034
6035 * emacs.c (ns_pool): New variable.
6036 (main): Assign ns_pool.
6037 (Fkill_emacs): Call ns_release_autorelease_pool.
6038
6039 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
6040 autorelease fdesc, release fdAttrs and tdict.
6041 (ns_get_covering_families): Release charset.
6042 (ns_findfonts): Release NSFontDescriptor created with new.
6043 (ns_uni_to_glyphs): Fix indentation.
6044 (setString): Release attrStr before assigning new value.
6045
6046 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6047
6048 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
6049 and NS_IMPL_COCOA.
6050 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
6051 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
6052
6053 2011-12-18 David Reitter <reitter@cmu.edu>
6054
6055 * nsterm.m (ns_term_init): Subscribe for notifications
6056 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
6057 to method trackingNotification in EmacsMenu.
6058
6059 * nsmenu.m (trackingMenu): New variable.
6060 (trackingNotification): New method (from Aquamacs).
6061 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
6062 from Aquamacs (Bug#7030).
6063
6064 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6065
6066 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
6067 (symbol_to_nsstring): Fix indentation.
6068 (ns_symbol_to_pb): New function.
6069 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
6070 (Fns_rotate_cut_buffers_internal): Remove.
6071 (Fns_store_selection_internal): Rename from
6072 Fns_store_cut_buffer_internal.
6073 (ns_get_foreign_selection, Fx_own_selection_internal)
6074 (Fx_disown_selection_internal, Fx_selection_exists_p)
6075 (Fns_get_selection_internal, Fns_store_selection_internal):
6076 Use ns_symbol_to_pb and check if return value is nil.
6077 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
6078 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
6079 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
6080 renamed to Sns_store_selection_internal.
6081 (ns_handle_selection_request): Move code to Fx_own_selection_internal
6082 and remove this function.
6083 (ns_handle_selection_clear): Remove, never used.
6084 (Fx_own_selection_internal): Move code from ns_handle_selection_request
6085 here.
6086
6087 2011-12-17 Ken Brown <kbrown@cornell.edu>
6088
6089 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
6090 GID is unknown (Bug#10257).
6091
6092 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
6093
6094 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
6095 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
6096 which caused a build failure on GNU/Linux IA-64. This problem was
6097 introduced by my 2011-10-07 patch.
6098
6099 2011-12-15 Juri Linkov <juri@jurta.org>
6100
6101 * image.c (imagemagick_error): New function. (Bug#10112)
6102 (imagemagick_load_image): Comment out `MagickSetResolution' call.
6103 Use `imagemagick_error' where ImageMagick functions return
6104 `MagickFalse'.
6105 (Fimagemagick_types): Add `Fnreverse' to return the list in the
6106 proper order.
6107
6108 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6109
6110 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
6111 fill background (Bug#8992).
6112
6113 2011-12-13 Martin Rudalics <rudalics@gmx.at>
6114
6115 * window.c (Vwindow_combination_resize)
6116 (Vwindow_combination_limit): Use t instead of non-nil in
6117 doc-strings.
6118 (Vrecenter_redisplay): Add first sentence of doc-string on
6119 separate line.
6120 (Frecenter): Fix doc-string typo.
6121
6122 2011-12-11 Kenichi Handa <handa@m17n.org>
6123
6124 * coding.c (Funencodable_char_position): Pay attention to the
6125 buffer text relocation (Bug#9389).
6126
6127 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6128
6129 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
6130 gtk_init (Bug#10100).
6131
6132 2011-12-10 Eli Zaretskii <eliz@gnu.org>
6133
6134 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
6135 IT->string is nil. (Bug#10263)
6136
6137 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6138
6139 * nsterm.h (x_free_frame_resources): Declare.
6140
6141 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
6142 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
6143
6144 * nsterm.h (ns_get_defaults_value): Declare.
6145
6146 * nsterm.m (ns_default): Call ns_get_defaults_value.
6147
6148 2011-12-09 Eli Zaretskii <eliz@gnu.org>
6149
6150 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
6151 (Bug#10170)
6152
6153 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6154
6155 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
6156 that where the value of an _OBJC_* symbol points to is in the .bss
6157 section (Bug#10240).
6158
6159 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6160
6161 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
6162 after the loop to call ccl_driver at least once (Bug#8619).
6163
6164 2011-12-08 Kenichi Handa <handa@m17n.org>
6165
6166 * ftfont.c (get_adstyle_property): Fix previous change
6167 (Bug#10233).
6168
6169 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
6170
6171 * w32.c (init_environment): If no_site_lisp, remove site-lisp
6172 dirs from the default value of EMACSLOADPATH (bug#10208).
6173
6174 2011-12-07 Glenn Morris <rgm@gnu.org>
6175
6176 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
6177 installation and source directories as well. (Bug#10208)
6178
6179 2011-12-06 Chong Yidong <cyd@gnu.org>
6180
6181 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
6182
6183 2011-12-06 Glenn Morris <rgm@gnu.org>
6184
6185 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
6186 as an error, not just -1. (Bug#10217)
6187
6188 2011-12-05 Chong Yidong <cyd@gnu.org>
6189
6190 * keyboard.c (process_special_events): New function.
6191 (swallow_events, Finput_pending_p): Use it (Bug#10195).
6192
6193 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
6194
6195 * coding.c (encode_designation_at_bol): Don't use uninitialized
6196 local variable (Bug#9318).
6197
6198 2011-12-05 Kenichi Handa <handa@m17n.org>
6199
6200 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
6201 return Qnil (Bug#8046, Bug#10193).
6202
6203 2011-12-05 Kenichi Handa <handa@m17n.org>
6204
6205 * coding.c (encode_designation_at_bol): New args charbuf_end and
6206 dst. Return the number of produced bytes. Callers changed.
6207 (coding_set_source): Return how many bytes coding->source was
6208 relocated.
6209 (coding_set_destination): Return how many bytes
6210 coding->destination was relocated.
6211 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
6212 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
6213
6214 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6215
6216 * coding.c (CODING_CHAR_CHARSET_P): New macro.
6217 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
6218 macro (Bug#9318).
6219
6220 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
6221
6222 The following changes are to fix Bug#9318.
6223
6224 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
6225 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
6226 (encode_coding_iso_2022, encode_coding_sjis)
6227 (encode_coding_big5, encode_coding_charset): Use the above macros.
6228
6229 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
6230
6231 * lisp.h (process_quit_flag): Fix external declaration.
6232
6233 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
6234
6235 Don't macro-inline non-performance-critical code.
6236 * eval.c (process_quit_flag): New function.
6237 * lisp.h (QUIT): Use it.
6238
6239 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
6240
6241 * nsfns.m (get_geometry_from_preferences): New function.
6242 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
6243
6244 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
6245
6246 * emacs.c (Qkill_emacs): Define.
6247 (syms_of_emacs): Initialize it.
6248 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
6249 Qquit_flag to `kill-emacs' instead.
6250 (quit_throw_to_read_char): Add parameter `from_signal'.
6251 All callers changed. Call Fkill_emacs if requested and safe.
6252 * lisp.h (QUIT): Call Fkill_emacs if requested.
6253
6254 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
6255
6256 * widget.c (update_wm_hints): Return if wmshell is null.
6257 (widget_update_wm_size_hints): New function.
6258
6259 * widget.h (widget_update_wm_size_hints): Declare.
6260
6261 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
6262 widget_update_wm_size_hints (Bug#10104).
6263
6264 2011-12-03 Eli Zaretskii <eliz@gnu.org>
6265
6266 * xdisp.c (handle_invisible_prop): If the invisible text ends just
6267 before a newline, prepare the bidi iterator for consuming the
6268 newline, and keep the current paragraph direction. (Bug#10183)
6269 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
6270
6271 2011-12-02 Juri Linkov <juri@jurta.org>
6272
6273 * search.c (Fword_search_regexp): New Lisp function created from
6274 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
6275 (Fword_search_backward, Fword_search_forward)
6276 (Fword_search_backward_lax, Fword_search_forward_lax):
6277 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
6278 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
6279
6280 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
6281
6282 * fileio.c (Finsert_file_contents): Move after-change-function call
6283 to before the "handled:" label, since all "goto handled" appear in
6284 cases where the *-change-functions have already been properly called
6285 (bug#10117).
6286
6287 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
6288
6289 * keyboard.c (interrupt_signal): Don't call kill-emacs when
6290 waiting for input. (Bug#10169)
6291
6292 2011-11-30 Eli Zaretskii <eliz@gnu.org>
6293
6294 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
6295 verifies glyph row's hash code--we have just reallocated the
6296 glyphs, so their contents can be complete garbage. (Bug#10164)
6297
6298 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
6299
6300 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
6301
6302 2011-11-30 Eli Zaretskii <eliz@gnu.org>
6303
6304 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
6305 attributes are tested _before_ calling verify_row_hash, to protect
6306 against GCC re-ordering of the tests. (Bug#10164)
6307
6308 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
6309
6310 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
6311
6312 * xterm.c (handle_one_xevent): Only set async_visible and friends
6313 if net_wm_state_hidden_seen is non-zero (Bug#10002)
6314 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
6315 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
6316
6317 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
6318
6319 Remove GCPRO-related macros that exist only to avoid shadowing locals.
6320 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
6321 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
6322 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6323 All uses changed to use GCPRO1 etc.
6324 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
6325 Revert to old implementation (i.e., before 2011-03-11).
6326
6327 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6328
6329 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
6330 of scroll runs so as to avoid assigning disabled bogus rows and
6331 unnecessary graphics copy operations.
6332
6333 2011-11-27 Eli Zaretskii <eliz@gnu.org>
6334
6335 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
6336 (snprintf) [_MSC_VER]: Redirect to _snprintf.
6337 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
6338 (malloc, free, realloc, calloc): Redirect to e_* only when
6339 compiling Emacs.
6340
6341 * lisp.h (GCTYPEBITS): Move before first use.
6342 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
6343 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
6344 this macro definition.
6345
6346 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
6347 _MSC_VER.
6348
6349 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
6350
6351 * gtkutil.c (xg_create_frame_widgets):
6352 Call gtk_window_set_has_resize_grip (FALSE) if that function is
6353 present with Gtk+ 2.0.
6354
6355 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6356
6357 * fileio.c (Finsert_file_contents): Undo previous change; see
6358 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6359
6360 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6361
6362 Rename locals to avoid shadowing.
6363 * fileio.c (Finsert_file_contents):
6364 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
6365 * process.c (wait_reading_process_output):
6366 Rename inner 'proc' to 'p' to avoid shadowing.
6367 Indent for consistency with usual Emacs style.
6368
6369 2011-11-25 Eli Zaretskii <eliz@gnu.org>
6370
6371 * xdisp.c (redisplay_window): If cursor row is not fully visible
6372 after recentering, and scroll-conservatively is set to a large
6373 number, scroll window by a few more lines to make the cursor fully
6374 visible and out of scroll-margin. (Bug#10105)
6375 (start_display): Don't move to the next line if the display should
6376 start at a newline that is part of a display vector or an overlay
6377 string. (Bug#10119)
6378
6379 2011-11-24 Juri Linkov <juri@jurta.org>
6380
6381 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6382 after the `MagickPingImage' call. (Bug#10112)
6383
6384 2011-11-23 Chong Yidong <cyd@gnu.org>
6385
6386 * window.c (Fcoordinates_in_window_p): Accept only live windows.
6387
6388 2011-11-23 Martin Rudalics <rudalics@gmx.at>
6389
6390 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6391 making another buffer current. (Bug#10114)
6392
6393 2011-11-23 Glenn Morris <rgm@gnu.org>
6394
6395 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
6396
6397 2011-11-23 Chong Yidong <cyd@gnu.org>
6398
6399 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6400 using it (Bug#5984).
6401
6402 2011-11-22 Eli Zaretskii <eliz@gnu.org>
6403
6404 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6405 and header-lines, as they don't have one computed for them.
6406 (Bug#10098)
6407
6408 * .gdbinit (prow): Make displayed values more self-explaining.
6409 Add row's hash code.
6410
6411 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
6412
6413 * process.c (wait_reading_process_output): Fix asynchrounous
6414 GnuTLS socket handling on some versions of the GnuTLS library.
6415 (wait_reading_process_output): Add comment and URL.
6416
6417 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
6418
6419 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6420
6421 2011-11-21 Chong Yidong <cyd@gnu.org>
6422
6423 * window.c (Fnext_window, Fprevious_window): Doc fix.
6424
6425 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6426
6427 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6428
6429 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6430
6431 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6432
6433 2011-11-20 Martin Rudalics <rudalics@gmx.at>
6434
6435 * window.c (Fset_window_combination_limit): Rename argument
6436 STATUS to LIMIT.
6437 (Vwindow_combination_limit): Remove "status" from doc-string.
6438
6439 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
6440
6441 * m/ibms390.h: Remove.
6442 * m/ibms390x.h: Don't include "ibms390.h".
6443
6444 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6445
6446 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6447 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6448
6449 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6450
6451 * casetab.c (Fset_case_table):
6452 * charset.c (Fcharset_after): Fix typos.
6453
6454 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6457 Otherwise, valgrind does not work on some platforms.
6458 Problem reported by Andreas Schwab in
6459 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6460 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6461 is set, removing the need for VIRT_ADDRESS_VARIES.
6462 (PURE_P): Use a more-efficient implementation that needs just one
6463 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6464 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6465 to 4 (xorl, subq, cmpq, setbe).
6466 * alloc.c (pure): Always extern now, since that's the
6467 VIRT_ADDR_VARIES behavior.
6468 (PURE_POINTER_P): Use a single comparison, not two, for
6469 consistency with the new puresize.h.
6470 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6471 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6472 Remove VIRT_ADDR_VARIES no longer needed.
6473
6474 2011-11-19 Eli Zaretskii <eliz@gnu.org>
6475
6476 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6477 (erase_phys_cursor, update_window_cursor, show_mouse_face)
6478 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6479 behave as if the cursor position were at the window margin.
6480
6481 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6482 and the cursor position is out of bounds, behave as if the cursor
6483 position were at the window margin. (Bug#10075)
6484
6485 2011-11-18 Chong Yidong <cyd@gnu.org>
6486
6487 * window.c (Fwindow_combination_limit): Make first argument
6488 non-optional, since it is meaningless for live windows like the
6489 selected window.
6490
6491 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
6492
6493 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6494
6495 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
6496
6497 * intervals.c: Fix grafting over the whole buffer (bug#10071).
6498 (graft_intervals_into_buffer): Simplify.
6499
6500 2011-11-18 Eli Zaretskii <eliz@gnu.org>
6501
6502 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6503 hash values of the two rows.
6504 (copy_row_except_pointers): Preserve the used[] arrays and the
6505 hash values of the two rows. (Bug#10035)
6506 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
6507
6508 * xdisp.c (row_hash): New function, body extracted from
6509 compute_line_metrics.
6510 (compute_line_metrics): Call row_hash, instead of computing the
6511 hash code inline.
6512
6513 * dispnew.c (verify_row_hash): Call row_hash for computing the
6514 hash code of a row, instead of duplicating code from xdisp.c.
6515
6516 * dispextern.h (row_hash): Add prototype.
6517
6518 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
6519
6520 * frame.c (delete_frame): Don't delete the terminal when the last
6521 X frame is closed if emacs is built with GTK toolkit.
6522
6523 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
6524
6525 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
6526
6527 2011-11-17 Martin Rudalics <rudalics@gmx.at>
6528
6529 * window.c (Vwindow_splits): Rename to
6530 Vwindow_combination_resize. Suggested by Juri Linkov.
6531 (Fsplit_window_internal): Use Vwindow_combination_resize instead
6532 of Vwindow_splits.
6533
6534 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
6535
6536 * nsfns.m (Fns_font_name):
6537 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
6538
6539 2011-11-16 Martin Rudalics <rudalics@gmx.at>
6540
6541 * window.h (window): Rename slot "nest" to "combination_limit".
6542 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6543 (Fset_window_nest): Rename to Fset_window_combination_limit.
6544 (Vwindow_nest): Rename to Vwindow_combination_limit.
6545 (recombine_windows, make_parent_window, make_window)
6546 (Fsplit_window_internal, saved_window)
6547 (Fset_window_configuration, save_window_save): Rename all
6548 occurrences of window_nest to window_combination_limit.
6549
6550 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
6551
6552 * image.c (imagemagick_load_image): Fix typo.
6553
6554 2011-11-14 Eli Zaretskii <eliz@gnu.org>
6555
6556 * xdisp.c (display_line): Move the call to
6557 highlight_trailing_whitespace before the call to
6558 compute_line_metrics, since the latter needs to see the final
6559 faces of all the glyphs to compute ROW's hash value.
6560 Fixes assertion violations in row_equal_p. (Bug#10035)
6561
6562 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
6563
6564 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6565 just return (bug#10044).
6566
6567 2011-11-12 Eli Zaretskii <eliz@gnu.org>
6568
6569 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6570 with user-defined heap size. Bump the default size of the temacs
6571 heap to 27MB, to avoid memory warning when running temacs.
6572 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6573
6574 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6575 current_matrix and desired_matrix. (Bug#9990)
6576 (verify_row_hash) [XASSERTS]: New function.
6577 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6578 that the hash value of glyph rows is correct.
6579
6580 2011-11-12 Martin Rudalics <rudalics@gmx.at>
6581
6582 * window.h (window): Remove splits slot.
6583 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6584 (Fdelete_other_windows_internal, make_parent_window)
6585 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6586 (Fset_window_configuration, save_window_save): Don't deal with
6587 split status of windows.
6588 (saved_window): Remove splits slot.
6589 (Vwindow_splits): Rewrite doc-string.
6590
6591 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6592
6593 * xfns.c (unwind_create_frame):
6594 * nsfns.m (unwind_create_frame):
6595 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6596 Vframe_list (Bug#9999).
6597
6598 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6599
6600 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
6601
6602 2011-11-11 Kenichi Handa <handa@m17n.org>
6603
6604 * callproc.c (Fcall_process): Set the member dst_multibyte of
6605 process_coding.
6606
6607 2011-11-11 Johan Bockgård <bojohan@gnu.org>
6608
6609 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6610 avoid a crash (bug#9496).
6611
6612 2011-11-09 Chong Yidong <cyd@gnu.org>
6613
6614 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6615 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6616
6617 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6618
6619 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6620
6621 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 Avoid some portability problems by eschewing 'extern inline' functions.
6624 The trivial performance wins aren't worth the portability hassles; see
6625 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6626 et seq.
6627 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6628 (window_box_width, window_box_left, window_box_left_offset)
6629 (window_box_right, window_box_right_offset): Undo previous change,
6630 by removing the "extern"s.
6631 * intervals.c (adjust_intervals_for_insertion)
6632 (adjust_intervals_for_deletion): Undo previous change,
6633 making these static again.
6634 (offset_intervals, temp_set_point_both, temp_set_point)
6635 (copy_intervals_to_string): No longer inline.
6636 * xdisp.c (window_text_bottom_y, window_box_width)
6637 (window_box_height, window_box_left_offset)
6638 (window_box_right_offset, window_box_left, window_box_right)
6639 (window_box): No longer inline.
6640
6641 2011-11-08 Chong Yidong <cyd@gnu.org>
6642
6643 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6644 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6645 Signal an error if not a live window.
6646 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6647 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6648
6649 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
6650
6651 * lisp.h (syms_of_abbrev): Remove declaration.
6652 Reported by CHENG Gao <chenggao@royau.me>.
6653
6654 2011-11-07 Eli Zaretskii <eliz@gnu.org>
6655
6656 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6657 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6658 of temacs in GUI mode.
6659
6660 2011-11-07 Martin Rudalics <rudalics@gmx.at>
6661
6662 * window.h: Declare delete_all_child_windows instead of
6663 delete_all_subwindows.
6664 * window.c (Fwindow_nest, Fset_window_nest)
6665 (Fset_window_new_total, Fset_window_new_normal)
6666 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6667 (delete_all_subwindows): Rename to delete_all_child_windows.
6668 (Fdelete_other_windows_internal, Fset_window_configuration):
6669 Call delete_all_child_windows instead of delete_all_subwindows.
6670 * frame.c (delete_frame): Call delete_all_child_windows instead
6671 of delete_all_subwindows.
6672
6673 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6676 This is also needed for porting to any host where GC_MARK_STACK is
6677 not GC_MAKE_GCPROS_NOOPS.
6678 (which_symbols): Use it.
6679
6680 2011-11-07 Kenichi Handa <handa@m17n.org>
6681
6682 * coding.c (coding_set_destination): Check coding->src_pos only
6683 when coding->src_object is a buffer (bug#9910).
6684
6685 * process.c (send_process): Set the member src_multibyte of coding
6686 to 0 (bug#9911) when sending a unibyte text.
6687
6688 * callproc.c (Fcall_process): Set the member src_multibyte of
6689 process_coding to 0 (bug#9912).
6690
6691 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6692
6693 * xmenu.c (cleanup_widget_value_tree): New function.
6694 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6695 calling free_menubar_widget_value_tree directly (Bug#9830).
6696
6697 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6698
6699 Fix some portability problems with 'inline'.
6700 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6701 (window_box_width, window_box_left, window_box_left_offset)
6702 (window_box_right, window_box_right_offset): Declare extern.
6703 Otherwise, these inline functions do not conform to C99 and
6704 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6705 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6706 * intervals.c (adjust_intervals_for_insertion)
6707 (adjust_intervals_for_deletion): Now extern, because otherwise the
6708 extern inline functions 'offset_intervals' couldn't refer to it.
6709 (static_offset_intervals): Remove.
6710 (offset_intervals): Rewrite using the old contents of
6711 static_offset_intervals. The old version didn't conform to C99
6712 because an extern inline function contained a reference to an
6713 identifier with static linkage.
6714
6715 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6716
6717 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6718 GC.
6719
6720 2011-11-06 Eli Zaretskii <eliz@gnu.org>
6721
6722 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6723 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6724 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6725 return Qleft_to_right.
6726
6727 2011-11-06 Chong Yidong <cyd@gnu.org>
6728
6729 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6730 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6731 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6732 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6733 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6734 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6735 (Fwindow_vscroll): Doc fix.
6736 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6737 argument, since it makes no sense to pass a live window and for
6738 consistency with window-child.
6739
6740 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6741
6742 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6743 support MSVC.
6744
6745 2011-11-05 Jason Rumney <jasonr@gnu.org>
6746
6747 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6748 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6749 fonts (Bug#6029).
6750 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6751 bitwise arithmetic preventing use of unicode-sip and non-truetype
6752 opentype fonts.
6753
6754 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6755
6756 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6757 "emacs"-only part.
6758
6759 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6760 initialization code to keep similarity to xfns.c after changes
6761 from 2011-11-05.
6762
6763 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
6764
6765 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
6766 (unwind_create_frame): New function (Bug#9943).
6767 (Fx_create_frame): Restructure code to be more similar to the one in
6768 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
6769 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
6770 Move terminal->reference_count++ just before making the frame official
6771 (Bug#9943).
6772
6773 * nsterm.m (x_free_frame_resources): New function.
6774 (x_destroy_window): Move code to x_free_frame_resources.
6775
6776 * xfns.c (unwind_create_frame): Fix comment.
6777 (Fx_create_frame, x_create_tip_frame):
6778 Move terminal->reference_count++ just before making the frame
6779 official. Move initialization of image_cache_refcount and
6780 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
6781
6782 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6783
6784 Support MSVC build with newer versions of Visual Studio.
6785 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
6786 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
6787 nt/gmake.defs.
6788
6789 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
6790 which are not supported by MSVC.
6791 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
6792 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
6793 bitfields.
6794 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
6795 types in bitfields.
6796 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
6797
6798 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
6799
6800 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
6801
6802 Support MSVC build with newer versions of Visual Studio.
6803 * w32.c: Don't include w32api.h for MSVC.
6804 (init_environment) [_MSC_VER]: Call sys_access, not _access.
6805
6806 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
6807 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
6808 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
6809 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
6810 e_* cousins.
6811 (alloca) [_MSC_VER]: Define to _alloca.
6812
6813 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
6814
6815 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
6816
6817 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6818
6819 * xdisp.c (note_mouse_highlight): If either of
6820 previous/next-single-property-change returns nil, treat that as
6821 the beginning or the end of the buffer. (Bug#9955)
6822
6823 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
6824
6825 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
6826 label is not null (Bug#9951).
6827 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6828 may be NULL.
6829
6830 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6831
6832 * window.c (Fwindow_body_size): Mention in the doc string that the
6833 return value is in frame's canonical units. (Bug#9949)
6834
6835 2011-11-03 Eli Zaretskii <eliz@gnu.org>
6836
6837 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
6838
6839 * w32fns.c (unwind_create_frame): If needed, free the glyph
6840 matrices of the partially constructed frame. (Bug#9943)
6841 * xfns.c (unwind_create_frame): Likewise.
6842
6843 2011-11-01 Eli Zaretskii <eliz@gnu.org>
6844
6845 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
6846 Don't stop backward scan on the continuation glyph, even though
6847 its CHARPOS is positive.
6848 (mouse_face_from_buffer_pos, note_mouse_highlight):
6849 Rename cover_string to disp_string.
6850
6851 2011-11-01 Martin Rudalics <rudalics@gmx.at>
6852
6853 * window.c (temp_output_buffer_show): Don't use
6854 Vtemp_buffer_show_specifiers.
6855 (Vtemp_buffer_show_specifiers): Remove unused variable.
6856
6857 2011-10-30 Eli Zaretskii <eliz@gnu.org>
6858
6859 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
6860 past the beginning of the current glyph matrix.
6861
6862 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6863
6864 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
6865 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
6866 HAVE_GTK3 (Bug#9869).
6867
6868 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6869 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6870
6871 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6872
6873 * xterm.c: Declare x_handle_net_wm_state to return int.
6874 (handle_one_xevent): Check if we are iconified but don't have
6875 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6876 (get_current_wm_state): Return non-zero if not hidden,
6877 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6878 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6879 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6880 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6881
6882 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6883
6884 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6885 so that this new function doesn't get optimized away by a
6886 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6887
6888 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6889
6890 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6891
6892 2011-10-29 Eli Zaretskii <eliz@gnu.org>
6893
6894 Fix the `xbytecode' command.
6895 * .gdbinit (xprintbytestr): New command.
6896 (xwhichsymbols): Rename from `which'; all callers changed.
6897 (xbytecode): Print the byte-code string as well.
6898
6899 2011-10-29 Kim Storm <storm@cua.dk>
6900
6901 * alloc.c (which_symbols): New function.
6902
6903 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6904
6905 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6906 line. (Bug#9903)
6907
6908 2011-10-29 Glenn Morris <rgm@gnu.org>
6909
6910 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6911 Not clear what it was for, and it causes various bugs. (Bug#9839)
6912
6913 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6914
6915 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6916 possible random value that matches one of those tested as
6917 condition to clear the mouse face.
6918
6919 2011-10-28 Chong Yidong <cyd@gnu.org>
6920
6921 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6922
6923 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6924
6925 * window.c (make_window): Initialize phys_cursor_on_p.
6926
6927 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6928
6929 * lisp.h (struct Lisp_Symbol): Update comments.
6930
6931 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
6932
6933 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6934
6935 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6936
6937 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6938 <oslsachem@gmail.com> for helping to debug this.
6939
6940 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6941 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6942 (g_b_init_get_glyph_outline_w): New static variables.
6943 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6944 (GetGlyphOutlineW_Proc): New typedefs.
6945 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
6946 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6947 New functions.
6948 (w32font_open_internal, compute_metrics):
6949 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
6950 instead of calling the "wide" APIs directly.
6951
6952 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6953
6954 * w32.h (syms_of_w32font): Add prototype.
6955
6956 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6957
6958 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6959 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6960 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6961 (Fmove_to_window_line): Doc fix.
6962
6963 2011-10-27 Chong Yidong <cyd@gnu.org>
6964
6965 * process.c (make_process): Set gnutls_state to NULL.
6966
6967 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6968 non-NULL, regardless of GNUTLS_INITSTAGE.
6969 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6970 an error. Set process slots as soon as we allocate them.
6971
6972 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6973
6974 2011-10-27 Chong Yidong <cyd@gnu.org>
6975
6976 * gnutls.c (emacs_gnutls_deinit): New function.
6977 Deallocate credentials structures as well as calling gnutls_deinit.
6978 (Fgnutls_deinit, Fgnutls_boot): Use it.
6979
6980 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6981 (deactivate_process): Call emacs_gnutls_deinit.
6982
6983 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6984
6985 * image.c (x_create_x_image_and_pixmap):
6986 * w32.c (sys_rename, w32_delayed_load):
6987 * w32font.c (fill_in_logfont):
6988 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6989
6990 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
6991
6992 * w32fns.c (w32_default_color_map): New function,
6993 extracted from Fw32_default_color_map.
6994 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
6995
6996 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
6997
6998 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
6999
7000 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
7001
7002 * keyboard.c (test_undefined): New function (bug#9751).
7003 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
7004
7005 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
7006
7007 * sysdep.c (init_sys_modes): Fix the check for the controlling
7008 terminal (Bug#6649).
7009
7010 2011-10-20 Eli Zaretskii <eliz@gnu.org>
7011
7012 * dispextern.h (struct bidi_it): New member next_en_type.
7013
7014 * bidi.c (bidi_line_init): Initialize the next_en_type member.
7015 (bidi_resolve_explicit_1): When next_en_pos is valid for the
7016 current character, check also for next_en_type being WEAK_EN.
7017 (bidi_resolve_weak): Don't enter the expensive loop if the current
7018 position is before next_en_pos. Record the bidi type of the first
7019 non-ET, non-BN character we find, in addition to its position.
7020 (bidi_level_of_next_char): Invalidate next_en_type when
7021 next_en_pos is over-stepped.
7022
7023 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
7024
7025 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
7026 * editfns.c: Rewrite current-time-zone so that it invokes
7027 the equivalent of (format-time-string "%Z") to get the time zone name.
7028 This fixes a bug when the time zone name contains characters that
7029 need converting from the system time locale to Emacs internal format.
7030 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
7031 that patch fixed format-time-string to do the conversion, but
7032 I forgot to fix current-time-zone.
7033 (format_time_string): New function, containing most of
7034 what Fformat_time_string used to contain.
7035 (Fformat_time_string): Rewrite in terms of format_time_string.
7036 This doesn't change this function's behavior.
7037 (current-time-zone): Rewrite to use format_time_string.
7038 This fixes the bug reported by Michael Schierl in
7039 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
7040 Jason Rumney's 2007-06-07 change worked around this bug, but
7041 didn't fix it.
7042 * systime.h (tzname, timezone): Remove no-longer-used declarations.
7043
7044 2011-10-19 Eli Zaretskii <eliz@gnu.org>
7045
7046 * xdisp.c (start_display): If the character at POS is displayed
7047 via a display vector, reset IT->current.dpvec_index to zero.
7048 (try_window_reusing_current_matrix): If a line ends in a display
7049 vector or the next line starts in a display vector, continue
7050 redrawing the window even though the character position of
7051 start_row was reached.
7052 (Bug#9771, part 2)
7053
7054 2011-10-18 Chong Yidong <cyd@gnu.org>
7055
7056 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
7057 with nobreak-char-display too.
7058
7059 2011-10-18 Eli Zaretskii <eliz@gnu.org>
7060
7061 Fix part 3 of bug#9771.
7062 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
7063 (bidi_resolve_neutral): Don't enter the expensive loop looking for
7064 non-neutral characters if the current character is a paragraph
7065 separator (a.k.a. Newline). This avoids running the same
7066 expensive loop twice, once when we consume the preceding newline
7067 and the other time when the line actually needs to be displayed.
7068 Avoid the loop when we see neutrals on the base embedding level
7069 following a character whose directionality is the same as the
7070 paragraph's. This avoids running the expensive loop when a line
7071 ends in a long sequence of neutrals, like control characters.
7072 Add assertion against STRONG_AL type. Slightly rearrange code
7073 that determines the type of a neutral given the first non-neutral
7074 that follows it.
7075 (bidi_level_of_next_char): Set next_en_pos to zero when
7076 invalidating its info.
7077
7078 2011-10-17 Eli Zaretskii <eliz@gnu.org>
7079
7080 * xdisp.c (push_display_prop): Determine whether to record string
7081 or buffer position by IT->string, not by IT->method. Allow
7082 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
7083 (move_it_vertically_backward): Don't look for character position
7084 immediately after the newline when in a continuation line.
7085 (Bug#9771, part 1)
7086
7087 2011-10-15 Martin Rudalics <rudalics@gmx.at>
7088
7089 * window.c (coordinates_in_window): Rewrite and delabelize
7090 vertical border check. (Bug#5357) (Bug#9618)
7091
7092 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7093
7094 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
7095 errors in XSetWindowBorder (bug#9310).
7096
7097 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
7098
7099 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
7100 avoid crash when xmalloc overrun checking is enabled.
7101
7102 2011-10-13 Eli Zaretskii <eliz@gnu.org>
7103
7104 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
7105 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
7106 cursor motion with <left> and <right> arrow keys.
7107
7108 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
7109 some callers set that themselves.
7110
7111 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7112
7113 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
7114 display string and the previous row comes from the same string and
7115 is empty. (Bug#9739) (Bug#9738)
7116
7117 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
7118
7119 * doc.c (get_doc_string): Encode file name (bug#9735).
7120
7121 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7122
7123 * bidi.c (bidi_level_of_next_char):
7124 * xdisp.c (get_visually_first_element): Remove old incorrect
7125 comments regarding the Unicode Line Separator character.
7126
7127 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
7128
7129 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
7130
7131 * alloc.c (Fgc_status): Do not access beyond zombies array
7132 boundary if nzombies > MAX_ZOMBIES.
7133 * alloc.c (dump_zombies): Add missing format specifier.
7134
7135 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
7136
7137 * xdisp.c (set_cursor_from_row): Simplify conditionals,
7138 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
7139
7140 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
7141 Some packages use them to denote characters with modifiers.
7142
7143 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
7144
7145 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
7146 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
7147 matching a pp-number. Rename parameter var to var1.
7148
7149 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
7150
7151 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
7152
7153 2011-10-08 Glenn Morris <rgm@gnu.org>
7154
7155 * callint.c (Fcall_interactively): Give a more explicit error for the
7156 'c' case with a non-character input. (Bug#8479)
7157
7158 2011-10-08 Eli Zaretskii <eliz@gnu.org>
7159
7160 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
7161 lines.
7162 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
7163 lines that are hscrolled on the left.
7164
7165 * dispnew.c (buffer_posn_from_coords): Account for a possible
7166 presence of header-line. (Bug#4426)
7167
7168 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
7169
7170 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
7171 Don't advertise functionality which we discourage or doesn't work.
7172
7173 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
7174
7175 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
7176 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
7177 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
7178 this makes Emacs dump core during garbage collection on rare
7179 occasions. sizeof is obviously inferior to offsetof here, so
7180 stick with offsetof.
7181 (GC_POINTER_ALIGNMENT): New macro.
7182 (mark_memory): Omit 3rd (offset) arg; caller changed.
7183 Don't assume EMACS_INT alignment is the same as pointer alignment.
7184
7185 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
7186
7187 * keyboard.c (read_key_sequence_remapped): New var.
7188 (read_key_sequence): Compute remapping in the right buffer.
7189 (command_loop_1): Use read_key_sequence's remapping directly.
7190
7191 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
7192
7193 * dired.c (file_name_completion): Don't expand file name.
7194 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
7195 before checking file name handler.
7196
7197 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
7198 they've been requested explicitly (bug#9591).
7199
7200 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
7201
7202 * keymap.c (Fsingle_key_description): Use make_specified_string
7203 instead of build_string to build string from push_key_description.
7204 (Bug#5193)
7205
7206 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7207
7208 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
7209 This fixes a Y2038 bug on 64-bit hosts.
7210 * buffer.c (reset_buffer):
7211 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
7212 (Fclear_buffer_auto_save_failure):
7213 Use 0, not -1, to represent an unset failure time, since time_t
7214 might not be signed.
7215
7216 Remove dependency on glibc malloc internals.
7217 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7218 Move back here from lisp.h, but with their new implementations.
7219 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7220 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
7221 * charset.c (charset_table_init): New static var.
7222 (syms_of_charset): Use it instead of xmalloc. This removes a
7223 dependency on glibc malloc internals. See Eli Zaretskii's comment in
7224 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
7225 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7226 Move back to alloc.c.
7227 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7228 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
7229
7230 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
7231
7232 * nsterm.m (windowDidResize): Call x_set_window_size only when
7233 ns_in_resize is true. Otherwise set pixelwidth/height and
7234 call change_frame_size (Bug#9628).
7235
7236 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7237
7238 Port --enable-checking=all to Fedora 14 x86-64.
7239 * charset.c (syms_of_charset): Also account for glibc malloc's
7240 internal overhead when calculating the initial malloc maximum.
7241
7242 Port --enable-checking=all to Fedora 14 x86.
7243 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7244 Move to lisp.h.
7245 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
7246 (overrun_check_realloc, overrun_check_free):
7247 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
7248 That way, xmalloc returns a properly-aligned pointer even if
7249 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
7250 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
7251 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
7252 into account when calculating the initial malloc maximum.
7253 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7254 Move here from alloc.c, so that charset.c can use it too.
7255 Properly align; the old code wasn't right for common 32-bit hosts
7256 when configured with --enable-checking=all.
7257 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7258 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
7259
7260 2011-09-29 Eli Zaretskii <eliz@gnu.org>
7261
7262 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
7263 use EDOM.
7264
7265 2011-09-28 Eli Zaretskii <eliz@gnu.org>
7266
7267 * xdisp.c (compute_display_string_end): If there's no display
7268 string at CHARPOS, return -1.
7269
7270 * bidi.c (bidi_fetch_char): When compute_display_string_end
7271 returns a negative value, treat the character as a normal
7272 character not covered by a display string. (Bug#9624)
7273
7274 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
7275
7276 * lread.c (Fread_from_string): Fix typo in docstring.
7277
7278 2011-09-27 Eli Zaretskii <eliz@gnu.org>
7279
7280 * xdisp.c (handle_invisible_prop): If invisible text ends on a
7281 newline, reseat the iterator instead of bidi-iterating there one
7282 character at a time. (Bug#9610)
7283 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
7284 TO_CHARPOS if the bidi iterator is at base embedding level.
7285
7286 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
7287
7288 * lread.c (readevalloop): Use correct code for NBSP.
7289 (read1): Likewise. (Bug#9608)
7290
7291 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
7292
7293 * dbusbind.c (Fdbus_register_signal): When service is not
7294 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
7295
7296 2011-09-25 Glenn Morris <rgm@gnu.org>
7297
7298 * buffer.c (truncate-lines): Doc fix.
7299
7300 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
7301
7302 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
7303 (Fset_window_next_buffers): Doc fix.
7304
7305 2011-09-24 Glenn Morris <rgm@gnu.org>
7306
7307 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
7308
7309 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
7310
7311 Fix minor problems found by static checking.
7312 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
7313 * indent.c (Fvertical_motion): Fix == vs = typo.
7314
7315 2011-09-24 Eli Zaretskii <eliz@gnu.org>
7316
7317 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
7318 Default value is now t. Doc fix.
7319
7320 * indent.c (Fvertical_motion): Compute and apply the overshoot
7321 logic when moving up, not only when moving down. Fix the
7322 confusing name and values of the it_overshoot_expected variable;
7323 logic changes accordingly. (Bug#9254) (Bug#9549)
7324
7325 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
7326 CHARPOS is covered by a display string which includes newlines.
7327 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
7328 is covered by a display string with embedded newlines.
7329
7330 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
7331
7332 * dbusbind.c (Fdbus_register_signal): Add match rule to
7333 Vdbus_registered_objects_table. (Bug#9581)
7334 (Fdbus_register_method, Vdbus_registered_objects_table):
7335 Fix docstring.
7336
7337 2011-09-24 Jim Meyering <meyering@redhat.com>
7338
7339 do not ignore write error for any output size
7340 The previous change was incomplete.
7341 While it makes emacs --batch detect the vast majority of stdout
7342 write failures, errors were still ignored whenever the output size is
7343 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
7344 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
7345 && echo FAIL: ignored write error
7346 FAIL: ignored write error
7347 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
7348 && echo FAIL: ignored write error
7349 FAIL: ignored write error
7350 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
7351
7352 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
7353
7354 * emacs.c (Fkill_emacs): In noninteractive mode exit
7355 non-successfully if a write error occurred on stdout. (Bug#9574)
7356
7357 2011-09-21 Eli Zaretskii <eliz@gnu.org>
7358
7359 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
7360 the xassert test.
7361
7362 * dispextern.h (struct it): Update the comment documenting what
7363 can it->OBJECT be.
7364
7365 2011-09-20 Eli Zaretskii <eliz@gnu.org>
7366
7367 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
7368 a display string, extend search for cursor position to end of row.
7369 (find_row_edges): If the row ends in a newline from a display
7370 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
7371 Handle the case of a display string with multiple newlines.
7372 (Fcurrent_bidi_paragraph_direction): Fix search for previous
7373 non-empty line. Fixes confusing cursor motion with arrow keys at
7374 the beginning of a line that starts with whitespace.
7375
7376 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7377
7378 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7379 (bug#9493).
7380
7381 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
7382
7383 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7384 boolean (Bug#9154).
7385
7386 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7387
7388 * xdisp.c (display_line): Record maximum and minimum buffer
7389 positions even if no glyphs were produced (e.g., by a zero-width
7390 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
7391 buffer positions that will be removed from the glyph row because
7392 they don't fit.
7393 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7394 column is beyond frame width: don't subtract 1 "pixel" when
7395 computing width of the stretch.
7396 (reseat_at_next_visible_line_start): Undo the change made on
7397 2011-09-17 that saved paragraph information and restored it after
7398 the call to `reseat'. (Bug#9545)
7399
7400 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7401
7402 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7403 and turn window cursor on if cleared (Bug#9415).
7404
7405 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
7406
7407 * search.c (boyer_moore): Take unibyte characters from pattern
7408 literally. (Bug#9458)
7409
7410 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7411
7412 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7413
7414 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
7415
7416 Fix minor problem found by static checking.
7417 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7418 initialized, to pacify gcc -Wuninitialized.
7419
7420 * fileio.c: Report proper errno when syscall falls.
7421 (Finsert_file_contents): Save and restore errno,
7422 so that report_file_error outputs the correct diagnostic.
7423 (Fwrite_region) [CLASH_DETECTION]: Likewise.
7424
7425 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7426
7427 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7428
7429 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7430
7431 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7432 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
7433
7434 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7435
7436 * xdisp.c (reseat_at_next_visible_line_start): Keep information
7437 about the current paragraph and restore it after the call to reseat.
7438
7439 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7440 (bidi_find_paragraph_start): Search back for paragraph beginning
7441 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7442 (bidi_move_to_visually_next): Only trigger paragraph-related
7443 computations when the last character is a newline or at EOB, not
7444 just any NEUTRAL_B. (Bug#9470)
7445
7446 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7447 truncated lines if point is covered by a display string. (Bug#9524)
7448
7449 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
7450
7451 * xselect.c: Relax test for outgoing X longs (Bug#9498).
7452 (cons_to_x_long): New function.
7453 (lisp_data_to_selection_data): Use it. Correct the test for
7454 short-versus-long data; it was negated. Break out of vector
7455 loop, for efficiency, when a long datum is discovered.
7456
7457 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
7458
7459 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7460
7461 2011-09-16 Eli Zaretskii <eliz@gnu.org>
7462
7463 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7464 GCC PR/17406) by declaring this function with external scope.
7465
7466 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7467
7468 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7469 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7470
7471 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
7472
7473 * editfns.c (Fformat): Correctly handle text properties on "%%".
7474
7475 2011-09-15 Eli Zaretskii <eliz@gnu.org>
7476
7477 * xterm.c (x_draw_composite_glyph_string_foreground):
7478 * w32term.c (x_draw_composite_glyph_string_foreground):
7479 * term.c (encode_terminal_code):
7480 * composite.c (composition_update_it, get_composition_id):
7481 * xdisp.c (get_next_display_element)
7482 (fill_composite_glyph_string): Add comments about special meaning
7483 of TAB characters in a composition.
7484
7485 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
7488 This occurs when processing a multibyte format.
7489 Problem reported by Wolfgang Jenker.
7490
7491 2011-09-15 Johan Bockgård <bojohan@gnu.org>
7492
7493 * xdisp.c (try_cursor_movement): Only check for exact match if
7494 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
7495
7496 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7497
7498 Remove unused external symbols.
7499 * dispextern.h (calc_pixel_width_or_height): Remove decl.
7500 * xdisp.c (calc_pixel_width_or_height): Now static.
7501 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7502 * indent.c (check_display_width):
7503 * w32term.c: Fix comment to match code.
7504 * xterm.c, xterm.h (x_catching_errors): Remove.
7505
7506 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7507
7508 * xselect.c: Use signed conversions more consistently (Bug#9498).
7509 (selection_data_to_lisp_data): Assume incoming selection data are
7510 signed integers, not unsigned. This is to be consistent with
7511 outgoing selection data, which was modified to use signed integers
7512 in as part of the fix to Bug#9196 in response to Jan D.'s comment
7513 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7514 expects long, not unsigned long.
7515
7516 2011-09-14 Eli Zaretskii <eliz@gnu.org>
7517
7518 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7519 computation of loop end. Reported by Johan Bockgård
7520 <bojohan@gnu.org>.
7521
7522 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
7523
7524 * frame.c (Fother_visible_frames_p): Function deleted.
7525
7526 2011-09-12 Eli Zaretskii <eliz@gnu.org>
7527
7528 * indent.c (compute_motion): Process display vector front to back
7529 rather than the other way around. (Bug#2496)
7530
7531 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7532
7533 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
7534
7535 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
7536
7537 * minibuf.c (Fread_from_minibuffer): Doc fix.
7538
7539 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7540
7541 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7542 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7543
7544 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7545
7546 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7547 value for non-existent files.
7548
7549 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7550
7551 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7552 set its "size" to -1. This will set the modtime_size field of
7553 the corresponding buffer to -1, which is what
7554 verify-visited-file-modtime expects for files that do not exist.
7555 (Bug#9139)
7556
7557 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7558
7559 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7560 here ...
7561 * lisp.h: ... from here. push_key_description is no longer
7562 defined in keyboard.c, so its declaration should not be in
7563 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7564 logically belongs with push_key_description.
7565
7566 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 * buffer.h: Include <sys/types.h> instead of <time.h>.
7569 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7570 Problem reported by Herbert J. Skuhra.
7571
7572 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7573
7574 * xml.c (parse_region): Make the parsing work for
7575 non-comment-starting XML files again (bug#9144).
7576
7577 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7578
7579 * image.c (gif_load): Fix calculation of bottom and right corner.
7580 (Bug#9468)
7581
7582 2011-09-10 Eli Zaretskii <eliz@gnu.org>
7583
7584 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7585 redisplay in small windows.
7586
7587 2011-09-09 Eli Zaretskii <eliz@gnu.org>
7588
7589 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7590
7591 2011-09-08 Martin Rudalics <rudalics@gmx.at>
7592
7593 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7594 Operate on live windows only.
7595
7596 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
7597
7598 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7599
7600 2011-09-07 Eli Zaretskii <eliz@gnu.org>
7601
7602 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7603 only under bidi iteration.
7604
7605 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7606
7607 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7608
7609 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7610
7611 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7612 Without this fix, the command to link temacs failed due to an
7613 undefined symbol __builtin_isnan. This is because
7614 /usr/include/iso/math_c99.h #defines isnan(x) to
7615 __builtin_isnan(x), but the bundled gcc, which identifies itself
7616 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7617 a __builtin_isnan.
7618 * floatfns.c (isnan): #undef, and then #define to a clone of
7619 what's in data.c.
7620 (Fisnan): Always define, since it's always available now.
7621 (syms_of_floatfns): Always define isnan at the Lisp level.
7622
7623 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7624
7625 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7626
7627 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7628
7629 * fileio.c: Fix bugs with large file offsets (Bug#9428).
7630 The previous code assumed that file offsets (off_t values) fit in
7631 EMACS_INT variables, which is not true on typical 32-bit hosts.
7632 The code messed up by falsely reporting buffer overflow in cases
7633 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7634 when "big" contains more than 2**29 bytes, even though this
7635 inserts just one byte and does not overflow the buffer.
7636 (Finsert_file_contents): Store file offsets as off_t
7637 values, not as EMACS_INT values. Check for overflow when
7638 converting between EMACS_INT and off_t. When checking for
7639 buffer overflow or for overlap, take the offsets into account.
7640 Don't use EMACS_INT for small values where int suffices.
7641 When checking for overlap, fix a typo: ZV was used where
7642 ZV_BYTE was intended.
7643 (Fwrite_region): Don't assume off_t fits into 'long'.
7644 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7645
7646 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
7647
7648 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7649
7650 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7651
7652 sprintf-related integer and memory overflow issues (Bug#9412).
7653
7654 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
7655 (esprintf, exprintf, evxprintf): New functions.
7656 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
7657 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
7658 (modify_event_symbol): Do not assume that the length of
7659 name_alist_or_stem is safe to alloca and fits in int.
7660 (Fexecute_extended_command): Likewise for function name and binding.
7661 (Frecursion_depth): Wrap around reliably on integer overflow.
7662 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7663 since some callers pass EMACS_INT values.
7664 (Fsingle_key_description): Don't crash if symbol name contains more
7665 than MAX_ALLOCA bytes.
7666 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7667 (get_minibuffer): Arg is now EMACS_INT, not int.
7668 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
7669 (esprintf, exprintf, evxprintf): New decls.
7670 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7671
7672 * dbusbind.c (signature_cat): New function.
7673 (xd_signature, Fdbus_register_signal):
7674 Do not overrun buffer; instead, report string overflow.
7675
7676 * dispnew.c (add_window_display_history): Don't overrun buffer.
7677 Truncate instead; this is OK since it's just a log.
7678
7679 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7680 even if the time zone offset is outlandishly large.
7681 Don't mishandle offset == INT_MIN.
7682
7683 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7684 when creating daemon; the previous buffer-overflow check was incorrect.
7685
7686 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7687 which has the guts of the old verror function.
7688
7689 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7690 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7691
7692 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7693 (font_unparse_xlfd): Don't blindly alloca long strings.
7694 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
7695 fits in int, when using sprintf. Use single snprintf to count
7696 length of string rather than counting it via multiple sprintfs;
7697 that's simpler and more reliable.
7698 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7699 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7700 sprintf, in case result does not fit in int.
7701
7702 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7703 (fontset_from_font): Print it.
7704
7705 * frame.c (tty_frame_count): Now printmax_t, not int.
7706 (make_terminal_frame, set_term_frame_name): Print it.
7707 (x_report_frame_params): In X, window IDs are unsigned long,
7708 not signed long, so print them as unsigned.
7709 (validate_x_resource_name): Check for implausibly long names,
7710 and don't assume name length fits in 'int'.
7711 (x_get_resource_string): Don't blindly alloca invocation name;
7712 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7713 not fit in int.
7714
7715 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7716 (xg_check_special_colors, xg_set_geometry):
7717 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7718
7719 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7720 Use esprintf, not sprintf, in case result does not fit in int.
7721
7722 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7723 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7724 it as a large positive number.
7725 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7726 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7727
7728 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7729 in case result does not fit in int.
7730
7731 * print.c (float_to_string): Detect width overflow more reliably.
7732 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7733 buffer overrun. Don't assume list length fits in 'int'. Treat
7734 print length of 0 as 0, not as infinity; to be consistent with other
7735 uses of print length in this function. Don't overflow print length
7736 index. Don't assume hash table size fits in 'long', or that
7737 vectorlike size fits in 'unsigned long'.
7738
7739 * process.c (make_process): Use printmax_t, not int, to format
7740 process-name gensyms.
7741
7742 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7743
7744 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7745 to avoid potential buffer overrun.
7746
7747 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7748 if X resource line is longer than 512 bytes.
7749
7750 * xfns.c (x_window): Make sprintf buffer a bit bigger
7751 to avoid potential buffer overrun.
7752
7753 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7754
7755 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7756
7757 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7758
7759 Integer overflow fixes for scrolling, etc.
7760 Without these, Emacs silently mishandles large integers sometimes.
7761 For example, "C-u 4294967297 M-x recenter" was treated as if
7762 it were "C-u 1 M-x recenter" on a typical 64-bit host.
7763
7764 * xdisp.c (try_window_id): Check Emacs fixnum range before
7765 converting to 'int'.
7766
7767 * window.c (window_scroll_line_based, Frecenter):
7768 Check that an Emacs fixnum is in range before assigning it to 'int'.
7769 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
7770 values converted from Emacs fixnums.
7771 (Frecenter): Don't wrap around a line count if it is out of 'int'
7772 range; instead, treat it as an extreme value.
7773 (Fset_window_configuration, compare_window_configurations):
7774 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
7775
7776 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
7777 that can exceed INT_MAX. Check that EMACS_INT value is in range
7778 before assigning it to the (possibly-narrower) index.
7779 (match_limit): Don't assume that a fixnum can fit in 'int'.
7780
7781 * print.c (print_object): Use ptrdiff_t, not int, for index that can
7782 exceed INT_MAX.
7783
7784 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
7785 (Fvertical_motion): Don't wrap around LINES values that don't fit
7786 in 'int'. Instead, treat them as extreme values. This is good
7787 enough for windows, which can't have more than INT_MAX lines anyway.
7788
7789 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7790
7791 * Require libxml/parser.h to avoid compilation warning.
7792
7793 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
7794
7795 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
7796 since this reportedly can destroy thread storage.
7797
7798 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
7799
7800 * syntax.c (find_defun_start): Update all cache variables if
7801 exiting early (Bug#9401).
7802
7803 2011-08-30 Eli Zaretskii <eliz@gnu.org>
7804
7805 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
7806
7807 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
7808 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
7809 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
7810
7811 * term.c (tty_append_glyph): New function.
7812 (produce_stretch_glyph): Static function and its prototype deleted.
7813
7814 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
7815 Add prototypes.
7816
7817 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
7818
7819 * image.c (parse_image_spec): Check for nonnegative, not for positive,
7820 when checking :margin (Bug#9390).
7821 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
7822 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
7823 so that the name doesn't mislead. All uses changed.
7824
7825 2011-08-28 Johan Bockgård <bojohan@gnu.org>
7826
7827 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
7828 set_tty_hooks.
7829
7830 2011-08-27 Eli Zaretskii <eliz@gnu.org>
7831
7832 * xdisp.c (move_it_to): Don't bail out early when reaching
7833 position beyond to_charpos, if we are scanning backwards.
7834 (move_it_vertically_backward): When DY == 0, make sure we get to
7835 the first character in the line after the newline.
7836
7837 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
7838
7839 * ccl.c: Improve and simplify overflow checking (Bug#9196).
7840 (ccl_driver): Do not generate an out-of-range pointer.
7841 (Fccl_execute_on_string): Remove unnecessary check for
7842 integer overflow, noted by Stefan Monnier in
7843 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
7844 Remove a FIXME that didn't need fixing.
7845 Simplify the newly-introduced buffer reallocation code.
7846
7847 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
7848
7849 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
7850
7851 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
7852
7853 Integer and memory overflow issues (Bug#9196).
7854
7855 * doc.c (get_doc_string): Rework so that
7856 get_doc_string_buffer_size is the actual buffer size, rather than
7857 being 1 less than the actual buffer size; this makes xpalloc more
7858 convenient.
7859
7860 * image.c (x_allocate_bitmap_record, cache_image):
7861 * xselect.c (Fx_register_dnd_atom):
7862 Simplify previous changes by using xpalloc.
7863
7864 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
7865 since either will do and ptrdiff_t is convenient with xpalloc.
7866
7867 * charset.c (charset_table_size)
7868 (struct charset_sort_data.priority): Now ptrdiff_t.
7869 (charset_compare): Don't overflow if priorities differ greatly.
7870 (Fsort_charsets): Don't assume list length fits in int.
7871 Check for size-calculation overflow when allocating sort data.
7872 (syms_of_charset): Allocate an initial charset table that is
7873 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7874
7875 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7876
7877 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7878 The actual value is always <= INT_MAX, and leaving it unsigned made
7879 overflow checking harder.
7880
7881 * dispextern.h (struct glyph_matrix.rows_allocated)
7882 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7883 with xpalloc. The values are still always <= INT_MAX.
7884
7885 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7886
7887 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7888 (SAFE_NALLOCA): New macro.
7889
7890 * region-cache.c (struct boundary.pos, find_cache_boundary)
7891 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7892 (set_cache_region, invalidate_region_cache)
7893 (revalidate_region_cache, know_region_cache, region_cache_forward)
7894 (region_cache_backward, pp_cache):
7895 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7896 so that ptrdiff_t * can be passed to xpalloc.
7897 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7898 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7899 (pp_cache): Don't assume cache_len fits in int.
7900 * region-cache.h: Adjust extern decls to match.
7901
7902 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7903 EMACS_INT, since either will do, for xpalloc.
7904
7905 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7906 (xnmalloc, xnrealloc, xpalloc): New functions.
7907
7908 * bidi.c (bidi_shelve_header_size): New constant.
7909 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7910 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7911
7912 * bidi.c (bidi_cache_shrink):
7913 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7914 (overlay_strings):
7915 Don't update size of array until after memory allocation succeeds,
7916 because xmalloc/xrealloc may not return.
7917 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7918 now that we have proper integer overflow checking.
7919 (record_overlay_string, overlay_strings): Catch overflows when
7920 calculating size of overlay_str_buf.
7921
7922 * callproc.c (Fcall_process): Check for size overflow when
7923 calculating size of args2.
7924 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7925 Normally we prefer signed values, but sticking with ptrdiff_t would
7926 require adding more-complicated checks.
7927
7928 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7929 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7930 Redo buffer-overflow calculations to avoid integer overflow.
7931 Add a FIXME comment where memory seems to be over-allocated.
7932
7933 * character.c (Fstring): Check for size-calculation overflow.
7934
7935 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7936 unnecessary integer overflow. Check for size overflow.
7937 (encode_coding_object): Don't update size until xmalloc succeeds.
7938
7939 * composite.c (get_composition_id): Check for overflow in glyph
7940 length calculations.
7941
7942 Integer and memory overflow fixes for display code.
7943 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7944 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7945 (scrolling_window): Check for overflow in size calculations.
7946 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7947 Don't assume glyph table len fits in int.
7948 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7949 (row_table_size): Now ptrdiff_t, not int.
7950 (scrolling_window): Avoid overflow in size calculations.
7951 Don't update size until allocation succeeds.
7952 * fns.c (concat): Check for overflow in size calculations.
7953 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7954 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7955 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7956
7957 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7958 (get_doc_string): Check for size calculation overflow.
7959 Don't update size until allocation succeeds.
7960 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7961 EMACS_INT, where ptrdiff_t will do.
7962 (Fsubstitute_command_keys): Check for string overflow.
7963
7964 * editfns.c (set_time_zone_rule): Don't assume environment length
7965 fits in int.
7966 (message_length): Now ptrdiff_t, not int.
7967 (Fmessage_box): Don't update size until allocation succeeds.
7968 Don't assume message length fits in int.
7969 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7970
7971 * emacs.c (main): Do not reallocate argv, since there is a null at
7972 the end that can be overwritten, and this way there's no need to
7973 worry about size-calculation overflow.
7974 (sort_args): Check for size-calculation overflow.
7975
7976 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7977 alloc succeeds.
7978 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7979
7980 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7981 (x_set_scroll_bar_width, x_figure_window_size):
7982 Check for integer overflow.
7983 (x_set_alpha): Do not assume XINT fits in int.
7984
7985 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7986 This is for the members text_lines, text_cols, total_lines, total_cols,
7987 where the system imposes an 'int' limit.
7988
7989 * fringe.c (Fdefine_fringe_bitmap):
7990 Don't update size until alloc works.
7991
7992 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7993 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
7994
7995 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
7996 Check for size-calculation overflow.
7997 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
7998 do, as we prefer signed integers.
7999 (id_to_widget.max_size, id_to_widget.used)
8000 (xg_store_widget_in_map, xg_remove_widget_from_map)
8001 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
8002 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
8003 Use and return ptrdiff_t, not int.
8004 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
8005 * gtkutil.h: Change prototypes to match the above.
8006
8007 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
8008 are duplicate now that they've been promoted to lisp.h.
8009 (x_allocate_bitmap_record, x_alloc_image_color)
8010 (make_image_cache, cache_image, xpm_load):
8011 Don't update size until alloc is done.
8012 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
8013 (x_detect_edges):
8014 Check for size calculation overflow.
8015 (ct_colors_allocated_max): New constant.
8016 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
8017 overflow.
8018
8019 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
8020 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
8021 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
8022 Use ptrdiff_t, not int, to count maps.
8023 (read_char_minibuf_menu_prompt): Check for overflow in size
8024 calculations. Don't update size until allocation succeeds.
8025 Redo calculations to avoid overflow.
8026 * keyboard.h: Change prototypes to match the above.
8027
8028 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
8029 to count maps.
8030 (current_minor_maps): Check for size calculation overflow.
8031 * keymap.h: Change prototypes to match the above.
8032
8033 * lread.c (read1, init_obarray): Don't update size until alloc done.
8034
8035 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
8036 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
8037
8038 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
8039 Now ptrdiff_t, not int.
8040 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
8041 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
8042
8043 * process.c (Fnetwork_interface_list): Check for overflow
8044 in size calculation.
8045
8046 * region-cache.c (move_cache_gap): Check for size calculation overflow.
8047
8048 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
8049 overflow. Don't bother calling xmalloc when xrealloc will do.
8050
8051 * search.c (Freplace_match): Check for size calculation overflow.
8052 (Fset_match_data): Don't assume list lengths fit in 'int'.
8053
8054 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
8055 for command line length. Do not attempt to address one before the
8056 beginning of an array, as that's not portable.
8057
8058 * term.c (max_frame_lines): Remove; unused.
8059 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
8060 not int.
8061 (encode_terminal_code, calculate_costs): Check for size
8062 calculation overflow.
8063 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
8064 table lengths and related sizes. Don't update size until alloc
8065 done. Redo calculations to avoid overflow.
8066 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
8067
8068 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
8069 subtracting pointers.
8070 (gobble_line): Check for overflow more carefully. Don't update size
8071 until alloc done.
8072
8073 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
8074 Don't update size until alloc done.
8075 Redo size calculations to avoid overflow.
8076 Check for size calculation overflow.
8077 (main) [DEBUG]: Fix typo in invoking tparam1.
8078
8079 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
8080 Use ptrdiff_t, not int, for sizes.
8081 (store_mode_line_noprop_char): Don't update size until alloc done.
8082
8083 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
8084 Use ptrdiff_t, not int, for sizes.
8085 (Finternal_make_lisp_face, cache_face):
8086 Check for size calculation overflow.
8087 (cache_face): Treat size calculation overflows as if they were
8088 memory exhaustion (the usual treatment), rather than aborting.
8089
8090 * xfns.c (x_encode_text, x_set_name_internal)
8091 (Fx_change_window_property): Use ptrdiff_t, not int, to count
8092 sizes, since they can exceed INT_MAX in size. Check for size
8093 calculation overflow.
8094
8095 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
8096 (xg_select): Check for size calculation overflow.
8097 Don't update size until alloc done.
8098
8099 * xrdb.c (get_environ_db): Don't assume path length fits in int,
8100 as sprintf is limited to int lengths.
8101
8102 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
8103 (X_LONG_MIN): New macros.
8104 Use them to make the following changes clearer.
8105 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
8106 This change doesn't affect the value now, but it may help remind
8107 future maintainers not to raise the value too much later.
8108 (SELECTION_QUANTUM): Remove, replacing with ...
8109 (selection_quantum): ... new function, which avoids overflow.
8110 All uses changed.
8111 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
8112 assumption that selection length fits in 'int'.
8113 (x_reply_selection_request, x_handle_selection_request)
8114 (x_get_window_property, receive_incremental_selection)
8115 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
8116 (lisp_data_to_selection_data, clean_local_selection_data):
8117 Use ptrdiff_t, not int, to record length of selection.
8118 (x_reply_selection_request, x_get_window_property)
8119 (receive_incremental_selection, x_property_data_to_lisp):
8120 Redo calculations to avoid overflow.
8121 (x_reply_selection_request): When sending hint, ceiling it at
8122 X_LONG_MAX rather than relying on wraparound overflow to send
8123 something.
8124 (x_get_window_property, receive_incremental_selection)
8125 (lisp_data_to_selection_data, x_property_data_to_lisp):
8126 Check for size-calculation overflow.
8127 (x_get_window_property, receive_incremental_selection)
8128 (lisp_data_to_selection_data, Fx_register_dnd_atom):
8129 Don't store size until memory allocation succeeds.
8130 (x_get_window_property): Plug memory leak on memory exhaustion.
8131 Don't double-block input; malloc is safe here. Don't assume 2**34
8132 - 4 fits in unsigned long. Add an xassert to check
8133 XGetWindowProperty overflow. Be more careful about overflow
8134 calculations, and distinguish size from memory overflow better.
8135 (receive_incremental_selection): When tracing, don't assume
8136 unsigned int is less than INT_MAX.
8137 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
8138 harmful) conversions of unsigned short to int.
8139 (lisp_data_to_selection_data): Don't assume that integers
8140 in the range -65535 through -1 fit in an X unsigned short.
8141 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
8142 result parameters unless successful. Rely on cons_to_unsigned
8143 to report problems with elements; the old code wasn't right anyway.
8144 (x_check_property_data): Check for int overflow; we cannot use
8145 a wider type due to X limits.
8146 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
8147
8148 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
8149
8150 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
8151 (x_term_init): Check for size calculation overflow.
8152 (x_color_cells): Don't store size until memory allocation succeeds.
8153 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
8154 Don't assume alloca size is less than MAX_ALLOCA.
8155 (x_term_init): Don't assume length fits in int (sprintf is limited
8156 to int size).
8157
8158 Use ptrdiff_t for composition IDs.
8159 * character.c (lisp_string_width):
8160 * composite.c (composition_table_size, n_compositions)
8161 (get_composition_id, composition_gstring_from_id):
8162 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
8163 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
8164 * window.c (Frecenter):
8165 Use ptrdiff_t, not int, for composition IDs.
8166 * composite.c (get_composition_id): Check for integer overflow.
8167 * composite.h: Adjust prototypes to match the above changes.
8168
8169 Use ptrdiff_t for hash table indexes.
8170 * category.c (hash_get_category_set):
8171 * ccl.c (ccl_driver):
8172 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
8173 * coding.c (coding_system_charset_list, detect_coding_system):
8174 * coding.h (struct coding_system.id):
8175 * composite.c (get_composition_id, gstring_lookup_cache):
8176 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
8177 * image.c (xpm_get_color_table_h):
8178 * lisp.h (hash_lookup, hash_put):
8179 * minibuf.c (Ftest_completion):
8180 Use ptrdiff_t for hash table indexes, not int (which is too
8181 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
8182 32-bit --with-wide-int hosts).
8183
8184 * charset.c (Fdefine_charset_internal): Check for integer overflow.
8185 Add a FIXME comment about memory leaks.
8186 (syms_of_charset): Don't assume xmalloc returns.
8187
8188 Don't assume that stated character widths fit in int.
8189 * character.c (Fchar_width, c_string_width, lisp_string_width):
8190 * character.h (CHAR_WIDTH):
8191 * indent.c (MULTIBYTE_BYTES_WIDTH):
8192 Use sanitize_char_width to avoid undefined and/or bad behavior
8193 with outlandish widths.
8194 * character.h (sanitize_tab_width): Rename from sanitize_width,
8195 now that we have two such functions. All uses changed.
8196 (sanitize_char_width): New inline function.
8197
8198 Don't assume that tab-width fits in int.
8199 * character.h (sanitize_width): New inline function.
8200 (SANE_TAB_WIDTH): New macro.
8201 (ASCII_CHAR_WIDTH): Use it.
8202 * indent.c (sane_tab_width): Remove. All uses replaced by
8203 SANE_TAB_WIDTH (current_buffer).
8204 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
8205
8206 * fileio.c: Integer overflow issues with file modes.
8207 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
8208
8209 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
8210 Remove unreachable code.
8211 (read_hex, load_charset_map_from_file): Check for integer overflow.
8212
8213 * xterm.c: Don't go over XClientMessageEvent limit.
8214 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
8215 (x_send_scroll_bar_event): Likewise. Check that the size does not
8216 exceed limits imposed by XClientMessageEvent, as well as the usual
8217 ptrdiff_t and size_t limits.
8218
8219 * keyboard.c: Overflow, signedness and related fixes.
8220 (make_lispy_movement): Use same integer type in forward decl
8221 that is used in the definition.
8222 (read_key_sequence, keyremap_step):
8223 Change bufsize argument back to int, undoing my 2011-03-30 change.
8224 We prefer signed types, and int is wide enough here.
8225 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
8226 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
8227 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
8228 length, not size_t. Use ptrdiff_t for index, not int.
8229 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
8230 possibility of integer overflow.
8231
8232 Overflow, signedness and related fixes for images.
8233
8234 * dispextern.h (struct it.stack[0].u.image.image_id)
8235 (struct_it.image_id, struct image.id, struct image_cache.size)
8236 (struct image_cache.used, struct image_cache.ref_count):
8237 * gtkutil.c (update_frame_tool_bar):
8238 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
8239 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
8240 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
8241 * nsmenu.m (update_frame_tool_bar):
8242 * xdisp.c (calc_pixel_width_or_height):
8243 * xfns.c (image_cache_refcount):
8244 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
8245 on typical 64-bit hosts.
8246
8247 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8248 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
8249 Omit unnecessary casts to int.
8250 (parse_image_spec): Check that integers fall into 'int' range
8251 when the callers expect that.
8252 (image_ascent): Redo ascent calculation to avoid int overflow.
8253 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
8254 (lookup_image): Remove unnecessary tests.
8255 (xbm_image_p): Locals are now of int, not EMACS_INT,
8256 since parse_image_check makes sure they fit into int.
8257 (png_load, gif_load, svg_load_image):
8258 Prefer int to unsigned where either will do.
8259 (tiff_handler): New function, combining the cores of the
8260 old tiff_error_handler and tiff_warning_handler.
8261 This function is rewritten to use vsnprintf and thereby avoid
8262 stack buffer overflows. It uses only the features of vsnprintf
8263 that are common to both POSIX and native Microsoft.
8264 (tiff_error_handler, tiff_warning_handler): Use it.
8265 (tiff_load, gif_load, imagemagick_load_image):
8266 Don't assume :index value fits in 'int'.
8267 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
8268 (imagemagick_load_image): Check that crop parameters fit into
8269 the integer types that MagickCropImage accepts. Don't assume
8270 Vimagemagick_render_type has a nonnegative value. Don't assume
8271 size_t fits in 'long'.
8272 (gs_load): Use printmax_t to print the widest integers possible.
8273 Check for integer overflow when computing image height and width.
8274
8275 2011-08-26 Eli Zaretskii <eliz@gnu.org>
8276
8277 * xdisp.c (redisplay_window): Don't force window start if point
8278 will be invisible in the resulting window. (Bug#9324)
8279
8280 2011-08-25 Eli Zaretskii <eliz@gnu.org>
8281
8282 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
8283 the display spec is of the form `(space ...)'.
8284 (handle_display_spec): Return the value returned by
8285 handle_single_display_spec, not just 1 or zero.
8286 (handle_single_display_spec): If the display spec is of the form
8287 `(space ...)', and specifies display in the text area, return 2
8288 rather than 1.
8289 (try_cursor_movement): Check for the need to scroll more
8290 accurately, and prefer exact match for point under bidi.
8291 Don't advance `row' beyond the last row of the window.
8292
8293 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
8294 into disp_prop; all users changed.
8295
8296 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
8297 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
8298 for the text covered by the display property.
8299
8300 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
8301
8302 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
8303 Change return value to nil.
8304 (Frecord_buffer): Delete unused function.
8305
8306 2011-08-24 Eli Zaretskii <eliz@gnu.org>
8307
8308 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
8309 buffers, return left-to-right.
8310 (set_cursor_from_row): Consider candidate row a win if its glyph
8311 represents a newline and point is on that newline. Fixes cursor
8312 positioning on the newline at EOL of R2L text within L2R
8313 paragraph, and vice versa.
8314 (try_cursor_movement): Check continued rows, in addition to
8315 continuation rows. Fixes unwarranted scroll when point enters a
8316 continued line of R2L text within an L2R paragraph, or vice versa.
8317 (cursor_row_p): Consider the case of point being equal to
8318 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
8319 from the end of a short line to the beginning of a continued line
8320 of R2L text within L2R paragraph.
8321 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
8322 composed characters.
8323
8324 * bidi.c (bidi_check_type): Use xassert.
8325 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
8326 members.
8327
8328 2011-08-23 Eli Zaretskii <eliz@gnu.org>
8329
8330 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
8331 a character.
8332
8333 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
8334
8335 * nsfont.m (ns_otf_to_script): Fix typo.
8336
8337 2011-08-22 Kenichi Handa <handa@m17n.org>
8338
8339 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
8340 extra slot even if the purpose is char-code-property-table.
8341
8342 2011-08-23 Eli Zaretskii <eliz@gnu.org>
8343
8344 * xdisp.c (redisplay_window): When computing centering_position,
8345 account for the height of the header line. (Bug#8874)
8346
8347 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
8348 instead of CHAR_TO_BYTE. Fixes a crash when a completion
8349 candidate is selected by the mouse, and that candidate has a
8350 composed character under the mouse.
8351
8352 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
8353 coordinates reported by pos-visible-in-window-p for a composed
8354 character in column zero.
8355
8356 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
8357
8358 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
8359
8360 2011-08-22 Eli Zaretskii <eliz@gnu.org>
8361
8362 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
8363 consider it a hit if to_charpos is anywhere in the range of the
8364 composed buffer positions.
8365
8366 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
8367
8368 * image.c (gif_load): Don't assume that each subimage has the same
8369 dimensions as the base image. Handle disposal method that is
8370 "undefined" by the gif spec (Bug#9335).
8371
8372 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
8373
8374 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
8375 (Fcondition_case): Document `debug' symbol in error handler.
8376
8377 2011-08-19 Eli Zaretskii <eliz@gnu.org>
8378
8379 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8380 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8381 from an Org mode buffer to a Speedbar frame.
8382
8383 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8384 a composition, take its buffer position from IT->cmp_it.charpos.
8385 Fixes cursor positioning at the beginning of a line that begins
8386 with a composed character.
8387
8388 2011-08-18 Eli Zaretskii <eliz@gnu.org>
8389
8390 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8391 character bidirectional type, use STRONG_L instead. Fixes crashes
8392 in a buffer produced by `describe-categories'.
8393
8394 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8395 members before the level stack, so they would be saved and
8396 restored when copying iterator state. Fixes incorrect reordering
8397 around TABs covered by display properties.
8398
8399 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
8400
8401 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
8402
8403 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
8404
8405 * eval.c (internal_condition_case, internal_condition_case_1)
8406 (internal_condition_case_2, internal_condition_case_n):
8407 Remove unnecessary aborts (Bug#9081).
8408
8409 2011-08-17 Eli Zaretskii <eliz@gnu.org>
8410
8411 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8412 has no `load' handler, try opening the file locally. (Bug#9311)
8413
8414 2011-08-16 Ken Brown <kbrown@cornell.edu>
8415
8416 * gmalloc.c: Expand comment.
8417
8418 2011-08-16 Eli Zaretskii <eliz@gnu.org>
8419
8420 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8421 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
8422
8423 2011-08-16 Ken Brown <kbrown@cornell.edu>
8424
8425 Fix memory allocation problems in Cygwin build (Bug#9273).
8426
8427 * unexcw.c ( __malloc_initialized): Declare external variable.
8428 (fixup_executable): Force the dumped emacs to reinitialize malloc.
8429
8430 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8431 New variables.
8432 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8433 dumped emacs.
8434 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8435 in the static heap.
8436 [CYGWIN] (special_realloc): New function.
8437 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8438 requests to realloc storage in the static heap.
8439
8440 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
8441
8442 * bidi.c (bidi_initialize): Remove unused local.
8443
8444 2011-08-15 Eli Zaretskii <eliz@gnu.org>
8445
8446 * bidimirror.h:
8447 * biditype.h: Remove file.
8448 * makefile.w32-in ($(BLD)/bidi.$(O)):
8449 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
8450
8451 * dispextern.h: Fix a typo in the comment to bidi_type_t.
8452
8453 * chartab.c: Improve commentary for the uniprop_table API.
8454
8455 * bidi.c (bidi_paragraph_init): Support zero value of
8456 bidi_ignore_explicit_marks_for_paragraph_level.
8457 (bidi_initialize): Use uniprop_table instead of including
8458 biditype.h and bidimirror.h.
8459
8460 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8461 coordinates of the iterator when restoring from ppos_it.
8462 (Bug#9296)
8463
8464 2011-08-14 Kenichi Handa <handa@m17n.org>
8465
8466 * process.c (create_process): Call setup_process_coding_systems
8467 after the pid of the process is set to -1 (Bug#8162).
8468
8469 2011-08-14 Eli Zaretskii <eliz@gnu.org>
8470
8471 * xdisp.c (move_it_in_display_line_to): Don't invoke
8472 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8473 ppos_it. Fixes vertical cursor motion when line beginning is
8474 covered by an image. (Bug#9296)
8475
8476 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
8477
8478 * nsterm.h (ns_run_ascript): Declare.
8479 (NSAPP_DATA2_RUNASSCRIPT): Define.
8480
8481 * nsfns.m (as_script, as_result, as_status): New static variables.
8482 (ns_run_ascript): New function.
8483 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
8484 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8485 the event loop. Get status from as_status (Bug#7276).
8486
8487 * nsterm.m (sendEvent): If event is NSApplicationDefined and
8488 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8489 the event loop (Bug#7276).
8490
8491 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
8492
8493 * gnutls.c (QCgnutls_bootprop_priority)
8494 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8495 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8496 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8497 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8498 (QCgnutls_bootprop_verify_hostname_error)
8499 (QCgnutls_bootprop_callbacks_verify): Rename from
8500 Qgnutls_bootprop_..., all uses changed.
8501
8502 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8503 uses changed.
8504
8505 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
8506
8507 * xfaces.c (Qframe_set_background_mode): Now static.
8508 * dispextern.h (Qframe_set_background_mode): Remove decl.
8509
8510 * process.c (Fnetwork_interface_info): Declare local only if needed.
8511
8512 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
8513
8514 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8515 (Fnetwork_interface_list): Allocate in increments of bytes instead
8516 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
8517 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
8518 sockaddr.
8519 (struct ifflag_def): notrailers is smart on OSX.
8520 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
8521 Get hardware address with getifaddrs if available.
8522
8523 2011-08-12 Eli Zaretskii <eliz@gnu.org>
8524
8525 * xdisp.c (iterate_out_of_display_property): xassert that
8526 IT->position is set to within IT->object's boundaries. Break from
8527 the loop as soon as EOB is reached; avoids infloops in redisplay
8528 when IT->position is set up wrongly due to some bug.
8529 Set IT->current to match the bidi iterator unconditionally.
8530 (push_display_prop): Allow GET_FROM_STRING as IT->method on
8531 entry. Force push_it to save on the stack the current
8532 buffer/string position, to be restored by pop_it. Fix flags in
8533 the iterator structure wrt the object coming from a display
8534 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
8535 properties. (Bug#9284)
8536
8537 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
8538
8539 * fontset.c (fontset_get_font_group): Add proper type checks.
8540 (Bug#9172)
8541
8542 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8543
8544 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8545 and LC_VERSION_MIN_MACOSX.
8546 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8547 (dump_it) [LC_FUNCTION_STARTS]: Use it.
8548
8549 2011-08-08 Eli Zaretskii <eliz@gnu.org>
8550
8551 * xdisp.c (forward_to_next_line_start): Allow to use the
8552 no-display-properties-and-no-overlays under bidi display.
8553 Set disp_pos in the bidi iterator to avoid searches for display
8554 properties and overlays.
8555
8556 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
8557
8558 * editfns.c (Fset_time_zone_rule): Document relationship with the
8559 setenv function.
8560
8561 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8562 the font entity extracted from the cache (Bug#8109).
8563
8564 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
8565
8566 * composite.c (autocmp_chars): Don't reset point. That is done by
8567 restore_point_unwind (Bug#5984).
8568
8569 2011-08-07 Juri Linkov <juri@jurta.org>
8570
8571 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8572 to show the arg `TIME' instead of `TIMEVAL'.
8573
8574 2011-08-06 Eli Zaretskii <eliz@gnu.org>
8575
8576 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8577 display property strides EOL and includes a newline, as in
8578 longlines-mode. (Bug#9254)
8579 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8580 word-wrap under bidirectional display. (Bug#9224)
8581
8582 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8583 is non-zero, even if the data buffer is NULL. Fixes a crash in
8584 vertical-motion with longlines-mode. (Bug#9254)
8585
8586 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8587
8588 * bidi.c <bidi_cache_total_alloc>: Now static.
8589 (bidi_initialize): Initialize bidi_cache_total_alloc.
8590
8591 * xdisp.c (display_line): Release buffer allocated for shelved bidi
8592 cache. (Bug#9221)
8593
8594 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8595 amount allocated this far in `bidi_cache_total_alloc'.
8596 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8597 non-zero, only free the data buffer without restoring the cache
8598 contents. All callers changed.
8599
8600 * dispextern.h (bidi_unshelve_cache): Update prototype.
8601
8602 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8603 (move_it_in_display_line, move_it_to)
8604 (move_it_vertically_backward, move_it_by_lines): Replace the call
8605 to xfree to an equivalent call to bidi_unshelve_cache.
8606 (move_it_in_display_line_to): Fix logic of returning
8607 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
8608
8609 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8610
8611 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8612 came from a string character with a `cursor' property. (Bug#9229)
8613
8614 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8615
8616 * Makefile.in (LIB_PTHREAD): New variable.
8617 (LIBES): Add LIB_PTHREAD (Bug#9216).
8618
8619 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8620 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8621
8622 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8623
8624 * regex.c (re_iswctype): Remove some redundant boolean conversions.
8625
8626 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8627
8628 * xterm.c (x_find_topmost_parent): New function.
8629 (x_set_frame_alpha): Find topmost parent window with
8630 x_find_topmost_parent and set the property there also (bug#9181).
8631 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8632
8633 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8634
8635 * callproc.c (Fcall_process): Avoid vfork clobbering
8636 the local vars buffer, coding_systems, current_dir.
8637
8638 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8639
8640 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8641
8642 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8643
8644 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8645 so that it is not optimized away.
8646
8647 * xdisp.c (compute_display_string_pos): Remove unused local.
8648
8649 2011-08-02 Eli Zaretskii <eliz@gnu.org>
8650
8651 Fix slow cursor motion and scrolling in large buffers with
8652 selective display, like Org Mode buffers. (Bug#9218)
8653
8654 * dispextern.h (struct bidi_it): New member disp_prop_p.
8655
8656 * xdisp.c: Remove one-slot cache of display string positions.
8657 (compute_display_string_pos): Accept an additional argument
8658 DISP_PROP_P; callers changed. Scan at most 5K characters forward
8659 for a display string or property. If found, set DISP_PROP_P
8660 non-zero.
8661
8662 * bidi.c (bidi_fetch_char): Accept an additional argument
8663 DISP_PROP_P, and pass it to compute_display_string_pos.
8664 Only handle text covered by a display string if DISP_PROP_P is returned
8665 non-zero. All callers of bidi_fetch_char changed.
8666
8667 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8668
8669 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8670
8671 2010-12-03 Don March <don@ohspite.net>
8672
8673 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8674 last character M-[char] is translated to ESC [char] (bug#7541).
8675
8676 2011-08-02 Kenichi Handa <handa@m17n.org>
8677
8678 * lisp.h (uniprop_table): Extern it.
8679
8680 * chartab.c (uniprop_table): Make it non-static.
8681
8682 2011-08-01 Eli Zaretskii <eliz@gnu.org>
8683
8684 * xdisp.c (forward_to_next_line_start): Accept additional argument
8685 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8686 on the newline.
8687 (reseat_at_next_visible_line_start): Use the bidi iterator state
8688 returned by forward_to_next_line_start to restore the state of
8689 it->bidi_it after backing up to previous newline. (Bug#9212)
8690
8691 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8692
8693 * regex.c (re_comp): Protoize.
8694 (re_exec): Fix return type.
8695 (regexec): Fix type of `ret'. (Bug#9203)
8696
8697 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8698
8699 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8700 This is needed if max-image-size is a floating-point number.
8701
8702 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8703
8704 * print.c (print_object): Print empty symbol as ##.
8705
8706 * lread.c (read1): Read ## as empty symbol.
8707
8708 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8709
8710 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8711 setting frame foreground color (Bug#9175).
8712 (x_set_background_color): Likewise.
8713
8714 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8715 contents (Bug#9176).
8716 (EmacsTooltip -init): Remove bezels and add shadows to
8717 tooltip windows.
8718
8719 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8720 or scroll bar (Bug#8470).
8721
8722 * nsfont.m (nsfont_open): Remove assignment to voffset and
8723 unnecessary vars hshink, expand, hd, full_height, min_height.
8724 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8725
8726 * nsterm.h (nsfont_info): Remove voffset field.
8727
8728 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8729
8730 Implement strike-through and overline on NextStep (Bug#8863).
8731
8732 * nsfont.m (nsfont_open): Use underline position provided by font,
8733 instead of hard-coded value of 2.
8734 (nsfont_draw): Call ns_draw_text_decoration instead.
8735
8736 * nsterm.h: Add declaration for ns_draw_text_decoration.
8737
8738 * nsterm.m (ns_draw_text_decoration): New function for drawing
8739 underline, overline, and strike-through.
8740 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8741 ns_draw_text_decoration. Change treatment of cursor drawing to
8742 accommodate underlining, etc.
8743
8744 2011-07-28 Eli Zaretskii <eliz@gnu.org>
8745
8746 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8747 default.
8748
8749 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8750
8751 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8752 Without this fix, if a signal arrives just after memory fills up,
8753 'malloc' might be invoked reentrantly.
8754
8755 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8756 In other words, assume that every image size is allowed, on non-X
8757 hosts. This assumption is probably wrong, but it lets Emacs compile.
8758
8759 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8760
8761 * regex.c (re_iswctype): Convert return values to boolean.
8762
8763 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
8764
8765 * xdisp.c (compute_display_string_pos): Don't use cached display
8766 string position if the buffer had its restriction changed.
8767 (Bug#9184)
8768
8769 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8770
8771 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8772
8773 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8774
8775 Integer signedness and overflow and related fixes. (Bug#9079)
8776
8777 * bidi.c: Integer size and overflow fixes.
8778 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
8779 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
8780 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8781 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
8782 (bidi_find_other_level_edge):
8783 Use ptrdiff_t instead of EMACS_INT where either will do.
8784 This works better on 32-bit hosts configured --with-wide-int.
8785 (bidi_cache_ensure_space): Check for size-calculation overflow.
8786 Use % rather than repeated addition, for better worst-case speed.
8787 Don't set bidi_cache_size until after xrealloc returns, because it
8788 might not return.
8789 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
8790 (bidi_cache_ensure_space): Also check that the bidi cache size
8791 does not exceed that of the largest Lisp string or buffer. See Eli
8792 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
8793
8794 * alloc.c (__malloc_size_t): Remove.
8795 All uses replaced by size_t. See Andreas Schwab's note
8796 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
8797
8798 * image.c: Improve checking for integer overflow.
8799 (check_image_size): Assume that f is nonnull, since
8800 it is always nonnull in practice. This is one less thing to
8801 worry about when checking for integer overflow later.
8802 (x_check_image_size): New function, which checks for integer
8803 overflow issues inside X.
8804 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
8805 This removes the need for a memory_full check.
8806 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
8807 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
8808 (xbm_read_bitmap_data): Change locals back to 'int', since
8809 their values must fit in 'int'.
8810 (xpm_load_image, png_load, tiff_load):
8811 Invoke x_create_x_image_and_pixmap earlier,
8812 to avoid much needless work if the image is too large.
8813 (tiff_load): Treat overly large images as if
8814 x_create_x_image_and_pixmap failed, not as malloc failures.
8815 (gs_load): Use x_check_image_size.
8816
8817 * gtkutil.c: Omit integer casts.
8818 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
8819 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
8820
8821 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
8822
8823 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
8824 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
8825 would wrongly return t on a 64-bit host.
8826
8827 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
8828 The plain *_OVERFLOW macros run afoul of GCC bug 49705
8829 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
8830 and therefore cause GCC to emit a bogus diagnostic in some cases.
8831
8832 * image.c: Integer signedness and overflow and related fixes.
8833 This is not an exhaustive set of fixes, but it's time to
8834 record what I've got.
8835 (lookup_pixel_color, check_image_size): Remove redundant decls.
8836 (check_image_size): Don't assume that arbitrary EMACS_INT values
8837 fit in 'int', or that arbitrary 'double' values fit in 'int'.
8838 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
8839 (tiff_load, imagemagick_load_image):
8840 Check for overflow in size calculations.
8841 (x_create_x_image_and_pixmap): Remove unnecessary test for
8842 xmalloc returning NULL; that can't happen.
8843 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
8844 (xpm_color_bucket): Use better integer hashing function.
8845 (xpm_cache_color): Don't possibly over-allocate memory.
8846 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
8847 (gif_memory_source):
8848 Use ptrdiff_t, not int or size_t, to record sizes.
8849 (png_load): Don't assume values greater than 2**31 fit in 'int'.
8850 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
8851 either works, as we prefer signed integers.
8852 (tiff_read_from_memory, tiff_write_from_memory):
8853 Return tsize_t, not size_t, since that's what the TIFF API wants.
8854 (tiff_read_from_memory): Don't fail simply because the read would
8855 go past EOF; instead, return a short read.
8856 (tiff_load): Omit no-longer-needed casts.
8857 (Fimagemagick_types): Don't assume size fits into 'int'.
8858
8859 Improve hashing quality when configured --with-wide-int.
8860 * fns.c (hash_string): New function, taken from sxhash_string.
8861 Do not discard information about ASCII character case; this
8862 discarding is no longer needed.
8863 (sxhash-string): Use it. Change sig to match it. Caller changed.
8864 * lisp.h: Declare it.
8865 * lread.c (hash_string): Remove, since we now use fns.c's version.
8866 The fns.c version returns a wider integer if --with-wide-int is
8867 specified, so this should help the quality of the hashing a bit.
8868
8869 * emacs.c: Integer overflow minor fix.
8870 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8871 Define only if GNU_LINUX.
8872 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8873
8874 * dispnew.c: Integer signedness and overflow fixes.
8875 Remove unnecessary forward decls, that were a maintenance hassle.
8876 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8877 All uses changed.
8878 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8879 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8880 (prepare_desired_row, line_draw_cost):
8881 Use int, not unsigned, where either works.
8882 (save_current_matrix, restore_current_matrix):
8883 Use ptrdiff_t, not size_t, where either works.
8884 (init_display): Check for overflow more accurately, and without
8885 relying on undefined behavior.
8886
8887 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8888 Remove, replacing with the new symbols in lisp.h. All uses changed.
8889 * fileio.c (make_temp_name):
8890 * filelock.c (lock_file_1, lock_file):
8891 * xdisp.c (message_dolog):
8892 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8893 Use pMd etc. instead.
8894 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8895 replacing the pWIDE etc. symbols removed from editfns.c.
8896
8897 * keyboard.h (num_input_events): Now uintmax_t.
8898 This is (very slightly) less likely to mess up due to wraparound.
8899 All uses changed.
8900
8901 * buffer.c: Integer signedness fixes.
8902 (alloc_buffer_text, enlarge_buffer_text):
8903 Use ptrdiff_t rather than size_t when either will do, as we prefer
8904 signed integers.
8905
8906 * alloc.c: Integer signedness and overflow fixes.
8907 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8908 (__malloc_size_t): Default to size_t, not to int.
8909 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8910 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8911 Prefer ptrdiff_t to size_t when either would do, as we prefer
8912 signed integers.
8913 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8914 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8915 Now const. Initialize with values that are in range even if char
8916 is signed.
8917 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8918 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8919 These functions do the right thing with sizes > 2**32.
8920 (check_depth): Now ptrdiff_t, not int.
8921 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8922 Adjust to new way of storing sizes. Check for size overflow bugs
8923 in rest of code.
8924 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8925 slightly wrong anyway, as it missed one instance of
8926 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8927 (refill_memory_reserve): Omit needless cast to size_t.
8928 (mark_object_loop_halt): Mark as externally visible.
8929
8930 * xselect.c: Integer signedness and overflow fixes.
8931 (Fx_register_dnd_atom, x_handle_dnd_message):
8932 Use ptrdiff_t, not size_t, since we prefer signed.
8933 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8934 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8935 x_dnd_atoms_size and x_dnd_atoms_length.
8936
8937 * doprnt.c: Prefer signed to unsigned when either works.
8938 * eval.c (verror):
8939 * doprnt.c (doprnt):
8940 * lisp.h (doprnt):
8941 * xdisp.c (vmessage):
8942 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8943 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8944 prefer signed arithmetic to avoid comparison confusion.
8945 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8946 but is a bit tricky.
8947
8948 Assume freestanding C89 headers, string.h, stdlib.h.
8949 * data.c, doprnt.c, floatfns.c, print.c:
8950 Include float.h unconditionally.
8951 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8952 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8953 * regex.c: Likewise for stddef.h, string.h.
8954 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8955 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8956 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8957 (STDC_HEADERS): Remove obsolete defines.
8958 * sysdep.c: Include limits.h unconditionally.
8959
8960 Assume support for memcmp, memcpy, memmove, memset.
8961 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8962 * regex.c (memcmp, memcpy):
8963 Remove; we assume C89 now.
8964
8965 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8966 (__malloc_safe_bcopy): Remove; no longer needed.
8967
8968 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
8969 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8970 well either way, and we prefer signed to unsigned.
8971
8972 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8973
8974 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8975 closes the connection while we're reading (bug#9182).
8976
8977 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
8978
8979 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8980 are specified (Bug#9168).
8981
8982 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8983
8984 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8985 Found by GCC static checking and --with-wide-int on a 32-bit host.
8986
8987 2011-07-25 Eli Zaretskii <eliz@gnu.org>
8988
8989 * xdisp.c (compute_display_string_pos): Fix logic of caching
8990 previous display string position. Initialize cached_prev_pos to
8991 -1. Fixes slow-down at the beginning of a buffer.
8992
8993 2011-07-24 Eli Zaretskii <eliz@gnu.org>
8994
8995 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
8996 for attrs[LFACE_FONTSET_INDEX].
8997
8998 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
8999
9000 * xml.c (parse_region): Remove unused local
9001 that was recently introduced.
9002
9003 2011-07-23 Eli Zaretskii <eliz@gnu.org>
9004
9005 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
9006 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
9007
9008 * xdisp.c (move_it_in_display_line_to): Record the best matching
9009 position for TO_CHARPOS while scanning the line, and restore it on
9010 exit if none of the characters scanned was an exact match.
9011 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
9012 when exact match is impossible due to invisible text, and the
9013 lines are truncated.
9014
9015 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
9016
9017 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
9018 for OSX >= 10.7.
9019
9020 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9021
9022 Fix a significant slow-down of cursor motion with C-n, C-p,
9023 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
9024 auto-repeat under bidi redisplay in fontified buffers.
9025 * xdisp.c (compute_stop_pos_backwards): New function.
9026 (next_element_from_buffer): Call compute_stop_pos_backwards to
9027 find a suitable prev_stop when we find ourselves before
9028 base_level_stop.
9029 (reseat): Don't look for prev_stop, as that could mean a very long
9030 run.
9031 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
9032 <cached_disp_overlay_modiff>: Cache for last found display string
9033 position.
9034 (compute_display_string_pos): Return the cached position if asked
9035 about the same buffer in the same area of character positions, and
9036 the buffer wasn't changed since the time the display string
9037 position was cached.
9038
9039 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9040
9041 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
9042 is an integer, which is important for empty lines. (Bug#9149)
9043
9044 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
9045
9046 * frame.c (Fmodify_frame_parameters): In tty case, update the
9047 default face if necessary (Bug#4238).
9048
9049 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
9050
9051 * editfns.c (Fstring_to_char): No need to explain what a character
9052 is in the docstring (Bug#6576).
9053
9054 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9055
9056 * xml.c (parse_region): Make sure we always return a tree.
9057
9058 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
9059
9060 * xml.c (parse_region): If a document contains only comments,
9061 return that, too.
9062
9063 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9064
9065 * xml.c (make_dom): Return comments, too.
9066
9067 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
9068
9069 Port to OpenBSD.
9070 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
9071 and the surrounding thread.
9072 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
9073 rather than fgets, and retry after EINTR. Otherwise, 'emacs
9074 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
9075 timer goes off.
9076 * s/openbsd.h (BROKEN_SIGIO): Define.
9077 * unexelf.c (unexec) [__OpenBSD__]:
9078 Don't update the .mdebug section of the Alpha COFF symbol table.
9079
9080 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9081
9082 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
9083 (bug#8460).
9084
9085 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
9086
9087 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
9088 This fixes some race conditions on the permissions of any newly
9089 created file.
9090
9091 * alloc.c (valid_pointer_p): Use pipe, not open.
9092 This fixes some permissions issues when debugging.
9093
9094 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
9095 If fchown fails to set both uid and gid, try to set just gid,
9096 as that is sometimes allowed. Adjust the file's mode to eliminate
9097 setuid or setgid bits that are inappropriate if fchown fails.
9098
9099 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9100
9101 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
9102 to compare Lisp_Objects.
9103 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
9104 global_gnutls_log_level, don't mistake it for a Lisp_Object.
9105 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9106
9107 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
9108
9109 * lread.c (read_integer): Unread even EOF character.
9110 (read1): Likewise. Properly record start position of symbol.
9111
9112 * lread.c (read1): Read `#:' as empty uninterned symbol if no
9113 symbol character follows.
9114
9115 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
9118 This works around a problem with the previous change to Fcopy_file.
9119 Recent glibc declares fchown with __attribute__((warn_unused_result)),
9120 and without this change, GCC might complain about discarding
9121 fchown's return value.
9122
9123 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
9124
9125 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
9126
9127 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
9128
9129 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
9130
9131 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
9132
9133 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
9134 it's used from the C level.
9135
9136 * process.c: Use the same condition for POLL_FOR_INPUT in both
9137 keyboard.c and process.c (bug#1858).
9138
9139 2011-07-09 Lawrence Mitchell <wence@gmx.li>
9140
9141 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
9142 (Fgnutls_boot): Use it.
9143
9144 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
9145
9146 * doc.c (Fsubstitute_command_keys): Revert last change.
9147
9148 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
9149
9150 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
9151 quotes the next character, and doesn't affect other longer
9152 sequences (bug#8935).
9153
9154 * lread.c (syms_of_lread): Clarify that is isn't only
9155 `eval-buffer' and `eval-defun' that's affected by
9156 `lexical-binding' (bug#8460).
9157
9158 2011-07-15 Eli Zaretskii <eliz@gnu.org>
9159
9160 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
9161 bidi redisplay when a line includes both an image and is truncated.
9162
9163 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
9164
9165 Fix minor problems found by static checking.
9166 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
9167 (elsz): Now a signed constant, not a size_t var. We prefer signed
9168 types to unsigned, to avoid integer comparison confusion. Without
9169 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
9170 "cannot optimize loop, the loop counter may overflow", a symptom
9171 of the confusion.
9172 * indent.c (Fvertical_motion): Mark locals as initialized.
9173 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
9174
9175 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9176
9177 * search.c (Fre_search_backward): Mention `case-fold-search' in
9178 all the re_search_* functions (bug#8138).
9179
9180 * keyboard.c (Fopen_dribble_file): Document when the file is
9181 closed (bug#8056).
9182
9183 2011-07-14 Eli Zaretskii <eliz@gnu.org>
9184
9185 * bidi.c (bidi_dump_cached_states): Fix format of displaying
9186 bidi_cache_idx.
9187
9188 Support bidi reordering of display and overlay strings.
9189 * xdisp.c (compute_display_string_pos)
9190 (compute_display_string_end): Accept additional argument STRING.
9191 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
9192 (reseat_to_string): Initialize bidi_it->string.s and
9193 bidi_it->string.schars.
9194 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
9195 NULL (avoids a crash in bidi_paragraph_init).
9196 Initialize itb.string.lstring.
9197 (init_iterator): Call bidi_init_it only of a valid
9198 buffer position was specified. Initialize paragraph_embedding to
9199 L2R.
9200 (reseat_to_string): Initialize the bidi iterator.
9201 (display_string): If we need to ignore text properties of
9202 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
9203 original value of -1 will not work with bidi.)
9204 (compute_display_string_pos): First arg is now struct
9205 `text_pos *'; all callers changed. Support display properties on
9206 Lisp strings.
9207 (compute_display_string_end): Support display properties on Lisp
9208 strings.
9209 (init_iterator, reseat_1, reseat_to_string): Initialize the
9210 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
9211 when iterating on a string not from display properties).
9212 (compute_display_string_pos, compute_display_string_end):
9213 Fix calculation of the object to scan. Fixes an error when using
9214 arrow keys.
9215 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
9216 base_level_stop; instead, set base_level_stop to BEGV.
9217 Fixes crashes in vertical-motion.
9218 (next_element_from_buffer): Improve commentary for when
9219 the iterator is before prev_stop.
9220 (init_iterator): Initialize bidi_p from the default value of
9221 bidi-display-reordering, not from buffer-local value. Use the
9222 buffer-local value only if initializing for buffer iteration.
9223 (handle_invisible_prop): Support invisible properties on strings
9224 that are being bidi-reordered.
9225 (set_iterator_to_next): Support bidi reordering of C strings and
9226 Lisp strings.
9227 (next_element_from_string): Support bidi reordering of Lisp
9228 strings.
9229 (handle_stop_backwards): Support Lisp strings as well.
9230 (display_string): Support display of R2L glyph rows.
9231 Use IT_STRING_CHARPOS when displaying from a Lisp string.
9232 (init_iterator): Don't initialize it->bidi_p for strings
9233 here.
9234 (reseat_to_string): Initialize it->bidi_p for strings here.
9235 (next_element_from_string, next_element_from_c_string)
9236 (next_element_from_buffer): Add xassert's for correspondence
9237 between IT's object being iterated and it->bidi_it.string
9238 structure.
9239 (face_before_or_after_it_pos): Support bidi iteration.
9240 (next_element_from_c_string): Handle the case of the first string
9241 character that is not the first one in the visual order.
9242 (get_visually_first_element): New function, refactored from common
9243 parts of next_element_from_buffer, next_element_from_string, and
9244 next_element_from_c_string.
9245 (tool_bar_lines_needed, redisplay_tool_bar)
9246 (display_menu_bar): Force left-to-right direction. Add a FIXME
9247 comment for making that be controlled by a user option.
9248 (push_it, pop_it): Save and restore the state of the
9249 bidi iterator. Save and restore the bidi_p flag.
9250 (pop_it): Iterate out of display property for string iteration as
9251 well.
9252 (iterate_out_of_display_property): Support iteration over strings.
9253 (handle_single_display_spec): Set up it->bidi_it for iteration
9254 over a display string, and call bidi_init_it.
9255 (handle_single_display_spec, next_overlay_string)
9256 (get_overlay_strings_1, push_display_prop): Set up the bidi
9257 iterator for displaying display or overlay strings.
9258 (forward_to_next_line_start): Don't use the shortcut if
9259 bidi-iterating.
9260 (back_to_previous_visible_line_start): If handle_display_prop
9261 pushed the iterator stack, restore the internal state of the bidi
9262 iterator by calling bidi_pop_it same number of times.
9263 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
9264 and we are bidi-iterating, don't decrement the iterator position;
9265 instead, set the first_elt flag in the bidi iterator, to produce
9266 the same effect.
9267 (reseat_1): Remove redundant setting of string_from_display_prop_p.
9268 (push_display_prop): xassert that we are iterating a buffer.
9269 (push_it, pop_it): Save and restore paragraph_embedding member.
9270 (handle_single_display_spec, next_overlay_string)
9271 (get_overlay_strings_1, reseat_1, reseat_to_string)
9272 (push_display_prop): Set up the `unibyte' member of bidi_it.string
9273 correctly. Don't assume unibyte strings are not bidi-reordered.
9274 (compute_display_string_pos)
9275 (compute_display_string_end): Fix handling the case of C string.
9276 (push_it, pop_it): Save and restore from_disp_prop_p.
9277 (handle_single_display_spec, push_display_prop): Set the
9278 from_disp_prop_p flag.
9279 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
9280 (pop_it): Call iterate_out_of_display_property only if we are
9281 popping after iteration over a string that came from a display
9282 property. Fix a typo in popping stretch info. Add an assertion
9283 for verifying that the iterator position is in sync with the bidi
9284 iterator.
9285 (handle_single_display_spec, get_overlay_strings_1)
9286 (push_display_prop): Fix initialization of paragraph direction for
9287 string when that of the parent object is not yet determined.
9288 (reseat_1): Call bidi_init_it to resync the bidi
9289 iterator with IT's position. (Bug#7616)
9290 (find_row_edges): If ROW->start.pos gives position
9291 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
9292 (handle_stop, back_to_previous_visible_line_start, reseat_1):
9293 Reset the from_disp_prop_p flag.
9294 (SAVE_IT, RESTORE_IT): New macros.
9295 (pos_visible_p, face_before_or_after_it_pos)
9296 (back_to_previous_visible_line_start)
9297 (move_it_in_display_line_to, move_it_in_display_line)
9298 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9299 (try_scrolling, redisplay_window, display_line): Use them when
9300 saving a temporary copy of the iterator and restoring it back.
9301 (back_to_previous_visible_line_start, reseat_1)
9302 (init_iterator): Empty the bidi cache "stack".
9303 (move_it_in_display_line_to): If iterator ended up at
9304 EOL, but we never saw any buffer positions smaller than
9305 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
9306 motion in bidi-reordered lines.
9307 (move_it_in_display_line_to): Record prev_method and prev_pos
9308 immediately before the call to set_iterator_to_next. Fixes cursor
9309 motion in bidi-reordered lines with stretch glyphs and strings
9310 displayed in margins. (Bug#8133) (Bug#8867)
9311 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
9312 TO_CHARPOS.
9313 (pos_visible_p): Support positions in bidi-reordered lines.
9314 Save and restore bidi cache.
9315
9316 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
9317 (bidi_paragraph_info): Delete unused struct.
9318 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
9319 (bidi_cache_start): New variable.
9320 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
9321 to zero.
9322 (bidi_cache_fetch_state, bidi_cache_search)
9323 (bidi_cache_find_level_change, bidi_cache_iterator_state)
9324 (bidi_cache_find, bidi_peek_at_next_level)
9325 (bidi_level_of_next_char, bidi_find_other_level_edge)
9326 (bidi_move_to_visually_next): Compare cache index with
9327 bidi_cache_start rather than with zero.
9328 (bidi_fetch_char): Accept new argument STRING; all callers
9329 changed. Support iteration over a string. Support strings with
9330 display properties. Support unibyte strings. Fix the type of
9331 `len' according to what STRING_CHAR_AND_LENGTH expects.
9332 (bidi_paragraph_init, bidi_resolve_explicit_1)
9333 (bidi_resolve_explicit, bidi_resolve_weak)
9334 (bidi_level_of_next_char, bidi_move_to_visually_next):
9335 Support iteration over a string.
9336 (bidi_set_sor_type, bidi_resolve_explicit_1)
9337 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
9338 can now be zero (for strings); special values 0 and -1 were
9339 changed to -1 and -2, respectively.
9340 (bidi_char_at_pos): New function.
9341 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
9342 Call it instead of FETCH_MULTIBYTE_CHAR.
9343 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
9344 initialized to valid values.
9345 (bidi_init_it): Don't initialize charpos and bytepos with invalid
9346 values.
9347 (bidi_level_of_next_char): Allow the sentinel "position" to pass
9348 the test for valid cached positions. Fix the logic for looking up
9349 the sentinel state in the cache. GCPRO the Lisp string we are
9350 iterating.
9351 (bidi_push_it, bidi_pop_it): New functions.
9352 (bidi_initialize): Initialize the bidi cache start stack pointer.
9353 (bidi_cache_ensure_space): New function, refactored from part of
9354 bidi_cache_iterator_state. Don't assume the required size is just
9355 one BIDI_CACHE_CHUNK away.
9356 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
9357 (bidi_count_bytes, bidi_char_at_pos): New functions.
9358 (bidi_cache_search): Don't assume bidi_cache_last_idx is
9359 always valid if bidi_cache_idx is valid.
9360 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
9361 is valid if it's going to be used.
9362 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
9363 (bidi_cache_fetch_state, bidi_cache_search)
9364 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9365 (bidi_cache_iterator_state, bidi_cache_find)
9366 (bidi_find_other_level_edge, bidi_cache_start_stack):
9367 All variables related to cache indices are now EMACS_INT.
9368
9369 * dispextern.h (struct bidi_string_data): New structure.
9370 (struct bidi_it): New member `string'. Make flag members be 1-bit
9371 fields, and put them last in the struct.
9372 (compute_display_string_pos, compute_display_string_end):
9373 Update prototypes.
9374 (bidi_push_it, bidi_pop_it): Add prototypes.
9375 (struct iterator_stack_entry): New members bidi_p,
9376 paragraph_embedding, and from_disp_prop_p.
9377 (struct it): Member bidi_p is now a bit field 1 bit wide.
9378 (bidi_shelve_cache, bidi_unshelve_cache):
9379 Declare prototypes.
9380
9381 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9382 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9383 and vector-like objects.
9384
9385 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9386 cache around display iteration.
9387
9388 * window.c (Fwindow_end, window_scroll_pixel_based)
9389 (displayed_window_lines, Frecenter): Save and restore the bidi
9390 cache around display iteration.
9391
9392 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9393
9394 * editfns.c (Fdelete_region): Clarify the use of the named
9395 parameters (bug#6788).
9396
9397 2011-07-14 Martin Rudalics <rudalics@gmx.at>
9398
9399 * indent.c (Fvertical_motion): Set and restore w->pointm when
9400 saving and restoring the window's buffer (Bug#9006).
9401
9402 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
9403
9404 * editfns.c (Fstring_to_char): Clarify just what is returned
9405 (bug#6576). Text by Eli Zaretskii.
9406
9407 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
9408
9409 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9410
9411 2011-07-13 Eli Zaretskii <eliz@gnu.org>
9412
9413 * buffer.c (mmap_find): Fix a typo.
9414
9415 2011-07-13 Johan Bockgård <bojohan@gnu.org>
9416
9417 Fix execution of x selection hooks.
9418 * xselect.c (Qx_lost_selection_functions)
9419 (Qx_sent_selection_functions): New vars.
9420 (syms_of_xselect): DEFSYM them.
9421 (x_handle_selection_request): Pass Qx_sent_selection_functions
9422 rather than Vx_sent_selection_functions to Frun_hook_with_args.
9423 (x_handle_selection_clear,x_clear_frame_selections):
9424 Pass Qx_lost_selection_functions rather than
9425 Vx_lost_selection_functions to Frun_hook_with_args.
9426
9427 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
9430 The old code sometimes used this field without initializing it.
9431
9432 * alloc.c (gc_sweep): Don't read past end of array.
9433 In theory, the old code could also have corrupted Emacs internals,
9434 though it'd be very unlikely.
9435
9436 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
9437
9438 * character.c (Fcharacterp): Don't advertise optional ignored
9439 argument. (Bug#4026)
9440
9441 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
9442
9443 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9444 key" (bug#4257).
9445
9446 * window.c (Fset_window_start): Doc fix (bug#4199).
9447 (Fset_window_hscroll): Ditto.
9448
9449 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
9450
9451 Fix minor new problems caught by GCC 4.6.1.
9452 * term.c (init_tty): Remove unused local.
9453 * xsettings.c (store_monospaced_changed): Define this function only
9454 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
9455 not used otherwise.
9456
9457 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
9458
9459 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9460
9461 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9462
9463 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9464 are the mini-buffer and the echo area (bug#3320).
9465
9466 * term.c (init_tty): Remove support for supdup, c10 and perq
9467 terminals, which are no longer supported (bug#1482).
9468
9469 2011-07-10 Johan Bockgård <bojohan@gnu.org>
9470
9471 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9472
9473 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
9474
9475 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9476 for non-popups (Bug#3642).
9477
9478 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
9479
9480 * alloc.c (reset_malloc_hooks): Protoize.
9481 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
9482 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9483 * cm.c (losecursor): Likewise.
9484 * data.c (fmod): Likewise.
9485 * dispnew.c (swap_glyphs_in_rows): Likewise.
9486 * emacs.c (memory_warning_signal): Likewise.
9487 * floatfns.c (float_error): Likewise.
9488 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9489 (otf_open, font_otf_capability, generate_otf_features)
9490 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9491 Likewise.
9492 * image.c (pbm_read_file): Likewise.
9493 * indent.c (string_display_width): Likewise.
9494 * intervals.c (check_for_interval, search_for_interval)
9495 (inc_interval_count, count_intervals, root_interval)
9496 (adjust_intervals_for_insertion, make_new_interval): Likewise.
9497 * lread.c (defalias): Likewise.
9498 * ralloc.c (r_alloc_check): Likewise.
9499 * regex.c (set_image_of_range_1, set_image_of_range)
9500 (regex_grow_registers): Likewise.
9501 * sysdep.c (strerror): Likewise.
9502 * termcap.c (valid_filename_p, tprint, main): Likewise.
9503 * tparam.c (main): Likewise.
9504 * unexhp9k800.c (run_time_remap, save_data_space)
9505 (update_file_ptrs, read_header, write_header, calculate_checksum)
9506 (copy_file, copy_rest, display_header): Likewise.
9507 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9508 Likewise.
9509 * xdisp.c (check_it): Likewise.
9510 * xfaces.c (register_color, unregister_color, unregister_colors):
9511 Likewise.
9512 * xfns.c (print_fontset_result): Likewise.
9513 * xrdb.c (member, fatal, main): Likewise.
9514
9515 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
9516
9517 Fix minor problems found by static checking (Bug#9031).
9518 * chartab.c (char_table_set_range, map_sub_char_table):
9519 Remove unused locals.
9520 (uniprop_table): Now static.
9521 * composite.c (_work_char): Remove unused static var.
9522
9523 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
9524
9525 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
9526
9527 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
9528
9529 * gtkutil.c (qttip_cb): Remove code without function.
9530
9531 2011-07-09 Eli Zaretskii <eliz@gnu.org>
9532
9533 * w32.c (pthread_sigmask): New stub.
9534
9535 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
9536
9537 Use pthread_sigmask, not sigprocmask (Bug#9010).
9538 sigprocmask is portable only for single-threaded applications, and
9539 Emacs can be multi-threaded when it uses GTK.
9540 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
9541 (LIBES): Use it.
9542 * callproc.c (Fcall_process):
9543 * process.c (create_process):
9544 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9545 Use pthread_sigmask, not sigprocmask.
9546
9547 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9548
9549 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9550 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9551 wrong (Bug#8591).
9552
9553 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9554
9555 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9556 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9557 (xg_hide_tooltip): Fix comment.
9558
9559 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9560 in registerServicesMenuSendTypes.
9561 (validRequestorForSendType): Don't check ns_return_types.
9562
9563 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9564 ns_return_type.
9565
9566 2011-07-08 Jason Rumney <jasonr@gnu.org>
9567
9568 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9569 SH_SHOW for hidden windows (Bug#5482).
9570
9571 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9572 frame struct members of non-existent frames (Bug#6284).
9573
9574 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9575
9576 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9577 variable firstTime not needed on OSX >= 10.6.
9578 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9579 >= 10.5. Use setKnobProportion, setDoubleValue.
9580
9581 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9582 (MAC_OS_X_VERSION_10_5): Define if not defined.
9583 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9584 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9585 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9586
9587 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
9588 cString and lossyCString on OSX >= 10.4.
9589
9590 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
9591 sizeToFit on OSX >= 10.2.
9592
9593 * nsimage.m (allocInitFromFile): Don't use deprecated method
9594 bestRepresentationForDevice on OSX >= 10.6.
9595
9596 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9597 to avoid warning.
9598
9599 * emacs.c: Declare unexec_init_emacs_zone.
9600
9601 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9602
9603 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9604
9605 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9606 on svcsMenu (Bug#8842).
9607
9608 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9609 ns_return_types.
9610 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9611
9612 * nsterm.m (QUTF8_STRING): Declare.
9613 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9614 (validRequestorForSendType): Return type is (id).
9615 Change indexOfObjectIdenticalTo to indexOfObject.
9616 Check if we have local selection before returning self (Bug#8842).
9617 (writeSelectionToPasteboard): Put local selection into paste board
9618 if we have a local selection (Bug#8842).
9619 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9620
9621 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9622 (ns_get_local_selection): Declare.
9623
9624 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9625
9626 * keymap.c (describe_map_tree): Don't insert a double newline at
9627 the end of the buffer (bug#1169) and return whether we inserted
9628 something.
9629
9630 * callint.c (Fcall_interactively): Change "reading args" to
9631 "providing args" to try to clarify what it does (bug#1010).
9632
9633 2011-07-07 Kenichi Handa <handa@m17n.org>
9634
9635 * composite.c (composition_compute_stop_pos): Ignore a static
9636 composition starting before CHARPOS (Bug#8915).
9637
9638 * xdisp.c (handle_composition_prop): Likewise.
9639
9640 2011-07-07 Eli Zaretskii <eliz@gnu.org>
9641
9642 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9643 (Bug#9015)
9644
9645 2011-07-07 Kenichi Handa <handa@m17n.org>
9646
9647 * character.h (unicode_category_t): New enum type.
9648
9649 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9650 (Qchar_code_property_table): New variable.
9651 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9652 (UNIPROP_COMPRESSED_FORM_P): New macros.
9653 (char_table_ascii): Uncompress the compressed values.
9654 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9655 Uncompress the compressed values.
9656 (sub_char_table_ref_and_range): Likewise.
9657 (char_table_ref_and_range): Uncompress the compressed values.
9658 (sub_char_table_set): New arg is_uniprop. Callers changed.
9659 Uncompress the compressed values.
9660 (sub_char_table_set_range): Args changed. Callers changed.
9661 (char_table_set_range): Adjuted for the above change.
9662 (map_sub_char_table): Delete args default_val and parent. Add arg
9663 top. Give decoded values to a Lisp function.
9664 (map_char_table): Adjust for the above change. Give decoded
9665 values to a Lisp function. Gcpro more variables.
9666 (uniprop_table_uncompress)
9667 (uniprop_decode_value_run_length): New functions.
9668 (uniprop_decoder, uniprop_decoder_count): New variables.
9669 (uniprop_get_decoder, uniprop_encode_value_character)
9670 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9671 New functions.
9672 (uniprop_encoder, uniprop_encoder_count): New variables.
9673 (uniprop_get_encoder, uniprop_table)
9674 (Funicode_property_table_internal, Fget_unicode_property_internal)
9675 (Fput_unicode_property_internal): New functions.
9676 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9677 Sunicode_property_table_internal, Sget_unicode_property_internal,
9678 and Sput_unicode_property_internal. Defvar_lisp
9679 char-code-property-alist.
9680
9681 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
9682 Vunicode_category_table.
9683
9684 * font.c (font_range): Adjust for the change of
9685 Vunicode_category_table.
9686
9687 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9688
9689 * m/iris4d.h: Remove file, move contents ...
9690 * s/irix6-5.h: ... here.
9691
9692 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9693
9694 Remove unportable assumption about struct layout (Bug#8884).
9695 * alloc.c (mark_buffer):
9696 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9697 (clone_per_buffer_values): Don't assume that
9698 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9699 This isn't true in general, and it's particularly not true
9700 if Emacs is configured with --with-wide-int.
9701 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9702 New macros, used in the buffer.c change.
9703
9704 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9705
9706 * xsettings.c: Use both GConf and GSettings if both are available.
9707 (store_config_changed_event): Add comment.
9708 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9709 (store_tool_bar_style_changed): New functions.
9710 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
9711 (struct xsettings): Move font inside HAVE_XFT.
9712 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
9713 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
9714 Move inside HAVE_XFT.
9715 (something_changed_gsettingsCB): Rename from something_changedCB.
9716 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9717 also.
9718 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
9719 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
9720 (something_changed_gconfCB): Rename from something_changedCB.
9721 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9722 (parse_settings): Move check for font inside HAVE_XFT.
9723 (read_settings, apply_xft_settings): Add comment.
9724 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9725 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9726 call store_font_name_changed.
9727 (xft_settings_event): Add comment.
9728 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9729 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9730 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9731 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9732 (xsettings_initialize): Call init_gsettings last.
9733 (xsettings_get_system_font, xsettings_get_system_normal_font):
9734 Add comment.
9735
9736 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 Random fixes. E.g., (random) never returned negative values.
9739 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9740 subseconds part to the entropy, as that's a bit more random.
9741 Prefer signed to unsigned, since the signedness doesn't matter and
9742 in general we prefer signed. When given a limit, use a
9743 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9744 latter isn't right if USE_2_TAGS_FOR_INTS.
9745 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9746 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9747
9748 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9749
9750 * textprop.c (text_property_stickiness):
9751 Obey Vtext_property_default_nonsticky.
9752 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9753 * w32fns.c (syms_of_w32fns):
9754 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9755
9756 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9757
9758 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9759 This is more efficient than Ffile_directory_p and avoids a minor race.
9760
9761 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
9762
9763 * buffer.c (Foverlay_put): Say what the return value is
9764 (bug#7835).
9765
9766 * fileio.c (barf_or_query_if_file_exists): Check first if the file
9767 is a directory before asking whether to use the file name
9768 (bug#7564).
9769 (barf_or_query_if_file_exists): Make the "File is a directory"
9770 error be more correct.
9771
9772 * fns.c (Frequire): Remove the mention of the .gz files, since
9773 that's installation-specific, but keep the mention of
9774 `get-load-suffixes'.
9775
9776 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
9779 Report string overflow if the output is too long.
9780
9781 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
9782
9783 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
9784 (syms_of_gnutls): Remove duplicate DEFSYM for
9785 Qgnutls_bootprop_verify_hostname_error, an error for
9786 Qgnutls_bootprop_verify_error (which is no longer used).
9787
9788 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
9789 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
9790 Also (re)move comments that are misplaced or no longer relevant.
9791
9792 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9793
9794 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
9795
9796 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
9797
9798 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
9799 and background color parameters if they have been changed.
9800
9801 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9802
9803 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
9804
9805 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 * xsettings.c (SYSTEM_FONT): Define only when used.
9808 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
9809
9810 * keymap.c (access_keymap_1): Now static.
9811
9812 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
9813
9814 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
9815 leave any prefix arg for the up event (Bug#1586).
9816
9817 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
9818
9819 * lread.c (syms_of_lread): Mention single symbols defined by
9820 `defvar' or `defconst' (bug#7154).
9821
9822 * fns.c (Frequire): Mention .el.gz files (bug#7314).
9823 (Frequire): Mention get-load-suffixes.
9824
9825 2011-07-02 Martin Rudalics <rudalics@gmx.at>
9826
9827 * window.h (window): Remove clone_number slot.
9828 * window.c (Fwindow_clone_number, Fset_window_clone_number):
9829 Remove.
9830 (make_parent_window, make_window, saved_window)
9831 (Fset_window_configuration, save_window_save): Don't deal with
9832 clone numbers.
9833 * buffer.c (Qclone_number): Remove declaration.
9834 (sort_overlays, overlay_strings): Don't deal with clone numbers.
9835
9836 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
9837
9838 Add multiple inheritance to keymaps.
9839 * keymap.c (Fmake_composed_keymap): New function.
9840 (Fset_keymap_parent): Simplify.
9841 (fix_submap_inheritance): Remove.
9842 (access_keymap_1): New function extracted from access_keymap to handle
9843 embedded parents and handle lists of maps.
9844 (access_keymap): Use it.
9845 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
9846 (Fcopy_keymap): Handle embedded parents.
9847 (Fcommand_remapping, define_as_prefix): Simplify.
9848 (Fkey_binding): Simplify.
9849 (syms_of_keymap): Move minibuffer-local-completion-map,
9850 minibuffer-local-filename-completion-map,
9851 minibuffer-local-must-match-map, and
9852 minibuffer-local-filename-must-match-map to Elisp.
9853 (syms_of_keymap): Defsubr make-composed-keymap.
9854 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
9855 (parse_menu_item): Trivial simplification.
9856
9857 2011-07-01 Glenn Morris <rgm@gnu.org>
9858
9859 * Makefile.in (SETTINGS_LIBS): Fix typo.
9860
9861 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
9862
9863 * coding.c (Fencode_coding_string): Record the last coding system
9864 used, as the function doc string says (bug#8738).
9865
9866 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
9867
9868 * xsettings.c (store_monospaced_changed): Take new font as arg and
9869 check for change against current_mono_font.
9870 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9871 (emacs_settings_constructor, emacs_settings_get_property)
9872 (emacs_settings_set_property, emacs_settings_class_init)
9873 (emacs_settings_init, gsettings_obj): Remove.
9874 (something_changedCB): New function for HAVE_GSETTINGS.
9875 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9876 with value as argument.
9877 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9878 g_settings_new (Bug#8967). Do not create gsettings_obj.
9879 Remove calls to g_settings_bind. Connect something_changedCB to
9880 "changed".
9881
9882 * xgselect.c: Add defined (HAVE_GSETTINGS).
9883 (xgselect_initialize): Ditto.
9884
9885 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9886 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9887 xg_select.
9888
9889 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9890
9891 * eval.c (struct backtrace): Simplify and port the data structure.
9892 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9893 signed bit field, as this assumption is not portable and it makes
9894 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9895 "char debug_on_exit : 1" as this is not portable either; instead,
9896 use the portable "unsigned int debug_on_exit : 1". Remove unused
9897 member evalargs. Remove obsolete comments about cc bombing out.
9898
9899 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9900
9901 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9902 Let HAVE_GSETTINGS override HAVE_GCONF.
9903 (store_monospaced_changed): New function.
9904 (EMACS_SETTINGS): A new type derived from GObject to handle
9905 GSettings notifications.
9906 (emacs_settings_constructor, emacs_settings_get_property)
9907 (emacs_settings_set_property, emacs_settings_class_init):
9908 New functions.
9909 (gsettings_client, gsettings_obj): New variables.
9910 (GSETTINGS_SCHEMA): New define.
9911 (something_changedCB): Call store_monospaced_changed.
9912 (init_gsettings): New function.
9913 (xsettings_initialize): Call init_gsettings.
9914 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9915 to NULL.
9916
9917 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9918 GCONF_CFLAGS/LIBS.
9919
9920 2011-06-29 Martin Rudalics <rudalics@gmx.at>
9921
9922 * window.c (resize_root_window, grow_mini_window)
9923 (shrink_mini_window): Rename Qresize_root_window to
9924 Qwindow_resize_root_window and Qresize_root_window_vertically to
9925 Qwindow_resize_root_window_vertically.
9926
9927 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9930
9931 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
9932
9933 * makefile.w32-in: Redesign dependencies so they reflect more
9934 clearly which files are directly included by each source file,
9935 and not through other includes.
9936
9937 2011-06-27 Martin Rudalics <rudalics@gmx.at>
9938
9939 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9940 (sort_overlays, overlay_strings): When an overlay's clone number
9941 matches the window's clone number process the overlay even if
9942 the overlay's window property doesn't match the current window.
9943
9944 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9945 (Fwindow_hchild): Rename to Fwindow_left_child.
9946 (Fwindow_next): Rename to Fwindow_next_sibling.
9947 (Fwindow_prev): Rename to Fwindow_prev_sibling.
9948 (resize_window_check): Rename to window_resize_check.
9949 (resize_window_apply): Rename to window_resize_apply.
9950 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9951 (Fdelete_other_windows_internal, resize_frame_windows)
9952 (Fsplit_window_internal, Fdelete_window_internal)
9953 (grow_mini_window, shrink_mini_window)
9954 (Fresize_mini_window_internal): Fix callers accordingly.
9955
9956 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9957
9958 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9959 (emacs_fixed_set_min_size): Remove.
9960 (emacs_fixed_new): Take frame as argument.
9961
9962 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9963 (_EmacsFixedPrivate): Remove minwidth/height.
9964 Add struct frame *f.
9965 (emacs_fixed_init): Initialize priv->f.
9966 (get_parent_class, emacs_fixed_set_min_size): Remove.
9967 (emacs_fixed_new): Set priv->f to argument.
9968 (emacs_fixed_get_preferred_width)
9969 (emacs_fixed_get_preferred_height): Use min_width/height from
9970 frames size_hint to set minimum and natural (Bug#8919).
9971 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9972 and use min_width/height from frames size_hint to set
9973 min_width/height (Bug#8919).
9974
9975 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9976 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9977 Fix indentation.
9978
9979 2011-06-26 Eli Zaretskii <eliz@gnu.org>
9980
9981 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9982 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9983 called at ZV.
9984
9985 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
9986
9987 * process.c (wait_reading_process_output): Bypass select if
9988 waiting for a cell while ignoring keyboard input, and input is
9989 pending. Suggested by Jan Djärv (Bug#8869).
9990
9991 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9992
9993 Use gnulib's dup2 module instead of rolling our own.
9994 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
9995
9996 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9997
9998 * dispnew.c (scrolling_window): Before scrolling, turn off a
9999 mouse-highlight in the window being scrolled.
10000
10001 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
10002
10003 Move DEFSYM to lisp.h and use everywhere.
10004
10005 * character.h (DEFSYM): Move declaration...
10006 * lisp.h (DEFSYM): ...here.
10007
10008 * gnutls.c:
10009 * minibuf.c:
10010 * w32menu.c:
10011 * w32proc.c:
10012 * w32select.c: Don't include character.h.
10013
10014 * alloc.c (syms_of_alloc):
10015 * buffer.c (syms_of_buffer):
10016 * bytecode.c (syms_of_bytecode):
10017 * callint.c (syms_of_callint):
10018 * casefiddle.c (syms_of_casefiddle):
10019 * casetab.c (init_casetab_once):
10020 * category.c (init_category_once, syms_of_category):
10021 * ccl.c (syms_of_ccl):
10022 * cmds.c (syms_of_cmds):
10023 * composite.c (syms_of_composite):
10024 * dbusbind.c (syms_of_dbusbind):
10025 * dired.c (syms_of_dired):
10026 * dispnew.c (syms_of_display):
10027 * doc.c (syms_of_doc):
10028 * editfns.c (syms_of_editfns):
10029 * emacs.c (syms_of_emacs):
10030 * eval.c (syms_of_eval):
10031 * fileio.c (syms_of_fileio):
10032 * fns.c (syms_of_fns):
10033 * frame.c (syms_of_frame):
10034 * fringe.c (syms_of_fringe):
10035 * insdel.c (syms_of_insdel):
10036 * keymap.c (syms_of_keymap):
10037 * lread.c (init_obarray, syms_of_lread):
10038 * macros.c (syms_of_macros):
10039 * msdos.c (syms_of_msdos):
10040 * print.c (syms_of_print):
10041 * process.c (syms_of_process):
10042 * search.c (syms_of_search):
10043 * sound.c (syms_of_sound):
10044 * syntax.c (init_syntax_once, syms_of_syntax):
10045 * terminal.c (syms_of_terminal):
10046 * textprop.c (syms_of_textprop):
10047 * undo.c (syms_of_undo):
10048 * w32.c (globals_of_w32):
10049 * window.c (syms_of_window):
10050 * xdisp.c (syms_of_xdisp):
10051 * xfaces.c (syms_of_xfaces):
10052 * xfns.c (syms_of_xfns):
10053 * xmenu.c (syms_of_xmenu):
10054 * xsettings.c (syms_of_xsettings):
10055 * xterm.c (syms_of_xterm): Use DEFSYM.
10056
10057 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
10058
10059 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
10060
10061 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
10062
10063 Integer and buffer overflow fixes (Bug#8873).
10064
10065 * print.c (printchar, strout): Check for string overflow.
10066 (PRINTPREPARE, printchar, strout):
10067 Don't set size unless allocation succeeds.
10068
10069 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
10070 for sizes. Check for string overflow more accurately.
10071 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
10072
10073 * macros.c: Integer and buffer overflow fixes.
10074 * keyboard.h (struct keyboard.kbd_macro_bufsize):
10075 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
10076 Use ptrdiff_t, not int, for sizes.
10077 Don't increment bufsize until after realloc succeeds.
10078 Check for size-calculation overflow.
10079 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
10080
10081 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
10082
10083 * lread.c: Integer overflow fixes.
10084 (read_integer): Radix is now EMACS_INT, not int,
10085 to improve quality of diagnostics for out-of-range radices.
10086 Calculate buffer size correctly for out-of-range radices.
10087 (read1): Check for integer overflow in radices, and in
10088 read-circle numbers.
10089 (read_escape): Avoid int overflow.
10090 (Fload, openp, read_buffer_size, read1)
10091 (substitute_object_recurse, read_vector, read_list, map_obarray):
10092 Use ptrdiff_t, not int, for sizes.
10093 (read1): Use EMACS_INT, not int, for sizes.
10094 Check for size overflow.
10095
10096 * image.c (cache_image): Check for size arithmetic overflow.
10097
10098 * lread.c: Integer overflow issues.
10099 (saved_doc_string_size, saved_doc_string_length)
10100 (prev_saved_doc_string_size, prev_saved_doc_string_length):
10101 Now ptrdiff_t, not int.
10102 (read1): Don't assume doc string length fits in int. Check for
10103 out-of-range doc string lengths.
10104 (read_list): Don't assume file position fits in int.
10105 (read_escape): Check for hex character overflow.
10106
10107 2011-06-22 Leo Liu <sdl.web@gmail.com>
10108
10109 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
10110 Move to minibuffer.el.
10111
10112 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10113
10114 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
10115 The following patches are for when GLYPH_DEBUG && !XASSERT.
10116 * dispextern.h (trace_redisplay_p, dump_glyph_string):
10117 * dispnew.c (flush_stdout):
10118 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
10119 Mark as externally visible.
10120 * dispnew.c (check_window_matrix_pointers): Now static.
10121 * dispnew.c (window_to_frame_vpos):
10122 * xfns.c (unwind_create_frame):
10123 * xterm.c (x_check_font): Remove unused local.
10124 * scroll.c (CHECK_BOUNDS):
10125 * xfaces.c (cache_fache): Rename local to avoid shadowing.
10126 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
10127 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
10128 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
10129 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
10130 Now static.
10131 (debug_method_add): Use va_list and vsprintf rather than relying
10132 on undefined behavior with wrong number of arguments.
10133 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
10134 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
10135 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
10136 since we're not interested in debugging glyphs with old libraries.
10137 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
10138 GCC 4.6.0's static checking.
10139
10140 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10141
10142 Integer overflow and signedness fixes (Bug#8873).
10143 A few related buffer overrun fixes, too.
10144
10145 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
10146
10147 * dispextern.h (struct face.stipple):
10148 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
10149 (x_bitmap_mask, x_allocate_bitmap_record)
10150 (x_create_bitmap_from_data, x_create_bitmap_from_file)
10151 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
10152 (x_create_bitmap_from_xpm_data):
10153 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
10154 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
10155 (.bitmaps_last):
10156 * xfaces.c (load_pixmap):
10157 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
10158 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
10159 (.bitmaps_last, struct x_output.icon_bitmap):
10160 Use ptrdiff_t, not int, for bitmap indexes.
10161 (x_allocate_bitmap_record): Check for size overflow.
10162 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
10163
10164 Use ptrdiff_t, not int, for overlay counts.
10165 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
10166 * editfns.c (overlays_around, get_pos_property):
10167 * textprop.c (get_char_property_and_overlay):
10168 * xdisp.c (next_overlay_change, note_mouse_highlight):
10169 * xfaces.c (face_at_buffer_position):
10170 * buffer.c (OVERLAY_COUNT_MAX): New macro.
10171 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
10172 (Fnext_overlay_change, Fprevious_overlay_change)
10173 (mouse_face_overlay_overlaps, Foverlays_in):
10174 Use ptrdiff_t, not int, for sizes.
10175 (overlays_at, overlays_in): Check for size-calculation overflow.
10176
10177 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
10178
10179 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
10180 (x_session_initialize): Do not assume string length fits in int.
10181
10182 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
10183 This is unlikely, but can occur if DPI is outlandish.
10184
10185 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
10186 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
10187
10188 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
10189 * xrdb.c (magic_file_p, search_magic_path):
10190 Omit last arg SUFFIX; it was always 0. All callers changed.
10191 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
10192
10193 * xfont.c (xfont_match): Avoid need for strlen.
10194
10195 * xfns.c: Don't assume strlen fits in int.
10196 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
10197
10198 * xdisp.c (message_log_check_duplicate): Return intmax_t,
10199 not unsigned long, as we prefer signed integers. All callers changed.
10200 Detect integer overflow in repeat count.
10201 (message_dolog): Don't assume print length fits in 39 bytes.
10202 (display_mode_element): Don't assume strlen fits in int.
10203
10204 * termcap.c: Don't assume sizes fit in int and never overflow.
10205 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
10206 (gobble_line): Check for size-calculation overflow.
10207
10208 * minibuf.c (Fread_buffer):
10209 * lread.c (intern, intern_c_string):
10210 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
10211 Don't assume string length fits in int.
10212
10213 * keyboard.c (parse_tool_bar_item):
10214 * gtkutil.c (style_changed_cb): Avoid need for strlen.
10215
10216 * font.c: Don't assume string length fits in int.
10217 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
10218 Use ptrdiff_t, not int.
10219 (font_intern_prop): Don't assume string length fits in int.
10220 Don't assume integer property fits in fixnum.
10221 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
10222
10223 * filelock.c: Fix some buffer overrun and integer overflow issues.
10224 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
10225 Reformulate so as not to need the command string.
10226 Invoke gzip -cd rather than gunzip, as it's more portable.
10227 (lock_info_type, lock_file_1, lock_file):
10228 Don't assume pid_t and time_t fit in unsigned long.
10229 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
10230 (current_lock_owner): Prefer signed type for sizes.
10231 Use memcpy, not strncpy, where memcpy is what is really wanted.
10232 Don't assume (via atoi) that time_t and pid_t fit in int.
10233 Check for time_t and/or pid_t out of range, e.g., via a network share.
10234 Don't alloca where an auto var works fine.
10235
10236 * fileio.c: Fix some integer overflow issues.
10237 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
10238 Don't assume string length fits in int.
10239 (directory_file_name): Don't assume string length fits in long.
10240 (make_temp_name): Don't assume pid fits in int, or that its print
10241 length is less than 20.
10242
10243 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
10244
10245 * coding.c (make_subsidiaries): Don't assume string length fits in int.
10246
10247 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
10248
10249 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
10250 We prefer signed integers, even for size calculations.
10251
10252 * emacs.c: Don't assume string length fits in 'int'.
10253 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
10254 (main): Don't invoke strlen when not needed.
10255
10256 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
10257 (XD_DEBUG_MESSAGE): Don't waste a byte.
10258
10259 * callproc.c (getenv_internal_1, getenv_internal)
10260 (Fgetenv_internal):
10261 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
10262
10263 * lread.c (invalid_syntax): Omit length argument.
10264 All uses changed. This doesn't fix a bug, but it simplifies the
10265 code away from its former Hollerith-constant appearance, and it's
10266 one less 'int' to worry about when looking at integer-overflow issues.
10267 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
10268
10269 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
10270 This didn't break anything, but it didn't help either.
10271 It's confusing to put a bogus integer in a place where the actual
10272 value does not matter.
10273 (LIST_END_P): Remove unused macro and its bogus comment.
10274 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
10275
10276 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
10277 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
10278 implementation.
10279 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
10280 We prefer signed types, and the value cannot exceed the EMACS_INT
10281 range anyway (because otherwise the length would not be representable).
10282 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
10283 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
10284 This avoids a GCC warning when WIDE_EMACS_INT.
10285
10286 * indent.c (sane_tab_width): New function.
10287 (current_column, scan_for_column, Findent_to, position_indentation)
10288 (compute_motion): Use it. This is just for clarity.
10289 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
10290
10291 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
10292
10293 * lisp.h (lint_assume): New macro.
10294 * composite.c (composition_gstring_put_cache):
10295 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
10296
10297 * editfns.c, insdel.c:
10298 Omit unnecessary forward decls, to simplify future changes.
10299
10300 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
10301
10302 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
10303
10304 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
10305 Use much-faster test for byte-length change.
10306 Don't assume string byte-length fits in 'int'.
10307 Check that character arg fits in 'int'.
10308 (mapcar1): Declare byte as byte, for clarity.
10309
10310 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
10311
10312 * fns.c (concat): Catch string overflow earlier.
10313 Do not rely on integer wraparound.
10314
10315 * dispextern.h (struct it.overlay_strings_charpos)
10316 (struct it.selective): Now EMACS_INT, not int.
10317 * xdisp.c (forward_to_next_line_start)
10318 (back_to_previous_visible_line_start)
10319 (reseat_at_next_visible_line_start, next_element_from_buffer):
10320 Don't arbitrarily truncate the value of 'selective' to int.
10321
10322 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
10323
10324 * composite.c: Don't truncate sizes to 'int'.
10325 (composition_gstring_p, composition_reseat_it)
10326 (composition_adjust_point): Use EMACS_INT, not int.
10327 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
10328 not EMACS_UINT, for indexes.
10329
10330 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
10331
10332 * buffer.c: Include <verify.h>.
10333 (struct sortvec.priority, struct sortstr.priority):
10334 Now EMACS_INT, not int.
10335 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
10336 (struct sortstr.size, record_overlay_string)
10337 (struct sortstrlist.size, struct sortlist.used):
10338 Don't truncate size to int.
10339 (record_overlay_string): Check for size-calculation overflow.
10340 (init_buffer_once): Check at compile-time, not run-time.
10341
10342 2011-06-22 Jim Meyering <meyering@redhat.com>
10343
10344 Don't leak an XBM-image-sized buffer
10345 * image.c (xbm_load): Free the image buffer after using it.
10346
10347 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
10348
10349 Port to Sun C.
10350 * composite.c (find_automatic_composition): Omit needless 'return 0;'
10351 that Sun C diagnosed.
10352 * fns.c (secure_hash): Fix pointer signedness issue.
10353 * intervals.c (static_offset_intervals): New function.
10354 (offset_intervals): Use it.
10355
10356 2011-06-21 Leo Liu <sdl.web@gmail.com>
10357
10358 * deps.mk (fns.o):
10359 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
10360 sha512.h.
10361
10362 * fns.c (secure_hash): Rename from crypto_hash_function and change
10363 the first arg to accept symbols.
10364 (Fsecure_hash): New primitive.
10365 (syms_of_fns): New symbols.
10366
10367 2011-06-20 Deniz Dogan <deniz@dogan.se>
10368
10369 * process.c (Fset_process_buffer): Clarify return value in
10370 docstring.
10371
10372 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
10373
10374 * dispnew.c (add_window_display_history): Use BVAR.
10375
10376 * xdisp.c (debug_method_add): Use BVAR.
10377 (check_window_end, dump_glyph_matrix, dump_glyph)
10378 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10379
10380 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10381 Likewise.
10382
10383 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10384 check till after the cache is created in init_frame_faces.
10385
10386 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
10387
10388 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10389
10390 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
10391
10392 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10393 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10394 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10395
10396 Improve buffer-overflow checking (Bug#8873).
10397 * fileio.c (Finsert_file_contents):
10398 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10399 Remove the old (too-loose) buffer overflow checks.
10400 They weren't needed, since make_gap checks for buffer overflow.
10401 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10402 The old code merely checked for Emacs fixnum overflow, and relied
10403 on undefined (wraparound) behavior. The new code avoids undefined
10404 behavior, and also checks for ptrdiff_t and/or size_t overflow.
10405
10406 * editfns.c (Finsert_char): Don't dump core with very negative counts.
10407 Tune. Don't use wider integers than needed. Don't use alloca.
10408 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
10409
10410 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10411
10412 * insdel.c, lisp.h (buffer_overflow): New function.
10413 (insert_from_buffer_1, replace_range, replace_range_2):
10414 * insdel.c (make_gap_larger):
10415 * editfns.c (Finsert_char):
10416 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10417
10418 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10419
10420 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
10421
10422 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
10423
10424 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10425 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10426
10427 * fileio.c: Don't assume EMACS_INT fits in off_t.
10428 (emacs_lseek): New static function.
10429 (Finsert_file_contents, Fwrite_region): Use it.
10430 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10431
10432 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10433
10434 * fns.c: Don't overflow int when computing a list length.
10435 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10436 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10437 truncation on 64-bit hosts. Check for QUIT every
10438 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10439 faster and is responsive enough.
10440 (Flength): Report an error instead of overflowing an integer.
10441 (Fsafe_length): Return a float if the value is not representable
10442 as a fixnum. This shouldn't happen except in contrived situations.
10443 (Fnthcdr, Fsort): Don't assume list length fits in int.
10444 (Fcopy_sequence): Don't assume vector length fits in int.
10445
10446 * alloc.c: Check that resized vectors' lengths fit in fixnums.
10447 (header_size, word_size): New constants.
10448 (allocate_vectorlike): Don't check size overflow here.
10449 (allocate_vector): Check it here instead, since this is the only
10450 caller of allocate_vectorlike that could cause overflow.
10451 Check that the new vector's length is representable as a fixnum.
10452
10453 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10454 The previous code was bogus. For example, next_almost_prime (32)
10455 returned 39, which is undesirable as it is a multiple of 3; and
10456 next_almost_prime (24) returned 25, which is a multiple of 5 so
10457 why was the code bothering to check for multiples of 7?
10458
10459 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10460
10461 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10462
10463 Variadic C functions now count arguments with ptrdiff_t.
10464 This partly undoes my 2011-03-30 change, which replaced int with size_t.
10465 Back then I didn't know that the Emacs coding style prefers signed int.
10466 Also, in the meantime I found a few more instances where arguments
10467 were being counted with int, which may truncate counts on 64-bit
10468 machines, or EMACS_INT, which may be unnecessarily wide.
10469 * lisp.h (struct Lisp_Subr.function.aMANY)
10470 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10471 Arg counts are now ptrdiff_t, not size_t.
10472 All variadic functions and their callers changed accordingly.
10473 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
10474 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10475 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
10476 * callint.c (Fcall_interactively): Check arg count for overflow,
10477 to avoid potential buffer overrun. Use signed char, not 'int',
10478 for 'varies' array, so that we needn't bother to check its size
10479 calculation for overflow.
10480 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10481 * eval.c (apply_lambda):
10482 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10483 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
10484 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10485
10486 * callint.c (Fcall_interactively): Don't use index var as event count.
10487
10488 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10489 * mem-limits.h (SIZE): Remove; no longer used.
10490
10491 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
10492
10493 Remove unnecessary casts.
10494 * xterm.c (x_term_init):
10495 * xfns.c (x_set_border_pixel):
10496 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10497 These aren't needed now that we assume ANSI C.
10498
10499 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10500 It's more likely to cause problems (due to unsigned overflow)
10501 than to cure them.
10502
10503 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10504
10505 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10506
10507 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10508
10509 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10510
10511 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10512
10513 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10514
10515 GLYPH_CODE_FACE returns EMACS_INT, not int.
10516 * dispextern.h (merge_faces):
10517 * xfaces.c (merge_faces):
10518 * xdisp.c (get_next_display_element, next_element_from_display_vector):
10519 Don't assume EMACS_INT fits in int.
10520
10521 * character.h (CHAR_VALID_P): Remove unused parameter.
10522 * fontset.c, lisp.h, xdisp.c: All uses changed.
10523
10524 * editfns.c (Ftranslate_region_internal): Omit redundant test.
10525
10526 * fns.c (concat): Minor tuning based on overflow analysis.
10527 This doesn't fix any bugs. Use int to hold character, instead
10528 of constantly refetching from Emacs object. Use XFASTINT, not
10529 XINT, for value known to be a character. Don't bother comparing
10530 a single byte to 0400, as it's always less.
10531
10532 * floatfns.c (Fexpt):
10533 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
10534
10535 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
10536 for characters.
10537
10538 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
10539
10540 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
10541 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10542 incorrectly succeed when S was a string, because 4294967386 was
10543 truncated before it was used.
10544
10545 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10546 Otherwise, an out-of-range integer could cause undefined behavior
10547 on a 64-bit host.
10548
10549 * composite.c: Use int, not EMACS_INT, for characters.
10550 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10551 EMACS_INT, for values that are known to be in character range.
10552 This doesn't fix any bugs but is the usual style inside Emacs and
10553 may generate better code on 32-bit machines.
10554
10555 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10556 This is for reasons similar to the recent CHAR_STRING fix.
10557 * charset.c (Fencode_char): Check that character arg is actually
10558 a character. Pass an int to ENCODE_CHAR.
10559 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10560 wider than 'int', as a compile-time check to prevent future regressions
10561 in this area.
10562
10563 * character.c (char_string): Remove unnecessary casts.
10564
10565 Make sure a 64-bit char is never passed to CHAR_STRING.
10566 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10567 by silently ignoring the top 32 bits, allowing some values
10568 that were far too large to be valid characters.
10569 * character.h: Include <verify.h>.
10570 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10571 arguments are no wider than unsigned, as a compile-time check
10572 to prevent future regressions in this area.
10573 * data.c (Faset):
10574 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
10575 (Fsubst_char_in_region):
10576 * fns.c (concat):
10577 * xdisp.c (decode_mode_spec_coding):
10578 Adjust to CHAR_STRING's new requirement.
10579 * editfns.c (Finsert_char, Fsubst_char_in_region):
10580 * fns.c (concat): Check that character args are actually
10581 characters. Without this test, these functions did the wrong
10582 thing with wildly out-of-range values on 64-bit hosts.
10583
10584 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10585 These casts should not be needed on 32-bit hosts, either.
10586 * keyboard.c (read_char):
10587 * lread.c (Fload): Remove casts to unsigned.
10588
10589 * lisp.h (UNSIGNED_CMP): New macro.
10590 This fixes comparison bugs on 64-bit hosts.
10591 (ASCII_CHAR_P): Use it.
10592 * casefiddle.c (casify_object):
10593 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
10594 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10595 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10596 * dispextern.h (FACE_FROM_ID):
10597 * keyboard.c (read_char): Use UNSIGNED_CMP.
10598
10599 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10600 not to EMACS_INT, to avoid GCC warning.
10601
10602 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10603
10604 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10605 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10606 isn't needed on 32-bit machines.
10607
10608 * buffer.c (Fgenerate_new_buffer_name):
10609 Use EMACS_INT for count, not int.
10610 (advance_to_char_boundary): Return EMACS_INT, not int.
10611
10612 * data.c (Qcompiled_function): Now static.
10613
10614 * window.c (window_body_lines): Now static.
10615
10616 * image.c (gif_load): Rename local to avoid shadowing.
10617
10618 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10619 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10620 * alloc.c (make_save_value): Integer argument is now of type
10621 ptrdiff_t, not int.
10622 (mark_object): Use ptrdiff_t, not int.
10623 * lisp.h (pD): New macro.
10624 * print.c (print_object): Use it.
10625
10626 * alloc.c: Use EMACS_INT, not int, to count objects.
10627 (total_conses, total_markers, total_symbols, total_vector_size)
10628 (total_free_conses, total_free_markers, total_free_symbols)
10629 (total_free_floats, total_floats, total_free_intervals)
10630 (total_intervals, total_strings, total_free_strings):
10631 Now EMACS_INT, not int. All uses changed.
10632 (Fgarbage_collect): Compute overall total using a double, so that
10633 integer overflow is less likely to be a problem. Check for overflow
10634 when converting back to an integer.
10635 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10636 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10637 These were 'int' variables that could overflow on 64-bit hosts;
10638 they were never used, so remove them instead of repairing them.
10639 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
10640 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10641 Previously, this ceilinged at INT_MAX, but that doesn't work on
10642 64-bit machines.
10643 (allocate_pseudovector): Don't use EMACS_INT when int would do.
10644
10645 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
10646 (allocate_vectorlike): Check for ptrdiff_t overflow.
10647 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10648 when a (possibly-narrower) signed value would do just as well.
10649 We prefer using signed arithmetic, to avoid comparison confusion.
10650
10651 * alloc.c: Catch some string size overflows that we were missing.
10652 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10653 for convenience in STRING_BYTES_MAX.
10654 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10655 The definition here is exact; the one in lisp.h was approximate.
10656 (allocate_string_data): Check for string overflow. This catches
10657 some instances we weren't catching before. Also, it catches
10658 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10659 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10660 and ptrdiff_t and EMACS_INT are both 64 bits.
10661
10662 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10663 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
10664 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
10665
10666 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10667
10668 * alloc.c (Fmake_string): Check for out-of-range init.
10669
10670 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10671
10672 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10673
10674 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10675
10676 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10677 xg_get_default_scrollbar_width.
10678
10679 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10680 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10681 (style_changed_cb): Call update_theme_scrollbar_width and call
10682 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10683 all frames (Bug#8505).
10684 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10685 Call gtk_window_set_resizable if HAVE_GTK3.
10686 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10687 and height if HAVE_GTK3 (Bug#8505).
10688 (scroll_bar_width_for_theme): New variable.
10689 (update_theme_scrollbar_width): New function.
10690 (xg_get_default_scrollbar_width): Move code to
10691 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10692 (xg_initialize): Call update_theme_scrollbar_width.
10693
10694 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10695
10696 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10697
10698 2011-06-12 Martin Rudalics <rudalics@gmx.at>
10699
10700 * frame.c (make_frame): Call other_buffer_safely instead of
10701 other_buffer.
10702
10703 * window.c (temp_output_buffer_show): Call display_buffer with
10704 second argument Vtemp_buffer_show_specifiers and reset latter
10705 immediately after the call.
10706 (Vtemp_buffer_show_specifiers): New variable.
10707 (auto_window_vscroll_p, next_screen_context_lines)
10708 (Vscroll_preserve_screen_position): Remove leading asterisks from
10709 doc-strings.
10710
10711 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
10712
10713 Fix minor problems found by GCC 4.6.0 static checking.
10714 * buffer.c (Qclone_number): Remove for now, as it's unused.
10715 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10716 (record_buffer): Remove unused local.
10717 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10718 (set_frame_buffer_list): Remove; unused.
10719 * frame.h (other_visible_frames): Remove decl.
10720 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10721 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10722 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10723 if HAVE_GPM.
10724 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10725 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10726 Define only if HAVE_GPM.
10727 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10728 (update_hints_inhibit): Remove; never set. All uses removed.
10729 * widgetprv.h (emacsFrameClassRec): Remove decl.
10730 * window.c (delete_deletable_window): Now returns void, since it
10731 wasn't returning anything.
10732 (compare_window_configurations): Remove unused locals.
10733 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10734 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
10735 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10736 the same widths as pointers. This follows up on the 2011-05-06 patch.
10737 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10738 * xterm.h: Likewise.
10739 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10740
10741 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
10742
10743 * makefile.w32-in: Update dependencies.
10744 (LISP_H): Add lib/intprops.h.
10745
10746 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10747
10748 * image.c (gif_load): Add animation frame delay to the metadata.
10749 (syms_of_image): Use DEFSYM. New symbol `delay'.
10750
10751 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10752
10753 * window.c (delete_deletable_window): Re-add.
10754 (Fset_window_configuration): Rewrite to handle dead buffers and
10755 consequently deletable windows.
10756 (window_tree, Fwindow_tree): Remove. Supply functionality in
10757 window.el.
10758 (compare_window_configurations): Simplify code.
10759
10760 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10761
10762 * image.c (imagemagick_load_image): Fix type mismatch.
10763 (Fimagemagick_types): Likewise.
10764
10765 * window.h (replace_buffer_in_windows): Declare.
10766
10767 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10768
10769 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
10770 Qclone_number. Remove external declaration of Qdelete_window.
10771 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
10772 code.
10773 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
10774 Run Qbuffer_list_update_hook if allowed.
10775 (Fother_buffer): Rewrite doc-string. Major rewrite for new
10776 buffer list implementation.
10777 (other_buffer_safely): New function.
10778 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
10779 calls to replace_buffer_in_windows and
10780 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
10781 if allowed.
10782 (record_buffer): Inhibit quitting and rewrite using quittable
10783 functions. Run Qbuffer_list_update_hook if allowed.
10784 (Frecord_buffer, Funrecord_buffer): New functions.
10785 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
10786 Move switch-to-buffer to window.el.
10787 (bury-buffer): Move to window.el.
10788 (Vbuffer_list_update_hook): New variable.
10789
10790 * lisp.h (other_buffer_safely): Add prototype in buffer.c
10791 section.
10792
10793 * window.h (resize_frame_windows): Move up in code.
10794 (Fwindow_frame): Remove EXFUN.
10795 (replace_buffer_in_all_windows): Remove prototype.
10796 (replace_buffer_in_windows_safely): Add prototype.
10797
10798 * window.c: Declare Qdelete_window static again. Move down
10799 declaration of select_count.
10800 (Fnext_window, Fprevious_window): Rewrite doc-strings.
10801 (Fother_window): Move to window.el.
10802 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
10803 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
10804 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
10805 window.el.
10806 (replace_buffer_in_windows): Implement by calling
10807 Qreplace_buffer_in_windows.
10808 (replace_buffer_in_all_windows): Remove with some functionality
10809 moved into replace_buffer_in_windows_safely.
10810 (replace_buffer_in_windows_safely): New function.
10811 (select_window_norecord, select_frame_norecord): Move in front
10812 of run_window_configuration_change_hook. Remove now obsolete
10813 declarations.
10814 (Fset_window_buffer): Rewrite doc-string.
10815 Call Qrecord_window_buffer.
10816 (keys_of_window): Move binding for other-window to window.el.
10817
10818 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10819
10820 * dispextern.h (struct image): Replace data member, whose int_val
10821 and ptr_val fields were not used by anything, with a single
10822 lisp_val object.
10823
10824 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
10825 (gif_clear_image, gif_load, imagemagick_load_image)
10826 (gs_clear_image, gs_load): Callers changed.
10827
10828 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
10829
10830 * buffer.h: Include <time.h>, for time_t.
10831 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
10832
10833 Fix minor problems found by static checking.
10834
10835 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
10836
10837 Make identifiers static if they are not used in other modules.
10838 * data.c (Qcompiled_function, Qframe, Qvector):
10839 * image.c (QimageMagick, Qsvg):
10840 * minibuf.c (Qmetadata):
10841 * window.c (resize_window_check, resize_root_window): Now static.
10842 * window.h (resize_window_check, resize_root_window): Remove decls.
10843
10844 * window.c (window_deletion_count, delete_deletable_window):
10845 Remove; unused.
10846 (window_body_lines): Now static.
10847 (Fdelete_other_windows_internal): Mark vars as initialized.
10848 Make sure 'resize_failed' is initialized.
10849 (run_window_configuration_change_hook): Rename local to avoid shadowing.
10850 (resize_window_apply): Remove unused local.
10851 * window.h (delete_deletable_window): Remove decl.
10852
10853 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
10854 (imagemagick_load_image): Fix pointer signedness problem by changing
10855 last arg from unsigned char * to char *. All uses changed.
10856 Also, fix a local for similar reasons.
10857 Remove unused locals. Remove locals to avoid shadowing.
10858 (fn_rsvg_handle_free): Remove; unused.
10859 (svg_load, svg_load_image): Fix pointer signedness problem.
10860 (imagemagick_load_image): Don't use garbage pointer image_wand.
10861
10862 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
10863
10864 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
10865
10866 * image.c (gif_load): Fix omitted cast error introduced by
10867 2011-06-06 change.
10868
10869 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10870
10871 * window.h (resize_proportionally, orig_total_lines)
10872 (orig_top_line): Remove from window structure.
10873 (set_window_height, set_window_width, change_window_heights)
10874 (Fdelete_window): Remove prototypes.
10875 (resize_frame_windows): Remove duplicate declaration.
10876
10877 2011-06-10 Eli Zaretskii <eliz@gnu.org>
10878
10879 * window.h (resize_frame_windows, resize_window_check)
10880 (delete_deletable_window, resize_root_window)
10881 (resize_frame_windows): Declare prototypes.
10882
10883 * window.c (resize_window_apply): Make definition be "static" to
10884 match the prototype.
10885
10886 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10887
10888 * window.c: Remove declarations of Qwindow_size_fixed,
10889 window_min_size_1, window_min_size_2, window_min_size,
10890 size_window, window_fixed_size_p, enlarge_window, delete_window.
10891 Remove static from declaration of Qdelete_window, it's
10892 temporarily needed by Fbury_buffer.
10893 (replace_window): Don't assign orig_top_line and
10894 orig_total_lines.
10895 (Fdelete_window, delete_window): Remove. Window deletion is
10896 handled by window.el.
10897 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10898 Replace Fdelete_window calls with calls to Qdelete_window.
10899 (Fdelete_other_windows): Remove. Deleting other windows is
10900 handled by window.el.
10901 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10902 handled in window.el.
10903 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10904 Window minimum sizes are handled in window.el.
10905 (shrink_windows, size_window, set_window_height)
10906 (set_window_width, change_window_heights, window_height)
10907 (window_width, CURBEG, CURSIZE, enlarge_window)
10908 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10909 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10910 handled in window.el.
10911 (make_dummy_parent): Rename to make_parent_window and give it a
10912 second argument horflag.
10913 (make_window): Don't set resize_proportionally any more.
10914 (Fsplit_window): Remove. Windows are split in window.el.
10915 (save_restore_action, save_restore_orig_size)
10916 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10917 Resize mini windows in window.el.
10918 (grow_mini_window, shrink_mini_window): Implement by calling
10919 Qresize_root_window_vertically, resize_window_check and
10920 resize_window_apply.
10921 (saved_window, Fset_window_configuration, save_window_save):
10922 Do not handle orig_top_line, orig_total_lines, and
10923 resize_proportionally.
10924 (window_min_height, window_min_width): Move to window.el.
10925 (keys_of_window): Move bindings for delete-other-windows,
10926 split-window, delete-window and enlarge-window to window.el.
10927
10928 * buffer.c: Temporarily extern Qdelete_window.
10929 (Fbury_buffer): Temporarily call Qdelete_window instead of
10930 Fdelete_window (Fbury_buffer will move to window.el soon).
10931
10932 * frame.c (set_menu_bar_lines_1): Remove code handling
10933 orig_top_line and orig_total_lines.
10934
10935 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10936 set_window_height but set heights directly.
10937 (change_frame_size_1): Use resize_frame_windows.
10938
10939 * xdisp.c (init_xdisp): Don't use set_window_height but set
10940 heights directly.
10941
10942 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10943 Use resize_frame_windows instead of change_window_heights and run
10944 run_window_configuration_change_hook.
10945
10946 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10947 instead of change_window_heights and run
10948 run_window_configuration_change_hook.
10949
10950 2011-06-09 Martin Rudalics <rudalics@gmx.at>
10951
10952 * window.c (replace_window): Rename second argument REPLACEMENT to
10953 NEW. New third argument SETFLAG. Rewrite.
10954 (delete_window, make_dummy_parent): Call replace_window with
10955 third argument 1.
10956 (window_list_1): Move down in code.
10957 (run_window_configuration_change_hook): Move set_buffer part
10958 before select_frame_norecord part in order to unwind correctly.
10959 Rename count1 to count.
10960 (recombine_windows, delete_deletable_window, resize_root_window)
10961 (Fdelete_other_windows_internal)
10962 (Frun_window_configuration_change_hook, make_parent_window)
10963 (resize_window_check, resize_window_apply, Fresize_window_apply)
10964 (resize_frame_windows, Fsplit_window_internal)
10965 (Fdelete_window_internal, Fresize_mini_window_internal):
10966 New functions.
10967 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10968
10969 2011-06-08 Martin Rudalics <rudalics@gmx.at>
10970
10971 * window.h (window): Add some new members to window structure -
10972 normal_lines, normal_cols, new_total, new_normal, clone_number,
10973 splits, nest, prev_buffers, next_buffers.
10974 (WINDOW_TOTAL_SIZE): Move here from window.c.
10975 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
10976
10977 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10978 Remove.
10979 (make_dummy_parent): Set new members of windows structure.
10980 (make_window): Move down in code. Handle new members of window
10981 structure.
10982 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10983 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10984 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10985 (Fset_window_prev_buffers, Fwindow_next_buffers)
10986 (Fset_window_next_buffers, Fset_window_clone_number):
10987 New functions.
10988 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10989 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10990 Doc-string fixes.
10991 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10992 Argument WINDOW can be now internal window too.
10993 (Fwindow_use_time): Move up in code.
10994 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
10995 Rewrite doc-string.
10996 (Fset_window_configuration, saved_window)
10997 (Fcurrent_window_configuration, save_window_save): Handle new
10998 members of window structure.
10999 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
11000 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
11001 (syms_of_window): New Lisp objects Qrecord_window_buffer,
11002 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
11003 Qget_mru_window, Qresize_root_window,
11004 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
11005 Qauto_buffer_name; staticpro them.
11006
11007 2011-06-07 Martin Rudalics <rudalics@gmx.at>
11008
11009 * window.c (Fwindow_total_size, Fwindow_left_column)
11010 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
11011 (Fwindow_list_1): New functions.
11012 (window_box_text_cols): Replace with window_body_cols.
11013 (Fwindow_width, Fscroll_left, Fscroll_right):
11014 Use window_body_cols instead of window_box_text_cols.
11015 (delete_window, Fset_window_configuration):
11016 Call delete_all_subwindows with window as argument.
11017 (delete_all_subwindows): Take a window as argument and not a
11018 structure. Rewrite.
11019 (window_loop): Remove handling of GET_LRU_WINDOW and
11020 GET_LARGEST_WINDOW.
11021 (Fget_lru_window, Fget_largest_window): Move to window.el.
11022
11023 * window.h: Extern window_body_cols instead of
11024 window_box_text_cols. delete_all_subwindows now takes a
11025 Lisp_Object as argument.
11026
11027 * indent.c (compute_motion, Fcompute_motion):
11028 Use window_body_cols instead of window_box_text_cols.
11029
11030 * frame.c (delete_frame): Call delete_all_subwindows with root
11031 window as argument.
11032
11033 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
11034
11035 * fns.c (Fputhash): Document return value.
11036
11037 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
11038
11039 * image.c (gif_load): Implement gif89a spec "no disposal" method.
11040
11041 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11042
11043 Cons<->int and similar integer overflow fixes (Bug#8794).
11044
11045 Check for overflow when converting integer to cons and back.
11046 * charset.c (Fdefine_charset_internal, Fdecode_char):
11047 Use cons_to_unsigned to catch overflow.
11048 (Fencode_char): Use INTEGER_TO_CONS.
11049 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
11050 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
11051 * data.c (long_to_cons, cons_to_long): Remove.
11052 (cons_to_unsigned, cons_to_signed): New functions.
11053 These signal an error for invalid or out-of-range values.
11054 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
11055 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
11056 * font.c (Ffont_variation_glyphs):
11057 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
11058 * lisp.h: Include <intprops.h>.
11059 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
11060 (cons_to_signed, cons_to_unsigned): New decls.
11061 (long_to_cons, cons_to_long): Remove decls.
11062 * undo.c (record_first_change): Use INTEGER_TO_CONS.
11063 (Fprimitive_undo): Use CONS_TO_INTEGER.
11064 * xfns.c (Fx_window_property): Likewise.
11065 * xselect.c: Include <limits.h>.
11066 (x_own_selection, selection_data_to_lisp_data):
11067 Use INTEGER_TO_CONS.
11068 (x_handle_selection_request, x_handle_selection_clear)
11069 (x_get_foreign_selection, Fx_disown_selection_internal)
11070 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
11071 (lisp_data_to_selection_data): Use cons_to_unsigned.
11072 (x_fill_property_data): Use cons_to_signed.
11073 Report values out of range.
11074
11075 Check for buffer and string overflow more precisely.
11076 * buffer.h (BUF_BYTES_MAX): New macro.
11077 * lisp.h (STRING_BYTES_MAX): New macro.
11078 * alloc.c (Fmake_string):
11079 * character.c (string_escape_byte8):
11080 * coding.c (coding_alloc_by_realloc):
11081 * doprnt.c (doprnt):
11082 * editfns.c (Fformat):
11083 * eval.c (verror):
11084 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
11085 since they may not be the same number.
11086 * editfns.c (Finsert_char):
11087 * fileio.c (Finsert_file_contents):
11088 Likewise for BUF_BYTES_MAX.
11089
11090 * image.c: Use ptrdiff_t, not int, for sizes.
11091 (slurp_file): Switch from int to ptrdiff_t.
11092 All uses changed.
11093 (slurp_file): Check that file size fits in both size_t (for
11094 malloc) and ptrdiff_t (for sanity and safety).
11095
11096 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
11097 if b->modtime has its maximal value.
11098
11099 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
11100
11101 Don't assume time_t can fit into int.
11102 * buffer.h (struct buffer.modtime): Now time_t, not int.
11103 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
11104 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
11105
11106 Minor fixes for signed vs unsigned integers.
11107 * character.h (MAYBE_UNIFY_CHAR):
11108 * charset.c (maybe_unify_char):
11109 * keyboard.c (read_char, reorder_modifiers):
11110 XINT -> XFASTINT, since the integer must be nonnegative.
11111 * ftfont.c (ftfont_spec_pattern):
11112 * keymap.c (access_keymap, silly_event_symbol_error):
11113 XUINT -> XFASTINT, since the integer must be nonnegative.
11114 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
11115 since it makes no difference and we prefer signed.
11116 * keyboard.c (record_char): Use XUINT when all the neighbors do.
11117 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
11118 nonnegative.
11119
11120 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
11121
11122 * window.h (Fwindow_frame): Declare.
11123
11124 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11125
11126 * alloc.c: Simplify handling of large-request failures (Bug#8800).
11127 (SPARE_MEMORY): Always define.
11128 (LARGE_REQUEST): Remove.
11129 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
11130
11131 2011-06-06 Martin Rudalics <rudalics@gmx.at>
11132
11133 * lisp.h: Move EXFUNS for Fframe_root_window,
11134 Fframe_first_window and Fset_frame_selected_window to window.h.
11135
11136 * window.h: Move EXFUNS for Fframe_root_window,
11137 Fframe_first_window and Fset_frame_selected_window here from
11138 lisp.h.
11139
11140 * frame.c (Fwindow_frame, Fframe_first_window)
11141 (Fframe_root_window, Fframe_selected_window)
11142 (Fset_frame_selected_window): Move to window.c.
11143 (Factive_minibuffer_window): Move to minibuf.c.
11144 (Fother_visible_frames_p): New function.
11145
11146 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
11147
11148 * window.c (decode_window, decode_any_window): Move up in code.
11149 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
11150 (inhibit_frame_unsplittable): Remove unused variable.
11151 (Fwindow_buffer): Move up and rewrite doc-string.
11152 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
11153 (Fwindow_prev): New functions.
11154 (Fwindow_frame): Move here from frame.c. Accept any window as
11155 argument.
11156 (Fframe_root_window, Fframe_first_window)
11157 (Fframe_selected_window): Move here from frame.c. Accept frame
11158 or arbitrary window as argument. Update doc-strings.
11159 (Fminibuffer_window): Move up in code.
11160 (Fwindow_minibuffer_p): Move up in code and simplify.
11161 (Fset_frame_selected_window): Move here from frame.c.
11162 Marginal rewrite.
11163 (Fselected_window, select_window, Fselect_window): Move up in
11164 code. Minor doc-string fixes.
11165
11166 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11167
11168 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
11169 Do not assume that spare memory exists; that assumption is valid
11170 only if SYSTEM_MALLOC.
11171 (LARGE_REQUEST): New macro, so that the issue of large requests
11172 is separated from the issue of spare memory.
11173
11174 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
11175
11176 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
11177 format. (Bug#8806)
11178
11179 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
11180
11181 * xfns.c (x_set_scroll_bar_default_width): Move declarations
11182 before statements.
11183
11184 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
11185
11186 * gtkutil.c (xg_get_default_scrollbar_width): New function.
11187
11188 * gtkutil.h: Declare xg_get_default_scrollbar_width.
11189
11190 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
11191 min width by calling x_set_scroll_bar_default_width (Bug#8505).
11192
11193 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
11194
11195 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
11196
11197 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
11198
11199 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
11200 (x_clipboard_manager_save): Add return value.
11201 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
11202 New error handlers.
11203 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
11204 Obey Vx_select_enable_clipboard_manager. Catch errors in
11205 x_clipboard_manager_save (Bug#8779).
11206 (Vx_select_enable_clipboard_manager): New variable.
11207 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
11208
11209 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
11210
11211 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
11212
11213 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11214
11215 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
11216 in the current matrix if keep_current_p is non-zero.
11217
11218 2011-06-04 Eli Zaretskii <eliz@gnu.org>
11219
11220 * bidi.c (bidi_level_of_next_char): Fix last change.
11221
11222 2011-06-03 Eli Zaretskii <eliz@gnu.org>
11223
11224 Support bidi reordering of text covered by display properties.
11225
11226 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
11227 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
11228 (bidi_cache_search, bidi_cache_iterator_state)
11229 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11230 (bidi_level_of_next_char, bidi_move_to_visually_next):
11231 Support character positions inside a run of characters covered by a
11232 display string.
11233 (bidi_paragraph_init, bidi_resolve_explicit_1)
11234 (bidi_level_of_next_char): Call bidi_fetch_char and
11235 bidi_fetch_char_advance instead of FETCH_CHAR and
11236 FETCH_CHAR_ADVANCE.
11237 (bidi_init_it): Initialize new members.
11238 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
11239 definitions.
11240 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
11241 instead of using explicit *_CHAR codes.
11242 (bidi_resolve_explicit, bidi_resolve_weak):
11243 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
11244 bidirectional text is supported only in multibyte buffers.
11245 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
11246 it to initialize the frame_window_p member of struct bidi_it.
11247 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
11248 (bidi_resolve_explicit, bidi_resolve_weak)
11249 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
11250 bidi_it->nchars is non-positive.
11251 (bidi_level_of_next_char): Don't try to lookup the cache for the
11252 next/previous character if nothing is cached there yet, or if we
11253 were just reseat()'ed to a new position.
11254
11255 * xdisp.c (set_cursor_from_row): Set start and stop points
11256 according to the row's direction when priming the loop that looks
11257 for the glyph on which to display cursor.
11258 (single_display_spec_intangible_p): Function deleted.
11259 (display_prop_intangible_p): Reimplement to call
11260 handle_display_spec instead of single_display_spec_intangible_p.
11261 Accept 3 additional arguments needed by handle_display_spec.
11262 This fixes incorrect cursor motion across display property with complex
11263 values: lists, `(when COND...)' forms, etc.
11264 (single_display_spec_string_p): Support property values that are
11265 lists with the argument STRING its top-level element.
11266 (display_prop_string_p): Fix the condition for processing a
11267 property that is a list to be consistent with handle_display_spec.
11268 (handle_display_spec): New function, refactored from the
11269 last portion of handle_display_prop.
11270 (compute_display_string_pos): Accept additional argument
11271 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
11272 value of a `display' property is a "replacing spec".
11273 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
11274 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
11275 the display property, but just return a value indicating whether
11276 the display property will replace the characters it covers.
11277 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
11278 frame_window_p members of struct bidi_it.
11279 (compute_display_string_pos, compute_display_string_end):
11280 New functions.
11281 (push_it): Accept second argument POSITION, where pop_it should
11282 jump to continue iteration.
11283 (reseat_1): Initialize bidi_it.disp_pos.
11284
11285 * keyboard.c (adjust_point_for_property): Adjust the call to
11286 display_prop_intangible_p to its new signature.
11287
11288 * dispextern.h (struct bidi_it): New member frame_window_p.
11289 (bidi_init_it): Update prototypes.
11290 (display_prop_intangible_p): Update prototype.
11291 (compute_display_string_pos, compute_display_string_end):
11292 Declare prototypes.
11293 (struct bidi_it): New members nchars and disp_pos. ch_len is now
11294 EMACS_INT.
11295
11296 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
11297
11298 Malloc failure behavior now depends on size of allocation.
11299 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
11300 * lisp.h: Change signatures accordingly.
11301 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
11302 All callers changed. (Bug#8762)
11303
11304 * gnutls.c: Use Emacs's memory allocators.
11305 Without this change, the gnutls library would invoke malloc etc.
11306 directly, which causes problems on non-SYNC_INPUT hosts, and which
11307 runs afoul of improving memory_full behavior. (Bug#8761)
11308 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
11309 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
11310 xfree instead of the default malloc, realloc, free.
11311 (Fgnutls_boot): No need to check for memory allocation failure,
11312 since xmalloc does that for us.
11313
11314 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
11315 * category.c (hash_get_category_set):
11316 * ccl.c (ccl_driver):
11317 * charset.c (Fdefine_charset_internal):
11318 * charset.h (struct charset.hash_index):
11319 * composite.c (get_composition_id, gstring_lookup_cache)
11320 (composition_gstring_put_cache):
11321 * composite.h (struct composition.hash_index):
11322 * dispextern.h (struct image.hash):
11323 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
11324 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
11325 (hashfn_equal, hashfn_user_defined, make_hash_table)
11326 (maybe_resize_hash_table, hash_lookup, hash_put)
11327 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
11328 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
11329 (Fsxhash, Fgethash, Fputhash, Fmaphash):
11330 * image.c (make_image, search_image_cache, lookup_image)
11331 (xpm_put_color_table_h):
11332 * lisp.h (struct Lisp_Hash_Table):
11333 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
11334 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
11335 for hashes and hash indexes, instead of 'unsigned' and 'int'.
11336 * alloc.c (allocate_vectorlike):
11337 Check for overflow in vector size calculations.
11338 * ccl.c (ccl_driver):
11339 Check for overflow when converting EMACS_INT to int.
11340 * fns.c, image.c: Remove unnecessary static decls that would otherwise
11341 need to be updated by these changes.
11342 * fns.c (make_hash_table, maybe_resize_hash_table):
11343 Check for integer overflow with large hash tables.
11344 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
11345 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
11346 (SXHASH_REDUCE): New macro.
11347 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
11348 Use it instead of discarding useful hash info with large hash values.
11349 (sxhash_float): New function.
11350 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
11351 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
11352 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
11353 Rewrite to use FIXNUM_BITS, as this simplifies things.
11354 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
11355 Adjust signatures to match updated version of code.
11356 (consing_since_gc): Now EMACS_INT, since a single hash table can
11357 use more than INT_MAX bytes.
11358
11359 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
11360
11361 Make it possible to build with GCC-4.6+ -O2 -flto.
11362
11363 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
11364
11365 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
11366
11367 * minibuf.c (get_minibuffer, read_minibuf_unwind):
11368 Call minibuffer-inactive-mode.
11369
11370 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
11371
11372 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
11373 Update dependencies.
11374
11375 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11376
11377 * data.c (init_data): Remove code for UTS, this system is not
11378 supported anymore.
11379
11380 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11381
11382 Don't force ./temacs to start in terminal mode.
11383
11384 * frame.c (make_initial_frame): Initialize faces in all cases, not
11385 only when CANNOT_DUMP is defined.
11386 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11387
11388 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11389
11390 * dispnew.c (add_window_display_history): Use const for the string
11391 pointer. Remove declaration, not needed.
11392
11393 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11394
11395 Use 'inline', not 'INLINE'.
11396 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
11397 * alloc.c, fontset.c (INLINE): Remove.
11398 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11399 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11400 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11401 * gmalloc.c (register_heapinfo): Use inline unconditionally.
11402 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11403
11404 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11405
11406 Make it possible to run ./temacs.
11407
11408 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11409 syms_of_callproc does the same thing. Remove test for
11410 "initialized", do it in the caller.
11411 * emacs.c (main): Avoid calling set_initial_environment when dumping.
11412
11413 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
11414
11415 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11416 (read_minibuf): Use get_minibuffer.
11417 (syms_of_minibuf): Use DEFSYM.
11418 (Qmetadata): New var.
11419 * data.c (Qbuffer): Don't make it static.
11420 (syms_of_data): Use DEFSYM.
11421
11422 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11423
11424 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
11425 (CCL_CODE_MIN): New macro.
11426
11427 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
11428
11429 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11430
11431 * eval.c (Qdebug): Now static.
11432 * lisp.h (Qdebug): Remove decl. This reverts a part of the
11433 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11434 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11435
11436 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11437
11438 * image.c: Various fixes to ImageMagick code comments.
11439 (Fimagemagick_types): Doc fix.
11440
11441 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
11442
11443 Minor fixes prompted by GCC 4.6.0 warnings.
11444
11445 * xselect.c (converted_selections, conversion_fail_tag): Now static.
11446
11447 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11448 (x_clipboard_manager_save_all): Move extern decl to ...
11449 * xterm.h: ... here, so that it can be checked for consistency.
11450
11451 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11452
11453 * xselect.c (x_clipboard_manager_save_frame)
11454 (x_clipboard_manager_save_all): New functions.
11455 (Fx_clipboard_manager_save): Lisp function deleted.
11456
11457 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11458 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11459
11460 * xterm.h: Update prototype.
11461
11462 2011-05-28 William Xu <william.xwl@gmail.com>
11463
11464 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11465 exiting (Bug#8239).
11466
11467 2011-05-28 Jim Meyering <meyering@redhat.com>
11468
11469 Avoid a sign-extension bug in crypto_hash_function.
11470 * fns.c (to_uchar): Define.
11471 (crypto_hash_function): Use it to convert some newly-signed
11472 variables to unsigned, to avoid sign-extension bugs. For example,
11473 without this change, (md5 "truc") would evaluate to
11474 45723a2aff78ff4fff7fff1114760e62 rather than the expected
11475 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
11476 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
11477
11478 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11479
11480 Integer overflow fixes.
11481
11482 * dbusbind.c: Serial number integer overflow fixes.
11483 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
11484 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11485 to hold a serial number that is too large for a fixnum.
11486 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11487 Check for serial numbers out of range. Decode any serial number
11488 that was so large that it became a float. (Bug#8722)
11489
11490 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11491 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11492 Use XFASTINT rather than XUINT when numbers are nonnegative.
11493 (xd_append_arg, Fdbus_method_return_internal):
11494 (Fdbus_method_error_internal): Likewise. Also, for unsigned
11495 arguments, check that Lisp number is nonnegative, rather than
11496 silently wrapping negative numbers around. (Bug#8722)
11497 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
11498 (Bug#8722)
11499
11500 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11501
11502 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11503
11504 ccl: Add integer overflow checks.
11505 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11506 (IN_INT_RANGE): New macros.
11507 (ccl_driver): Use them to check for integer overflow when
11508 decoding a CCL program. Many of the new checks are whether XINT (x)
11509 fits in int; it doesn't always, on 64-bit hosts. The new version
11510 doesn't catch all possible integer overflows, but it's an
11511 improvement. (Bug#8719)
11512
11513 * alloc.c (make_event_array): Use XINT, not XUINT.
11514 There's no need for unsigned here.
11515
11516 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11517 This follows up to the 2011-05-06 change that substituted uintptr_t
11518 for EMACS_INT. This case wasn't caught back then.
11519
11520 Rework Fformat to avoid integer overflow issues.
11521 * editfns.c: Include <float.h> unconditionally, as it's everywhere
11522 now (part of C89). Include <verify.h>.
11523 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
11524 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
11525 (Fformat): Avoid the prepass trying to compute sizes; it was only
11526 approximate and thus did not catch overflow reliably. Instead, walk
11527 through the format just once, formatting and computing sizes as we go,
11528 checking for integer overflow at every step, and allocating a larger
11529 buffer as needed. Keep track separately whether the format is
11530 multibyte. Keep only the most-recently calculated precision, rather
11531 than them all. Record whether each argument has been converted to
11532 string. Use EMACS_INT, not int, for byte and char and arg counts.
11533 Support field widths and precisions larger than INT_MAX. Avoid
11534 sprintf's undefined behavior with conversion specifications such as %#d
11535 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
11536 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
11537 formatting out-of-range floating point numbers with int
11538 formats. (Bug#8668)
11539
11540 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
11541
11542 * data.c: Avoid integer truncation in expressions involving floats.
11543 * data.c: Include <intprops.h>.
11544 (arith_driver): When there's an integer overflow in an expression
11545 involving floating point, convert the integers to floating point
11546 so that the resulting value does not suffer from catastrophic
11547 integer truncation. For example, on a 64-bit host (* 4
11548 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11549 Do not rely on undefined behavior after integer overflow.
11550
11551 merge count_size_as_multibyte, parse_str_to_multibyte
11552 * character.c, character.h (count_size_as_multibyte):
11553 Rename from parse_str_to_multibyte; all uses changed.
11554 Check for integer overflow.
11555 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11556 since it's now a duplicate of the other. This is more of
11557 a character than a buffer op, so better that it's in character.c.
11558 * fns.c, print.c: Adjust to above changes.
11559
11560 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11561
11562 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11563
11564 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11565
11566 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11567 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11568 (x_clipboard_manager_save): Now static.
11569 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11570
11571 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11572 (crypto_hash_function): Now static.
11573 Fix pointer signedness problems. Avoid unnecessary initializations.
11574
11575 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
11576
11577 * termhooks.h (Vselection_alist): Make it terminal-local.
11578
11579 * terminal.c (create_terminal): Initialize it.
11580
11581 * xselect.c: Support for clipboard managers.
11582 (Vselection_alist): Move to termhooks.h as terminal-local var.
11583 (LOCAL_SELECTION): New macro.
11584 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11585 (symbol_to_x_atom): Remove gratuitous arg.
11586 (x_handle_selection_request, lisp_data_to_selection_data)
11587 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
11588 (x_own_selection, x_get_local_selection, x_convert_selection):
11589 New arg, specifying work frame. Use terminal-local Vselection_alist.
11590 (some_frame_on_display): Delete unused function.
11591 (Fx_own_selection_internal, Fx_get_selection_internal)
11592 (Fx_disown_selection_internal, Fx_selection_owner_p)
11593 (Fx_selection_exists_p): New optional frame arg.
11594 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11595 (x_handle_selection_clear): Don't treat other terminals with the
11596 same keyboard specially. Use the terminal-local Vselection_alist.
11597 (x_clear_frame_selections): Use Frun_hook_with_args.
11598
11599 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11600
11601 * xterm.h: Add support for those atoms.
11602
11603 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
11604
11605 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11606 (converted_selections, conversion_fail_tag): New global variables.
11607 (x_selection_request_lisp_error): Free the above.
11608 (x_get_local_selection): Remove unnecessary code.
11609 (x_reply_selection_request): Args changed; handle arbitrary array
11610 of converted selections stored in converted_selections.
11611 Separate the XChangeProperty and SelectionNotify steps.
11612 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11613 (x_convert_selection): New function.
11614 (x_handle_selection_event): Simplify.
11615 (x_get_foreign_selection): Don't ignore incoming requests while
11616 waiting for an answer; this will fail when we implement
11617 SAVE_TARGETS, and seems unnecessary anyway.
11618 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11619 (Vx_sent_selection_functions): Doc fix.
11620
11621 2011-05-26 Leo Liu <sdl.web@gmail.com>
11622
11623 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11624
11625 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11626
11627 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11628
11629 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11630 for fringe update if it has periodic bitmap.
11631 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
11632 and fringe_bitmap_periodic_p.
11633
11634 * fringe.c (get_fringe_bitmap_data): New function.
11635 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11636 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11637 row. Mark glyph row for fringe update if periodicity changed.
11638
11639 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11640 for fringe update unless it has periodic bitmap.
11641
11642 2011-05-25 Kenichi Handa <handa@m17n.org>
11643
11644 * xdisp.c (get_next_display_element): Set correct it->face_id for
11645 a static composition.
11646
11647 2011-05-24 Leo Liu <sdl.web@gmail.com>
11648
11649 * deps.mk (fns.o):
11650 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11651
11652 * fns.c (crypto_hash_function, Fsha1): New function.
11653 (Fmd5): Use crypto_hash_function.
11654 (syms_of_fns): Add Ssha1.
11655
11656 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11657
11658 * gnutls.c: Remove unused macros.
11659 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11660 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11661 Remove macros that are defined and never used.
11662 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11663
11664 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11665
11666 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11667 (Fx_get_selection_internal): Minor cleanup.
11668 (Fx_own_selection_internal): Rename arguments for consistency with
11669 select.el.
11670
11671 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11672
11673 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11674
11675 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11676
11677 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11678
11679 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11680
11681 * dispnew.c (scrolling_window): Don't exclude the case that the
11682 last enabled row in the desired matrix touches the bottom boundary.
11683
11684 2011-05-21 Glenn Morris <rgm@gnu.org>
11685
11686 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
11687 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11688 and add some more files.
11689
11690 2011-05-20 Eli Zaretskii <eliz@gnu.org>
11691
11692 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11693 report_file_error introduced by the change from 2011-05-07.
11694
11695 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11696
11697 * systime.h (Time): Define only if emacs is defined.
11698 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11699 where the include path doesn't have X11/X.h by default. See
11700 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11701
11702 2011-05-20 Kenichi Handa <handa@m17n.org>
11703
11704 * composite.c (find_automatic_composition): Fix previous change.
11705
11706 2011-05-20 Glenn Morris <rgm@gnu.org>
11707
11708 * lisp.mk: New file, split from Makefile.in.
11709 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11710 (shortlisp): Remove.
11711 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11712
11713 2011-05-19 Glenn Morris <rgm@gnu.org>
11714
11715 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11716 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11717 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11718 (lisp): Set the order to that of loadup.el.
11719 (shortlisp): Make it a copy of $lisp.
11720 (SOME_MACHINE_LISP): Remove.
11721 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11722 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11723
11724 2011-05-18 Kenichi Handa <handa@m17n.org>
11725
11726 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11727 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11728 (find_automatic_composition): Mostly rewrite for efficiency.
11729
11730 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
11731
11732 * makefile.w32-in: Update dependencies.
11733
11734 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11735
11736 * menu.c: Include limits.h (fixes the MS-Windows build broken by
11737 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
11738
11739 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
11740
11741 Fix some integer overflow issues, such as string length overflow.
11742
11743 * insdel.c (count_size_as_multibyte): Check for string overflow.
11744
11745 * character.c (lisp_string_width): Check for string overflow.
11746 Use EMACS_INT, not int, for string indexes and lengths; in
11747 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11748 the resulting string length overflows an EMACS_INT; instead,
11749 report a string overflow if no precision given. When checking for
11750 precision exhaustion, use a check that cannot possibly have
11751 integer overflow. (Bug#8675)
11752 * character.h (lisp_string_width): Adjust to new signature.
11753
11754 * alloc.c (string_overflow): New function.
11755 (Fmake_string): Use it. This doesn't change behavior, but saves
11756 a few bytes and will simplify future changes.
11757 * character.c (string_escape_byte8): Likewise.
11758 * lisp.h (string_overflow): New decl.
11759
11760 Fixups, following up to the user-interface timestamp change.
11761 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
11762 for UI timestamps, instead of unsigned long.
11763 * msdos.c (mouse_get_pos): Likewise.
11764 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
11765 * w32gui.h (Time): Define by including "systime.h" rather than by
11766 declaring it ourselves. (Bug#8664)
11767
11768 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
11769 * image.c (clear_image_cache): Likewise.
11770
11771 * term.c (term_mouse_position): Don't assume time_t wraparound.
11772
11773 Be more systematic about user-interface timestamps.
11774 Before, the code sometimes used 'Time', sometimes 'unsigned long',
11775 and sometimes 'EMACS_UINT', to represent these timestamps.
11776 This change causes it to use 'Time' uniformly, as that's what X uses.
11777 This makes the code easier to follow, and makes it easier to catch
11778 integer overflow bugs such as Bug#8664.
11779 * frame.c (Fmouse_position, Fmouse_pixel_position):
11780 Use Time, not unsigned long, for user-interface timestamps.
11781 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
11782 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
11783 * keyboard.h (last_event_timestamp): Likewise.
11784 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
11785 * menu.h (xmenu_show): Likewise.
11786 * term.c (term_mouse_position): Likewise.
11787 * termhooks.h (struct input_event.timestamp): Likewise.
11788 (struct terminal.mouse_position_hook): Likewise.
11789 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
11790 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
11791 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
11792 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
11793 what it was before.
11794 * menu.h, termhooks.h: Include "systime.h", for Time.
11795
11796 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
11797 Don't assume that the difference between two unsigned long values
11798 can fit into an integer. At this point, we know button_down_time
11799 <= event->timestamp, so the difference must be nonnegative, so
11800 there's no need to cast the result if double-click-time is
11801 nonnegative, as it should be; check that it's nonnegative, just in
11802 case. This bug is triggered when events are more than 2**31 ms
11803 apart (about 25 days). (Bug#8664)
11804
11805 * xselect.c (last_event_timestamp): Remove duplicate decl.
11806 (x_own_selection): Remove needless cast to unsigned long.
11807
11808 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
11809 that always fit in int. Use a sentinel instead of a counter, to
11810 avoid a temp and to allay GCC's concerns about possible int overflow.
11811 * frame.h (struct frame): Use int for menu_bar_items_used
11812 instead of EMACS_INT, since it always fits in int.
11813
11814 * menu.c (grow_menu_items): Check for int overflow.
11815
11816 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
11817
11818 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
11819 Before, the code was not consistent. These values cannot exceed
11820 2**31 - 1 so there's no need to make them unsigned.
11821 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
11822 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
11823 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
11824 as modifiers.
11825 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
11826
11827 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
11828 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
11829 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
11830 presumably because the widths might not match.
11831
11832 * window.c (size_window): Avoid needless test at loop start.
11833
11834 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
11835
11836 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
11837
11838 2011-05-12 Drew Adams <drew.adams@oracle.com>
11839
11840 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
11841
11842 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11843
11844 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
11845 `width' to `bar_area_x' and `bar_area_width', respectively.
11846 (x_scroll_run): Take account of fringe background extension.
11847
11848 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
11849 Rename local vars `left' and `width' to `bar_area_x' and
11850 `bar_area_width', respectively.
11851 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
11852 background extension.
11853
11854 2011-05-10 Jim Meyering <meyering@redhat.com>
11855
11856 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
11857
11858 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
11859
11860 * image.c (Finit_image_library): Return t for built-in image types,
11861 like pbm and xbm. (Bug#8640)
11862
11863 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
11864
11865 * w32menu.c (set_frame_menubar): Fix submenu allocation.
11866
11867 2011-05-07 Eli Zaretskii <eliz@gnu.org>
11868
11869 * w32console.c (Fset_screen_color): Doc fix.
11870 (Fget_screen_color): New function.
11871 (syms_of_ntterm): Defsubr it.
11872
11873 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11874 unlink the temporary file if Fcall_process didn't create it in the
11875 first place.
11876 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11877 child process will be redirected to a file specified with `:file'.
11878 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11879 cue to call_process_cleanup not to close that handle.
11880
11881 2011-05-07 Ben Key <bkey76@gmail.com>
11882
11883 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11884 one of two shell specific rules, either bootstrap-temacs-CMD or
11885 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11886 to the previous implementation of the bootstrap-temacs rule.
11887 The bootstrap-temacs-CMD rule is similar to the previous
11888 implementation of the bootstrap-temacs rule except that it
11889 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11890 variable.
11891
11892 These changes, along with some changes to nt/configure.bat,
11893 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11894 earlier fix to add support for --cflags and --ldflags options
11895 that include quotes so that it works whether make uses cmd or
11896 sh as the shell.
11897
11898 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
11899
11900 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11901 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11902 is a constant.
11903 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11904 a string. Handle both cases.
11905 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11906 (Fdbus_register_method): Use Qinvalid_function.
11907
11908 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
11909
11910 * makefile.w32-in: Update dependencies.
11911 (LISP_H): Add inttypes.h and stdin.h.
11912 (PROCESS_H): Add unistd.h.
11913
11914 2011-05-06 Eli Zaretskii <eliz@gnu.org>
11915
11916 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11917 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11918
11919 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
11920
11921 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11922
11923 * term.c (vfatal): Remove stray call to va_end.
11924 It's not needed and the C Standard doesn't allow it here anyway.
11925
11926 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11927 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11928
11929 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11930 bytes.
11931
11932 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11933
11934 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11935
11936 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11937
11938 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11939
11940 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11941
11942 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11943 * charset.c (Fdefine_charset_internal): Don't initialize
11944 charset.code_space[15]. The value was garbage, on hosts with
11945 32-bit int (Bug#8600).
11946
11947 * lread.c (read_integer): Be more consistent with string-to-number.
11948 Use string_to_number to do the actual conversion; this avoids
11949 rounding errors and fixes some other screwups. Without this fix,
11950 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11951 (digit_to_number): Move earlier, for benefit of read_integer.
11952 Return -1 if the digit is out of range for the base, -2 if it is
11953 not a digit in any supported base. (Bug#8602)
11954
11955 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11956
11957 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11958 to match comment at start of function. This also removes a
11959 GCC warning about overflow in a 32+64-bit port.
11960
11961 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11962
11963 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11964 Reported by Stefan Monnier in
11965 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
11966 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11967 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
11968
11969 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11970 (EMACS_UINTPTR): Likewise, with uintptr_t.
11971
11972 * lisp.h: Prefer 64-bit EMACS_INT if available.
11973 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11974 on 32-bit hosts that have 64-bit int, so that they can access
11975 large files.
11976 However, temporarily disable this change unless the temporary
11977 symbol WIDE_EMACS_INT is defined.
11978
11979 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11980
11981 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11982 This removes an assumption that EMACS_INT and long are the same
11983 width as pointers. The assumption is true for Emacs porting targets
11984 now, but we want to make other targets possible.
11985 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11986 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11987 In the rest of the code, change types of integers that hold casted
11988 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11989 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11990 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11991 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11992 No need to cast type when ORing.
11993 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
11994 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
11995 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
11996 assume EMACS_INT is the same width as char *.
11997 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
11998 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
11999 Remove no-longer-needed casts.
12000 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
12001 (xg_tool_bar_help_callback, xg_make_tool_item):
12002 Use EMACS_INTPTR to hold an integer
12003 that will be cast to void *; this can avoid a GCC warning
12004 if EMACS_INT is not the same width as void *.
12005 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
12006 * xdisp.c (display_echo_area_1, resize_mini_window_1):
12007 (current_message_1, set_message_1):
12008 Use a local to convert to proper width without a cast.
12009 * xmenu.c (dialog_selection_callback): Likewise.
12010
12011 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
12012 Also, don't assume VALBITS / RAND_BITS is less than 5,
12013 and don't rely on undefined behavior when shifting a 1 left into
12014 the sign bit.
12015 * lisp.h (get_random): Change signature to match.
12016
12017 * lread.c (hash_string): Use size_t, not int, for hash computation.
12018 Normally we prefer signed values; but hashing is special, because
12019 it's better to use unsigned division on hash table sizes so that
12020 the remainder is nonnegative. Also, size_t is the natural width
12021 for hashing into memory. The previous code used 'int', which doesn't
12022 retain enough info to hash well into very large tables.
12023 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
12024
12025 * dbusbind.c: Don't possibly lose pointer info when converting.
12026 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12027 Use XPNTR rather than XHASH, so that the high-order bits of
12028 the pointer aren't lost when converting through void *.
12029
12030 * eval.c (Fautoload): Don't double-shift a pointer.
12031
12032 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
12033
12034 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
12035
12036 * gnutls.c (DEF_GNUTLS_FN):
12037 * image.c (DEF_IMGLIB_FN): Make function pointers static.
12038
12039 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
12040
12041 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
12042 marker. (Bug#8610)
12043
12044 2011-05-05 Eli Zaretskii <eliz@gnu.org>
12045
12046 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
12047 New version that can reserve upto 2GB of heap space.
12048
12049 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
12050
12051 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
12052
12053 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
12054
12055 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
12056 `gnutls_certificate_set_x509_key_file'.
12057
12058 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
12059
12060 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
12061 Update dependencies.
12062
12063 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12064
12065 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
12066 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12067 Remove unused parameter `fildes'.
12068 * process.c (read_process_output, send_process): Don't pass it.
12069
12070 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12071
12072 Fix previous change: the library cache is defined in w32.c.
12073 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
12074 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
12075
12076 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12077
12078 Implement dynamic loading of GnuTLS on Windows.
12079
12080 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
12081 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
12082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12083 Declare.
12084
12085 * gnutls.c (Qgnutls_dll): Define.
12086 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
12087 (gnutls_*): Declare function pointers.
12088 (init_gnutls_functions): New function to initialize function pointers.
12089 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
12090 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
12091 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12092 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
12093 (emacs_gnutls_write, emacs_gnutls_read)
12094 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
12095 (Fgnutls_available_p): New function.
12096 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
12097 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
12098 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
12099
12100 * image.c: Include w32.h.
12101 (Vimage_type_cache): Delete.
12102 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
12103 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
12104 (w32_delayed_load): Move to w32.c.
12105
12106 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
12107
12108 * w32.c (QCloaded_from, Vlibrary_cache): Define.
12109 (w32_delayed_load): Move from image.c. When loading a library, record
12110 its filename in the :loaded-from property of the library id.
12111 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
12112 Initialize and staticpro them.
12113 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
12114
12115 * process.c: Include lisp.h before w32.h, not after.
12116 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
12117 instead of gnutls_record_check_pending.
12118
12119 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
12120
12121 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
12122
12123 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
12124 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
12125 as passed in.
12126
12127 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
12128
12129 * xterm.c (x_set_frame_alpha): Do not set property on anything
12130 else than FRAME_X_OUTER_WINDOW (Bug#8608).
12131
12132 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12133
12134 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
12135
12136 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12137
12138 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
12139 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
12140 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
12141 (gnutls_global_initialized, Qgnutls_bootprop_priority)
12142 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
12143 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
12144 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
12145 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
12146 (Qgnutls_bootprop_callbacks_verify): Make static.
12147
12148 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
12149
12150 * callproc.c: Indentation fixup.
12151
12152 * sysdep.c (wait_for_termination_1): Make static.
12153 (wait_for_termination, interruptible_wait_for_termination):
12154 Move after wait_for_termination_1.
12155
12156 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
12157
12158 * sysdep.c (interruptible_wait_for_termination): New function
12159 which is like wait_for_termination, but allows keyboard
12160 interruptions.
12161
12162 * callproc.c (Fcall_process): Add (:file "file") as an option for
12163 the STDOUT buffer.
12164 (Fcall_process_region): Ditto.
12165
12166 2011-04-30 Eli Zaretskii <eliz@gnu.org>
12167
12168 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
12169 rather than `XVECTOR (FOO)->size'.
12170
12171 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
12172 inttypes.h, as a gnulib replacement is used if it not available in
12173 system headers.
12174
12175 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12176
12177 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
12178 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
12179 of MOST_POSITIVE_FIXNUM. (Bug#8528)
12180
12181 * coding.c (coding_alloc_by_realloc): Error out if destination
12182 will grow beyond MOST_POSITIVE_FIXNUM.
12183 (decode_coding_emacs_mule): Abort if there isn't enough place in
12184 charbuf for the composition carryover bytes. Reserve an extra
12185 space for up to 2 characters produced in a loop.
12186 (decode_coding_iso_2022): Abort if there isn't enough place in
12187 charbuf for the composition carryover bytes.
12188
12189 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12190
12191 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
12192 aborting when %lld or %lll format is passed.
12193 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
12194 %llo or %llx format is passed. (Bug#8545)
12195
12196 * window.c (window_scroll_line_based): Use a marker instead of
12197 simple variables to record original value of point. (Bug#7952)
12198
12199 * doprnt.c (doprnt): Fix the case where a multibyte sequence
12200 produced by %s or %c overflows available buffer space. (Bug#8545)
12201
12202 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
12203
12204 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
12205 (SIZE_MAX): Move defn after all includes, as they might #define it.
12206
12207 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12208
12209 * w32.c (init_environment): Warn about defaulting HOME to C:\.
12210
12211 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12212
12213 * keyboard.c (Qdelayed_warnings_hook): Define.
12214 (command_loop_1): Run `delayed-warnings-hook'
12215 if Vdelayed_warnings_list is non-nil.
12216 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
12217 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
12218
12219 2011-04-28 Eli Zaretskii <eliz@gnu.org>
12220
12221 * doprnt.c (doprnt): Don't return value smaller than the buffer
12222 size if the message was truncated. (Bug#8545).
12223
12224 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12225
12226 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
12227 (Fx_window_property): #if-0 the whole functions, not just the bodies.
12228
12229 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12230
12231 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
12232
12233 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
12234
12235 * makefile.w32-in: Update dependencies.
12236
12237 2011-04-27 Eli Zaretskii <eliz@gnu.org>
12238
12239 Improve `doprnt' and its usage. (Bug#8545)
12240 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
12241 `format_end'. Remove support for %l as a conversion specifier.
12242 Don't use xrealloc. Improve diagnostics when the %l size modifier
12243 is used. Update the commentary.
12244
12245 * eval.c (verror): Simplify calculation of size_t.
12246
12247 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
12248 messages.
12249
12250 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
12251
12252 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
12253 change.
12254
12255 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
12258 This makes this file independent of the recent pseudovector change.
12259
12260 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
12261
12262 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
12263
12264 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
12265 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
12266 Remove unused local.
12267 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
12268
12269 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
12270 GCC 4.6.0 optimizes based on type-based alias analysis.
12271 For example, if b is of type struct buffer * and v of type struct
12272 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
12273 != &v->size, and therefore "v->size = 1; b->size = 2; return
12274 v->size;" must therefore return 1. This assumption is incorrect
12275 for Emacs, since it type-puns struct Lisp_Vector * with many other
12276 types. To fix this problem, this patch adds a new type struct
12277 vectorlike_header that documents the constraints on layout of vectors
12278 and pseudovectors, and helps optimizing compilers not get fooled
12279 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
12280 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
12281 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
12282 the size member.
12283 (XSETPVECTYPE): Rewrite in terms of new macro.
12284 (XSETPVECTYPESIZE): New macro, specifying both type and size.
12285 This is a bit clearer, and further avoids the possibility of
12286 undesirable aliasing.
12287 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
12288 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
12289 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
12290 since Lisp_Subr is a special case (no "next" field).
12291 (ASIZE): Now uses header.size rather than size.
12292 All previous uses of XVECTOR (foo)->size replaced to use this macro,
12293 to avoid the hassle of writing XVECTOR (foo)->header.size.
12294 (struct vectorlike_header): New type.
12295 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
12296 object, to help avoid aliasing.
12297 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
12298 (SUBRP): Likewise, since Lisp_Subr is a special case.
12299 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
12300 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
12301 (struct Lisp_Hash_Table): Combine first two members into a single
12302 struct vectorlike_header member. All uses of "size" and "next" members
12303 changed to be "header.size" and "header.next".
12304 * buffer.h (struct buffer): Likewise.
12305 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
12306 * frame.h (struct frame): Likewise.
12307 * process.h (struct Lisp_Process): Likewise.
12308 * termhooks.h (struct terminal): Likewise.
12309 * window.c (struct save_window_data, struct saved_window): Likewise.
12310 * window.h (struct window): Likewise.
12311 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
12312 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
12313 * buffer.c (init_buffer_once): Likewise.
12314 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
12315 special case.
12316 * process.c (Fformat_network_address): Use local var for size,
12317 for brevity.
12318
12319 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
12320
12321 Make the Lisp reader and string-to-float more consistent (Bug#8525)
12322 * data.c (atof): Remove decl; no longer used or needed.
12323 (digit_to_number): Move to lread.c.
12324 (Fstring_to_number): Use new string_to_number function, to be
12325 consistent with how the Lisp reader treats infinities and NaNs.
12326 Do not assume that floating-point numbers represent EMACS_INT
12327 without losing information; this is not true on most 64-bit hosts.
12328 Avoid double-rounding errors, by insisting on integers when
12329 parsing non-base-10 numbers, as the documentation specifies.
12330 * lisp.h (string_to_number): New decl, replacing ...
12331 (isfloat_string): Remove.
12332 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
12333 (read1): Do not accept +. and -. as integers; this
12334 appears to have been a coding error. Similarly, do not accept
12335 strings like +-1e0 as floating point numbers. Do not report
12336 overflow for integer overflows unless the base is not 10 which
12337 means we have no simple and reliable way to continue.
12338 Break out the floating-point parsing into a new
12339 function string_to_number, so that Fstring_to_number parses
12340 floating point numbers consistently with the Lisp reader.
12341 (digit_to_number): Move here from data.c. Make it static inline.
12342 (E_CHAR, EXP_INT): Remove, replacing with ...
12343 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
12344 (string_to_number): New function, replacing isfloat_string.
12345 This function checks for valid syntax and produces the resulting
12346 Lisp float number too. Rework it so that string-to-number
12347 no longer mishandles examples like "1.0e+". Use strtoumax,
12348 so that overflow for non-base-10 numbers is reported only when
12349 there's no portable and simple way to convert to floating point.
12350
12351 * textprop.c (set_text_properties_1): Rewrite for clarity,
12352 and to avoid GCC warning about integer overflow.
12353
12354 * intervals.h (struct interval): Use EMACS_INT for members
12355 where EMACS_UINT might cause problems. See
12356 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
12357 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
12358 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
12359 All uses changed.
12360 (offset_intervals): Tell GCC not to worry about length overflow
12361 when negating a negative length.
12362
12363 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
12364 (overrun_check_free): Likewise.
12365
12366 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
12367 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
12368 word size.
12369
12370 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12371 (gnutls_make_error): Rename local to avoid shadowing.
12372 (gnutls_emacs_global_deinit): ifdef out; not used.
12373 (Fgnutls_boot): Use const for pointer to readonly storage.
12374 Comment out unused local. Fix pointer signedness problems.
12375
12376 * lread.c (openp): Don't stuff size_t into an 'int'.
12377 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
12378 about possible signed overflow.
12379
12380 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12381 (GDK_KEY_g): Don't define if already defined.
12382 (xg_prepare_tooltip): Avoid pointer signedness problem.
12383 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12384
12385 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12386 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
12387
12388 * xfns.c (Fx_window_property): Simplify a bit,
12389 to make a bit faster and to avoid GCC 4.6.0 warning.
12390 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12391
12392 * fns.c (internal_equal): Don't assume size_t fits in int.
12393
12394 * alloc.c (compact_small_strings): Tighten assertion a little.
12395
12396 Replace pEd with more-general pI, and fix some printf arg casts.
12397 * lisp.h (pI): New macro, generalizing old pEd macro to other
12398 conversion specifiers. For example, use "...%"pI"d..." rather
12399 than "...%"pEd"...".
12400 (pEd): Remove. All uses replaced with similar uses of pI.
12401 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
12402 * alloc.c (check_pure_size): Don't overflow by converting size to int.
12403 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12404 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12405 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12406 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12407 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12408 64-bit hosts.
12409 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12410 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12411 * print.c (safe_debug_print, print_object): Likewise.
12412 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12413 to int.
12414 Use pI instead of if-then-else-abort. Use %p to avoid casts,
12415 avoiding the 0 flag, which is not portable.
12416 * process.c (Fmake_network_process): Use pI to avoid cast.
12417 * region-cache.c (pp_cache): Likewise.
12418 * xdisp.c (decode_mode_spec): Likewise.
12419 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12420 behavior on 64-bit hosts with printf arg.
12421 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
12422 (x_stop_queuing_selection_requests): Likewise.
12423 (x_get_window_property): Don't truncate byte count to an 'int'
12424 when tracing.
12425
12426 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12427 here, since it parses constructs like leading '-' and spaces,
12428 which are not wanted; and it overflows with large numbers.
12429 Instead, simply match F[0-9]+, which is what is wanted anyway.
12430
12431 * alloc.c: Remove unportable assumptions about struct layout.
12432 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12433 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12434 (allocate_vectorlike, make_pure_vector): Use the new macros,
12435 plus offsetof, to remove unportable assumptions about struct layout.
12436 These assumptions hold on all porting targets that I know of, but
12437 they are not guaranteed, they're easy to remove, and removing them
12438 makes further changes easier.
12439
12440 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12441 This doesn't fix a bug but makes the code clearer.
12442 (string_overrun_cookie): Now const. Use initializers that
12443 don't formally overflow signed char, to avoid warnings.
12444 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12445 can cause Emacs to crash when string overrun checking is enabled.
12446 (allocate_buffer): Don't assume sizeof (struct buffer) is a
12447 multiple of sizeof (EMACS_INT); it need not be, if
12448 alignof(EMACS_INT) < sizeof (EMACS_INT).
12449 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
12450
12451 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
12452
12453 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
12454
12455 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
12456
12457 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
12458 supposed to be handshaking. (Bug#8556)
12459 Reported by Paul Eggert <eggert@cs.ucla.edu>.
12460
12461 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
12462
12463 * lisp.h (Qdebug): List symbol.
12464 * eval.c (Qdebug): Restore global linkage.
12465 * keyboard.c (debug-on-event): New variable.
12466 (handle_user_signal): Break into debugger when debug-on-event
12467 matches the current signal symbol.
12468
12469 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
12470
12471 * alloc.c (check_sblock, check_string_bytes)
12472 (check_string_free_list): Convert to standard C.
12473
12474 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
12475
12476 * w32.c (emacs_gnutls_push): Fix typo.
12477
12478 2011-04-25 Eli Zaretskii <eliz@gnu.org>
12479
12480 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12481 "cast to pointer from integer of different size".
12482
12483 Improve doprnt and its use in verror. (Bug#8545)
12484 * doprnt.c (doprnt): Document the set of format control sequences
12485 supported by the function. Use SAFE_ALLOCA instead of always
12486 using `alloca'.
12487
12488 * eval.c (verror): Don't limit the buffer size at size_max-1, that
12489 is one byte too soon. Don't use xrealloc; instead xfree and
12490 xmalloc anew.
12491
12492 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
12493
12494 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12495 callbacks stage.
12496
12497 * gnutls.c: Renamed global_initialized to
12498 gnutls_global_initialized. Added internals for the
12499 :verify-hostname-error, :verify-error, and :verify-flags
12500 parameters of `gnutls-boot' and documented those parameters in the
12501 docstring. Start callback support.
12502 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
12503 unless a fatal error occurred. Call gnutls_alert_send_appropriate
12504 on error. Return error code.
12505 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12506 (emacs_gnutls_read): Likewise.
12507 (Fgnutls_boot): Return handshake error code.
12508 (emacs_gnutls_handle_error): New function.
12509 (wsaerror_to_errno): Likewise.
12510
12511 * w32.h (emacs_gnutls_pull): Add prototype.
12512 (emacs_gnutls_push): Likewise.
12513
12514 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12515 (emacs_gnutls_push): Likewise.
12516
12517 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
12518
12519 * process.c (wait_reading_process_output): Check if GnuTLS
12520 buffered some data internally if no FDs are set for TLS
12521 connections.
12522
12523 * makefile.w32-in (OBJ2): Add gnutls.$(O).
12524 (LIBS): Link to USER_LIBS.
12525 ($(BLD)/gnutls.$(0)): New target.
12526
12527 2011-04-24 Eli Zaretskii <eliz@gnu.org>
12528
12529 * xdisp.c (handle_single_display_spec): Rename the
12530 display_replaced_before_p argument into display_replaced_p, to
12531 make it consistent with the commentary. Fix typos in the
12532 commentary.
12533
12534 * textprop.c (syms_of_textprop): Remove dead code.
12535 (copy_text_properties): Delete obsolete commentary about an
12536 interface that was deleted long ago. Fix typos in the description
12537 of arguments.
12538
12539 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
12540 to changes in oldXMenu/XMenu.h from 2011-04-16.
12541 <menu_help_message, prev_menu_help_message>: Constify.
12542 (IT_menu_make_room): menu->help_text is now `const char **';
12543 adjust.
12544
12545 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12546 to changes in oldXMenu/XMenu.h from 2011-04-16.
12547 (struct XMenu): Declare `help_text' `const char **'.
12548
12549 * xfaces.c <Qunspecified>: Make extern again.
12550
12551 * syntax.c: Include sys/types.h before including regex.h, as
12552 required by POSIX.
12553
12554 * doc.c (get_doc_string): Improve the format passed to `error'.
12555
12556 * doprnt.c (doprnt): Improve commentary.
12557
12558 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12559
12560 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12561 them with etags.
12562
12563 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12564 changes in globals.h immediately force recompilation.
12565 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12566 $(CURDIR)/s/ms-w32.h.
12567 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
12568
12569 * character.c (Fchar_direction): Function deleted.
12570 (syms_of_character): Don't defsubr it.
12571 <char-direction-table>: Deleted.
12572
12573 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12574
12575 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12576 * doprnt.c: Include limits.h.
12577 (SIZE_MAX): New macro.
12578 (doprnt): Return a size_t value. 2nd arg is now size_t.
12579 Many local variables are now size_t instead of int or unsigned.
12580 Improve overflow protection. Support `l' modifier for integer
12581 conversions. Support %l conversion. Don't assume an EMACS_INT
12582 argument for integer conversions and for %c.
12583
12584 * lisp.h (doprnt): Restore prototype.
12585
12586 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12587 $(SRC)/character.h.
12588
12589 * Makefile.in (base_obj): Add back doprnt.o.
12590
12591 * deps.mk (doprnt.o): Add back prerequisites.
12592 (callint.o): Depend on character.h.
12593
12594 * eval.c (internal_lisp_condition_case): Include the handler
12595 representation in the error message.
12596 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12597 when breaking from the loop.
12598
12599 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12600
12601 * callint.c (Fcall_interactively): When displaying error message
12602 about invalid control letter, pass the character's codepoint, not
12603 a pointer to its multibyte form. Improve display of the character
12604 in octal and display also its hex code.
12605
12606 * character.c (char_string): Use %x to display the (unsigned)
12607 codepoint of an invalid character, to avoid displaying a bogus
12608 negative value.
12609
12610 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12611 `error', not SYMBOL_NAME itself.
12612
12613 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12614 character arguments to `error'.
12615
12616 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12617 to `error' in error message about FINAL_CHAR argument. Make sure
12618 FINAL_CHAR is a character, and use %c when it is passed as
12619 argument to `error'.
12620
12621 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12622
12623 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12624
12625 * w32.c: Include <time.h>.
12626 (sys_localtime): New function.
12627
12628 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
12629
12630 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12631
12632 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
12633
12634 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
12635
12636 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12637 zombies (Bug#8467).
12638
12639 2011-04-19 Eli Zaretskii <eliz@gnu.org>
12640
12641 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12642 gl_state.e_property when gl_state.object is Qt.
12643
12644 * insdel.c (make_gap_larger): Remove limitation of buffer size
12645 to <= INT_MAX.
12646
12647 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
12648
12649 * xdisp.c (lookup_glyphless_char_display)
12650 (produce_glyphless_glyph): Handle cons cell entry in
12651 glyphless-char-display.
12652 (Vglyphless_char_display): Document it.
12653
12654 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12655 glyphless-char-display.
12656
12657 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
12658
12659 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12660
12661 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12662
12663 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12664 definition for no-X builds.
12665
12666 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
12667
12668 Static checks with GCC 4.6.0 and non-default toolkits.
12669
12670 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12671
12672 * process.c (keyboard_bit_set): Define only if SIGIO.
12673 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12674 (send_process): Repair possible setjmp clobbering.
12675
12676 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12677
12678 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12679
12680 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12681
12682 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12683 Define only if needed.
12684
12685 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12686 by pacifying GCC about it. Maybe it's time to retire it?
12687 * xfaces.c (USG, __TIMEVAL__): Likewise.
12688
12689 * dispextern.h (struct redisplay_interface): Rename param
12690 to avoid shadowing.
12691 * termhooks.h (struct terminal): Likewise.
12692 * xterm.c (xembed_send_message): Likewise.
12693
12694 * insdel.c (make_gap_smaller): Define only if
12695 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12696
12697 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12698 it.
12699
12700 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12701 so that we aren't warned about unused symbols.
12702
12703 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12704
12705 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
12706
12707 * xfns.c (x_real_positions): Mark locals as initialized.
12708
12709 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12710
12711 * xterm.c: Fix problems found by static analysis with other toolkits.
12712 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
12713 (x_dispatch_event): Declare static if USE_GTK, and
12714 define if USE_GTK || USE_X_TOOLKIT.
12715 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
12716 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
12717 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12718 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
12719
12720 * xmenu.c (menu_help_callback): Pointer type fixes.
12721 Use const pointers when pointing at readonly data. Avoid pointer
12722 signedness clashes.
12723 (FALSE): Remove unused macro.
12724 (update_frame_menubar): Remove unused decl.
12725
12726 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12727
12728 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12729 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12730 (single_menu_item): Rename local to avoid shadowing.
12731
12732 * keyboard.c (make_lispy_event): Remove unused local var.
12733
12734 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12735 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12736
12737 * bitmaps: Change bitmaps from unsigned char back to the X11
12738 compatible char. Avoid the old compiler warnings about
12739 out-of-range initializers by using, for example, '\xab' rather
12740 than 0xab.
12741
12742 * xgselect.c (xgselect_initialize): Check vs interface
12743 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12744
12745 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12746
12747 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12748 to read-only memory.
12749
12750 * fns.c (vector): Remove; this old hack is no longer needed.
12751
12752 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
12753 Remove unused var.
12754 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
12755
12756 * xrdb.c (x_load_resources): Omit unused local.
12757
12758 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
12759 (x_window): Rename locals to avoid shadowing.
12760 (USG): Use the kludged USG macro, to pacify gcc.
12761
12762 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
12763 (x_term_init): Remove local to avoid shadowing.
12764
12765 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
12766
12767 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
12768 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
12769
12770 2011-04-16 Eli Zaretskii <eliz@gnu.org>
12771
12772 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
12773
12774 Fix regex.c, syntax.c and friends for buffers > 2GB.
12775 * syntax.h (struct gl_state_s): Declare character position members
12776 EMACS_INT.
12777
12778 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
12779
12780 * textprop.c (verify_interval_modification, interval_of):
12781 Declare arguments EMACS_INT.
12782
12783 * intervals.c (adjust_intervals_for_insertion): Declare arguments
12784 EMACS_INT.
12785
12786 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
12787
12788 * indent.c (Fvertical_motion): Local variable it_start is now
12789 EMACS_INT.
12790
12791 * regex.c (re_match, re_match_2, re_match_2_internal)
12792 (bcmp_translate, regcomp, regexec, print_double_string)
12793 (group_in_compile_stack, re_search, re_search_2, regex_compile)
12794 (re_compile_pattern, re_exec): Declare arguments and local
12795 variables `size_t' and `ssize_t' and return values `regoff_t', as
12796 appropriate.
12797 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
12798 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
12799 <compile_stack_type>: `size' and `avail' are now `size_t'.
12800
12801 * regex.h <regoff_t>: Use ssize_t, not int.
12802 (re_search, re_search_2, re_match, re_match_2): Arguments that
12803 specify buffer/string position and length are now ssize_t and
12804 size_t. Return type is regoff_t.
12805
12806 2011-04-16 Ben Key <bkey76@gmail.com>
12807
12808 * nsfont.m: Fixed bugs in ns_get_family and
12809 ns_descriptor_to_entity that were caused by using free to
12810 deallocate memory blocks that were allocated by xmalloc (via
12811 xstrdup). This caused Emacs to crash when compiled with
12812 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
12813 --enable-checking=xmallocoverrun). xfree is now used to
12814 deallocate these memory blocks.
12815
12816 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
12817
12818 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
12819
12820 emacs_write: Accept and return EMACS_INT for sizes.
12821 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
12822 et seq.
12823 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
12824 Accept and return EMACS_INT.
12825 (emacs_gnutls_write): Return the number of bytes written on
12826 partial writes.
12827 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
12828 (emacs_read, emacs_write): Remove check for negative size, as the
12829 Emacs source code has been audited now.
12830 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
12831 (emacs_read, emacs_write): Use it.
12832 * process.c (send_process): Adjust to the new signatures of
12833 emacs_write and emacs_gnutls_write. Do not attempt to store
12834 a byte offset into an 'int'; it might overflow.
12835 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
12836
12837 * sound.c: Don't assume sizes fit in 'int'.
12838 (struct sound_device.period_size, alsa_period_size):
12839 Return EMACS_INT, not int.
12840 (struct sound_device.write, vox_write, alsa_write):
12841 Accept EMACS_INT, not int.
12842 (wav_play, au_play): Use EMACS_INT to store sizes and to
12843 record read return values.
12844
12845 2011-04-15 Ben Key <bkey76@gmail.com>
12846
12847 * keyboard.c (Qundefined): Don't declare static since it is used
12848 in nsfns.m.
12849 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
12850 static since they are used in nsfont.m.
12851
12852 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
12853
12854 * process.c (Qprocessp): Don't declare static.
12855 * lisp.h (Qprocessp): Declare again.
12856
12857 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
12858
12859 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
12860
12861 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
12862
12863 Improve C-level modularity by making more things 'static'.
12864
12865 Don't publish debugger-only interfaces to other modules.
12866 * lisp.h (safe_debug_print, debug_output_compilation_hack):
12867 (verify_bytepos, count_markers): Move decls to the only modules
12868 that need them.
12869 * region-cache.h (pp_cache): Likewise.
12870 * window.h (check_all_windows): Likewise.
12871 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12872
12873 * sysdep.c (croak): Now static, if
12874 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12875 * syssignal.h (croak): Declare only if not static.
12876
12877 * alloc.c (refill_memory_reserve): Now static if
12878 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12879 * lisp.h (refill_memory_reserve): Declare only if not static.
12880
12881 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12882 Define only if USE_LUCID.
12883
12884 * xrdb.c (x_customization_string, x_rm_string): Now static.
12885
12886 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12887 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12888
12889 * xdisp.c (draw_row_with_mouse_face): Now static.
12890 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12891
12892 * window.h (check_all_windows): Mark externally visible.
12893
12894 * window.c (window_deletion_count): Now static.
12895
12896 * undo.c: Make symbols static if they're not exported.
12897 (last_undo_buffer, last_boundary_position, pending_boundary):
12898 Now static.
12899
12900 * textprop.c (interval_insert_behind_hooks): Now static.
12901 (interval_insert_in_front_hooks): Likewise.
12902
12903 * term.c: Make symbols static if they're not exported.
12904 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12905 (max_frame_lines, tty_set_terminal_modes):
12906 (tty_reset_terminal_modes, tty_turn_off_highlight):
12907 (get_tty_terminal): Now static.
12908 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12909 * termhooks.h (term_mouse_moveto): Do not declare if
12910 HAVE_WINDOW_SYSTEM.
12911 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12912 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12913
12914 * sysdep.c: Make symbols static if they're not exported.
12915 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12916 Now static.
12917 (sigprocmask_set, full_mask): Remove; unused.
12918 (wait_debugging): Mark as visible.
12919 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12920 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12921
12922 * syntax.c (syntax_temp): Define only if !__GNUC__.
12923
12924 * sound.c (current_sound_device, current_sound): Now static.
12925
12926 * search.c (searchbufs, searchbuf_head): Now static.
12927
12928 * scroll.c (scroll_cost): Remove; unused.
12929 * dispextern.h (scroll_cost): Remove decl.
12930
12931 * region-cache.h (pp_cache): Mark as externally visible.
12932
12933 * process.c: Make symbols static if they're not exported.
12934 (process_tick, update_tick, create_process, chan_process):
12935 (Vprocess_alist, proc_buffered_char, datagram_access):
12936 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12937 (deactivate_process): Mark defn as static, as well as decl.
12938 * lisp.h (create_process): Remove decl.
12939 * process.h (chan_process, Vprocess_alist): Remove decls.
12940
12941 * print.c: Make symbols static if they're not exported.
12942 (print_depth, new_backquote_output, being_printed, print_buffer):
12943 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12944 (print_interval, print_number_index, initial_stderr_stream):
12945 Now static.
12946 * lisp.h (Fprinc): Remove decl.
12947 (debug_output_compilation_hack): Mark as externally visible.
12948
12949 * sysdep.c (croak): Move decl from here to syssignal.h.
12950 * syssignal.h (croak): Put it here, so the API can be checked when
12951 'croak' is called from dissociate_if_controlling_tty.
12952
12953 * minibuf.c: Make symbols static if they're not exported.
12954 (minibuf_save_list, choose_minibuf_frame): Now static.
12955 * lisp.h (choose_minibuf_frame): Remove decl.
12956
12957 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12958
12959 * lread.c: Make symbols static if they're not exported.
12960 (read_objects, initial_obarray, oblookup_last_bucket_number):
12961 Now static.
12962 (make_symbol): Remove; unused.
12963 * lisp.h (initial_obarray, make_symbol): Remove decls.
12964
12965 * keyboard.c: Make symbols static if they're not exported.
12966 (single_kboard, recent_keys_index, total_keys, recent_keys):
12967 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12968 (this_single_command_key_start, echoing, last_auto_save):
12969 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12970 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12971 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12972 (Vlispy_mouse_stem, double_click_count):
12973 Now static.
12974 (force_auto_save_soon): Define only if SIGDANGER.
12975 (ignore_mouse_drag_p): Now static if
12976 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12977 (print_help): Remove; unused.
12978 (stop_character, last_timer_event): Mark as externally visible.
12979 * keyboard.h (ignore_mouse_drag_p): Declare only if
12980 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12981 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12982 * lisp.h (echoing): Remove decl.
12983 (force_auto_save_soon): Declare only if SIGDANGER.
12984 * xdisp.c (redisplay_window): Simplify code, to make it more
12985 obvious that ignore_mouse_drag_p is not accessed if !defined
12986 USE_GTK && !defined HAVE_NS.
12987
12988 * intervals.c: Make symbols static if they're not exported.
12989 (merge_properties_sticky, merge_interval_right, delete_interval):
12990 Now static.
12991 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12992
12993 * insdel.c: Make symbols static if they're not exported.
12994 However, leave prepare_to_modify_buffer alone. It's never
12995 called from outside this function, but that appears to be a bug.
12996 (combine_after_change_list, combine_after_change_buffer):
12997 (adjust_after_replace, signal_before_change): Now static.
12998 (adjust_after_replace_noundo): Remove; unused.
12999 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
13000 (signal_before_change): Remove decls.
13001
13002 * indent.c (val_compute_motion, val_vmotion): Now static.
13003
13004 * image.c: Make symbols static if they're not exported.
13005 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
13006 if USE_GTK.
13007 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
13008 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
13009
13010 * fringe.c (standard_bitmaps): Now static.
13011 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
13012
13013 * frame.c: Make symbols static if they're not exported.
13014 (x_report_frame_params, make_terminal_frame): Now static.
13015 (get_frame_param): Now static, unless HAVE_NS.
13016 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
13017 (x_get_resource_string): Remove; not used.
13018 * frame.h (make_terminal_frame, x_report_frame_params):
13019 (x_get_resource_string); Remove decls.
13020 (x_fullscreen_adjust): Declare only if WINDOWSNT.
13021 * lisp.h (get_frame_param): Declare only if HAVE_NS.
13022
13023 * font.c, fontset.c: Make symbols static if they're not exported.
13024 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
13025 (FACE_SUITABLE_FOR_CHAR_P): Use it.
13026 * font.c (font_close_object): Now static.
13027 * font.h (font_close_object): Remove.
13028 * fontset.c (FONTSET_OBJLIST): Remove.
13029 (free_realized_fontset) #if-0 the body, which does nothing.
13030 (face_suitable_for_char_p): #if-0, as it's never called.
13031 * fontset.h (face_suitable_for_char_p): Remove decl.
13032 * xfaces.c (face_at_string_position):
13033 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
13034 since 0 is always ASCII.
13035
13036 * fns.c (weak_hash_tables): Now static.
13037
13038 * fileio.c: Make symbols static if they're not exported.
13039 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
13040 (Vwrite_region_annotation_buffers): Now static.
13041
13042 * eval.c: Make symbols static if they're not exported.
13043 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
13044 * lisp.h (backtrace_list): Remove decl.
13045
13046 * emacs.c: Make symbols static if they're not exported.
13047 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
13048 (fatal_error_code, fatal_error_signal_hook, standard_args):
13049 Now static.
13050 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
13051 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
13052 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
13053 * lisp.h (fatal_error_signal_hook): Remove decl.
13054 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
13055
13056 * editfns.c: Move a (normally-unused) function to its only use.
13057 * editfns.c, lisp.h (get_operating_system_release): Remove.
13058 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
13059 worth the hassle of breaking this out.
13060
13061 * xterm.c: Make symbols static if they're not exported.
13062 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
13063 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
13064 (x_destroy_window, x_delete_display):
13065 Now static.
13066 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
13067 (x_mouse_leave): Remove; unused.
13068 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
13069 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
13070 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
13071 Remove decls.
13072 (x_mouse_leave): Declare only if WINDOWSNT.
13073 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
13074 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
13075 USE_X_TOOLKIT.
13076
13077 * ftxfont.c: Make symbols static if they're not exported.
13078 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
13079 HAVE_FREETYPE.
13080 * font.h (ftxfont_driver): Likewise.
13081
13082 * xfns.c: Make symbols static if they're not exported.
13083 (x_last_font_name, x_display_info_for_name):
13084 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
13085 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
13086 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
13087 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
13088 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
13089 (last_show_tip_args): Now static.
13090 (xic_defaut_fontset, xic_create_fontsetname): Define only if
13091 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
13092 (x_screen_planes): Remove; unused.
13093 * dispextern.h (x_screen_planes): Remove decl.
13094
13095 * dispnew.c: Make symbols static if they're not exported.
13096 * dispextern.h (redraw_garbaged_frames, scrolling):
13097 (increment_row_positions): Remove.
13098 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
13099 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
13100 Now static.
13101 (redraw_garbaged_frames): Remove; unused.
13102
13103 * xfaces.c: Make symbols static if they're not exported.
13104 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
13105 Remove decls.
13106 * xterm.h (defined_color): Remove decls.
13107 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
13108 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
13109 (menu_face_changed_default, defined_color, free_realized_face):
13110 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
13111 (ascii_face_of_lisp_face): Remove; unused.
13112
13113 * xdisp.c: Make symbols static if they're not exported.
13114 * dispextern.h (scratch_glyph_row, window_box_edges):
13115 (glyph_to_pixel_coords, set_cursor_from_row):
13116 (get_next_display_element, set_iterator_to_next):
13117 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
13118 (show_mouse_face): Remove decls
13119 * frame.h (message_buf_print): Likewise.
13120 * lisp.h (pop_message, set_message, check_point_in_composition):
13121 Likewise.
13122 * xterm.h (set_vertical_scroll_bar): Likewise.
13123 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
13124 (message_buf_print, scratch_glyph_row, displayed_buffer):
13125 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
13126 (get_next_display_element, show_mouse_face, window_box_edges):
13127 (frame_to_window_pixel_xy, check_point_in_composition):
13128 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
13129 (glyph_to_pixel_coords): Remove; unused.
13130
13131 * dired.c (file_name_completion): Now static.
13132
13133 * dbusbind.c (xd_in_read_queued_messages): Now static.
13134
13135 * lisp.h (circular_list_error, FOREACH): Remove; unused.
13136 * data.c (circular_list_error): Remove.
13137
13138 * commands.h (last_point_position, last_point_position_buffer):
13139 (last_point_position_window): Remove decls.
13140 * keyboard.c: Make these variables static.
13141
13142 * coding.h (coding, code_convert_region, encode_coding_gap):
13143 Remove decls.
13144 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
13145 (iso_code_class, detect_coding, code_convert_region): Now static.
13146 (encode_coding_gap): Remove; unused.
13147
13148 * chartab.c (chartab_chars, chartab_bits): Now static.
13149
13150 * charset.h (charset_iso_8859_1): Remove decl.
13151 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
13152 Now static.
13153
13154 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
13155 * ccl.c (Vccl_program_table): Now static.
13156 (check_ccl_update): Remove; unused.
13157
13158 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
13159 * category.h: ... from here.
13160 * category.c (check_category_table, set_category_set): Now static.
13161
13162 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
13163 * lisp.h: Remove these decls.
13164
13165 * buffer.c (buffer_count): Remove unused var.
13166
13167 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
13168 so that it's not optimized away.
13169 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
13170 * dispextern.h (bidi_dump_cached_states): Remove, since it's
13171 exported only to the debugger.
13172
13173 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
13174 * atimer.h (run_all_atimers): Remove; not exported.
13175
13176 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
13177 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
13178 was inaccessible from Lisp.
13179 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
13180 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
13181
13182 alloc.c: Import and export fewer symbols, and remove unused items.
13183 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
13184 is defined.
13185 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
13186 it's not optimized away by whole-program optimization.
13187 (message_enable_multibyte, free_misc): Remove.
13188 (catchlist, handlerlist, mark_backtrace):
13189 Declare only if BYTE_MARK_STACK.
13190 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
13191 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13192 (message_enable_multibyte): Remove decl.
13193 (free_misc, interval_free_list, float_block, float_block_index):
13194 (n_float_blocks, float_free_list, cons_block, cons_block_index):
13195 (cons_free_list, last_marked_index):
13196 Now static.
13197 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
13198 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
13199 (mark_backtrace): Define only if BYTE_MARK_STACK.
13200 * xdisp.c (message_enable_multibyte): Now static.
13201
13202 Declare Lisp_Object Q* variables to be 'static' if not exported.
13203 This makes it easier for human readers (and static analyzers)
13204 to see whether these variables are used from other modules.
13205 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
13206 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
13207 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
13208 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
13209 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
13210 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
13211 * xmenu.c, xselect.c:
13212 Declare Q* vars static if they are not used in other modules.
13213 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
13214 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
13215 Remove decls of unexported vars.
13216 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
13217
13218 * lisp.h (DEFINE_FUNC): Make sname 'static'.
13219
13220 Make Emacs functions such as Fatom 'static' by default.
13221 This makes it easier for human readers (and static analyzers)
13222 to see whether these functions can be called from other modules.
13223 DEFUN now defines a static function. To make the function external
13224 so that it can be used in other C modules, use the new macro DEFUE.
13225 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
13226 (Finit_image_library):
13227 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
13228 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
13229 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
13230 Remove decls, since these functions are now static.
13231 (Funintern, Fget_internal_run_time): New decls, since these functions
13232 were already external.
13233
13234 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
13235 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
13236 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
13237 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
13238 * keyboard.c, keymap.c, lread.c:
13239 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
13240 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
13241 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
13242 Mark functions with DEFUE instead of DEFUN,
13243 if they are used in other modules.
13244 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
13245 decls for now-static functions.
13246 * buffer.h (Fdelete_overlay): Remove decl.
13247 * callproc.c (Fgetenv_internal): Mark as internal.
13248 * composite.c (Fremove_list_of_text_properties): Remove decl.
13249 (Fcomposition_get_gstring): New forward static decl.
13250 * composite.h (Fcomposite_get_gstring): Remove decl.
13251 * dired.c (Ffile_attributes): New forward static decl.
13252 * doc.c (Fdocumntation_property): New forward static decl.
13253 * eval.c (Ffetch_bytecode): New forward static decl.
13254 (Funintern): Remove extern decl; now in .h file where it belongs.
13255 * fileio.c (Fmake_symbolic_link): New forward static decl.
13256 * image.c (Finit_image_library): New forward static decl.
13257 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
13258 * intervals.h (Fprevious_property_change):
13259 (Fremove_list_of_text_properties): Remove decls.
13260 * keyboard.c (Fthis_command_keys): Remove decl.
13261 (Fcommand_execute): New forward static decl.
13262 * keymap.c (Flookup_key): New forward static decl.
13263 (Fcopy_keymap): Now static.
13264 * keymap.h (Flookup_key): Remove decl.
13265 * process.c (Fget_process): New forward static decl.
13266 (Fprocess_datagram_address): Mark as internal.
13267 * syntax.c (Fsyntax_table_p): New forward static decl.
13268 (skip_chars): Remove duplicate decl.
13269 * textprop.c (Fprevious_property_change): New forward static decl.
13270 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
13271 Now internal.
13272 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
13273 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
13274
13275 * editfns.c (Fformat): Remove unreachable code.
13276
13277 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
13278
13279 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
13280 change. (Bug#8496)
13281
13282 2011-04-13 Eli Zaretskii <eliz@gnu.org>
13283
13284 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
13285 when at ZV. (Bug#8487)
13286
13287 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
13288
13289 * charset.c (Fclear_charset_maps): Use xfree instead of free.
13290 (Bug#8437)
13291 * keyboard.c (parse_tool_bar_item): Likewise.
13292 * sound.c (sound_cleanup, alsa_close): Likewise.
13293 * termcap.c (tgetent): Likewise.
13294 * xfns.c (x_default_font_parameter): Likewise.
13295 * xsettings.c (read_and_apply_settings): Likewise.
13296
13297 * alloc.c (overrun_check_malloc, overrun_check_realloc)
13298 (overrun_check_free): Protoize.
13299
13300 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
13301
13302 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
13303 since callers should never pass a negative size.
13304 Change the signature to match that of plain 'read' and 'write'; see
13305 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
13306 * lisp.h: Update prototypes of emacs_write and emacs_read.
13307
13308 2011-04-11 Eli Zaretskii <eliz@gnu.org>
13309
13310 * xdisp.c (redisplay_window): Don't try to determine the character
13311 position of the scroll margin if the window start point w->startp
13312 is outside the buffer's accessible region. (Bug#8468)
13313
13314 2011-04-10 Eli Zaretskii <eliz@gnu.org>
13315
13316 Fix write-region and its subroutines for buffers > 2GB.
13317 * fileio.c (a_write, e_write): Modify declaration of arguments and
13318 local variables to support buffers larger than 2GB.
13319 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
13320
13321 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
13322 argument, local variables, and return value.
13323
13324 * lisp.h: Update prototypes of emacs_write and emacs_read.
13325
13326 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
13327
13328 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
13329
13330 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
13331
13332 Fix more problems found by GCC 4.6.0's static checks.
13333
13334 * xdisp.c (vmessage): Use a better test for character truncation.
13335
13336 * charset.c (load_charset_map): <, not <=, for optimization,
13337 and to avoid potential problems with integer overflow.
13338 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
13339 * casetab.c (set_identity, shuffle): Likewise.
13340 * editfns.c (Fformat): Likewise.
13341 * syntax.c (skip_chars): Likewise.
13342
13343 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
13344 This also lets GCC 4.6.0 generate slightly better loop code.
13345
13346 * callint.c (Fcall_interactively): <, not <=, for optimization.
13347 (Fcall_interactively): Count the number of arguments produced,
13348 not the number of arguments given. This is simpler and lets GCC
13349 4.6.0 generate slightly better code.
13350
13351 * ftfont.c: Distingish more carefully between FcChar8 and char.
13352 The previous code passed unsigned char * to a functions like
13353 strlen and xstrcasecmp that expect char *, which does not
13354 conform to the C standard.
13355 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
13356 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
13357 char * when the C standard requires it.
13358
13359 * keyboard.c (read_char): Remove unused var.
13360
13361 * eval.c: Port to Windows vsnprintf (Bug#8435).
13362 Include <limits.h>.
13363 (SIZE_MAX): Define if the headers do not.
13364 (verror): Do not give up if vsnprintf returns a negative count.
13365 Instead, grow the buffer. This ports to Windows vsnprintf, which
13366 does not conform to C99. Problem reported by Eli Zaretskii.
13367 Also, simplify the allocation scheme, by avoiding the need for
13368 calling realloc, and removing the ALLOCATED variable.
13369
13370 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
13371
13372 Remove invocations of doprnt, as Emacs now uses vsnprintf.
13373 But keep the doprint source code for now, as we might revamp it
13374 and use it again (Bug#8435).
13375 * lisp.h (doprnt): Remove.
13376 * Makefile.in (base_obj): Remove doprnt.o.
13377 * deps.mk (doprnt.o): Remove.
13378
13379 error: Print 32- and 64-bit integers portably (Bug#8435).
13380 Without this change, on typical 64-bit hosts error ("...%d...", N)
13381 was used to print both 32- and 64-bit integers N, which relied on
13382 undefined behavior.
13383 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
13384 * lisp.h (error, verror): Mark as printf-like functions.
13385 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13386 Report overflow in size calculations when allocating printf buffer.
13387 Do not truncate output string at its first null byte.
13388 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13389 Truncate the output at a character boundary, since vsnprintf does not
13390 do that.
13391 * charset.c (check_iso_charset_parameter): Convert internal
13392 character to string before calling 'error', since %c now has the
13393 printf meaning.
13394 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13395 overflow when computing char to be passed to 'error'. Do not
13396 pass Lisp_Object to 'error'; pass the integer instead.
13397 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13398 formatted with plain %d.
13399
13400 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13401
13402 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13403
13404 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13405
13406 * xterm.c (x_catch_errors): Remove duplicate declaration.
13407
13408 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13409
13410 * xdisp.c, lisp.h (message_nolog): Remove; unused.
13411
13412 2011-04-10 Jim Meyering <meyering@redhat.com>
13413
13414 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13415 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13416 return ssize_t not "int", and use size_t as the buffer length.
13417 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13418 * gnutls.h: Update declarations.
13419 * process.c (read_process_output): Use ssize_t, to match.
13420 (send_process): Likewise.
13421
13422 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13423
13424 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13425
13426 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13427
13428 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13429 Use unsigned char, to match FcChar8 type definition.
13430
13431 * xterm.c (handle_one_xevent):
13432 * xmenu.c (create_and_show_popup_menu):
13433 * xselect.c (x_decline_selection_request)
13434 (x_reply_selection_request): Avoid type-punned deref of X events.
13435
13436 2011-04-09 Eli Zaretskii <eliz@gnu.org>
13437
13438 Fix some uses of `int' instead of EMACS_INT.
13439 * search.c (string_match_1, fast_string_match)
13440 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13441 (scan_buffer, find_next_newline_no_quit)
13442 (find_before_next_newline, search_command, Freplace_match)
13443 (Fmatch_data): Make some `int' variables be EMACS_INT.
13444
13445 * xdisp.c (display_count_lines): 3rd argument and return value now
13446 EMACS_INT. All callers changed.
13447 (pint2hrstr): Last argument is now EMACS_INT.
13448
13449 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13450 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13451 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13452 (decode_coding_utf_16, decode_coding_emacs_mule)
13453 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13454 (decode_coding_ccl, decode_coding_charset)
13455 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13456 (decode_coding_iso_2022, decode_coding_emacs_mule)
13457 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13458 <char_offset, last_offset>: Declare EMACS_INT.
13459 (encode_coding_utf_8, encode_coding_utf_16)
13460 (encode_coding_emacs_mule, encode_invocation_designation)
13461 (encode_designation_at_bol, encode_coding_iso_2022)
13462 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13463 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13464 Declare EMACS_INT.
13465 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13466 (encode_invocation_designation): Last argument P_NCHARS is now
13467 EMACS_INT.
13468 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13469 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13470
13471 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13472 All users changed.
13473
13474 * ccl.c (Fccl_execute_on_string): Declare some variables
13475 EMACS_INT.
13476
13477 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
13478
13479 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13480
13481 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
13482
13483 * process.c (Fformat_network_address): Doc fix.
13484
13485 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
13486
13487 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
13488
13489 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
13490
13491 * keyboard.c (read_char): Call Lisp function help-form-show,
13492 instead of using internal_with_output_to_temp_buffer.
13493 (Qhelp_form_show): New var.
13494 (syms_of_keyboard): Use DEFSYM macro.
13495
13496 * print.c (internal_with_output_to_temp_buffer): Function deleted.
13497
13498 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13499
13500 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
13501
13502 * process.c (Flist_processes): Remove to Lisp.
13503 (list_processes_1): Delete.
13504
13505 2011-04-06 Eli Zaretskii <eliz@gnu.org>
13506
13507 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13508
13509 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13510
13511 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
13512
13513 Fix more problems found by GCC 4.6.0's static checks.
13514
13515 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13516
13517 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13518
13519 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
13520
13521 * xdisp.c (vmessage): Mark as a printf-like function.
13522
13523 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
13524
13525 * sound.c (sound_warning): Don't crash if arg contains a printf format.
13526
13527 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
13528 printf-like functions.
13529 (tiff_load): Add casts to remove these marks before passing them
13530 to system-supplied API.
13531
13532 * eval.c (Fsignal): Remove excess argument to 'fatal'.
13533
13534 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
13535 This avoids several warnings with gcc -Wstrict-overflow.
13536 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
13537 directly, rather than having caller test rule sign. This avoids
13538 some unnecessary tests.
13539 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
13540 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
13541 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
13542
13543 * xfont.c (xfont_text_extents): Remove var that was set but not used.
13544 (xfont_open): Avoid unnecessary tests.
13545
13546 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13547
13548 * composite.h, composite.c (composition_gstring_put_cache):
13549 Use EMACS_INT, not int, for length.
13550
13551 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13552 breaking out part of COMPOSITION_DECODE_RULE.
13553 (COMPOSITION_DECODE_RULE): Use it.
13554 * composite.c (get_composition_id): Remove unused local vars,
13555 by using the new macro.
13556
13557 * textprop.c (set_text_properties_1): Change while to do-while,
13558 since the condition is always true at first.
13559
13560 * intervals.c (graft_intervals_into_buffer): Mark var as used.
13561 (interval_deletion_adjustment): Return unsigned value.
13562 All uses changed.
13563
13564 * process.c (list_processes_1, create_pty, read_process_output):
13565 (exec_sentinel): Remove vars that were set but not used.
13566 (create_pty): Remove unnecessary "volatile"s.
13567 (Fnetwork_interface_info): Avoid possibility of int overflow.
13568 (read_process_output): Do adaptive read buffering even if carryover.
13569 (read_process_output): Simplify nbytes computation if buffered.
13570
13571 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13572
13573 * syntax.c (scan_words): Remove var that was set but not used.
13574 (update_syntax_table): Use unsigned instead of int.
13575
13576 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
13577 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
13578 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
13579
13580 * print.c (print_error_message): Avoid int overflow.
13581
13582 * font.c (font_list_entities): Redo for clarity,
13583 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13584
13585 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
13586 (font_score): Avoid potential overflow in diff calculation.
13587
13588 * fns.c (substring_both): Remove var that is set but not used.
13589 (sxhash): Redo loop for clarity and to avoid wraparound warning.
13590
13591 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13592
13593 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13594 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13595 can always succeed if overflow has undefined behavior.
13596
13597 * search.c (boyer_moore, wordify): Remove vars set but not used.
13598 (wordify): Omit three unnecessary tests.
13599
13600 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13601 All callers changed. This avoids the need for an unused var.
13602
13603 * casefiddle.c (casify_region): Remove var that is set but not used.
13604
13605 * dired.c (file_name_completion): Remove var that is set but not used.
13606
13607 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13608
13609 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
13610 (Finsert_file_contents): Remove unnecessary code checking fd.
13611
13612 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13613 Check for integer overflow on size calculations.
13614
13615 * buffer.c (Fprevious_overlay_change): Remove var that is set
13616 but not used.
13617
13618 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13619 Remove vars that are set but not used.
13620 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
13621 (timer_check_2): Mark vars as initialized.
13622
13623 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13624
13625 * image.c (lookup_image): Remove var that is set but not used.
13626 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
13627
13628 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13629 that are set but not used.
13630
13631 * xfns.c (make_invisible_cursor): Don't return garbage
13632 if XCreateBitmapFromData fails (Bug#8410).
13633
13634 * xselect.c (x_get_local_selection, x_handle_property_notify):
13635 Remove vars that are set but not used.
13636
13637 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
13638 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
13639
13640 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13641 Remove var that is set but not used.
13642 (scroll_bar_windows_size): Now size_t, not int.
13643 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13644 Check for overflow.
13645
13646 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13647 (map_tty_color) [!defined MSDOS]: Likewise.
13648
13649 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13650
13651 * coding.c: Remove vars that are set but not used.
13652 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13653 All callers changed.
13654 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13655 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13656 (decode_coding_charset): Remove vars that are set but not used.
13657
13658 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13659 that is set but not used.
13660
13661 * print.c (print_object): Remove var that is set but not used.
13662
13663 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
13664 The gnulib version avoids calling malloc in the usual case,
13665 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13666 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13667 * filelock.c (current_lock_owner): Likewise.
13668 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13669 * sysdep.c: Include allocator.h, careadlinkat.h.
13670 (emacs_no_realloc_allocator): New static constant.
13671 (emacs_readlink): New function.
13672 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13673 ../lib/careadlinkat.h.
13674
13675 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13676
13677 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13678 first non-nil return value).
13679
13680 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13681
13682 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13683 if not defined (Bug#8403).
13684
13685 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13686
13687 * xdisp.c (display_count_lines): Remove parameter `start',
13688 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13689 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13690 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13691 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13692 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13693 and thereabouts. All callers changed.
13694 (get_per_char_metric): Remove parameter `f', unused since
13695 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13696
13697 2011-04-02 Jim Meyering <meyering@redhat.com>
13698
13699 do not dereference NULL upon failed strdup
13700 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13701 (ns_get_family): Likewise.
13702
13703 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13704
13705 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13706
13707 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13708
13709 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13710 later (Bug#8403).
13711
13712 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13713
13714 Add lexical binding.
13715
13716 * window.c (Ftemp_output_buffer_show): New fun.
13717 (Fsave_window_excursion):
13718 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13719
13720 * lread.c (lisp_file_lexically_bound_p): New function.
13721 (Fload): Bind Qlexical_binding.
13722 (readevalloop): Remove `evalfun' arg.
13723 Bind Qinternal_interpreter_environment.
13724 (Feval_buffer): Bind Qlexical_binding.
13725 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13726 Mark as dynamic.
13727 (syms_of_lread): Declare `lexical-binding'.
13728
13729 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13730
13731 * keyboard.c (eval_dyn): New fun.
13732 (menu_item_eval_property): Use it.
13733
13734 * image.c (parse_image_spec): Use Ffunctionp.
13735
13736 * fns.c (concat, mapcar1): Accept byte-code-functions.
13737
13738 * eval.c (Fsetq): Handle lexical vars.
13739 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13740 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13741 (FletX, Flet): Obey lexical binding.
13742 (Fcommandp): Handle closures.
13743 (Feval): New `lexical' arg.
13744 (eval_sub): New function extracted from Feval. Use it almost
13745 everywhere where Feval was used. Look up vars in lexical env.
13746 Handle closures.
13747 (Ffunctionp): Move from subr.el.
13748 (Ffuncall): Handle closures.
13749 (apply_lambda): Remove `eval_flags'.
13750 (funcall_lambda): Handle closures and new byte-code-functions.
13751 (Fspecial_variable_p): New function.
13752 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13753 but without exporting it to Lisp.
13754
13755 * doc.c (Fdocumentation, store_function_docstring):
13756 * data.c (Finteractive_form): Handle closures.
13757
13758 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13759 interactive spec.
13760
13761 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
13762 New byte-codes.
13763 (exec_byte_code): New function extracted from Fbyte_code to handle new
13764 calling convention for byte-code-functions. Add new byte-codes.
13765
13766 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
13767
13768 * alloc.c (Fmake_symbol): Init new `declared_special' field.
13769
13770 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13771
13772 * xdisp.c (redisplay_internal): Fix prototype.
13773
13774 2011-03-31 Eli Zaretskii <eliz@gnu.org>
13775
13776 * xdisp.c (SCROLL_LIMIT): New macro.
13777 (try_scrolling): Use it when setting scroll_limit.
13778 Limit scrolling to 100 screen lines.
13779 (redisplay_window): Even when falling back on "recentering",
13780 position point in the window according to scroll-conservatively,
13781 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
13782
13783 (try_scrolling): When point is above the window, allow searching
13784 as far as scroll_max, or one screenful, to compute vertical
13785 distance from PT to the scroll margin position. This prevents
13786 try_scrolling from unnecessarily failing when
13787 scroll-conservatively is set to a value slightly larger than the
13788 window height. Clean up the case of PT below the margin at bottom
13789 of window: scroll_max can no longer be INT_MAX. When aggressive
13790 scrolling is in use, don't let point enter the opposite scroll
13791 margin as result of the scroll.
13792 (syms_of_xdisp) <scroll-conservatively>: Document the
13793 threshold of 100 lines for never-recentering scrolling.
13794
13795 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13796
13797 * dispextern.h (move_it_by_lines):
13798 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
13799 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
13800 (message_log_check_duplicate): Remove parameters `prev_bol' and
13801 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13802 (redisplay_internal): Remove parameter `preserve_echo_area',
13803 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
13804
13805 * indent.c (Fvertical_motion):
13806 * window.c (window_scroll_pixel_based, Frecenter):
13807 Don't pass `need_y_p' to `move_it_by_lines'.
13808
13809 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
13810
13811 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
13812 steal a few bits to be more compact.
13813 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
13814 Remove unneeded casts.
13815
13816 * bytecode.c (Fbyte_code): CAR and CDR can GC.
13817
13818 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
13819
13820 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
13821 binding" message (bug#7967).
13822
13823 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
13824
13825 Fix more problems found by GCC 4.6.0's static checks.
13826
13827 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
13828 Remove unused local var.
13829
13830 * editfns.c (Fmessage_box): Remove unused local var.
13831
13832 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
13833 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13834 Omit unused local vars.
13835 * window.c (shrink_windows): Omit unused local var.
13836 * menu.c (digest_single_submenu): Omit unused local var.
13837 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
13838 Omit unused local var.
13839
13840 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
13841 Don't assume string length fits in int.
13842 (keyremap_step, read_key_sequence): Use size_t for sizes.
13843 (read_key_sequence): Don't check last_real_key_start redundantly.
13844
13845 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
13846 instead of alloca (Bug#8344).
13847
13848 * eval.c (Fbacktrace): Don't assume nargs fits in int.
13849 (Fbacktrace_frame): Don't assume nframes fits in int.
13850
13851 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
13852
13853 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
13854 concerns.
13855
13856 * term.c (produce_glyphless_glyph): Remove unnecessary test.
13857
13858 * cm.c (calccost): Turn while-do into do-while, for clarity.
13859
13860 * keyboard.c (syms_of_keyboard): Use the same style as later
13861 in this function when indexing through an array. This also
13862 works around GCC bug 48267.
13863
13864 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
13865
13866 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
13867
13868 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13869 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13870
13871 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13872 This avoids undefined behavior on integer overflow, and is a bit
13873 more convenient anyway since it is compared to a size_t variable.
13874
13875 Variadic C functions now count arguments with size_t, not int.
13876 This avoids an unnecessary limitation on 64-bit machines, which
13877 caused (substring ...) to crash on large vectors (Bug#8344).
13878 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13879 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
13880 All variadic functions and their callers changed accordingly.
13881 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13882 * data.c (arith_driver, float_arith_driver): Likewise.
13883 * editfns.c (general_insert_function): Likewise.
13884 * eval.c (struct backtrace.nargs, interactive_p)
13885 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13886 (funcall_lambda, mark_backtrace): Likewise.
13887 * fns.c (concat): Likewise.
13888 * frame.c (x_set_frame_parameters): Likewise.
13889 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13890 0 if not found, not -1. All callers changed.
13891
13892 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13893 (stack_copy_size): Now size_t, not int.
13894 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13895
13896 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13897
13898 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13899 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13900 All callers changed.
13901
13902 * lisp.h (multibyte_char_to_unibyte):
13903 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13904 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13905 * character.h (CHAR_TO_BYTE8):
13906 * cmds.c (internal_self_insert):
13907 * editfns.c (general_insert_function):
13908 * keymap.c (push_key_description):
13909 * search.c (Freplace_match):
13910 * xdisp.c (message_dolog, set_message_1): All callers changed.
13911
13912 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13913
13914 * keyboard.c (safe_run_hook_funcall): New function.
13915 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13916 don't set the hook to nil, but remove the offending function instead.
13917 (Qcommand_hook_internal): Remove, unused.
13918 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13919 Vcommand_hook_internal.
13920
13921 * eval.c (enum run_hooks_condition): Remove.
13922 (funcall_nil, funcall_not): New functions.
13923 (run_hook_with_args): Call each function through a `funcall' argument.
13924 Remove `cond' argument, now redundant.
13925 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13926 (Frun_hook_with_args_until_failure): Adjust accordingly.
13927 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13928
13929 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13930
13931 * dispextern.h (string_buffer_position): Remove declaration.
13932
13933 * print.c (strout): Remove parameter `multibyte', unused since
13934 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13935
13936 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13937 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13938 All callers changed.
13939
13940 * w32.c (_wsa_errlist): Use braces for struct initializers.
13941
13942 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13943 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13944 All callers changed.
13945 (string_buffer_position): Likewise. Also, make static (it's never
13946 used outside xdisp.c).
13947 (cursor_row_p): Remove parameter `w', unused since
13948 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13949 (decode_mode_spec): Remove parameter `precision', introduced during
13950 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13951 All callers changed.
13952
13953 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13954
13955 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13956
13957 2011-03-27 Anders Lindgren <andlind@gmail.com>
13958
13959 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13960 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13961 (ns_update_auto_hide_menu_bar): New functions.
13962 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13963 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13964 ns_constrain_all_frames.
13965 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13966 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13967
13968 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13969
13970 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13971
13972 2011-03-27 Glenn Morris <rgm@gnu.org>
13973
13974 * syssignal.h: Replace RETSIGTYPE with void.
13975 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13976 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13977 Replace SIGTYPE with void everywhere.
13978 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13979 * s/template.h (SIGTYPE): Remove commented out definition.
13980
13981 2011-03-26 Eli Zaretskii <eliz@gnu.org>
13982
13983 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13984 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13985
13986 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
13987
13988 * w32.c (read_unc_volume): Use parameter `henum', instead of
13989 global variable `wget_enum_handle'.
13990
13991 * keymap.c (describe_vector): Remove parameters `indices' and
13992 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13993 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
13994
13995 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
13996
13997 * keyboard.c (timer_check): Remove parameter `do_it_now',
13998 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
13999 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
14000 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
14001
14002 * keyboard.c (read_char):
14003 * w32menu.c (w32_menu_display_help):
14004 * xmenu.c (show_help_event, menu_help_callback):
14005 Adjust calls to `show_help_echo'.
14006
14007 * gtkutil.c (xg_maybe_add_timer):
14008 * keyboard.c (readable_events):
14009 * process.c (wait_reading_process_output):
14010 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
14011
14012 * insdel.c (adjust_markers_gap_motion):
14013 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
14014 (gap_left, gap_right): Don't call it.
14015
14016 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
14017
14018 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
14019 incurred during fontification.
14020
14021 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14022
14023 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
14024 (DEFVAR_PER_BUFFER): Don't pass it.
14025
14026 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
14027 (scrolling_window): Don't pass it.
14028
14029 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14030
14031 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
14032
14033 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
14034 and `suffix'.
14035 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
14036 of variables specific to SELinux and computation of `encoded_absname'.
14037
14038 * image.c (XPutPixel): Remove unused variable `height'.
14039
14040 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
14041
14042 * unexw32.c (get_section_info): Remove unused variable `section'.
14043
14044 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
14045 (system_process_attributes): Remove unused variable `sess'.
14046 (sys_read): Remove unused variable `err'.
14047
14048 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
14049 (w32_wnd_proc): Remove unused variable `isdead'.
14050 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
14051 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
14052 (x_create_tip_frame): Remove unused variable `tem'.
14053
14054 * w32inevt.c (w32_console_read_socket):
14055 Remove unused variable `no_events'.
14056
14057 * w32term.c (x_draw_composite_glyph_string_foreground):
14058 Remove unused variable `width'.
14059
14060 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
14061
14062 * w32term.c (x_set_glyph_string_clipping):
14063 Don't pass uninitialized region to CombineRgn.
14064
14065 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
14066
14067 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
14068 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
14069 (Fx_close_connection): Remove unused variable `i'.
14070
14071 * w32font.c (w32font_draw): Return number of glyphs.
14072 (w32font_open_internal): Remove unused variable `i'.
14073 (w32font_driver): Add missing initializer.
14074
14075 * w32menu.c (utf8to16): Remove unused variable `utf16'.
14076 (fill_in_menu): Remove unused variable `items_added'.
14077
14078 * w32term.c (last_mouse_press_frame): Remove static global variable.
14079 (w32_clip_to_row): Remove unused variable `f'.
14080 (x_delete_terminal): Remove unused variable `i'.
14081
14082 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
14083 (NOTHING): Remove unused static global variable.
14084 (uniscribe_check_otf): Remove unused variable `table'.
14085 (uniscribe_font_driver): Add missing initializers.
14086
14087 2011-03-23 Julien Danjou <julien@danjou.info>
14088
14089 * term.c (Fsuspend_tty, Fresume_tty):
14090 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
14091 * window.c (temp_output_buffer_show):
14092 * insdel.c (signal_before_change):
14093 * frame.c (Fhandle_switch_frame):
14094 * fileio.c (Fdo_auto_save):
14095 * emacs.c (Fkill_emacs):
14096 * editfns.c (save_excursion_restore):
14097 * cmds.c (internal_self_insert):
14098 * callint.c (Fcall_interactively):
14099 * buffer.c (Fkill_all_local_variables):
14100 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
14101 Use Frun_hooks.
14102 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
14103 unconditionally since it does the check itself.
14104
14105 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
14106
14107 Fix more problems found by GCC 4.5.2's static checks.
14108
14109 * coding.c (encode_coding_raw_text): Avoid unnecessary test
14110 the first time through the loop, since we know p0 < p1 then.
14111 This also avoids a gcc -Wstrict-overflow warning.
14112
14113 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
14114 leading to a memory leak, possible in functions like
14115 load_charset_map_from_file that can allocate an unbounded number
14116 of objects (Bug#8318).
14117
14118 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
14119 that could (at least in theory) be that large.
14120
14121 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
14122 This is less likely to overflow, and avoids undefined behavior if
14123 overflow does occur. All callers changed. Use strtoul to scan
14124 for the unsigned long integer.
14125 (pint2hrstr): Simplify and tune code slightly.
14126 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
14127
14128 * scroll.c (do_scrolling): Work around GCC bug 48228.
14129 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
14130
14131 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
14132 This also avoids a warning with gcc -Wstrict-overflow.
14133 (validate_x_resource_name): Simplify count usage.
14134 This also avoids a warning with gcc -Wstrict-overflow.
14135
14136 * fileio.c (Fcopy_file): Report error if fchown or fchmod
14137 fail (Bug#8306).
14138
14139 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
14140
14141 * process.c (Fmake_network_process): Use socklen_t, not int,
14142 where POSIX says socklen_t is required in portable programs.
14143 This fixes a porting bug on hosts like 64-bit HP-UX, where
14144 socklen_t is wider than int (Bug#8277).
14145 (Fmake_network_process, server_accept_connection):
14146 (wait_reading_process_output, read_process_output):
14147 Likewise.
14148
14149 * process.c: Rename or move locals to avoid shadowing.
14150 (list_processes_1, Fmake_network_process):
14151 (read_process_output_error_handler, exec_sentinel_error_handler):
14152 Rename or move locals.
14153 (Fmake_network_process): Define label "retry_connect" only if needed.
14154 (Fnetwork_interface_info): Fix pointer signedness.
14155 (process_send_signal): Add cast to avoid pointer signedness problem.
14156 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
14157 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
14158
14159 Make tparam.h and terminfo.c consistent.
14160 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
14161 Include tparam.h instead, since it declares them.
14162 * cm.h (PC): Remove extern decl; tparam.h now does this.
14163 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
14164 * terminfo.c: Include tparam.h, to check interfaces.
14165 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
14166 (tparam): Adjust signature to match interface in tparam.h;
14167 this removes some undefined behavior. Check that outstring and len
14168 are zero, which they always are with Emacs.
14169 * tparam.h (PC, BC, UP): New extern decls.
14170
14171 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
14172 (xftfont_open): Rename locals to avoid shadowing.
14173
14174 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
14175 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
14176 (OTF_TAG_SYM): Omit macro if not needed.
14177 (ftfont_list): Remove unused local.
14178 (get_adstyle_property, ftfont_pattern_entity):
14179 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
14180 Rename locals to avoid shadowing.
14181
14182 * xfont.c (xfont_list_family): Mark var as initialized.
14183
14184 * xml.c (make_dom): Now static.
14185
14186 * composite.c (composition_compute_stop_pos): Rename local to
14187 avoid shadowing.
14188 (composition_reseat_it): Remove unused locals.
14189 (find_automatic_composition, composition_adjust_point): Likewise.
14190 (composition_update_it): Mark var as initialized.
14191 (find_automatic_composition): Mark vars as initialized,
14192 with a FIXME (Bug#8290).
14193
14194 character.h: Rename locals to avoid shadowing.
14195 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
14196 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
14197 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
14198 (BUF_DEC_POS): Be more systematic about renaming local temporaries
14199 to avoid shadowing.
14200
14201 * textprop.c (property_change_between_p): Remove; unused.
14202
14203 * intervals.c (interval_start_pos): Now static.
14204
14205 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
14206
14207 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
14208 Rename locals to avoid shadowing.
14209
14210 * sound.c (wav_play, au_play, Fplay_sound_internal):
14211 Fix pointer signedness.
14212 (alsa_choose_format): Remove unused local var.
14213 (wav_play): Initialize a variable to 0, to prevent undefined
14214 behavior (Bug#8278).
14215
14216 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
14217
14218 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
14219
14220 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
14221 clobbering (Bug#8298).
14222 * sysdep.c (sys_subshell): Likewise.
14223 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
14224
14225 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
14226 This should get cleaned up, so that child_setup has the
14227 same signature on all platforms.
14228
14229 * callproc.c (call_process_cleanup): Now static.
14230 (relocate_fd): Rename locals to avoid shadowing.
14231
14232 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
14233
14234 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
14235 not to be necessary, and produces flickering.
14236
14237 2011-03-20 Glenn Morris <rgm@gnu.org>
14238
14239 * config.in: Remove file.
14240
14241 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
14242
14243 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
14244 are now in src/globals.h.
14245 (syms_of_minibuf): Remove spurious & from previous change.
14246
14247 2011-03-20 Leo Liu <sdl.web@gmail.com>
14248
14249 * minibuf.c (completing-read-function): New variable.
14250 (completing-read-default): Rename from completing-read.
14251 (completing-read): Call completing-read-function.
14252
14253 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
14254
14255 * xfaces.c (Fx_load_color_file):
14256 Read color file from absolute filename (bug#8250).
14257
14258 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
14259
14260 * makefile.w32-in: Update dependencies.
14261
14262 2011-03-17 Eli Zaretskii <eliz@gnu.org>
14263
14264 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
14265
14266 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
14267
14268 Fix more problems found by GCC 4.5.2's static checks.
14269
14270 * process.c (make_serial_process_unwind, send_process_trap):
14271 (sigchld_handler): Now static.
14272
14273 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
14274 That way, the code declares only the vars that it needs.
14275 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
14276 * s/cygwin.h (PTY_ITERATION): Likewise.
14277 * s/darwin.h (PTY_ITERATION): Likewise.
14278 * s/gnu-linux.h (PTY_ITERATION): Likewise.
14279
14280 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
14281 * process.c (allocate_pty): Don't declare stb unless it's needed.
14282
14283 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
14284 (CONSTANTLIM): Remove; unused.
14285 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
14286 Define only if needed.
14287
14288 * unexelf.c (unexec): Name an expression,
14289 to avoid gcc -Wbad-function-cast warning.
14290 Use a different way to cause a compilation error if anyone uses
14291 n rather than nn, a way that does not involve shadowing.
14292 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
14293
14294 * deps.mk (unexalpha.o): Remove; unused.
14295
14296 New file unexec.h, the (simple) interface for unexec (Bug#8267).
14297 * unexec.h: New file.
14298 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
14299 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
14300 Depend on unexec.h.
14301 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
14302 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
14303 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
14304 Change as necessary to match prototype in unexec.h.
14305
14306 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
14307 shadowing.
14308 (back_comment, skip_chars): Mark vars as initialized.
14309
14310 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
14311 Rename locals to avoid shadowing.
14312
14313 * lread.c (read1): Rewrite so as not to use empty "else".
14314 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
14315
14316 * print.c (Fredirect_debugging_output): Fix pointer signedess.
14317
14318 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
14319 warning when compiling print.c.
14320
14321 * font.c (font_unparse_fcname): Abort in an "impossible" situation
14322 instead of using an uninitialized var.
14323 (font_sort_entities): Mark var as initialized.
14324
14325 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
14326
14327 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
14328 pointers to constants.
14329 (font_parse_fcname): Remove unused vars.
14330 (font_delete_unmatched): Now static.
14331 (font_get_spec): Remove; unused.
14332 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
14333 (font_update_drivers, Ffont_get_glyphs, font_add_log):
14334 Rename or move locals to avoid shadowing.
14335
14336 * fns.c (require_nesting_list, require_unwind): Now static.
14337 (Ffillarray): Rename locals to avoid shadowing.
14338
14339 * floatfns.c (domain_error2): Define only if needed.
14340 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
14341
14342 * alloc.c (mark_backtrace): Move decl from here ...
14343 * lisp.h: ... to here, so that it can be checked.
14344
14345 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
14346 (Fdefvar): Rewrite so as not to use empty "else".
14347 (lisp_indirect_variable): Name an expression,
14348 to avoid gcc -Wbad-function-cast warning.
14349 (Fdefvar): Rename locals to avoid shadowing.
14350
14351 * callint.c (quotify_arg, quotify_args): Now static.
14352 (Fcall_interactively): Rename locals to avoid shadowing.
14353 Use const pointer when appropriate.
14354
14355 * lisp.h (get_system_name, get_operating_system_release):
14356 Move decls here, to check interfaces.
14357 * process.c (get_operating_system_release): Move decl to lisp.h.
14358 * xrdb.c (get_system_name): Likewise.
14359 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
14360 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
14361 some of which prompt warnings from gcc -Wbad-function-cast.
14362 (Fformat_time_string, Fencode_time, Finsert_char):
14363 (Ftranslate_region_internal, Fformat):
14364 Rename or remove local vars to avoid shadowing.
14365 (Ftranslate_region_internal): Mark var as initialized.
14366
14367 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
14368 avoid shadowing.
14369
14370 * lisp.h (eassert): Check that the argument compiles, even if
14371 ENABLE_CHECKING is not defined.
14372
14373 * data.c (Findirect_variable): Name an expression, to avoid
14374 gcc -Wbad-function-cast warning.
14375 (default_value, arithcompare, arith_driver, arith_error): Now static.
14376 (store_symval_forwarding): Rename local to avoid shadowing.
14377 (Fmake_variable_buffer_local, Fmake_local_variable):
14378 Mark variables as initialized.
14379 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
14380
14381 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
14382 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14383 Rename locals to avoid shadowing.
14384 (mark_stack): Move local variables into the #ifdef region where
14385 they're used.
14386 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14387 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14388 needed otherwise.
14389 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14390 (GC_STRING_CHARS): Remove; not used.
14391 (Fmemory_limit): Cast sbrk's returned value to char *.
14392
14393 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14394 avoids undefined behavior in theory.
14395
14396 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14397
14398 Use functions, not macros, for up- and down-casing (Bug#8254).
14399 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14400 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
14401 to use the following functions instead of these macros.
14402 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
14403 EMACS_INT, since callers assume the returned value fits in int.
14404 (upcase1): Likewise, for UPCASE_TABLE.
14405 (uppercasep, lowercasep, upcase): New static inline functions.
14406 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
14407 the race-condition problem in the old DOWNCASE.
14408
14409 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14410 Rename locals to avoid shadowing.
14411 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
14412 (regex_compile, re_search_2, re_match_2_internal):
14413 Remove unused local vars.
14414 (FREE_VAR): Rewrite so as not to use empty "else",
14415 which gcc can warn about.
14416 (regex_compile, re_match_2_internal): Mark locals as initialized.
14417 (RETALLOC_IF): Define only if needed.
14418 (WORDCHAR_P): Likewise. This one is never needed, but is used
14419 only in a comment talking about a compiler bug, so put inside
14420 the #if 0 of that comment.
14421 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14422 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14423 Remove; unused.
14424
14425 * search.c (boyer_moore): Rename locals to avoid shadowing.
14426 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14427 (PREV_CHAR_BOUNDARY): Likewise.
14428
14429 * search.c (simple_search): Remove unused var.
14430
14431 * dired.c (compile_pattern): Move decl from here ...
14432 * lisp.h: ... to here, so that it can be checked.
14433 (struct re_registers): New forward decl.
14434
14435 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14436
14437 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14438 All uses changed.
14439 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14440 Rename locals to avoid shadowing.
14441 (Fvertical_motion): Mark locals as initialized.
14442
14443 * casefiddle.c (casify_object, casify_region): Now static.
14444 (casify_region): Mark local as initialized.
14445
14446 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14447
14448 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14449 New macros, so that the caller can use some names other than
14450 gcpro1, gcpro2, etc.
14451 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14452 of the new macros.
14453 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14454 argument, for consistency with GCPRO2_VAR, etc: it is now the
14455 prefix of the variable, not the variable itself. All uses
14456 changed.
14457 * dired.c (directory_files_internal, file_name_completion):
14458 Rename locals to avoid shadowing.
14459
14460 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14461 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14462 dired.c's scmp function, had undefined behavior.
14463 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14464 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14465 * buffer.h: ... to here, because these macros use current_buffer,
14466 and the new implementation with inline functions needs to have
14467 current_buffer in scope now, rather than later when the macros
14468 are used.
14469 (downcase, upcase1): New static inline functions.
14470 (DOWNCASE, UPCASE1): Reimplement using these functions.
14471 This avoids undefined behavior in expressions like
14472 DOWNCASE (x) == DOWNCASE (y), which previously suffered
14473 from race conditions in accessing the global variables
14474 case_temp1 and case_temp2.
14475 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14476 * lisp.h (case_temp1, case_temp2): Remove their decls.
14477 * character.h (ASCII_CHAR_P): Move from here ...
14478 * lisp.h: ... to here, so that the inline functions mentioned
14479 above can use them.
14480
14481 * dired.c (directory_files_internal_unwind): Now static.
14482
14483 * fileio.c (file_name_as_directory, directory_file_name):
14484 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14485 Now static.
14486 (file_name_as_directory): Use const pointers when appropriate.
14487 (Fexpand_file_name): Likewise. In particular, newdir might
14488 point at constant storage, so make it a const pointer.
14489 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
14490 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14491 signedness issues.
14492 (Fset_file_times, Finsert_file_contents, auto_save_error):
14493 Rename locals to avoid shadowing.
14494
14495 * minibuf.c (choose_minibuf_frame_1): Now static.
14496 (Ftry_completion, Fall_completions): Rename or remove locals
14497 to avoid shadowing.
14498
14499 * marker.c (bytepos_to_charpos): Remove; unused.
14500
14501 * lisp.h (verify_bytepos, count_markers): New decls,
14502 so that gcc does not warn that these functions aren't declared.
14503
14504 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14505 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
14506 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
14507 (copy_text): Remove unused local var.
14508
14509 * filelock.c (within_one_second): Now static.
14510 (lock_file_1): Rename local to avoid shadowing.
14511
14512 * buffer.c (fix_overlays_before): Mark locals as initialized.
14513 (fix_start_end_in_overlays): Likewise. This function should be
14514 simplified by using pointers-to-pointers, but that's a different
14515 matter.
14516 (switch_to_buffer_1): Now static.
14517 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14518 (report_overlay_modification): Rename locals to avoid shadowing.
14519
14520 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
14521 Fix pointer signedness issue.
14522 (sys_subshell): Mark local as volatile if checking for lint,
14523 to suppress a gcc -Wclobbered warning that does not seem to be right.
14524 (MAXPATHLEN): Define only if needed.
14525
14526 * process.c (serial_open, serial_configure): Move decls from here ...
14527 * systty.h: ... to here, so that they can be checked.
14528
14529 * fns.c (get_random, seed_random): Move extern decls from here ...
14530 * lisp.h: ... to here, so that they can be checked.
14531
14532 * sysdep.c (reset_io): Now static.
14533 (wait_for_termination_signal): Remove; unused.
14534
14535 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
14536 (copy_keymap_item, append_key, push_text_char_description):
14537 Now static.
14538 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
14539 (DENSE_TABLE_SIZE): Remove; unused.
14540 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
14541 (describe_map_tree):
14542 Rename locals to avoid shadowing.
14543
14544 * keyboard.c: Declare functions static if they are not used elsewhere.
14545 (echo_char, echo_dash, cmd_error, top_level_2):
14546 (poll_for_input, handle_async_input): Now static.
14547 (read_char, kbd_buffer_get_event, make_lispy_position):
14548 (make_lispy_event, make_lispy_movement, apply_modifiers):
14549 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14550 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14551 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
14552 (read_key_sequence, read_char): Mark locals as initialized.
14553 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
14554
14555 * keyboard.h (make_ctrl_char): New decl.
14556 (mark_kboards): Move decl here ...
14557 * alloc.c (mark_kboards): ... from here.
14558
14559 * lisp.h (force_auto_save_soon): New decl.
14560
14561 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
14562 (DEFINE_DUMMY_FUNCTION): New macro.
14563 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14564 Use it.
14565 (main): Add casts to avoid warnings
14566 if GCC considers string literals to be constants.
14567
14568 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14569
14570 * dbusbind.c: Pointer signedness fixes.
14571 (xd_signature, xd_append_arg, xd_initialize):
14572 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14573 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14574 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14575 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14576
14577 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14578 if GCC considers string literals to be constants.
14579 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
14580
14581 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14582
14583 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14584 (print_preprocess, print_object): New macro to fix last change.
14585
14586 * print.c (print_preprocess): Don't forget font objects.
14587
14588 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
14589
14590 * emacs.c (USAGE3): Doc fixes.
14591
14592 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14593
14594 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14595 structure.
14596
14597 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
14598
14599 * lisp.h (VWindow_system, Qfile_name_history):
14600 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14601 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14602 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14603
14604 * w32select.c: Don't #include "keyboard.h".
14605 (run_protected): Add extern declaration for waiting_for_input.
14606
14607 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14608 * w32console.c (detect_input_pending, read_input_pending)
14609 (encode_terminal_code):
14610 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14611 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14612 (w32_system_caret_y, Qfile_name_history):
14613 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14614 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14615 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14616 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14617 * w32proc.c (Qlocal, report_file_error):
14618 * w32term.c (Vwindow_system, updating_frame):
14619 * w32uniscribe.c (initialized, uniscribe_font_driver):
14620 Remove unneeded extern declarations.
14621
14622 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
14623
14624 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
14625
14626 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
14627
14628 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14629 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14630 These macros can no longer be used for assignment.
14631
14632 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14633 Assign struct members directly, instead of using BUF_BEGV etc.
14634 (record_buffer_markers, fetch_buffer_markers): New functions for
14635 recording and fetching special buffer markers.
14636 (set_buffer_internal_1, set_buffer_temp): Use them.
14637
14638 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14639
14640 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14641
14642 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14643 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14644
14645 * xdisp.c (hscroll_window_tree):
14646 (reconsider_clip_changes): Use PT instead of BUF_PT.
14647
14648 2011-03-13 Eli Zaretskii <eliz@gnu.org>
14649
14650 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14651 $(EMACS_ROOT)/lib/intprops.h.
14652
14653 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14654
14655 Fix more problems found by GCC 4.5.2's static checks.
14656
14657 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14658 to unsigned char * to avoid compiler diagnostic.
14659 (xg_free_frame_widgets): Make it clear that a local variable is
14660 needed only if USE_GTK_TOOLTIP.
14661 (gdk_window_get_screen): Make it clear that this macro is needed
14662 only if USE_GTK_TOOLTIP.
14663 (int_gtk_range_get_value): New function, which avoids a diagnostic
14664 from gcc -Wbad-function-cast.
14665 (xg_set_toolkit_scroll_bar_thumb): Use it.
14666 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14667 diagnostic from gcc -Wbad-function-cast.
14668 (get_utf8_string, xg_get_file_with_chooser):
14669 Rename locals to avoid shadowing.
14670 (create_dialog): Move locals to avoid shadowing.
14671
14672 * xgselect.c (xg_select): Remove unused var.
14673
14674 * image.c (four_corners_best): Mark locals as initialized.
14675 (gif_load): Initialize transparent_p to zero (Bug#8238).
14676 Mark another local as initialized.
14677 (my_png_error, my_error_exit): Mark with NO_RETURN.
14678
14679 * image.c (clear_image_cache): Now static.
14680 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
14681 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
14682 (x_edge_detection): Remove unnecessary cast that
14683 gcc -Wbad-function-cast diagnoses.
14684 (gif_load): Fix pointer signedness.
14685 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14686 (jpeg_load, gif_load): Rename locals to avoid shadowing.
14687
14688 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
14689
14690 Improve quality of tests for time stamp overflow.
14691 For example, without this patch (encode-time 0 0 0 1 1
14692 1152921504606846976) returns the obviously-bogus value (-948597
14693 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14694 reports time overflow. See
14695 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
14696 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14697 * editfns.c: Include limits.h and intprops.h.
14698 (TIME_T_MIN, TIME_T_MAX): New macros.
14699 (time_overflow): Move earlier, to before first use.
14700 (hi_time, lo_time): New functions, for an accurate test for
14701 out-of-range times.
14702 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14703 (Fget_internal_run_time): Don't assume time_t fits in int.
14704 (make_time): Use list2 instead of Fcons twice.
14705 (Fdecode_time): More accurate test for out-of-range times.
14706 (check_tm_member): New function.
14707 (Fencode_time): Use it, to test for out-of-range times.
14708 (lisp_time_argument): Don't rely on undefined left-shift and
14709 right-shift behavior when checking for time stamp overflow.
14710
14711 * editfns.c (time_overflow): New function, refactoring common code.
14712 (Fformat_time_string, Fdecode_time, Fencode_time):
14713 (Fcurrent_time_string): Use it.
14714
14715 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14716 * dired.c (make_time): Move to ...
14717 * editfns.c (make_time): ... here.
14718 * systime.h: Note the move.
14719
14720 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14721
14722 * fringe.c (update_window_fringes): Remove unused variables.
14723
14724 * unexmacosx.c (copy_data_segment): Also copy __got section.
14725 (Bug#8223)
14726
14727 2011-03-12 Eli Zaretskii <eliz@gnu.org>
14728
14729 * termcap.c [MSDOS]: Include "msdos.h".
14730 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14731 Constify `char *' arguments and their references according to
14732 prototypes in tparam.h.
14733
14734 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
14735
14736 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14737 Adapt all references accordingly.
14738
14739 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14740
14741 2011-03-11 Tom Tromey <tromey@redhat.com>
14742
14743 * buffer.c (syms_of_buffer): Remove obsolete comment.
14744
14745 2011-03-11 Eli Zaretskii <eliz@gnu.org>
14746
14747 * termhooks.h (encode_terminal_code): Declare prototype.
14748
14749 * msdos.c (encode_terminal_code): Don't declare prototype.
14750
14751 * term.c (encode_terminal_code): Now external again, used by
14752 w32console.c and msdos.c.
14753
14754 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14755 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
14756
14757 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
14758
14759 Fix some minor problems found by GCC 4.5.2's static checks.
14760
14761 * fringe.c (update_window_fringes): Mark locals as initialized
14762 (Bug#8227).
14763 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
14764
14765 * alloc.c (mark_fringe_data): Move decl from here ...
14766 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
14767 to check its interface.
14768 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
14769
14770 * fontset.c (free_realized_fontset): Now static.
14771 (Fset_fontset_font): Rename local to avoid shadowing.
14772 (fontset_font): Mark local as initialized.
14773 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
14774
14775 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
14776
14777 * xselect.c (x_disown_buffer_selections): Remove; not used.
14778 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
14779 (x_own_selection, Fx_disown_selection_internal): Rename locals
14780 to avoid shadowing.
14781 (x_handle_dnd_message): Remove local to avoid shadowing.
14782
14783 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
14784 so that the caller can use some name other than gcpro1.
14785 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
14786 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14787 (Fx_backspace_delete_keys_p):
14788 Use them to avoid shadowing, and rename vars to avoid shadowing.
14789 (x_decode_color, x_set_name, x_window): Now static.
14790 (Fx_create_frame): Add braces to silence GCC warning.
14791 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
14792 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
14793 Remove unused locals.
14794 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14795 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
14796 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
14797 macros.
14798
14799 * xterm.h (x_mouse_leave): New decl.
14800
14801 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
14802 Remove unused functions.
14803 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
14804 (x_calc_absolute_position): Now static.
14805 (XTread_socket): Don't define label "out" unless it's used.
14806 Don't declare local "event" unless it's used.
14807 (x_iconify_frame, x_free_frame_resources): Don't declare locals
14808 unless they are used.
14809 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
14810 (x_fatal_error_signal): Remove; not used.
14811 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
14812 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
14813 (x_error_catcher, x_connection_closed, x_error_handler):
14814 (x_error_quitter, xembed_send_message, x_iconify_frame):
14815 (my_log_handler): Rename locals to avoid shadowing.
14816 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
14817 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
14818
14819 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
14820 Rename or move locals to avoid shadowing.
14821 (tty_defined_color, merge_face_heights): Now static.
14822 (free_realized_faces_for_fontset): Remove; not used.
14823 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
14824 does not deduce is never used uninitialized.
14825 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
14826 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
14827
14828 * terminal.c (store_terminal_param): Now static.
14829
14830 * xmenu.c (menu_highlight_callback): Now static.
14831 (set_frame_menubar): Remove unused local.
14832 (xmenu_show): Rename parameter to avoid shadowing.
14833 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
14834 since they might point to immutable storage.
14835 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
14836 since it's unused otherwise.
14837
14838 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
14839 Add a FIXME, since the code still doesn't look right. (Bug#8215)
14840 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
14841 avoids a gcc -Wuninitialized diagnostic.
14842 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
14843 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
14844 does not deduce are never used uninitialized.
14845
14846 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
14847
14848 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
14849 * window.c (window_loop, size_window):
14850 (run_window_configuration_change_hook, enlarge_window): Likewise.
14851
14852 * window.c (display_buffer): Now static.
14853 (size_window): Mark variables that gcc -Wuninitialized
14854 does not deduce are never used uninitialized.
14855 * window.h (check_all_windows): New decl, to forestall
14856 gcc -Wmissing-prototypes diagnostic.
14857 * dispextern.h (bidi_dump_cached_states): Likewise.
14858
14859 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
14860 shadowing.
14861 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
14862 Include <limits.h>.
14863 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
14864 and to avoid gcc -Wuninitialized warning.
14865 (load_charset_map): Mark variables that gcc -Wuninitialized
14866 does not deduce are never used uninitialized.
14867 (load_charset): Abort instead of using uninitialized var (Bug#8229).
14868
14869 * coding.c (coding_set_source, coding_set_destination):
14870 Use "else { /* comment */ }" rather than "else /* comment */;"
14871 for clarity, and to avoid gcc -Wempty-body warning.
14872 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14873 a block, when the outer 'i' will do.
14874 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14875 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14876 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14877 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14878 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14879 Rename locals to avoid shadowing.
14880 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
14881 * coding.c (emacs_mule_char, encode_invocation_designation):
14882 Now static, since they're not used elsewhere.
14883 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
14884 (decode_coding_object, encode_coding_object, detect_coding_system):
14885 (decode_coding_emacs_mule): Mark variables that gcc
14886 -Wuninitialized does not deduce are never used uninitialized.
14887 (detect_coding_iso_2022): Initialize a local variable that might
14888 be used uninitialized. Leave a FIXME because it's not clear that
14889 this initialization is needed. (Bug#8211)
14890 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14891 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14892 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14893 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14894 Remove unused macros.
14895
14896 * category.c (hash_get_category_set): Remove unused local var.
14897 (copy_category_table): Now static, since it's not used elsewhere.
14898 * character.c (string_count_byte8): Likewise.
14899
14900 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14901 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14902
14903 * chartab.c (copy_sub_char_table): Now static, since it's not used
14904 elsewhere.
14905 (sub_char_table_ref_and_range, char_table_ref_and_range):
14906 Rename locals to avoid shadowing.
14907 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
14908
14909 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
14910 (BIDI_BOB): Remove unused macro.
14911
14912 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14913 deduce are never used uninitialized.
14914 * term.c (encode_terminal_code): Likewise.
14915
14916 * term.c (encode_terminal_code): Now static. Remove unused local.
14917
14918 * tparam.h: New file.
14919 * term.c, tparam.h: Include it.
14920 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14921 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14922 Move these decls to tparam.h, and make them agree with what
14923 is actually in tparam.c. The previous trick of using incompatible
14924 decls in different modules does not conform to the C standard.
14925 All callers of tparam changed to use tparam's actual API.
14926 * tparam.c (tparam1, tparam, tgoto):
14927 Use const pointers where appropriate.
14928
14929 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14930 * cm.h (struct cm): Likewise.
14931 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14932 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14933 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14934 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14935 (turn_on_face, init_tty): Likewise.
14936 * termchar.h (struct tty_display_info): Likewise.
14937
14938 * term.c (term_mouse_position): Rename local to avoid shadowing.
14939
14940 * alloc.c (mark_ttys): Move decl from here ...
14941 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14942
14943 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14944
14945 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14946
14947 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
14948
14949 * search.c (compile_pattern_1): Remove argument regp, unused since
14950 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14951 (compile_pattern): Don't pass it.
14952
14953 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14954
14955 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14956 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14957 for ! HAVE_GTK3.
14958 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14959
14960 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14961
14962 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14963 gdk_window_get_screen, gdk_window_get_geometry,
14964 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14965 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14966 (xg_get_pixbuf_from_pixmap): New function.
14967 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14968 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14969 Call xg_get_pixbuf_from_pixmap instead of
14970 gdk_pixbuf_get_from_drawable.
14971 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14972 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14973 (xg_check_special_colors): Use GtkStyleContext and its functions
14974 for HAVE_GTK3.
14975 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14976 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14977 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
14978 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14979 Call gtk_widget_get_preferred_size.
14980 (xg_frame_resized): gdk_window_get_geometry only takes 5
14981 parameters.
14982 (xg_win_to_widget, xg_event_is_for_menubar):
14983 Call gdk_x11_window_lookup_for_display.
14984 (xg_set_widget_bg): New function.
14985 (delete_cb): New function.
14986 (xg_create_frame_widgets): Connect delete-event to delete_cb.
14987 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
14988 (xg_set_background_color): Call xg_set_widget_bg.
14989 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14990 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14991 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14992 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14993 if ! HAVE_GTK3.
14994 (update_frame_tool_bar): Call gtk_widget_hide.
14995 (xg_initialize): Use GDK_KEY_g.
14996
14997 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
14998 if ! HAVE_GTK3
14999 (x_session_initialize): Call gdk_x11_set_sm_client_id.
15000
15001 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
15002 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
15003 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
15004
15005 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
15006
15007 * w32xfns.c (select_palette): Check success of RealizePalette against
15008 GDI_ERROR, not zero.
15009
15010 See ChangeLog.11 for earlier changes.
15011
15012 ;; Local Variables:
15013 ;; coding: utf-8
15014 ;; End:
15015
15016 Copyright (C) 2011-2012 Free Software Foundation, Inc.
15017
15018 This file is part of GNU Emacs.
15019
15020 GNU Emacs is free software: you can redistribute it and/or modify
15021 it under the terms of the GNU General Public License as published by
15022 the Free Software Foundation, either version 3 of the License, or
15023 (at your option) any later version.
15024
15025 GNU Emacs is distributed in the hope that it will be useful,
15026 but WITHOUT ANY WARRANTY; without even the implied warranty of
15027 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15028 GNU General Public License for more details.
15029
15030 You should have received a copy of the GNU General Public License
15031 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.