Separate read and write access to Lisp_Object slots of Lisp_Process.
[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 Lisp_Process.
4 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6
7 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8
9 Separate read and write access to Lisp_Object slots of struct window.
10 * window.h (WGET, WSET): New macros similar to AREF and ASET.
11 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
12 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
13 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
14 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
15 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
16 Adjust users.
17
18 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
19
20 Fix Windows build errors introduced after converting to FGET and FSET.
21 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
22 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
23 (w32_judge_scroll_bars): Change to use FSET.
24 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
25
26 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
27
28 Fix replacement typo.
29 * window.c (replace_window): Set root_window instead of
30 selected_window. This fixes a total window subsystem
31 malfunction reported by Bastien Guerry <bzg@gnu.org>.
32
33 2012-08-06 Glenn Morris <rgm@gnu.org>
34
35 * lisp.mk (lisp): Add language/persian.elc.
36
37 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
38
39 Separate read and write access to Lisp_Object slots of struct frame.
40 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
41 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
42 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
43 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
44 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
45
46 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
47
48 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
49
50 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
51
52 Generalize common compile-time constants.
53 * lisp.h (header_size, bool_header_size, word_size): Now here.
54 (struct Lisp_Vector): Add comment.
55 (struct Lisp_Bool_Vector): Move up to define handy constants.
56 (VECSIZE, PSEUDOVECSIZE): Simplify.
57 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
58 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
59 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
60 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
61 * xfont.c, xmenu.c: Use word_size where appropriate.
62
63 2012-08-05 Lawrence Mitchell <wence@gmx.li>
64
65 * search.c (Freplace_match): Treat \? in the replacement text
66 literally (Bug#8161).
67
68 2012-08-05 Chong Yidong <cyd@gnu.org>
69
70 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
71 * frame.c (Vdelete_frame_functions):
72 * emacs.c (Vkill_emacs_hook): Doc fix.
73
74 2012-08-04 Eli Zaretskii <eliz@gnu.org>
75
76 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
77 --with-x-toolkit=no builds.
78 Reported by Carsten Mattner <carstenmattner@gmail.com>.
79
80 2012-08-04 Chong Yidong <cyd@gnu.org>
81
82 * syntax.c (Fmodify_syntax_entry): Doc fix.
83
84 2012-08-04 Eli Zaretskii <eliz@gnu.org>
85
86 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
87 * w32.c (init_environment): Change the default values of many
88 environment variables in dflt_envvars[] to NULL, to avoid pushing
89 them into environment when they were not already defined. Remove
90 the code that deletes site-lisp subdirectories from the default
91 value of EMACSLOADPATH, as it is no longer needed.
92 (check_windows_init_file): Now external, not static. Use
93 Vload_path as is, without adding anything, as this function is now
94 called when Vload_path is already set up.
95
96 * w32.h (check_windows_init_file): Add prototype.
97
98 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
99 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
100 compatibility with Posix platforms.
101 (main): Move the call to check_windows_init_file to here from
102 w32.c.
103 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
104 any, in the DEFALT argument into the root of the Emacs build or
105 installation tree, as appropriate.
106
107 * callproc.c (init_callproc_1): Call decode_env_path instead of
108 doing its equivalent by hand.
109 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
110 the code that sets Vexec_path run on MS-Windows.
111
112 * lread.c (init_lread): Add comments to #ifdef's.
113
114 * msdos.c (dos_set_window_size, IT_update_begin)
115 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
116 instead of direct references.
117
118 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
119
120 Export DEFAULT_REHASH_* to GDB.
121 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
122 Now constants, not macros.
123
124 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
125
126 Remove unnecessary casts involving pointers.
127 These casts are no longer needed now that we assume C89 or later,
128 since they involve casting to or from void *.
129 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
130 (make_pure_float, make_pure_vector):
131 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
132 * macros.c (Fstart_kbd_macro):
133 * menu.c (find_and_return_menu_selection):
134 * minibuf.c (read_minibuf_noninteractive):
135 * sysdep.c (closedir):
136 * xdisp.c (x_produce_glyphs):
137 * xfaces.c (compare_fonts_by_sort_order):
138 * xfns.c (x_real_positions, select_visual):
139 * xselect.c (x_stop_queuing_selection_requests)
140 (x_get_window_property, x_get_window_property_as_lisp_data):
141 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
142 Remove unnecessary pointer casts.
143 * alloc.c (record_xmalloc): New function.
144 * lisp.h (record_xmalloc): New decl.
145 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
146 more like a function. This is because the pointer cast is not
147 needed. All uses changed.
148 * print.c (print_string, print_error_message): Avoid length recalc.
149
150 Improve fix for macroexp crash with debugging (Bug#12118).
151 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
152 ARRAY_MARK_FLAG when checking subscripts, because ASET is
153 not supposed to be invoked from the garbage collector.
154 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
155 (gc_aset): New function, which is like ASET but can be
156 used in the garbage collector.
157 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
158 (set_hash_index): Use it instead of ASET.
159
160 2012-08-03 Eli Zaretskii <eliz@gnu.org>
161
162 Support symlinks on latest versions of MS-Windows.
163 * w32.c: Include winioctl.h and aclapi.h.
164 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
165 (revert_to_self): Forward declarations of static functions.
166 <static BOOL g_b_init_get_security_info>:
167 <g_b_init_create_symbolic_link>: New static flags.
168 (globals_of_w32): Initialize them to zero.
169 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
170 (map_w32_filename): Improve commentary. Simplify switch.
171 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
172 headers (most versions of MinGW w32api don't).
173 (get_security_info, create_symbolic_link)
174 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
175 New functions.
176 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
177 in the argument file name.
178 (sys_access): Call unc_volume_file_attributes only if
179 GetFileAttributes fails with network-related error codes.
180 (sys_rename): Diagnose renaming of a symlink when the user doesn't
181 have the required privileges.
182 (get_file_security_desc_by_name): Renamed from
183 get_file_security_desc.
184 (stat_worker): New function, with most of the guts of 'stat', and
185 with addition of handling of symlinks and support for 'lstat'. If
186 possible, get file's attributes and security information by
187 handle, not by name. Produce S_IFLNK bit for symlinks, when
188 called from 'lstat'.
189 (stat, lstat): New functions, call 'stat_worker'.
190 (symlink, readlink, careadlinkat): Rewritten to create and resolve
191 symlinks when the underlying filesystem supports them.
192
193 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
194
195 Fix macroexp crash on Windows with debugging (Bug#12118).
196 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
197 checking subscripts; problem introduced with the recent
198 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
199 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
200 since it's used in non-static inline functions now.
201
202 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
203 Don't assume buffer size fits in 'int'. Remove unused local.
204
205 Use C99-style 'extern inline' if available.
206 * buffer.h (BUFFER_INLINE):
207 * category.h (CATEGORY_INLINE):
208 * character.h (CHARACTER_INLINE):
209 * charset.h (CHARSET_INLINE):
210 * composite.h (COMPOSITE_INLINE):
211 * dispextern.h (DISPEXTERN_INLINE):
212 * lisp.h (LISP_INLINE):
213 * systime.h (SYSTIME_INLINE):
214 New macro, replacing 'static inline' in this header.
215 * buffer.h, category.h, character.h, charset.h, composite.h:
216 * dispextern.h, lisp.h, systime.h:
217 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
218 * alloc.c (LISP_INLINE):
219 * buffer.c (BUFFER_INLINE):
220 * category.c (CATEGORY_INLINE):
221 * character.c (CHARACTER_INLINE):
222 * charset.c (CHARSET_INLINE):
223 * composite.c (COMPOSITE_INLINE):
224 * dispnew.c (DISPEXTERN_INLINE):
225 * sysdep.c (SYSTIME_INLINE):
226 Define to EXTERN_INLINE, so that the corresponding functions
227 are compiled into code.
228 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
229 (INLINE_HEADER_END): New macros.
230 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
231 since it's used in non-static inline functions now.
232 (VALMASK) [!USE_LSB_TAG]: Likewise.
233
234 2012-08-02 Glenn Morris <rgm@gnu.org>
235
236 * s/: Remove empty directory.
237
238 * s/ms-w32.h: Move to ../nt/inc.
239 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
240 Update for new ms-w32.h location.
241
242 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
243
244 Port to Solaris 8.
245 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
246
247 2012-08-02 Glenn Morris <rgm@gnu.org>
248
249 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
250 hard-coding the path separator.
251
252 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
253
254 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
255 This how ASET and AREF are supposed to work, and makes
256 it easier to think about future improvements. See
257 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
258 * charset.h (set_charset_attr): New function.
259 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
260 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
261 (aref_addr): New function. All uses of &AREF(...) changed.
262 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
263 (set_hash_index): New functions. All lvalue-style uses of
264 HASH_KEY etc. changed.
265 * keyboard.c (set_prop): New function. All lvalue-style uses
266 of PROP changed.
267
268 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
269
270 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
271 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
272 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
273 * nsfns.m (ns_set_name_as_filename): Likewise.
274 * nsmenu.m (ns_update_menubar): Likewise.
275 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
276
277 2012-08-01 Eli Zaretskii <eliz@gnu.org>
278
279 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
280 Adapt to latest changes in field names of the corresponding Lisp
281 objects.
282
283 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
284
285 2012-08-01 Glenn Morris <rgm@gnu.org>
286
287 * s/msdos.h: Remove file.
288 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
289 * Makefile.in (S_FILE): Remove.
290 (config_h): Remove S_FILE.
291
292 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
293
294 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
295 Remove; moved to nt/config.nt.
296
297 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
298
299 Use INTERNAL_FIELD for conses and overlays.
300 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
301 Remove obsolete comment.
302 (MVAR): New macro.
303 (struct Lisp_Overlay): Use INTERNAL_FIELD.
304 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
305
306 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
307
308 Use INTERNAL_FIELD for symbols.
309 * lisp.h (SVAR): New macro. Adjust users.
310 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
311 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
312
313 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
314
315 Use INTERNAL_FIELD for processes.
316 * process.h (PVAR): New macro. Adjust style.
317 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
318 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
319
320 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
321
322 Use INTERNAL_FIELD for windows.
323 * window.h (WVAR): New macro.
324 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
325 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
326 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
327 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
328 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
329 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
330
331 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
332
333 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
334
335 2012-08-01 Glenn Morris <rgm@gnu.org>
336
337 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
338 Move to configure.ac.
339
340 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
341
342 * makefile.w32-in (CONFIG_H): Update dependencies.
343 (CONF_POST_H): New macro.
344
345 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
346
347 2012-07-31 Glenn Morris <rgm@gnu.org>
348
349 * Makefile.in (S_FILE): No longer set by configure.
350
351 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
352 is available.
353 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
354
355 * process.h (NULL_DEVICE):
356 * emacs.c (SEPCHAR):
357 * editfns.c (USER_FULL_NAME): Let configure set them.
358
359 * s/README, s/template.h: Remove files.
360
361 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
362
363 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
364 Move to configure.ac.
365
366 2012-07-31 Eli Zaretskii <eliz@gnu.org>
367
368 * .gdbinit (xframe): Adapt to introduction of FVAR and the
369 resulting renaming of 'struct frame' members.
370
371 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
372
373 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
374 after introduction of FVAR.
375
376 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
377
378 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
379
380 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
381 instead of compositeToPoint.
382 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
383
384 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
385
386 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
387
388 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
389 * lisp.h (INTERNAL_FIELD): New macro.
390 * buffer.h (BUFFER_INTERNAL_FIELD): Removed.
391 (BVAR): Change to use INTERNAL_FIELD.
392 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
393 (KVAR): Change to use INTERNAL_FIELD.
394 * frame.h (FVAR): New macro.
395 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
396 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
397 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
398 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
399 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
400
401 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
402
403 Miscellaneous fixes for non-default X toolkits.
404 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
405 * xterm.c (x_frame_of_widget): Remove redundant prototype.
406 Move under #ifdef USE_LUCID.
407 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
408 definition and usage to avoid warnings.
409
410 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
411
412 * nsterm.m (openFiles): Fix previous checkin.
413
414 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
415
416 * indent.c (compute_motion): Remove unused local.
417
418 2012-07-31 Glenn Morris <rgm@gnu.org>
419
420 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
421
422 * conf_post.h [USG5_4]:
423 Move remaining contents of s/usg5-4-common.h here.
424 * s/usg5-4-common.h: Remove file.
425
426 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
427 * s/irix6-5.h: Remove file.
428
429 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
430 * s/darwin.h: Remove file.
431
432 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
433 * s/hpux10-20.h: Remove file, which is now empty.
434
435 2012-07-30 Glenn Morris <rgm@gnu.org>
436
437 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
438 * Makefile.in (config_h): Add conf_post.h.
439 * makefile.w32-in (CONFIG_H): Add conf_post.h.
440
441 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
442
443 * nsterm.m (ns_do_open_file): New variable.
444 (ns_term_init): Set ns_do_open_file to YES after run returns.
445 (openFile, openTempFile, openFileWithoutUI, openFiles): Open
446 files only if ns_do_open_file.
447
448 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
449
450 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
451 This no-op macro hasn't been needed for many years.
452 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
453
454 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
455 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
456 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
457 gdb_make_enums_visible.
458 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
459 (DIRECTORY_SEP): Now a constant, not a macro.
460
461 2012-07-30 Eli Zaretskii <eliz@gnu.org>
462
463 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
464 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
465
466 * w32term.c <w32_keyboard_codepage>: Renamed from
467 keyboard_codepage and now external. All users changed.
468
469 * w32term.h: Add declaration of w32_keyboard_codepage.
470
471 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
472 the codepage to translate keys to Unicode. If this argument is
473 -1, use the value returned by GetConsoleCP. All callers changed.
474
475 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
476
477 Update .PHONY listings in makefiles.
478 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
479 bootstrap-clean, distclean, maintainer-clean, versioclean,
480 extraclean, frc.
481
482 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
483 This is a bit clearer. Fix some commentary typos.
484
485 2012-07-30 Glenn Morris <rgm@gnu.org>
486
487 * s/netbsd.h: Let configure include signal.h if needed.
488 Remove file, which is now empty.
489
490 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
491 Let configure set them.
492 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
493 No more need to undefine.
494
495 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
496
497 * keymap.c (Fkey_description): Don't remove 0x80 bit from
498 non-single-byte char when adding meta modifier. (Bug#12090)
499
500 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
501
502 Convert safe_call to use variable number of arguments.
503 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
504 (safe_call2): Fix comment.
505 * lisp.h (safe_call): Adjust prototype.
506 * coding.c (encode_coding_object): Change to use safe_call2.
507 * xfaces.c (merge_face_heights): Change to use safe_call1.
508
509 2012-07-30 Glenn Morris <rgm@gnu.org>
510
511 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
512 does that unconditionally. Remove file, which is now empty.
513
514 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
515 Remove empty files.
516
517 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
518
519 Export to GDB most of lisp.h's remaining object-like macros.
520 * lisp.h (min, max): Move earlier, because they're used earlier now.
521 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
522 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
523 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
524 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
525 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
526 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
527 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
528 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
529 Now constants, for GDB. They need not be macros.
530 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
531 Now constants, for GDB, as well as macros, for static initializers.
532 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
533 Move to after the definition of struct Lisp_Char_Table,
534 since the former now needs that type defined.
535 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
536 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
537 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
538 New enums, for gdb_make_enums_visible.
539 (GLYPH_MODE_LINE_FACE): Remove; unused.
540 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
541 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
542 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
543 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
544 enum maxargs, enum MAX_ALLOCA.
545 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
546 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
547 no longer needed, now that they are done in lisp.h.
548
549 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
550
551 Cleanup string bytes checking.
552 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
553 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
554 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
555 (check_sblock, compact_small_strings): Simplify.
556
557 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
558
559 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
560 These macros are confusing and no longer need to be defined, as
561 the enum values now suffice. All uses replaced with definiens.
562 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
563
564 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
565
566 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
567 ($(BLD)/w32console.$(O)): Update dependencies.
568
569 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
570
571 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
572 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
573 time. Adjust users.
574 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
575
576 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
577
578 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
579 setting sitelisp (Bug#12010).
580
581 2012-07-29 Eli Zaretskii <eliz@gnu.org>
582
583 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
584
585 * w32heap.c (cache_system_info):
586 * w32.c (sys_rename):
587 * w32proc.c (find_child_console, sys_kill): All users changed.
588
589 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
590
591 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
592
593 2012-07-29 Eli Zaretskii <eliz@gnu.org>
594
595 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
596
597 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
598
599 Cleanup statistics calculation in Fgarbage_collect.
600 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
601 zombies percentage calculation. Simplify elapsed time calculation.
602
603 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
604
605 Generalize marker debugging code under MARKER_DEBUG and use eassert.
606 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
607 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
608 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
609 (replace_range, replace_range_2, del_range_2): Change to eassert.
610 * marker.c (byte_char_debug_check): Adjust style.
611
612 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
613
614 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
615 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
616 long-ago-commented-out code that talks about "WIN32".
617 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
618 All uses changed.
619
620 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
621
622 Use Gnulib stdalign module (Bug#9772, Bug#9960).
623 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
624 Simplify by using alignof.
625 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
626 * lisp.h: Include <stdalign.h>.
627 (GCALIGNMENT): New macro and constant.
628 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
629 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
630 (stdalign): New macro, if not already defined.
631
632 2012-07-28 Eli Zaretskii <eliz@gnu.org>
633
634 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
635 * w32inevt.c: Include w32inevt.h.
636 (w32_read_console_input): New inline function, calls either
637 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
638 w32_console_unicode_input.
639 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
640 (w32_kbd_patch_key, key_event): Use the codepage returned by
641 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
642 (key_event): use uChar.UnicodeChar only if
643 w32_console_unicode_input is non-zero.
644
645 * w32console.c: Include w32heap.h.
646 <w32_console_unicode_input>: New global variable.
647 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
648 family of Windows, zero otherwise.
649
650 * w32inevt.h: Declare w32_console_unicode_input.
651
652 * xdisp.c (init_iterator): Don't reference tip_frame in a build
653 --without-x. (Bug#11742)
654
655 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
656
657 Adjust GDB to reflect pvec_type changes (Bug#12036).
658 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
659 2012-07-04 changes to pseudovector representation. Problem
660 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
661
662 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
663
664 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
665 bus address.
666 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
667
668 2012-07-27 Eli Zaretskii <eliz@gnu.org>
669
670 * alloc.c (listn): Fix the order the arguments are consed onto the
671 list.
672
673 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
674 enumeration constants, as PURE and HEAP are too general, and clash
675 with other headers and sources, such as gmalloc.c and the
676 MS-Windows system headers. All users changed.
677
678 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
679
680 Revert last save_excursion_save and save_excursion_restore changes.
681 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
682 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
683
684 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
685
686 Fix recently-introduced typos in Windows port.
687 Reported by Martin Rudalics <rudalics@gmx.at>.
688 * w32.c (init_environment): Replace comma with semicolon.
689 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
690
691 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
692
693 Improve GDB symbol export (Bug#12036).
694 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
695 arms of an 'if', not using conditional expressions; otherwise GDB
696 complains about the types in the unevaluated arm when the argument
697 is an integer literal.
698 (xgetint): Simplify expression.
699 * alloc.c (gdb_make_enums_visible): New constant. This ports to
700 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
701 Zaretskii in <http://bugs.gnu.org/12036#13>.
702 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
703 needed now that we have gdb_make_enums_visible.
704 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
705 (enum enum_USE_LSB_TAG):
706 New enum types, packaging up enums that need to be exported to GDB.
707
708 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
709
710 Utility function to make a list from specified amount of objects.
711 * lisp.h (enum constype): New datatype.
712 (listn): New prototype.
713 * alloc.c (listn): New function.
714 (Fmemory_use_count, syms_of_alloc): Use it.
715 * buffer.c (syms_of_buffer): Likewise.
716 * callint.c (syms_of_callint): Likewise.
717 * charset.c (define_charset_internal): Likewise.
718 * coding.c (syms_of_coding): Likewise.
719 * keymap.c (syms_of_keymap): Likewise.
720 * search.c (syms_of_search): Likewise.
721 * syntax.c (syms_of_syntax): Likewise.
722 * w32.c (init_environment): Likewise.
723 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
724 * xdisp.c (syms_of_xdisp): Likewise.
725 * xfns.c (syms_of_xfns): Likewise.
726
727 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
728
729 Fast save_excursion_save and save_excursion_restore.
730 * lisp.h (struct Lisp_Excursion): New data type.
731 (PVEC_EXCURSION): New pseudovector type.
732 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
733 to deal with it. Adjust comments.
734 (init_marker, attach_marker): New prototype.
735 (unchain_marker): Adjust prototype.
736 * marker.c (attach_marker): Change to global.
737 (init_marker): New function.
738 * alloc.c (Fmake_marker, build_marker): Use it.
739 (build_marker): More easserts.
740 (mark_object): Handle struct Lisp_Excursion.
741 * editfns.c (save_excursion_save, save_excursion_restore):
742 Reimplement to use struct Lisp_Excursion. Add comments.
743
744 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
745
746 Fix export of symbols to GDB (Bug#12036).
747 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
748 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
749 emacs.c, as this is a more-suitable home. Had this been done earlier
750 the fix for 12036 would have avoided some of the problems noted in
751 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
752 would have been more obvious.
753 * emacs.c: Do not include <verify.h>; no longer needed.
754 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
755 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
756 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
757 Remove; now done in lisp.h.
758 * lisp.h (PUBLISH_TO_GDB): New macro.
759 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
760 (DATA_SEG_BITS): Use it.
761 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
762 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
763 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
764 not be usable in #if. This simplifies things.
765
766 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
767
768 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
769
770 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
771
772 Simplify export of symbols to GDB (Bug#12036).
773 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
774 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
775 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
776 Adjust to changes in lisp.h and emacs.c, by using
777 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
778 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
779 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
780 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
781 instead of gdb_valbits.
782 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
783 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
784 instead of gdb_array_mark_flag.
785 (xboolvector): Get size from $->size, not $->header.size.
786 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
787 (xreload, hook-run, hookpost-run): Remove.
788 * emacs.c: Include <verify.h>.
789 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
790 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
791 Remove.
792 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
793 (gdb_USE_LSB_TAG): New enum constants.
794 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
795 Also define these as enum constants, so they're visible to GDB.
796 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
797 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
798 as constants, so they're visible to GDB.
799 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
800 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
801 Now enum constants, not macros, so they're visible to GDB.
802 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
803 more convenient now. All uses changed.
804 (VALMASK) [USE_LSB_TAG]: Also define in this case.
805 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
806
807 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
808
809 Explicitly free restriction data that are not needed anymore.
810 * editfns.c (save_restriction_restore): Free restriction data.
811
812 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
813
814 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
815 add argument, tune behavior, and adjust all callers.
816
817 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
818
819 Use typedef for EMACS_INT, EMACS_UINT.
820 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
821 than macros. This simplifies debugging in the usual case, since
822 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
823 and it allows expressions involving EMACS_INT casts.
824 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
825
826 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
827
828 * nsterm.m (ns_read_socket): Return early if there is a modal
829 window (Bug#12043).
830
831 2012-07-25 Martin Rudalics <rudalics@gmx.at>
832
833 * frame.c (Fredirect_frame_focus): In doc-string don't mention
834 that FOCUS-FRAME can be omitted.
835
836 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
837
838 Adjust buffer text indirection counters at the end of Fkill_buffer.
839 * buffer.c (Fkill_buffer): Adjust indirection counters when the
840 buffer is definitely dead. This should really fix an issue reported
841 by Christoph Scholtes again. (Bug#12007).
842 (init_buffer_once): Initialize indirection counters of
843 buffer_defaults and buffer_local_symbols (for sanity and safety).
844
845 2012-07-24 Eli Zaretskii <eliz@gnu.org>
846
847 * xdisp.c (init_iterator): Don't compute dimensions of truncation
848 and continuation glyphs on tooltip frames, leave them at zero.
849 Avoids continued lines in tooltips. (Bug#11832)
850
851 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
852
853 Simplify copy_overlay.
854 * buffer.c (copy_overlay): Simplify. Use build_marker.
855 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
856
857 2012-07-23 Eli Zaretskii <eliz@gnu.org>
858
859 * print.c (print_object): Don't crash when a frame's name is nil
860 or invalid. (Bug#12025)
861
862 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
863 it signals an error when a tooltip frame is being created.
864
865 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
866
867 Cleanup miscellaneous objects allocation and initialization.
868 * alloc.c (allocate_misc): Change to static. Add argument to
869 specify the subtype. Adjust comment and users.
870 (build_overlay): New function.
871 * buffer.c (copy_overlays, Fmake_overlay): Use it.
872 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
873 (allocate_misc): Remove prototype.
874 (build_overlay): Add prototype.
875
876 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
877
878 Swap buffer text indirection counters in Fbuffer_swap_text.
879 * buffer.c (Fbuffer_swap_text): Swap indirections too.
880 This avoids crash reported by Christoph Scholtes at
881 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
882
883 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
884
885 * nsmenu.m (Popdown_data): New struct.
886 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
887 free Popdown_data.
888 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
889 (initWithContentRect): Make imgView and contentView non-static
890 and autorelease them. Also autorelease img and matrix (Bug#12005).
891 (dealloc): Remove (Bug#12005).
892
893 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
894
895 Adjust consing_since_gc when objects are explicitly freed.
896 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
897 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
898 (free_cons, free_misc): Subtract object size from consing_since_gc.
899
900 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
901
902 Simplify and cleanup markers positioning code.
903 * marker.c (attach_marker): More useful eassert.
904 (live_buffer, set_marker_internal): New function.
905 (Fset_marker, set_marker_restricted): Use set_marker_internal.
906 (set_marker_both, set_marker_restricted_both): Use live_buffer.
907
908 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
909
910 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
911 as it's limited by the amount of memory, not by INT_MAX.
912
913 2012-07-21 Eli Zaretskii <eliz@gnu.org>
914
915 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
916 in special-event-map. See the discussion at
917 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
918 for the reasons.
919
920 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
921 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
922 Fabrice Popineau <fabrice.popineau@supelec.fr>.
923
924 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
925
926 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
927 (conversationIdentifier): Return value is NSInteger.
928 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
929
930 2012-07-21 Chong Yidong <cyd@gnu.org>
931
932 * window.c (decode_any_window): Signal an error if the window is
933 on a dead frame (Bug#11984).
934
935 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
936
937 Add indirection counting to speed up Fkill_buffer.
938 * buffer.h (struct buffer): New member.
939 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
940 (Fmake_indirect_buffer): Set indirection counter to -1, increment
941 base buffer indirection counter.
942 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
943 (Fkill_buffer): Adjust indirection counters as needed, don't walk
944 through buffer list if indirection counter is 0.
945
946 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
947
948 Extend the value returned by Fgarbage_collect with heap statistics.
949 * alloc.c (Qheap): New symbol.
950 (syms_of_alloc): DEFSYM it.
951 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
952 (Fmemory_free): Remove.
953 (syms_of_alloc): Don't defsubr it.
954 * buffer.c (Fcompact_buffer): Remove.
955 (syms_of_buffer): Don't defsubr it.
956
957 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
958
959 Make maybe_gc inline.
960 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
961 * lisp.h (consing_since_gc, gc_relative_threshold)
962 (memory_full_cons_threshold): Revert declaration.
963 (maybe_gc): Remove prototype, define as inline.
964 * alloc.c: Remove old commented-out code.
965 (consing_since_gc, gc_relative_threshold)
966 (memory_full_cons_threshold): Revert to global.
967 (maybe_gc): Remove.
968
969 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
970
971 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
972 * lisp.h (build_unibyte_string): New function.
973 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
974 * sysdep.c, w32fns.c, xfns.c: Use it.
975 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
976 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
977 Adjust users accordingly.
978 * font.h (font_open_by_name): Adjust prototype.
979
980 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
981
982 Cleanup calls to Fgarbage_collect.
983 * lisp.h (maybe_gc): New prototype.
984 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
985 Remove declarations.
986 * alloc.c (maybe_gc): New function.
987 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
988 Make them static.
989 * bytecode.c (MAYBE_GC): Use maybe_gc.
990 * eval.c (eval_sub, Ffuncall): Likewise.
991 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
992 to avoid dependency from auto-save feature.
993
994 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
995
996 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
997 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
998 'for_each_per_buffer_object_at'.
999 All uses changed. It's better to use upper-case for macros that
1000 cannot be implemented as functions, to give the reader a clue
1001 that they're special.
1002
1003 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
1004
1005 * alloc.c (Fgarbage_collect): Tweak docstring.
1006
1007 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1008
1009 Tweak the value returned from Fgarbage_collect again.
1010 * alloc.c (Fgarbage_collect): New return value, as confirmed in
1011 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
1012 Adjust documentation.
1013 (total_vector_bytes): Rename to total_vector_slots, adjust
1014 accounting.
1015 (total_free_vector_bytes): Rename to total_free_vector_slots,
1016 adjust accounting.
1017 (Qstring_bytes, Qvector_slots): New symbols.
1018 (syms_of_alloc): DEFSYM them.
1019
1020 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1021
1022 Buffer compaction primitive which may be used from Lisp.
1023 * buffer.c (compact_buffer, Fcompact_buffer): New function.
1024 (syms_of_buffer): Register Fcompact_buffer.
1025 * alloc.c (Fgarbage_collect): Use compact_buffer.
1026 * buffer.h (compact_buffer): New prototype.
1027 (struct buffer_text): New member.
1028
1029 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1030
1031 New macro to iterate over all buffers, miscellaneous cleanups.
1032 * lisp.h (all_buffers): Remove declaration.
1033 * buffer.h (all_buffers): Add declaration, with comment.
1034 (for_each_buffer): New macro.
1035 * alloc.c (Fgarbage_collect, mark_object): Use it.
1036 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
1037 (init_buffer): Likewise.
1038 * data.c (Fset_default): Likewise.
1039 * coding.c (code_conversion_restore): Remove redundant check
1040 for dead buffer.
1041 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
1042
1043 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1044
1045 Fix bug that created negative-length intervals.
1046 * intervals.c (merge_interval_right, merge_interval_left):
1047 Do not zero out this interval if it is absorbed by its children,
1048 as this interval's total length doesn't change in that case. See
1049 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
1050
1051 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
1052
1053 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
1054 when invoking (make-bool-vector N t) and N is a positive
1055 multiple of 8 -- the last 8 bits were mistakenly cleared.
1056
1057 Remove some struct layout assumptions in bool vectors.
1058 * alloc.c (bool_header_size): New constant.
1059 (header_size, word_size): Move earlier, as they're now used earlier.
1060 Use 'word_size' in a few more places, where it's appropriate.
1061 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
1062 padding before the data member of a bool vector.
1063 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
1064 than doing the check by hand with an abort ().
1065
1066 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
1067
1068 * eval.c (Fdefvar): Don't check constants since we only set the var if
1069 it's not yet defined anyway (bug#11904).
1070
1071 * lisp.h (last_undo_boundary): Declare new var.
1072 * keyboard.c (command_loop_1): Set it.
1073 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
1074 were auto-added by the command loop (bug#11774).
1075
1076 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1077
1078 * w32font.c (Qsymbol): Remove local definition.
1079 (syms_of_w32font): Don't DEFSYM it.
1080
1081 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1082
1083 Fix sweep_vectors to handle large bool vectors correctly.
1084 * alloc.c (sweep_vectors): Account total_vector_bytes for
1085 bool vectors larger than VBLOCK_BYTES_MAX.
1086
1087 2012-07-18 Chong Yidong <cyd@gnu.org>
1088
1089 * frame.c (x_set_frame_parameters): Revert bogus change introduced
1090 in 2012-05-25 commit by Paul Eggert (Bug#11738).
1091
1092 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1093
1094 Return more descriptive data from Fgarbage_collect.
1095 Suggested by Stefan Monnier in
1096 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
1097 * alloc.c (bounded_number): New function.
1098 (total_buffers, total_vectors): New variable.
1099 (total_string_size): Rename to total_string_bytes, adjust users.
1100 (total_vector_size): Rename to total_vector_bytes, adjust users.
1101 (sweep_vectors): Account total_vectors and total_vector_bytes.
1102 (Fgarbage_collect): New return value. Adjust documentation.
1103 (gc_sweep): Account total_buffers.
1104 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
1105 (VECTOR_SIZE): Remove.
1106 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
1107 (Qinterval, Qmisc): New symbols.
1108 (syms_of_data): Initialize them.
1109 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
1110 (Qcons, Qbuffer): New declarations.
1111
1112 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1113
1114 * alloc.c (Fmemory_free): Account for memory-free's own storage.
1115 Round up, not down. Improve doc.
1116
1117 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1118
1119 Restore old code in allocate_string_data to avoid Faset breakage.
1120 Reported by Julien Danjou <julien@danjou.info> in
1121 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
1122 * alloc.c (allocate_string_data): Restore old code with minor
1123 adjustments, fix comment to explain this subtle issue.
1124
1125 2012-07-17 Eli Zaretskii <eliz@gnu.org>
1126
1127 Remove FILE_SYSTEM_CASE.
1128 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
1129
1130 * fileio.c (FILE_SYSTEM_CASE): Don't define.
1131 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
1132 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
1133 call-process-region passes it through expand-file-name.
1134
1135 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
1136
1137 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1138
1139 Fix crash when creating indirect buffer (Bug#11917)
1140 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
1141 Don't handle unbound variables specially if non-zero.
1142 (Fbuffer_local_variables): Pass zero.
1143 (clone_per_buffer_values): Pass non-zero.
1144
1145 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1146
1147 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
1148 to make the loop interruptible.
1149
1150 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1151
1152 * gnutls.c (emacs_gnutls_handshake): Only retry if
1153 GNUTLS_E_INTERRUPTED.
1154
1155 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1156
1157 Cleanup and convert miscellaneous checks to eassert.
1158 * alloc.c (mark_interval): Fix comment, partially rephrase
1159 old comment from intervals.h (see below).
1160 * intervals.c (find_interval, adjust_intervals_for_insertion)
1161 (delete_interval, adjust_intervals_for_deletion)
1162 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
1163 Convert to eassert.
1164 (adjust_intervals_for_insertion, make_new_interval):
1165 Remove obsolete and unused code.
1166 * intervals.h (struct interval): Remove obsolete comment.
1167 * textprotp.c (erase_properties): Remove unused code.
1168 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
1169 (Fremove_list_of_text_properties): Convert to eassert.
1170
1171 2012-07-17 Chong Yidong <cyd@gnu.org>
1172
1173 * editfns.c (Finsert_char): Doc fix.
1174
1175 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1176
1177 Fix previous change to make Fmemory_free always accurate.
1178 * alloc.c (make_interval): Update total_free_intervals.
1179 (make_float): Likewise for total_free_floats.
1180 (free_cons, Fcons): Likewise for total_free_conses.
1181 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
1182 Likewise for total_free_vector_bytes.
1183 (Fmake_symbol): Likewise for total_free_symbols.
1184 (bytes_free): Remove.
1185
1186 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1187
1188 Simple free memory accounting feature.
1189 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
1190 (sweep_vectors): Accumulate size of free vectors.
1191 (Fgarbage_collect): Setup bytes_free.
1192 (Fmemory_free): New function.
1193 (syms_of_alloc): Register it.
1194
1195 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1196
1197 Cleanup overlays checking.
1198 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
1199 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
1200 eassert and OVERLAYP.
1201 (sort_overlays): Change to use OVERLAYP.
1202
1203 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
1204
1205 * editfns.c (Finsert_char): Make it interactive, and make the
1206 second arg optional. Copy interactive spec and docstring from
1207 ucs-insert.
1208
1209 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1210
1211 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
1212 Unlike the other wrapped functions, fabs has an unspecified
1213 effect on errno.
1214
1215 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
1216
1217 * nsterm.m (keyDown): Interpret flags without left/right bits
1218 as the left key (Bug#11670).
1219
1220 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1221
1222 Remove empty and useless init functions.
1223 * lisp.h (init_character_once, init_fns, init_image)
1224 (init_filelock, init_sound): Remove prototype.
1225 * character.c (init_character_once): Remove.
1226 * filelock.c (init_filelock): Likewise.
1227 * fns.c (init_fns): Likewise.
1228 * image.c (init_image): Likewise.
1229 * sound.c (init_sound): Likewise.
1230 * emacs.c (main): Adjust accordingly.
1231
1232 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1233
1234 * gtkutil.h: Tiny cleanups.
1235 (use_old_gtk_file_dialog): Remove useless declaration.
1236 (xg_uses_old_file_dialog): Add suggested const attribute.
1237
1238 2012-07-15 Eli Zaretskii <eliz@gnu.org>
1239
1240 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
1241 (bidi_paragraph_init): Use it to limit search forward for a strong
1242 directional character in abnormally large paragraphs full of
1243 neutral or weak characters. (Bug#11943)
1244
1245 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
1246
1247 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
1248 the toolbar (Bug#9451).
1249 (xg_make_tool_item): Give the widget event box a transparent
1250 background.
1251
1252 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1253
1254 Cleanup basic allocation variables and functions.
1255 * alloc.c (ignore_warnings, init_intervals, init_float)
1256 (init_cons, init_symbol, init_marker): Remove.
1257 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
1258 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
1259 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
1260 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
1261 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
1262 (staticidx, init_alloc_once, init_strings, free_ablock):
1263 Remove redundant initialization.
1264 * fns.c (init_weak_hash_tables): Remove.
1265 * lisp.h (init_weak_hash_tables): Remove prototype.
1266
1267 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1268
1269 Use zero_vector where appropriate.
1270 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
1271 accordingly.
1272 * lisp.h (zero_vector): New declaration.
1273 * font.c (null_vector): Remove.
1274 (syms_of_font): Remove initialization and staticpro.
1275 (font_list_entities, font_find_for_lface): Change to use zero_vector.
1276 * keymap.c (Faccessible_keymaps): Likewise.
1277
1278 2012-07-15 Leo Liu <sdl.web@gmail.com>
1279
1280 * fringe.c: Fix typo in comments.
1281
1282 2012-07-14 Leo Liu <sdl.web@gmail.com>
1283
1284 * fringe.c: Add a new bitmap exclamation-mark.
1285
1286 2012-07-14 Eli Zaretskii <eliz@gnu.org>
1287
1288 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
1289
1290 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
1291 (HAVE_MENUS): Don't define, defined by editing config.in with
1292 msdos/sed2v2.inp.
1293 (GMALLOC_INHIBIT_VALLOC): Don't define.
1294 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
1295
1296 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
1297
1298 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
1299
1300 2012-07-14 Glenn Morris <rgm@gnu.org>
1301
1302 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
1303 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
1304 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
1305
1306 2012-07-13 Glenn Morris <rgm@gnu.org>
1307
1308 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
1309
1310 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
1311 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
1312
1313 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
1314
1315 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
1316 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
1317 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
1318 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
1319 where appropriate.
1320 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
1321 as boolean expression.
1322 (x_set_window_size): Remove unused variable toolbar.
1323 (ns_get_color_default, ns_mod_to_lisp): Remove.
1324 (ns_mouse_position): Remove unused variables xchar and ychar.
1325 (ns_compute_glyph_string_overhangs): Remove unused variable face.
1326 (ns_set_vertical_scroll_bar): Remove unused variable count.
1327 (ns_delete_terminal): Remove unused variable i.
1328 (ns_term_init): Remove unused variables r, g and b.
1329 (mouseDown): Remove unused variable window.
1330 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
1331 (initFrameFromEmacs): Remove unused variable vbextra.
1332 (mouseEntered): Remove unused variables p and dpyinfo.
1333 (mouseExited): Remove unused variables p and r.
1334 (ns_define_frame_cursor, ns_clear_frame_area)
1335 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
1336 (menuDown): Assign [sender tag] to variable and cast the variable.
1337
1338 * nsterm.h (menuDown): Add id as type to argument sender.
1339 (ns_display_info_for_name): Add Lisp_Object argument.
1340 (ns_term_init): Add Lisp_Object argument.
1341 (ns_map_event_to_object): Add void argument.
1342 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
1343 prototype with arguments and only declare if __OBJC__.
1344 (nxatoms_of_nsselect): Add void argument.
1345 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
1346 (ns_alloc_autorelease_pool): Add void argument.
1347 (ns_release_autorelease_pool): Add void* argument.
1348 (ns_get_defaults_value): Add const char* argument.
1349
1350 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
1351 (initFromContents): Use SSDATA where appropriate.
1352 (ns_update_menubar): Add braces to ambigous if-else.
1353 (initWithTitle): Put () around assignment in if statement.
1354 (ns_menu_show): Remove unused variables window and keymap.
1355 (update_frame_tool_bar): Remove unused variable selected_p.
1356 (initWithContentRect): Remove unused variable this_cmd_name.
1357
1358 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
1359 appropriate.
1360 (setXBMColor): Remove unused variable len.
1361 (setPixmapData): Put () around assignment in loop statement.
1362
1363 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
1364 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
1365 where appropriate.
1366 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
1367 around assignment in loop statement.
1368 (nsfont_open): Remove unused variable i.
1369 (nsfont_open): Remove unused variable len.
1370 (nsfont_draw): Remove unused variable cs.
1371
1372 * nsfns.m (x_set_icon_name, ns_set_name_internal)
1373 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
1374 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
1375 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
1376 (Fns_font_name, Fns_perform_service)
1377 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
1378 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
1379 (ns_set_name): Remove unused variable view.
1380 (x_set_menu_bar_lines): Remove unused variable olines.
1381 (x_set_tool_bar_lines): Remove unused variable root_window.
1382 (Fns_list_colors): Put () around assignment in while statement.
1383 (Fns_perform_service): Remove unused variable len.
1384 (Fns_display_usable_bounds): Remove unused variable top.
1385 (syms_of_nsfns): Remove unused variable i.
1386
1387 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1388 memcpy (Bug#11907).
1389
1390 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
1391
1392 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1393 and free it with DestroyExceptionInfo (Bug#11558).
1394
1395 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
1396
1397 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1398 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1399 Set here, not in nt/config.nt.
1400
1401 2012-07-13 Eli Zaretskii <eliz@gnu.org>
1402
1403 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1404 cursor overflow into the last glyph on display line when the right
1405 fringe is off. (Bug#11832)
1406
1407 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
1408
1409 * xdisp.c (produce_special_glyphs): Now static.
1410 * dispextern.h (produce_special_glyphs): Remove decl.
1411
1412 2012-07-13 Glenn Morris <rgm@gnu.org>
1413
1414 * s/bsd-common.h, s/cygwin.h: Remove empty files.
1415 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1416
1417 * s/usg5-4-common.h (USG, USG5):
1418 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1419 * s/sol2-6.h (SOLARIS2):
1420 * s/irix6-5.h (IRIX6_5):
1421 * s/hpux10-20.h (USG, USG5, HPUX):
1422 * s/gnu-linux.h (USG, GNU_LINUX):
1423 * s/freebsd.h (BSD_SYSTEM):
1424 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1425 * s/cygwin.h (CYGWIN):
1426 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1427 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1428
1429 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
1430
1431 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
1432
1433 2012-07-13 Glenn Morris <rgm@gnu.org>
1434
1435 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1436
1437 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1438
1439 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1440 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1441
1442 2012-07-12 Glenn Morris <rgm@gnu.org>
1443
1444 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
1445
1446 * process.c (init_process_emacs): Rename from init_process.
1447 The old name is also the name of a Mach system call.
1448 * lisp.h, emacs.c: Update for this name change.
1449 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1450 longer needed.
1451
1452 2012-07-12 Eli Zaretskii <eliz@gnu.org>
1453
1454 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1455 memmove call that removes glyphs covered by the left truncation
1456 glyph. Improve commentary.
1457 (display_line): Fix display of continuation glyphs on GUI frames
1458 when the right fringe is turned off and variable-size fonts are
1459 used in the window. Move the code that appends a stretch glyph to
1460 produce_special_glyphs, so that it could be used for truncation
1461 and continuation glyphs alike.
1462 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1463 glyph of a suitably computed width, to align the special glyphs at
1464 the window margin. Code moved from display_line. (Bug#11832)
1465
1466 2012-07-12 Glenn Morris <rgm@gnu.org>
1467
1468 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1469
1470 * s/gnu-linux.h, s/hpux10-20.h:
1471 Do not unconditionally define HAVE_XRMSETDATABASE.
1472
1473 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1474
1475 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
1476
1477 Fix typos that broke OS X build.
1478 Reported by Randal L. Schwartz in
1479 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1480 * nsterm.m (ns_timeout): Add missing local decl.
1481 (ns_get_color): snprintf -> sprintf, to fix typo.
1482
1483 2012-07-12 Glenn Morris <rgm@gnu.org>
1484
1485 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1486 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1487 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1488 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1489
1490 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1491 Move PTY_OPEN to configure.
1492
1493 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1494 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1495 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1496
1497 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
1498
1499 Use empty_unibyte_string where applicable.
1500 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1501 * lread.c (read1): Likewise.
1502 * xsettings.c (syms_of_xsettings): Likewise.
1503
1504 2012-07-12 Glenn Morris <rgm@gnu.org>
1505
1506 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1507 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
1508 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1509 * s/hpux10-20.h (RUN_TIME_REMAP):
1510 * s/bsd-common.h (TABDLY): Move to configure.
1511
1512 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1513
1514 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1515
1516 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1517 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
1518
1519 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
1520
1521 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1522 * s/template.h: Move NARROWPROTO to configure.
1523
1524 2012-07-11 Glenn Morris <rgm@gnu.org>
1525
1526 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
1527 unused since 2011-01-17 change to systty.h.
1528
1529 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
1530 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1531 Move HAVE_PTYS and HAVE_SOCKETS to configure.
1532
1533 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1534
1535 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
1536
1537 2012-07-11 Glenn Morris <rgm@gnu.org>
1538
1539 * s/darwin.h, s/gnu-linux.h, s/template.h:
1540 Move INTERRUPT_INPUT to configure.
1541
1542 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1543
1544 Minor adjustments to interning code.
1545 * lisp.h (intern, intern_c_string): Redefine as static inline
1546 wrappers for intern_1 and intern_c_string_1, respectively.
1547 (intern_1, intern_c_string_1): Rename prototypes.
1548 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1549 Vobarray checking.
1550 * font.c (font_intern_prop): Likewise. Adjust comment.
1551 * w32font.c (intern_font_name): Likewise.
1552
1553 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1554
1555 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1556
1557 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1558 of Fcar/Fcdr if possible.
1559 * font.c (check_otf_features): Likewise.
1560 * fontset.c (Fnew_fontset): Likewise.
1561 * gnutls.c (Fgnutls_boot): Likewise.
1562 * minibuf.c (read_minibuf): Likewise.
1563 * msdos.c (IT_set_frame_parameters): Likewise.
1564 * xmenu.c (Fx_popup_dialog): Likewise.
1565 * w32menu.c (Fx_popup_dialog): Likewise.
1566
1567 2012-07-11 Glenn Morris <rgm@gnu.org>
1568
1569 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1570 since nothing has defined it on these platforms.
1571
1572 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1573 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1574
1575 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1576 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1577 Move CLASH_DETECTION to configure.
1578
1579 * s/gnu.h: Remove file, which is now empty.
1580
1581 * s/gnu.h, s/gnu-linux.h:
1582 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1583
1584 2012-07-11 John Wiegley <johnw@newartisans.com>
1585
1586 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1587 function attribute, so we only use it if it exists in the
1588 compiler.
1589
1590 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1591
1592 Avoid call to strlen in fast_c_string_match_ignore_case.
1593 * search.c (fast_c_string_match_ignore_case): Change to use
1594 length argument. Adjust users accordingly.
1595 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1596
1597 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1598
1599 Assume mkdir, rmdir.
1600 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1601 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1602
1603 Assume rename.
1604 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1605
1606 Assume perror.
1607 * s/hpux10-20.h (HAVE_PERROR): Remove.
1608 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1609 Remove dummy definition, as this problem was obsolete long ago.
1610
1611 Assume strerror.
1612 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1613
1614 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1615
1616 Avoid calls to strlen in font processing functions.
1617 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
1618 (font_open_by_name): Change to use length argument. Adjust
1619 users accordingly.
1620 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1621 Adjust prototypes.
1622 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1623 Change to return ptrdiff_t.
1624 (xfont_list_pattern, xfont_match): Use length returned by
1625 xfont_decode_coding_xlfd.
1626 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1627
1628 2012-07-11 Glenn Morris <rgm@gnu.org>
1629
1630 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1631 Move DONT_REOPEN_PTY to configure.
1632
1633 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1634 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1635
1636 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1637
1638 Remove "#define unix" that is no longer needed (Bug#11905).
1639 * s/aix4-2.h (unix): Remove; no longer needed.
1640
1641 EMACS_TIME simplification (Bug#11875).
1642 This replaces macros (which typically do not work in GDB)
1643 with functions, typedefs and enums, making the code easier to debug.
1644 The functional style also makes code easier to read and maintain.
1645 * systime.h: Include <sys/time.h> on all hosts, not just if
1646 WINDOWSNT, since 'struct timeval' is needed in general.
1647 (EMACS_TIME): Now a typedef, not a macro.
1648 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1649 not macros.
1650 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1651 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1652 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1653 (EMACS_TIME_LE): Now functions, not macros.
1654 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1655 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1656 which are not functions. All uses rewritten to use:
1657 (make_emacs_time): New function.
1658 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1659 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1660 not functions. All uses rewritten to use the following, respectively:
1661 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1662 (add_emacs_time, sub_emacs_time): New functions.
1663 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
1664 * fileio.c (Fcopy_file):
1665 * xterm.c (XTflash): Get the current time closer to when it's used.
1666 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1667
1668 * bytecode.c (targets): Suppress -Woverride-init warnings.
1669
1670 Simplify by avoiding confusing use of strncpy etc.
1671 * doc.c (Fsnarf_documentation):
1672 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1673 * frame.c (Fmake_terminal_frame):
1674 * gtkutil.c (get_utf8_string):
1675 * lread.c (openp):
1676 * nsmenu.m (ns_update_menubar):
1677 * regex.c (regerror):
1678 Prefer memcpy to strncpy and strncat when either will do.
1679 * fileio.c (Fsubstitute_in_file_name):
1680 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1681 (menu_separator_name_p):
1682 * nsmenu.m (ns_update_menubar):
1683 Prefer memcmp to strncmp when either will do.
1684 * nsterm.m: Include <ftoastr.h>.
1685 (ns_get_color):
1686 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1687 Prefer snprintf to strncpy.
1688 * nsterm.m (ns_term_init):
1689 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1690 * nsterm.m (ns_term_init):
1691 Avoid the need for strncpy, by using build_string or
1692 make_unibyte_string directly. Use dtoastr, not snprintf.
1693 * process.c (Fmake_network_process): Diagnose service names that
1694 are too long, rather than silently truncating them or creating
1695 non-null-terminated names.
1696 (Fnetwork_interface_info): Likewise, for interface names.
1697 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1698 Prefer sprintf to strncat.
1699 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1700 Prefer vsnprintf to vsprintf + strncpy.
1701
1702 2012-07-10 Glenn Morris <rgm@gnu.org>
1703
1704 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1705 Clarify fallback case.
1706
1707 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1708
1709 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1710 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1711 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
1712 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
1713 where argument type is known to be a Lisp_Cons.
1714
1715 2012-07-10 Tom Tromey <tromey@redhat.com>
1716
1717 * bytecode.c (BYTE_CODE_THREADED): New macro.
1718 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1719 (enum byte_code_op): New type.
1720 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1721 (exec_byte_code): Use them. Use token threading when applicable.
1722
1723 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1724
1725 Optimize pure C strings initialization.
1726 * lisp.h (make_pure_string): Fix prototype.
1727 (build_pure_c_string): New function, defined as static inline. This
1728 provides a better opportunity to optimize away calls to strlen when
1729 the function is called with compile-time constant argument.
1730 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1731 argument, adjust users accordingly. Use build_pure_c_string where
1732 appropriate.
1733 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1734 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1735 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1736
1737 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1738
1739 Avoid calls to strlen in miscellaneous functions.
1740 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1741 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1742 * lread.c (openp): Likewise.
1743
1744 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1745
1746 Avoid calls to strlen in path processing functions.
1747 * fileio.c (file_name_as_directory): Add comment. Change to add
1748 srclen argument and return the length of result. Adjust users
1749 accordingly.
1750 (directory_file_name): Fix comment. Change to add srclen argument,
1751 swap 1st and 2nd arguments to obey the common convention. Adjust
1752 users accordingly.
1753 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1754
1755 2012-07-10 Glenn Morris <rgm@gnu.org>
1756
1757 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1758 Move PENDING_OUTPUT_COUNT definition to configure.
1759
1760 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1761 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1762 * s/gnu.h (DATA_START): Move definitions to configure.
1763
1764 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1765 We include usg5-4-common.h, which defines them both.
1766
1767 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
1768 O_RDONLY already includes it).
1769
1770 Stop ns builds setting the EMACSLOADPATH environment variable.
1771 * nsterm.m (ns_load_path): Rename from ns_init_paths.
1772 Now it does not set EMACSLOADPATH, just returns the load-path string.
1773 * nsterm.h: Update accordingly.
1774 * lread.c [HAVE_NS]: Include nsterm.h.
1775 (init_lread) [HAVE_NS]: Use ns_load_path.
1776 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
1777
1778 2012-07-09 Glenn Morris <rgm@gnu.org>
1779
1780 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
1781 since the included bsd-common.h does so.
1782
1783 Stop ns builds setting the EMACSPATH environment variable.
1784 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
1785 (ns_init_paths): Do not set EMACSPATH.
1786 * nsterm.h (ns_exec_path): Add it.
1787 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
1788 Use ns_exec_path.
1789
1790 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
1791
1792 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
1793
1794 * process.c (wait_reading_process_output): 'waitchannels' was unset
1795 when read_kbd || !NILP (wait_for_cell); fix this.
1796
1797 Add GCC-style 'const' attribute to functions that can use it.
1798 * character.h (char_resolve_modifier_mask):
1799 * keyboard.h (make_ctrl_char):
1800 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
1801 (init_character_once, next_almost_prime, init_fns, init_image)
1802 (flush_pending_output, init_sound):
1803 * mem-limits.h (start_of_data):
1804 * menu.h (finish_menu_items):
1805 Add ATTRIBUTE_CONST.
1806 * emacs.c (DEFINE_DUMMY_FUNCTION):
1807 Declare the dummy function with ATTRIBUTE_CONST.
1808 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
1809 Add decls with ATTRIBUTE_CONST.
1810
1811 Minor improvements to make_formatted_string.
1812 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
1813 where int is good enough, as vsprintf returns an int.
1814 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
1815
1816 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1817
1818 Use make_formatted_string to avoid double length calculation.
1819 * lisp.h (make_formatted_string): New prototype.
1820 * alloc.c (make_formatted_string): New function.
1821 * buffer.c (Fgenerate_new_buffer_name): Use it.
1822 * dbus.c (syms_of_dbusbind): Likewise.
1823 * editfns.c (Fcurrent_time_zone): Likewise.
1824 * filelock.c (get_boot_time): Likewise.
1825 * frame.c (make_terminal_frame, set_term_frame_name)
1826 (x_report_frame_params): Likewise.
1827 * image.c (gs_load): Likewise.
1828 * minibuf.c (get_minibuffer): Likewise.
1829 * msdos.c (dos_set_window_size): Likewise.
1830 * process.c (make_process): Likewise.
1831 * xdisp.c (ensure_echo_area_buffers): Likewise.
1832 * xsettings.c (apply_xft_settings): Likewise.
1833
1834 2012-07-09 Glenn Morris <rgm@gnu.org>
1835
1836 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
1837 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
1838 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
1839 * nsterm.h (ns_etc_directory): Add it.
1840 * callproc.c [HAVE_NS]: Include nsterm.h.
1841 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
1842
1843 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1844
1845 Move marker debugging code under MARKER_DEBUG.
1846 * marker.c (MARKER_DEBUG): Move marker debugging code under
1847 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
1848 for bootstrap with --enable-checking (~3x slowdown reported
1849 by Juanma Barranquero <lekktu@gmail.com>).
1850 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
1851
1852 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
1853
1854 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
1855 See <http://bugs.gnu.org/11825#29>.
1856
1857 2012-07-08 Eli Zaretskii <eliz@gnu.org>
1858
1859 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
1860 has no font, use the frame's font. (Bug#11813)
1861 (display_line): Add commentary about displaying truncation glyphs
1862 on GUI frames.
1863 (produce_special_glyphs): Move here from term.c.
1864
1865 * term.c (produce_special_glyphs): Move to xdisp.c.
1866
1867 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
1868 section.
1869
1870 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
1871
1872 * xdisp.c (display_line): Avoid warning about implicit declaration
1873 of FRAME_FONT.
1874
1875 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1876
1877 * lisp.h: Remove empty conditional.
1878
1879 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1880
1881 * lread.c (load_path_check): Now static.
1882
1883 Fix some minor --with-ns problems found by static checking.
1884 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1885 (x_set_font) [!HAVE_X_WINDOWS]:
1886 * image.c (xpm_load_image) [HAVE_NS]:
1887 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1888 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1889 Remove unused local.
1890 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1891 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1892 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1893 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1894 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1895 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1896 Fix pointer signedness problem.
1897 * xfaces.c (FRAME_X_FONT_TABLE):
1898 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1899
1900 2012-07-07 Glenn Morris <rgm@gnu.org>
1901
1902 * lread.c (load_path_check): New function, split from init_lread.
1903 (init_lread): Reorganize. Motivation:
1904 If EMACSLOADPATH is set, check/warn about that rather than the
1905 defaults, which we are not going to use. Hence we can remove
1906 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1907 Don't warn if site-lisp directories are missing.
1908 If not installed, start from a blank load-path, since
1909 PATH_LOADSEARCH refers to the eventual installation directories.
1910
1911 2012-07-07 Eli Zaretskii <eliz@gnu.org>
1912
1913 Support truncation and continuation glyphs on GUI frames, when
1914 fringes are disabled. (Bug#11832)
1915 * xdisp.c (init_iterator): Get dimensions of truncation and
1916 continuation glyphs even if on GUI frames. Adjust
1917 it->last_visible_x on GUI frames when the left or right fringes,
1918 or both, are absent.
1919 (start_display, move_it_in_display_line_to): Handle the case of a
1920 GUI frame without a fringe to display continuation or truncation
1921 glyphs.
1922 (insert_left_trunc_glyphs): Support GUI frames: make sure
1923 truncation glyphs overwrite enough glyphs from the current line to
1924 have sufficient space in pixels.
1925 (display_line): Support truncation and continuation glyphs on GUI
1926 frames. If some spare pixels are left on the line after inserting
1927 the truncation glyphs, fill that space with a stretch glyph of a
1928 suitably computed width.
1929
1930 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1931 produce_glyphs, to support GUI sessions.
1932
1933 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1934
1935 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1936
1937 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1938
1939 Do not require float-time's arg to fit in time_t (Bug#11825).
1940 This works better on hosts where time_t is unsigned, and where
1941 float-time is applied to the (negative) difference between two times.
1942 * editfns.c (decode_time_components): Last arg is now double *,
1943 not int *, and means to store all the result as a double, without
1944 worrying about whether the seconds part fits in time_t.
1945 All callers changed.
1946 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1947 All callers changed.
1948 (Ffloat_time): Do not fail merely because the specified time falls
1949 outside of time_t range.
1950
1951 2012-07-07 Glenn Morris <rgm@gnu.org>
1952
1953 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1954 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1955 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1956
1957 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
1958
1959 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1960 Update dependencies.
1961
1962 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1963
1964 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1965
1966 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1967 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1968 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1969 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1970 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1971 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1972
1973 * xfont.c (compare_font_names): Redo to omit the need for casts.
1974
1975 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1976
1977 * xfns.c (Fx_change_window_property): Doc fix.
1978 * w32fns.c (Fx_change_window_property): Doc fix.
1979
1980 * w32fns.c (Fx_window_property): Accept the same arguments as the
1981 X Windows version. Doc fix.
1982 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1983
1984 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
1985 Eli Zaretskii <eliz@gnu.org>
1986
1987 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1988 Windows-specific code from nt/config.nt moved here.
1989 Obsolete settings removed.
1990
1991 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1992
1993 * process.c: Avoid unnecessary calls to gettime.
1994 (wait_reading_process_output): Don't get the time of day
1995 when gobbling data immediately and not waiting, as there's no need
1996 for it in that case. This removes a FIXME.
1997
1998 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1999
2000 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
2001 is defined (Bug#11768).
2002
2003 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2004
2005 Fix marker debugging code.
2006 * marker.c (byte_char_debug_check): Do not perform the check
2007 if buffer is not multibyte.
2008 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2009 Call byte_char_debug_check with correct arguments.
2010
2011 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2012
2013 Compile marker debugging code only if ENABLE_CHECKING is defined.
2014 * marker.c (byte_char_debug_check, count_markers):
2015 Use only if ENABLE_CHECKING is defined.
2016 (byte_debug_flag): Remove.
2017 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2018 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
2019
2020 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2021
2022 Avoid code repetition in marker-related functions.
2023 * marker.c (attach_marker): New function.
2024 (Fset_marker, set_marker_restricted, set_marker_both)
2025 (set_marker_restricted_both): Use it.
2026 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
2027 Consistently rename charno to charpos.
2028 (marker_position): Add eassert.
2029 (marker_byte_position): Convert to eassert.
2030
2031 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2032
2033 Simplify list operations in unchain_overlay and unchain_marker.
2034 * buffer.c (unchain_overlay): Simplify. Add comment.
2035 * marker.c (unchain_marker): Simplify. Fix comments.
2036
2037 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2038
2039 Introduce fast path for the widely used marker operation.
2040 * alloc.c (build_marker): New function.
2041 * lisp.h (build_marker): New prototype.
2042 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
2043 * composite.c (autocmp_chars): Likewise.
2044 * editfns.c (buildmark): Remove.
2045 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
2046 (save_restriction_save): Use build_marker.
2047 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
2048 * window.c (save_window_save): Likewise.
2049
2050 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2051
2052 Do not use Fdelete_overlay in delete_all_overlays
2053 to avoid redundant calls to unchain_overlay.
2054 * buffer.c (drop_overlay): New function.
2055 (delete_all_overlays, Fdelete_overlay): Use it.
2056 * minibuf.c (get_minibuffer): Fix comment.
2057
2058 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2059
2060 Port to OpenBSD 5.1 amd64.
2061 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
2062 This is needed for OpenBSD, and should be harmless on all BSD systems.
2063 Also, include <sys/sysctl.h>, as it should be available on all
2064 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
2065 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
2066 use p_pid member, not kp_proc.pid.
2067
2068 2012-07-06 Glenn Morris <rgm@gnu.org>
2069
2070 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
2071
2072 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2073
2074 More xmalloc and related cleanup.
2075 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
2076 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
2077 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
2078 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
2079 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
2080 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
2081 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
2082 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
2083 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
2084 * xterm.c:
2085 Omit needless casts involving void * pointers and allocation.
2086 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
2087 as the former is more robust if P's type is changed.
2088 Prefer xzalloc to xmalloc + memset 0.
2089 Simplify malloc-or-realloc to realloc.
2090 Don't worry about xmalloc returning a null pointer.
2091 Prefer xstrdup to xmalloc + strcpy.
2092 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
2093 growing it.
2094 * keyboard.c (apply_modifiers_uncached): Prefer local array to
2095 alloca of a constant.
2096
2097 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2098
2099 * xdisp.c (display_line): Fix horizontal pixel coordinates when
2100 hscroll is larger than the line width. Fixes long and futile
2101 looping inside extend_face_to_end_of_line (on a TTY) producing
2102 glyphs that are not needed and thrown away.
2103
2104 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2105
2106 * marker.c (set_marker_restricted_both): Simplify by using
2107 clip_to_bounds.
2108
2109 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2110
2111 * editfns.c (region_limit): Simplify by using clip_to_bounds.
2112
2113 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
2114
2115 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
2116 not defined (Bug#11768).
2117 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
2118 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
2119 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
2120 followed by gtk_box_set_homogeneous (Bug#11768).
2121 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
2122 (update_theme_scrollbar_width, xg_create_scroll_bar):
2123 Use gtk_scrollbar_new (Bug#11768).
2124 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
2125 (is_box_type): New function (Bug#11768).
2126 (xg_tool_item_stale_p): Call is_box_type.
2127 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
2128 with default display (Bug#11768).
2129
2130 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2131
2132 * xdisp.c (window_hscroll_limited): New function.
2133 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
2134 coordinates when window's hscroll is set to insanely large
2135 values. (Bug#11857)
2136
2137 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
2138
2139 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
2140 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
2141
2142 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2143
2144 Cleanup xmalloc.
2145 * lisp.h (xzalloc): New prototype. Omit needless casts.
2146 * alloc.c (xzalloc): New function. Omit needless casts.
2147 * charset.c: Omit needless casts. Convert all calls to
2148 xmalloc with following memset to xzalloc.
2149 * dispnew.c: Likewise.
2150 * fringe.c: Likewise.
2151 * image.c: Likewise.
2152 * sound.c: Likewise.
2153 * term.c: Likewise.
2154 * w32fns.c: Likewise.
2155 * w32font.c: Likewise.
2156 * w32term.c: Likewise.
2157 * xfaces.c: Likewise.
2158 * xfns.c: Likewise.
2159 * xterm.c: Likewise.
2160 * atimer.c: Omit needless casts.
2161 * buffer.c: Likewise.
2162 * callproc.c: Likewise.
2163 * ccl.c: Likewise.
2164 * coding.c: Likewise.
2165 * composite.c: Likewise.
2166 * doc.c: Likewise.
2167 * doprnt.c: Likewise.
2168 * editfns.c: Likewise.
2169 * emacs.c: Likewise.
2170 * eval.c: Likewise.
2171 * filelock.c: Likewise.
2172 * fns.c: Likewise.
2173 * gtkutil.c: Likewise.
2174 * keyboard.c: Likewise.
2175 * lisp.h: Likewise.
2176 * lread.c: Likewise.
2177 * minibuf.c: Likewise.
2178 * msdos.c: Likewise.
2179 * print.c: Likewise.
2180 * process.c: Likewise.
2181 * region-cache.c: Likewise.
2182 * search.c: Likewise.
2183 * sysdep.c: Likewise.
2184 * termcap.c: Likewise.
2185 * terminal.c: Likewise.
2186 * tparam.c: Likewise.
2187 * w16select.c: Likewise.
2188 * w32.c: Likewise.
2189 * w32reg.c: Likewise.
2190 * w32select.c: Likewise.
2191 * w32uniscribe.c: Likewise.
2192 * widget.c: Likewise.
2193 * xdisp.c: Likewise.
2194 * xmenu.c: Likewise.
2195 * xrdb.c: Likewise.
2196 * xselect.c: Likewise.
2197
2198 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2199
2200 * fileio.c (time_error_value): Check the right error number.
2201 Problem reported by Troels Nielsen in
2202 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
2203
2204 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2205
2206 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
2207 This should be fixed in a better way; see Eli Zaretskii in
2208 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
2209 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
2210
2211 * fileio.c (time_error_value): Rename from special_mtime.
2212 The old name's problems were noted by Eli Zaretskii in
2213 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
2214
2215 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
2216 This variable's comment says Emacs needs at least one GDB-visible
2217 symbol of type enum pvec_type, to work around GDB problems.
2218 The symbol's value doesn't matter.
2219
2220 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
2221 that causes compilation to fail on pre-C99 compilers.
2222
2223 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
2224
2225 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
2226 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
2227
2228 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2229
2230 * buffer.c (init_buffer_once): Fix initialization of
2231 headers for buffer_defaults and buffer_local_symbols.
2232 Reported by Juanma Barranquero <lekktu@gmail.com>.
2233
2234 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
2235
2236 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
2237 * lisp.h (enum pvec_type): Use fewer bits.
2238 (PSEUDOVECTOR_SIZE_BITS): New constant.
2239 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
2240 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
2241 change in pvec_type.
2242 (PSEUDOVECTOR_TYPEP): New macro.
2243 (TYPED_PSEUDOVECTORP): Use it.
2244 * fns.c (internal_equal): Adapt code to extract pvectype.
2245 * emacs.c (gdb_pvec_type): Update type.
2246 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
2247 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
2248 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
2249 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
2250 (sweep_vectors): Use it. Use local var `total_bytes' instead of
2251 abusing vector->header.next.nbytes.
2252 (live_vector_p): Use PVEC_TYPE.
2253 (mark_object): Adapt code to extract pvectype. Use switch.
2254
2255 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2256
2257 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
2258 Tighten new eassert a bit.
2259
2260 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2261
2262 Fix compilation with --enable-gcc-warnings and -O1
2263 optimization level.
2264 * doprnt.c (doprnt): Change type of tem to int, initialize
2265 to avoid compiler warning. Add eassert.
2266 * search.c (simple_search): Initialize match_byte to avoid
2267 compiler warning. Add eassert.
2268
2269 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2270
2271 Avoid weird behavior with large horizontal scrolls.
2272 Without this change, for example, large hscroll values would
2273 mess up Emacs's display on Fedora 15 x86, presumably due to
2274 overflows in int calculations in the display code.
2275 Also, if buffers had long lines, Emacs would freeze.
2276 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
2277 (set_window_hscroll): New function, containing the old guts of
2278 Fset_window_hscroll. Return the clipped value.
2279 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
2280 This avoids the need to check against PTRDIFF_MAX.
2281
2282 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
2283
2284 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2285
2286 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
2287
2288 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2289
2290 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
2291 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
2292 since GCC 4.4.6 issues a bogus warning for them.
2293
2294 Fix bugs in file timestamp newness comparisons.
2295 * fileio.c (Ffile_newer_than_file_p):
2296 * lread.c (Fload): Use full timestamp resolution of files,
2297 not just the 1-second resolution, so that files that are only
2298 slightly newer still count as newer.
2299 * fileio.c (Ffile_newer_than_file_p): Don't assume file
2300 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
2301
2302 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
2303
2304 * fileio.c: Improve handling of file time marker. (Bug#11852)
2305 (special_mtime): New function.
2306 (Finsert_file_contents, Fverify_visited_file_modtime):
2307 Use it to set special mtime values consistently.
2308
2309 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
2310
2311 * fileio.c (Finsert_file_contents): Properly handle st_mtime
2312 marker for non-existing file. (Bug#11852)
2313
2314 2012-07-03 Glenn Morris <rgm@gnu.org>
2315
2316 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
2317 and did not make it into globals.h).
2318
2319 2012-07-03 Tom Tromey <tromey@redhat.com>
2320
2321 * window.c (Fset_window_margins, Fset_window_fringes)
2322 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
2323 * textprop.c (Fprevious_property_change): No longer static.
2324 * syntax.c (Fsyntax_table_p): No longer static.
2325 * process.c (Fget_process, Fprocess_datagram_address): No longer
2326 static.
2327 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
2328 * keyboard.c (Fcommand_execute): No longer static.
2329 Remove EXFUN.
2330 * insdel.c (Fcombine_after_change_execute): No longer static.
2331 * image.c (Finit_image_library): No longer static.
2332 * fileio.c (Fmake_symbolic_link): No longer static.
2333 * eval.c (Ffetch_bytecode): No longer static.
2334 * editfns.c (Fuser_full_name): No longer static.
2335 * doc.c (Fdocumentation_property, Fsnarf_documentation):
2336 No longer static.
2337 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
2338 static.
2339 * dired.c (Ffile_attributes): No longer static.
2340 * composite.c (Fcomposition_get_gstring): No longer static.
2341 * callproc.c (Fgetenv_internal): No longer static.
2342
2343 * ccl.h: Remove EXFUNs.
2344 * buffer.h: Remove EXFUNs.
2345 * dispextern.h: Remove EXFUNs.
2346 * intervals.h: Remove EXFUNs.
2347 * fontset.h: Remove EXFUN.
2348 * font.h: Remove EXFUNs.
2349 * dosfns.c (system_process_attributes): Remove EXFUN.
2350 * keymap.h: Remove EXFUNs.
2351 * lisp.h: Remove EXFUNs.
2352 * w32term.h: Remove EXFUNs.
2353 * window.h: Remove EXFUNs.
2354 * xsettings.h: Remove EXFUN.
2355 * xterm.h: Remove EXFUN.
2356
2357 2012-07-03 Glenn Morris <rgm@gnu.org>
2358
2359 * lisp.h (Frandom): Make it visible to C.
2360 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
2361 buffer for invisible buffers. (Bug#1229)
2362
2363 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2364
2365 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
2366 values which aren't power of 2.
2367 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
2368 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
2369 accordingly.
2370
2371 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
2372
2373 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
2374
2375 * alloc.c (mark_object): Revert part of last patch to use `switch'.
2376
2377 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2378
2379 * alloc.c (allocate_vector_block): Remove redundant
2380 calls to mallopt if DOUG_LEA_MALLOC is defined.
2381 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
2382 avoid calls to mallopt if zero_vector is returned.
2383
2384 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2385
2386 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2387 is enabled, avoid dereferencing NULL current_sblock if
2388 running undumped.
2389
2390 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2391
2392 Cleanup basic buffer management.
2393 * buffer.h (struct buffer): Change layout to use generic vector
2394 marking code. Fix some comments. Change type of 'clip_changed'
2395 to bitfield. Remove unused #ifndef old.
2396 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2397 (GET_OVERLAYS_AT): Fix indentation.
2398 (for_each_per_buffer_object_at): New macro.
2399 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2400 (Fbuffer_local_variables): Use it.
2401 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2402 * alloc.c (allocate_buffer): Adjust to match new layout of
2403 struct buffer. Fix comment.
2404 (mark_overlay): New function.
2405 (mark_buffer): Use it. Use mark_vectorlike to mark normal
2406 Lisp area of struct buffer.
2407 (mark_object): Use it. Adjust marking of misc objects
2408 and related comments.
2409
2410 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
2411
2412 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2413 wrapper that is not needed because the wrapped code is a no-op (zero
2414 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2415 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2416
2417 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
2418
2419 * alloc.c (mark_buffer): Simplify. Remove prototype.
2420 (mark_object): Add comment. Reorganize marking of vector-like
2421 objects. Use CHECK_LIVE for all vector-like objects except buffers
2422 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
2423 redundant calls to mark_vectorlike for bool vectors.
2424
2425 2012-06-30 Glenn Morris <rgm@gnu.org>
2426
2427 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2428
2429 * epaths.in (PATH_SITELOADSEARCH): New.
2430 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2431 This is rather than relying on --enable-locallisppath elements
2432 having "site-lisp" in their names. (Bug#10208#25, 11658)
2433
2434 2012-06-30 Eli Zaretskii <eliz@gnu.org>
2435
2436 * w32proc.c (sys_select): Accept and ignore one more argument.
2437
2438 * w32.c (emacs_gnutls_pull): Call select with one more argument.
2439
2440 * sysselect.h [DOS_NT]: Don't include sys/select.h.
2441 (pselect) [!MS_DOS]: Redirect to sys_select.
2442
2443 * sysdep.c: Don't include dos.h and dosfns.h.
2444
2445 * process.c (sys_select):
2446 * msdos.c (sys_select): Accept one more argument and ignore it.
2447
2448 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2449 adapt data types and code to that.
2450
2451 * dosfns.c:
2452 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2453 which clashes with the gnulib function of the same name.
2454
2455 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
2456
2457 * font.c (font_style_to_value, font_style_symbolic)
2458 (font_prop_validate_style): Add type checks for values in
2459 font_style_table.
2460
2461 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2462 argument.
2463 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2464 uses.
2465
2466 2012-06-29 Eli Zaretskii <eliz@gnu.org>
2467
2468 * xdisp.c (try_window_id): Undo last change.
2469
2470 * w32.c (getwd): Adjust commentary about startup_dir.
2471 (init_environment): Always call sys_access, even in non-MSVC
2472 builds. Don't chdir to the directory of the Emacs executable.
2473 This undoes code from 1997 which was justified by the need to
2474 "avoid conflicts when removing and renaming directories". But its
2475 downside was that every relative file name was being interpreted
2476 relative to the directory of the Emacs executable, which can never
2477 be TRT. In particular, it broke sys_access when called with
2478 relative file names.
2479 (sys_access): Map GetLastError to errno.
2480
2481 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2482
2483 * window.h (struct window): Change type of 'fringes_outside_margins'
2484 to bitfield. Fix comment. Adjust users accordingly.
2485 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2486 Adjust comment.
2487 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2488 to ptrdiff_t.
2489
2490 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
2491
2492 * gnutls.c (emacs_gnutls_handshake):
2493 Add QUIT to make the loop interruptible.
2494
2495 2012-06-29 Glenn Morris <rgm@gnu.org>
2496
2497 * charset.c (init_charset): Make lack of etc/charsets fatal.
2498
2499 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2500
2501 * editfns.c (region_limit): Fix type mismatch.
2502
2503 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2504
2505 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2506 undefined. Convert from xassert to eassert.
2507 * nsmenu.m: Convert from xassert to eassert.
2508 * nsterm.m: Likewise.
2509
2510 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
2511
2512 * editfns.c (region_limit): Clip to narrowing (bug#11770).
2513
2514 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2515
2516 Avoid integer overflow on scroll-left and scroll-right.
2517 * window.c (HSCROLL_MAX): New macro.
2518 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2519 overflow when requested scroll falls outside ptrdiff_t range.
2520
2521 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2522
2523 * window.h (struct window): Change type of 'hscroll',
2524 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2525 'last_modified' and 'last_overlay_modified' to EMACS_INT.
2526 Adjust users accordingly.
2527 * xdisp.c (try_cursor_movement): Replace type check with eassert.
2528 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
2529 from EMACS_INT to ptrdiff_t.
2530 (make_window): Omit redundant initialization.
2531
2532 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
2533
2534 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2535
2536 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2537
2538 * window.h (struct window): Change type of 'use_time' and
2539 'sequence_number' from Lisp_Object to int.
2540 * frame.c (make_frame): Adjust users accordingly.
2541 * print.c (print_object): Likewise.
2542 * window.c (select_window, Fwindow_use_time, make_parent_window)
2543 (make_window): Likewise.
2544
2545 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2546
2547 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2548 enabled with --enable-checking=[all,glyphs] configure option.
2549 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2550 adjust comments accordingly.
2551 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2552 undefined, adjust comments accordingly.
2553 * image.c: Likewise.
2554 * scroll.c: Likewise.
2555 * w32fns.c: Likewise.
2556 * w32term.c: Likewise.
2557 * xdisp.c: Likewise.
2558 * xfaces.c: Likewise.
2559 * xfns.c: Likewise.
2560 * xterm.c: Likewise.
2561
2562 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2563
2564 Generalize run-time debugging checks.
2565 * dispextern.h (XASSERTS): Remove.
2566 * fontset.c (xassert): Remove.
2567 Convert from xassert to eassert.
2568 * alloc.c: Convert from xassert to eassert.
2569 * bidi.c: Likewise.
2570 * dispnew.c: Likewise.
2571 * fns.c: Likewise.
2572 * fringe.c: Likewise.
2573 * ftfont.c: Likewise.
2574 * gtkutil.c: Likewise.
2575 * image.c: Likewise.
2576 * keyboard.c: Likewise.
2577 * menu.c: Likewise.
2578 * process.c: Likewise.
2579 * scroll.c: Likewise.
2580 * sound.c: Likewise.
2581 * term.c: Likewise.
2582 * w32console.c: Likewise.
2583 * w32fns.c: Likewise.
2584 * w32term.c: Likewise.
2585 * window.c: Likewise.
2586 * xdisp.c: Likewise.
2587 * xfaces.c: Likewise.
2588 * xfns.c: Likewise.
2589 * xselect.c: Likewise.
2590 * xterm.c: Likewise.
2591
2592 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2593
2594 * fns.c (maybe_resize_hash_table): Output message when growing the
2595 purify-hashtable.
2596
2597 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2598
2599 * alloc.c (allocate_string_data): Remove dead code.
2600 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2601 avoid GCC warning about unused macro.
2602
2603 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2604
2605 * alloc.c (allocate_string): Omit intervals initialization.
2606 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2607 as in make_pure_string and make_pure_c_string.
2608
2609 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2610
2611 * alloc.c (allocate_string): Fix last change.
2612
2613 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2614
2615 * alloc.c (allocate_string): Remove two redundant calls
2616 to memset, add explicit initialization where appropriate.
2617
2618 2012-06-27 Glenn Morris <rgm@gnu.org>
2619
2620 * lisp.mk (lisp): Remove paths.elc.
2621
2622 2012-06-27 Chong Yidong <cyd@gnu.org>
2623
2624 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2625
2626 2012-06-26 John Wiegley <johnw@newartisans.com>
2627
2628 * unexmacosx.c (copy_data_segment): Add two section names used
2629 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2630
2631 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2632 when building with Clang.
2633
2634 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2635
2636 * eval.c (Fapply): Allow calling it with a single argument.
2637
2638 2012-06-26 Eli Zaretskii <eliz@gnu.org>
2639
2640 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2641 _stricmp and _strnicmp.
2642 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2643
2644 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2645
2646 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2647 allocated window.
2648 (allocate_process): Likewise for new process.
2649 (allocate_terminal): Change to use offsetof.
2650 (allocate_frame): Likewise.
2651 * frame.c (make_frame): Omit redundant initialization.
2652 * window.c (make_parent_window): Use memset.
2653 (make_window): Omit redundant initialization.
2654 * process.c (make_process): Omit redundant initialization.
2655 * terminal.c (create_terminal): Likewise.
2656
2657 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2658
2659 * term.c (delete_tty): Remove redundant call to memset.
2660
2661 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2662
2663 * alloc.c: Remove build_string.
2664 * lisp.h: Define build_string as static inline. This provides
2665 a better opportunity to optimize away calls to strlen when the
2666 function is called with compile-time constant argument.
2667 * image.c (imagemagick_error): Convert to build_string.
2668 * w32proc.c (sys_spawnve): Likewise.
2669 * xterm.c (x_term_init): Likewise.
2670
2671 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 Use sprintf return value instead of invoking strlen on result.
2674 In the old days this wasn't portable, since some sprintf
2675 implementations returned char *. But they died out years ago and
2676 Emacs already assumes sprintf returns int.
2677 Similarly for float_to_string.
2678 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2679 * ccl.c (ccl_driver):
2680 * character.c (string_escape_byte8):
2681 * data.c (Fnumber_to_string):
2682 * doprnt.c (doprnt):
2683 * print.c (print_object):
2684 * xdisp.c (message_dolog):
2685 * xfns.c (syms_of_xfns):
2686 Use sprintf or float_to_string result to avoid need to call strlen.
2687 * data.c (Fnumber_to_string):
2688 Use make_unibyte_string, since the string must be ASCII.
2689 * lisp.h, print.c (float_to_string): Now returns int length.
2690 * term.c (produce_glyphless_glyph):
2691 Use sprintf result rather than recomputing it.
2692
2693 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2694 * Makefile.in (ALL_CFLAGS):
2695 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2696 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2697
2698 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2699
2700 * dispextern.h (xstrcasecmp): Define to library function
2701 strcasecmp if available.
2702 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2703
2704 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2705
2706 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2707 Avoid comma operator.
2708 * menu.c (push_submenu_start, push_submenu_end)
2709 (push_left_right_boundary, push_menu_pane): Likewise.
2710 * msdos.c (dos_rawgetc): Likewise.
2711
2712 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2713
2714 * xfns.c (xic_create_fontsetname): Remove redundant calls
2715 to memset.
2716
2717 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2720 sprintf already null-terminates its output.
2721
2722 * xfns.c (x_window): Remove redundant cast.
2723
2724 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2725
2726 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2727 `const char *' to `char *' to avoid compiler warning.
2728
2729 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2730
2731 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2732 instead of truncating it to 63 (admittedly a generous limit).
2733
2734 * process.c: Fix spelling and caps in comments.
2735
2736 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2737
2738 * emacs.c (setpgrp): Remove definition, unused.
2739 * sysdep.c (setpgrp): Remove definition, not used in this file.
2740
2741 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
2742
2743 * makefile.w32-in: Update dependencies.
2744
2745 2012-06-24 Eli Zaretskii <eliz@gnu.org>
2746
2747 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2748 (SYSTIME_H): Add nt/inc/sys/time.h.
2749
2750 * systime.h [WINDOWSNT]: Include sys/time.h.
2751
2752 * s/ms-w32.h (struct timespec): Definition moved from
2753 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2754
2755 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2756
2757 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2758 * buffer.h (buffer_slot_type_mismatch):
2759 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2760 * eval.c (unwind_to_catch):
2761 * image.c (my_png_error, my_error_exit):
2762 * keyboard.c (quit_throw_to_read_char, user_error)
2763 (Fexit_recursive_edit, Fabort_recursive_edit):
2764 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2765 (wrong_type_argument, buffer_overflow, __executable_start)
2766 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2767 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
2768 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
2769 (fatal):
2770 (child_setup) [!DOS_NT]:
2771 * lread.c (end_of_file_error, invalid_syntax):
2772 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2773 * puresize.h (pure_write_error):
2774 * search.c (matcher_overflow):
2775 * sound.c (sound_perror, alsa_sound_perror):
2776 * sysdep.c, syssignal.h (croak):
2777 * term.c (maybe_fatal, vfatal):
2778 * textprop.c (text_read_only):
2779 * undo.c (user_error):
2780 * unexmacosx.c (unexec_error):
2781 * xterm.c (x_ins_del_lines, x_delete_glyphs):
2782 Use _Noreturn rather than NO_RETURN.
2783 No need for separate decl merely because of _Noreturn.
2784 * sound.c (sound_warning, parse_sound):
2785 Remove unnecessary forward decls.
2786
2787 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2788
2789 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
2790 * lisp.h (WAIT_READING_MAX): New macro.
2791 * dispnew.c (Fsleep_for, sit_for):
2792 * keyboard.c (kbd_buffer_get_event):
2793 * process.c (Faccept_process_output):
2794 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
2795 This improves on the previous patch, which introduced a bug
2796 when time_t is unsigned and as wide as intmax_t.
2797 See <http://bugs.gnu.org/9000#51>.
2798
2799 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2800
2801 * dispnew.c (sit_for, Fsleep_for):
2802 * keyboard.c (kbd_buffer_get_event):
2803 * process.c (Faccept_process_output): Avoid compiler warnings when
2804 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
2805
2806 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
2807
2808 * makefile.w32-in: Update dependencies.
2809
2810 * w32.c (ltime): Add return type and declare static.
2811 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
2812
2813 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2814
2815 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
2816 Privately reported by Herbert J. Skuhra.
2817 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
2818 All uses changed.
2819 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
2820 not make_lisp_timeval, when the argument is of type EMACS_TIME.
2821
2822 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2823
2824 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
2825 last argument of make_unibyte_string.
2826
2827 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
2828 language ID in the event parameters.
2829
2830 * w32term.c (w32_read_socket): Put the new keyboard codepage into
2831 event.code, not the obscure "character set ID".
2832
2833 2012-06-23 Chong Yidong <cyd@gnu.org>
2834
2835 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
2836
2837 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2838
2839 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
2840 * w32.c (fdutimens): New function.
2841
2842 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
2843
2844 * s/ms-w32.h (pselect): Redirect to sys_select.
2845
2846 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
2847
2848 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
2849 in the logic of incrementing and decrementing the value of
2850 use_relocatable_buffers.
2851
2852 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2853
2854 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
2855 Privately reported by Herbert J. Skuhra.
2856 [__FreeBSD__]: Remove "*/" typo after "#include".
2857 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
2858 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
2859 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
2860 Don't assume EMACS_TIME and struct timeval are the same type.
2861
2862 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2863
2864 Support higher-resolution time stamps (Bug#9000).
2865 The time stamps are only nanosecond-resolution at the C level,
2866 since that's the best that any real-world system supports now.
2867 But they are picosecond-resolution at the Lisp level, as that's
2868 easy, and leaves room for future OS improvements.
2869
2870 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
2871 (LIBES): Use it.
2872
2873 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
2874 Don't get current time unless it's needed.
2875
2876 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2877 now provides it if it's absent.
2878 (start_atimer): Port to higher-res time stamps.
2879 Check for time stamp overflow. Don't get current time more
2880 often than is needed.
2881
2882 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2883 Include systime.h, not time.h.
2884 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2885
2886 * dired.c: Include stat-time.h.
2887 (Ffile-attributes): File times now have higher resolution.
2888
2889 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2890 (struct image): Timestamp now has higher resolution.
2891
2892 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2893 has at least microseconds now. All uses removed.
2894 (update_frame, update_single_window, update_window, update_frame_1)
2895 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2896
2897 * editfns.c (time_overflow): Now extern.
2898 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2899 (float-time, Fformat_time_string, Fcurrent_time_string)
2900 (Fcurrent_time_zone): Accept and generate higher-resolution
2901 time stamps.
2902 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2903 (decode_time_components, lisp_seconds_argument): New functions.
2904 (make_time): Now static.
2905 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2906 Report an error if the time is invalid, rather than having the caller
2907 do that.
2908
2909 * fileio.c: Include <stat-time.h>
2910 (Fcopy_file): Copy higher-resolution time stamps.
2911 Prefer to set the time stamp via a file descriptor if that works.
2912 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2913 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2914 (Fvisited_file_modtime, Fset_visited_file_modtime):
2915 Support higher-resolution time stamps.
2916
2917 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2918
2919 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2920
2921 * image.c (prepare_image_for_display, clear_image_cache)
2922 (lookup_image): Port to higer-resolution time stamps.
2923
2924 * keyboard.c (start_polling, bind_polling_period):
2925 Check for time stamp overflow.
2926 (read_char, kbd_buffer_get_event, timer_start_idle)
2927 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2928 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2929 Port to higher-resolution time stamps. Do not assume time_t is signed.
2930 (decode_timer): New function. Timers are now vectors of length 9,
2931 not 8, to accommodate the picosecond component.
2932 (timer_check_2): Use it.
2933
2934 * nsterm.m (select_timeout, timeval_subtract): Remove.
2935 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2936 as they're a bit more accurate and handle overflow better.
2937 (ns_select): Change prototype to be compatible with pselect.
2938 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2939 * nsterm.h (ns_select): Adjust prototype.
2940
2941 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2942 us-resolution time stamps.
2943 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2944
2945 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2946
2947 * lisp.h (time_overflow): New decl.
2948 (wait_reading_process_output): First arg is now intmax_t, not int,
2949 to accommodate larger waits.
2950
2951 * process.h (struct Lisp_Process.read_output_delay):
2952 Now counts nanoseconds, not microseconds.
2953 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2954 EMACS_HAS_USECS.
2955 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2956 (wait_reading_process_output):
2957 Port to ns-resolution time stamps.
2958 (Faccept_process_output, wait_reading_process_output):
2959 Check for time stamp overflow. Do not assume time_t is signed.
2960 (select_wrapper): Remove; we now use pselect.
2961 (Fprocess_attributes): Now generates ns-resolution time stamps.
2962
2963 * sysdep.c: Include utimens.h. Don't include utime.h
2964 or worry about struct utimbuf; gnulib does that for us now.
2965 (gettimeofday): Remove; gnulib provides a substitute.
2966 (make_timeval): New function.
2967 (set_file_times): Now sets ns-resolution time stamps.
2968 New arg FD; all uses changed.
2969 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2970 (system_process_attributes):
2971 Now returns ns-resolution time stamp. All uses changed.
2972 Check for time stamp overflow.
2973
2974 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2975 provides a substitute now.
2976
2977 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2978 since it guarantees struct timespec.
2979 (EMACS_TIME): Now struct timespec, so that we can support
2980 ns-resolution time stamps.
2981 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2982 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2983 (EMACS_USECS): Remove.
2984 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2985 so multiply the arg by 1000 before storing it.
2986 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2987 New macros.
2988 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2989 Port to ns-resolution time stamps.
2990 (EMACS_TIME_NEG_P): Remove; replaced by....
2991 (EMACS_TIME_SIGN): New macro.
2992 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2993 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2994 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2995 (make_timeval, make_lisp_time, decode_time_components): New decls.
2996 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2997 that it mishandled time_t overflow. You can't compare by subtracting!
2998 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2999 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
3000
3001 * term.c: Include <sys/time.h>.
3002 (timeval_to_Time): New function, for proper overflow wraparound.
3003 (term_mouse_position, term_mouse_click): Use it.
3004
3005 * undo.c (record_first_change): Support higher-resolution time stamps
3006 in the undo buffer.
3007 (Fprimitive_undo): Use them when restoring time stamps.
3008
3009 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
3010 (w32_get_internal_run_time):
3011 Port to higher-resolution Emacs time stamps.
3012 (ltime): Now accepts single 64-bit integer, as that's more convenient
3013 for callers.
3014
3015 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
3016
3017 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
3018 for compatibility with pselect. Support ns-resolution time stamps.
3019
3020 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
3021
3022 * xselect.c (wait_for_property_change, x_get_foreign_selection):
3023 Check for time stamp overflow, and support ns-resolution time stamps.
3024
3025 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
3026 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
3027 (timeval_subtract): Remove; no longer needed.
3028 (XTflash, XTring_bell, x_wait_for_event):
3029 Port to ns-resolution time stamps. Don't assume time_t is signed.
3030
3031 2012-06-22 Chong Yidong <cyd@gnu.org>
3032
3033 * xdisp.c (x_consider_frame_title): Revert last change.
3034
3035 2012-06-22 Eli Zaretskii <eliz@gnu.org>
3036
3037 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
3038 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
3039 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
3040 staticidx goes up to 1597 out of 1600 = 0x640.)
3041
3042 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
3043
3044 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
3045 Otherwise, the umask might be mistakenly 0 while handling input signals.
3046
3047 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
3048
3049 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
3050
3051 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
3052
3053 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
3054 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
3055 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
3056 access to `contents' member of Lisp_Vector objects with AREF and ASET
3057 where appropriate.
3058
3059 2012-06-19 Chong Yidong <cyd@gnu.org>
3060
3061 * frame.c (delete_frame): When selecting a frame on a different
3062 text terminal, do not alter the terminal's top-frame.
3063
3064 * xdisp.c (format_mode_line_unwind_data): Record the target
3065 frame's selected window and its terminal's top-frame.
3066 (unwind_format_mode_line): Restore them.
3067 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
3068 Callers changed.
3069 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
3070 since tty frames can be explicitly named.
3071 (prepare_menu_bars): Likewise.
3072
3073 * term.c (Ftty_top_frame): New function.
3074
3075 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3076
3077 Port byte-code-meter to modern targets.
3078 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
3079 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
3080 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
3081 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
3082 (METER_1, METER_2): Simplify.
3083
3084 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
3085
3086 * data.c (Fdefalias): Return `symbol' (bug#11686).
3087
3088 2012-06-18 Martin Rudalics <rudalics@gmx.at>
3089
3090 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
3091 gets killed during executing of this function (Bug#11665).
3092 Try to always return Qt when the buffer has been actually killed.
3093 (Vkill_buffer_query_functions): In doc-string say that functions
3094 run by this hook should not change the current buffer.
3095
3096 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3097
3098 Fix recently-introduced process.c problems found by static checking.
3099 * process.c (write_queue_push, write_queue_pop, send_process):
3100 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
3101 (write_queue_pop): Fix pointer signedness problem.
3102 (send_process): Remove unused local.
3103
3104 2012-06-17 Chong Yidong <cyd@gnu.org>
3105
3106 * xdisp.c (redisplay_internal): No need to redisplay terminal
3107 frames that are not on top.
3108
3109 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
3110
3111 * process.c (make_process): Initialize write_queue.
3112 (write_queue_push, write_queue_pop): New functions.
3113 (send_process): Use them to maintain correct ordering of process
3114 writes (Bug#10815).
3115
3116 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
3117
3118 * lisp.h (eassert): Assume C89 or later.
3119 This removes the need for CHECK.
3120 (CHECK): Remove. Its comments about always evaluating its
3121 argument were confusing, as 'eassert' typically does not evaluate
3122 its argument.
3123
3124 * coding.c (produce_chars): Use ptrdiff_t, not int.
3125
3126 * xterm.c (x_draw_underwave): Check for integer overflow.
3127 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
3128
3129 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
3130
3131 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
3132 referenced (Bug#11583).
3133
3134 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
3135
3136 Implement wave-style variant of underlining.
3137 * dispextern.h (face_underline_type): New enum.
3138 (face): Add field for underline type.
3139 * nsterm.m (ns_draw_underwave): New function.
3140 (ns_draw_text_decoration): Use it.
3141 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
3142 New functions.
3143 (x_draw_glyph_string): Use them.
3144 * xfaces.c (Qline, Qwave): New Lisp objects.
3145 (check_lface_attrs, merge_face_ref)
3146 (Finternal_set_lisp_face_attribute, realize_x_face):
3147 Handle wave-style underline face attributes.
3148 * xterm.c (x_draw_underwave): New function.
3149 (x_draw_glyph_string): Use it.
3150
3151 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
3152
3153 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
3154 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
3155 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
3156 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
3157 ($(BLD)/w32select.$(O)): Update dependencies.
3158
3159 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3160
3161 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
3162 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
3163 * character.c (_fetch_multibyte_char_p): Remove.
3164 * alloc.c: Include "character.h" before "buffer.h".
3165 * bidi.c: Likewise.
3166 * buffer.c: Likewise.
3167 * bytecode.c: Likewise.
3168 * callint.c: Likewise.
3169 * callproc.c: Likewise.
3170 * casefiddle.c: Likewise.
3171 * casetab.c: Likewise.
3172 * category.c: Likewise.
3173 * cmds.c: Likewise.
3174 * coding.c: Likewise.
3175 * composite.c: Likewise.
3176 * dired.c: Likewise.
3177 * dispnew.c: Likewise.
3178 * doc.c: Likewise.
3179 * dosfns.c: Likewise.
3180 * editfns.c: Likewise.
3181 * emacs.c: Likewise.
3182 * fileio.c: Likewise.
3183 * filelock.c: Likewise.
3184 * font.c: Likewise.
3185 * fontset.c: Likewise.
3186 * fringe.c: Likewise.
3187 * indent.c: Likewise.
3188 * insdel.c: Likewise.
3189 * intervals.c: Likewise.
3190 * keyboard.c: Likewise.
3191 * keymap.c: Likewise.
3192 * lread.c: Likewise.
3193 * macros.c: Likewise.
3194 * marker.c: Likewise.
3195 * minibuf.c: Likewise.
3196 * nsfns.m: Likewise.
3197 * nsmenu.m: Likewise.
3198 * print.c: Likewise.
3199 * process.c: Likewise.
3200 * regex.c: Likewise.
3201 * region-cache.c: Likewise.
3202 * search.c: Likewise.
3203 * syntax.c: Likewise.
3204 * term.c: Likewise.
3205 * textprop.c: Likewise.
3206 * undo.c: Likewise.
3207 * unexsol.c: Likewise.
3208 * w16select.c: Likewise.
3209 * w32fns.c: Likewise.
3210 * w32menu.c: Likewise.
3211 * window.c: Likewise.
3212 * xdisp.c: Likewise.
3213 * xfns.c: Likewise.
3214 * xmenu.c: Likewise.
3215 * xml.c: Likewise.
3216 * xselect.c: Likewise.
3217
3218 2012-06-16 Eli Zaretskii <eliz@gnu.org>
3219
3220 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
3221 If all the glyphs of the glyph row came from strings, and we have no
3222 cursor positioning clues, put the cursor on the first glyph of the
3223 row.
3224 (handle_face_prop): Use chunk-relative overlay string index when
3225 indexing into it->string_overlays array. (Bug#11653)
3226 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
3227 the rightmost. (Bug#11720)
3228
3229 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3230
3231 * category.h (CHAR_HAS_CATEGORY): Define as inline.
3232 (CATEGORY_MEMBER): Enforce 1/0 value.
3233 * category.c (_temp_category_set): Remove.
3234
3235 2012-06-16 Eli Zaretskii <eliz@gnu.org>
3236
3237 * window.c (Fdelete_other_windows_internal)
3238 (Fdelete_window_internal): Don't access frame's mouse highlight
3239 info of the initial frame. (Bug#11677)
3240
3241 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
3242
3243 * .gdbinit (xgetint): Fix recently-introduced paren typo.
3244 Assume USE_2_TAGS_FOR_INTS.
3245 (xreload): Adjust $tagmask width to match recent lisp.h change.
3246
3247 Simplify lisp.h in minor ways that should not affect code.
3248 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
3249 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
3250 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
3251 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
3252 (INTTYPEBITS): New macro, for clarity.
3253 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
3254 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
3255 Simplify now that USE_LSB_TAG is always defined.
3256 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
3257 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
3258
3259 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
3260
3261 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
3262
3263 2012-06-13 Glenn Morris <rgm@gnu.org>
3264
3265 * s/bsd-common.h (BSD4_3):
3266 * s/usg5-4-common.h (USG5_4): No longer define; unused.
3267
3268 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
3269
3270 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
3271 instead of union.
3272 (XLI, XIL): Define.
3273 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
3274 Use them.
3275 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
3276 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
3277 * alloc.c (widen_to_Lisp_Object): Remove.
3278 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
3279 * frame.c (delete_frame): Remove outdated comment.
3280 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
3281 USE_LISP_UNION_TYPE.
3282 (Fw32_unregister_hot_key): Likewise.
3283 (Fw32_toggle_lock_key): Likewise.
3284 * w32menu.c (add_menu_item): Likewise.
3285 (w32_menu_display_help): Use XIL instead of checking
3286 USE_LISP_UNION_TYPE.
3287 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
3288 (init_heap): Likewise.
3289 * w32term.c (w32_read_socket): Update comment.
3290
3291 2012-06-13 Glenn Morris <rgm@gnu.org>
3292
3293 * s/usg5-4-common.h, src/s/unixware.h:
3294 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
3295
3296 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
3297
3298 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
3299
3300 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
3301 * alloc.c (make_number) [!defined make_number]:
3302 Remove, as lisp.h always defines this now.
3303 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
3304 (roundup_size): Verify that it is a power of 2.
3305 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
3306 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
3307 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
3308 -DUSE_LSB_TAG=0, to override the automatically-selected default.
3309 USE_LSB_TAG now is always defined to be either 0 or 1.
3310 All uses changed.
3311 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
3312 code works fine either way, and efficiency is not a concern here,
3313 as the union type is for debugging, not for production.
3314 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
3315 Use an inline function on all platforms when using the union type,
3316 since this is simpler and 'static inline' can be used portably
3317 within Emacs now.
3318 (LISP_INITIALLY_ZERO): New macro.
3319 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
3320 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
3321
3322 2012-06-12 Glenn Morris <rgm@gnu.org>
3323
3324 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
3325
3326 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
3327
3328 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
3329 Move BROKEN_SIGIO to configure.
3330
3331 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
3332 Move NO_TERMIO to configure.
3333
3334 2012-06-12 Chong Yidong <cyd@gnu.org>
3335
3336 * image.c (imagemagick_load_image): Use MagickFlattenImage if
3337 MagickMergeImageLayers is undefined. Use pixel pusher loop if
3338 MagickExportImagePixels is undefined.
3339
3340 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
3341
3342 * image.c (imagemagick_load_image): Remove unused label.
3343
3344 2012-06-11 Glenn Morris <rgm@gnu.org>
3345
3346 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3347 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
3348 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
3349 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
3350
3351 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
3352
3353 * alloc.c (make_byte_code): New function.
3354 (Fmake_byte_code): Use it. Don't purify here.
3355 * lread.c (read1): Use it as well to avoid extra allocation.
3356
3357 2012-06-11 Chong Yidong <cyd@gnu.org>
3358
3359 * image.c (imagemagick_load_image): Implement transparency.
3360
3361 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
3362
3363 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
3364 account for preceding backslashes. (Bug#11663)
3365
3366 2012-06-09 Chong Yidong <cyd@gnu.org>
3367
3368 * term.c: Support italics in capable terminals (Bug#9652).
3369 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
3370 (turn_on_face): Output using TS_enter_italic_mode if available.
3371 Don't handle unused blinking and alt-charset cases.
3372 (turn_off_face): Handle italic case; discard unused tty_blinking_p
3373 and tty_alt_charset_p cases.
3374 (tty_capable_p, init_tty): Support italics.
3375
3376 * termchar.h (struct tty_display_info): Add field for italics.
3377 Remove unused blink field.
3378
3379 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
3380 Handle slant.
3381
3382 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
3383 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
3384 tty_alt_charset_p. Add tty_italic_p.
3385
3386 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
3387
3388 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3389 dbus_type_is_basic if available.
3390 (xd_extract_signed, xd_extract_unsigned): Rename from
3391 extract_signed and extract_unsigned, respectively. Adapt callers.
3392
3393 2012-06-09 Chong Yidong <cyd@gnu.org>
3394
3395 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3396
3397 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3398 case (Bug#9752).
3399
3400 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 * xdisp.c (vmessage): Treat frame message as multibyte.
3403 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3404 would generate the diagnostic "Making \302\247 buffer-local while
3405 let-bound!".
3406
3407 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3408
3409 * dispnew.c (showing_window_margins_p): Undo last change, which
3410 was done due to an inadvertent commit.
3411 (adjust_frame_glyphs_for_frame_redisplay): Do call
3412 showing_window_margins_p.
3413
3414 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3415
3416 * eval.c (Fmake_var_non_special): New primitive.
3417 (syms_of_eval): Defsubr it.
3418 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3419
3420 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
3421
3422 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3423 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3424
3425 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3426
3427 * alloc.c (allocate_vectorlike): Fix last change.
3428
3429 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
3430
3431 Block-based vector allocation of small vectors.
3432 * lisp.h (struct vectorlike_header): New field `nbytes',
3433 adjust comment accordingly.
3434 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3435 to denote vector blocks. Adjust users (live_vector_p,
3436 mark_maybe_pointer, valid_lisp_object_p) accordingly.
3437 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3438 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3439 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3440 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3441 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3442 (roundup_size): New constant.
3443 (struct vector_block): New data type.
3444 (vector_blocks, vector_free_lists, zero_vector): New variables.
3445 (all_vectors): Rename to `large_vectors'.
3446 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3447 (sweep_vectors): New functions.
3448 (allocate_vectorlike): Return `zero_vector' as the only vector of
3449 0 items. Allocate new vector from block if vector size is less than
3450 or equal to VBLOCK_BYTES_MAX.
3451 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3452 (init_alloc_once): Add call to init_vectors.
3453
3454 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3455
3456 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3457
3458 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
3459
3460 * doprnt.c (doprnt): Truncate multibyte char correctly.
3461 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3462 would mishandle a string argument "Xc" if X was a multibyte
3463 character of length 2: it would truncate after X's first byte
3464 rather than including all of X.
3465
3466 2012-06-06 Chong Yidong <cyd@gnu.org>
3467
3468 * buffer.c (word_wrap): Doc fix.
3469
3470 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
3471
3472 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3473
3474 2012-06-03 Glenn Morris <rgm@gnu.org>
3475
3476 * xdisp.c (tool-bar-style): Doc fix.
3477
3478 2012-06-03 Ulrich Müller <ulm@gentoo.org>
3479
3480 * Makefile.in (PAXCTL): Define.
3481 (temacs$(EXEEXT)): Disable memory randomization for the temacs
3482 binary via PaX flags if the paxctl utility is available.
3483 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3484 Restore PaX flags to their default. (Bug#11398)
3485
3486 2012-06-03 Chong Yidong <cyd@gnu.org>
3487
3488 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3489 buffer (Bug#11226).
3490
3491 2012-06-03 Chong Yidong <cyd@gnu.org>
3492
3493 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3494 (note_mode_line_or_margin_highlight): If there is no help echo,
3495 use mode-line-default-help-echo. Handle the case where the mouse
3496 position is past the end of the mode line string.
3497
3498 * buffer.c (buffer_local_value_1): New function, split from
3499 Fbuffer_local_value; can return Qunbound.
3500 (Fbuffer_local_value): Use it.
3501 (Vmode_line_format): Docstring tweaks.
3502
3503 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3504
3505 * sysdep.c (system_process_attributes): Improve comment.
3506
3507 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
3508
3509 * keyboard.c: Export real-this-command to Elisp.
3510 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3511 and DEFVAR it. Update all users.
3512
3513 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3514
3515 * minibuf.c (Fassoc_string): Remove duplicate declaration.
3516
3517 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3518 Convert pctcpu and pctmem to Lisp float properly.
3519 Let the compiler fold better, as 100.0/0x8000 is exact.
3520
3521 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
3522
3523 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3524 cons_block.
3525
3526 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
3527
3528 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
3529
3530 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
3531
3532 For a 'struct window', replace some Lisp_Object fields to
3533 bitfields where appropriate, remove unused fields.
3534 * window.h (struct window): Remove unused 'last_mark_x' and
3535 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
3536 change it's type from Lisp_Object to bitfield.
3537 Change type of 'force_start', 'optional_new_start',
3538 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
3539 fields from Lisp_Object to bitfield. Adjust users accordingly.
3540
3541 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3542
3543 Pacify gcc -Wdouble-precision when using Xaw.
3544 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
3545 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
3546 Use 'float' consistently, rather than 'float' in most places
3547 and 'double' in a couple of places.
3548
3549 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3550
3551 * xdisp.c (handle_stop): Detect whether we have overlay strings
3552 loaded by testing it->current.overlay_string_index to be
3553 non-negative, instead of checking whether n_overlay_strings is
3554 positive. (Bug#11587)
3555
3556 2012-05-31 Chong Yidong <cyd@gnu.org>
3557
3558 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3559
3560 * doc.c (Fsubstitute_command_keys): Doc fix.
3561
3562 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3563
3564 * search.c (search_buffer): Remove calls to
3565 r_alloc_inhibit_buffer_relocation, as it is now called by
3566 maybe_unify_char, which was the cause of relocation of buffer text
3567 in bug#11519.
3568
3569 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3570
3571 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3572 for the duration of call to load_charset, to avoid problems with
3573 callers of maybe_unify_char that access buffer text through C
3574 pointers.
3575
3576 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3577 decrement the inhibition flag, instead of just setting or
3578 resetting it.
3579
3580 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3581
3582 Remove obsolete '#define static' cruft.
3583 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3584 This #undef was "temporary" in 2000; it is no longer needed
3585 now that '#define static' has gone away.
3586 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3587 (gray_bitmap_bits): Remove; no longer needed.
3588 All uses replaced with definiens.
3589 * xterm.c: Include "bitmaps/gray.xbm".
3590
3591 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3592
3593 Clean up __executable_start, monstartup when --enable-profiling.
3594 The following changes affect the code only when profiling.
3595 * dispnew.c (__executable_start): Rename from safe_bcopy.
3596 Define only on platforms that need it.
3597 * emacs.c: Include <sys/gmon.h> when profiling.
3598 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3599 (__executable_start): Remove decl, since lisp.h does it now.
3600 (safe_bcopy): Remove decl; no longer has that name.
3601 (main): Coalesce #if into single bit of code, for simplicity.
3602 Cast pointers to uintptr_t, since standard libraries want integers
3603 and not pointers.
3604 * lisp.h (__executable_start): New decl.
3605
3606 2012-05-31 Glenn Morris <rgm@gnu.org>
3607
3608 * image.c (Fimagemagick_types): Doc fix.
3609
3610 2012-05-30 Jim Meyering <meyering@redhat.com>
3611
3612 * callproc.c (Fcall_process_region): Include directory component
3613 in mkstemp error message (Bug#11586).
3614
3615 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3616
3617 * alloc.c, lisp.h (make_pure_vector): Now static.
3618
3619 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3620
3621 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3622 Move to byte-run.el.
3623 (Fautoload): Do the hash-doc more carefully.
3624 * data.c (Fdefalias): Purify definition, except for keymaps.
3625 (Qdefun): Move from eval.c.
3626 * lisp.h (Qdefun): Remove.
3627 * lread.c (read1): Tiny simplification.
3628
3629 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
3630
3631 Do not create empty overlays with the evaporate property (Bug#9642).
3632 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3633 Bug#9642, but explicitly check that the buffer the overlay would
3634 be moved to is live and rearrange lines to make sure that errors
3635 will not put the overlay in an inconsistent state.
3636 (Fdelete_overlay): Cosmetics.
3637
3638 2012-05-28 Eli Zaretskii <eliz@gnu.org>
3639
3640 * w32term.c (my_bring_window_to_top): New function.
3641 (x_raise_frame): Use handle returned by DeferWindowPos, which
3642 could be different from the original one.
3643 Call my_bring_window_to_top instead of my_set_foreground_window.
3644 (Bug#11513)
3645
3646 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3647 by calling BringWindowToTop.
3648
3649 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3650 (WM_EMACS_END): Increase by one.
3651
3652 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3653
3654 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3655 This avoids undefined behavior that might cause the eassert
3656 to not catch an out-of-range value.
3657
3658 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
3659
3660 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3661 Update dependencies.
3662
3663 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3664
3665 * bidi.c (bidi_mirror_char): Fix last change.
3666
3667 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3668
3669 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3670 when referring to sectname field in printf format.
3671
3672 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3673
3674 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3675 Only r_alloc_inhibit_buffer_relocation needed to be added;
3676 the others were already declared.
3677
3678 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3679 before checking whether it's out of range. Put the check inside
3680 eassert. See
3681 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3682
3683 2012-05-27 Ken Brown <kbrown@cornell.edu>
3684
3685 * callproc.c (Fcall_process): Restore a line that was accidentally
3686 commented out in the 2011-02-13 change (bug#11547).
3687
3688 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3689
3690 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3691 defined on ralloc.c.
3692
3693 * buffer.c [REL_ALLOC]: Remove prototypes of
3694 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3695 they are now on lisp.h.
3696
3697 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3698
3699 * search.c (search_buffer): Use it to inhibit relocation of buffer
3700 text while re_search_2 is doing its job, because re_search_2 is
3701 passed C pointers to buffer text. (Bug#11519)
3702
3703 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3704 Update value to 24.
3705
3706 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3707 state after an additional call to move_it_in_display_line_to, keep
3708 the values of it->max_ascent and it->max_descent found for the
3709 entire line.
3710 (pos_visible_p): Revert the comparison against bottom_y to what it
3711 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3712 (Bug#11464)
3713
3714 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3715
3716 Fix coding-related core dumps with gcc -ftrapv.
3717 The code was computing A - B, where A and B are pointers, and B is
3718 random garbage. This can lead to core dumps on platforms that
3719 have special pointer registers, and it also leads to core dumps on
3720 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3721 A - B only when B is initialized properly.
3722 * coding.c (coding_set_source, coding_set_destination): Return void.
3723 (coding_change_source, coding_change_destinations): New functions,
3724 with the old behaviors of coding_set_source and coding_set_destination.
3725 All callers that need an offset changed to use these new functions.
3726
3727 2012-05-26 Glenn Morris <rgm@gnu.org>
3728
3729 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3730
3731 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3732
3733 Extend mouse support on W32 text-mode console.
3734 * xdisp.c (draw_row_with_mouse_face):
3735 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
3736
3737 * w32console.c: Include window.h.
3738 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3739 New functions.
3740 (initialize_w32_display): Initialize mouse-highlight data.
3741
3742 * w32inevt.c: Include termchar.h and window.h.
3743 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3744 moves, call note_mouse_highlight. If help_echo changed, call
3745 gen_help_event to produce help-echo message in the echo area.
3746 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3747 highlight info.
3748
3749 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3750
3751 * lread.c (read1): Simplify slightly to avoid an overflow warning
3752 with GCC 4.7.0 on x86-64.
3753
3754 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3755
3756 * bidi.c (bidi_mirror_char): Revert last change: an int is
3757 definitely wide enough here.
3758
3759 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3760
3761 Fix integer width and related bugs (Bug#9874).
3762 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
3763 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3764 (string_bytes, check_sblock, allocate_string_data):
3765 (compact_small_strings, Fmake_bool_vector, make_string)
3766 (make_unibyte_string, make_multibyte_string)
3767 (make_string_from_bytes, make_specified_string)
3768 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
3769 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
3770 (mark_vectorlike):
3771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3772 (allocate_pseudovector):
3773 Use int, not EMACS_INT, where int is wide enough.
3774 (inhibit_garbage_collection, Fgarbage_collect):
3775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3776 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
3777 int might not be wide enough.
3778 (bidi_cache_search, bidi_cache_find, bidi_init_it)
3779 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3780 (bidi_at_paragraph_end, bidi_find_paragraph_start)
3781 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
3782 (bidi_level_of_next_char, bidi_move_to_visually_next):
3783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3784 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
3785 (Fkill_buffer, Fset_buffer_major_mode)
3786 (advance_to_char_boundary, Fbuffer_swap_text)
3787 (Fset_buffer_multibyte, overlays_at, overlays_in)
3788 (overlay_touches_p, struct sortvec, record_overlay_string)
3789 (overlay_strings, recenter_overlay_lists)
3790 (adjust_overlays_for_insert, adjust_overlays_for_delete)
3791 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
3792 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
3793 (Foverlay_recenter, last_overlay_modification_hooks_used)
3794 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
3795 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3796 (validate_region): Omit unnecessary test for b <= e,
3797 since that's guaranteed by the previous test.
3798 (adjust_overlays_for_delete): Avoid pos + length overflow.
3799 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
3800 (report_overlay_modification):
3801 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3802 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
3803 Omit pointer cast, which isn't needed anyway, and doesn't work
3804 after the EMACS_INT -> ptrdiff_t change.
3805 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
3806 * buffer.h: Adjust decls to match defn changes elsewhere.
3807 (struct buffer_text, struct buffer):
3808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3809 Use EMACS_INT, not int, where int might not be wide enough.
3810 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
3811 not int, to avoid needless 32-bit limit on 64-bit hosts.
3812 (exec_byte_code): Use tighter memory-full test, one that checks
3813 for alloca overflow. Don't compute the address of the object just
3814 before an array, as that's not portable. Use EMACS_INT, not
3815 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
3816 * callint.c (Fcall_interactively):
3817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3818 * callproc.c (call_process_kill, Fcall_process):
3819 Don't assume pid_t fits into an Emacs fixnum.
3820 (call_process_cleanup, Fcall_process, child_setup):
3821 Don't assume pid_t fits into int.
3822 (call_process_cleanup, Fcall_process, delete_temp_file)
3823 (Fcall_process_region):
3824 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3825 (Fcall_process): Simplify handling of volatile integers.
3826 Use int, not EMACS_INT, where int will do.
3827 * casefiddle.c (casify_object, casify_region, operate_on_word)
3828 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
3829 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3830 (casify_object): Avoid integer overflow when overallocating buffer.
3831 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
3832 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
3833 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
3834 * category.h (CATEGORYP): Don't assume arg is nonnegative.
3835 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
3836 integers are now checked earlier. All uses replaced with XINT.
3837 (ccl_driver):
3838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3839 For CCL_MapSingle, check that content and value are in int range.
3840 (ccl_driver, Fregister_code_conversion_map):
3841 Check that Vcode_version_map_vector is a vector.
3842 (resolve_symbol_ccl_program): Check that vector header is in range.
3843 Always copy the vector, so that we can check its contents reliably
3844 now rather than having to recheck each instruction as it's being
3845 executed. Check that vector words fit in 'int'.
3846 (ccl_get_compiled_code, Fregister_ccl_program)
3847 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
3848 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
3849 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
3850 contents are in range.
3851 (Fccl_execute_on_string): Check that status is in range.
3852 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
3853 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
3854 Accept and return EMACS_INT, not int, because callers can pass values
3855 out of 'int' range.
3856 (c_string_width, strwidth, lisp_string_width, chars_in_text)
3857 (multibyte_chars_in_text, parse_str_as_multibyte)
3858 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
3859 (str_as_unibyte, str_to_unibyte, string_count_byte8)
3860 (string_escape_byte8, Fget_byte):
3861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3862 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
3863 avoid mishandling large integers.
3864 * character.h: Adjust decls to match defn changes elsewhere.
3865 * charset.c (load_charset_map_from_file, find_charsets_in_text)
3866 (Ffind_charset_region):
3867 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3868 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
3869 (load_charset_map_from_vector, Fdefine_charset_internal):
3870 Don't assume fixnum fits in int.
3871 (load_charset_map_from_vector, Fmap_charset_chars):
3872 Remove now-unnecessary CHECK_NATNUMs.
3873 (Fdefine_charset_internal): Check ranges here, more carefully.
3874 Don't rely on undefined behavior with signed left shift overflow.
3875 Don't assume unsigned int fits into fixnum, or that fixnum fits
3876 into unsigned int. Don't require max_code to be a valid fixnum;
3877 that's not true for gb10830 4-byte on a 32-bit host. Allow
3878 invalid_code to be a cons, for the same reason. Require code_offset
3879 to be a character. Avoid int overflow if max_char is close
3880 to INT_MAX.
3881 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3882 this is intended anyway and avoids some undefined behavior.
3883 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3884 INDEX_TO_CODE_POINT, as that's what it expects.
3885 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
3886 * charset.h (DECODE_CHAR): Return int, not unsigned;
3887 this is what was intended anyway, and it avoids undefined behavior.
3888 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3889 integer-overflow issues.
3890 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3891 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3892 where the argument is EMACS_INT, and this behavior is not intended.
3893 * chartab.c (Fmake_char_table, Fset_char_table_range)
3894 (uniprop_get_decoder, uniprop_get_encoder):
3895 Don't assume fixnum fits in int.
3896 * cmds.c (move_point): New function, that does the gist of
3897 Fforward_char and Fbackward_char, but does so while checking
3898 for integer overflow more accurately.
3899 (Fforward_char, Fbackward_char): Use it.
3900 (Fforward_line, Fend_of_line, internal_self_insert)
3901 (internal_self_insert):
3902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3903 Fix a FIXME, by checking for integer overflow when calculating
3904 target_clm and actual_clm.
3905 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
3906 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
3907 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3908 (coding_alloc_by_making_gap, alloc_destination)
3909 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3910 (encode_coding_utf_16, detect_coding_emacs_mule)
3911 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3912 (detect_coding_iso_2022, decode_coding_iso_2022)
3913 (encode_invocation_designation, encode_designation_at_bol)
3914 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3915 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3916 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3917 (encode_coding_ccl, encode_coding_raw_text)
3918 (detect_coding_charset, decode_coding_charset)
3919 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3920 (produce_composition, produce_charset, produce_annotation)
3921 (decode_coding, handle_composition_annotation)
3922 (handle_charset_annotation, consume_chars, decode_coding_gap)
3923 (decode_coding_object, encode_coding_object, detect_coding_system)
3924 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3925 (code_convert_region, code_convert_string)
3926 (Fdefine_coding_system_internal)
3927 (coding_set_source, coding_set_destination):
3928 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3929 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3930 (Fdefine_coding_system_internal):
3931 Don't assume fixnums fit in int.
3932 (decode_coding_gap, decode_coding_object, encode_coding_object)
3933 (Fread_coding_system, Fdetect_coding_region)
3934 (Funencodable_char_position, Fcheck_coding_systems_region)
3935 (get_translation, handle_composition_annotation, consume_chars):
3936 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3937 (consume_chars): Rewrite to not calculate an address outside buffer.
3938 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
3939 Don't access memory outside of the args array.
3940 (Fdefine_coding_system_internal): Check for charset-id overflow.
3941 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3942 result of ENCODE_CHAR.
3943 * coding.h: Adjust decls to match defn changes elsewhere.
3944 (struct coding_system):
3945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3946 * composite.c (get_composition_id, find_composition)
3947 (run_composition_function, update_compositions)
3948 (compose_text, composition_gstring_put_cache)
3949 (composition_gstring_p, composition_gstring_width)
3950 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3951 (composition_compute_stop_pos, composition_reseat_it)
3952 (composition_update_it, struct position_record)
3953 (find_automatic_composition, composition_adjust_point)
3954 (Fcomposition_get_gstring, Ffind_composition_internal):
3955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3956 (update_compositions):
3957 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3958 * composite.h: Adjust decls to match defn changes elsewhere.
3959 (struct composition):
3960 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3961 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3962 Do not attempt to compute the address of the object just before a
3963 buffer; this is not portable.
3964 (Faref, Faset):
3965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3966 (Faset): Use int, not EMACS_INT, where int is wide enough.
3967 (Fstring_to_number): Don't assume fixnums fit in int.
3968 (Frem): Don't assume arg is nonnegative.
3969 * dbusbind.c (xd_append_arg): Check for integers out of range.
3970 (Fdbus_call_method): Don't overflow the timeout int.
3971 (extract_signed, extract_unsigned): New functions.
3972 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3973 (xd_get_connection_references): Return ptrdiff_t, not int.
3974 All uses changed.
3975 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3976 (xd_read_message_1):
3977 Use int, not unsigned, where the dbus API uses int.
3978 (Fdbus_message_internal): Don't overflow mtype.
3979 (syms_of_dbusbind): Allocate right-sized buffer for integers.
3980 * dired.c (directory_files_internal, file_name_completion, scmp)
3981 (file_name_completion_stat):
3982 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3983 (file_name_completion): Don't overflow matchcount.
3984 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3985 * dispextern.h: Adjust decls to match defn changes elsewhere.
3986 (struct text_pos, struct glyph, struct bidi_saved_info)
3987 (struct bidi_string_data, struct bidi_it, struct composition_it)
3988 (struct it):
3989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3990 (struct display_pos, struct composition_it, struct it):
3991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3992 * dispnew.c (increment_matrix_positions)
3993 (increment_row_positions, mode_line_string)
3994 (marginal_area_string):
3995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3996 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
3997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3998 (duration_to_sec_usec): New function, to check for overflow better.
3999 (Fsleep_for, sit_for): Use it.
4000 * doc.c (get_doc_string, store_function_docstring):
4001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4002 (get_doc_string, Fsnarf_documentation):
4003 Use int, not EMACS_INT, where int is wide enough.
4004 (get_doc_string):
4005 Use SAFE_ALLOCA, not alloca.
4006 Check for overflow when converting EMACS_INT to off_t.
4007 * doprnt.c (doprnt):
4008 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4009 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
4010 Don't assume uid_t fits into fixnum.
4011 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
4012 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
4013 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
4014 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
4015 (general_insert_function)
4016 (Finsert_char, make_buffer_string, make_buffer_string_both)
4017 (update_buffer_properties, Fbuffer_substring)
4018 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
4019 (Fsubst_char_in_region, check_translation)
4020 (Ftranslate_region_internal, save_restriction_restore, Fformat)
4021 (transpose_markers, Ftranspose_regions):
4022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4023 (clip_to_bounds): Move to lisp.h as an inline function).
4024 (Fconstrain_to_field): Don't assume integers are nonnegative.
4025 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
4026 (Fsubst_char_in_region, Fsave_restriction):
4027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4028 (Femacs_pid): Don't assume pid_t fits into fixnum.
4029 (lo_time): Use int, not EMACS_INT, when int suffices.
4030 (lisp_time_argument): Check for usec out of range.
4031 (Fencode_time): Don't assume fixnum fits in int.
4032 (Fuser_login_name, Fuser_full_name): Signal an error
4033 if a uid argument is out of range, rather than relying on
4034 undefined behavior.
4035 (Fformat_time_string): Remove now-unnecessary check.
4036 lisp_time_argument checks for out-of-range usec now.
4037 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
4038 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
4039 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
4040 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
4041 (init_cmdargs, Fdump_emacs):
4042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4043 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
4044 the bottom (typically) 32 bits of the fixnum.
4045 * eval.c (specpdl_size, call_debugger):
4046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4047 (when_entered_debugger, Fbacktrace_debug):
4048 Don't assume fixnum can fit in int.
4049 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
4050 the object just before a buffer; this is not portable.
4051 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
4052 (grow_specpdl, unbind_to):
4053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4054 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
4055 (grow_specpdl): Simplify allocation by using xpalloc.
4056 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
4057 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
4058 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
4059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4060 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
4061 (a_write, e_write):
4062 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4063 (Fcopy_file, non_regular_nbytes, read_non_regular)
4064 (Finsert_file_contents):
4065 Use int, not EMACS_INT, where int is wide enough.
4066 (READ_BUF_SIZE): Verify that it fits in int.
4067 (Finsert_file_contents): Check that counts are in proper range,
4068 rather than assuming fixnums fit into ptrdiff_t etc.
4069 Don't assume fixnums fit into int.
4070 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
4071 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
4072 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
4073 (string_char_to_byte, string_byte_to_char)
4074 (string_make_multibyte, string_to_multibyte)
4075 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
4076 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
4077 (substring_both, Fdelete, internal_equal, Ffillarray)
4078 (Fclear_string, mapcar1)
4079 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
4080 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
4081 (larger_vector, make_hash_table, maybe_resize_hash_table)
4082 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
4083 (Fmaphash, secure_hash):
4084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4085 (concat): Check for string index and length overflow.
4086 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
4087 (Frequire):
4088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4089 (larger_vector): New API (vec, incr_min, size_max) replaces old
4090 one (vec, new_size, init). This catches size overflow.
4091 INIT was removed because it was always Qnil.
4092 All callers changed.
4093 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
4094 the upper bound on a hash table index size.
4095 (make_hash_table, maybe_resize_hash_table): Use it.
4096 (secure_hash): Computer start_byte and end_byte only after
4097 they're known to be in ptrdiff_t range.
4098 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
4099 (Ffont_get_glyphs, Ffont_at):
4100 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4101 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
4102 (Flist_fonts, Fopen_font):
4103 Don't assume fixnum can fit in int.
4104 (check_gstring): Don't assume index can fit in int.
4105 (font_match_p): Check that fixnum is a character, not a nonnegative
4106 fixnum, since the later code needs to stuff it into an int.
4107 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
4108 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
4109 conversion overflow issues.
4110 (Fopen_font): Check for integer out of range.
4111 (Ffont_get_glyphs): Don't assume index can fit in int.
4112 * font.h: Adjust decls to match defn changes elsewhere.
4113 * fontset.c (reorder_font_vector): Redo score calculation to avoid
4114 integer overflow.
4115 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
4116 printmax_t, where ptrdiff_t is wide enough.
4117 (Finternal_char_font):
4118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4119 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
4120 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
4121 (Fset_frame_position, x_set_frame_parameters)
4122 (x_set_line_spacing, x_set_border_width)
4123 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
4124 Check that fixnums are in proper range for system types.
4125 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
4126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4127 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
4128 Use SAFE_ALLOCA_LISP, not alloca.
4129 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
4130 intptr_t is wide enough.
4131 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
4132 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
4133 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
4134 Check for fixnum out of range.
4135 * ftfont.c (ftfont_list): Don't assume index fits in int.
4136 Check that fixnums are in proper range for system types.
4137 (ftfont_shape_by_flt):
4138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4139 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4141 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
4142 Check that fixnums are in proper range for system types.
4143 * gnutls.h: Adjust decls to match defn changes elsewhere.
4144 * gtkutil.c (xg_dialog_run):
4145 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4146 (update_frame_tool_bar):
4147 Check that fixnums are in proper range for system types.
4148 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
4149 (lookup_image): Check that fixnums are in range for system types.
4150 * indent.c (last_known_column, last_known_column_point):
4151 (current_column_bol_cache):
4152 (skip_invisible, current_column, check_display_width):
4153 (check_display_width, scan_for_column, current_column_1)
4154 (Findent_to, Fcurrent_indentation, position_indentation)
4155 (indented_beyond_p, Fmove_to_column, compute_motion):
4156 (Fcompute_motion, Fvertical_motion):
4157 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4158 (last_known_column_modified): Use EMACS_INT, not int.
4159 (check_display_width):
4160 (Fcompute_motion):
4161 Check that fixnums and floats are in proper range for system types.
4162 (compute_motion): Don't assume index or fixnum fits in int.
4163 (compute_motion, Fcompute_motion):
4164 Use int, not EMACS_INT, when it is wide enough.
4165 (vmotion): Omit local var start_hpos that is always 0; that way
4166 we don't need to worry about overflow in expressions involving it.
4167 * indent.h: Adjust decls to match defn changes elsewhere.
4168 (struct position):
4169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4170 Use int, not EMACS_INT, where int is wide enough.
4171 Remove unused members ovstring_chars_done and tab_offset;
4172 all uses removed.
4173 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
4174 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
4175 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
4176 (make_gap, copy_text, insert, insert_and_inherit)
4177 (insert_before_markers, insert_before_markers_and_inherit)
4178 (insert_1, count_combining_before, count_combining_after)
4179 (insert_1_both, insert_from_string)
4180 (insert_from_string_before_markers, insert_from_string_1)
4181 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
4182 (adjust_after_replace, adjust_after_insert, replace_range)
4183 (replace_range_2, del_range, del_range_1, del_range_byte)
4184 (del_range_both, del_range_2, modify_region)
4185 (prepare_to_modify_buffer, signal_before_change)
4186 (signal_after_change, Fcombine_after_change_execute):
4187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4188 * intervals.c (traverse_intervals, rotate_right, rotate_left)
4189 (balance_an_interval, split_interval_right, split_interval_left)
4190 (find_interval, next_interval, update_interval)
4191 (adjust_intervals_for_insertion, delete_node, delete_interval)
4192 (interval_deletion_adjustment, adjust_intervals_for_deletion)
4193 (static_offset_intervals, offset_intervals)
4194 (merge_interval_right, merge_interval_left, make_new_interval)
4195 (graft_intervals_into_buffer, temp_set_point_both)
4196 (temp_set_point, set_point, adjust_for_invis_intang)
4197 (set_point_both, move_if_not_intangible, get_property_and_range)
4198 (get_local_map, copy_intervals, copy_intervals_to_string)
4199 (compare_string_intervals, set_intervals_multibyte_1):
4200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4201 * intervals.h: Adjust decls to match defn changes elsewhere.
4202 (struct interval):
4203 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4204 * keyboard.c (this_command_key_count, this_single_command_key_start)
4205 (before_command_key_count, before_command_echo_length, echo_now)
4206 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
4207 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
4208 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
4209 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
4210 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4211 (last_non_minibuf_size, last_point_position, echo_truncate)
4212 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
4213 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
4214 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
4215 (stuff_buffered_input):
4216 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4217 (last_auto_save, command_loop_1, read_char):
4218 Use EMACS_INT, not int, to avoid integer overflow.
4219 (record_char): Avoid overflow in total_keys computation.
4220 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
4221 * keyboard.h: Adjust decls to match defn changes elsewhere.
4222 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
4223 (Fkey_description, Fdescribe_vector, Flookup_key):
4224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4225 (click_position): New function, to check that positions are in range.
4226 (Fcurrent_active_maps):
4227 (describe_command):
4228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4229 (Faccessible_keymaps, Fkey_description):
4230 (preferred_sequence_p):
4231 Don't assume fixnum can fit into int.
4232 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
4233 Check for integer overflow in size calculations.
4234 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
4235 avoid mishandling large integers.
4236 * lisp.h: Adjust decls to match defn changes elsewhere.
4237 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
4238 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
4239 (struct Lisp_Marker):
4240 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4241 (clip_to_bounds): Now an inline function, moved here from editfns.c.
4242 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
4243 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
4244 All callers changed.
4245 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
4246 Assume the arg has valid form, since it always does.
4247 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
4248 unsigned integer system type.
4249 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
4250 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
4251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4252 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
4253 (duration_to_sec_usec): New decl.
4254 * lread.c (read_from_string_index, read_from_string_index_byte)
4255 (read_from_string_limit, readchar, unreadchar, openp)
4256 (read_internal_start, read1, oblookup):
4257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4258 (Fload, readevalloop, Feval_buffer, Feval_region):
4259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4260 (openp): Check for out-of-range argument to 'access'.
4261 (read1): Use int, not EMACS_INT, where int is wide enough.
4262 Don't assume fixnum fits into int.
4263 Fix off-by-one error that can read outside a buffer.
4264 (read_filtered_event): Use duration_to_sec_usec
4265 to do proper overflow checking on durations.
4266 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
4267 in size calculation.
4268 (Fexecute_kbd_macro):
4269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4270 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
4271 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
4272 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
4273 (set_marker_both, set_marker_restricted_both, marker_position)
4274 (marker_byte_position, Fbuffer_has_markers_at):
4275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4276 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
4277 * menu.c (ensure_menu_items): Rename from grow_menu_items.
4278 It now merely ensures that the menu is large enough, without
4279 necessarily growing it, as this avoids some integer overflow issues.
4280 All callers changed.
4281 (keymap_panes, parse_single_submenu, Fx_popup_menu):
4282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4283 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
4284 Use SAFE_ALLOCA_LISP, not alloca.
4285 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
4286 to EMACS_INT. Check that fixnums are in proper range for system types.
4287 * minibuf.c (minibuf_prompt_width, string_to_object)
4288 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
4289 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
4290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4291 (get_minibuffer, read_minibuf_unwind):
4292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4293 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
4294 this simplifies overflow checking. All callers changed.
4295 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
4296 (Ftest_completion):
4297 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4298 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
4299 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
4300 Check that fixnums are in proper range for system types.
4301 (Fx_create_frame, Fx_show_tip):
4302 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4303 * nsfont.m (ns_findfonts, nsfont_list_family):
4304 Don't assume fixnum fits in long.
4305 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
4306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4307 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
4308 wide enough.
4309 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
4310 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4311 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
4312 (PRINTDECLARE, PRINTPREPARE):
4313 (strout, print_string):
4314 (print, print_preprocess, print_check_string_charset_prop)
4315 (print_object):
4316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4317 (PRINTDECLARE):
4318 (temp_output_buffer_setup, Fprin1_to_string, print_object):
4319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4320 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
4321 (printchar, strout): Use xpalloc to catch size calculation overflow.
4322 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
4323 (print_error_message): Use SAFE_ALLOCA, not alloca.
4324 (print_object): Use int, not EMACS_INT, where int is wide enough.
4325 (print_depth, new_backquote_output, print_number_index):
4326 Use ptrdiff_t, not int, where int might not be wide enough.
4327 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
4328 (Fset_process_window_size, Fformat_network_address)
4329 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
4330 (sigchld_handler):
4331 Check that fixnums are in proper range for system types.
4332 (Fsignal_process): Simplify by avoiding a goto.
4333 Check for process-ids out of pid_t range rather than relying on
4334 undefined behavior.
4335 (process_tick, update_tick): Use EMACS_INT, not int.
4336 (Fformat_network_address, read_process_output, send_process)
4337 (Fprocess_send_region, status_notify):
4338 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4339 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
4340 (wait_reading_process_output, read_process_output, exec_sentinel):
4341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4342 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
4343 (Faccept_process_output): Use duration_to_sec_usec to do proper
4344 overflow checking on durations.
4345 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
4346 Don't assume pid_t fits in int.
4347 * process.h (struct Lisp_Process): Members tick and update_tick
4348 are now of type EMACS_INT, not int.
4349 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
4350 configured --with-wide-int.
4351 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
4352 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
4353 * search.c (looking_at_1, string_match_1):
4354 (fast_string_match, fast_c_string_match_ignore_case)
4355 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
4356 (scan_newline, find_before_next_newline, search_command)
4357 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
4358 (set_search_regs, wordify):
4359 (Freplace_match):
4360 (Fmatch_data):
4361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4362 (string_match_1, search_buffer, set_search_regs):
4363 (Fmatch_data):
4364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4365 (wordify): Check for overflow in size calculation.
4366 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
4367 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
4368 Check that fixnums are in proper range for system types.
4369 * sound.c (struct sound_device)
4370 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
4371 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4372 (Fplay_sound_internal):
4373 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4374 * syntax.c (struct lisp_parse_state, find_start_modiff)
4375 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
4376 (Fparse_partial_sexp):
4377 Don't assume fixnums can fit in int.
4378 (struct lisp_parse_state, find_start_pos, find_start_value)
4379 (find_start_value_byte, find_start_begv)
4380 (update_syntax_table, char_quoted, dec_bytepos)
4381 (find_defun_start, prev_char_comend_first, back_comment):
4382 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
4383 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
4384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4385 (Finternal_describe_syntax_value): Check that match_lisp is a
4386 character, not an integer, since the code stuffs it into int.
4387 (scan_words, scan_sexps_forward):
4388 Check that fixnums are in proper range for system types.
4389 (Fforward_word):
4390 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4391 (scan_sexps_forward):
4392 Use CHARACTERP, not INTEGERP, since the value must fit into int.
4393 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4394 * syntax.h: Adjust decls to match defn changes elsewhere.
4395 (struct gl_state_s):
4396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4397 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4398 MOST_POSITIVE_FIXNUM.
4399 * sysdep.c (wait_for_termination_1, wait_for_termination)
4400 (interruptible_wait_for_termination, mkdir):
4401 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4402 (emacs_read, emacs_write):
4403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4404 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4405 and double all fit in int.
4406 * term.c (set_tty_color_mode):
4407 Check that fixnums are in proper range for system types.
4408 * termhooks.h (struct input_event):
4409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4410 * textprop.c (validate_interval_range, interval_of)
4411 (Fadd_text_properties, set_text_properties_1)
4412 (Fremove_text_properties, Fremove_list_of_text_properties)
4413 (Ftext_property_any, Ftext_property_not_all)
4414 (copy_text_properties, text_property_list, extend_property_ranges)
4415 (verify_interval_modification):
4416 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4417 (Fnext_single_char_property_change)
4418 (Fprevious_single_char_property_change):
4419 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4420 (copy_text_properties):
4421 Check for integer overflow in index calculation.
4422 * undo.c (last_boundary_position, record_point, record_insert)
4423 (record_delete, record_marker_adjustment, record_change)
4424 (record_property_change):
4425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4426 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4428 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4429 (Fx_hide_tip, Fx_file_dialog):
4430 * w32menu.c (set_frame_menubar):
4431 Use ptrdiff_t, not int, for consistency with rest of code.
4432 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4433 (select_window, Fdelete_other_windows_internal)
4434 (window_scroll_pixel_based, window_scroll_line_based)
4435 (Frecenter, Fset_window_configuration):
4436 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4437 (Fset_window_hscroll, run_window_configuration_change_hook)
4438 (set_window_buffer, temp_output_buffer_show, scroll_command)
4439 (Fscroll_other_window, Frecenter):
4440 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4441 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4442 Don't assume fixnum fits in int.
4443 (Fset_window_scroll_bars):
4444 Check that fixnums are in proper range for system types.
4445 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4446 (string_pos, c_string_pos, number_of_chars, init_iterator)
4447 (in_ellipses_for_invisible_text_p, init_from_display_pos)
4448 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4449 (compute_display_string_end, handle_face_prop)
4450 (face_before_or_after_it_pos, handle_invisible_prop)
4451 (handle_display_prop, handle_display_spec, handle_single_display_spec)
4452 (display_prop_intangible_p, string_buffer_position_lim)
4453 (string_buffer_position, handle_composition_prop, load_overlay_strings)
4454 (get_overlay_strings_1, get_overlay_strings)
4455 (iterate_out_of_display_property, forward_to_next_line_start)
4456 (back_to_previous_visible_line_start, reseat, reseat_to_string)
4457 (get_next_display_element, set_iterator_to_next)
4458 (get_visually_first_element, compute_stop_pos_backwards)
4459 (handle_stop_backwards, next_element_from_buffer)
4460 (move_it_in_display_line_to, move_it_in_display_line)
4461 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4462 (add_to_log, message_dolog, message_log_check_duplicate)
4463 (message2, message2_nolog, message3, message3_nolog
4464 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4465 (current_message_1, truncate_echo_area, truncate_message_1)
4466 (set_message, set_message_1, store_mode_line_noprop)
4467 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4468 (text_outside_line_unchanged_p, check_point_in_composition)
4469 (reconsider_clip_changes)
4470 (redisplay_internal, set_cursor_from_row, try_scrolling)
4471 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4472 (redisplay_window, find_last_unchanged_at_beg_row)
4473 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4474 (trailing_whitespace_p, find_row_edges, display_line)
4475 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4476 (display_mode_element, store_mode_line_string)
4477 (pint2str, pint2hrstr, decode_mode_spec)
4478 (display_count_lines, display_string, draw_glyphs)
4479 (x_produce_glyphs, x_insert_glyphs)
4480 (rows_from_pos_range, mouse_face_from_buffer_pos)
4481 (fast_find_string_pos, mouse_face_from_string_pos)
4482 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4483 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4484 (safe_call, init_from_display_pos, handle_fontified_prop)
4485 (handle_single_display_spec, load_overlay_strings)
4486 (with_echo_area_buffer, setup_echo_area_for_printing)
4487 (display_echo_area, echo_area_display)
4488 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4489 (update_tool_bar, hscroll_window_tree, redisplay_internal)
4490 (redisplay_window, dump_glyph_row, display_mode_line)
4491 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
4492 (handle_display_spec, display_prop_string_p):
4493 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4494 (handle_single_display_spec, build_desired_tool_bar_string)
4495 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4496 (get_specified_cursor_type):
4497 Check that fixnums are in proper range for system types.
4498 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4499 (Flookup_image_map):
4500 Don't assume fixnums fit in int.
4501 (compare_overlay_entries):
4502 Avoid mishandling comparisons due to subtraction overflow.
4503 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4504 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4505 (handle_tool_bar_click):
4506 Use int, not unsigned, since we prefer signed and the signedness
4507 doesn't matter here.
4508 (get_next_display_element, next_element_from_display_vector):
4509 Use int, not EMACS_INT, when int is wide enough.
4510 (start_hourglass): Use duration_to_sec_usec to do proper
4511 overflow checking on durations.
4512 * xfaces.c (Fbitmap_spec_p):
4513 Check that fixnums are in proper range for system types.
4514 (compare_fonts_by_sort_order):
4515 Avoid mishandling comparisons due to subtraction overflow.
4516 (Fx_family_fonts, realize_basic_faces):
4517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4518 (Fx_family_fonts):
4519 Don't assume fixnum fits in int.
4520 Use SAFE_ALLOCA_LISP, not alloca.
4521 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4522 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4523 (face_at_buffer_position, face_for_overlay_string)
4524 (face_at_string_position):
4525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4526 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
4527 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
4528 (Fx_show_tip):
4529 Check that fixnums are in proper range for system types.
4530 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4531 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
4532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4533 (Fx_change_window_property): Don't assume fixnums fit in int.
4534 * xfont.c (xfont_chars_supported):
4535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4536 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
4537 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
4538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4539 * xml.c (parse_region):
4540 * xrdb.c (magic_file_p):
4541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4542 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
4543 (x_get_local_selection, x_reply_selection_request)
4544 (x_handle_selection_request, wait_for_property_change):
4545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4546 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
4547 short is wide enough.
4548 (x_send_client_event): Don't assume fixnum fits in int.
4549 * xterm.c (x_x_to_emacs_modifiers):
4550 Don't assume EMACS_INT overflows nicely into int.
4551 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4552 may come from Lisp.
4553 (handle_one_xevent): NATNUMP can eval its arg twice.
4554 (x_connection_closed):
4555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4556 * xterm.h: Adjust decls to match defn changes elsewhere.
4557 (struct scroll_bar): Use struct vectorlike_header
4558 rather than rolling our own approximation.
4559 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4560
4561 2012-05-25 Glenn Morris <rgm@gnu.org>
4562
4563 * lisp.mk (lisp): Update for more files being compiled now.
4564
4565 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4566
4567 * lread.c: Remove `read_pure' which makes no difference.
4568 (read_pure): Remove var.
4569 (unreadpure): Remove function.
4570 (readevalloop): Don't call read_list with -1 flag.
4571 (read1, read_vector): Don't test read_pure any more.
4572 (read_list): Simplify.
4573
4574 * fileio.c, character.h: Minor style tweaks.
4575
4576 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4577
4578 * window.h (clip_changed): Remove useless declaration.
4579
4580 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
4581
4582 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4583 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4584
4585 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4586
4587 Remove src/m/*.
4588 This directory predates autoconf and is no longer needed nowadays.
4589 Move its few remaining bits of functionality to where they're needed.
4590 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4591 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4592 * m/template.h: Remove.
4593 * Makefile.in (M_FILE): Remove. All uses removed.
4594 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4595 * lisp.h (USE_LSB_TAG):
4596 * mem-limits.h (EXCEEDS_LISP_PTR):
4597 Use VAL_MAX, not VALBITS, in #if.
4598 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4599 (EMACS_UINT): Define unconditionally now.
4600 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4601 (BITS_PER_EMACS_INT): New constants, replacing
4602 what used to be in config.h, but not useful in #if.
4603 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4604 define them any more.
4605 (VAL_MAX): New macro.
4606 (VALMASK): Use it.
4607 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4608 BITS_PER_EMACS_INT, in #if.
4609 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4610 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4611 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4612 * s/ms-w32.h (DATA_START):
4613 Move here from removed file m/intel386.h.
4614 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4615 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4616
4617 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4618
4619 Assume C89 or later.
4620 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4621 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4622 (xrealloc):
4623 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4624 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4625 * textprop.c, tparam.c (NULL): Remove.
4626 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4627 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4628 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4629 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4630 * xterm.c (input_signal_count): Assume volatile works.
4631
4632 2012-05-21 Ken Brown <kbrown@cornell.edu>
4633
4634 * xgselect.c (xg_select): Fix first argument in call to 'select'
4635 (bug#11508).
4636
4637 2012-05-20 Ken Brown <kbrown@cornell.edu>
4638
4639 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
4640 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
4641
4642 2012-05-19 Ken Brown <kbrown@cornell.edu>
4643
4644 * xfns.c (x_in_use): Remove `static' qualifier.
4645 * xterm.h (x_in_use): Declare.
4646 * xgselect.c: Include xterm.h.
4647 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4648 and `display_arg' (bug#9754).
4649
4650 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4651
4652 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4653
4654 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4655 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4656
4657 2012-05-18 Eli Zaretskii <eliz@gnu.org>
4658
4659 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4660
4661 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
4662 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
4663
4664 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4665 reference to image_cache->refcount.
4666 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4667
4668 2012-05-17 Juri Linkov <juri@jurta.org>
4669
4670 * search.c (Fword_search_regexp, Fword_search_backward)
4671 (Fword_search_forward, Fword_search_backward_lax)
4672 (Fword_search_forward_lax): Move functions to isearch.el
4673 (bug#10145, bug#11381).
4674
4675 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4676
4677 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4678
4679 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4680
4681 * lread.c (init_obarray): Declare Qt and Qnil as special.
4682
4683 2012-05-14 Glenn Morris <rgm@gnu.org>
4684
4685 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
4686 Put "libexec" before "bin", for the sake of init_callproc_1.
4687
4688 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4689
4690 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4691
4692 * unexaix.c: Port to more-recent AIX compilers.
4693 (report_error, report_error_1, make_hdr, copy_sym)
4694 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4695 Make arguments const char *, not char *, to avoid violations of C
4696 standard and to fix some AIX warnings reported by Gilles Pion.
4697
4698 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4699
4700 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4701 already have overlays loaded.
4702 (handle_single_display_spec): Before returning without displaying
4703 fringe bitmap, synchronize the bidi iterator with the main display
4704 iterator, by calling iterate_out_of_display_property.
4705 (iterate_out_of_display_property): Detect buffer iteration by
4706 testing that it->string is a Lisp string.
4707 (get_next_display_element): When the current object is exhausted,
4708 and there's something on it->stack, call set_iterator_to_next to
4709 proceed with what's on the stack, instead of returning zero.
4710 (set_iterator_to_next): If called at the end of a Lisp string,
4711 proceed to consider_string_end without incrementing string
4712 position. Don't increment display vector index past the end of
4713 the display vector. (Bug#11417)
4714 (pos_visible_p): Don't report a position visible when move_it_to
4715 stopped at the last line of window, which happens to be scanned
4716 backwards by the bidi iteration. (Bug#11464)
4717
4718 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4719
4720 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4721 and right-margin display specs even if the spec is invalid or we
4722 are on a TTY, and thus unable to display on the fringes.
4723 That's because the text with the property will not be displayed anyway,
4724 so we need to signal to the caller that this is a "replacing"
4725 display spec. This fixes display when the spec is invalid or we
4726 are on a TTY.
4727
4728 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4729
4730 * unexaix.c (make_hdr): Fix typo in prototype.
4731 This bug broke the build on AIX. Problem reported by Gilles Pion.
4732
4733 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
4734
4735 * keyboard.c (kbd_buffer_get_event): Read special events also in
4736 batch mode. (Bug#11415)
4737
4738 2012-05-12 Glenn Morris <rgm@gnu.org>
4739
4740 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4741
4742 2012-05-12 Eli Zaretskii <eliz@gnu.org>
4743
4744 * lisp.mk (lisp): Add newcomment.elc.
4745
4746 2012-05-12 Glenn Morris <rgm@gnu.org>
4747
4748 * Makefile.in (MKDIR_P): New, set by configure.
4749 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4750
4751 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4752
4753 Remove unused function hourglass_started.
4754 * dispextern.h (hourglass_started):
4755 * w32fns.c (hourglass_started):
4756 * xdisp.c (hourglass_started): Remove.
4757
4758 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
4759
4760 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4761 Update dependencies.
4762
4763 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4764
4765 * xgselect.c (xg_select): Put maxfds+1 into a var.
4766 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4767
4768 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4769
4770 2012-05-10 Dave Abrahams <dave@boostpro.com>
4771
4772 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
4773 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
4774
4775 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
4776
4777 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4778 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
4779 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
4780 Initialize xd_registered_buses.
4781
4782 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
4783
4784 Untag more efficiently if USE_LSB_TAG.
4785 This is based on a proposal by YAMAMOTO Mitsuharu in
4786 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
4787 For an admittedly artificial (nth 8000 longlist) benchmark on
4788 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
4789 Emacs's overall text size by 1%.
4790 * lisp.h (XUNTAG): New macro.
4791 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
4792 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
4793 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
4794 * eval.c (Fautoload):
4795 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
4796 * frame.h (XFRAME): Use XUNTAG.
4797
4798 Port recent dbusbind.c changes to 32-bit --with-wide-int.
4799 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
4800 Remove unportable assumptions about print widths of types like
4801 dbus_uint32_t.
4802 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
4803 intptr_t when converting between pointer and integer, to avoid GCC
4804 warnings about wrong width.
4805
4806 2012-05-09 Eli Zaretskii <eliz@gnu.org>
4807
4808 * w32proc.c (new_child): Force Windows to reserve only 64KB of
4809 stack for each reader_thread, instead of defaulting to 8MB
4810 determined by the linker. This avoids failures in creating
4811 subprocesses on Windows 7, see the discussion in this thread:
4812 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
4813
4814 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
4815
4816 Fix up display of the *Minibuf-0* buffer in the mini window.
4817 * keyboard.c (read_char): Don't clear the echo area if there's no
4818 message to clear.
4819 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
4820 contents of *Minibuf-0*) if there's no message displayed in its stead.
4821
4822 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
4823
4824 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
4825 batch mode.
4826
4827 2012-05-06 Chong Yidong <cyd@gnu.org>
4828
4829 * lisp.mk (lisp): Update.
4830
4831 2012-05-05 Jim Meyering <meyering@redhat.com>
4832
4833 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
4834
4835 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4836
4837 * data.c (PUT_ERROR): New macro.
4838 (syms_of_data): Use it. Add new error type `user-error'.
4839 * undo.c (user_error): New function.
4840 (Fprimitive_undo): Use it.
4841 * print.c (print_error_message): Adjust print style for `user-error'.
4842 * keyboard.c (user_error): New function.
4843 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
4844
4845 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
4846
4847 Do not limit current-time-string to years 1000..9999.
4848 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
4849 (Fcurrent_time_string): Support any year that is supported by the
4850 underlying localtime representation. Don't use asctime, as it
4851 has undefined behavior for years outside the range -999..9999.
4852
4853 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
4854
4855 Fix race conditions involving setenv, gmtime, localtime, asctime.
4856 Without this fix, interrupts could mess up code that uses these
4857 nonreentrant functions, since setting TZ invalidates existing
4858 tm_zone or tzname values, and since most of these functions return
4859 pointers to static storage.
4860 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
4861 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
4862 Grow the critical sections to include not just invoking
4863 localtime/gmtime, but also accessing these functions' results
4864 including their tm_zone values if any, and any related TZ setting.
4865 (format_time_string): Last arg is now struct tm *, not struct tm **,
4866 so that the struct tm is saved in the critical section.
4867 All callers changed. Simplify allocation of initial buffer, partly
4868 motivated by the fact that memory allocation needs to be outside
4869 the critical section.
4870
4871 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
4872
4873 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
4874 with RESET_INTERVAL.
4875
4876 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4877 Remove duplicated buffer name initialization.
4878
4879 2012-05-02 Jim Meyering <jim@meyering.net>
4880
4881 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4882
4883 * xfns.c (x_window): Use xstrdup (Bug#11375).
4884
4885 2012-05-02 Eli Zaretskii <eliz@gnu.org>
4886
4887 * xdisp.c (pos_visible_p): If already at a newline from the
4888 display string before the 'while' loop, don't walk back the glyphs
4889 from it3.glyph_row. Solves assertion violation when the display
4890 string begins with a newline (egg.el). (Bug#11367)
4891
4892 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4893
4894 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4895 Move to simple.el.
4896
4897 2012-05-01 Glenn Morris <rgm@gnu.org>
4898
4899 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4900 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4901 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4902 All were removed before 23.1.
4903
4904 * dispnew.c: Remove HAVE_LIBNCURSES test;
4905 it is always true on relevant platforms.
4906
4907 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4908 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4909
4910 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4911
4912 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4913
4914 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4915 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4916 Remove.
4917
4918 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4919
4920 Do not avoid creating empty evaporating overlays (Bug#9642).
4921 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4922 That is, do not delete an evaporating overlay if it becomes
4923 empty after its bounds are adjusted to fit within its buffer.
4924 This fix caused other problems, and I'm reverting it until we get
4925 to the bottom of them.
4926
4927 2012-04-27 Chong Yidong <cyd@gnu.org>
4928
4929 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4930
4931 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4932
4933 * xdisp.c (pos_visible_p): If the window start position is beyond
4934 ZV, start the display from buffer beginning. Prevents assertion
4935 violation in init_iterator when the minibuffer window is scrolled
4936 via the scroll bar.
4937
4938 * window.c (window_scroll_pixel_based): Likewise.
4939
4940 2012-04-27 Chong Yidong <cyd@gnu.org>
4941
4942 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4943
4944 2012-04-27 Glenn Morris <rgm@gnu.org>
4945
4946 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4947 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4948
4949 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4950
4951 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4952 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
4953
4954 2012-04-26 Eli Zaretskii <eliz@gnu.org>
4955
4956 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4957 display element, check also the underlying string or buffer
4958 character. (Bug#11341)
4959
4960 * w32menu.c: Include w32heap.h.
4961 (add_menu_item): If the call to AppendMenuW (via
4962 unicode_append_menu) fails, disable Unicode menus only if we are
4963 running on Windows 9X/Me.
4964
4965 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4966
4967 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4968 (xgetint): Add missing shift for LSB tags.
4969
4970 2012-04-24 Martin Rudalics <rudalics@gmx.at>
4971
4972 * keyboard.c (read_char): Don't wipe echo area for select window
4973 events: These might get delayed via `mouse-autoselect-window'
4974 (Bug#11304).
4975
4976 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
4977
4978 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4979 manipulation of :loaded-from data.
4980
4981 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
4982
4983 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4984 now a cons (bug#11311).
4985
4986 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 Do not create empty overlays with the evaporate property (Bug#9642).
4989 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4990 if it becomes empty after its bounds are adjusted to fit within
4991 its buffer. Without this fix, in a nonempty buffer (let ((o
4992 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4993 yields an empty overlay that has the evaporate property, which is
4994 not supposed to happen.
4995
4996 Fix minor GTK3 problems found by static checking.
4997 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4998 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4999 (struct _EmacsFixedClass, emacs_fixed_get_type):
5000 Move decls here from emacsgtkfixed.h, since they needn't be public.
5001 (emacs_fixed_get_type): Now static.
5002 (emacs_fixed_class_init): Omit unused local.
5003 (emacs_fixed_child_type): Remove; unused.
5004 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5005 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5006 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
5007 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
5008 (EMACS_FIXED_GET_CLASS): Remove; unused.
5009 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
5010
5011 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
5012 Problem reported by Juanma Barranquero for Windows -Wunused-function.
5013
5014 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5015
5016 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
5017 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
5018 (__malloc_size_t, __malloc_ptrdiff_t):
5019 Remove. All uses removed, replaced by the definiens if needed,
5020 since we can assume C89 or better now.
5021 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
5022 (protect_malloc_state, align, get_contiguous_space)
5023 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
5024 (malloc_atfork_handler_child, malloc_enable_thread)
5025 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
5026 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
5027 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
5028 (special_realloc, _realloc_internal_nolock, _realloc_internal)
5029 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
5030 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
5031 Define using prototypes, not old style.
5032 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
5033 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
5034 (align): Don't assume that signed integer overflow wraps around.
5035 Omit unused local var.
5036 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
5037 (_free_internal_nolock, memalign, mallochook, reallochook):
5038 Omit no-longer-needed casts.
5039 (valloc): Use getpagesize, not __getpagesize.
5040 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
5041 (struct hdr): The 'magic' member is now size_t, not unsigned long.
5042
5043 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
5044
5045 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
5046
5047 Move functions from C to Lisp. Make non-blocking method calls
5048 the default. Implement further D-Bus standard interfaces.
5049
5050 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
5051 (QCdbus_request_name_allow_replacement)
5052 (QCdbus_request_name_replace_existing)
5053 (QCdbus_request_name_do_not_queue)
5054 (QCdbus_request_name_reply_primary_owner)
5055 (QCdbus_request_name_reply_in_queue)
5056 (QCdbus_request_name_reply_exists)
5057 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
5058 (QCdbus_registered_serial, QCdbus_registered_method)
5059 (QCdbus_registered_signal): New Lisp objects.
5060 (XD_DEBUG_MESSAGE): Use sizeof.
5061 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
5062 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
5063 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
5064 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
5065 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
5066 (xd_signature, xd_append_arg): Allow float for integer types.
5067 (xd_get_connection_references): New function.
5068 (xd_get_connection_address): Rename from xd_initialize.
5069 Return cached address.
5070 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
5071 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
5072 level.
5073 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
5074 Return number of refcounts.
5075 (Fdbus_get_unique_name): Make stronger parameter check.
5076 (Fdbus_message_internal): New defun.
5077 (Fdbus_call_method, Fdbus_call_method_asynchronously)
5078 (Fdbus_method_return_internal, Fdbus_method_error_internal)
5079 (Fdbus_send_signal, Fdbus_register_service)
5080 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
5081 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
5082 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
5083 (Vdbus_compiled_version, Vdbus_runtime_version)
5084 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
5085 (Vdbus_message_type_method_return, Vdbus_message_type_error)
5086 (Vdbus_message_type_signal): New defvars.
5087 (Vdbus_registered_buses, Vdbus_registered_objects_table):
5088 Adapt docstring.
5089
5090 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5091
5092 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
5093 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
5094 Do not assume ptrdiff_t is the same width as 'int'.
5095
5096 * alloc.c: Handle unusual debugging option combinations.
5097 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5098 since the two debugging options are incompatible.
5099 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
5100 is defined.
5101 (mem_init, mem_insert, mem_insert_fixup):
5102 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
5103 (NEED_MEM_INSERT): Remove; no longer needed.
5104
5105 2012-04-22 Leo Liu <sdl.web@gmail.com>
5106
5107 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
5108
5109 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 * sysdep.c [__FreeBSD__]: Minor cleanups.
5112 (list_system_processes, system_process_attributes) [__FreeBSD__]:
5113 Use Emacs indenting style more consistently. Avoid some casts.
5114 Use 'double' consistently rather than mixing 'float' and 'double'.
5115
5116 2012-04-21 Eduard Wiebe <usenet@pusto.de>
5117
5118 * sysdep.c (list_system_processes, system_process_attributes):
5119 Add implementation for FreeBSD (Bug#5243).
5120
5121 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
5122
5123 * lisp.mk (lisp): Update.
5124
5125 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
5126
5127 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
5128 It is never used otherwise.
5129
5130 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
5131
5132 * print.c (print_preprocess): Only check print_depth if print-circle
5133 is nil.
5134 (print_object): Check for cycles even when print-circle is nil and
5135 print-gensym is t, but only check print_depth if print-circle is nil.
5136
5137 2012-04-20 Chong Yidong <cyd@gnu.org>
5138
5139 * process.c (wait_reading_process_output): If EIO occurs on a pty,
5140 set the status to "failed" and ensure that sentinel is run.
5141
5142 2012-04-20 Glenn Morris <rgm@gnu.org>
5143
5144 * process.c (Fset_process_inherit_coding_system_flag)
5145 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
5146 (Fmake_network_process, Fmake_serial_process): Doc fix.
5147
5148 2012-04-20 Eli Zaretskii <eliz@gnu.org>
5149
5150 * xdisp.c (string_buffer_position_lim): Limit starting position to
5151 BEGV.
5152 (set_cursor_from_row): If called for a mode-line or header-line
5153 row, return zero immediately.
5154 (try_cursor_movement): If inside continuation line, don't back up
5155 farther than the first row after the header line, if any.
5156 Don't consider the header-line row as "partially visible", even if
5157 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
5158
5159 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
5160
5161 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
5162 (bug#11238).
5163
5164 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
5165 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
5166
5167 configure: new option --enable-gcc-warnings (Bug#11207)
5168 * Makefile.in (C_WARNINGS_SWITCH): Remove.
5169 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
5170 (ALL_CFLAGS): Use new macros rather than old.
5171 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
5172 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
5173 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
5174 -Wunused-result, -Wunused-variable. This should go away once
5175 the Emacs and Gnulib regex code is merged.
5176 (xmalloc, xrealloc): Now static.
5177
5178 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
5179
5180 * dired.c (Fsystem_groups): Remove unused local.
5181
5182 2012-04-17 Glenn Morris <rgm@gnu.org>
5183
5184 * dired.c (Fsystem_users): Doc fix.
5185
5186 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
5187
5188 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
5189 (syms_of_dired): Add them.
5190
5191 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
5192
5193 Fix minor alloc.c problems found by static checking.
5194 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
5195 New extern decls, to avoid calling undeclared functions.
5196 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
5197 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
5198 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
5199 (NEED_MEM_INSERT): New macro.
5200 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
5201 Remove one incorrect comment and fix another.
5202
5203 Fix minor ralloc.c problems found by static checking.
5204 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5205 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
5206 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
5207 (r_alloc_sbrk): Now static.
5208
5209 Improve ralloc.c interface checking.
5210 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5211 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
5212 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
5213 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
5214 [REL_ALLOC]: ... to here, to check interface.
5215 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
5216 Remove decls. This fixes an "It stinks!".
5217
5218 * alloc.c (which_symbols): Fix alignment issue / type clash.
5219
5220 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
5221
5222 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
5223 (struct Lisp_Misc_Any): Likewise.
5224 (struct Lisp_Free): Likewise.
5225 * alloc.c (union aligned_Lisp_Symbol): Define.
5226 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
5227 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
5228 (union aligned_Lisp_Misc): Define.
5229 (MARKER_BLOCK_SIZE, struct marker_block): Use union
5230 aligned_Lisp_Misc instead of union Lisp_Misc.
5231 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
5232
5233 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
5234
5235 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
5236 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
5237 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
5238 * s/netbsd.h, s/sol2-6.h:
5239 Remove definition of GC_MARK_STACK, since the default now works.
5240 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
5241 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
5242 no longer the default.
5243 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
5244
5245 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
5246
5247 * lread.c (lisp_file_lexically_bound_p):
5248 Fix hang at ";-*-\n" (bug#11238).
5249
5250 2012-04-14 Eli Zaretskii <eliz@gnu.org>
5251
5252 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
5253 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
5254
5255 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
5256
5257 * nsterm.m (constrainFrameRect): Always constrain when there is only
5258 one screen (Bug#10962).
5259
5260 2012-04-13 Ken Brown <kbrown@cornell.edu>
5261
5262 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
5263
5264 2012-04-13 Reuben Thomas <rrt@sc3d.org>
5265
5266 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
5267
5268 2012-04-11 Daniel Colascione <dancol@dancol.org>
5269
5270 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
5271 against is gone. It's better to use vfork now so that when Cygwin
5272 gains a new, working vfork, we use it automatically (bug#10398).
5273
5274 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5275
5276 * window.c (save_window_save): Obey window-point-insertion-type.
5277
5278 2012-04-11 Glenn Morris <rgm@gnu.org>
5279
5280 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
5281
5282 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5283
5284 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
5285
5286 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
5287
5288 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
5289 (force_quit_count): New var.
5290 (handle_interrupt): Use it.
5291
5292 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
5293
5294 * w32.c (w32_delayed_load): Record the full path of the library
5295 being loaded (bug#10424).
5296
5297 2012-04-09 Glenn Morris <rgm@gnu.org>
5298
5299 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
5300 not just in the obarray, before snarfing them. (Bug#11036)
5301
5302 * Makefile.in ($(leimdir)/leim-list.el):
5303 Pass EMACS rather than BUILT_EMACS.
5304
5305 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
5306
5307 * process.c (make_process):
5308 * process.h: Add integer `gnutls_handshakes_tried' member to
5309 process struct.
5310
5311 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
5312 Add convenience `GNUTLS_LOG2i' macro.
5313
5314 * gnutls.c (gnutls_log_function2i): Convenience log function.
5315 (emacs_gnutls_read): Use new log functions,
5316 `gnutls_handshakes_tried' process member, and
5317 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
5318 attempts per process (connection).
5319
5320 2012-04-09 Chong Yidong <cyd@gnu.org>
5321
5322 * eval.c (Fuser_variable_p, user_variable_p_eh)
5323 (lisp_indirect_variable): Functions deleted.
5324 (Fdefvar): Caller changed.
5325
5326 * callint.c (Finteractive, Fcall_interactively):
5327 * minibuf.c (Fread_variable): Callers changed.
5328
5329 2012-04-09 Eli Zaretskii <eliz@gnu.org>
5330
5331 * xdisp.c (set_cursor_from_row): If the display string appears in
5332 the buffer at position that is closer to point than the position
5333 after the display string, display the cursor on the first glyph of
5334 the display string. Fixes cursor display when a 'display' text
5335 property immediately follows invisible text. (Bug#11094)
5336
5337 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
5338
5339 composite.c: use 'double' consistently
5340 * composite.c (get_composition_id): Use 'double' consistently
5341 instead of converting 'float' to 'double' and vice versa; this is
5342 easier to understand and avoids a GCC warning.
5343
5344 2012-04-09 Glenn Morris <rgm@gnu.org>
5345
5346 * Makefile.in: Generate leim-list with bootstrap-emacs, in
5347 preparation for dumping it with emacs. (Bug#4789)
5348 (leimdir): New variable.
5349 ($(leimdir)/leim-list.el): New rule.
5350 (emacs$(EXEEXT)): Depend on leim-list.el.
5351
5352 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
5353 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
5354 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
5355
5356 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
5357
5358 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
5359 proper alignment.
5360
5361 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
5362
5363 * xml.c (init_libxml2_functions) [WINDOWSNT]:
5364 Remove unused local variable.
5365
5366 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
5369 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
5370 (mark_memory): Mark Lisp_Objects only if pointers might hide in
5371 objects, as mark_maybe_pointer will catch them otherwise.
5372 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
5373 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
5374
5375 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5376
5377 Fix typo that broke non-Windows builds.
5378 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
5379
5380 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5381
5382 Support building on MS-Windows with libxml2.
5383
5384 * makefile.w32-in (OBJ2): Add xml.$(O).
5385 (GLOBAL_SOURCES): Add xml.c.
5386 ($(BLD)/xml.$(O)): New dependency list.
5387
5388 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5389 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5390 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5391 [!WINDOWSNT]: New macros.
5392 (init_libxml2_functions, libxml2_loaded_p): New functions.
5393 (parse_region): Call fn_xmlCheckVersion instead of using the macro
5394 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
5395 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5396 Calls xmlCleanupParser only if libxml2 was loaded (or statically
5397 linked in).
5398 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5399 Call init_libxml2_functions before calling libxml2 functions.
5400 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5401
5402 * emacs.c: Don't include libxml/parser.h.
5403 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5404 xmlCleanupParser directly.
5405
5406 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5407
5408 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5409
5410 * indent.c (Fvertical_motion): If there is a display string at
5411 point, use it.vpos to compute how many lines to backtrack after
5412 move_it_to point. (Bug#11133)
5413
5414 2012-04-06 Eli Zaretskii <eliz@gnu.org>
5415
5416 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5417 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5418 about subtle differences between FETCH_CHAR* and STRING_CHAR*
5419 macros related to unification of CJK characters. For the details,
5420 see the discussion following the message here:
5421 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5422
5423 2012-04-04 Chong Yidong <cyd@gnu.org>
5424
5425 * keyboard.c (Vdelayed_warnings_list): Doc fix.
5426
5427 2012-04-01 Eli Zaretskii <eliz@gnu.org>
5428
5429 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5430 instead of alloca. (Bug#11138)
5431
5432 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
5433
5434 * w32menu.c (is_simple_dialog): Properly check lisp types.
5435 (Bug#11141)
5436
5437 2012-03-31 Eli Zaretskii <eliz@gnu.org>
5438
5439 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5440 position we get to after a call to move_it_to fails the
5441 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5442 only if we wind up in a string from display property. (Bug#11063)
5443
5444 * window.c (Fdelete_other_windows_internal): Invalidate the row
5445 and column information about mouse highlight, so that redisplay
5446 restores it after reallocating the glyph matrices. (Bug#7464)
5447
5448 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5449 string comes from a `display' text property, use the buffer
5450 position of that property as if we actually saw that position in
5451 the row's glyphs.
5452 (move_it_by_lines): Remove the assertion that
5453 "it->current_x == 0 && it->hpos == 0" which can be legitimately
5454 violated when there's a before-string at the beginning of a line.
5455 (Bug#11063)
5456
5457 2012-03-30 Eli Zaretskii <eliz@gnu.org>
5458
5459 * xdisp.c (append_space_for_newline): If the default face was
5460 remapped, use the remapped face for the appended newline.
5461 (extend_face_to_end_of_line): Use the remapped default face for
5462 extending the face to the end of the line.
5463 (display_line): Call extend_face_to_end_of_line when the default
5464 face was remapped. (Bug#11068)
5465
5466 2012-03-29 Eli Zaretskii <eliz@gnu.org>
5467
5468 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5469
5470 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5471
5472 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5473
5474 2012-03-27 Glenn Morris <rgm@gnu.org>
5475
5476 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5477 Doc fixes.
5478
5479 2012-03-26 Kenichi Handa <handa@m17n.org>
5480
5481 * dispextern.h (struct glyph): Fix previous change. Change the
5482 bit length of glyphless.ch to 25 (Bug#11082).
5483
5484 2012-03-26 Chong Yidong <cyd@gnu.org>
5485
5486 * keyboard.c (Vselection_inhibit_update_commands): New variable.
5487 (command_loop_1): Use it; inhibit selection update for
5488 handle-select-window too (Bug#8996).
5489
5490 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
5491
5492 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
5493
5494 2012-03-25 Kenichi Handa <handa@m17n.org>
5495
5496 * dispextern.h (struct glyph): Change the bit length of
5497 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5498
5499 2012-03-24 Eli Zaretskii <eliz@gnu.org>
5500
5501 * s/ms-w32.h (tzname): Include time.h before redirecting to
5502 _tzname. Fixes the MSVC build. (Bug#9960)
5503
5504 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
5505
5506 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5507 characters.
5508
5509 * xterm.c (XTread_socket): Only modify handling_signal if
5510 !SYNC_INPUT. (Bug#11080)
5511
5512 2012-03-23 Eli Zaretskii <eliz@gnu.org>
5513
5514 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5515 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
5516 when fetching a multibyte character consumes more bytes than
5517 CHAR_BYTES returns, due to unification of CJK characters in
5518 string_char. (Bug#11073)
5519
5520 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
5521
5522 * process.c (wait_reading_process_output): Handle pty disconnect
5523 by refraining from sending oneself a SIGCHLD (bug#10933).
5524
5525 2012-03-22 Chong Yidong <cyd@gnu.org>
5526
5527 * dispextern.h (struct it): New member string_from_prefix_prop_p.
5528
5529 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
5530 Mark string as coming from a prefix property.
5531 (handle_face_prop): Use default face for prefix strings (Bug#4281).
5532 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
5533
5534 2012-03-21 Chong Yidong <cyd@gnu.org>
5535
5536 * xfaces.c (Vface_remapping_alist): Doc fix.
5537
5538 2012-03-20 Eli Zaretskii <eliz@gnu.org>
5539
5540 * w32proc.c (Fw32_set_console_codepage)
5541 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
5542 Doc fixes.
5543
5544 2012-03-20 Chong Yidong <cyd@gnu.org>
5545
5546 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
5547 to reflect default non-nil value of redisplay-dont-pause.
5548
5549 2012-03-19 Kenichi Handa <handa@m17n.org>
5550
5551 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5552 it fit in a valid range (Bug#11003).
5553
5554 2012-03-18 Eli Zaretskii <eliz@gnu.org>
5555
5556 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5557 that is not from display property, accept the row as a "cursor
5558 row" if one of the string's character has a non-nil `cursor'
5559 property. Fixes cursor positioning when there are newlines in
5560 overlay strings, e.g. in icomplete.el. (Bug#11035)
5561
5562 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5563
5564 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5565
5566 2012-03-12 Chong Yidong <cyd@gnu.org>
5567
5568 * eval.c (inhibit_lisp_code): Rename from
5569 inhibit_window_configuration_change_hook; move from window.c.
5570
5571 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5572 * window.c (run_window_configuration_change_hook)
5573 (syms_of_window): Callers changed.
5574
5575 2012-03-11 Chong Yidong <cyd@gnu.org>
5576
5577 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5578
5579 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5580
5581 2012-03-10 Chong Yidong <cyd@gnu.org>
5582
5583 * frame.c (other_visible_frames): Don't assume the selected frame
5584 is visible (Bug#10955).
5585
5586 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5587
5588 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5589
5590 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5591
5592 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5593 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5594 zero (Bug#10954).
5595
5596 2012-03-03 Glenn Morris <rgm@gnu.org>
5597
5598 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
5599
5600 2012-03-02 Eli Zaretskii <eliz@gnu.org>
5601
5602 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5603 position past the first glyph_row that ends at ZV. (Bug#10902)
5604 (redisplay_window, next_element_from_string): Fix typos in
5605 comments.
5606 (redisplay_window): Pass to move_it_vertically the margin in
5607 pixels, not in screen lines.
5608
5609 2012-03-02 Glenn Morris <rgm@gnu.org>
5610
5611 * buffer.c (buffer-list-update-hook): Doc fix.
5612
5613 2012-02-29 Eli Zaretskii <eliz@gnu.org>
5614
5615 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5616 push_it before setting up the iterator for the first overlay
5617 string, even if we have an empty string loaded.
5618 (next_overlay_string): If there's an empty string on the iterator
5619 stack, pop the stack. (Bug#10903)
5620
5621 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5622
5623 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5624 Suggested by Stefan Monnier in
5625 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5626 * alloc.c (widen_to_Lisp_Object): New static function.
5627 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5628 and widening them to Lisp_Objects. This would work even if
5629 USE_LSB_TAG is defined and wide integers are used, which might
5630 happen in a future version of Emacs.
5631
5632 2012-02-25 Chong Yidong <cyd@gnu.org>
5633
5634 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5635 Doc fix.
5636
5637 * xselect.c (Fx_selection_exists_p): Doc fix.
5638 (x_clipboard_manager_save_all): Print an informative message
5639 before saving to clipboard manager.
5640
5641 2012-02-24 Chong Yidong <cyd@gnu.org>
5642
5643 * keyboard.c (process_special_events): Handle all X selection
5644 requests in kbd_buffer, not just the next one (Bug#8869).
5645
5646 2012-02-23 Chong Yidong <cyd@gnu.org>
5647
5648 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5649 call when setting menu-bar-lines and tool-bar-lines parameters.
5650 (unwind_create_frame_1): New helper function.
5651
5652 * window.c (inhibit_window_configuration_change_hook): New var.
5653 (run_window_configuration_change_hook): Obey it.
5654 (syms_of_window): Initialize it.
5655
5656 2012-02-22 Chong Yidong <cyd@gnu.org>
5657
5658 * xterm.c (x_draw_image_relief): Add missing type check for
5659 Vtool_bar_button_margin (Bug#10743).
5660
5661 2012-02-21 Chong Yidong <cyd@gnu.org>
5662
5663 * fileio.c (Vfile_name_handler_alist): Doc fix.
5664
5665 * buffer.c (Fget_file_buffer): Protect against invalid file
5666 handler return value.
5667
5668 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5669
5670 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5671 when computing $valmask.
5672
5673 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5674 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5675 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5676 It's useless in that case, and it can cause problems on hosts
5677 that allocate halves of EMACS_INT values separately.
5678 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5679 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5680 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5681 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5682 it avoids undefined behavior on hosts where shifting right by more
5683 than the word width has undefined behavior.
5684
5685 2012-02-19 Chong Yidong <cyd@gnu.org>
5686
5687 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5688 (Funhandled_file_name_directory, Ffile_name_as_directory)
5689 (Fdirectory_file_name, Fexpand_file_name)
5690 (Fsubstitute_in_file_name): Protect against invalid file handler
5691 return values (Bug#10845).
5692
5693 2012-02-18 Eli Zaretskii <eliz@gnu.org>
5694
5695 * .gdbinit (pitx): Fix incorrect references to fields of the
5696 iterator stack.
5697
5698 2012-02-17 Chong Yidong <cyd@gnu.org>
5699
5700 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5701
5702 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5703
5704 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5705 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5706
5707 2012-02-15 Chong Yidong <cyd@gnu.org>
5708
5709 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5710 marked as special. Also, starting docstrings with * is obsolete.
5711
5712 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5713
5714 * gnutls.c (emacs_gnutls_write): Fix last change.
5715
5716 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5717
5718 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5719 send_process.
5720
5721 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5722
5723 * keymap.c (Fsingle_key_description): Handle char ranges.
5724
5725 2012-02-12 Chong Yidong <cyd@gnu.org>
5726
5727 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5728 as that creates a dangerous corner case.
5729
5730 * window.c (Fdelete_window_internal): Invalidate the mouse
5731 highlight (Bug#9904).
5732
5733 2012-02-12 Glenn Morris <rgm@gnu.org>
5734
5735 * xselect.c (Fx_own_selection_internal)
5736 (Fx_get_selection_internal, Fx_disown_selection_internal)
5737 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5738 * nsselect.m (Fx_own_selection_internal)
5739 (Fx_disown_selection_internal, Fx_selection_exists_p)
5740 (Fx_selection_owner_p, Fx_get_selection_internal):
5741 Sync docs and argument specs with the xselect.c versions.
5742
5743 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5744
5745 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5746
5747 2012-02-11 Eli Zaretskii <eliz@gnu.org>
5748
5749 * w32select.c (Fx_selection_exists_p): Sync doc string and
5750 argument list with xselect.c. (Bug#10783)
5751
5752 * w16select.c (Fx_selection_exists_p): Sync doc string and
5753 argument list with xselect.c. (Bug#10783)
5754
5755 2012-02-10 Glenn Morris <rgm@gnu.org>
5756
5757 * fns.c (Fsecure_hash): Doc fix.
5758
5759 2012-02-09 Kenichi Handa <handa@m17n.org>
5760
5761 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5762
5763 2012-02-07 Chong Yidong <cyd@gnu.org>
5764
5765 * buffer.c (Fbuffer_local_variables)
5766 (buffer_lisp_local_variables): Handle unbound vars correctly;
5767 don't let Qunbound leak into Lisp.
5768
5769 2012-02-07 Glenn Morris <rgm@gnu.org>
5770
5771 * image.c (Fimagemagick_types): Doc fix.
5772
5773 * image.c (imagemagick-render-type): Change it from a lisp object
5774 to an integer. Move the doc here from the lisp manual.
5775 Treat all values not equal to 0 the same.
5776
5777 2012-02-06 Chong Yidong <cyd@gnu.org>
5778
5779 * doc.c (store_function_docstring): Avoid applying docstring of
5780 alias to base function (Bug#2603).
5781
5782 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
5783
5784 * .gdbinit (pp1, pv1): Remove redundant defines.
5785 (pr): Use pp.
5786
5787 2012-02-04 Chong Yidong <cyd@gnu.org>
5788
5789 * nsterm.m: Declare a global (Bug#10694).
5790
5791 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5792
5793 * w32.c (get_emacs_configuration_options):
5794 Include --enable-checking, if specified, in the return value.
5795
5796 2012-02-04 Martin Rudalics <rudalics@gmx.at>
5797
5798 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
5799 after rounding frame sizes. (Bug#9723)
5800
5801 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5802
5803 * keyboard.c (adjust_point_for_property): Don't position point
5804 before BEGV. (Bug#10696)
5805
5806 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
5807
5808 Handle overflow when computing char display width (Bug#9496).
5809 * character.c (char_width): Return EMACS_INT, not int.
5810 (char_width, c_string_width): Check for overflow when
5811 computing the width; this is possible now that individual
5812 characters can have unbounded width. Problem introduced
5813 by merge from Emacs 23 on 2012-01-19.
5814
5815 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
5816
5817 * dbusbind.c (Fdbus_register_method): Mention the return value
5818 :ignore in the docstring.
5819
5820 2012-02-02 Glenn Morris <rgm@gnu.org>
5821
5822 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
5823
5824 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5825 Unconditionally set to t. (Bug#10673)
5826 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5827 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5828 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
5829
5830 2012-02-02 Kenichi Handa <handa@m17n.org>
5831
5832 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
5833 0, do not call append_composite_glyph.
5834
5835 2012-02-02 Kenichi Handa <handa@m17n.org>
5836
5837 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
5838 NULL (Bug#6988).
5839 (x_produce_glyphs): If the component of a composition is a null
5840 string, set it->pixel_width to 1 to avoid zero-width glyph.
5841
5842 2012-02-01 Eli Zaretskii <eliz@gnu.org>
5843
5844 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
5845 first 2 arguments are identical. This makes inserting large
5846 output from a subprocess an order of magnitude faster on
5847 MS-Windows, where all sbrk'ed memory is always contiguous.
5848
5849 2012-01-31 Glenn Morris <rgm@gnu.org>
5850
5851 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5852 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5853 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
5854
5855 2012-01-29 Glenn Morris <rgm@gnu.org>
5856
5857 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
5858
5859 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
5860
5861 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
5862
5863 2012-01-28 Chong Yidong <cyd@gnu.org>
5864
5865 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
5866
5867 2012-01-26 Chong Yidong <cyd@gnu.org>
5868
5869 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
5870
5871 * search.c (Fsearch_forward, Fsearch_backward): Document negative
5872 repeat counts (Bug#10507).
5873
5874 2012-01-26 Glenn Morris <rgm@gnu.org>
5875
5876 * lread.c (syms_of_lread): Doc fix.
5877
5878 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5879
5880 * coding.c (encode_designation_at_bol): Change return value to
5881 EMACS_INT.
5882
5883 2012-01-25 Chong Yidong <cyd@gnu.org>
5884
5885 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5886
5887 2012-01-21 Chong Yidong <cyd@gnu.org>
5888
5889 * floatfns.c (Fcopysign): Make the second argument non-optional,
5890 since nil is not allowed anyway.
5891
5892 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5893
5894 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5895 (send_process): Likewise.
5896
5897 2012-01-19 Martin Rudalics <rudalics@gmx.at>
5898
5899 * window.c (save_window_save, Fcurrent_window_configuration)
5900 (Vwindow_persistent_parameters): Do not use Qstate.
5901 Rewrite doc-strings.
5902
5903 2012-01-19 Kenichi Handa <handa@m17n.org>
5904
5905 * character.c (char_width): New function.
5906 (Fchar_width, c_string_width, lisp_string_width):
5907 Use char_width (Bug#9496).
5908
5909 2012-01-16 Martin Rudalics <rudalics@gmx.at>
5910
5911 * window.c (Vwindow_persistent_parameters): New variable.
5912 (Fset_window_configuration, save_window_save): Handle persistent
5913 window parameters.
5914
5915 2012-01-14 Eli Zaretskii <eliz@gnu.org>
5916
5917 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5918 thrashing the stack of the thread. (Bug#9087)
5919
5920 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5921
5922 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5923
5924 2012-01-11 Eli Zaretskii <eliz@gnu.org>
5925
5926 * xdisp.c (rows_from_pos_range): Handle the case where the
5927 highlight ends on a newline. (Bug#10464)
5928 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5929 he end column for display of highlight that ends on a newline
5930 before a R2L line.
5931
5932 2012-01-11 Glenn Morris <rgm@gnu.org>
5933
5934 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5935 from load-path also when installation-directory is nil. (Bug#10208)
5936
5937 2012-01-10 Glenn Morris <rgm@gnu.org>
5938
5939 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5940
5941 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5942 Update template values to be closer to their typical values these days.
5943
5944 2012-01-09 Eli Zaretskii <eliz@gnu.org>
5945
5946 * xdisp.c (rows_from_pos_range): Accept additional argument
5947 DISP_STRING, and accept any glyph in a row whose object is that
5948 string as eligible for mouse highlight. Fixes mouse highlight of
5949 display strings from overlays. (Bug#10464)
5950
5951 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
5952
5953 emacs: fix an auto-save permissions race condition (Bug#10400)
5954 * fileio.c (auto_saving_dir_umask): New static var.
5955 (Fmake_directory_internal): Use it.
5956 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5957 creating the directory. The old code temporarily assigns
5958 too-generous permissions to the directory.
5959 (do_auto_save_eh): Clear it.
5960 (Fdo_auto_save): Catch all errors, not just file errors, so
5961 that the var is always cleared.
5962
5963 2012-01-07 Eli Zaretskii <eliz@gnu.org>
5964
5965 * search.c (scan_buffer): Pass character positions to
5966 know_region_cache, not byte positions. (Bug#6540)
5967
5968 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
5969
5970 * w32.c (sys_rename): Report EXDEV when rename of a directory
5971 fails because the target is on another logical disk. (Bug#10284)
5972
5973 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5974
5975 * xterm.c (x_embed_request_focus): New function.
5976
5977 * xterm.h: Add prototype.
5978
5979 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5980
5981 2012-01-05 Glenn Morris <rgm@gnu.org>
5982
5983 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5984
5985 2012-01-01 Eli Zaretskii <eliz@gnu.org>
5986
5987 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5988 Load gnutls_transport_set_lowat only if GnuTLS version is below
5989 2.11.1.
5990 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5991 GnuTLS versions below 2.11.1.
5992
5993 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5994
5995 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5996 to the doc string advising against its use for altering the way
5997 windows are scrolled.
5998
5999 2011-12-28 Kenichi Handa <handa@m17n.org>
6000
6001 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
6002 coding-system ASCII compatible only when it does not produce BOM
6003 on encoding (Bug#10383).
6004
6005 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
6006
6007 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
6008 can scroll.
6009 (create_and_show_popup_menu): Always use menu_position_func for
6010 Gtk3 (Bug#10361).
6011
6012 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
6013
6014 * callint.c (Fcall_interactively): Don't truncate prompt string.
6015
6016 2011-12-23 Eli Zaretskii <eliz@gnu.org>
6017
6018 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
6019 property that ends at ZV, so that the bidi iteration could be
6020 resumed from there (after widening). (Bug#10360)
6021
6022 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
6023
6024 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
6025
6026 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
6027
6028 * nsterm.m (x_free_frame_resources):
6029 Release f->output_data.ns->miniimage.
6030 (ns_index_color): Fix indentation. Do not retain
6031 color_table->colors[i].
6032
6033 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
6034 before returning.
6035
6036 * nsfns.m (x_set_background_color): Assign return value from
6037 ns_index_color to face-background instead of NSColor*.
6038 (ns_implicitly_set_icon_type): Fix indentation.
6039 Change assignment in for loop to comparison.
6040
6041 * emacs.c (ns_pool): New variable.
6042 (main): Assign ns_pool.
6043 (Fkill_emacs): Call ns_release_autorelease_pool.
6044
6045 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
6046 autorelease fdesc, release fdAttrs and tdict.
6047 (ns_get_covering_families): Release charset.
6048 (ns_findfonts): Release NSFontDescriptor created with new.
6049 (ns_uni_to_glyphs): Fix indentation.
6050 (setString): Release attrStr before assigning new value.
6051
6052 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6053
6054 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
6055 and NS_IMPL_COCOA.
6056 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
6057 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
6058
6059 2011-12-18 David Reitter <reitter@cmu.edu>
6060
6061 * nsterm.m (ns_term_init): Subscribe for notifications
6062 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
6063 to method trackingNotification in EmacsMenu.
6064
6065 * nsmenu.m (trackingMenu): New variable.
6066 (trackingNotification): New method (from Aquamacs).
6067 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
6068 from Aquamacs (Bug#7030).
6069
6070 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6071
6072 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
6073 (symbol_to_nsstring): Fix indentation.
6074 (ns_symbol_to_pb): New function.
6075 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
6076 (Fns_rotate_cut_buffers_internal): Remove.
6077 (Fns_store_selection_internal): Rename from
6078 Fns_store_cut_buffer_internal.
6079 (ns_get_foreign_selection, Fx_own_selection_internal)
6080 (Fx_disown_selection_internal, Fx_selection_exists_p)
6081 (Fns_get_selection_internal, Fns_store_selection_internal):
6082 Use ns_symbol_to_pb and check if return value is nil.
6083 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
6084 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
6085 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
6086 renamed to Sns_store_selection_internal.
6087 (ns_handle_selection_request): Move code to Fx_own_selection_internal
6088 and remove this function.
6089 (ns_handle_selection_clear): Remove, never used.
6090 (Fx_own_selection_internal): Move code from ns_handle_selection_request
6091 here.
6092
6093 2011-12-17 Ken Brown <kbrown@cornell.edu>
6094
6095 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
6096 GID is unknown (Bug#10257).
6097
6098 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
6101 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
6102 which caused a build failure on GNU/Linux IA-64. This problem was
6103 introduced by my 2011-10-07 patch.
6104
6105 2011-12-15 Juri Linkov <juri@jurta.org>
6106
6107 * image.c (imagemagick_error): New function. (Bug#10112)
6108 (imagemagick_load_image): Comment out `MagickSetResolution' call.
6109 Use `imagemagick_error' where ImageMagick functions return
6110 `MagickFalse'.
6111 (Fimagemagick_types): Add `Fnreverse' to return the list in the
6112 proper order.
6113
6114 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6115
6116 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
6117 fill background (Bug#8992).
6118
6119 2011-12-13 Martin Rudalics <rudalics@gmx.at>
6120
6121 * window.c (Vwindow_combination_resize)
6122 (Vwindow_combination_limit): Use t instead of non-nil in
6123 doc-strings.
6124 (Vrecenter_redisplay): Add first sentence of doc-string on
6125 separate line.
6126 (Frecenter): Fix doc-string typo.
6127
6128 2011-12-11 Kenichi Handa <handa@m17n.org>
6129
6130 * coding.c (Funencodable_char_position): Pay attention to the
6131 buffer text relocation (Bug#9389).
6132
6133 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6134
6135 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
6136 gtk_init (Bug#10100).
6137
6138 2011-12-10 Eli Zaretskii <eliz@gnu.org>
6139
6140 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
6141 IT->string is nil. (Bug#10263)
6142
6143 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6144
6145 * nsterm.h (x_free_frame_resources): Declare.
6146
6147 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
6148 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
6149
6150 * nsterm.h (ns_get_defaults_value): Declare.
6151
6152 * nsterm.m (ns_default): Call ns_get_defaults_value.
6153
6154 2011-12-09 Eli Zaretskii <eliz@gnu.org>
6155
6156 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
6157 (Bug#10170)
6158
6159 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6160
6161 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
6162 that where the value of an _OBJC_* symbol points to is in the .bss
6163 section (Bug#10240).
6164
6165 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6166
6167 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
6168 after the loop to call ccl_driver at least once (Bug#8619).
6169
6170 2011-12-08 Kenichi Handa <handa@m17n.org>
6171
6172 * ftfont.c (get_adstyle_property): Fix previous change
6173 (Bug#10233).
6174
6175 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
6176
6177 * w32.c (init_environment): If no_site_lisp, remove site-lisp
6178 dirs from the default value of EMACSLOADPATH (bug#10208).
6179
6180 2011-12-07 Glenn Morris <rgm@gnu.org>
6181
6182 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
6183 installation and source directories as well. (Bug#10208)
6184
6185 2011-12-06 Chong Yidong <cyd@gnu.org>
6186
6187 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
6188
6189 2011-12-06 Glenn Morris <rgm@gnu.org>
6190
6191 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
6192 as an error, not just -1. (Bug#10217)
6193
6194 2011-12-05 Chong Yidong <cyd@gnu.org>
6195
6196 * keyboard.c (process_special_events): New function.
6197 (swallow_events, Finput_pending_p): Use it (Bug#10195).
6198
6199 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
6200
6201 * coding.c (encode_designation_at_bol): Don't use uninitialized
6202 local variable (Bug#9318).
6203
6204 2011-12-05 Kenichi Handa <handa@m17n.org>
6205
6206 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
6207 return Qnil (Bug#8046, Bug#10193).
6208
6209 2011-12-05 Kenichi Handa <handa@m17n.org>
6210
6211 * coding.c (encode_designation_at_bol): New args charbuf_end and
6212 dst. Return the number of produced bytes. Callers changed.
6213 (coding_set_source): Return how many bytes coding->source was
6214 relocated.
6215 (coding_set_destination): Return how many bytes
6216 coding->destination was relocated.
6217 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
6218 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
6219
6220 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6221
6222 * coding.c (CODING_CHAR_CHARSET_P): New macro.
6223 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
6224 macro (Bug#9318).
6225
6226 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
6227
6228 The following changes are to fix Bug#9318.
6229
6230 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
6231 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
6232 (encode_coding_iso_2022, encode_coding_sjis)
6233 (encode_coding_big5, encode_coding_charset): Use the above macros.
6234
6235 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
6236
6237 * lisp.h (process_quit_flag): Fix external declaration.
6238
6239 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
6240
6241 Don't macro-inline non-performance-critical code.
6242 * eval.c (process_quit_flag): New function.
6243 * lisp.h (QUIT): Use it.
6244
6245 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
6246
6247 * nsfns.m (get_geometry_from_preferences): New function.
6248 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
6249
6250 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
6251
6252 * emacs.c (Qkill_emacs): Define.
6253 (syms_of_emacs): Initialize it.
6254 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
6255 Qquit_flag to `kill-emacs' instead.
6256 (quit_throw_to_read_char): Add parameter `from_signal'.
6257 All callers changed. Call Fkill_emacs if requested and safe.
6258 * lisp.h (QUIT): Call Fkill_emacs if requested.
6259
6260 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
6261
6262 * widget.c (update_wm_hints): Return if wmshell is null.
6263 (widget_update_wm_size_hints): New function.
6264
6265 * widget.h (widget_update_wm_size_hints): Declare.
6266
6267 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
6268 widget_update_wm_size_hints (Bug#10104).
6269
6270 2011-12-03 Eli Zaretskii <eliz@gnu.org>
6271
6272 * xdisp.c (handle_invisible_prop): If the invisible text ends just
6273 before a newline, prepare the bidi iterator for consuming the
6274 newline, and keep the current paragraph direction. (Bug#10183)
6275 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
6276
6277 2011-12-02 Juri Linkov <juri@jurta.org>
6278
6279 * search.c (Fword_search_regexp): New Lisp function created from
6280 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
6281 (Fword_search_backward, Fword_search_forward)
6282 (Fword_search_backward_lax, Fword_search_forward_lax):
6283 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
6284 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
6285
6286 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
6287
6288 * fileio.c (Finsert_file_contents): Move after-change-function call
6289 to before the "handled:" label, since all "goto handled" appear in
6290 cases where the *-change-functions have already been properly called
6291 (bug#10117).
6292
6293 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
6294
6295 * keyboard.c (interrupt_signal): Don't call kill-emacs when
6296 waiting for input. (Bug#10169)
6297
6298 2011-11-30 Eli Zaretskii <eliz@gnu.org>
6299
6300 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
6301 verifies glyph row's hash code--we have just reallocated the
6302 glyphs, so their contents can be complete garbage. (Bug#10164)
6303
6304 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
6305
6306 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
6307
6308 2011-11-30 Eli Zaretskii <eliz@gnu.org>
6309
6310 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
6311 attributes are tested _before_ calling verify_row_hash, to protect
6312 against GCC re-ordering of the tests. (Bug#10164)
6313
6314 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
6315
6316 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
6317
6318 * xterm.c (handle_one_xevent): Only set async_visible and friends
6319 if net_wm_state_hidden_seen is non-zero (Bug#10002)
6320 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
6321 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
6322
6323 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 Remove GCPRO-related macros that exist only to avoid shadowing locals.
6326 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
6327 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
6328 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6329 All uses changed to use GCPRO1 etc.
6330 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
6331 Revert to old implementation (i.e., before 2011-03-11).
6332
6333 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6334
6335 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
6336 of scroll runs so as to avoid assigning disabled bogus rows and
6337 unnecessary graphics copy operations.
6338
6339 2011-11-27 Eli Zaretskii <eliz@gnu.org>
6340
6341 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
6342 (snprintf) [_MSC_VER]: Redirect to _snprintf.
6343 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
6344 (malloc, free, realloc, calloc): Redirect to e_* only when
6345 compiling Emacs.
6346
6347 * lisp.h (GCTYPEBITS): Move before first use.
6348 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
6349 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
6350 this macro definition.
6351
6352 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
6353 _MSC_VER.
6354
6355 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
6356
6357 * gtkutil.c (xg_create_frame_widgets):
6358 Call gtk_window_set_has_resize_grip (FALSE) if that function is
6359 present with Gtk+ 2.0.
6360
6361 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6362
6363 * fileio.c (Finsert_file_contents): Undo previous change; see
6364 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6365
6366 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6367
6368 Rename locals to avoid shadowing.
6369 * fileio.c (Finsert_file_contents):
6370 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
6371 * process.c (wait_reading_process_output):
6372 Rename inner 'proc' to 'p' to avoid shadowing.
6373 Indent for consistency with usual Emacs style.
6374
6375 2011-11-25 Eli Zaretskii <eliz@gnu.org>
6376
6377 * xdisp.c (redisplay_window): If cursor row is not fully visible
6378 after recentering, and scroll-conservatively is set to a large
6379 number, scroll window by a few more lines to make the cursor fully
6380 visible and out of scroll-margin. (Bug#10105)
6381 (start_display): Don't move to the next line if the display should
6382 start at a newline that is part of a display vector or an overlay
6383 string. (Bug#10119)
6384
6385 2011-11-24 Juri Linkov <juri@jurta.org>
6386
6387 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6388 after the `MagickPingImage' call. (Bug#10112)
6389
6390 2011-11-23 Chong Yidong <cyd@gnu.org>
6391
6392 * window.c (Fcoordinates_in_window_p): Accept only live windows.
6393
6394 2011-11-23 Martin Rudalics <rudalics@gmx.at>
6395
6396 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6397 making another buffer current. (Bug#10114)
6398
6399 2011-11-23 Glenn Morris <rgm@gnu.org>
6400
6401 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
6402
6403 2011-11-23 Chong Yidong <cyd@gnu.org>
6404
6405 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6406 using it (Bug#5984).
6407
6408 2011-11-22 Eli Zaretskii <eliz@gnu.org>
6409
6410 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6411 and header-lines, as they don't have one computed for them.
6412 (Bug#10098)
6413
6414 * .gdbinit (prow): Make displayed values more self-explaining.
6415 Add row's hash code.
6416
6417 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
6418
6419 * process.c (wait_reading_process_output): Fix asynchrounous
6420 GnuTLS socket handling on some versions of the GnuTLS library.
6421 (wait_reading_process_output): Add comment and URL.
6422
6423 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
6424
6425 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6426
6427 2011-11-21 Chong Yidong <cyd@gnu.org>
6428
6429 * window.c (Fnext_window, Fprevious_window): Doc fix.
6430
6431 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6432
6433 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6434
6435 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6436
6437 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6438
6439 2011-11-20 Martin Rudalics <rudalics@gmx.at>
6440
6441 * window.c (Fset_window_combination_limit): Rename argument
6442 STATUS to LIMIT.
6443 (Vwindow_combination_limit): Remove "status" from doc-string.
6444
6445 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
6446
6447 * m/ibms390.h: Remove.
6448 * m/ibms390x.h: Don't include "ibms390.h".
6449
6450 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6451
6452 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6453 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6454
6455 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6456
6457 * casetab.c (Fset_case_table):
6458 * charset.c (Fcharset_after): Fix typos.
6459
6460 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6461
6462 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6463 Otherwise, valgrind does not work on some platforms.
6464 Problem reported by Andreas Schwab in
6465 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6466 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6467 is set, removing the need for VIRT_ADDRESS_VARIES.
6468 (PURE_P): Use a more-efficient implementation that needs just one
6469 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6470 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6471 to 4 (xorl, subq, cmpq, setbe).
6472 * alloc.c (pure): Always extern now, since that's the
6473 VIRT_ADDR_VARIES behavior.
6474 (PURE_POINTER_P): Use a single comparison, not two, for
6475 consistency with the new puresize.h.
6476 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6477 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6478 Remove VIRT_ADDR_VARIES no longer needed.
6479
6480 2011-11-19 Eli Zaretskii <eliz@gnu.org>
6481
6482 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6483 (erase_phys_cursor, update_window_cursor, show_mouse_face)
6484 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6485 behave as if the cursor position were at the window margin.
6486
6487 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6488 and the cursor position is out of bounds, behave as if the cursor
6489 position were at the window margin. (Bug#10075)
6490
6491 2011-11-18 Chong Yidong <cyd@gnu.org>
6492
6493 * window.c (Fwindow_combination_limit): Make first argument
6494 non-optional, since it is meaningless for live windows like the
6495 selected window.
6496
6497 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
6498
6499 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6500
6501 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
6502
6503 * intervals.c: Fix grafting over the whole buffer (bug#10071).
6504 (graft_intervals_into_buffer): Simplify.
6505
6506 2011-11-18 Eli Zaretskii <eliz@gnu.org>
6507
6508 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6509 hash values of the two rows.
6510 (copy_row_except_pointers): Preserve the used[] arrays and the
6511 hash values of the two rows. (Bug#10035)
6512 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
6513
6514 * xdisp.c (row_hash): New function, body extracted from
6515 compute_line_metrics.
6516 (compute_line_metrics): Call row_hash, instead of computing the
6517 hash code inline.
6518
6519 * dispnew.c (verify_row_hash): Call row_hash for computing the
6520 hash code of a row, instead of duplicating code from xdisp.c.
6521
6522 * dispextern.h (row_hash): Add prototype.
6523
6524 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
6525
6526 * frame.c (delete_frame): Don't delete the terminal when the last
6527 X frame is closed if emacs is built with GTK toolkit.
6528
6529 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
6530
6531 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
6532
6533 2011-11-17 Martin Rudalics <rudalics@gmx.at>
6534
6535 * window.c (Vwindow_splits): Rename to
6536 Vwindow_combination_resize. Suggested by Juri Linkov.
6537 (Fsplit_window_internal): Use Vwindow_combination_resize instead
6538 of Vwindow_splits.
6539
6540 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
6541
6542 * nsfns.m (Fns_font_name):
6543 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
6544
6545 2011-11-16 Martin Rudalics <rudalics@gmx.at>
6546
6547 * window.h (window): Rename slot "nest" to "combination_limit".
6548 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6549 (Fset_window_nest): Rename to Fset_window_combination_limit.
6550 (Vwindow_nest): Rename to Vwindow_combination_limit.
6551 (recombine_windows, make_parent_window, make_window)
6552 (Fsplit_window_internal, saved_window)
6553 (Fset_window_configuration, save_window_save): Rename all
6554 occurrences of window_nest to window_combination_limit.
6555
6556 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
6557
6558 * image.c (imagemagick_load_image): Fix typo.
6559
6560 2011-11-14 Eli Zaretskii <eliz@gnu.org>
6561
6562 * xdisp.c (display_line): Move the call to
6563 highlight_trailing_whitespace before the call to
6564 compute_line_metrics, since the latter needs to see the final
6565 faces of all the glyphs to compute ROW's hash value.
6566 Fixes assertion violations in row_equal_p. (Bug#10035)
6567
6568 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
6569
6570 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6571 just return (bug#10044).
6572
6573 2011-11-12 Eli Zaretskii <eliz@gnu.org>
6574
6575 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6576 with user-defined heap size. Bump the default size of the temacs
6577 heap to 27MB, to avoid memory warning when running temacs.
6578 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6579
6580 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6581 current_matrix and desired_matrix. (Bug#9990)
6582 (verify_row_hash) [XASSERTS]: New function.
6583 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6584 that the hash value of glyph rows is correct.
6585
6586 2011-11-12 Martin Rudalics <rudalics@gmx.at>
6587
6588 * window.h (window): Remove splits slot.
6589 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6590 (Fdelete_other_windows_internal, make_parent_window)
6591 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6592 (Fset_window_configuration, save_window_save): Don't deal with
6593 split status of windows.
6594 (saved_window): Remove splits slot.
6595 (Vwindow_splits): Rewrite doc-string.
6596
6597 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6598
6599 * xfns.c (unwind_create_frame):
6600 * nsfns.m (unwind_create_frame):
6601 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6602 Vframe_list (Bug#9999).
6603
6604 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6605
6606 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
6607
6608 2011-11-11 Kenichi Handa <handa@m17n.org>
6609
6610 * callproc.c (Fcall_process): Set the member dst_multibyte of
6611 process_coding.
6612
6613 2011-11-11 Johan Bockgård <bojohan@gnu.org>
6614
6615 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6616 avoid a crash (bug#9496).
6617
6618 2011-11-09 Chong Yidong <cyd@gnu.org>
6619
6620 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6621 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6622
6623 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6624
6625 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6626
6627 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6628
6629 Avoid some portability problems by eschewing 'extern inline' functions.
6630 The trivial performance wins aren't worth the portability hassles; see
6631 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6632 et seq.
6633 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6634 (window_box_width, window_box_left, window_box_left_offset)
6635 (window_box_right, window_box_right_offset): Undo previous change,
6636 by removing the "extern"s.
6637 * intervals.c (adjust_intervals_for_insertion)
6638 (adjust_intervals_for_deletion): Undo previous change,
6639 making these static again.
6640 (offset_intervals, temp_set_point_both, temp_set_point)
6641 (copy_intervals_to_string): No longer inline.
6642 * xdisp.c (window_text_bottom_y, window_box_width)
6643 (window_box_height, window_box_left_offset)
6644 (window_box_right_offset, window_box_left, window_box_right)
6645 (window_box): No longer inline.
6646
6647 2011-11-08 Chong Yidong <cyd@gnu.org>
6648
6649 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6650 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6651 Signal an error if not a live window.
6652 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6653 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6654
6655 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
6656
6657 * lisp.h (syms_of_abbrev): Remove declaration.
6658 Reported by CHENG Gao <chenggao@royau.me>.
6659
6660 2011-11-07 Eli Zaretskii <eliz@gnu.org>
6661
6662 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6663 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6664 of temacs in GUI mode.
6665
6666 2011-11-07 Martin Rudalics <rudalics@gmx.at>
6667
6668 * window.h: Declare delete_all_child_windows instead of
6669 delete_all_subwindows.
6670 * window.c (Fwindow_nest, Fset_window_nest)
6671 (Fset_window_new_total, Fset_window_new_normal)
6672 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6673 (delete_all_subwindows): Rename to delete_all_child_windows.
6674 (Fdelete_other_windows_internal, Fset_window_configuration):
6675 Call delete_all_child_windows instead of delete_all_subwindows.
6676 * frame.c (delete_frame): Call delete_all_child_windows instead
6677 of delete_all_subwindows.
6678
6679 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6680
6681 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6682 This is also needed for porting to any host where GC_MARK_STACK is
6683 not GC_MAKE_GCPROS_NOOPS.
6684 (which_symbols): Use it.
6685
6686 2011-11-07 Kenichi Handa <handa@m17n.org>
6687
6688 * coding.c (coding_set_destination): Check coding->src_pos only
6689 when coding->src_object is a buffer (bug#9910).
6690
6691 * process.c (send_process): Set the member src_multibyte of coding
6692 to 0 (bug#9911) when sending a unibyte text.
6693
6694 * callproc.c (Fcall_process): Set the member src_multibyte of
6695 process_coding to 0 (bug#9912).
6696
6697 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6698
6699 * xmenu.c (cleanup_widget_value_tree): New function.
6700 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6701 calling free_menubar_widget_value_tree directly (Bug#9830).
6702
6703 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6704
6705 Fix some portability problems with 'inline'.
6706 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6707 (window_box_width, window_box_left, window_box_left_offset)
6708 (window_box_right, window_box_right_offset): Declare extern.
6709 Otherwise, these inline functions do not conform to C99 and
6710 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6711 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6712 * intervals.c (adjust_intervals_for_insertion)
6713 (adjust_intervals_for_deletion): Now extern, because otherwise the
6714 extern inline functions 'offset_intervals' couldn't refer to it.
6715 (static_offset_intervals): Remove.
6716 (offset_intervals): Rewrite using the old contents of
6717 static_offset_intervals. The old version didn't conform to C99
6718 because an extern inline function contained a reference to an
6719 identifier with static linkage.
6720
6721 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6722
6723 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6724 GC.
6725
6726 2011-11-06 Eli Zaretskii <eliz@gnu.org>
6727
6728 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6729 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6730 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6731 return Qleft_to_right.
6732
6733 2011-11-06 Chong Yidong <cyd@gnu.org>
6734
6735 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6736 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6737 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6738 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6739 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6740 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6741 (Fwindow_vscroll): Doc fix.
6742 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6743 argument, since it makes no sense to pass a live window and for
6744 consistency with window-child.
6745
6746 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6747
6748 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6749 support MSVC.
6750
6751 2011-11-05 Jason Rumney <jasonr@gnu.org>
6752
6753 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6754 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6755 fonts (Bug#6029).
6756 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6757 bitwise arithmetic preventing use of unicode-sip and non-truetype
6758 opentype fonts.
6759
6760 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6761
6762 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6763 "emacs"-only part.
6764
6765 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6766 initialization code to keep similarity to xfns.c after changes
6767 from 2011-11-05.
6768
6769 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
6770
6771 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
6772 (unwind_create_frame): New function (Bug#9943).
6773 (Fx_create_frame): Restructure code to be more similar to the one in
6774 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
6775 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
6776 Move terminal->reference_count++ just before making the frame official
6777 (Bug#9943).
6778
6779 * nsterm.m (x_free_frame_resources): New function.
6780 (x_destroy_window): Move code to x_free_frame_resources.
6781
6782 * xfns.c (unwind_create_frame): Fix comment.
6783 (Fx_create_frame, x_create_tip_frame):
6784 Move terminal->reference_count++ just before making the frame
6785 official. Move initialization of image_cache_refcount and
6786 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
6787
6788 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6789
6790 Support MSVC build with newer versions of Visual Studio.
6791 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
6792 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
6793 nt/gmake.defs.
6794
6795 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
6796 which are not supported by MSVC.
6797 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
6798 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
6799 bitfields.
6800 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
6801 types in bitfields.
6802 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
6803
6804 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
6805
6806 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
6807
6808 Support MSVC build with newer versions of Visual Studio.
6809 * w32.c: Don't include w32api.h for MSVC.
6810 (init_environment) [_MSC_VER]: Call sys_access, not _access.
6811
6812 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
6813 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
6814 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
6815 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
6816 e_* cousins.
6817 (alloca) [_MSC_VER]: Define to _alloca.
6818
6819 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
6820
6821 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
6822
6823 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6824
6825 * xdisp.c (note_mouse_highlight): If either of
6826 previous/next-single-property-change returns nil, treat that as
6827 the beginning or the end of the buffer. (Bug#9955)
6828
6829 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
6830
6831 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
6832 label is not null (Bug#9951).
6833 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6834 may be NULL.
6835
6836 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6837
6838 * window.c (Fwindow_body_size): Mention in the doc string that the
6839 return value is in frame's canonical units. (Bug#9949)
6840
6841 2011-11-03 Eli Zaretskii <eliz@gnu.org>
6842
6843 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
6844
6845 * w32fns.c (unwind_create_frame): If needed, free the glyph
6846 matrices of the partially constructed frame. (Bug#9943)
6847 * xfns.c (unwind_create_frame): Likewise.
6848
6849 2011-11-01 Eli Zaretskii <eliz@gnu.org>
6850
6851 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
6852 Don't stop backward scan on the continuation glyph, even though
6853 its CHARPOS is positive.
6854 (mouse_face_from_buffer_pos, note_mouse_highlight):
6855 Rename cover_string to disp_string.
6856
6857 2011-11-01 Martin Rudalics <rudalics@gmx.at>
6858
6859 * window.c (temp_output_buffer_show): Don't use
6860 Vtemp_buffer_show_specifiers.
6861 (Vtemp_buffer_show_specifiers): Remove unused variable.
6862
6863 2011-10-30 Eli Zaretskii <eliz@gnu.org>
6864
6865 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
6866 past the beginning of the current glyph matrix.
6867
6868 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6869
6870 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
6871 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
6872 HAVE_GTK3 (Bug#9869).
6873
6874 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6875 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6876
6877 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6878
6879 * xterm.c: Declare x_handle_net_wm_state to return int.
6880 (handle_one_xevent): Check if we are iconified but don't have
6881 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6882 (get_current_wm_state): Return non-zero if not hidden,
6883 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6884 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6885 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6886 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6887
6888 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6891 so that this new function doesn't get optimized away by a
6892 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6893
6894 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6895
6896 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6897
6898 2011-10-29 Eli Zaretskii <eliz@gnu.org>
6899
6900 Fix the `xbytecode' command.
6901 * .gdbinit (xprintbytestr): New command.
6902 (xwhichsymbols): Rename from `which'; all callers changed.
6903 (xbytecode): Print the byte-code string as well.
6904
6905 2011-10-29 Kim Storm <storm@cua.dk>
6906
6907 * alloc.c (which_symbols): New function.
6908
6909 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6910
6911 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6912 line. (Bug#9903)
6913
6914 2011-10-29 Glenn Morris <rgm@gnu.org>
6915
6916 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6917 Not clear what it was for, and it causes various bugs. (Bug#9839)
6918
6919 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6920
6921 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6922 possible random value that matches one of those tested as
6923 condition to clear the mouse face.
6924
6925 2011-10-28 Chong Yidong <cyd@gnu.org>
6926
6927 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6928
6929 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6930
6931 * window.c (make_window): Initialize phys_cursor_on_p.
6932
6933 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6934
6935 * lisp.h (struct Lisp_Symbol): Update comments.
6936
6937 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
6938
6939 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6940
6941 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6942
6943 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6944 <oslsachem@gmail.com> for helping to debug this.
6945
6946 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6947 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6948 (g_b_init_get_glyph_outline_w): New static variables.
6949 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6950 (GetGlyphOutlineW_Proc): New typedefs.
6951 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
6952 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6953 New functions.
6954 (w32font_open_internal, compute_metrics):
6955 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
6956 instead of calling the "wide" APIs directly.
6957
6958 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6959
6960 * w32.h (syms_of_w32font): Add prototype.
6961
6962 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6963
6964 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6965 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6966 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6967 (Fmove_to_window_line): Doc fix.
6968
6969 2011-10-27 Chong Yidong <cyd@gnu.org>
6970
6971 * process.c (make_process): Set gnutls_state to NULL.
6972
6973 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6974 non-NULL, regardless of GNUTLS_INITSTAGE.
6975 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6976 an error. Set process slots as soon as we allocate them.
6977
6978 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6979
6980 2011-10-27 Chong Yidong <cyd@gnu.org>
6981
6982 * gnutls.c (emacs_gnutls_deinit): New function.
6983 Deallocate credentials structures as well as calling gnutls_deinit.
6984 (Fgnutls_deinit, Fgnutls_boot): Use it.
6985
6986 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6987 (deactivate_process): Call emacs_gnutls_deinit.
6988
6989 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6990
6991 * image.c (x_create_x_image_and_pixmap):
6992 * w32.c (sys_rename, w32_delayed_load):
6993 * w32font.c (fill_in_logfont):
6994 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6995
6996 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
6997
6998 * w32fns.c (w32_default_color_map): New function,
6999 extracted from Fw32_default_color_map.
7000 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
7001
7002 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
7003
7004 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
7005
7006 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
7007
7008 * keyboard.c (test_undefined): New function (bug#9751).
7009 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
7010
7011 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
7012
7013 * sysdep.c (init_sys_modes): Fix the check for the controlling
7014 terminal (Bug#6649).
7015
7016 2011-10-20 Eli Zaretskii <eliz@gnu.org>
7017
7018 * dispextern.h (struct bidi_it): New member next_en_type.
7019
7020 * bidi.c (bidi_line_init): Initialize the next_en_type member.
7021 (bidi_resolve_explicit_1): When next_en_pos is valid for the
7022 current character, check also for next_en_type being WEAK_EN.
7023 (bidi_resolve_weak): Don't enter the expensive loop if the current
7024 position is before next_en_pos. Record the bidi type of the first
7025 non-ET, non-BN character we find, in addition to its position.
7026 (bidi_level_of_next_char): Invalidate next_en_type when
7027 next_en_pos is over-stepped.
7028
7029 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
7030
7031 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
7032 * editfns.c: Rewrite current-time-zone so that it invokes
7033 the equivalent of (format-time-string "%Z") to get the time zone name.
7034 This fixes a bug when the time zone name contains characters that
7035 need converting from the system time locale to Emacs internal format.
7036 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
7037 that patch fixed format-time-string to do the conversion, but
7038 I forgot to fix current-time-zone.
7039 (format_time_string): New function, containing most of
7040 what Fformat_time_string used to contain.
7041 (Fformat_time_string): Rewrite in terms of format_time_string.
7042 This doesn't change this function's behavior.
7043 (current-time-zone): Rewrite to use format_time_string.
7044 This fixes the bug reported by Michael Schierl in
7045 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
7046 Jason Rumney's 2007-06-07 change worked around this bug, but
7047 didn't fix it.
7048 * systime.h (tzname, timezone): Remove no-longer-used declarations.
7049
7050 2011-10-19 Eli Zaretskii <eliz@gnu.org>
7051
7052 * xdisp.c (start_display): If the character at POS is displayed
7053 via a display vector, reset IT->current.dpvec_index to zero.
7054 (try_window_reusing_current_matrix): If a line ends in a display
7055 vector or the next line starts in a display vector, continue
7056 redrawing the window even though the character position of
7057 start_row was reached.
7058 (Bug#9771, part 2)
7059
7060 2011-10-18 Chong Yidong <cyd@gnu.org>
7061
7062 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
7063 with nobreak-char-display too.
7064
7065 2011-10-18 Eli Zaretskii <eliz@gnu.org>
7066
7067 Fix part 3 of bug#9771.
7068 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
7069 (bidi_resolve_neutral): Don't enter the expensive loop looking for
7070 non-neutral characters if the current character is a paragraph
7071 separator (a.k.a. Newline). This avoids running the same
7072 expensive loop twice, once when we consume the preceding newline
7073 and the other time when the line actually needs to be displayed.
7074 Avoid the loop when we see neutrals on the base embedding level
7075 following a character whose directionality is the same as the
7076 paragraph's. This avoids running the expensive loop when a line
7077 ends in a long sequence of neutrals, like control characters.
7078 Add assertion against STRONG_AL type. Slightly rearrange code
7079 that determines the type of a neutral given the first non-neutral
7080 that follows it.
7081 (bidi_level_of_next_char): Set next_en_pos to zero when
7082 invalidating its info.
7083
7084 2011-10-17 Eli Zaretskii <eliz@gnu.org>
7085
7086 * xdisp.c (push_display_prop): Determine whether to record string
7087 or buffer position by IT->string, not by IT->method. Allow
7088 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
7089 (move_it_vertically_backward): Don't look for character position
7090 immediately after the newline when in a continuation line.
7091 (Bug#9771, part 1)
7092
7093 2011-10-15 Martin Rudalics <rudalics@gmx.at>
7094
7095 * window.c (coordinates_in_window): Rewrite and delabelize
7096 vertical border check. (Bug#5357) (Bug#9618)
7097
7098 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7099
7100 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
7101 errors in XSetWindowBorder (bug#9310).
7102
7103 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
7104
7105 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
7106 avoid crash when xmalloc overrun checking is enabled.
7107
7108 2011-10-13 Eli Zaretskii <eliz@gnu.org>
7109
7110 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
7111 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
7112 cursor motion with <left> and <right> arrow keys.
7113
7114 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
7115 some callers set that themselves.
7116
7117 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7118
7119 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
7120 display string and the previous row comes from the same string and
7121 is empty. (Bug#9739) (Bug#9738)
7122
7123 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
7124
7125 * doc.c (get_doc_string): Encode file name (bug#9735).
7126
7127 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7128
7129 * bidi.c (bidi_level_of_next_char):
7130 * xdisp.c (get_visually_first_element): Remove old incorrect
7131 comments regarding the Unicode Line Separator character.
7132
7133 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
7134
7135 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
7136
7137 * alloc.c (Fgc_status): Do not access beyond zombies array
7138 boundary if nzombies > MAX_ZOMBIES.
7139 * alloc.c (dump_zombies): Add missing format specifier.
7140
7141 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
7142
7143 * xdisp.c (set_cursor_from_row): Simplify conditionals,
7144 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
7145
7146 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
7147 Some packages use them to denote characters with modifiers.
7148
7149 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
7150
7151 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
7152 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
7153 matching a pp-number. Rename parameter var to var1.
7154
7155 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
7156
7157 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
7158
7159 2011-10-08 Glenn Morris <rgm@gnu.org>
7160
7161 * callint.c (Fcall_interactively): Give a more explicit error for the
7162 'c' case with a non-character input. (Bug#8479)
7163
7164 2011-10-08 Eli Zaretskii <eliz@gnu.org>
7165
7166 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
7167 lines.
7168 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
7169 lines that are hscrolled on the left.
7170
7171 * dispnew.c (buffer_posn_from_coords): Account for a possible
7172 presence of header-line. (Bug#4426)
7173
7174 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
7175
7176 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
7177 Don't advertise functionality which we discourage or doesn't work.
7178
7179 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
7180
7181 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
7182 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
7183 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
7184 this makes Emacs dump core during garbage collection on rare
7185 occasions. sizeof is obviously inferior to offsetof here, so
7186 stick with offsetof.
7187 (GC_POINTER_ALIGNMENT): New macro.
7188 (mark_memory): Omit 3rd (offset) arg; caller changed.
7189 Don't assume EMACS_INT alignment is the same as pointer alignment.
7190
7191 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
7192
7193 * keyboard.c (read_key_sequence_remapped): New var.
7194 (read_key_sequence): Compute remapping in the right buffer.
7195 (command_loop_1): Use read_key_sequence's remapping directly.
7196
7197 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
7198
7199 * dired.c (file_name_completion): Don't expand file name.
7200 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
7201 before checking file name handler.
7202
7203 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
7204 they've been requested explicitly (bug#9591).
7205
7206 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
7207
7208 * keymap.c (Fsingle_key_description): Use make_specified_string
7209 instead of build_string to build string from push_key_description.
7210 (Bug#5193)
7211
7212 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7213
7214 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
7215 This fixes a Y2038 bug on 64-bit hosts.
7216 * buffer.c (reset_buffer):
7217 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
7218 (Fclear_buffer_auto_save_failure):
7219 Use 0, not -1, to represent an unset failure time, since time_t
7220 might not be signed.
7221
7222 Remove dependency on glibc malloc internals.
7223 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7224 Move back here from lisp.h, but with their new implementations.
7225 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7226 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
7227 * charset.c (charset_table_init): New static var.
7228 (syms_of_charset): Use it instead of xmalloc. This removes a
7229 dependency on glibc malloc internals. See Eli Zaretskii's comment in
7230 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
7231 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7232 Move back to alloc.c.
7233 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7234 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
7235
7236 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
7237
7238 * nsterm.m (windowDidResize): Call x_set_window_size only when
7239 ns_in_resize is true. Otherwise set pixelwidth/height and
7240 call change_frame_size (Bug#9628).
7241
7242 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7243
7244 Port --enable-checking=all to Fedora 14 x86-64.
7245 * charset.c (syms_of_charset): Also account for glibc malloc's
7246 internal overhead when calculating the initial malloc maximum.
7247
7248 Port --enable-checking=all to Fedora 14 x86.
7249 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7250 Move to lisp.h.
7251 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
7252 (overrun_check_realloc, overrun_check_free):
7253 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
7254 That way, xmalloc returns a properly-aligned pointer even if
7255 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
7256 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
7257 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
7258 into account when calculating the initial malloc maximum.
7259 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7260 Move here from alloc.c, so that charset.c can use it too.
7261 Properly align; the old code wasn't right for common 32-bit hosts
7262 when configured with --enable-checking=all.
7263 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7264 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
7265
7266 2011-09-29 Eli Zaretskii <eliz@gnu.org>
7267
7268 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
7269 use EDOM.
7270
7271 2011-09-28 Eli Zaretskii <eliz@gnu.org>
7272
7273 * xdisp.c (compute_display_string_end): If there's no display
7274 string at CHARPOS, return -1.
7275
7276 * bidi.c (bidi_fetch_char): When compute_display_string_end
7277 returns a negative value, treat the character as a normal
7278 character not covered by a display string. (Bug#9624)
7279
7280 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
7281
7282 * lread.c (Fread_from_string): Fix typo in docstring.
7283
7284 2011-09-27 Eli Zaretskii <eliz@gnu.org>
7285
7286 * xdisp.c (handle_invisible_prop): If invisible text ends on a
7287 newline, reseat the iterator instead of bidi-iterating there one
7288 character at a time. (Bug#9610)
7289 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
7290 TO_CHARPOS if the bidi iterator is at base embedding level.
7291
7292 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
7293
7294 * lread.c (readevalloop): Use correct code for NBSP.
7295 (read1): Likewise. (Bug#9608)
7296
7297 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
7298
7299 * dbusbind.c (Fdbus_register_signal): When service is not
7300 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
7301
7302 2011-09-25 Glenn Morris <rgm@gnu.org>
7303
7304 * buffer.c (truncate-lines): Doc fix.
7305
7306 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
7307
7308 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
7309 (Fset_window_next_buffers): Doc fix.
7310
7311 2011-09-24 Glenn Morris <rgm@gnu.org>
7312
7313 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
7314
7315 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
7316
7317 Fix minor problems found by static checking.
7318 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
7319 * indent.c (Fvertical_motion): Fix == vs = typo.
7320
7321 2011-09-24 Eli Zaretskii <eliz@gnu.org>
7322
7323 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
7324 Default value is now t. Doc fix.
7325
7326 * indent.c (Fvertical_motion): Compute and apply the overshoot
7327 logic when moving up, not only when moving down. Fix the
7328 confusing name and values of the it_overshoot_expected variable;
7329 logic changes accordingly. (Bug#9254) (Bug#9549)
7330
7331 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
7332 CHARPOS is covered by a display string which includes newlines.
7333 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
7334 is covered by a display string with embedded newlines.
7335
7336 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
7337
7338 * dbusbind.c (Fdbus_register_signal): Add match rule to
7339 Vdbus_registered_objects_table. (Bug#9581)
7340 (Fdbus_register_method, Vdbus_registered_objects_table):
7341 Fix docstring.
7342
7343 2011-09-24 Jim Meyering <meyering@redhat.com>
7344
7345 do not ignore write error for any output size
7346 The previous change was incomplete.
7347 While it makes emacs --batch detect the vast majority of stdout
7348 write failures, errors were still ignored whenever the output size is
7349 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
7350 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
7351 && echo FAIL: ignored write error
7352 FAIL: ignored write error
7353 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
7354 && echo FAIL: ignored write error
7355 FAIL: ignored write error
7356 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
7357
7358 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
7359
7360 * emacs.c (Fkill_emacs): In noninteractive mode exit
7361 non-successfully if a write error occurred on stdout. (Bug#9574)
7362
7363 2011-09-21 Eli Zaretskii <eliz@gnu.org>
7364
7365 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
7366 the xassert test.
7367
7368 * dispextern.h (struct it): Update the comment documenting what
7369 can it->OBJECT be.
7370
7371 2011-09-20 Eli Zaretskii <eliz@gnu.org>
7372
7373 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
7374 a display string, extend search for cursor position to end of row.
7375 (find_row_edges): If the row ends in a newline from a display
7376 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
7377 Handle the case of a display string with multiple newlines.
7378 (Fcurrent_bidi_paragraph_direction): Fix search for previous
7379 non-empty line. Fixes confusing cursor motion with arrow keys at
7380 the beginning of a line that starts with whitespace.
7381
7382 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7383
7384 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7385 (bug#9493).
7386
7387 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
7388
7389 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7390 boolean (Bug#9154).
7391
7392 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7393
7394 * xdisp.c (display_line): Record maximum and minimum buffer
7395 positions even if no glyphs were produced (e.g., by a zero-width
7396 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
7397 buffer positions that will be removed from the glyph row because
7398 they don't fit.
7399 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7400 column is beyond frame width: don't subtract 1 "pixel" when
7401 computing width of the stretch.
7402 (reseat_at_next_visible_line_start): Undo the change made on
7403 2011-09-17 that saved paragraph information and restored it after
7404 the call to `reseat'. (Bug#9545)
7405
7406 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7407
7408 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7409 and turn window cursor on if cleared (Bug#9415).
7410
7411 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
7412
7413 * search.c (boyer_moore): Take unibyte characters from pattern
7414 literally. (Bug#9458)
7415
7416 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7417
7418 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7419
7420 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
7421
7422 Fix minor problem found by static checking.
7423 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7424 initialized, to pacify gcc -Wuninitialized.
7425
7426 * fileio.c: Report proper errno when syscall falls.
7427 (Finsert_file_contents): Save and restore errno,
7428 so that report_file_error outputs the correct diagnostic.
7429 (Fwrite_region) [CLASH_DETECTION]: Likewise.
7430
7431 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7432
7433 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7434
7435 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7436
7437 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7438 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
7439
7440 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7441
7442 * xdisp.c (reseat_at_next_visible_line_start): Keep information
7443 about the current paragraph and restore it after the call to reseat.
7444
7445 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7446 (bidi_find_paragraph_start): Search back for paragraph beginning
7447 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7448 (bidi_move_to_visually_next): Only trigger paragraph-related
7449 computations when the last character is a newline or at EOB, not
7450 just any NEUTRAL_B. (Bug#9470)
7451
7452 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7453 truncated lines if point is covered by a display string. (Bug#9524)
7454
7455 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
7456
7457 * xselect.c: Relax test for outgoing X longs (Bug#9498).
7458 (cons_to_x_long): New function.
7459 (lisp_data_to_selection_data): Use it. Correct the test for
7460 short-versus-long data; it was negated. Break out of vector
7461 loop, for efficiency, when a long datum is discovered.
7462
7463 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
7464
7465 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7466
7467 2011-09-16 Eli Zaretskii <eliz@gnu.org>
7468
7469 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7470 GCC PR/17406) by declaring this function with external scope.
7471
7472 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7473
7474 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7475 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7476
7477 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
7478
7479 * editfns.c (Fformat): Correctly handle text properties on "%%".
7480
7481 2011-09-15 Eli Zaretskii <eliz@gnu.org>
7482
7483 * xterm.c (x_draw_composite_glyph_string_foreground):
7484 * w32term.c (x_draw_composite_glyph_string_foreground):
7485 * term.c (encode_terminal_code):
7486 * composite.c (composition_update_it, get_composition_id):
7487 * xdisp.c (get_next_display_element)
7488 (fill_composite_glyph_string): Add comments about special meaning
7489 of TAB characters in a composition.
7490
7491 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7492
7493 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
7494 This occurs when processing a multibyte format.
7495 Problem reported by Wolfgang Jenker.
7496
7497 2011-09-15 Johan Bockgård <bojohan@gnu.org>
7498
7499 * xdisp.c (try_cursor_movement): Only check for exact match if
7500 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
7501
7502 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 Remove unused external symbols.
7505 * dispextern.h (calc_pixel_width_or_height): Remove decl.
7506 * xdisp.c (calc_pixel_width_or_height): Now static.
7507 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7508 * indent.c (check_display_width):
7509 * w32term.c: Fix comment to match code.
7510 * xterm.c, xterm.h (x_catching_errors): Remove.
7511
7512 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7513
7514 * xselect.c: Use signed conversions more consistently (Bug#9498).
7515 (selection_data_to_lisp_data): Assume incoming selection data are
7516 signed integers, not unsigned. This is to be consistent with
7517 outgoing selection data, which was modified to use signed integers
7518 in as part of the fix to Bug#9196 in response to Jan D.'s comment
7519 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7520 expects long, not unsigned long.
7521
7522 2011-09-14 Eli Zaretskii <eliz@gnu.org>
7523
7524 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7525 computation of loop end. Reported by Johan Bockgård
7526 <bojohan@gnu.org>.
7527
7528 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
7529
7530 * frame.c (Fother_visible_frames_p): Function deleted.
7531
7532 2011-09-12 Eli Zaretskii <eliz@gnu.org>
7533
7534 * indent.c (compute_motion): Process display vector front to back
7535 rather than the other way around. (Bug#2496)
7536
7537 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7538
7539 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
7540
7541 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
7542
7543 * minibuf.c (Fread_from_minibuffer): Doc fix.
7544
7545 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7546
7547 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7548 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7549
7550 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7551
7552 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7553 value for non-existent files.
7554
7555 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7556
7557 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7558 set its "size" to -1. This will set the modtime_size field of
7559 the corresponding buffer to -1, which is what
7560 verify-visited-file-modtime expects for files that do not exist.
7561 (Bug#9139)
7562
7563 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7564
7565 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7566 here ...
7567 * lisp.h: ... from here. push_key_description is no longer
7568 defined in keyboard.c, so its declaration should not be in
7569 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7570 logically belongs with push_key_description.
7571
7572 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7573
7574 * buffer.h: Include <sys/types.h> instead of <time.h>.
7575 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7576 Problem reported by Herbert J. Skuhra.
7577
7578 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7579
7580 * xml.c (parse_region): Make the parsing work for
7581 non-comment-starting XML files again (bug#9144).
7582
7583 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7584
7585 * image.c (gif_load): Fix calculation of bottom and right corner.
7586 (Bug#9468)
7587
7588 2011-09-10 Eli Zaretskii <eliz@gnu.org>
7589
7590 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7591 redisplay in small windows.
7592
7593 2011-09-09 Eli Zaretskii <eliz@gnu.org>
7594
7595 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7596
7597 2011-09-08 Martin Rudalics <rudalics@gmx.at>
7598
7599 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7600 Operate on live windows only.
7601
7602 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
7603
7604 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7605
7606 2011-09-07 Eli Zaretskii <eliz@gnu.org>
7607
7608 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7609 only under bidi iteration.
7610
7611 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7612
7613 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7614
7615 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7616
7617 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7618 Without this fix, the command to link temacs failed due to an
7619 undefined symbol __builtin_isnan. This is because
7620 /usr/include/iso/math_c99.h #defines isnan(x) to
7621 __builtin_isnan(x), but the bundled gcc, which identifies itself
7622 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7623 a __builtin_isnan.
7624 * floatfns.c (isnan): #undef, and then #define to a clone of
7625 what's in data.c.
7626 (Fisnan): Always define, since it's always available now.
7627 (syms_of_floatfns): Always define isnan at the Lisp level.
7628
7629 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7630
7631 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7632
7633 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * fileio.c: Fix bugs with large file offsets (Bug#9428).
7636 The previous code assumed that file offsets (off_t values) fit in
7637 EMACS_INT variables, which is not true on typical 32-bit hosts.
7638 The code messed up by falsely reporting buffer overflow in cases
7639 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7640 when "big" contains more than 2**29 bytes, even though this
7641 inserts just one byte and does not overflow the buffer.
7642 (Finsert_file_contents): Store file offsets as off_t
7643 values, not as EMACS_INT values. Check for overflow when
7644 converting between EMACS_INT and off_t. When checking for
7645 buffer overflow or for overlap, take the offsets into account.
7646 Don't use EMACS_INT for small values where int suffices.
7647 When checking for overlap, fix a typo: ZV was used where
7648 ZV_BYTE was intended.
7649 (Fwrite_region): Don't assume off_t fits into 'long'.
7650 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7651
7652 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
7653
7654 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7655
7656 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7657
7658 sprintf-related integer and memory overflow issues (Bug#9412).
7659
7660 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
7661 (esprintf, exprintf, evxprintf): New functions.
7662 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
7663 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
7664 (modify_event_symbol): Do not assume that the length of
7665 name_alist_or_stem is safe to alloca and fits in int.
7666 (Fexecute_extended_command): Likewise for function name and binding.
7667 (Frecursion_depth): Wrap around reliably on integer overflow.
7668 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7669 since some callers pass EMACS_INT values.
7670 (Fsingle_key_description): Don't crash if symbol name contains more
7671 than MAX_ALLOCA bytes.
7672 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7673 (get_minibuffer): Arg is now EMACS_INT, not int.
7674 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
7675 (esprintf, exprintf, evxprintf): New decls.
7676 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7677
7678 * dbusbind.c (signature_cat): New function.
7679 (xd_signature, Fdbus_register_signal):
7680 Do not overrun buffer; instead, report string overflow.
7681
7682 * dispnew.c (add_window_display_history): Don't overrun buffer.
7683 Truncate instead; this is OK since it's just a log.
7684
7685 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7686 even if the time zone offset is outlandishly large.
7687 Don't mishandle offset == INT_MIN.
7688
7689 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7690 when creating daemon; the previous buffer-overflow check was incorrect.
7691
7692 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7693 which has the guts of the old verror function.
7694
7695 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7696 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7697
7698 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7699 (font_unparse_xlfd): Don't blindly alloca long strings.
7700 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
7701 fits in int, when using sprintf. Use single snprintf to count
7702 length of string rather than counting it via multiple sprintfs;
7703 that's simpler and more reliable.
7704 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7705 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7706 sprintf, in case result does not fit in int.
7707
7708 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7709 (fontset_from_font): Print it.
7710
7711 * frame.c (tty_frame_count): Now printmax_t, not int.
7712 (make_terminal_frame, set_term_frame_name): Print it.
7713 (x_report_frame_params): In X, window IDs are unsigned long,
7714 not signed long, so print them as unsigned.
7715 (validate_x_resource_name): Check for implausibly long names,
7716 and don't assume name length fits in 'int'.
7717 (x_get_resource_string): Don't blindly alloca invocation name;
7718 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7719 not fit in int.
7720
7721 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7722 (xg_check_special_colors, xg_set_geometry):
7723 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7724
7725 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7726 Use esprintf, not sprintf, in case result does not fit in int.
7727
7728 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7729 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7730 it as a large positive number.
7731 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7732 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7733
7734 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7735 in case result does not fit in int.
7736
7737 * print.c (float_to_string): Detect width overflow more reliably.
7738 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7739 buffer overrun. Don't assume list length fits in 'int'. Treat
7740 print length of 0 as 0, not as infinity; to be consistent with other
7741 uses of print length in this function. Don't overflow print length
7742 index. Don't assume hash table size fits in 'long', or that
7743 vectorlike size fits in 'unsigned long'.
7744
7745 * process.c (make_process): Use printmax_t, not int, to format
7746 process-name gensyms.
7747
7748 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7749
7750 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7751 to avoid potential buffer overrun.
7752
7753 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7754 if X resource line is longer than 512 bytes.
7755
7756 * xfns.c (x_window): Make sprintf buffer a bit bigger
7757 to avoid potential buffer overrun.
7758
7759 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7760
7761 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7762
7763 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7764
7765 Integer overflow fixes for scrolling, etc.
7766 Without these, Emacs silently mishandles large integers sometimes.
7767 For example, "C-u 4294967297 M-x recenter" was treated as if
7768 it were "C-u 1 M-x recenter" on a typical 64-bit host.
7769
7770 * xdisp.c (try_window_id): Check Emacs fixnum range before
7771 converting to 'int'.
7772
7773 * window.c (window_scroll_line_based, Frecenter):
7774 Check that an Emacs fixnum is in range before assigning it to 'int'.
7775 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
7776 values converted from Emacs fixnums.
7777 (Frecenter): Don't wrap around a line count if it is out of 'int'
7778 range; instead, treat it as an extreme value.
7779 (Fset_window_configuration, compare_window_configurations):
7780 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
7781
7782 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
7783 that can exceed INT_MAX. Check that EMACS_INT value is in range
7784 before assigning it to the (possibly-narrower) index.
7785 (match_limit): Don't assume that a fixnum can fit in 'int'.
7786
7787 * print.c (print_object): Use ptrdiff_t, not int, for index that can
7788 exceed INT_MAX.
7789
7790 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
7791 (Fvertical_motion): Don't wrap around LINES values that don't fit
7792 in 'int'. Instead, treat them as extreme values. This is good
7793 enough for windows, which can't have more than INT_MAX lines anyway.
7794
7795 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7796
7797 * Require libxml/parser.h to avoid compilation warning.
7798
7799 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
7800
7801 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
7802 since this reportedly can destroy thread storage.
7803
7804 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
7805
7806 * syntax.c (find_defun_start): Update all cache variables if
7807 exiting early (Bug#9401).
7808
7809 2011-08-30 Eli Zaretskii <eliz@gnu.org>
7810
7811 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
7812
7813 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
7814 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
7815 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
7816
7817 * term.c (tty_append_glyph): New function.
7818 (produce_stretch_glyph): Static function and its prototype deleted.
7819
7820 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
7821 Add prototypes.
7822
7823 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
7824
7825 * image.c (parse_image_spec): Check for nonnegative, not for positive,
7826 when checking :margin (Bug#9390).
7827 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
7828 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
7829 so that the name doesn't mislead. All uses changed.
7830
7831 2011-08-28 Johan Bockgård <bojohan@gnu.org>
7832
7833 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
7834 set_tty_hooks.
7835
7836 2011-08-27 Eli Zaretskii <eliz@gnu.org>
7837
7838 * xdisp.c (move_it_to): Don't bail out early when reaching
7839 position beyond to_charpos, if we are scanning backwards.
7840 (move_it_vertically_backward): When DY == 0, make sure we get to
7841 the first character in the line after the newline.
7842
7843 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
7844
7845 * ccl.c: Improve and simplify overflow checking (Bug#9196).
7846 (ccl_driver): Do not generate an out-of-range pointer.
7847 (Fccl_execute_on_string): Remove unnecessary check for
7848 integer overflow, noted by Stefan Monnier in
7849 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
7850 Remove a FIXME that didn't need fixing.
7851 Simplify the newly-introduced buffer reallocation code.
7852
7853 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
7854
7855 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
7856
7857 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
7858
7859 Integer and memory overflow issues (Bug#9196).
7860
7861 * doc.c (get_doc_string): Rework so that
7862 get_doc_string_buffer_size is the actual buffer size, rather than
7863 being 1 less than the actual buffer size; this makes xpalloc more
7864 convenient.
7865
7866 * image.c (x_allocate_bitmap_record, cache_image):
7867 * xselect.c (Fx_register_dnd_atom):
7868 Simplify previous changes by using xpalloc.
7869
7870 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
7871 since either will do and ptrdiff_t is convenient with xpalloc.
7872
7873 * charset.c (charset_table_size)
7874 (struct charset_sort_data.priority): Now ptrdiff_t.
7875 (charset_compare): Don't overflow if priorities differ greatly.
7876 (Fsort_charsets): Don't assume list length fits in int.
7877 Check for size-calculation overflow when allocating sort data.
7878 (syms_of_charset): Allocate an initial charset table that is
7879 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7880
7881 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7882
7883 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7884 The actual value is always <= INT_MAX, and leaving it unsigned made
7885 overflow checking harder.
7886
7887 * dispextern.h (struct glyph_matrix.rows_allocated)
7888 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7889 with xpalloc. The values are still always <= INT_MAX.
7890
7891 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7892
7893 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7894 (SAFE_NALLOCA): New macro.
7895
7896 * region-cache.c (struct boundary.pos, find_cache_boundary)
7897 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7898 (set_cache_region, invalidate_region_cache)
7899 (revalidate_region_cache, know_region_cache, region_cache_forward)
7900 (region_cache_backward, pp_cache):
7901 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7902 so that ptrdiff_t * can be passed to xpalloc.
7903 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7904 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7905 (pp_cache): Don't assume cache_len fits in int.
7906 * region-cache.h: Adjust extern decls to match.
7907
7908 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7909 EMACS_INT, since either will do, for xpalloc.
7910
7911 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7912 (xnmalloc, xnrealloc, xpalloc): New functions.
7913
7914 * bidi.c (bidi_shelve_header_size): New constant.
7915 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7916 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7917
7918 * bidi.c (bidi_cache_shrink):
7919 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7920 (overlay_strings):
7921 Don't update size of array until after memory allocation succeeds,
7922 because xmalloc/xrealloc may not return.
7923 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7924 now that we have proper integer overflow checking.
7925 (record_overlay_string, overlay_strings): Catch overflows when
7926 calculating size of overlay_str_buf.
7927
7928 * callproc.c (Fcall_process): Check for size overflow when
7929 calculating size of args2.
7930 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7931 Normally we prefer signed values, but sticking with ptrdiff_t would
7932 require adding more-complicated checks.
7933
7934 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7935 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7936 Redo buffer-overflow calculations to avoid integer overflow.
7937 Add a FIXME comment where memory seems to be over-allocated.
7938
7939 * character.c (Fstring): Check for size-calculation overflow.
7940
7941 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7942 unnecessary integer overflow. Check for size overflow.
7943 (encode_coding_object): Don't update size until xmalloc succeeds.
7944
7945 * composite.c (get_composition_id): Check for overflow in glyph
7946 length calculations.
7947
7948 Integer and memory overflow fixes for display code.
7949 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7950 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7951 (scrolling_window): Check for overflow in size calculations.
7952 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7953 Don't assume glyph table len fits in int.
7954 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7955 (row_table_size): Now ptrdiff_t, not int.
7956 (scrolling_window): Avoid overflow in size calculations.
7957 Don't update size until allocation succeeds.
7958 * fns.c (concat): Check for overflow in size calculations.
7959 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7960 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7961 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7962
7963 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7964 (get_doc_string): Check for size calculation overflow.
7965 Don't update size until allocation succeeds.
7966 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7967 EMACS_INT, where ptrdiff_t will do.
7968 (Fsubstitute_command_keys): Check for string overflow.
7969
7970 * editfns.c (set_time_zone_rule): Don't assume environment length
7971 fits in int.
7972 (message_length): Now ptrdiff_t, not int.
7973 (Fmessage_box): Don't update size until allocation succeeds.
7974 Don't assume message length fits in int.
7975 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7976
7977 * emacs.c (main): Do not reallocate argv, since there is a null at
7978 the end that can be overwritten, and this way there's no need to
7979 worry about size-calculation overflow.
7980 (sort_args): Check for size-calculation overflow.
7981
7982 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7983 alloc succeeds.
7984 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7985
7986 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7987 (x_set_scroll_bar_width, x_figure_window_size):
7988 Check for integer overflow.
7989 (x_set_alpha): Do not assume XINT fits in int.
7990
7991 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7992 This is for the members text_lines, text_cols, total_lines, total_cols,
7993 where the system imposes an 'int' limit.
7994
7995 * fringe.c (Fdefine_fringe_bitmap):
7996 Don't update size until alloc works.
7997
7998 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7999 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
8000
8001 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
8002 Check for size-calculation overflow.
8003 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
8004 do, as we prefer signed integers.
8005 (id_to_widget.max_size, id_to_widget.used)
8006 (xg_store_widget_in_map, xg_remove_widget_from_map)
8007 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
8008 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
8009 Use and return ptrdiff_t, not int.
8010 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
8011 * gtkutil.h: Change prototypes to match the above.
8012
8013 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
8014 are duplicate now that they've been promoted to lisp.h.
8015 (x_allocate_bitmap_record, x_alloc_image_color)
8016 (make_image_cache, cache_image, xpm_load):
8017 Don't update size until alloc is done.
8018 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
8019 (x_detect_edges):
8020 Check for size calculation overflow.
8021 (ct_colors_allocated_max): New constant.
8022 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
8023 overflow.
8024
8025 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
8026 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
8027 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
8028 Use ptrdiff_t, not int, to count maps.
8029 (read_char_minibuf_menu_prompt): Check for overflow in size
8030 calculations. Don't update size until allocation succeeds.
8031 Redo calculations to avoid overflow.
8032 * keyboard.h: Change prototypes to match the above.
8033
8034 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
8035 to count maps.
8036 (current_minor_maps): Check for size calculation overflow.
8037 * keymap.h: Change prototypes to match the above.
8038
8039 * lread.c (read1, init_obarray): Don't update size until alloc done.
8040
8041 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
8042 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
8043
8044 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
8045 Now ptrdiff_t, not int.
8046 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
8047 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
8048
8049 * process.c (Fnetwork_interface_list): Check for overflow
8050 in size calculation.
8051
8052 * region-cache.c (move_cache_gap): Check for size calculation overflow.
8053
8054 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
8055 overflow. Don't bother calling xmalloc when xrealloc will do.
8056
8057 * search.c (Freplace_match): Check for size calculation overflow.
8058 (Fset_match_data): Don't assume list lengths fit in 'int'.
8059
8060 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
8061 for command line length. Do not attempt to address one before the
8062 beginning of an array, as that's not portable.
8063
8064 * term.c (max_frame_lines): Remove; unused.
8065 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
8066 not int.
8067 (encode_terminal_code, calculate_costs): Check for size
8068 calculation overflow.
8069 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
8070 table lengths and related sizes. Don't update size until alloc
8071 done. Redo calculations to avoid overflow.
8072 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
8073
8074 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
8075 subtracting pointers.
8076 (gobble_line): Check for overflow more carefully. Don't update size
8077 until alloc done.
8078
8079 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
8080 Don't update size until alloc done.
8081 Redo size calculations to avoid overflow.
8082 Check for size calculation overflow.
8083 (main) [DEBUG]: Fix typo in invoking tparam1.
8084
8085 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
8086 Use ptrdiff_t, not int, for sizes.
8087 (store_mode_line_noprop_char): Don't update size until alloc done.
8088
8089 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
8090 Use ptrdiff_t, not int, for sizes.
8091 (Finternal_make_lisp_face, cache_face):
8092 Check for size calculation overflow.
8093 (cache_face): Treat size calculation overflows as if they were
8094 memory exhaustion (the usual treatment), rather than aborting.
8095
8096 * xfns.c (x_encode_text, x_set_name_internal)
8097 (Fx_change_window_property): Use ptrdiff_t, not int, to count
8098 sizes, since they can exceed INT_MAX in size. Check for size
8099 calculation overflow.
8100
8101 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
8102 (xg_select): Check for size calculation overflow.
8103 Don't update size until alloc done.
8104
8105 * xrdb.c (get_environ_db): Don't assume path length fits in int,
8106 as sprintf is limited to int lengths.
8107
8108 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
8109 (X_LONG_MIN): New macros.
8110 Use them to make the following changes clearer.
8111 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
8112 This change doesn't affect the value now, but it may help remind
8113 future maintainers not to raise the value too much later.
8114 (SELECTION_QUANTUM): Remove, replacing with ...
8115 (selection_quantum): ... new function, which avoids overflow.
8116 All uses changed.
8117 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
8118 assumption that selection length fits in 'int'.
8119 (x_reply_selection_request, x_handle_selection_request)
8120 (x_get_window_property, receive_incremental_selection)
8121 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
8122 (lisp_data_to_selection_data, clean_local_selection_data):
8123 Use ptrdiff_t, not int, to record length of selection.
8124 (x_reply_selection_request, x_get_window_property)
8125 (receive_incremental_selection, x_property_data_to_lisp):
8126 Redo calculations to avoid overflow.
8127 (x_reply_selection_request): When sending hint, ceiling it at
8128 X_LONG_MAX rather than relying on wraparound overflow to send
8129 something.
8130 (x_get_window_property, receive_incremental_selection)
8131 (lisp_data_to_selection_data, x_property_data_to_lisp):
8132 Check for size-calculation overflow.
8133 (x_get_window_property, receive_incremental_selection)
8134 (lisp_data_to_selection_data, Fx_register_dnd_atom):
8135 Don't store size until memory allocation succeeds.
8136 (x_get_window_property): Plug memory leak on memory exhaustion.
8137 Don't double-block input; malloc is safe here. Don't assume 2**34
8138 - 4 fits in unsigned long. Add an xassert to check
8139 XGetWindowProperty overflow. Be more careful about overflow
8140 calculations, and distinguish size from memory overflow better.
8141 (receive_incremental_selection): When tracing, don't assume
8142 unsigned int is less than INT_MAX.
8143 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
8144 harmful) conversions of unsigned short to int.
8145 (lisp_data_to_selection_data): Don't assume that integers
8146 in the range -65535 through -1 fit in an X unsigned short.
8147 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
8148 result parameters unless successful. Rely on cons_to_unsigned
8149 to report problems with elements; the old code wasn't right anyway.
8150 (x_check_property_data): Check for int overflow; we cannot use
8151 a wider type due to X limits.
8152 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
8153
8154 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
8155
8156 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
8157 (x_term_init): Check for size calculation overflow.
8158 (x_color_cells): Don't store size until memory allocation succeeds.
8159 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
8160 Don't assume alloca size is less than MAX_ALLOCA.
8161 (x_term_init): Don't assume length fits in int (sprintf is limited
8162 to int size).
8163
8164 Use ptrdiff_t for composition IDs.
8165 * character.c (lisp_string_width):
8166 * composite.c (composition_table_size, n_compositions)
8167 (get_composition_id, composition_gstring_from_id):
8168 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
8169 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
8170 * window.c (Frecenter):
8171 Use ptrdiff_t, not int, for composition IDs.
8172 * composite.c (get_composition_id): Check for integer overflow.
8173 * composite.h: Adjust prototypes to match the above changes.
8174
8175 Use ptrdiff_t for hash table indexes.
8176 * category.c (hash_get_category_set):
8177 * ccl.c (ccl_driver):
8178 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
8179 * coding.c (coding_system_charset_list, detect_coding_system):
8180 * coding.h (struct coding_system.id):
8181 * composite.c (get_composition_id, gstring_lookup_cache):
8182 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
8183 * image.c (xpm_get_color_table_h):
8184 * lisp.h (hash_lookup, hash_put):
8185 * minibuf.c (Ftest_completion):
8186 Use ptrdiff_t for hash table indexes, not int (which is too
8187 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
8188 32-bit --with-wide-int hosts).
8189
8190 * charset.c (Fdefine_charset_internal): Check for integer overflow.
8191 Add a FIXME comment about memory leaks.
8192 (syms_of_charset): Don't assume xmalloc returns.
8193
8194 Don't assume that stated character widths fit in int.
8195 * character.c (Fchar_width, c_string_width, lisp_string_width):
8196 * character.h (CHAR_WIDTH):
8197 * indent.c (MULTIBYTE_BYTES_WIDTH):
8198 Use sanitize_char_width to avoid undefined and/or bad behavior
8199 with outlandish widths.
8200 * character.h (sanitize_tab_width): Rename from sanitize_width,
8201 now that we have two such functions. All uses changed.
8202 (sanitize_char_width): New inline function.
8203
8204 Don't assume that tab-width fits in int.
8205 * character.h (sanitize_width): New inline function.
8206 (SANE_TAB_WIDTH): New macro.
8207 (ASCII_CHAR_WIDTH): Use it.
8208 * indent.c (sane_tab_width): Remove. All uses replaced by
8209 SANE_TAB_WIDTH (current_buffer).
8210 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
8211
8212 * fileio.c: Integer overflow issues with file modes.
8213 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
8214
8215 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
8216 Remove unreachable code.
8217 (read_hex, load_charset_map_from_file): Check for integer overflow.
8218
8219 * xterm.c: Don't go over XClientMessageEvent limit.
8220 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
8221 (x_send_scroll_bar_event): Likewise. Check that the size does not
8222 exceed limits imposed by XClientMessageEvent, as well as the usual
8223 ptrdiff_t and size_t limits.
8224
8225 * keyboard.c: Overflow, signedness and related fixes.
8226 (make_lispy_movement): Use same integer type in forward decl
8227 that is used in the definition.
8228 (read_key_sequence, keyremap_step):
8229 Change bufsize argument back to int, undoing my 2011-03-30 change.
8230 We prefer signed types, and int is wide enough here.
8231 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
8232 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
8233 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
8234 length, not size_t. Use ptrdiff_t for index, not int.
8235 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
8236 possibility of integer overflow.
8237
8238 Overflow, signedness and related fixes for images.
8239
8240 * dispextern.h (struct it.stack[0].u.image.image_id)
8241 (struct_it.image_id, struct image.id, struct image_cache.size)
8242 (struct image_cache.used, struct image_cache.ref_count):
8243 * gtkutil.c (update_frame_tool_bar):
8244 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
8245 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
8246 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
8247 * nsmenu.m (update_frame_tool_bar):
8248 * xdisp.c (calc_pixel_width_or_height):
8249 * xfns.c (image_cache_refcount):
8250 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
8251 on typical 64-bit hosts.
8252
8253 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8254 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
8255 Omit unnecessary casts to int.
8256 (parse_image_spec): Check that integers fall into 'int' range
8257 when the callers expect that.
8258 (image_ascent): Redo ascent calculation to avoid int overflow.
8259 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
8260 (lookup_image): Remove unnecessary tests.
8261 (xbm_image_p): Locals are now of int, not EMACS_INT,
8262 since parse_image_check makes sure they fit into int.
8263 (png_load, gif_load, svg_load_image):
8264 Prefer int to unsigned where either will do.
8265 (tiff_handler): New function, combining the cores of the
8266 old tiff_error_handler and tiff_warning_handler.
8267 This function is rewritten to use vsnprintf and thereby avoid
8268 stack buffer overflows. It uses only the features of vsnprintf
8269 that are common to both POSIX and native Microsoft.
8270 (tiff_error_handler, tiff_warning_handler): Use it.
8271 (tiff_load, gif_load, imagemagick_load_image):
8272 Don't assume :index value fits in 'int'.
8273 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
8274 (imagemagick_load_image): Check that crop parameters fit into
8275 the integer types that MagickCropImage accepts. Don't assume
8276 Vimagemagick_render_type has a nonnegative value. Don't assume
8277 size_t fits in 'long'.
8278 (gs_load): Use printmax_t to print the widest integers possible.
8279 Check for integer overflow when computing image height and width.
8280
8281 2011-08-26 Eli Zaretskii <eliz@gnu.org>
8282
8283 * xdisp.c (redisplay_window): Don't force window start if point
8284 will be invisible in the resulting window. (Bug#9324)
8285
8286 2011-08-25 Eli Zaretskii <eliz@gnu.org>
8287
8288 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
8289 the display spec is of the form `(space ...)'.
8290 (handle_display_spec): Return the value returned by
8291 handle_single_display_spec, not just 1 or zero.
8292 (handle_single_display_spec): If the display spec is of the form
8293 `(space ...)', and specifies display in the text area, return 2
8294 rather than 1.
8295 (try_cursor_movement): Check for the need to scroll more
8296 accurately, and prefer exact match for point under bidi.
8297 Don't advance `row' beyond the last row of the window.
8298
8299 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
8300 into disp_prop; all users changed.
8301
8302 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
8303 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
8304 for the text covered by the display property.
8305
8306 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
8307
8308 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
8309 Change return value to nil.
8310 (Frecord_buffer): Delete unused function.
8311
8312 2011-08-24 Eli Zaretskii <eliz@gnu.org>
8313
8314 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
8315 buffers, return left-to-right.
8316 (set_cursor_from_row): Consider candidate row a win if its glyph
8317 represents a newline and point is on that newline. Fixes cursor
8318 positioning on the newline at EOL of R2L text within L2R
8319 paragraph, and vice versa.
8320 (try_cursor_movement): Check continued rows, in addition to
8321 continuation rows. Fixes unwarranted scroll when point enters a
8322 continued line of R2L text within an L2R paragraph, or vice versa.
8323 (cursor_row_p): Consider the case of point being equal to
8324 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
8325 from the end of a short line to the beginning of a continued line
8326 of R2L text within L2R paragraph.
8327 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
8328 composed characters.
8329
8330 * bidi.c (bidi_check_type): Use xassert.
8331 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
8332 members.
8333
8334 2011-08-23 Eli Zaretskii <eliz@gnu.org>
8335
8336 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
8337 a character.
8338
8339 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
8340
8341 * nsfont.m (ns_otf_to_script): Fix typo.
8342
8343 2011-08-22 Kenichi Handa <handa@m17n.org>
8344
8345 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
8346 extra slot even if the purpose is char-code-property-table.
8347
8348 2011-08-23 Eli Zaretskii <eliz@gnu.org>
8349
8350 * xdisp.c (redisplay_window): When computing centering_position,
8351 account for the height of the header line. (Bug#8874)
8352
8353 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
8354 instead of CHAR_TO_BYTE. Fixes a crash when a completion
8355 candidate is selected by the mouse, and that candidate has a
8356 composed character under the mouse.
8357
8358 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
8359 coordinates reported by pos-visible-in-window-p for a composed
8360 character in column zero.
8361
8362 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
8363
8364 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
8365
8366 2011-08-22 Eli Zaretskii <eliz@gnu.org>
8367
8368 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
8369 consider it a hit if to_charpos is anywhere in the range of the
8370 composed buffer positions.
8371
8372 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
8373
8374 * image.c (gif_load): Don't assume that each subimage has the same
8375 dimensions as the base image. Handle disposal method that is
8376 "undefined" by the gif spec (Bug#9335).
8377
8378 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
8379
8380 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
8381 (Fcondition_case): Document `debug' symbol in error handler.
8382
8383 2011-08-19 Eli Zaretskii <eliz@gnu.org>
8384
8385 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8386 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8387 from an Org mode buffer to a Speedbar frame.
8388
8389 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8390 a composition, take its buffer position from IT->cmp_it.charpos.
8391 Fixes cursor positioning at the beginning of a line that begins
8392 with a composed character.
8393
8394 2011-08-18 Eli Zaretskii <eliz@gnu.org>
8395
8396 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8397 character bidirectional type, use STRONG_L instead. Fixes crashes
8398 in a buffer produced by `describe-categories'.
8399
8400 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8401 members before the level stack, so they would be saved and
8402 restored when copying iterator state. Fixes incorrect reordering
8403 around TABs covered by display properties.
8404
8405 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
8406
8407 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
8408
8409 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
8410
8411 * eval.c (internal_condition_case, internal_condition_case_1)
8412 (internal_condition_case_2, internal_condition_case_n):
8413 Remove unnecessary aborts (Bug#9081).
8414
8415 2011-08-17 Eli Zaretskii <eliz@gnu.org>
8416
8417 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8418 has no `load' handler, try opening the file locally. (Bug#9311)
8419
8420 2011-08-16 Ken Brown <kbrown@cornell.edu>
8421
8422 * gmalloc.c: Expand comment.
8423
8424 2011-08-16 Eli Zaretskii <eliz@gnu.org>
8425
8426 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8427 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
8428
8429 2011-08-16 Ken Brown <kbrown@cornell.edu>
8430
8431 Fix memory allocation problems in Cygwin build (Bug#9273).
8432
8433 * unexcw.c ( __malloc_initialized): Declare external variable.
8434 (fixup_executable): Force the dumped emacs to reinitialize malloc.
8435
8436 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8437 New variables.
8438 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8439 dumped emacs.
8440 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8441 in the static heap.
8442 [CYGWIN] (special_realloc): New function.
8443 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8444 requests to realloc storage in the static heap.
8445
8446 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
8447
8448 * bidi.c (bidi_initialize): Remove unused local.
8449
8450 2011-08-15 Eli Zaretskii <eliz@gnu.org>
8451
8452 * bidimirror.h:
8453 * biditype.h: Remove file.
8454 * makefile.w32-in ($(BLD)/bidi.$(O)):
8455 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
8456
8457 * dispextern.h: Fix a typo in the comment to bidi_type_t.
8458
8459 * chartab.c: Improve commentary for the uniprop_table API.
8460
8461 * bidi.c (bidi_paragraph_init): Support zero value of
8462 bidi_ignore_explicit_marks_for_paragraph_level.
8463 (bidi_initialize): Use uniprop_table instead of including
8464 biditype.h and bidimirror.h.
8465
8466 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8467 coordinates of the iterator when restoring from ppos_it.
8468 (Bug#9296)
8469
8470 2011-08-14 Kenichi Handa <handa@m17n.org>
8471
8472 * process.c (create_process): Call setup_process_coding_systems
8473 after the pid of the process is set to -1 (Bug#8162).
8474
8475 2011-08-14 Eli Zaretskii <eliz@gnu.org>
8476
8477 * xdisp.c (move_it_in_display_line_to): Don't invoke
8478 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8479 ppos_it. Fixes vertical cursor motion when line beginning is
8480 covered by an image. (Bug#9296)
8481
8482 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
8483
8484 * nsterm.h (ns_run_ascript): Declare.
8485 (NSAPP_DATA2_RUNASSCRIPT): Define.
8486
8487 * nsfns.m (as_script, as_result, as_status): New static variables.
8488 (ns_run_ascript): New function.
8489 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
8490 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8491 the event loop. Get status from as_status (Bug#7276).
8492
8493 * nsterm.m (sendEvent): If event is NSApplicationDefined and
8494 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8495 the event loop (Bug#7276).
8496
8497 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
8498
8499 * gnutls.c (QCgnutls_bootprop_priority)
8500 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8501 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8502 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8503 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8504 (QCgnutls_bootprop_verify_hostname_error)
8505 (QCgnutls_bootprop_callbacks_verify): Rename from
8506 Qgnutls_bootprop_..., all uses changed.
8507
8508 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8509 uses changed.
8510
8511 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
8512
8513 * xfaces.c (Qframe_set_background_mode): Now static.
8514 * dispextern.h (Qframe_set_background_mode): Remove decl.
8515
8516 * process.c (Fnetwork_interface_info): Declare local only if needed.
8517
8518 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
8519
8520 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8521 (Fnetwork_interface_list): Allocate in increments of bytes instead
8522 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
8523 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
8524 sockaddr.
8525 (struct ifflag_def): notrailers is smart on OSX.
8526 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
8527 Get hardware address with getifaddrs if available.
8528
8529 2011-08-12 Eli Zaretskii <eliz@gnu.org>
8530
8531 * xdisp.c (iterate_out_of_display_property): xassert that
8532 IT->position is set to within IT->object's boundaries. Break from
8533 the loop as soon as EOB is reached; avoids infloops in redisplay
8534 when IT->position is set up wrongly due to some bug.
8535 Set IT->current to match the bidi iterator unconditionally.
8536 (push_display_prop): Allow GET_FROM_STRING as IT->method on
8537 entry. Force push_it to save on the stack the current
8538 buffer/string position, to be restored by pop_it. Fix flags in
8539 the iterator structure wrt the object coming from a display
8540 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
8541 properties. (Bug#9284)
8542
8543 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
8544
8545 * fontset.c (fontset_get_font_group): Add proper type checks.
8546 (Bug#9172)
8547
8548 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8549
8550 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8551 and LC_VERSION_MIN_MACOSX.
8552 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8553 (dump_it) [LC_FUNCTION_STARTS]: Use it.
8554
8555 2011-08-08 Eli Zaretskii <eliz@gnu.org>
8556
8557 * xdisp.c (forward_to_next_line_start): Allow to use the
8558 no-display-properties-and-no-overlays under bidi display.
8559 Set disp_pos in the bidi iterator to avoid searches for display
8560 properties and overlays.
8561
8562 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
8563
8564 * editfns.c (Fset_time_zone_rule): Document relationship with the
8565 setenv function.
8566
8567 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8568 the font entity extracted from the cache (Bug#8109).
8569
8570 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
8571
8572 * composite.c (autocmp_chars): Don't reset point. That is done by
8573 restore_point_unwind (Bug#5984).
8574
8575 2011-08-07 Juri Linkov <juri@jurta.org>
8576
8577 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8578 to show the arg `TIME' instead of `TIMEVAL'.
8579
8580 2011-08-06 Eli Zaretskii <eliz@gnu.org>
8581
8582 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8583 display property strides EOL and includes a newline, as in
8584 longlines-mode. (Bug#9254)
8585 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8586 word-wrap under bidirectional display. (Bug#9224)
8587
8588 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8589 is non-zero, even if the data buffer is NULL. Fixes a crash in
8590 vertical-motion with longlines-mode. (Bug#9254)
8591
8592 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8593
8594 * bidi.c <bidi_cache_total_alloc>: Now static.
8595 (bidi_initialize): Initialize bidi_cache_total_alloc.
8596
8597 * xdisp.c (display_line): Release buffer allocated for shelved bidi
8598 cache. (Bug#9221)
8599
8600 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8601 amount allocated this far in `bidi_cache_total_alloc'.
8602 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8603 non-zero, only free the data buffer without restoring the cache
8604 contents. All callers changed.
8605
8606 * dispextern.h (bidi_unshelve_cache): Update prototype.
8607
8608 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8609 (move_it_in_display_line, move_it_to)
8610 (move_it_vertically_backward, move_it_by_lines): Replace the call
8611 to xfree to an equivalent call to bidi_unshelve_cache.
8612 (move_it_in_display_line_to): Fix logic of returning
8613 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
8614
8615 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8616
8617 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8618 came from a string character with a `cursor' property. (Bug#9229)
8619
8620 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8621
8622 * Makefile.in (LIB_PTHREAD): New variable.
8623 (LIBES): Add LIB_PTHREAD (Bug#9216).
8624
8625 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8626 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8627
8628 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8629
8630 * regex.c (re_iswctype): Remove some redundant boolean conversions.
8631
8632 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8633
8634 * xterm.c (x_find_topmost_parent): New function.
8635 (x_set_frame_alpha): Find topmost parent window with
8636 x_find_topmost_parent and set the property there also (bug#9181).
8637 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8638
8639 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 * callproc.c (Fcall_process): Avoid vfork clobbering
8642 the local vars buffer, coding_systems, current_dir.
8643
8644 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8645
8646 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8647
8648 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8649
8650 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8651 so that it is not optimized away.
8652
8653 * xdisp.c (compute_display_string_pos): Remove unused local.
8654
8655 2011-08-02 Eli Zaretskii <eliz@gnu.org>
8656
8657 Fix slow cursor motion and scrolling in large buffers with
8658 selective display, like Org Mode buffers. (Bug#9218)
8659
8660 * dispextern.h (struct bidi_it): New member disp_prop_p.
8661
8662 * xdisp.c: Remove one-slot cache of display string positions.
8663 (compute_display_string_pos): Accept an additional argument
8664 DISP_PROP_P; callers changed. Scan at most 5K characters forward
8665 for a display string or property. If found, set DISP_PROP_P
8666 non-zero.
8667
8668 * bidi.c (bidi_fetch_char): Accept an additional argument
8669 DISP_PROP_P, and pass it to compute_display_string_pos.
8670 Only handle text covered by a display string if DISP_PROP_P is returned
8671 non-zero. All callers of bidi_fetch_char changed.
8672
8673 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8674
8675 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8676
8677 2010-12-03 Don March <don@ohspite.net>
8678
8679 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8680 last character M-[char] is translated to ESC [char] (bug#7541).
8681
8682 2011-08-02 Kenichi Handa <handa@m17n.org>
8683
8684 * lisp.h (uniprop_table): Extern it.
8685
8686 * chartab.c (uniprop_table): Make it non-static.
8687
8688 2011-08-01 Eli Zaretskii <eliz@gnu.org>
8689
8690 * xdisp.c (forward_to_next_line_start): Accept additional argument
8691 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8692 on the newline.
8693 (reseat_at_next_visible_line_start): Use the bidi iterator state
8694 returned by forward_to_next_line_start to restore the state of
8695 it->bidi_it after backing up to previous newline. (Bug#9212)
8696
8697 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8698
8699 * regex.c (re_comp): Protoize.
8700 (re_exec): Fix return type.
8701 (regexec): Fix type of `ret'. (Bug#9203)
8702
8703 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8704
8705 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8706 This is needed if max-image-size is a floating-point number.
8707
8708 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8709
8710 * print.c (print_object): Print empty symbol as ##.
8711
8712 * lread.c (read1): Read ## as empty symbol.
8713
8714 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8715
8716 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8717 setting frame foreground color (Bug#9175).
8718 (x_set_background_color): Likewise.
8719
8720 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8721 contents (Bug#9176).
8722 (EmacsTooltip -init): Remove bezels and add shadows to
8723 tooltip windows.
8724
8725 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8726 or scroll bar (Bug#8470).
8727
8728 * nsfont.m (nsfont_open): Remove assignment to voffset and
8729 unnecessary vars hshink, expand, hd, full_height, min_height.
8730 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8731
8732 * nsterm.h (nsfont_info): Remove voffset field.
8733
8734 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8735
8736 Implement strike-through and overline on NextStep (Bug#8863).
8737
8738 * nsfont.m (nsfont_open): Use underline position provided by font,
8739 instead of hard-coded value of 2.
8740 (nsfont_draw): Call ns_draw_text_decoration instead.
8741
8742 * nsterm.h: Add declaration for ns_draw_text_decoration.
8743
8744 * nsterm.m (ns_draw_text_decoration): New function for drawing
8745 underline, overline, and strike-through.
8746 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8747 ns_draw_text_decoration. Change treatment of cursor drawing to
8748 accommodate underlining, etc.
8749
8750 2011-07-28 Eli Zaretskii <eliz@gnu.org>
8751
8752 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8753 default.
8754
8755 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8756
8757 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8758 Without this fix, if a signal arrives just after memory fills up,
8759 'malloc' might be invoked reentrantly.
8760
8761 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8762 In other words, assume that every image size is allowed, on non-X
8763 hosts. This assumption is probably wrong, but it lets Emacs compile.
8764
8765 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8766
8767 * regex.c (re_iswctype): Convert return values to boolean.
8768
8769 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
8770
8771 * xdisp.c (compute_display_string_pos): Don't use cached display
8772 string position if the buffer had its restriction changed.
8773 (Bug#9184)
8774
8775 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8776
8777 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8778
8779 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8780
8781 Integer signedness and overflow and related fixes. (Bug#9079)
8782
8783 * bidi.c: Integer size and overflow fixes.
8784 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
8785 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
8786 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8787 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
8788 (bidi_find_other_level_edge):
8789 Use ptrdiff_t instead of EMACS_INT where either will do.
8790 This works better on 32-bit hosts configured --with-wide-int.
8791 (bidi_cache_ensure_space): Check for size-calculation overflow.
8792 Use % rather than repeated addition, for better worst-case speed.
8793 Don't set bidi_cache_size until after xrealloc returns, because it
8794 might not return.
8795 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
8796 (bidi_cache_ensure_space): Also check that the bidi cache size
8797 does not exceed that of the largest Lisp string or buffer. See Eli
8798 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
8799
8800 * alloc.c (__malloc_size_t): Remove.
8801 All uses replaced by size_t. See Andreas Schwab's note
8802 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
8803
8804 * image.c: Improve checking for integer overflow.
8805 (check_image_size): Assume that f is nonnull, since
8806 it is always nonnull in practice. This is one less thing to
8807 worry about when checking for integer overflow later.
8808 (x_check_image_size): New function, which checks for integer
8809 overflow issues inside X.
8810 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
8811 This removes the need for a memory_full check.
8812 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
8813 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
8814 (xbm_read_bitmap_data): Change locals back to 'int', since
8815 their values must fit in 'int'.
8816 (xpm_load_image, png_load, tiff_load):
8817 Invoke x_create_x_image_and_pixmap earlier,
8818 to avoid much needless work if the image is too large.
8819 (tiff_load): Treat overly large images as if
8820 x_create_x_image_and_pixmap failed, not as malloc failures.
8821 (gs_load): Use x_check_image_size.
8822
8823 * gtkutil.c: Omit integer casts.
8824 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
8825 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
8826
8827 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
8828
8829 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
8830 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
8831 would wrongly return t on a 64-bit host.
8832
8833 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
8834 The plain *_OVERFLOW macros run afoul of GCC bug 49705
8835 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
8836 and therefore cause GCC to emit a bogus diagnostic in some cases.
8837
8838 * image.c: Integer signedness and overflow and related fixes.
8839 This is not an exhaustive set of fixes, but it's time to
8840 record what I've got.
8841 (lookup_pixel_color, check_image_size): Remove redundant decls.
8842 (check_image_size): Don't assume that arbitrary EMACS_INT values
8843 fit in 'int', or that arbitrary 'double' values fit in 'int'.
8844 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
8845 (tiff_load, imagemagick_load_image):
8846 Check for overflow in size calculations.
8847 (x_create_x_image_and_pixmap): Remove unnecessary test for
8848 xmalloc returning NULL; that can't happen.
8849 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
8850 (xpm_color_bucket): Use better integer hashing function.
8851 (xpm_cache_color): Don't possibly over-allocate memory.
8852 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
8853 (gif_memory_source):
8854 Use ptrdiff_t, not int or size_t, to record sizes.
8855 (png_load): Don't assume values greater than 2**31 fit in 'int'.
8856 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
8857 either works, as we prefer signed integers.
8858 (tiff_read_from_memory, tiff_write_from_memory):
8859 Return tsize_t, not size_t, since that's what the TIFF API wants.
8860 (tiff_read_from_memory): Don't fail simply because the read would
8861 go past EOF; instead, return a short read.
8862 (tiff_load): Omit no-longer-needed casts.
8863 (Fimagemagick_types): Don't assume size fits into 'int'.
8864
8865 Improve hashing quality when configured --with-wide-int.
8866 * fns.c (hash_string): New function, taken from sxhash_string.
8867 Do not discard information about ASCII character case; this
8868 discarding is no longer needed.
8869 (sxhash-string): Use it. Change sig to match it. Caller changed.
8870 * lisp.h: Declare it.
8871 * lread.c (hash_string): Remove, since we now use fns.c's version.
8872 The fns.c version returns a wider integer if --with-wide-int is
8873 specified, so this should help the quality of the hashing a bit.
8874
8875 * emacs.c: Integer overflow minor fix.
8876 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8877 Define only if GNU_LINUX.
8878 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8879
8880 * dispnew.c: Integer signedness and overflow fixes.
8881 Remove unnecessary forward decls, that were a maintenance hassle.
8882 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8883 All uses changed.
8884 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8885 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8886 (prepare_desired_row, line_draw_cost):
8887 Use int, not unsigned, where either works.
8888 (save_current_matrix, restore_current_matrix):
8889 Use ptrdiff_t, not size_t, where either works.
8890 (init_display): Check for overflow more accurately, and without
8891 relying on undefined behavior.
8892
8893 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8894 Remove, replacing with the new symbols in lisp.h. All uses changed.
8895 * fileio.c (make_temp_name):
8896 * filelock.c (lock_file_1, lock_file):
8897 * xdisp.c (message_dolog):
8898 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8899 Use pMd etc. instead.
8900 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8901 replacing the pWIDE etc. symbols removed from editfns.c.
8902
8903 * keyboard.h (num_input_events): Now uintmax_t.
8904 This is (very slightly) less likely to mess up due to wraparound.
8905 All uses changed.
8906
8907 * buffer.c: Integer signedness fixes.
8908 (alloc_buffer_text, enlarge_buffer_text):
8909 Use ptrdiff_t rather than size_t when either will do, as we prefer
8910 signed integers.
8911
8912 * alloc.c: Integer signedness and overflow fixes.
8913 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8914 (__malloc_size_t): Default to size_t, not to int.
8915 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8916 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8917 Prefer ptrdiff_t to size_t when either would do, as we prefer
8918 signed integers.
8919 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8920 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8921 Now const. Initialize with values that are in range even if char
8922 is signed.
8923 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8924 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8925 These functions do the right thing with sizes > 2**32.
8926 (check_depth): Now ptrdiff_t, not int.
8927 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8928 Adjust to new way of storing sizes. Check for size overflow bugs
8929 in rest of code.
8930 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8931 slightly wrong anyway, as it missed one instance of
8932 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8933 (refill_memory_reserve): Omit needless cast to size_t.
8934 (mark_object_loop_halt): Mark as externally visible.
8935
8936 * xselect.c: Integer signedness and overflow fixes.
8937 (Fx_register_dnd_atom, x_handle_dnd_message):
8938 Use ptrdiff_t, not size_t, since we prefer signed.
8939 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8940 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8941 x_dnd_atoms_size and x_dnd_atoms_length.
8942
8943 * doprnt.c: Prefer signed to unsigned when either works.
8944 * eval.c (verror):
8945 * doprnt.c (doprnt):
8946 * lisp.h (doprnt):
8947 * xdisp.c (vmessage):
8948 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8949 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8950 prefer signed arithmetic to avoid comparison confusion.
8951 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8952 but is a bit tricky.
8953
8954 Assume freestanding C89 headers, string.h, stdlib.h.
8955 * data.c, doprnt.c, floatfns.c, print.c:
8956 Include float.h unconditionally.
8957 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8958 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8959 * regex.c: Likewise for stddef.h, string.h.
8960 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8961 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8962 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8963 (STDC_HEADERS): Remove obsolete defines.
8964 * sysdep.c: Include limits.h unconditionally.
8965
8966 Assume support for memcmp, memcpy, memmove, memset.
8967 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8968 * regex.c (memcmp, memcpy):
8969 Remove; we assume C89 now.
8970
8971 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8972 (__malloc_safe_bcopy): Remove; no longer needed.
8973
8974 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
8975 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8976 well either way, and we prefer signed to unsigned.
8977
8978 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8979
8980 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8981 closes the connection while we're reading (bug#9182).
8982
8983 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
8984
8985 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8986 are specified (Bug#9168).
8987
8988 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8989
8990 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8991 Found by GCC static checking and --with-wide-int on a 32-bit host.
8992
8993 2011-07-25 Eli Zaretskii <eliz@gnu.org>
8994
8995 * xdisp.c (compute_display_string_pos): Fix logic of caching
8996 previous display string position. Initialize cached_prev_pos to
8997 -1. Fixes slow-down at the beginning of a buffer.
8998
8999 2011-07-24 Eli Zaretskii <eliz@gnu.org>
9000
9001 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
9002 for attrs[LFACE_FONTSET_INDEX].
9003
9004 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
9005
9006 * xml.c (parse_region): Remove unused local
9007 that was recently introduced.
9008
9009 2011-07-23 Eli Zaretskii <eliz@gnu.org>
9010
9011 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
9012 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
9013
9014 * xdisp.c (move_it_in_display_line_to): Record the best matching
9015 position for TO_CHARPOS while scanning the line, and restore it on
9016 exit if none of the characters scanned was an exact match.
9017 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
9018 when exact match is impossible due to invisible text, and the
9019 lines are truncated.
9020
9021 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
9022
9023 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
9024 for OSX >= 10.7.
9025
9026 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9027
9028 Fix a significant slow-down of cursor motion with C-n, C-p,
9029 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
9030 auto-repeat under bidi redisplay in fontified buffers.
9031 * xdisp.c (compute_stop_pos_backwards): New function.
9032 (next_element_from_buffer): Call compute_stop_pos_backwards to
9033 find a suitable prev_stop when we find ourselves before
9034 base_level_stop.
9035 (reseat): Don't look for prev_stop, as that could mean a very long
9036 run.
9037 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
9038 <cached_disp_overlay_modiff>: Cache for last found display string
9039 position.
9040 (compute_display_string_pos): Return the cached position if asked
9041 about the same buffer in the same area of character positions, and
9042 the buffer wasn't changed since the time the display string
9043 position was cached.
9044
9045 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9046
9047 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
9048 is an integer, which is important for empty lines. (Bug#9149)
9049
9050 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
9051
9052 * frame.c (Fmodify_frame_parameters): In tty case, update the
9053 default face if necessary (Bug#4238).
9054
9055 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
9056
9057 * editfns.c (Fstring_to_char): No need to explain what a character
9058 is in the docstring (Bug#6576).
9059
9060 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9061
9062 * xml.c (parse_region): Make sure we always return a tree.
9063
9064 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
9065
9066 * xml.c (parse_region): If a document contains only comments,
9067 return that, too.
9068
9069 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9070
9071 * xml.c (make_dom): Return comments, too.
9072
9073 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 Port to OpenBSD.
9076 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
9077 and the surrounding thread.
9078 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
9079 rather than fgets, and retry after EINTR. Otherwise, 'emacs
9080 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
9081 timer goes off.
9082 * s/openbsd.h (BROKEN_SIGIO): Define.
9083 * unexelf.c (unexec) [__OpenBSD__]:
9084 Don't update the .mdebug section of the Alpha COFF symbol table.
9085
9086 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9087
9088 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
9089 (bug#8460).
9090
9091 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
9094 This fixes some race conditions on the permissions of any newly
9095 created file.
9096
9097 * alloc.c (valid_pointer_p): Use pipe, not open.
9098 This fixes some permissions issues when debugging.
9099
9100 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
9101 If fchown fails to set both uid and gid, try to set just gid,
9102 as that is sometimes allowed. Adjust the file's mode to eliminate
9103 setuid or setgid bits that are inappropriate if fchown fails.
9104
9105 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9106
9107 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
9108 to compare Lisp_Objects.
9109 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
9110 global_gnutls_log_level, don't mistake it for a Lisp_Object.
9111 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9112
9113 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
9114
9115 * lread.c (read_integer): Unread even EOF character.
9116 (read1): Likewise. Properly record start position of symbol.
9117
9118 * lread.c (read1): Read `#:' as empty uninterned symbol if no
9119 symbol character follows.
9120
9121 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
9124 This works around a problem with the previous change to Fcopy_file.
9125 Recent glibc declares fchown with __attribute__((warn_unused_result)),
9126 and without this change, GCC might complain about discarding
9127 fchown's return value.
9128
9129 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
9130
9131 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
9132
9133 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
9134
9135 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
9136
9137 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
9138
9139 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
9140 it's used from the C level.
9141
9142 * process.c: Use the same condition for POLL_FOR_INPUT in both
9143 keyboard.c and process.c (bug#1858).
9144
9145 2011-07-09 Lawrence Mitchell <wence@gmx.li>
9146
9147 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
9148 (Fgnutls_boot): Use it.
9149
9150 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
9151
9152 * doc.c (Fsubstitute_command_keys): Revert last change.
9153
9154 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
9155
9156 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
9157 quotes the next character, and doesn't affect other longer
9158 sequences (bug#8935).
9159
9160 * lread.c (syms_of_lread): Clarify that is isn't only
9161 `eval-buffer' and `eval-defun' that's affected by
9162 `lexical-binding' (bug#8460).
9163
9164 2011-07-15 Eli Zaretskii <eliz@gnu.org>
9165
9166 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
9167 bidi redisplay when a line includes both an image and is truncated.
9168
9169 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
9170
9171 Fix minor problems found by static checking.
9172 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
9173 (elsz): Now a signed constant, not a size_t var. We prefer signed
9174 types to unsigned, to avoid integer comparison confusion. Without
9175 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
9176 "cannot optimize loop, the loop counter may overflow", a symptom
9177 of the confusion.
9178 * indent.c (Fvertical_motion): Mark locals as initialized.
9179 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
9180
9181 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9182
9183 * search.c (Fre_search_backward): Mention `case-fold-search' in
9184 all the re_search_* functions (bug#8138).
9185
9186 * keyboard.c (Fopen_dribble_file): Document when the file is
9187 closed (bug#8056).
9188
9189 2011-07-14 Eli Zaretskii <eliz@gnu.org>
9190
9191 * bidi.c (bidi_dump_cached_states): Fix format of displaying
9192 bidi_cache_idx.
9193
9194 Support bidi reordering of display and overlay strings.
9195 * xdisp.c (compute_display_string_pos)
9196 (compute_display_string_end): Accept additional argument STRING.
9197 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
9198 (reseat_to_string): Initialize bidi_it->string.s and
9199 bidi_it->string.schars.
9200 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
9201 NULL (avoids a crash in bidi_paragraph_init).
9202 Initialize itb.string.lstring.
9203 (init_iterator): Call bidi_init_it only of a valid
9204 buffer position was specified. Initialize paragraph_embedding to
9205 L2R.
9206 (reseat_to_string): Initialize the bidi iterator.
9207 (display_string): If we need to ignore text properties of
9208 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
9209 original value of -1 will not work with bidi.)
9210 (compute_display_string_pos): First arg is now struct
9211 `text_pos *'; all callers changed. Support display properties on
9212 Lisp strings.
9213 (compute_display_string_end): Support display properties on Lisp
9214 strings.
9215 (init_iterator, reseat_1, reseat_to_string): Initialize the
9216 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
9217 when iterating on a string not from display properties).
9218 (compute_display_string_pos, compute_display_string_end):
9219 Fix calculation of the object to scan. Fixes an error when using
9220 arrow keys.
9221 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
9222 base_level_stop; instead, set base_level_stop to BEGV.
9223 Fixes crashes in vertical-motion.
9224 (next_element_from_buffer): Improve commentary for when
9225 the iterator is before prev_stop.
9226 (init_iterator): Initialize bidi_p from the default value of
9227 bidi-display-reordering, not from buffer-local value. Use the
9228 buffer-local value only if initializing for buffer iteration.
9229 (handle_invisible_prop): Support invisible properties on strings
9230 that are being bidi-reordered.
9231 (set_iterator_to_next): Support bidi reordering of C strings and
9232 Lisp strings.
9233 (next_element_from_string): Support bidi reordering of Lisp
9234 strings.
9235 (handle_stop_backwards): Support Lisp strings as well.
9236 (display_string): Support display of R2L glyph rows.
9237 Use IT_STRING_CHARPOS when displaying from a Lisp string.
9238 (init_iterator): Don't initialize it->bidi_p for strings
9239 here.
9240 (reseat_to_string): Initialize it->bidi_p for strings here.
9241 (next_element_from_string, next_element_from_c_string)
9242 (next_element_from_buffer): Add xassert's for correspondence
9243 between IT's object being iterated and it->bidi_it.string
9244 structure.
9245 (face_before_or_after_it_pos): Support bidi iteration.
9246 (next_element_from_c_string): Handle the case of the first string
9247 character that is not the first one in the visual order.
9248 (get_visually_first_element): New function, refactored from common
9249 parts of next_element_from_buffer, next_element_from_string, and
9250 next_element_from_c_string.
9251 (tool_bar_lines_needed, redisplay_tool_bar)
9252 (display_menu_bar): Force left-to-right direction. Add a FIXME
9253 comment for making that be controlled by a user option.
9254 (push_it, pop_it): Save and restore the state of the
9255 bidi iterator. Save and restore the bidi_p flag.
9256 (pop_it): Iterate out of display property for string iteration as
9257 well.
9258 (iterate_out_of_display_property): Support iteration over strings.
9259 (handle_single_display_spec): Set up it->bidi_it for iteration
9260 over a display string, and call bidi_init_it.
9261 (handle_single_display_spec, next_overlay_string)
9262 (get_overlay_strings_1, push_display_prop): Set up the bidi
9263 iterator for displaying display or overlay strings.
9264 (forward_to_next_line_start): Don't use the shortcut if
9265 bidi-iterating.
9266 (back_to_previous_visible_line_start): If handle_display_prop
9267 pushed the iterator stack, restore the internal state of the bidi
9268 iterator by calling bidi_pop_it same number of times.
9269 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
9270 and we are bidi-iterating, don't decrement the iterator position;
9271 instead, set the first_elt flag in the bidi iterator, to produce
9272 the same effect.
9273 (reseat_1): Remove redundant setting of string_from_display_prop_p.
9274 (push_display_prop): xassert that we are iterating a buffer.
9275 (push_it, pop_it): Save and restore paragraph_embedding member.
9276 (handle_single_display_spec, next_overlay_string)
9277 (get_overlay_strings_1, reseat_1, reseat_to_string)
9278 (push_display_prop): Set up the `unibyte' member of bidi_it.string
9279 correctly. Don't assume unibyte strings are not bidi-reordered.
9280 (compute_display_string_pos)
9281 (compute_display_string_end): Fix handling the case of C string.
9282 (push_it, pop_it): Save and restore from_disp_prop_p.
9283 (handle_single_display_spec, push_display_prop): Set the
9284 from_disp_prop_p flag.
9285 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
9286 (pop_it): Call iterate_out_of_display_property only if we are
9287 popping after iteration over a string that came from a display
9288 property. Fix a typo in popping stretch info. Add an assertion
9289 for verifying that the iterator position is in sync with the bidi
9290 iterator.
9291 (handle_single_display_spec, get_overlay_strings_1)
9292 (push_display_prop): Fix initialization of paragraph direction for
9293 string when that of the parent object is not yet determined.
9294 (reseat_1): Call bidi_init_it to resync the bidi
9295 iterator with IT's position. (Bug#7616)
9296 (find_row_edges): If ROW->start.pos gives position
9297 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
9298 (handle_stop, back_to_previous_visible_line_start, reseat_1):
9299 Reset the from_disp_prop_p flag.
9300 (SAVE_IT, RESTORE_IT): New macros.
9301 (pos_visible_p, face_before_or_after_it_pos)
9302 (back_to_previous_visible_line_start)
9303 (move_it_in_display_line_to, move_it_in_display_line)
9304 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9305 (try_scrolling, redisplay_window, display_line): Use them when
9306 saving a temporary copy of the iterator and restoring it back.
9307 (back_to_previous_visible_line_start, reseat_1)
9308 (init_iterator): Empty the bidi cache "stack".
9309 (move_it_in_display_line_to): If iterator ended up at
9310 EOL, but we never saw any buffer positions smaller than
9311 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
9312 motion in bidi-reordered lines.
9313 (move_it_in_display_line_to): Record prev_method and prev_pos
9314 immediately before the call to set_iterator_to_next. Fixes cursor
9315 motion in bidi-reordered lines with stretch glyphs and strings
9316 displayed in margins. (Bug#8133) (Bug#8867)
9317 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
9318 TO_CHARPOS.
9319 (pos_visible_p): Support positions in bidi-reordered lines.
9320 Save and restore bidi cache.
9321
9322 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
9323 (bidi_paragraph_info): Delete unused struct.
9324 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
9325 (bidi_cache_start): New variable.
9326 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
9327 to zero.
9328 (bidi_cache_fetch_state, bidi_cache_search)
9329 (bidi_cache_find_level_change, bidi_cache_iterator_state)
9330 (bidi_cache_find, bidi_peek_at_next_level)
9331 (bidi_level_of_next_char, bidi_find_other_level_edge)
9332 (bidi_move_to_visually_next): Compare cache index with
9333 bidi_cache_start rather than with zero.
9334 (bidi_fetch_char): Accept new argument STRING; all callers
9335 changed. Support iteration over a string. Support strings with
9336 display properties. Support unibyte strings. Fix the type of
9337 `len' according to what STRING_CHAR_AND_LENGTH expects.
9338 (bidi_paragraph_init, bidi_resolve_explicit_1)
9339 (bidi_resolve_explicit, bidi_resolve_weak)
9340 (bidi_level_of_next_char, bidi_move_to_visually_next):
9341 Support iteration over a string.
9342 (bidi_set_sor_type, bidi_resolve_explicit_1)
9343 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
9344 can now be zero (for strings); special values 0 and -1 were
9345 changed to -1 and -2, respectively.
9346 (bidi_char_at_pos): New function.
9347 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
9348 Call it instead of FETCH_MULTIBYTE_CHAR.
9349 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
9350 initialized to valid values.
9351 (bidi_init_it): Don't initialize charpos and bytepos with invalid
9352 values.
9353 (bidi_level_of_next_char): Allow the sentinel "position" to pass
9354 the test for valid cached positions. Fix the logic for looking up
9355 the sentinel state in the cache. GCPRO the Lisp string we are
9356 iterating.
9357 (bidi_push_it, bidi_pop_it): New functions.
9358 (bidi_initialize): Initialize the bidi cache start stack pointer.
9359 (bidi_cache_ensure_space): New function, refactored from part of
9360 bidi_cache_iterator_state. Don't assume the required size is just
9361 one BIDI_CACHE_CHUNK away.
9362 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
9363 (bidi_count_bytes, bidi_char_at_pos): New functions.
9364 (bidi_cache_search): Don't assume bidi_cache_last_idx is
9365 always valid if bidi_cache_idx is valid.
9366 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
9367 is valid if it's going to be used.
9368 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
9369 (bidi_cache_fetch_state, bidi_cache_search)
9370 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9371 (bidi_cache_iterator_state, bidi_cache_find)
9372 (bidi_find_other_level_edge, bidi_cache_start_stack):
9373 All variables related to cache indices are now EMACS_INT.
9374
9375 * dispextern.h (struct bidi_string_data): New structure.
9376 (struct bidi_it): New member `string'. Make flag members be 1-bit
9377 fields, and put them last in the struct.
9378 (compute_display_string_pos, compute_display_string_end):
9379 Update prototypes.
9380 (bidi_push_it, bidi_pop_it): Add prototypes.
9381 (struct iterator_stack_entry): New members bidi_p,
9382 paragraph_embedding, and from_disp_prop_p.
9383 (struct it): Member bidi_p is now a bit field 1 bit wide.
9384 (bidi_shelve_cache, bidi_unshelve_cache):
9385 Declare prototypes.
9386
9387 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9388 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9389 and vector-like objects.
9390
9391 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9392 cache around display iteration.
9393
9394 * window.c (Fwindow_end, window_scroll_pixel_based)
9395 (displayed_window_lines, Frecenter): Save and restore the bidi
9396 cache around display iteration.
9397
9398 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9399
9400 * editfns.c (Fdelete_region): Clarify the use of the named
9401 parameters (bug#6788).
9402
9403 2011-07-14 Martin Rudalics <rudalics@gmx.at>
9404
9405 * indent.c (Fvertical_motion): Set and restore w->pointm when
9406 saving and restoring the window's buffer (Bug#9006).
9407
9408 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
9409
9410 * editfns.c (Fstring_to_char): Clarify just what is returned
9411 (bug#6576). Text by Eli Zaretskii.
9412
9413 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
9414
9415 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9416
9417 2011-07-13 Eli Zaretskii <eliz@gnu.org>
9418
9419 * buffer.c (mmap_find): Fix a typo.
9420
9421 2011-07-13 Johan Bockgård <bojohan@gnu.org>
9422
9423 Fix execution of x selection hooks.
9424 * xselect.c (Qx_lost_selection_functions)
9425 (Qx_sent_selection_functions): New vars.
9426 (syms_of_xselect): DEFSYM them.
9427 (x_handle_selection_request): Pass Qx_sent_selection_functions
9428 rather than Vx_sent_selection_functions to Frun_hook_with_args.
9429 (x_handle_selection_clear,x_clear_frame_selections):
9430 Pass Qx_lost_selection_functions rather than
9431 Vx_lost_selection_functions to Frun_hook_with_args.
9432
9433 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
9434
9435 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
9436 The old code sometimes used this field without initializing it.
9437
9438 * alloc.c (gc_sweep): Don't read past end of array.
9439 In theory, the old code could also have corrupted Emacs internals,
9440 though it'd be very unlikely.
9441
9442 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
9443
9444 * character.c (Fcharacterp): Don't advertise optional ignored
9445 argument. (Bug#4026)
9446
9447 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
9448
9449 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9450 key" (bug#4257).
9451
9452 * window.c (Fset_window_start): Doc fix (bug#4199).
9453 (Fset_window_hscroll): Ditto.
9454
9455 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
9456
9457 Fix minor new problems caught by GCC 4.6.1.
9458 * term.c (init_tty): Remove unused local.
9459 * xsettings.c (store_monospaced_changed): Define this function only
9460 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
9461 not used otherwise.
9462
9463 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
9464
9465 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9466
9467 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9468
9469 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9470 are the mini-buffer and the echo area (bug#3320).
9471
9472 * term.c (init_tty): Remove support for supdup, c10 and perq
9473 terminals, which are no longer supported (bug#1482).
9474
9475 2011-07-10 Johan Bockgård <bojohan@gnu.org>
9476
9477 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9478
9479 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
9480
9481 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9482 for non-popups (Bug#3642).
9483
9484 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
9485
9486 * alloc.c (reset_malloc_hooks): Protoize.
9487 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
9488 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9489 * cm.c (losecursor): Likewise.
9490 * data.c (fmod): Likewise.
9491 * dispnew.c (swap_glyphs_in_rows): Likewise.
9492 * emacs.c (memory_warning_signal): Likewise.
9493 * floatfns.c (float_error): Likewise.
9494 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9495 (otf_open, font_otf_capability, generate_otf_features)
9496 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9497 Likewise.
9498 * image.c (pbm_read_file): Likewise.
9499 * indent.c (string_display_width): Likewise.
9500 * intervals.c (check_for_interval, search_for_interval)
9501 (inc_interval_count, count_intervals, root_interval)
9502 (adjust_intervals_for_insertion, make_new_interval): Likewise.
9503 * lread.c (defalias): Likewise.
9504 * ralloc.c (r_alloc_check): Likewise.
9505 * regex.c (set_image_of_range_1, set_image_of_range)
9506 (regex_grow_registers): Likewise.
9507 * sysdep.c (strerror): Likewise.
9508 * termcap.c (valid_filename_p, tprint, main): Likewise.
9509 * tparam.c (main): Likewise.
9510 * unexhp9k800.c (run_time_remap, save_data_space)
9511 (update_file_ptrs, read_header, write_header, calculate_checksum)
9512 (copy_file, copy_rest, display_header): Likewise.
9513 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9514 Likewise.
9515 * xdisp.c (check_it): Likewise.
9516 * xfaces.c (register_color, unregister_color, unregister_colors):
9517 Likewise.
9518 * xfns.c (print_fontset_result): Likewise.
9519 * xrdb.c (member, fatal, main): Likewise.
9520
9521 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
9522
9523 Fix minor problems found by static checking (Bug#9031).
9524 * chartab.c (char_table_set_range, map_sub_char_table):
9525 Remove unused locals.
9526 (uniprop_table): Now static.
9527 * composite.c (_work_char): Remove unused static var.
9528
9529 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
9530
9531 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
9532
9533 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
9534
9535 * gtkutil.c (qttip_cb): Remove code without function.
9536
9537 2011-07-09 Eli Zaretskii <eliz@gnu.org>
9538
9539 * w32.c (pthread_sigmask): New stub.
9540
9541 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
9542
9543 Use pthread_sigmask, not sigprocmask (Bug#9010).
9544 sigprocmask is portable only for single-threaded applications, and
9545 Emacs can be multi-threaded when it uses GTK.
9546 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
9547 (LIBES): Use it.
9548 * callproc.c (Fcall_process):
9549 * process.c (create_process):
9550 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9551 Use pthread_sigmask, not sigprocmask.
9552
9553 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9554
9555 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9556 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9557 wrong (Bug#8591).
9558
9559 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9560
9561 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9562 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9563 (xg_hide_tooltip): Fix comment.
9564
9565 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9566 in registerServicesMenuSendTypes.
9567 (validRequestorForSendType): Don't check ns_return_types.
9568
9569 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9570 ns_return_type.
9571
9572 2011-07-08 Jason Rumney <jasonr@gnu.org>
9573
9574 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9575 SH_SHOW for hidden windows (Bug#5482).
9576
9577 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9578 frame struct members of non-existent frames (Bug#6284).
9579
9580 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9581
9582 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9583 variable firstTime not needed on OSX >= 10.6.
9584 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9585 >= 10.5. Use setKnobProportion, setDoubleValue.
9586
9587 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9588 (MAC_OS_X_VERSION_10_5): Define if not defined.
9589 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9590 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9591 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9592
9593 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
9594 cString and lossyCString on OSX >= 10.4.
9595
9596 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
9597 sizeToFit on OSX >= 10.2.
9598
9599 * nsimage.m (allocInitFromFile): Don't use deprecated method
9600 bestRepresentationForDevice on OSX >= 10.6.
9601
9602 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9603 to avoid warning.
9604
9605 * emacs.c: Declare unexec_init_emacs_zone.
9606
9607 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9608
9609 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9610
9611 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9612 on svcsMenu (Bug#8842).
9613
9614 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9615 ns_return_types.
9616 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9617
9618 * nsterm.m (QUTF8_STRING): Declare.
9619 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9620 (validRequestorForSendType): Return type is (id).
9621 Change indexOfObjectIdenticalTo to indexOfObject.
9622 Check if we have local selection before returning self (Bug#8842).
9623 (writeSelectionToPasteboard): Put local selection into paste board
9624 if we have a local selection (Bug#8842).
9625 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9626
9627 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9628 (ns_get_local_selection): Declare.
9629
9630 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9631
9632 * keymap.c (describe_map_tree): Don't insert a double newline at
9633 the end of the buffer (bug#1169) and return whether we inserted
9634 something.
9635
9636 * callint.c (Fcall_interactively): Change "reading args" to
9637 "providing args" to try to clarify what it does (bug#1010).
9638
9639 2011-07-07 Kenichi Handa <handa@m17n.org>
9640
9641 * composite.c (composition_compute_stop_pos): Ignore a static
9642 composition starting before CHARPOS (Bug#8915).
9643
9644 * xdisp.c (handle_composition_prop): Likewise.
9645
9646 2011-07-07 Eli Zaretskii <eliz@gnu.org>
9647
9648 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9649 (Bug#9015)
9650
9651 2011-07-07 Kenichi Handa <handa@m17n.org>
9652
9653 * character.h (unicode_category_t): New enum type.
9654
9655 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9656 (Qchar_code_property_table): New variable.
9657 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9658 (UNIPROP_COMPRESSED_FORM_P): New macros.
9659 (char_table_ascii): Uncompress the compressed values.
9660 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9661 Uncompress the compressed values.
9662 (sub_char_table_ref_and_range): Likewise.
9663 (char_table_ref_and_range): Uncompress the compressed values.
9664 (sub_char_table_set): New arg is_uniprop. Callers changed.
9665 Uncompress the compressed values.
9666 (sub_char_table_set_range): Args changed. Callers changed.
9667 (char_table_set_range): Adjuted for the above change.
9668 (map_sub_char_table): Delete args default_val and parent. Add arg
9669 top. Give decoded values to a Lisp function.
9670 (map_char_table): Adjust for the above change. Give decoded
9671 values to a Lisp function. Gcpro more variables.
9672 (uniprop_table_uncompress)
9673 (uniprop_decode_value_run_length): New functions.
9674 (uniprop_decoder, uniprop_decoder_count): New variables.
9675 (uniprop_get_decoder, uniprop_encode_value_character)
9676 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9677 New functions.
9678 (uniprop_encoder, uniprop_encoder_count): New variables.
9679 (uniprop_get_encoder, uniprop_table)
9680 (Funicode_property_table_internal, Fget_unicode_property_internal)
9681 (Fput_unicode_property_internal): New functions.
9682 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9683 Sunicode_property_table_internal, Sget_unicode_property_internal,
9684 and Sput_unicode_property_internal. Defvar_lisp
9685 char-code-property-alist.
9686
9687 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
9688 Vunicode_category_table.
9689
9690 * font.c (font_range): Adjust for the change of
9691 Vunicode_category_table.
9692
9693 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9694
9695 * m/iris4d.h: Remove file, move contents ...
9696 * s/irix6-5.h: ... here.
9697
9698 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9699
9700 Remove unportable assumption about struct layout (Bug#8884).
9701 * alloc.c (mark_buffer):
9702 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9703 (clone_per_buffer_values): Don't assume that
9704 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9705 This isn't true in general, and it's particularly not true
9706 if Emacs is configured with --with-wide-int.
9707 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9708 New macros, used in the buffer.c change.
9709
9710 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9711
9712 * xsettings.c: Use both GConf and GSettings if both are available.
9713 (store_config_changed_event): Add comment.
9714 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9715 (store_tool_bar_style_changed): New functions.
9716 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
9717 (struct xsettings): Move font inside HAVE_XFT.
9718 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
9719 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
9720 Move inside HAVE_XFT.
9721 (something_changed_gsettingsCB): Rename from something_changedCB.
9722 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9723 also.
9724 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
9725 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
9726 (something_changed_gconfCB): Rename from something_changedCB.
9727 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9728 (parse_settings): Move check for font inside HAVE_XFT.
9729 (read_settings, apply_xft_settings): Add comment.
9730 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9731 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9732 call store_font_name_changed.
9733 (xft_settings_event): Add comment.
9734 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9735 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9736 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9737 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9738 (xsettings_initialize): Call init_gsettings last.
9739 (xsettings_get_system_font, xsettings_get_system_normal_font):
9740 Add comment.
9741
9742 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9743
9744 Random fixes. E.g., (random) never returned negative values.
9745 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9746 subseconds part to the entropy, as that's a bit more random.
9747 Prefer signed to unsigned, since the signedness doesn't matter and
9748 in general we prefer signed. When given a limit, use a
9749 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9750 latter isn't right if USE_2_TAGS_FOR_INTS.
9751 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9752 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9753
9754 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9755
9756 * textprop.c (text_property_stickiness):
9757 Obey Vtext_property_default_nonsticky.
9758 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9759 * w32fns.c (syms_of_w32fns):
9760 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9761
9762 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9763
9764 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9765 This is more efficient than Ffile_directory_p and avoids a minor race.
9766
9767 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
9768
9769 * buffer.c (Foverlay_put): Say what the return value is
9770 (bug#7835).
9771
9772 * fileio.c (barf_or_query_if_file_exists): Check first if the file
9773 is a directory before asking whether to use the file name
9774 (bug#7564).
9775 (barf_or_query_if_file_exists): Make the "File is a directory"
9776 error be more correct.
9777
9778 * fns.c (Frequire): Remove the mention of the .gz files, since
9779 that's installation-specific, but keep the mention of
9780 `get-load-suffixes'.
9781
9782 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9783
9784 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
9785 Report string overflow if the output is too long.
9786
9787 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
9788
9789 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
9790 (syms_of_gnutls): Remove duplicate DEFSYM for
9791 Qgnutls_bootprop_verify_hostname_error, an error for
9792 Qgnutls_bootprop_verify_error (which is no longer used).
9793
9794 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
9795 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
9796 Also (re)move comments that are misplaced or no longer relevant.
9797
9798 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9799
9800 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
9801
9802 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
9803
9804 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
9805 and background color parameters if they have been changed.
9806
9807 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9808
9809 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
9810
9811 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
9812
9813 * xsettings.c (SYSTEM_FONT): Define only when used.
9814 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
9815
9816 * keymap.c (access_keymap_1): Now static.
9817
9818 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
9819
9820 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
9821 leave any prefix arg for the up event (Bug#1586).
9822
9823 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
9824
9825 * lread.c (syms_of_lread): Mention single symbols defined by
9826 `defvar' or `defconst' (bug#7154).
9827
9828 * fns.c (Frequire): Mention .el.gz files (bug#7314).
9829 (Frequire): Mention get-load-suffixes.
9830
9831 2011-07-02 Martin Rudalics <rudalics@gmx.at>
9832
9833 * window.h (window): Remove clone_number slot.
9834 * window.c (Fwindow_clone_number, Fset_window_clone_number):
9835 Remove.
9836 (make_parent_window, make_window, saved_window)
9837 (Fset_window_configuration, save_window_save): Don't deal with
9838 clone numbers.
9839 * buffer.c (Qclone_number): Remove declaration.
9840 (sort_overlays, overlay_strings): Don't deal with clone numbers.
9841
9842 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
9843
9844 Add multiple inheritance to keymaps.
9845 * keymap.c (Fmake_composed_keymap): New function.
9846 (Fset_keymap_parent): Simplify.
9847 (fix_submap_inheritance): Remove.
9848 (access_keymap_1): New function extracted from access_keymap to handle
9849 embedded parents and handle lists of maps.
9850 (access_keymap): Use it.
9851 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
9852 (Fcopy_keymap): Handle embedded parents.
9853 (Fcommand_remapping, define_as_prefix): Simplify.
9854 (Fkey_binding): Simplify.
9855 (syms_of_keymap): Move minibuffer-local-completion-map,
9856 minibuffer-local-filename-completion-map,
9857 minibuffer-local-must-match-map, and
9858 minibuffer-local-filename-must-match-map to Elisp.
9859 (syms_of_keymap): Defsubr make-composed-keymap.
9860 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
9861 (parse_menu_item): Trivial simplification.
9862
9863 2011-07-01 Glenn Morris <rgm@gnu.org>
9864
9865 * Makefile.in (SETTINGS_LIBS): Fix typo.
9866
9867 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
9868
9869 * coding.c (Fencode_coding_string): Record the last coding system
9870 used, as the function doc string says (bug#8738).
9871
9872 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
9873
9874 * xsettings.c (store_monospaced_changed): Take new font as arg and
9875 check for change against current_mono_font.
9876 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9877 (emacs_settings_constructor, emacs_settings_get_property)
9878 (emacs_settings_set_property, emacs_settings_class_init)
9879 (emacs_settings_init, gsettings_obj): Remove.
9880 (something_changedCB): New function for HAVE_GSETTINGS.
9881 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9882 with value as argument.
9883 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9884 g_settings_new (Bug#8967). Do not create gsettings_obj.
9885 Remove calls to g_settings_bind. Connect something_changedCB to
9886 "changed".
9887
9888 * xgselect.c: Add defined (HAVE_GSETTINGS).
9889 (xgselect_initialize): Ditto.
9890
9891 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9892 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9893 xg_select.
9894
9895 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9896
9897 * eval.c (struct backtrace): Simplify and port the data structure.
9898 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9899 signed bit field, as this assumption is not portable and it makes
9900 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9901 "char debug_on_exit : 1" as this is not portable either; instead,
9902 use the portable "unsigned int debug_on_exit : 1". Remove unused
9903 member evalargs. Remove obsolete comments about cc bombing out.
9904
9905 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9906
9907 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9908 Let HAVE_GSETTINGS override HAVE_GCONF.
9909 (store_monospaced_changed): New function.
9910 (EMACS_SETTINGS): A new type derived from GObject to handle
9911 GSettings notifications.
9912 (emacs_settings_constructor, emacs_settings_get_property)
9913 (emacs_settings_set_property, emacs_settings_class_init):
9914 New functions.
9915 (gsettings_client, gsettings_obj): New variables.
9916 (GSETTINGS_SCHEMA): New define.
9917 (something_changedCB): Call store_monospaced_changed.
9918 (init_gsettings): New function.
9919 (xsettings_initialize): Call init_gsettings.
9920 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9921 to NULL.
9922
9923 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9924 GCONF_CFLAGS/LIBS.
9925
9926 2011-06-29 Martin Rudalics <rudalics@gmx.at>
9927
9928 * window.c (resize_root_window, grow_mini_window)
9929 (shrink_mini_window): Rename Qresize_root_window to
9930 Qwindow_resize_root_window and Qresize_root_window_vertically to
9931 Qwindow_resize_root_window_vertically.
9932
9933 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9934
9935 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9936
9937 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
9938
9939 * makefile.w32-in: Redesign dependencies so they reflect more
9940 clearly which files are directly included by each source file,
9941 and not through other includes.
9942
9943 2011-06-27 Martin Rudalics <rudalics@gmx.at>
9944
9945 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9946 (sort_overlays, overlay_strings): When an overlay's clone number
9947 matches the window's clone number process the overlay even if
9948 the overlay's window property doesn't match the current window.
9949
9950 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9951 (Fwindow_hchild): Rename to Fwindow_left_child.
9952 (Fwindow_next): Rename to Fwindow_next_sibling.
9953 (Fwindow_prev): Rename to Fwindow_prev_sibling.
9954 (resize_window_check): Rename to window_resize_check.
9955 (resize_window_apply): Rename to window_resize_apply.
9956 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9957 (Fdelete_other_windows_internal, resize_frame_windows)
9958 (Fsplit_window_internal, Fdelete_window_internal)
9959 (grow_mini_window, shrink_mini_window)
9960 (Fresize_mini_window_internal): Fix callers accordingly.
9961
9962 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9963
9964 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9965 (emacs_fixed_set_min_size): Remove.
9966 (emacs_fixed_new): Take frame as argument.
9967
9968 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9969 (_EmacsFixedPrivate): Remove minwidth/height.
9970 Add struct frame *f.
9971 (emacs_fixed_init): Initialize priv->f.
9972 (get_parent_class, emacs_fixed_set_min_size): Remove.
9973 (emacs_fixed_new): Set priv->f to argument.
9974 (emacs_fixed_get_preferred_width)
9975 (emacs_fixed_get_preferred_height): Use min_width/height from
9976 frames size_hint to set minimum and natural (Bug#8919).
9977 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9978 and use min_width/height from frames size_hint to set
9979 min_width/height (Bug#8919).
9980
9981 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9982 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9983 Fix indentation.
9984
9985 2011-06-26 Eli Zaretskii <eliz@gnu.org>
9986
9987 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9988 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9989 called at ZV.
9990
9991 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
9992
9993 * process.c (wait_reading_process_output): Bypass select if
9994 waiting for a cell while ignoring keyboard input, and input is
9995 pending. Suggested by Jan Djärv (Bug#8869).
9996
9997 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9998
9999 Use gnulib's dup2 module instead of rolling our own.
10000 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
10001
10002 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10003
10004 * dispnew.c (scrolling_window): Before scrolling, turn off a
10005 mouse-highlight in the window being scrolled.
10006
10007 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
10008
10009 Move DEFSYM to lisp.h and use everywhere.
10010
10011 * character.h (DEFSYM): Move declaration...
10012 * lisp.h (DEFSYM): ...here.
10013
10014 * gnutls.c:
10015 * minibuf.c:
10016 * w32menu.c:
10017 * w32proc.c:
10018 * w32select.c: Don't include character.h.
10019
10020 * alloc.c (syms_of_alloc):
10021 * buffer.c (syms_of_buffer):
10022 * bytecode.c (syms_of_bytecode):
10023 * callint.c (syms_of_callint):
10024 * casefiddle.c (syms_of_casefiddle):
10025 * casetab.c (init_casetab_once):
10026 * category.c (init_category_once, syms_of_category):
10027 * ccl.c (syms_of_ccl):
10028 * cmds.c (syms_of_cmds):
10029 * composite.c (syms_of_composite):
10030 * dbusbind.c (syms_of_dbusbind):
10031 * dired.c (syms_of_dired):
10032 * dispnew.c (syms_of_display):
10033 * doc.c (syms_of_doc):
10034 * editfns.c (syms_of_editfns):
10035 * emacs.c (syms_of_emacs):
10036 * eval.c (syms_of_eval):
10037 * fileio.c (syms_of_fileio):
10038 * fns.c (syms_of_fns):
10039 * frame.c (syms_of_frame):
10040 * fringe.c (syms_of_fringe):
10041 * insdel.c (syms_of_insdel):
10042 * keymap.c (syms_of_keymap):
10043 * lread.c (init_obarray, syms_of_lread):
10044 * macros.c (syms_of_macros):
10045 * msdos.c (syms_of_msdos):
10046 * print.c (syms_of_print):
10047 * process.c (syms_of_process):
10048 * search.c (syms_of_search):
10049 * sound.c (syms_of_sound):
10050 * syntax.c (init_syntax_once, syms_of_syntax):
10051 * terminal.c (syms_of_terminal):
10052 * textprop.c (syms_of_textprop):
10053 * undo.c (syms_of_undo):
10054 * w32.c (globals_of_w32):
10055 * window.c (syms_of_window):
10056 * xdisp.c (syms_of_xdisp):
10057 * xfaces.c (syms_of_xfaces):
10058 * xfns.c (syms_of_xfns):
10059 * xmenu.c (syms_of_xmenu):
10060 * xsettings.c (syms_of_xsettings):
10061 * xterm.c (syms_of_xterm): Use DEFSYM.
10062
10063 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
10064
10065 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
10066
10067 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
10068
10069 Integer and buffer overflow fixes (Bug#8873).
10070
10071 * print.c (printchar, strout): Check for string overflow.
10072 (PRINTPREPARE, printchar, strout):
10073 Don't set size unless allocation succeeds.
10074
10075 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
10076 for sizes. Check for string overflow more accurately.
10077 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
10078
10079 * macros.c: Integer and buffer overflow fixes.
10080 * keyboard.h (struct keyboard.kbd_macro_bufsize):
10081 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
10082 Use ptrdiff_t, not int, for sizes.
10083 Don't increment bufsize until after realloc succeeds.
10084 Check for size-calculation overflow.
10085 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
10086
10087 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
10088
10089 * lread.c: Integer overflow fixes.
10090 (read_integer): Radix is now EMACS_INT, not int,
10091 to improve quality of diagnostics for out-of-range radices.
10092 Calculate buffer size correctly for out-of-range radices.
10093 (read1): Check for integer overflow in radices, and in
10094 read-circle numbers.
10095 (read_escape): Avoid int overflow.
10096 (Fload, openp, read_buffer_size, read1)
10097 (substitute_object_recurse, read_vector, read_list, map_obarray):
10098 Use ptrdiff_t, not int, for sizes.
10099 (read1): Use EMACS_INT, not int, for sizes.
10100 Check for size overflow.
10101
10102 * image.c (cache_image): Check for size arithmetic overflow.
10103
10104 * lread.c: Integer overflow issues.
10105 (saved_doc_string_size, saved_doc_string_length)
10106 (prev_saved_doc_string_size, prev_saved_doc_string_length):
10107 Now ptrdiff_t, not int.
10108 (read1): Don't assume doc string length fits in int. Check for
10109 out-of-range doc string lengths.
10110 (read_list): Don't assume file position fits in int.
10111 (read_escape): Check for hex character overflow.
10112
10113 2011-06-22 Leo Liu <sdl.web@gmail.com>
10114
10115 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
10116 Move to minibuffer.el.
10117
10118 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10119
10120 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
10121 The following patches are for when GLYPH_DEBUG && !XASSERT.
10122 * dispextern.h (trace_redisplay_p, dump_glyph_string):
10123 * dispnew.c (flush_stdout):
10124 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
10125 Mark as externally visible.
10126 * dispnew.c (check_window_matrix_pointers): Now static.
10127 * dispnew.c (window_to_frame_vpos):
10128 * xfns.c (unwind_create_frame):
10129 * xterm.c (x_check_font): Remove unused local.
10130 * scroll.c (CHECK_BOUNDS):
10131 * xfaces.c (cache_fache): Rename local to avoid shadowing.
10132 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
10133 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
10134 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
10135 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
10136 Now static.
10137 (debug_method_add): Use va_list and vsprintf rather than relying
10138 on undefined behavior with wrong number of arguments.
10139 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
10140 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
10141 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
10142 since we're not interested in debugging glyphs with old libraries.
10143 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
10144 GCC 4.6.0's static checking.
10145
10146 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10147
10148 Integer overflow and signedness fixes (Bug#8873).
10149 A few related buffer overrun fixes, too.
10150
10151 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
10152
10153 * dispextern.h (struct face.stipple):
10154 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
10155 (x_bitmap_mask, x_allocate_bitmap_record)
10156 (x_create_bitmap_from_data, x_create_bitmap_from_file)
10157 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
10158 (x_create_bitmap_from_xpm_data):
10159 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
10160 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
10161 (.bitmaps_last):
10162 * xfaces.c (load_pixmap):
10163 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
10164 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
10165 (.bitmaps_last, struct x_output.icon_bitmap):
10166 Use ptrdiff_t, not int, for bitmap indexes.
10167 (x_allocate_bitmap_record): Check for size overflow.
10168 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
10169
10170 Use ptrdiff_t, not int, for overlay counts.
10171 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
10172 * editfns.c (overlays_around, get_pos_property):
10173 * textprop.c (get_char_property_and_overlay):
10174 * xdisp.c (next_overlay_change, note_mouse_highlight):
10175 * xfaces.c (face_at_buffer_position):
10176 * buffer.c (OVERLAY_COUNT_MAX): New macro.
10177 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
10178 (Fnext_overlay_change, Fprevious_overlay_change)
10179 (mouse_face_overlay_overlaps, Foverlays_in):
10180 Use ptrdiff_t, not int, for sizes.
10181 (overlays_at, overlays_in): Check for size-calculation overflow.
10182
10183 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
10184
10185 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
10186 (x_session_initialize): Do not assume string length fits in int.
10187
10188 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
10189 This is unlikely, but can occur if DPI is outlandish.
10190
10191 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
10192 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
10193
10194 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
10195 * xrdb.c (magic_file_p, search_magic_path):
10196 Omit last arg SUFFIX; it was always 0. All callers changed.
10197 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
10198
10199 * xfont.c (xfont_match): Avoid need for strlen.
10200
10201 * xfns.c: Don't assume strlen fits in int.
10202 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
10203
10204 * xdisp.c (message_log_check_duplicate): Return intmax_t,
10205 not unsigned long, as we prefer signed integers. All callers changed.
10206 Detect integer overflow in repeat count.
10207 (message_dolog): Don't assume print length fits in 39 bytes.
10208 (display_mode_element): Don't assume strlen fits in int.
10209
10210 * termcap.c: Don't assume sizes fit in int and never overflow.
10211 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
10212 (gobble_line): Check for size-calculation overflow.
10213
10214 * minibuf.c (Fread_buffer):
10215 * lread.c (intern, intern_c_string):
10216 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
10217 Don't assume string length fits in int.
10218
10219 * keyboard.c (parse_tool_bar_item):
10220 * gtkutil.c (style_changed_cb): Avoid need for strlen.
10221
10222 * font.c: Don't assume string length fits in int.
10223 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
10224 Use ptrdiff_t, not int.
10225 (font_intern_prop): Don't assume string length fits in int.
10226 Don't assume integer property fits in fixnum.
10227 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
10228
10229 * filelock.c: Fix some buffer overrun and integer overflow issues.
10230 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
10231 Reformulate so as not to need the command string.
10232 Invoke gzip -cd rather than gunzip, as it's more portable.
10233 (lock_info_type, lock_file_1, lock_file):
10234 Don't assume pid_t and time_t fit in unsigned long.
10235 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
10236 (current_lock_owner): Prefer signed type for sizes.
10237 Use memcpy, not strncpy, where memcpy is what is really wanted.
10238 Don't assume (via atoi) that time_t and pid_t fit in int.
10239 Check for time_t and/or pid_t out of range, e.g., via a network share.
10240 Don't alloca where an auto var works fine.
10241
10242 * fileio.c: Fix some integer overflow issues.
10243 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
10244 Don't assume string length fits in int.
10245 (directory_file_name): Don't assume string length fits in long.
10246 (make_temp_name): Don't assume pid fits in int, or that its print
10247 length is less than 20.
10248
10249 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
10250
10251 * coding.c (make_subsidiaries): Don't assume string length fits in int.
10252
10253 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
10254
10255 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
10256 We prefer signed integers, even for size calculations.
10257
10258 * emacs.c: Don't assume string length fits in 'int'.
10259 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
10260 (main): Don't invoke strlen when not needed.
10261
10262 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
10263 (XD_DEBUG_MESSAGE): Don't waste a byte.
10264
10265 * callproc.c (getenv_internal_1, getenv_internal)
10266 (Fgetenv_internal):
10267 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
10268
10269 * lread.c (invalid_syntax): Omit length argument.
10270 All uses changed. This doesn't fix a bug, but it simplifies the
10271 code away from its former Hollerith-constant appearance, and it's
10272 one less 'int' to worry about when looking at integer-overflow issues.
10273 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
10274
10275 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
10276 This didn't break anything, but it didn't help either.
10277 It's confusing to put a bogus integer in a place where the actual
10278 value does not matter.
10279 (LIST_END_P): Remove unused macro and its bogus comment.
10280 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
10281
10282 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
10283 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
10284 implementation.
10285 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
10286 We prefer signed types, and the value cannot exceed the EMACS_INT
10287 range anyway (because otherwise the length would not be representable).
10288 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
10289 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
10290 This avoids a GCC warning when WIDE_EMACS_INT.
10291
10292 * indent.c (sane_tab_width): New function.
10293 (current_column, scan_for_column, Findent_to, position_indentation)
10294 (compute_motion): Use it. This is just for clarity.
10295 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
10296
10297 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
10298
10299 * lisp.h (lint_assume): New macro.
10300 * composite.c (composition_gstring_put_cache):
10301 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
10302
10303 * editfns.c, insdel.c:
10304 Omit unnecessary forward decls, to simplify future changes.
10305
10306 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
10307
10308 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
10309
10310 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
10311 Use much-faster test for byte-length change.
10312 Don't assume string byte-length fits in 'int'.
10313 Check that character arg fits in 'int'.
10314 (mapcar1): Declare byte as byte, for clarity.
10315
10316 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
10317
10318 * fns.c (concat): Catch string overflow earlier.
10319 Do not rely on integer wraparound.
10320
10321 * dispextern.h (struct it.overlay_strings_charpos)
10322 (struct it.selective): Now EMACS_INT, not int.
10323 * xdisp.c (forward_to_next_line_start)
10324 (back_to_previous_visible_line_start)
10325 (reseat_at_next_visible_line_start, next_element_from_buffer):
10326 Don't arbitrarily truncate the value of 'selective' to int.
10327
10328 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
10329
10330 * composite.c: Don't truncate sizes to 'int'.
10331 (composition_gstring_p, composition_reseat_it)
10332 (composition_adjust_point): Use EMACS_INT, not int.
10333 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
10334 not EMACS_UINT, for indexes.
10335
10336 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
10337
10338 * buffer.c: Include <verify.h>.
10339 (struct sortvec.priority, struct sortstr.priority):
10340 Now EMACS_INT, not int.
10341 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
10342 (struct sortstr.size, record_overlay_string)
10343 (struct sortstrlist.size, struct sortlist.used):
10344 Don't truncate size to int.
10345 (record_overlay_string): Check for size-calculation overflow.
10346 (init_buffer_once): Check at compile-time, not run-time.
10347
10348 2011-06-22 Jim Meyering <meyering@redhat.com>
10349
10350 Don't leak an XBM-image-sized buffer
10351 * image.c (xbm_load): Free the image buffer after using it.
10352
10353 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
10354
10355 Port to Sun C.
10356 * composite.c (find_automatic_composition): Omit needless 'return 0;'
10357 that Sun C diagnosed.
10358 * fns.c (secure_hash): Fix pointer signedness issue.
10359 * intervals.c (static_offset_intervals): New function.
10360 (offset_intervals): Use it.
10361
10362 2011-06-21 Leo Liu <sdl.web@gmail.com>
10363
10364 * deps.mk (fns.o):
10365 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
10366 sha512.h.
10367
10368 * fns.c (secure_hash): Rename from crypto_hash_function and change
10369 the first arg to accept symbols.
10370 (Fsecure_hash): New primitive.
10371 (syms_of_fns): New symbols.
10372
10373 2011-06-20 Deniz Dogan <deniz@dogan.se>
10374
10375 * process.c (Fset_process_buffer): Clarify return value in
10376 docstring.
10377
10378 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
10379
10380 * dispnew.c (add_window_display_history): Use BVAR.
10381
10382 * xdisp.c (debug_method_add): Use BVAR.
10383 (check_window_end, dump_glyph_matrix, dump_glyph)
10384 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10385
10386 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10387 Likewise.
10388
10389 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10390 check till after the cache is created in init_frame_faces.
10391
10392 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
10393
10394 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10395
10396 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
10397
10398 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10399 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10400 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10401
10402 Improve buffer-overflow checking (Bug#8873).
10403 * fileio.c (Finsert_file_contents):
10404 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10405 Remove the old (too-loose) buffer overflow checks.
10406 They weren't needed, since make_gap checks for buffer overflow.
10407 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10408 The old code merely checked for Emacs fixnum overflow, and relied
10409 on undefined (wraparound) behavior. The new code avoids undefined
10410 behavior, and also checks for ptrdiff_t and/or size_t overflow.
10411
10412 * editfns.c (Finsert_char): Don't dump core with very negative counts.
10413 Tune. Don't use wider integers than needed. Don't use alloca.
10414 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
10415
10416 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10417
10418 * insdel.c, lisp.h (buffer_overflow): New function.
10419 (insert_from_buffer_1, replace_range, replace_range_2):
10420 * insdel.c (make_gap_larger):
10421 * editfns.c (Finsert_char):
10422 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10423
10424 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10425
10426 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
10427
10428 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
10429
10430 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10431 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10432
10433 * fileio.c: Don't assume EMACS_INT fits in off_t.
10434 (emacs_lseek): New static function.
10435 (Finsert_file_contents, Fwrite_region): Use it.
10436 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10437
10438 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10439
10440 * fns.c: Don't overflow int when computing a list length.
10441 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10442 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10443 truncation on 64-bit hosts. Check for QUIT every
10444 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10445 faster and is responsive enough.
10446 (Flength): Report an error instead of overflowing an integer.
10447 (Fsafe_length): Return a float if the value is not representable
10448 as a fixnum. This shouldn't happen except in contrived situations.
10449 (Fnthcdr, Fsort): Don't assume list length fits in int.
10450 (Fcopy_sequence): Don't assume vector length fits in int.
10451
10452 * alloc.c: Check that resized vectors' lengths fit in fixnums.
10453 (header_size, word_size): New constants.
10454 (allocate_vectorlike): Don't check size overflow here.
10455 (allocate_vector): Check it here instead, since this is the only
10456 caller of allocate_vectorlike that could cause overflow.
10457 Check that the new vector's length is representable as a fixnum.
10458
10459 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10460 The previous code was bogus. For example, next_almost_prime (32)
10461 returned 39, which is undesirable as it is a multiple of 3; and
10462 next_almost_prime (24) returned 25, which is a multiple of 5 so
10463 why was the code bothering to check for multiples of 7?
10464
10465 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10466
10467 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10468
10469 Variadic C functions now count arguments with ptrdiff_t.
10470 This partly undoes my 2011-03-30 change, which replaced int with size_t.
10471 Back then I didn't know that the Emacs coding style prefers signed int.
10472 Also, in the meantime I found a few more instances where arguments
10473 were being counted with int, which may truncate counts on 64-bit
10474 machines, or EMACS_INT, which may be unnecessarily wide.
10475 * lisp.h (struct Lisp_Subr.function.aMANY)
10476 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10477 Arg counts are now ptrdiff_t, not size_t.
10478 All variadic functions and their callers changed accordingly.
10479 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
10480 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10481 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
10482 * callint.c (Fcall_interactively): Check arg count for overflow,
10483 to avoid potential buffer overrun. Use signed char, not 'int',
10484 for 'varies' array, so that we needn't bother to check its size
10485 calculation for overflow.
10486 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10487 * eval.c (apply_lambda):
10488 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10489 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
10490 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10491
10492 * callint.c (Fcall_interactively): Don't use index var as event count.
10493
10494 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10495 * mem-limits.h (SIZE): Remove; no longer used.
10496
10497 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
10498
10499 Remove unnecessary casts.
10500 * xterm.c (x_term_init):
10501 * xfns.c (x_set_border_pixel):
10502 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10503 These aren't needed now that we assume ANSI C.
10504
10505 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10506 It's more likely to cause problems (due to unsigned overflow)
10507 than to cure them.
10508
10509 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10510
10511 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10512
10513 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10514
10515 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10516
10517 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10518
10519 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10520
10521 GLYPH_CODE_FACE returns EMACS_INT, not int.
10522 * dispextern.h (merge_faces):
10523 * xfaces.c (merge_faces):
10524 * xdisp.c (get_next_display_element, next_element_from_display_vector):
10525 Don't assume EMACS_INT fits in int.
10526
10527 * character.h (CHAR_VALID_P): Remove unused parameter.
10528 * fontset.c, lisp.h, xdisp.c: All uses changed.
10529
10530 * editfns.c (Ftranslate_region_internal): Omit redundant test.
10531
10532 * fns.c (concat): Minor tuning based on overflow analysis.
10533 This doesn't fix any bugs. Use int to hold character, instead
10534 of constantly refetching from Emacs object. Use XFASTINT, not
10535 XINT, for value known to be a character. Don't bother comparing
10536 a single byte to 0400, as it's always less.
10537
10538 * floatfns.c (Fexpt):
10539 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
10540
10541 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
10542 for characters.
10543
10544 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
10545
10546 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
10547 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10548 incorrectly succeed when S was a string, because 4294967386 was
10549 truncated before it was used.
10550
10551 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10552 Otherwise, an out-of-range integer could cause undefined behavior
10553 on a 64-bit host.
10554
10555 * composite.c: Use int, not EMACS_INT, for characters.
10556 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10557 EMACS_INT, for values that are known to be in character range.
10558 This doesn't fix any bugs but is the usual style inside Emacs and
10559 may generate better code on 32-bit machines.
10560
10561 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10562 This is for reasons similar to the recent CHAR_STRING fix.
10563 * charset.c (Fencode_char): Check that character arg is actually
10564 a character. Pass an int to ENCODE_CHAR.
10565 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10566 wider than 'int', as a compile-time check to prevent future regressions
10567 in this area.
10568
10569 * character.c (char_string): Remove unnecessary casts.
10570
10571 Make sure a 64-bit char is never passed to CHAR_STRING.
10572 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10573 by silently ignoring the top 32 bits, allowing some values
10574 that were far too large to be valid characters.
10575 * character.h: Include <verify.h>.
10576 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10577 arguments are no wider than unsigned, as a compile-time check
10578 to prevent future regressions in this area.
10579 * data.c (Faset):
10580 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
10581 (Fsubst_char_in_region):
10582 * fns.c (concat):
10583 * xdisp.c (decode_mode_spec_coding):
10584 Adjust to CHAR_STRING's new requirement.
10585 * editfns.c (Finsert_char, Fsubst_char_in_region):
10586 * fns.c (concat): Check that character args are actually
10587 characters. Without this test, these functions did the wrong
10588 thing with wildly out-of-range values on 64-bit hosts.
10589
10590 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10591 These casts should not be needed on 32-bit hosts, either.
10592 * keyboard.c (read_char):
10593 * lread.c (Fload): Remove casts to unsigned.
10594
10595 * lisp.h (UNSIGNED_CMP): New macro.
10596 This fixes comparison bugs on 64-bit hosts.
10597 (ASCII_CHAR_P): Use it.
10598 * casefiddle.c (casify_object):
10599 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
10600 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10601 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10602 * dispextern.h (FACE_FROM_ID):
10603 * keyboard.c (read_char): Use UNSIGNED_CMP.
10604
10605 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10606 not to EMACS_INT, to avoid GCC warning.
10607
10608 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10609
10610 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10611 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10612 isn't needed on 32-bit machines.
10613
10614 * buffer.c (Fgenerate_new_buffer_name):
10615 Use EMACS_INT for count, not int.
10616 (advance_to_char_boundary): Return EMACS_INT, not int.
10617
10618 * data.c (Qcompiled_function): Now static.
10619
10620 * window.c (window_body_lines): Now static.
10621
10622 * image.c (gif_load): Rename local to avoid shadowing.
10623
10624 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10625 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10626 * alloc.c (make_save_value): Integer argument is now of type
10627 ptrdiff_t, not int.
10628 (mark_object): Use ptrdiff_t, not int.
10629 * lisp.h (pD): New macro.
10630 * print.c (print_object): Use it.
10631
10632 * alloc.c: Use EMACS_INT, not int, to count objects.
10633 (total_conses, total_markers, total_symbols, total_vector_size)
10634 (total_free_conses, total_free_markers, total_free_symbols)
10635 (total_free_floats, total_floats, total_free_intervals)
10636 (total_intervals, total_strings, total_free_strings):
10637 Now EMACS_INT, not int. All uses changed.
10638 (Fgarbage_collect): Compute overall total using a double, so that
10639 integer overflow is less likely to be a problem. Check for overflow
10640 when converting back to an integer.
10641 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10642 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10643 These were 'int' variables that could overflow on 64-bit hosts;
10644 they were never used, so remove them instead of repairing them.
10645 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
10646 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10647 Previously, this ceilinged at INT_MAX, but that doesn't work on
10648 64-bit machines.
10649 (allocate_pseudovector): Don't use EMACS_INT when int would do.
10650
10651 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
10652 (allocate_vectorlike): Check for ptrdiff_t overflow.
10653 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10654 when a (possibly-narrower) signed value would do just as well.
10655 We prefer using signed arithmetic, to avoid comparison confusion.
10656
10657 * alloc.c: Catch some string size overflows that we were missing.
10658 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10659 for convenience in STRING_BYTES_MAX.
10660 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10661 The definition here is exact; the one in lisp.h was approximate.
10662 (allocate_string_data): Check for string overflow. This catches
10663 some instances we weren't catching before. Also, it catches
10664 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10665 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10666 and ptrdiff_t and EMACS_INT are both 64 bits.
10667
10668 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10669 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
10670 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
10671
10672 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10673
10674 * alloc.c (Fmake_string): Check for out-of-range init.
10675
10676 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10677
10678 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10679
10680 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10681
10682 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10683 xg_get_default_scrollbar_width.
10684
10685 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10686 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10687 (style_changed_cb): Call update_theme_scrollbar_width and call
10688 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10689 all frames (Bug#8505).
10690 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10691 Call gtk_window_set_resizable if HAVE_GTK3.
10692 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10693 and height if HAVE_GTK3 (Bug#8505).
10694 (scroll_bar_width_for_theme): New variable.
10695 (update_theme_scrollbar_width): New function.
10696 (xg_get_default_scrollbar_width): Move code to
10697 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10698 (xg_initialize): Call update_theme_scrollbar_width.
10699
10700 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10701
10702 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10703
10704 2011-06-12 Martin Rudalics <rudalics@gmx.at>
10705
10706 * frame.c (make_frame): Call other_buffer_safely instead of
10707 other_buffer.
10708
10709 * window.c (temp_output_buffer_show): Call display_buffer with
10710 second argument Vtemp_buffer_show_specifiers and reset latter
10711 immediately after the call.
10712 (Vtemp_buffer_show_specifiers): New variable.
10713 (auto_window_vscroll_p, next_screen_context_lines)
10714 (Vscroll_preserve_screen_position): Remove leading asterisks from
10715 doc-strings.
10716
10717 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
10718
10719 Fix minor problems found by GCC 4.6.0 static checking.
10720 * buffer.c (Qclone_number): Remove for now, as it's unused.
10721 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10722 (record_buffer): Remove unused local.
10723 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10724 (set_frame_buffer_list): Remove; unused.
10725 * frame.h (other_visible_frames): Remove decl.
10726 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10727 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10728 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10729 if HAVE_GPM.
10730 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10731 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10732 Define only if HAVE_GPM.
10733 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10734 (update_hints_inhibit): Remove; never set. All uses removed.
10735 * widgetprv.h (emacsFrameClassRec): Remove decl.
10736 * window.c (delete_deletable_window): Now returns void, since it
10737 wasn't returning anything.
10738 (compare_window_configurations): Remove unused locals.
10739 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10740 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
10741 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10742 the same widths as pointers. This follows up on the 2011-05-06 patch.
10743 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10744 * xterm.h: Likewise.
10745 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10746
10747 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
10748
10749 * makefile.w32-in: Update dependencies.
10750 (LISP_H): Add lib/intprops.h.
10751
10752 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10753
10754 * image.c (gif_load): Add animation frame delay to the metadata.
10755 (syms_of_image): Use DEFSYM. New symbol `delay'.
10756
10757 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10758
10759 * window.c (delete_deletable_window): Re-add.
10760 (Fset_window_configuration): Rewrite to handle dead buffers and
10761 consequently deletable windows.
10762 (window_tree, Fwindow_tree): Remove. Supply functionality in
10763 window.el.
10764 (compare_window_configurations): Simplify code.
10765
10766 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10767
10768 * image.c (imagemagick_load_image): Fix type mismatch.
10769 (Fimagemagick_types): Likewise.
10770
10771 * window.h (replace_buffer_in_windows): Declare.
10772
10773 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10774
10775 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
10776 Qclone_number. Remove external declaration of Qdelete_window.
10777 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
10778 code.
10779 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
10780 Run Qbuffer_list_update_hook if allowed.
10781 (Fother_buffer): Rewrite doc-string. Major rewrite for new
10782 buffer list implementation.
10783 (other_buffer_safely): New function.
10784 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
10785 calls to replace_buffer_in_windows and
10786 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
10787 if allowed.
10788 (record_buffer): Inhibit quitting and rewrite using quittable
10789 functions. Run Qbuffer_list_update_hook if allowed.
10790 (Frecord_buffer, Funrecord_buffer): New functions.
10791 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
10792 Move switch-to-buffer to window.el.
10793 (bury-buffer): Move to window.el.
10794 (Vbuffer_list_update_hook): New variable.
10795
10796 * lisp.h (other_buffer_safely): Add prototype in buffer.c
10797 section.
10798
10799 * window.h (resize_frame_windows): Move up in code.
10800 (Fwindow_frame): Remove EXFUN.
10801 (replace_buffer_in_all_windows): Remove prototype.
10802 (replace_buffer_in_windows_safely): Add prototype.
10803
10804 * window.c: Declare Qdelete_window static again. Move down
10805 declaration of select_count.
10806 (Fnext_window, Fprevious_window): Rewrite doc-strings.
10807 (Fother_window): Move to window.el.
10808 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
10809 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
10810 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
10811 window.el.
10812 (replace_buffer_in_windows): Implement by calling
10813 Qreplace_buffer_in_windows.
10814 (replace_buffer_in_all_windows): Remove with some functionality
10815 moved into replace_buffer_in_windows_safely.
10816 (replace_buffer_in_windows_safely): New function.
10817 (select_window_norecord, select_frame_norecord): Move in front
10818 of run_window_configuration_change_hook. Remove now obsolete
10819 declarations.
10820 (Fset_window_buffer): Rewrite doc-string.
10821 Call Qrecord_window_buffer.
10822 (keys_of_window): Move binding for other-window to window.el.
10823
10824 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10825
10826 * dispextern.h (struct image): Replace data member, whose int_val
10827 and ptr_val fields were not used by anything, with a single
10828 lisp_val object.
10829
10830 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
10831 (gif_clear_image, gif_load, imagemagick_load_image)
10832 (gs_clear_image, gs_load): Callers changed.
10833
10834 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
10835
10836 * buffer.h: Include <time.h>, for time_t.
10837 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
10838
10839 Fix minor problems found by static checking.
10840
10841 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
10842
10843 Make identifiers static if they are not used in other modules.
10844 * data.c (Qcompiled_function, Qframe, Qvector):
10845 * image.c (QimageMagick, Qsvg):
10846 * minibuf.c (Qmetadata):
10847 * window.c (resize_window_check, resize_root_window): Now static.
10848 * window.h (resize_window_check, resize_root_window): Remove decls.
10849
10850 * window.c (window_deletion_count, delete_deletable_window):
10851 Remove; unused.
10852 (window_body_lines): Now static.
10853 (Fdelete_other_windows_internal): Mark vars as initialized.
10854 Make sure 'resize_failed' is initialized.
10855 (run_window_configuration_change_hook): Rename local to avoid shadowing.
10856 (resize_window_apply): Remove unused local.
10857 * window.h (delete_deletable_window): Remove decl.
10858
10859 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
10860 (imagemagick_load_image): Fix pointer signedness problem by changing
10861 last arg from unsigned char * to char *. All uses changed.
10862 Also, fix a local for similar reasons.
10863 Remove unused locals. Remove locals to avoid shadowing.
10864 (fn_rsvg_handle_free): Remove; unused.
10865 (svg_load, svg_load_image): Fix pointer signedness problem.
10866 (imagemagick_load_image): Don't use garbage pointer image_wand.
10867
10868 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
10869
10870 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
10871
10872 * image.c (gif_load): Fix omitted cast error introduced by
10873 2011-06-06 change.
10874
10875 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10876
10877 * window.h (resize_proportionally, orig_total_lines)
10878 (orig_top_line): Remove from window structure.
10879 (set_window_height, set_window_width, change_window_heights)
10880 (Fdelete_window): Remove prototypes.
10881 (resize_frame_windows): Remove duplicate declaration.
10882
10883 2011-06-10 Eli Zaretskii <eliz@gnu.org>
10884
10885 * window.h (resize_frame_windows, resize_window_check)
10886 (delete_deletable_window, resize_root_window)
10887 (resize_frame_windows): Declare prototypes.
10888
10889 * window.c (resize_window_apply): Make definition be "static" to
10890 match the prototype.
10891
10892 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10893
10894 * window.c: Remove declarations of Qwindow_size_fixed,
10895 window_min_size_1, window_min_size_2, window_min_size,
10896 size_window, window_fixed_size_p, enlarge_window, delete_window.
10897 Remove static from declaration of Qdelete_window, it's
10898 temporarily needed by Fbury_buffer.
10899 (replace_window): Don't assign orig_top_line and
10900 orig_total_lines.
10901 (Fdelete_window, delete_window): Remove. Window deletion is
10902 handled by window.el.
10903 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10904 Replace Fdelete_window calls with calls to Qdelete_window.
10905 (Fdelete_other_windows): Remove. Deleting other windows is
10906 handled by window.el.
10907 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10908 handled in window.el.
10909 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10910 Window minimum sizes are handled in window.el.
10911 (shrink_windows, size_window, set_window_height)
10912 (set_window_width, change_window_heights, window_height)
10913 (window_width, CURBEG, CURSIZE, enlarge_window)
10914 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10915 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10916 handled in window.el.
10917 (make_dummy_parent): Rename to make_parent_window and give it a
10918 second argument horflag.
10919 (make_window): Don't set resize_proportionally any more.
10920 (Fsplit_window): Remove. Windows are split in window.el.
10921 (save_restore_action, save_restore_orig_size)
10922 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10923 Resize mini windows in window.el.
10924 (grow_mini_window, shrink_mini_window): Implement by calling
10925 Qresize_root_window_vertically, resize_window_check and
10926 resize_window_apply.
10927 (saved_window, Fset_window_configuration, save_window_save):
10928 Do not handle orig_top_line, orig_total_lines, and
10929 resize_proportionally.
10930 (window_min_height, window_min_width): Move to window.el.
10931 (keys_of_window): Move bindings for delete-other-windows,
10932 split-window, delete-window and enlarge-window to window.el.
10933
10934 * buffer.c: Temporarily extern Qdelete_window.
10935 (Fbury_buffer): Temporarily call Qdelete_window instead of
10936 Fdelete_window (Fbury_buffer will move to window.el soon).
10937
10938 * frame.c (set_menu_bar_lines_1): Remove code handling
10939 orig_top_line and orig_total_lines.
10940
10941 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10942 set_window_height but set heights directly.
10943 (change_frame_size_1): Use resize_frame_windows.
10944
10945 * xdisp.c (init_xdisp): Don't use set_window_height but set
10946 heights directly.
10947
10948 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10949 Use resize_frame_windows instead of change_window_heights and run
10950 run_window_configuration_change_hook.
10951
10952 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10953 instead of change_window_heights and run
10954 run_window_configuration_change_hook.
10955
10956 2011-06-09 Martin Rudalics <rudalics@gmx.at>
10957
10958 * window.c (replace_window): Rename second argument REPLACEMENT to
10959 NEW. New third argument SETFLAG. Rewrite.
10960 (delete_window, make_dummy_parent): Call replace_window with
10961 third argument 1.
10962 (window_list_1): Move down in code.
10963 (run_window_configuration_change_hook): Move set_buffer part
10964 before select_frame_norecord part in order to unwind correctly.
10965 Rename count1 to count.
10966 (recombine_windows, delete_deletable_window, resize_root_window)
10967 (Fdelete_other_windows_internal)
10968 (Frun_window_configuration_change_hook, make_parent_window)
10969 (resize_window_check, resize_window_apply, Fresize_window_apply)
10970 (resize_frame_windows, Fsplit_window_internal)
10971 (Fdelete_window_internal, Fresize_mini_window_internal):
10972 New functions.
10973 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10974
10975 2011-06-08 Martin Rudalics <rudalics@gmx.at>
10976
10977 * window.h (window): Add some new members to window structure -
10978 normal_lines, normal_cols, new_total, new_normal, clone_number,
10979 splits, nest, prev_buffers, next_buffers.
10980 (WINDOW_TOTAL_SIZE): Move here from window.c.
10981 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
10982
10983 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10984 Remove.
10985 (make_dummy_parent): Set new members of windows structure.
10986 (make_window): Move down in code. Handle new members of window
10987 structure.
10988 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10989 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10990 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10991 (Fset_window_prev_buffers, Fwindow_next_buffers)
10992 (Fset_window_next_buffers, Fset_window_clone_number):
10993 New functions.
10994 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10995 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10996 Doc-string fixes.
10997 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10998 Argument WINDOW can be now internal window too.
10999 (Fwindow_use_time): Move up in code.
11000 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
11001 Rewrite doc-string.
11002 (Fset_window_configuration, saved_window)
11003 (Fcurrent_window_configuration, save_window_save): Handle new
11004 members of window structure.
11005 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
11006 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
11007 (syms_of_window): New Lisp objects Qrecord_window_buffer,
11008 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
11009 Qget_mru_window, Qresize_root_window,
11010 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
11011 Qauto_buffer_name; staticpro them.
11012
11013 2011-06-07 Martin Rudalics <rudalics@gmx.at>
11014
11015 * window.c (Fwindow_total_size, Fwindow_left_column)
11016 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
11017 (Fwindow_list_1): New functions.
11018 (window_box_text_cols): Replace with window_body_cols.
11019 (Fwindow_width, Fscroll_left, Fscroll_right):
11020 Use window_body_cols instead of window_box_text_cols.
11021 (delete_window, Fset_window_configuration):
11022 Call delete_all_subwindows with window as argument.
11023 (delete_all_subwindows): Take a window as argument and not a
11024 structure. Rewrite.
11025 (window_loop): Remove handling of GET_LRU_WINDOW and
11026 GET_LARGEST_WINDOW.
11027 (Fget_lru_window, Fget_largest_window): Move to window.el.
11028
11029 * window.h: Extern window_body_cols instead of
11030 window_box_text_cols. delete_all_subwindows now takes a
11031 Lisp_Object as argument.
11032
11033 * indent.c (compute_motion, Fcompute_motion):
11034 Use window_body_cols instead of window_box_text_cols.
11035
11036 * frame.c (delete_frame): Call delete_all_subwindows with root
11037 window as argument.
11038
11039 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
11040
11041 * fns.c (Fputhash): Document return value.
11042
11043 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
11044
11045 * image.c (gif_load): Implement gif89a spec "no disposal" method.
11046
11047 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11048
11049 Cons<->int and similar integer overflow fixes (Bug#8794).
11050
11051 Check for overflow when converting integer to cons and back.
11052 * charset.c (Fdefine_charset_internal, Fdecode_char):
11053 Use cons_to_unsigned to catch overflow.
11054 (Fencode_char): Use INTEGER_TO_CONS.
11055 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
11056 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
11057 * data.c (long_to_cons, cons_to_long): Remove.
11058 (cons_to_unsigned, cons_to_signed): New functions.
11059 These signal an error for invalid or out-of-range values.
11060 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
11061 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
11062 * font.c (Ffont_variation_glyphs):
11063 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
11064 * lisp.h: Include <intprops.h>.
11065 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
11066 (cons_to_signed, cons_to_unsigned): New decls.
11067 (long_to_cons, cons_to_long): Remove decls.
11068 * undo.c (record_first_change): Use INTEGER_TO_CONS.
11069 (Fprimitive_undo): Use CONS_TO_INTEGER.
11070 * xfns.c (Fx_window_property): Likewise.
11071 * xselect.c: Include <limits.h>.
11072 (x_own_selection, selection_data_to_lisp_data):
11073 Use INTEGER_TO_CONS.
11074 (x_handle_selection_request, x_handle_selection_clear)
11075 (x_get_foreign_selection, Fx_disown_selection_internal)
11076 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
11077 (lisp_data_to_selection_data): Use cons_to_unsigned.
11078 (x_fill_property_data): Use cons_to_signed.
11079 Report values out of range.
11080
11081 Check for buffer and string overflow more precisely.
11082 * buffer.h (BUF_BYTES_MAX): New macro.
11083 * lisp.h (STRING_BYTES_MAX): New macro.
11084 * alloc.c (Fmake_string):
11085 * character.c (string_escape_byte8):
11086 * coding.c (coding_alloc_by_realloc):
11087 * doprnt.c (doprnt):
11088 * editfns.c (Fformat):
11089 * eval.c (verror):
11090 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
11091 since they may not be the same number.
11092 * editfns.c (Finsert_char):
11093 * fileio.c (Finsert_file_contents):
11094 Likewise for BUF_BYTES_MAX.
11095
11096 * image.c: Use ptrdiff_t, not int, for sizes.
11097 (slurp_file): Switch from int to ptrdiff_t.
11098 All uses changed.
11099 (slurp_file): Check that file size fits in both size_t (for
11100 malloc) and ptrdiff_t (for sanity and safety).
11101
11102 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
11103 if b->modtime has its maximal value.
11104
11105 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
11106
11107 Don't assume time_t can fit into int.
11108 * buffer.h (struct buffer.modtime): Now time_t, not int.
11109 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
11110 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
11111
11112 Minor fixes for signed vs unsigned integers.
11113 * character.h (MAYBE_UNIFY_CHAR):
11114 * charset.c (maybe_unify_char):
11115 * keyboard.c (read_char, reorder_modifiers):
11116 XINT -> XFASTINT, since the integer must be nonnegative.
11117 * ftfont.c (ftfont_spec_pattern):
11118 * keymap.c (access_keymap, silly_event_symbol_error):
11119 XUINT -> XFASTINT, since the integer must be nonnegative.
11120 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
11121 since it makes no difference and we prefer signed.
11122 * keyboard.c (record_char): Use XUINT when all the neighbors do.
11123 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
11124 nonnegative.
11125
11126 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
11127
11128 * window.h (Fwindow_frame): Declare.
11129
11130 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11131
11132 * alloc.c: Simplify handling of large-request failures (Bug#8800).
11133 (SPARE_MEMORY): Always define.
11134 (LARGE_REQUEST): Remove.
11135 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
11136
11137 2011-06-06 Martin Rudalics <rudalics@gmx.at>
11138
11139 * lisp.h: Move EXFUNS for Fframe_root_window,
11140 Fframe_first_window and Fset_frame_selected_window to window.h.
11141
11142 * window.h: Move EXFUNS for Fframe_root_window,
11143 Fframe_first_window and Fset_frame_selected_window here from
11144 lisp.h.
11145
11146 * frame.c (Fwindow_frame, Fframe_first_window)
11147 (Fframe_root_window, Fframe_selected_window)
11148 (Fset_frame_selected_window): Move to window.c.
11149 (Factive_minibuffer_window): Move to minibuf.c.
11150 (Fother_visible_frames_p): New function.
11151
11152 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
11153
11154 * window.c (decode_window, decode_any_window): Move up in code.
11155 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
11156 (inhibit_frame_unsplittable): Remove unused variable.
11157 (Fwindow_buffer): Move up and rewrite doc-string.
11158 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
11159 (Fwindow_prev): New functions.
11160 (Fwindow_frame): Move here from frame.c. Accept any window as
11161 argument.
11162 (Fframe_root_window, Fframe_first_window)
11163 (Fframe_selected_window): Move here from frame.c. Accept frame
11164 or arbitrary window as argument. Update doc-strings.
11165 (Fminibuffer_window): Move up in code.
11166 (Fwindow_minibuffer_p): Move up in code and simplify.
11167 (Fset_frame_selected_window): Move here from frame.c.
11168 Marginal rewrite.
11169 (Fselected_window, select_window, Fselect_window): Move up in
11170 code. Minor doc-string fixes.
11171
11172 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11173
11174 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
11175 Do not assume that spare memory exists; that assumption is valid
11176 only if SYSTEM_MALLOC.
11177 (LARGE_REQUEST): New macro, so that the issue of large requests
11178 is separated from the issue of spare memory.
11179
11180 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
11181
11182 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
11183 format. (Bug#8806)
11184
11185 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
11186
11187 * xfns.c (x_set_scroll_bar_default_width): Move declarations
11188 before statements.
11189
11190 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
11191
11192 * gtkutil.c (xg_get_default_scrollbar_width): New function.
11193
11194 * gtkutil.h: Declare xg_get_default_scrollbar_width.
11195
11196 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
11197 min width by calling x_set_scroll_bar_default_width (Bug#8505).
11198
11199 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
11200
11201 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
11202
11203 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
11204
11205 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
11206 (x_clipboard_manager_save): Add return value.
11207 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
11208 New error handlers.
11209 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
11210 Obey Vx_select_enable_clipboard_manager. Catch errors in
11211 x_clipboard_manager_save (Bug#8779).
11212 (Vx_select_enable_clipboard_manager): New variable.
11213 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
11214
11215 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
11216
11217 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
11218
11219 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11220
11221 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
11222 in the current matrix if keep_current_p is non-zero.
11223
11224 2011-06-04 Eli Zaretskii <eliz@gnu.org>
11225
11226 * bidi.c (bidi_level_of_next_char): Fix last change.
11227
11228 2011-06-03 Eli Zaretskii <eliz@gnu.org>
11229
11230 Support bidi reordering of text covered by display properties.
11231
11232 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
11233 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
11234 (bidi_cache_search, bidi_cache_iterator_state)
11235 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11236 (bidi_level_of_next_char, bidi_move_to_visually_next):
11237 Support character positions inside a run of characters covered by a
11238 display string.
11239 (bidi_paragraph_init, bidi_resolve_explicit_1)
11240 (bidi_level_of_next_char): Call bidi_fetch_char and
11241 bidi_fetch_char_advance instead of FETCH_CHAR and
11242 FETCH_CHAR_ADVANCE.
11243 (bidi_init_it): Initialize new members.
11244 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
11245 definitions.
11246 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
11247 instead of using explicit *_CHAR codes.
11248 (bidi_resolve_explicit, bidi_resolve_weak):
11249 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
11250 bidirectional text is supported only in multibyte buffers.
11251 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
11252 it to initialize the frame_window_p member of struct bidi_it.
11253 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
11254 (bidi_resolve_explicit, bidi_resolve_weak)
11255 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
11256 bidi_it->nchars is non-positive.
11257 (bidi_level_of_next_char): Don't try to lookup the cache for the
11258 next/previous character if nothing is cached there yet, or if we
11259 were just reseat()'ed to a new position.
11260
11261 * xdisp.c (set_cursor_from_row): Set start and stop points
11262 according to the row's direction when priming the loop that looks
11263 for the glyph on which to display cursor.
11264 (single_display_spec_intangible_p): Function deleted.
11265 (display_prop_intangible_p): Reimplement to call
11266 handle_display_spec instead of single_display_spec_intangible_p.
11267 Accept 3 additional arguments needed by handle_display_spec.
11268 This fixes incorrect cursor motion across display property with complex
11269 values: lists, `(when COND...)' forms, etc.
11270 (single_display_spec_string_p): Support property values that are
11271 lists with the argument STRING its top-level element.
11272 (display_prop_string_p): Fix the condition for processing a
11273 property that is a list to be consistent with handle_display_spec.
11274 (handle_display_spec): New function, refactored from the
11275 last portion of handle_display_prop.
11276 (compute_display_string_pos): Accept additional argument
11277 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
11278 value of a `display' property is a "replacing spec".
11279 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
11280 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
11281 the display property, but just return a value indicating whether
11282 the display property will replace the characters it covers.
11283 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
11284 frame_window_p members of struct bidi_it.
11285 (compute_display_string_pos, compute_display_string_end):
11286 New functions.
11287 (push_it): Accept second argument POSITION, where pop_it should
11288 jump to continue iteration.
11289 (reseat_1): Initialize bidi_it.disp_pos.
11290
11291 * keyboard.c (adjust_point_for_property): Adjust the call to
11292 display_prop_intangible_p to its new signature.
11293
11294 * dispextern.h (struct bidi_it): New member frame_window_p.
11295 (bidi_init_it): Update prototypes.
11296 (display_prop_intangible_p): Update prototype.
11297 (compute_display_string_pos, compute_display_string_end):
11298 Declare prototypes.
11299 (struct bidi_it): New members nchars and disp_pos. ch_len is now
11300 EMACS_INT.
11301
11302 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 Malloc failure behavior now depends on size of allocation.
11305 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
11306 * lisp.h: Change signatures accordingly.
11307 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
11308 All callers changed. (Bug#8762)
11309
11310 * gnutls.c: Use Emacs's memory allocators.
11311 Without this change, the gnutls library would invoke malloc etc.
11312 directly, which causes problems on non-SYNC_INPUT hosts, and which
11313 runs afoul of improving memory_full behavior. (Bug#8761)
11314 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
11315 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
11316 xfree instead of the default malloc, realloc, free.
11317 (Fgnutls_boot): No need to check for memory allocation failure,
11318 since xmalloc does that for us.
11319
11320 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
11321 * category.c (hash_get_category_set):
11322 * ccl.c (ccl_driver):
11323 * charset.c (Fdefine_charset_internal):
11324 * charset.h (struct charset.hash_index):
11325 * composite.c (get_composition_id, gstring_lookup_cache)
11326 (composition_gstring_put_cache):
11327 * composite.h (struct composition.hash_index):
11328 * dispextern.h (struct image.hash):
11329 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
11330 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
11331 (hashfn_equal, hashfn_user_defined, make_hash_table)
11332 (maybe_resize_hash_table, hash_lookup, hash_put)
11333 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
11334 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
11335 (Fsxhash, Fgethash, Fputhash, Fmaphash):
11336 * image.c (make_image, search_image_cache, lookup_image)
11337 (xpm_put_color_table_h):
11338 * lisp.h (struct Lisp_Hash_Table):
11339 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
11340 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
11341 for hashes and hash indexes, instead of 'unsigned' and 'int'.
11342 * alloc.c (allocate_vectorlike):
11343 Check for overflow in vector size calculations.
11344 * ccl.c (ccl_driver):
11345 Check for overflow when converting EMACS_INT to int.
11346 * fns.c, image.c: Remove unnecessary static decls that would otherwise
11347 need to be updated by these changes.
11348 * fns.c (make_hash_table, maybe_resize_hash_table):
11349 Check for integer overflow with large hash tables.
11350 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
11351 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
11352 (SXHASH_REDUCE): New macro.
11353 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
11354 Use it instead of discarding useful hash info with large hash values.
11355 (sxhash_float): New function.
11356 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
11357 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
11358 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
11359 Rewrite to use FIXNUM_BITS, as this simplifies things.
11360 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
11361 Adjust signatures to match updated version of code.
11362 (consing_since_gc): Now EMACS_INT, since a single hash table can
11363 use more than INT_MAX bytes.
11364
11365 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
11366
11367 Make it possible to build with GCC-4.6+ -O2 -flto.
11368
11369 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
11370
11371 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
11372
11373 * minibuf.c (get_minibuffer, read_minibuf_unwind):
11374 Call minibuffer-inactive-mode.
11375
11376 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
11377
11378 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
11379 Update dependencies.
11380
11381 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11382
11383 * data.c (init_data): Remove code for UTS, this system is not
11384 supported anymore.
11385
11386 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11387
11388 Don't force ./temacs to start in terminal mode.
11389
11390 * frame.c (make_initial_frame): Initialize faces in all cases, not
11391 only when CANNOT_DUMP is defined.
11392 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11393
11394 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11395
11396 * dispnew.c (add_window_display_history): Use const for the string
11397 pointer. Remove declaration, not needed.
11398
11399 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11400
11401 Use 'inline', not 'INLINE'.
11402 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
11403 * alloc.c, fontset.c (INLINE): Remove.
11404 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11405 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11406 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11407 * gmalloc.c (register_heapinfo): Use inline unconditionally.
11408 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11409
11410 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11411
11412 Make it possible to run ./temacs.
11413
11414 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11415 syms_of_callproc does the same thing. Remove test for
11416 "initialized", do it in the caller.
11417 * emacs.c (main): Avoid calling set_initial_environment when dumping.
11418
11419 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
11420
11421 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11422 (read_minibuf): Use get_minibuffer.
11423 (syms_of_minibuf): Use DEFSYM.
11424 (Qmetadata): New var.
11425 * data.c (Qbuffer): Don't make it static.
11426 (syms_of_data): Use DEFSYM.
11427
11428 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11429
11430 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
11431 (CCL_CODE_MIN): New macro.
11432
11433 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
11434
11435 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11436
11437 * eval.c (Qdebug): Now static.
11438 * lisp.h (Qdebug): Remove decl. This reverts a part of the
11439 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11440 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11441
11442 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11443
11444 * image.c: Various fixes to ImageMagick code comments.
11445 (Fimagemagick_types): Doc fix.
11446
11447 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
11448
11449 Minor fixes prompted by GCC 4.6.0 warnings.
11450
11451 * xselect.c (converted_selections, conversion_fail_tag): Now static.
11452
11453 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11454 (x_clipboard_manager_save_all): Move extern decl to ...
11455 * xterm.h: ... here, so that it can be checked for consistency.
11456
11457 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11458
11459 * xselect.c (x_clipboard_manager_save_frame)
11460 (x_clipboard_manager_save_all): New functions.
11461 (Fx_clipboard_manager_save): Lisp function deleted.
11462
11463 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11464 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11465
11466 * xterm.h: Update prototype.
11467
11468 2011-05-28 William Xu <william.xwl@gmail.com>
11469
11470 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11471 exiting (Bug#8239).
11472
11473 2011-05-28 Jim Meyering <meyering@redhat.com>
11474
11475 Avoid a sign-extension bug in crypto_hash_function.
11476 * fns.c (to_uchar): Define.
11477 (crypto_hash_function): Use it to convert some newly-signed
11478 variables to unsigned, to avoid sign-extension bugs. For example,
11479 without this change, (md5 "truc") would evaluate to
11480 45723a2aff78ff4fff7fff1114760e62 rather than the expected
11481 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
11482 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
11483
11484 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11485
11486 Integer overflow fixes.
11487
11488 * dbusbind.c: Serial number integer overflow fixes.
11489 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
11490 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11491 to hold a serial number that is too large for a fixnum.
11492 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11493 Check for serial numbers out of range. Decode any serial number
11494 that was so large that it became a float. (Bug#8722)
11495
11496 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11497 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11498 Use XFASTINT rather than XUINT when numbers are nonnegative.
11499 (xd_append_arg, Fdbus_method_return_internal):
11500 (Fdbus_method_error_internal): Likewise. Also, for unsigned
11501 arguments, check that Lisp number is nonnegative, rather than
11502 silently wrapping negative numbers around. (Bug#8722)
11503 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
11504 (Bug#8722)
11505
11506 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11507
11508 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11509
11510 ccl: Add integer overflow checks.
11511 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11512 (IN_INT_RANGE): New macros.
11513 (ccl_driver): Use them to check for integer overflow when
11514 decoding a CCL program. Many of the new checks are whether XINT (x)
11515 fits in int; it doesn't always, on 64-bit hosts. The new version
11516 doesn't catch all possible integer overflows, but it's an
11517 improvement. (Bug#8719)
11518
11519 * alloc.c (make_event_array): Use XINT, not XUINT.
11520 There's no need for unsigned here.
11521
11522 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11523 This follows up to the 2011-05-06 change that substituted uintptr_t
11524 for EMACS_INT. This case wasn't caught back then.
11525
11526 Rework Fformat to avoid integer overflow issues.
11527 * editfns.c: Include <float.h> unconditionally, as it's everywhere
11528 now (part of C89). Include <verify.h>.
11529 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
11530 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
11531 (Fformat): Avoid the prepass trying to compute sizes; it was only
11532 approximate and thus did not catch overflow reliably. Instead, walk
11533 through the format just once, formatting and computing sizes as we go,
11534 checking for integer overflow at every step, and allocating a larger
11535 buffer as needed. Keep track separately whether the format is
11536 multibyte. Keep only the most-recently calculated precision, rather
11537 than them all. Record whether each argument has been converted to
11538 string. Use EMACS_INT, not int, for byte and char and arg counts.
11539 Support field widths and precisions larger than INT_MAX. Avoid
11540 sprintf's undefined behavior with conversion specifications such as %#d
11541 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
11542 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
11543 formatting out-of-range floating point numbers with int
11544 formats. (Bug#8668)
11545
11546 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
11547
11548 * data.c: Avoid integer truncation in expressions involving floats.
11549 * data.c: Include <intprops.h>.
11550 (arith_driver): When there's an integer overflow in an expression
11551 involving floating point, convert the integers to floating point
11552 so that the resulting value does not suffer from catastrophic
11553 integer truncation. For example, on a 64-bit host (* 4
11554 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11555 Do not rely on undefined behavior after integer overflow.
11556
11557 merge count_size_as_multibyte, parse_str_to_multibyte
11558 * character.c, character.h (count_size_as_multibyte):
11559 Rename from parse_str_to_multibyte; all uses changed.
11560 Check for integer overflow.
11561 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11562 since it's now a duplicate of the other. This is more of
11563 a character than a buffer op, so better that it's in character.c.
11564 * fns.c, print.c: Adjust to above changes.
11565
11566 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11567
11568 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11569
11570 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11571
11572 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11573 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11574 (x_clipboard_manager_save): Now static.
11575 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11576
11577 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11578 (crypto_hash_function): Now static.
11579 Fix pointer signedness problems. Avoid unnecessary initializations.
11580
11581 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
11582
11583 * termhooks.h (Vselection_alist): Make it terminal-local.
11584
11585 * terminal.c (create_terminal): Initialize it.
11586
11587 * xselect.c: Support for clipboard managers.
11588 (Vselection_alist): Move to termhooks.h as terminal-local var.
11589 (LOCAL_SELECTION): New macro.
11590 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11591 (symbol_to_x_atom): Remove gratuitous arg.
11592 (x_handle_selection_request, lisp_data_to_selection_data)
11593 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
11594 (x_own_selection, x_get_local_selection, x_convert_selection):
11595 New arg, specifying work frame. Use terminal-local Vselection_alist.
11596 (some_frame_on_display): Delete unused function.
11597 (Fx_own_selection_internal, Fx_get_selection_internal)
11598 (Fx_disown_selection_internal, Fx_selection_owner_p)
11599 (Fx_selection_exists_p): New optional frame arg.
11600 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11601 (x_handle_selection_clear): Don't treat other terminals with the
11602 same keyboard specially. Use the terminal-local Vselection_alist.
11603 (x_clear_frame_selections): Use Frun_hook_with_args.
11604
11605 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11606
11607 * xterm.h: Add support for those atoms.
11608
11609 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
11610
11611 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11612 (converted_selections, conversion_fail_tag): New global variables.
11613 (x_selection_request_lisp_error): Free the above.
11614 (x_get_local_selection): Remove unnecessary code.
11615 (x_reply_selection_request): Args changed; handle arbitrary array
11616 of converted selections stored in converted_selections.
11617 Separate the XChangeProperty and SelectionNotify steps.
11618 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11619 (x_convert_selection): New function.
11620 (x_handle_selection_event): Simplify.
11621 (x_get_foreign_selection): Don't ignore incoming requests while
11622 waiting for an answer; this will fail when we implement
11623 SAVE_TARGETS, and seems unnecessary anyway.
11624 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11625 (Vx_sent_selection_functions): Doc fix.
11626
11627 2011-05-26 Leo Liu <sdl.web@gmail.com>
11628
11629 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11630
11631 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11632
11633 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11634
11635 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11636 for fringe update if it has periodic bitmap.
11637 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
11638 and fringe_bitmap_periodic_p.
11639
11640 * fringe.c (get_fringe_bitmap_data): New function.
11641 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11642 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11643 row. Mark glyph row for fringe update if periodicity changed.
11644
11645 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11646 for fringe update unless it has periodic bitmap.
11647
11648 2011-05-25 Kenichi Handa <handa@m17n.org>
11649
11650 * xdisp.c (get_next_display_element): Set correct it->face_id for
11651 a static composition.
11652
11653 2011-05-24 Leo Liu <sdl.web@gmail.com>
11654
11655 * deps.mk (fns.o):
11656 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11657
11658 * fns.c (crypto_hash_function, Fsha1): New function.
11659 (Fmd5): Use crypto_hash_function.
11660 (syms_of_fns): Add Ssha1.
11661
11662 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11663
11664 * gnutls.c: Remove unused macros.
11665 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11666 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11667 Remove macros that are defined and never used.
11668 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11669
11670 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11671
11672 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11673 (Fx_get_selection_internal): Minor cleanup.
11674 (Fx_own_selection_internal): Rename arguments for consistency with
11675 select.el.
11676
11677 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11678
11679 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11680
11681 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11682
11683 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11684
11685 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11686
11687 * dispnew.c (scrolling_window): Don't exclude the case that the
11688 last enabled row in the desired matrix touches the bottom boundary.
11689
11690 2011-05-21 Glenn Morris <rgm@gnu.org>
11691
11692 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
11693 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11694 and add some more files.
11695
11696 2011-05-20 Eli Zaretskii <eliz@gnu.org>
11697
11698 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11699 report_file_error introduced by the change from 2011-05-07.
11700
11701 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11702
11703 * systime.h (Time): Define only if emacs is defined.
11704 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11705 where the include path doesn't have X11/X.h by default. See
11706 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11707
11708 2011-05-20 Kenichi Handa <handa@m17n.org>
11709
11710 * composite.c (find_automatic_composition): Fix previous change.
11711
11712 2011-05-20 Glenn Morris <rgm@gnu.org>
11713
11714 * lisp.mk: New file, split from Makefile.in.
11715 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11716 (shortlisp): Remove.
11717 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11718
11719 2011-05-19 Glenn Morris <rgm@gnu.org>
11720
11721 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11722 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11723 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11724 (lisp): Set the order to that of loadup.el.
11725 (shortlisp): Make it a copy of $lisp.
11726 (SOME_MACHINE_LISP): Remove.
11727 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11728 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11729
11730 2011-05-18 Kenichi Handa <handa@m17n.org>
11731
11732 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11733 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11734 (find_automatic_composition): Mostly rewrite for efficiency.
11735
11736 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
11737
11738 * makefile.w32-in: Update dependencies.
11739
11740 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11741
11742 * menu.c: Include limits.h (fixes the MS-Windows build broken by
11743 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
11744
11745 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
11746
11747 Fix some integer overflow issues, such as string length overflow.
11748
11749 * insdel.c (count_size_as_multibyte): Check for string overflow.
11750
11751 * character.c (lisp_string_width): Check for string overflow.
11752 Use EMACS_INT, not int, for string indexes and lengths; in
11753 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11754 the resulting string length overflows an EMACS_INT; instead,
11755 report a string overflow if no precision given. When checking for
11756 precision exhaustion, use a check that cannot possibly have
11757 integer overflow. (Bug#8675)
11758 * character.h (lisp_string_width): Adjust to new signature.
11759
11760 * alloc.c (string_overflow): New function.
11761 (Fmake_string): Use it. This doesn't change behavior, but saves
11762 a few bytes and will simplify future changes.
11763 * character.c (string_escape_byte8): Likewise.
11764 * lisp.h (string_overflow): New decl.
11765
11766 Fixups, following up to the user-interface timestamp change.
11767 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
11768 for UI timestamps, instead of unsigned long.
11769 * msdos.c (mouse_get_pos): Likewise.
11770 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
11771 * w32gui.h (Time): Define by including "systime.h" rather than by
11772 declaring it ourselves. (Bug#8664)
11773
11774 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
11775 * image.c (clear_image_cache): Likewise.
11776
11777 * term.c (term_mouse_position): Don't assume time_t wraparound.
11778
11779 Be more systematic about user-interface timestamps.
11780 Before, the code sometimes used 'Time', sometimes 'unsigned long',
11781 and sometimes 'EMACS_UINT', to represent these timestamps.
11782 This change causes it to use 'Time' uniformly, as that's what X uses.
11783 This makes the code easier to follow, and makes it easier to catch
11784 integer overflow bugs such as Bug#8664.
11785 * frame.c (Fmouse_position, Fmouse_pixel_position):
11786 Use Time, not unsigned long, for user-interface timestamps.
11787 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
11788 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
11789 * keyboard.h (last_event_timestamp): Likewise.
11790 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
11791 * menu.h (xmenu_show): Likewise.
11792 * term.c (term_mouse_position): Likewise.
11793 * termhooks.h (struct input_event.timestamp): Likewise.
11794 (struct terminal.mouse_position_hook): Likewise.
11795 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
11796 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
11797 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
11798 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
11799 what it was before.
11800 * menu.h, termhooks.h: Include "systime.h", for Time.
11801
11802 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
11803 Don't assume that the difference between two unsigned long values
11804 can fit into an integer. At this point, we know button_down_time
11805 <= event->timestamp, so the difference must be nonnegative, so
11806 there's no need to cast the result if double-click-time is
11807 nonnegative, as it should be; check that it's nonnegative, just in
11808 case. This bug is triggered when events are more than 2**31 ms
11809 apart (about 25 days). (Bug#8664)
11810
11811 * xselect.c (last_event_timestamp): Remove duplicate decl.
11812 (x_own_selection): Remove needless cast to unsigned long.
11813
11814 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
11815 that always fit in int. Use a sentinel instead of a counter, to
11816 avoid a temp and to allay GCC's concerns about possible int overflow.
11817 * frame.h (struct frame): Use int for menu_bar_items_used
11818 instead of EMACS_INT, since it always fits in int.
11819
11820 * menu.c (grow_menu_items): Check for int overflow.
11821
11822 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
11823
11824 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
11825 Before, the code was not consistent. These values cannot exceed
11826 2**31 - 1 so there's no need to make them unsigned.
11827 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
11828 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
11829 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
11830 as modifiers.
11831 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
11832
11833 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
11834 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
11835 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
11836 presumably because the widths might not match.
11837
11838 * window.c (size_window): Avoid needless test at loop start.
11839
11840 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
11841
11842 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
11843
11844 2011-05-12 Drew Adams <drew.adams@oracle.com>
11845
11846 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
11847
11848 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11849
11850 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
11851 `width' to `bar_area_x' and `bar_area_width', respectively.
11852 (x_scroll_run): Take account of fringe background extension.
11853
11854 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
11855 Rename local vars `left' and `width' to `bar_area_x' and
11856 `bar_area_width', respectively.
11857 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
11858 background extension.
11859
11860 2011-05-10 Jim Meyering <meyering@redhat.com>
11861
11862 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
11863
11864 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
11865
11866 * image.c (Finit_image_library): Return t for built-in image types,
11867 like pbm and xbm. (Bug#8640)
11868
11869 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
11870
11871 * w32menu.c (set_frame_menubar): Fix submenu allocation.
11872
11873 2011-05-07 Eli Zaretskii <eliz@gnu.org>
11874
11875 * w32console.c (Fset_screen_color): Doc fix.
11876 (Fget_screen_color): New function.
11877 (syms_of_ntterm): Defsubr it.
11878
11879 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11880 unlink the temporary file if Fcall_process didn't create it in the
11881 first place.
11882 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11883 child process will be redirected to a file specified with `:file'.
11884 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11885 cue to call_process_cleanup not to close that handle.
11886
11887 2011-05-07 Ben Key <bkey76@gmail.com>
11888
11889 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11890 one of two shell specific rules, either bootstrap-temacs-CMD or
11891 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11892 to the previous implementation of the bootstrap-temacs rule.
11893 The bootstrap-temacs-CMD rule is similar to the previous
11894 implementation of the bootstrap-temacs rule except that it
11895 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11896 variable.
11897
11898 These changes, along with some changes to nt/configure.bat,
11899 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11900 earlier fix to add support for --cflags and --ldflags options
11901 that include quotes so that it works whether make uses cmd or
11902 sh as the shell.
11903
11904 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
11905
11906 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11907 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11908 is a constant.
11909 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11910 a string. Handle both cases.
11911 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11912 (Fdbus_register_method): Use Qinvalid_function.
11913
11914 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
11915
11916 * makefile.w32-in: Update dependencies.
11917 (LISP_H): Add inttypes.h and stdin.h.
11918 (PROCESS_H): Add unistd.h.
11919
11920 2011-05-06 Eli Zaretskii <eliz@gnu.org>
11921
11922 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11923 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11924
11925 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
11926
11927 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11928
11929 * term.c (vfatal): Remove stray call to va_end.
11930 It's not needed and the C Standard doesn't allow it here anyway.
11931
11932 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11933 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11934
11935 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11936 bytes.
11937
11938 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11939
11940 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11941
11942 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11943
11944 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11945
11946 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11947
11948 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11949 * charset.c (Fdefine_charset_internal): Don't initialize
11950 charset.code_space[15]. The value was garbage, on hosts with
11951 32-bit int (Bug#8600).
11952
11953 * lread.c (read_integer): Be more consistent with string-to-number.
11954 Use string_to_number to do the actual conversion; this avoids
11955 rounding errors and fixes some other screwups. Without this fix,
11956 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11957 (digit_to_number): Move earlier, for benefit of read_integer.
11958 Return -1 if the digit is out of range for the base, -2 if it is
11959 not a digit in any supported base. (Bug#8602)
11960
11961 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11962
11963 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11964 to match comment at start of function. This also removes a
11965 GCC warning about overflow in a 32+64-bit port.
11966
11967 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11968
11969 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11970 Reported by Stefan Monnier in
11971 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
11972 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11973 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
11974
11975 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11976 (EMACS_UINTPTR): Likewise, with uintptr_t.
11977
11978 * lisp.h: Prefer 64-bit EMACS_INT if available.
11979 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11980 on 32-bit hosts that have 64-bit int, so that they can access
11981 large files.
11982 However, temporarily disable this change unless the temporary
11983 symbol WIDE_EMACS_INT is defined.
11984
11985 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11986
11987 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11988 This removes an assumption that EMACS_INT and long are the same
11989 width as pointers. The assumption is true for Emacs porting targets
11990 now, but we want to make other targets possible.
11991 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11992 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11993 In the rest of the code, change types of integers that hold casted
11994 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11995 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11996 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11997 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11998 No need to cast type when ORing.
11999 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
12000 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
12001 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
12002 assume EMACS_INT is the same width as char *.
12003 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
12004 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
12005 Remove no-longer-needed casts.
12006 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
12007 (xg_tool_bar_help_callback, xg_make_tool_item):
12008 Use EMACS_INTPTR to hold an integer
12009 that will be cast to void *; this can avoid a GCC warning
12010 if EMACS_INT is not the same width as void *.
12011 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
12012 * xdisp.c (display_echo_area_1, resize_mini_window_1):
12013 (current_message_1, set_message_1):
12014 Use a local to convert to proper width without a cast.
12015 * xmenu.c (dialog_selection_callback): Likewise.
12016
12017 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
12018 Also, don't assume VALBITS / RAND_BITS is less than 5,
12019 and don't rely on undefined behavior when shifting a 1 left into
12020 the sign bit.
12021 * lisp.h (get_random): Change signature to match.
12022
12023 * lread.c (hash_string): Use size_t, not int, for hash computation.
12024 Normally we prefer signed values; but hashing is special, because
12025 it's better to use unsigned division on hash table sizes so that
12026 the remainder is nonnegative. Also, size_t is the natural width
12027 for hashing into memory. The previous code used 'int', which doesn't
12028 retain enough info to hash well into very large tables.
12029 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
12030
12031 * dbusbind.c: Don't possibly lose pointer info when converting.
12032 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12033 Use XPNTR rather than XHASH, so that the high-order bits of
12034 the pointer aren't lost when converting through void *.
12035
12036 * eval.c (Fautoload): Don't double-shift a pointer.
12037
12038 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
12039
12040 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
12041
12042 * gnutls.c (DEF_GNUTLS_FN):
12043 * image.c (DEF_IMGLIB_FN): Make function pointers static.
12044
12045 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
12046
12047 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
12048 marker. (Bug#8610)
12049
12050 2011-05-05 Eli Zaretskii <eliz@gnu.org>
12051
12052 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
12053 New version that can reserve upto 2GB of heap space.
12054
12055 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
12056
12057 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
12058
12059 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
12060
12061 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
12062 `gnutls_certificate_set_x509_key_file'.
12063
12064 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
12065
12066 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
12067 Update dependencies.
12068
12069 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12070
12071 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
12072 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12073 Remove unused parameter `fildes'.
12074 * process.c (read_process_output, send_process): Don't pass it.
12075
12076 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12077
12078 Fix previous change: the library cache is defined in w32.c.
12079 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
12080 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
12081
12082 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12083
12084 Implement dynamic loading of GnuTLS on Windows.
12085
12086 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
12087 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
12088 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12089 Declare.
12090
12091 * gnutls.c (Qgnutls_dll): Define.
12092 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
12093 (gnutls_*): Declare function pointers.
12094 (init_gnutls_functions): New function to initialize function pointers.
12095 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
12096 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
12097 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12098 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
12099 (emacs_gnutls_write, emacs_gnutls_read)
12100 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
12101 (Fgnutls_available_p): New function.
12102 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
12103 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
12104 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
12105
12106 * image.c: Include w32.h.
12107 (Vimage_type_cache): Delete.
12108 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
12109 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
12110 (w32_delayed_load): Move to w32.c.
12111
12112 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
12113
12114 * w32.c (QCloaded_from, Vlibrary_cache): Define.
12115 (w32_delayed_load): Move from image.c. When loading a library, record
12116 its filename in the :loaded-from property of the library id.
12117 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
12118 Initialize and staticpro them.
12119 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
12120
12121 * process.c: Include lisp.h before w32.h, not after.
12122 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
12123 instead of gnutls_record_check_pending.
12124
12125 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
12126
12127 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
12128
12129 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
12130 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
12131 as passed in.
12132
12133 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
12134
12135 * xterm.c (x_set_frame_alpha): Do not set property on anything
12136 else than FRAME_X_OUTER_WINDOW (Bug#8608).
12137
12138 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12139
12140 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
12141
12142 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12143
12144 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
12145 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
12146 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
12147 (gnutls_global_initialized, Qgnutls_bootprop_priority)
12148 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
12149 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
12150 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
12151 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
12152 (Qgnutls_bootprop_callbacks_verify): Make static.
12153
12154 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
12155
12156 * callproc.c: Indentation fixup.
12157
12158 * sysdep.c (wait_for_termination_1): Make static.
12159 (wait_for_termination, interruptible_wait_for_termination):
12160 Move after wait_for_termination_1.
12161
12162 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
12163
12164 * sysdep.c (interruptible_wait_for_termination): New function
12165 which is like wait_for_termination, but allows keyboard
12166 interruptions.
12167
12168 * callproc.c (Fcall_process): Add (:file "file") as an option for
12169 the STDOUT buffer.
12170 (Fcall_process_region): Ditto.
12171
12172 2011-04-30 Eli Zaretskii <eliz@gnu.org>
12173
12174 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
12175 rather than `XVECTOR (FOO)->size'.
12176
12177 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
12178 inttypes.h, as a gnulib replacement is used if it not available in
12179 system headers.
12180
12181 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12182
12183 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
12184 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
12185 of MOST_POSITIVE_FIXNUM. (Bug#8528)
12186
12187 * coding.c (coding_alloc_by_realloc): Error out if destination
12188 will grow beyond MOST_POSITIVE_FIXNUM.
12189 (decode_coding_emacs_mule): Abort if there isn't enough place in
12190 charbuf for the composition carryover bytes. Reserve an extra
12191 space for up to 2 characters produced in a loop.
12192 (decode_coding_iso_2022): Abort if there isn't enough place in
12193 charbuf for the composition carryover bytes.
12194
12195 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12196
12197 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
12198 aborting when %lld or %lll format is passed.
12199 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
12200 %llo or %llx format is passed. (Bug#8545)
12201
12202 * window.c (window_scroll_line_based): Use a marker instead of
12203 simple variables to record original value of point. (Bug#7952)
12204
12205 * doprnt.c (doprnt): Fix the case where a multibyte sequence
12206 produced by %s or %c overflows available buffer space. (Bug#8545)
12207
12208 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
12209
12210 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
12211 (SIZE_MAX): Move defn after all includes, as they might #define it.
12212
12213 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12214
12215 * w32.c (init_environment): Warn about defaulting HOME to C:\.
12216
12217 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12218
12219 * keyboard.c (Qdelayed_warnings_hook): Define.
12220 (command_loop_1): Run `delayed-warnings-hook'
12221 if Vdelayed_warnings_list is non-nil.
12222 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
12223 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
12224
12225 2011-04-28 Eli Zaretskii <eliz@gnu.org>
12226
12227 * doprnt.c (doprnt): Don't return value smaller than the buffer
12228 size if the message was truncated. (Bug#8545).
12229
12230 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12231
12232 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
12233 (Fx_window_property): #if-0 the whole functions, not just the bodies.
12234
12235 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12236
12237 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
12238
12239 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
12240
12241 * makefile.w32-in: Update dependencies.
12242
12243 2011-04-27 Eli Zaretskii <eliz@gnu.org>
12244
12245 Improve `doprnt' and its usage. (Bug#8545)
12246 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
12247 `format_end'. Remove support for %l as a conversion specifier.
12248 Don't use xrealloc. Improve diagnostics when the %l size modifier
12249 is used. Update the commentary.
12250
12251 * eval.c (verror): Simplify calculation of size_t.
12252
12253 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
12254 messages.
12255
12256 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
12257
12258 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
12259 change.
12260
12261 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12262
12263 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
12264 This makes this file independent of the recent pseudovector change.
12265
12266 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
12267
12268 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
12269
12270 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
12271 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
12272 Remove unused local.
12273 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
12274
12275 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
12276 GCC 4.6.0 optimizes based on type-based alias analysis.
12277 For example, if b is of type struct buffer * and v of type struct
12278 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
12279 != &v->size, and therefore "v->size = 1; b->size = 2; return
12280 v->size;" must therefore return 1. This assumption is incorrect
12281 for Emacs, since it type-puns struct Lisp_Vector * with many other
12282 types. To fix this problem, this patch adds a new type struct
12283 vectorlike_header that documents the constraints on layout of vectors
12284 and pseudovectors, and helps optimizing compilers not get fooled
12285 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
12286 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
12287 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
12288 the size member.
12289 (XSETPVECTYPE): Rewrite in terms of new macro.
12290 (XSETPVECTYPESIZE): New macro, specifying both type and size.
12291 This is a bit clearer, and further avoids the possibility of
12292 undesirable aliasing.
12293 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
12294 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
12295 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
12296 since Lisp_Subr is a special case (no "next" field).
12297 (ASIZE): Now uses header.size rather than size.
12298 All previous uses of XVECTOR (foo)->size replaced to use this macro,
12299 to avoid the hassle of writing XVECTOR (foo)->header.size.
12300 (struct vectorlike_header): New type.
12301 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
12302 object, to help avoid aliasing.
12303 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
12304 (SUBRP): Likewise, since Lisp_Subr is a special case.
12305 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
12306 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
12307 (struct Lisp_Hash_Table): Combine first two members into a single
12308 struct vectorlike_header member. All uses of "size" and "next" members
12309 changed to be "header.size" and "header.next".
12310 * buffer.h (struct buffer): Likewise.
12311 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
12312 * frame.h (struct frame): Likewise.
12313 * process.h (struct Lisp_Process): Likewise.
12314 * termhooks.h (struct terminal): Likewise.
12315 * window.c (struct save_window_data, struct saved_window): Likewise.
12316 * window.h (struct window): Likewise.
12317 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
12318 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
12319 * buffer.c (init_buffer_once): Likewise.
12320 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
12321 special case.
12322 * process.c (Fformat_network_address): Use local var for size,
12323 for brevity.
12324
12325 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
12326
12327 Make the Lisp reader and string-to-float more consistent (Bug#8525)
12328 * data.c (atof): Remove decl; no longer used or needed.
12329 (digit_to_number): Move to lread.c.
12330 (Fstring_to_number): Use new string_to_number function, to be
12331 consistent with how the Lisp reader treats infinities and NaNs.
12332 Do not assume that floating-point numbers represent EMACS_INT
12333 without losing information; this is not true on most 64-bit hosts.
12334 Avoid double-rounding errors, by insisting on integers when
12335 parsing non-base-10 numbers, as the documentation specifies.
12336 * lisp.h (string_to_number): New decl, replacing ...
12337 (isfloat_string): Remove.
12338 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
12339 (read1): Do not accept +. and -. as integers; this
12340 appears to have been a coding error. Similarly, do not accept
12341 strings like +-1e0 as floating point numbers. Do not report
12342 overflow for integer overflows unless the base is not 10 which
12343 means we have no simple and reliable way to continue.
12344 Break out the floating-point parsing into a new
12345 function string_to_number, so that Fstring_to_number parses
12346 floating point numbers consistently with the Lisp reader.
12347 (digit_to_number): Move here from data.c. Make it static inline.
12348 (E_CHAR, EXP_INT): Remove, replacing with ...
12349 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
12350 (string_to_number): New function, replacing isfloat_string.
12351 This function checks for valid syntax and produces the resulting
12352 Lisp float number too. Rework it so that string-to-number
12353 no longer mishandles examples like "1.0e+". Use strtoumax,
12354 so that overflow for non-base-10 numbers is reported only when
12355 there's no portable and simple way to convert to floating point.
12356
12357 * textprop.c (set_text_properties_1): Rewrite for clarity,
12358 and to avoid GCC warning about integer overflow.
12359
12360 * intervals.h (struct interval): Use EMACS_INT for members
12361 where EMACS_UINT might cause problems. See
12362 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
12363 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
12364 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
12365 All uses changed.
12366 (offset_intervals): Tell GCC not to worry about length overflow
12367 when negating a negative length.
12368
12369 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
12370 (overrun_check_free): Likewise.
12371
12372 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
12373 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
12374 word size.
12375
12376 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12377 (gnutls_make_error): Rename local to avoid shadowing.
12378 (gnutls_emacs_global_deinit): ifdef out; not used.
12379 (Fgnutls_boot): Use const for pointer to readonly storage.
12380 Comment out unused local. Fix pointer signedness problems.
12381
12382 * lread.c (openp): Don't stuff size_t into an 'int'.
12383 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
12384 about possible signed overflow.
12385
12386 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12387 (GDK_KEY_g): Don't define if already defined.
12388 (xg_prepare_tooltip): Avoid pointer signedness problem.
12389 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12390
12391 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12392 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
12393
12394 * xfns.c (Fx_window_property): Simplify a bit,
12395 to make a bit faster and to avoid GCC 4.6.0 warning.
12396 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12397
12398 * fns.c (internal_equal): Don't assume size_t fits in int.
12399
12400 * alloc.c (compact_small_strings): Tighten assertion a little.
12401
12402 Replace pEd with more-general pI, and fix some printf arg casts.
12403 * lisp.h (pI): New macro, generalizing old pEd macro to other
12404 conversion specifiers. For example, use "...%"pI"d..." rather
12405 than "...%"pEd"...".
12406 (pEd): Remove. All uses replaced with similar uses of pI.
12407 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
12408 * alloc.c (check_pure_size): Don't overflow by converting size to int.
12409 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12410 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12411 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12412 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12413 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12414 64-bit hosts.
12415 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12416 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12417 * print.c (safe_debug_print, print_object): Likewise.
12418 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12419 to int.
12420 Use pI instead of if-then-else-abort. Use %p to avoid casts,
12421 avoiding the 0 flag, which is not portable.
12422 * process.c (Fmake_network_process): Use pI to avoid cast.
12423 * region-cache.c (pp_cache): Likewise.
12424 * xdisp.c (decode_mode_spec): Likewise.
12425 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12426 behavior on 64-bit hosts with printf arg.
12427 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
12428 (x_stop_queuing_selection_requests): Likewise.
12429 (x_get_window_property): Don't truncate byte count to an 'int'
12430 when tracing.
12431
12432 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12433 here, since it parses constructs like leading '-' and spaces,
12434 which are not wanted; and it overflows with large numbers.
12435 Instead, simply match F[0-9]+, which is what is wanted anyway.
12436
12437 * alloc.c: Remove unportable assumptions about struct layout.
12438 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12439 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12440 (allocate_vectorlike, make_pure_vector): Use the new macros,
12441 plus offsetof, to remove unportable assumptions about struct layout.
12442 These assumptions hold on all porting targets that I know of, but
12443 they are not guaranteed, they're easy to remove, and removing them
12444 makes further changes easier.
12445
12446 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12447 This doesn't fix a bug but makes the code clearer.
12448 (string_overrun_cookie): Now const. Use initializers that
12449 don't formally overflow signed char, to avoid warnings.
12450 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12451 can cause Emacs to crash when string overrun checking is enabled.
12452 (allocate_buffer): Don't assume sizeof (struct buffer) is a
12453 multiple of sizeof (EMACS_INT); it need not be, if
12454 alignof(EMACS_INT) < sizeof (EMACS_INT).
12455 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
12456
12457 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
12458
12459 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
12460
12461 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
12462
12463 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
12464 supposed to be handshaking. (Bug#8556)
12465 Reported by Paul Eggert <eggert@cs.ucla.edu>.
12466
12467 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
12468
12469 * lisp.h (Qdebug): List symbol.
12470 * eval.c (Qdebug): Restore global linkage.
12471 * keyboard.c (debug-on-event): New variable.
12472 (handle_user_signal): Break into debugger when debug-on-event
12473 matches the current signal symbol.
12474
12475 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
12476
12477 * alloc.c (check_sblock, check_string_bytes)
12478 (check_string_free_list): Convert to standard C.
12479
12480 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
12481
12482 * w32.c (emacs_gnutls_push): Fix typo.
12483
12484 2011-04-25 Eli Zaretskii <eliz@gnu.org>
12485
12486 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12487 "cast to pointer from integer of different size".
12488
12489 Improve doprnt and its use in verror. (Bug#8545)
12490 * doprnt.c (doprnt): Document the set of format control sequences
12491 supported by the function. Use SAFE_ALLOCA instead of always
12492 using `alloca'.
12493
12494 * eval.c (verror): Don't limit the buffer size at size_max-1, that
12495 is one byte too soon. Don't use xrealloc; instead xfree and
12496 xmalloc anew.
12497
12498 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
12499
12500 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12501 callbacks stage.
12502
12503 * gnutls.c: Renamed global_initialized to
12504 gnutls_global_initialized. Added internals for the
12505 :verify-hostname-error, :verify-error, and :verify-flags
12506 parameters of `gnutls-boot' and documented those parameters in the
12507 docstring. Start callback support.
12508 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
12509 unless a fatal error occurred. Call gnutls_alert_send_appropriate
12510 on error. Return error code.
12511 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12512 (emacs_gnutls_read): Likewise.
12513 (Fgnutls_boot): Return handshake error code.
12514 (emacs_gnutls_handle_error): New function.
12515 (wsaerror_to_errno): Likewise.
12516
12517 * w32.h (emacs_gnutls_pull): Add prototype.
12518 (emacs_gnutls_push): Likewise.
12519
12520 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12521 (emacs_gnutls_push): Likewise.
12522
12523 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
12524
12525 * process.c (wait_reading_process_output): Check if GnuTLS
12526 buffered some data internally if no FDs are set for TLS
12527 connections.
12528
12529 * makefile.w32-in (OBJ2): Add gnutls.$(O).
12530 (LIBS): Link to USER_LIBS.
12531 ($(BLD)/gnutls.$(0)): New target.
12532
12533 2011-04-24 Eli Zaretskii <eliz@gnu.org>
12534
12535 * xdisp.c (handle_single_display_spec): Rename the
12536 display_replaced_before_p argument into display_replaced_p, to
12537 make it consistent with the commentary. Fix typos in the
12538 commentary.
12539
12540 * textprop.c (syms_of_textprop): Remove dead code.
12541 (copy_text_properties): Delete obsolete commentary about an
12542 interface that was deleted long ago. Fix typos in the description
12543 of arguments.
12544
12545 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
12546 to changes in oldXMenu/XMenu.h from 2011-04-16.
12547 <menu_help_message, prev_menu_help_message>: Constify.
12548 (IT_menu_make_room): menu->help_text is now `const char **';
12549 adjust.
12550
12551 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12552 to changes in oldXMenu/XMenu.h from 2011-04-16.
12553 (struct XMenu): Declare `help_text' `const char **'.
12554
12555 * xfaces.c <Qunspecified>: Make extern again.
12556
12557 * syntax.c: Include sys/types.h before including regex.h, as
12558 required by POSIX.
12559
12560 * doc.c (get_doc_string): Improve the format passed to `error'.
12561
12562 * doprnt.c (doprnt): Improve commentary.
12563
12564 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12565
12566 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12567 them with etags.
12568
12569 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12570 changes in globals.h immediately force recompilation.
12571 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12572 $(CURDIR)/s/ms-w32.h.
12573 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
12574
12575 * character.c (Fchar_direction): Function deleted.
12576 (syms_of_character): Don't defsubr it.
12577 <char-direction-table>: Deleted.
12578
12579 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12580
12581 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12582 * doprnt.c: Include limits.h.
12583 (SIZE_MAX): New macro.
12584 (doprnt): Return a size_t value. 2nd arg is now size_t.
12585 Many local variables are now size_t instead of int or unsigned.
12586 Improve overflow protection. Support `l' modifier for integer
12587 conversions. Support %l conversion. Don't assume an EMACS_INT
12588 argument for integer conversions and for %c.
12589
12590 * lisp.h (doprnt): Restore prototype.
12591
12592 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12593 $(SRC)/character.h.
12594
12595 * Makefile.in (base_obj): Add back doprnt.o.
12596
12597 * deps.mk (doprnt.o): Add back prerequisites.
12598 (callint.o): Depend on character.h.
12599
12600 * eval.c (internal_lisp_condition_case): Include the handler
12601 representation in the error message.
12602 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12603 when breaking from the loop.
12604
12605 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12606
12607 * callint.c (Fcall_interactively): When displaying error message
12608 about invalid control letter, pass the character's codepoint, not
12609 a pointer to its multibyte form. Improve display of the character
12610 in octal and display also its hex code.
12611
12612 * character.c (char_string): Use %x to display the (unsigned)
12613 codepoint of an invalid character, to avoid displaying a bogus
12614 negative value.
12615
12616 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12617 `error', not SYMBOL_NAME itself.
12618
12619 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12620 character arguments to `error'.
12621
12622 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12623 to `error' in error message about FINAL_CHAR argument. Make sure
12624 FINAL_CHAR is a character, and use %c when it is passed as
12625 argument to `error'.
12626
12627 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12628
12629 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12630
12631 * w32.c: Include <time.h>.
12632 (sys_localtime): New function.
12633
12634 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
12635
12636 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12637
12638 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
12639
12640 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
12641
12642 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12643 zombies (Bug#8467).
12644
12645 2011-04-19 Eli Zaretskii <eliz@gnu.org>
12646
12647 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12648 gl_state.e_property when gl_state.object is Qt.
12649
12650 * insdel.c (make_gap_larger): Remove limitation of buffer size
12651 to <= INT_MAX.
12652
12653 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
12654
12655 * xdisp.c (lookup_glyphless_char_display)
12656 (produce_glyphless_glyph): Handle cons cell entry in
12657 glyphless-char-display.
12658 (Vglyphless_char_display): Document it.
12659
12660 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12661 glyphless-char-display.
12662
12663 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
12664
12665 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12666
12667 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12668
12669 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12670 definition for no-X builds.
12671
12672 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
12673
12674 Static checks with GCC 4.6.0 and non-default toolkits.
12675
12676 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12677
12678 * process.c (keyboard_bit_set): Define only if SIGIO.
12679 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12680 (send_process): Repair possible setjmp clobbering.
12681
12682 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12683
12684 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12685
12686 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12687
12688 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12689 Define only if needed.
12690
12691 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12692 by pacifying GCC about it. Maybe it's time to retire it?
12693 * xfaces.c (USG, __TIMEVAL__): Likewise.
12694
12695 * dispextern.h (struct redisplay_interface): Rename param
12696 to avoid shadowing.
12697 * termhooks.h (struct terminal): Likewise.
12698 * xterm.c (xembed_send_message): Likewise.
12699
12700 * insdel.c (make_gap_smaller): Define only if
12701 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12702
12703 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12704 it.
12705
12706 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12707 so that we aren't warned about unused symbols.
12708
12709 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12710
12711 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
12712
12713 * xfns.c (x_real_positions): Mark locals as initialized.
12714
12715 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12716
12717 * xterm.c: Fix problems found by static analysis with other toolkits.
12718 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
12719 (x_dispatch_event): Declare static if USE_GTK, and
12720 define if USE_GTK || USE_X_TOOLKIT.
12721 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
12722 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
12723 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12724 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
12725
12726 * xmenu.c (menu_help_callback): Pointer type fixes.
12727 Use const pointers when pointing at readonly data. Avoid pointer
12728 signedness clashes.
12729 (FALSE): Remove unused macro.
12730 (update_frame_menubar): Remove unused decl.
12731
12732 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12733
12734 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12735 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12736 (single_menu_item): Rename local to avoid shadowing.
12737
12738 * keyboard.c (make_lispy_event): Remove unused local var.
12739
12740 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12741 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12742
12743 * bitmaps: Change bitmaps from unsigned char back to the X11
12744 compatible char. Avoid the old compiler warnings about
12745 out-of-range initializers by using, for example, '\xab' rather
12746 than 0xab.
12747
12748 * xgselect.c (xgselect_initialize): Check vs interface
12749 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12750
12751 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12752
12753 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12754 to read-only memory.
12755
12756 * fns.c (vector): Remove; this old hack is no longer needed.
12757
12758 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
12759 Remove unused var.
12760 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
12761
12762 * xrdb.c (x_load_resources): Omit unused local.
12763
12764 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
12765 (x_window): Rename locals to avoid shadowing.
12766 (USG): Use the kludged USG macro, to pacify gcc.
12767
12768 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
12769 (x_term_init): Remove local to avoid shadowing.
12770
12771 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
12772
12773 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
12774 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
12775
12776 2011-04-16 Eli Zaretskii <eliz@gnu.org>
12777
12778 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
12779
12780 Fix regex.c, syntax.c and friends for buffers > 2GB.
12781 * syntax.h (struct gl_state_s): Declare character position members
12782 EMACS_INT.
12783
12784 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
12785
12786 * textprop.c (verify_interval_modification, interval_of):
12787 Declare arguments EMACS_INT.
12788
12789 * intervals.c (adjust_intervals_for_insertion): Declare arguments
12790 EMACS_INT.
12791
12792 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
12793
12794 * indent.c (Fvertical_motion): Local variable it_start is now
12795 EMACS_INT.
12796
12797 * regex.c (re_match, re_match_2, re_match_2_internal)
12798 (bcmp_translate, regcomp, regexec, print_double_string)
12799 (group_in_compile_stack, re_search, re_search_2, regex_compile)
12800 (re_compile_pattern, re_exec): Declare arguments and local
12801 variables `size_t' and `ssize_t' and return values `regoff_t', as
12802 appropriate.
12803 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
12804 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
12805 <compile_stack_type>: `size' and `avail' are now `size_t'.
12806
12807 * regex.h <regoff_t>: Use ssize_t, not int.
12808 (re_search, re_search_2, re_match, re_match_2): Arguments that
12809 specify buffer/string position and length are now ssize_t and
12810 size_t. Return type is regoff_t.
12811
12812 2011-04-16 Ben Key <bkey76@gmail.com>
12813
12814 * nsfont.m: Fixed bugs in ns_get_family and
12815 ns_descriptor_to_entity that were caused by using free to
12816 deallocate memory blocks that were allocated by xmalloc (via
12817 xstrdup). This caused Emacs to crash when compiled with
12818 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
12819 --enable-checking=xmallocoverrun). xfree is now used to
12820 deallocate these memory blocks.
12821
12822 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
12823
12824 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
12825
12826 emacs_write: Accept and return EMACS_INT for sizes.
12827 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
12828 et seq.
12829 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
12830 Accept and return EMACS_INT.
12831 (emacs_gnutls_write): Return the number of bytes written on
12832 partial writes.
12833 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
12834 (emacs_read, emacs_write): Remove check for negative size, as the
12835 Emacs source code has been audited now.
12836 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
12837 (emacs_read, emacs_write): Use it.
12838 * process.c (send_process): Adjust to the new signatures of
12839 emacs_write and emacs_gnutls_write. Do not attempt to store
12840 a byte offset into an 'int'; it might overflow.
12841 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
12842
12843 * sound.c: Don't assume sizes fit in 'int'.
12844 (struct sound_device.period_size, alsa_period_size):
12845 Return EMACS_INT, not int.
12846 (struct sound_device.write, vox_write, alsa_write):
12847 Accept EMACS_INT, not int.
12848 (wav_play, au_play): Use EMACS_INT to store sizes and to
12849 record read return values.
12850
12851 2011-04-15 Ben Key <bkey76@gmail.com>
12852
12853 * keyboard.c (Qundefined): Don't declare static since it is used
12854 in nsfns.m.
12855 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
12856 static since they are used in nsfont.m.
12857
12858 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
12859
12860 * process.c (Qprocessp): Don't declare static.
12861 * lisp.h (Qprocessp): Declare again.
12862
12863 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
12864
12865 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
12866
12867 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
12868
12869 Improve C-level modularity by making more things 'static'.
12870
12871 Don't publish debugger-only interfaces to other modules.
12872 * lisp.h (safe_debug_print, debug_output_compilation_hack):
12873 (verify_bytepos, count_markers): Move decls to the only modules
12874 that need them.
12875 * region-cache.h (pp_cache): Likewise.
12876 * window.h (check_all_windows): Likewise.
12877 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12878
12879 * sysdep.c (croak): Now static, if
12880 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12881 * syssignal.h (croak): Declare only if not static.
12882
12883 * alloc.c (refill_memory_reserve): Now static if
12884 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12885 * lisp.h (refill_memory_reserve): Declare only if not static.
12886
12887 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12888 Define only if USE_LUCID.
12889
12890 * xrdb.c (x_customization_string, x_rm_string): Now static.
12891
12892 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12893 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12894
12895 * xdisp.c (draw_row_with_mouse_face): Now static.
12896 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12897
12898 * window.h (check_all_windows): Mark externally visible.
12899
12900 * window.c (window_deletion_count): Now static.
12901
12902 * undo.c: Make symbols static if they're not exported.
12903 (last_undo_buffer, last_boundary_position, pending_boundary):
12904 Now static.
12905
12906 * textprop.c (interval_insert_behind_hooks): Now static.
12907 (interval_insert_in_front_hooks): Likewise.
12908
12909 * term.c: Make symbols static if they're not exported.
12910 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12911 (max_frame_lines, tty_set_terminal_modes):
12912 (tty_reset_terminal_modes, tty_turn_off_highlight):
12913 (get_tty_terminal): Now static.
12914 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12915 * termhooks.h (term_mouse_moveto): Do not declare if
12916 HAVE_WINDOW_SYSTEM.
12917 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12918 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12919
12920 * sysdep.c: Make symbols static if they're not exported.
12921 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12922 Now static.
12923 (sigprocmask_set, full_mask): Remove; unused.
12924 (wait_debugging): Mark as visible.
12925 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12926 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12927
12928 * syntax.c (syntax_temp): Define only if !__GNUC__.
12929
12930 * sound.c (current_sound_device, current_sound): Now static.
12931
12932 * search.c (searchbufs, searchbuf_head): Now static.
12933
12934 * scroll.c (scroll_cost): Remove; unused.
12935 * dispextern.h (scroll_cost): Remove decl.
12936
12937 * region-cache.h (pp_cache): Mark as externally visible.
12938
12939 * process.c: Make symbols static if they're not exported.
12940 (process_tick, update_tick, create_process, chan_process):
12941 (Vprocess_alist, proc_buffered_char, datagram_access):
12942 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12943 (deactivate_process): Mark defn as static, as well as decl.
12944 * lisp.h (create_process): Remove decl.
12945 * process.h (chan_process, Vprocess_alist): Remove decls.
12946
12947 * print.c: Make symbols static if they're not exported.
12948 (print_depth, new_backquote_output, being_printed, print_buffer):
12949 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12950 (print_interval, print_number_index, initial_stderr_stream):
12951 Now static.
12952 * lisp.h (Fprinc): Remove decl.
12953 (debug_output_compilation_hack): Mark as externally visible.
12954
12955 * sysdep.c (croak): Move decl from here to syssignal.h.
12956 * syssignal.h (croak): Put it here, so the API can be checked when
12957 'croak' is called from dissociate_if_controlling_tty.
12958
12959 * minibuf.c: Make symbols static if they're not exported.
12960 (minibuf_save_list, choose_minibuf_frame): Now static.
12961 * lisp.h (choose_minibuf_frame): Remove decl.
12962
12963 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12964
12965 * lread.c: Make symbols static if they're not exported.
12966 (read_objects, initial_obarray, oblookup_last_bucket_number):
12967 Now static.
12968 (make_symbol): Remove; unused.
12969 * lisp.h (initial_obarray, make_symbol): Remove decls.
12970
12971 * keyboard.c: Make symbols static if they're not exported.
12972 (single_kboard, recent_keys_index, total_keys, recent_keys):
12973 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12974 (this_single_command_key_start, echoing, last_auto_save):
12975 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12976 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12977 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12978 (Vlispy_mouse_stem, double_click_count):
12979 Now static.
12980 (force_auto_save_soon): Define only if SIGDANGER.
12981 (ignore_mouse_drag_p): Now static if
12982 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12983 (print_help): Remove; unused.
12984 (stop_character, last_timer_event): Mark as externally visible.
12985 * keyboard.h (ignore_mouse_drag_p): Declare only if
12986 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12987 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12988 * lisp.h (echoing): Remove decl.
12989 (force_auto_save_soon): Declare only if SIGDANGER.
12990 * xdisp.c (redisplay_window): Simplify code, to make it more
12991 obvious that ignore_mouse_drag_p is not accessed if !defined
12992 USE_GTK && !defined HAVE_NS.
12993
12994 * intervals.c: Make symbols static if they're not exported.
12995 (merge_properties_sticky, merge_interval_right, delete_interval):
12996 Now static.
12997 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12998
12999 * insdel.c: Make symbols static if they're not exported.
13000 However, leave prepare_to_modify_buffer alone. It's never
13001 called from outside this function, but that appears to be a bug.
13002 (combine_after_change_list, combine_after_change_buffer):
13003 (adjust_after_replace, signal_before_change): Now static.
13004 (adjust_after_replace_noundo): Remove; unused.
13005 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
13006 (signal_before_change): Remove decls.
13007
13008 * indent.c (val_compute_motion, val_vmotion): Now static.
13009
13010 * image.c: Make symbols static if they're not exported.
13011 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
13012 if USE_GTK.
13013 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
13014 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
13015
13016 * fringe.c (standard_bitmaps): Now static.
13017 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
13018
13019 * frame.c: Make symbols static if they're not exported.
13020 (x_report_frame_params, make_terminal_frame): Now static.
13021 (get_frame_param): Now static, unless HAVE_NS.
13022 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
13023 (x_get_resource_string): Remove; not used.
13024 * frame.h (make_terminal_frame, x_report_frame_params):
13025 (x_get_resource_string); Remove decls.
13026 (x_fullscreen_adjust): Declare only if WINDOWSNT.
13027 * lisp.h (get_frame_param): Declare only if HAVE_NS.
13028
13029 * font.c, fontset.c: Make symbols static if they're not exported.
13030 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
13031 (FACE_SUITABLE_FOR_CHAR_P): Use it.
13032 * font.c (font_close_object): Now static.
13033 * font.h (font_close_object): Remove.
13034 * fontset.c (FONTSET_OBJLIST): Remove.
13035 (free_realized_fontset) #if-0 the body, which does nothing.
13036 (face_suitable_for_char_p): #if-0, as it's never called.
13037 * fontset.h (face_suitable_for_char_p): Remove decl.
13038 * xfaces.c (face_at_string_position):
13039 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
13040 since 0 is always ASCII.
13041
13042 * fns.c (weak_hash_tables): Now static.
13043
13044 * fileio.c: Make symbols static if they're not exported.
13045 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
13046 (Vwrite_region_annotation_buffers): Now static.
13047
13048 * eval.c: Make symbols static if they're not exported.
13049 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
13050 * lisp.h (backtrace_list): Remove decl.
13051
13052 * emacs.c: Make symbols static if they're not exported.
13053 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
13054 (fatal_error_code, fatal_error_signal_hook, standard_args):
13055 Now static.
13056 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
13057 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
13058 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
13059 * lisp.h (fatal_error_signal_hook): Remove decl.
13060 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
13061
13062 * editfns.c: Move a (normally-unused) function to its only use.
13063 * editfns.c, lisp.h (get_operating_system_release): Remove.
13064 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
13065 worth the hassle of breaking this out.
13066
13067 * xterm.c: Make symbols static if they're not exported.
13068 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
13069 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
13070 (x_destroy_window, x_delete_display):
13071 Now static.
13072 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
13073 (x_mouse_leave): Remove; unused.
13074 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
13075 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
13076 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
13077 Remove decls.
13078 (x_mouse_leave): Declare only if WINDOWSNT.
13079 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
13080 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
13081 USE_X_TOOLKIT.
13082
13083 * ftxfont.c: Make symbols static if they're not exported.
13084 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
13085 HAVE_FREETYPE.
13086 * font.h (ftxfont_driver): Likewise.
13087
13088 * xfns.c: Make symbols static if they're not exported.
13089 (x_last_font_name, x_display_info_for_name):
13090 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
13091 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
13092 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
13093 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
13094 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
13095 (last_show_tip_args): Now static.
13096 (xic_defaut_fontset, xic_create_fontsetname): Define only if
13097 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
13098 (x_screen_planes): Remove; unused.
13099 * dispextern.h (x_screen_planes): Remove decl.
13100
13101 * dispnew.c: Make symbols static if they're not exported.
13102 * dispextern.h (redraw_garbaged_frames, scrolling):
13103 (increment_row_positions): Remove.
13104 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
13105 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
13106 Now static.
13107 (redraw_garbaged_frames): Remove; unused.
13108
13109 * xfaces.c: Make symbols static if they're not exported.
13110 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
13111 Remove decls.
13112 * xterm.h (defined_color): Remove decls.
13113 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
13114 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
13115 (menu_face_changed_default, defined_color, free_realized_face):
13116 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
13117 (ascii_face_of_lisp_face): Remove; unused.
13118
13119 * xdisp.c: Make symbols static if they're not exported.
13120 * dispextern.h (scratch_glyph_row, window_box_edges):
13121 (glyph_to_pixel_coords, set_cursor_from_row):
13122 (get_next_display_element, set_iterator_to_next):
13123 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
13124 (show_mouse_face): Remove decls
13125 * frame.h (message_buf_print): Likewise.
13126 * lisp.h (pop_message, set_message, check_point_in_composition):
13127 Likewise.
13128 * xterm.h (set_vertical_scroll_bar): Likewise.
13129 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
13130 (message_buf_print, scratch_glyph_row, displayed_buffer):
13131 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
13132 (get_next_display_element, show_mouse_face, window_box_edges):
13133 (frame_to_window_pixel_xy, check_point_in_composition):
13134 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
13135 (glyph_to_pixel_coords): Remove; unused.
13136
13137 * dired.c (file_name_completion): Now static.
13138
13139 * dbusbind.c (xd_in_read_queued_messages): Now static.
13140
13141 * lisp.h (circular_list_error, FOREACH): Remove; unused.
13142 * data.c (circular_list_error): Remove.
13143
13144 * commands.h (last_point_position, last_point_position_buffer):
13145 (last_point_position_window): Remove decls.
13146 * keyboard.c: Make these variables static.
13147
13148 * coding.h (coding, code_convert_region, encode_coding_gap):
13149 Remove decls.
13150 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
13151 (iso_code_class, detect_coding, code_convert_region): Now static.
13152 (encode_coding_gap): Remove; unused.
13153
13154 * chartab.c (chartab_chars, chartab_bits): Now static.
13155
13156 * charset.h (charset_iso_8859_1): Remove decl.
13157 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
13158 Now static.
13159
13160 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
13161 * ccl.c (Vccl_program_table): Now static.
13162 (check_ccl_update): Remove; unused.
13163
13164 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
13165 * category.h: ... from here.
13166 * category.c (check_category_table, set_category_set): Now static.
13167
13168 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
13169 * lisp.h: Remove these decls.
13170
13171 * buffer.c (buffer_count): Remove unused var.
13172
13173 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
13174 so that it's not optimized away.
13175 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
13176 * dispextern.h (bidi_dump_cached_states): Remove, since it's
13177 exported only to the debugger.
13178
13179 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
13180 * atimer.h (run_all_atimers): Remove; not exported.
13181
13182 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
13183 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
13184 was inaccessible from Lisp.
13185 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
13186 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
13187
13188 alloc.c: Import and export fewer symbols, and remove unused items.
13189 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
13190 is defined.
13191 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
13192 it's not optimized away by whole-program optimization.
13193 (message_enable_multibyte, free_misc): Remove.
13194 (catchlist, handlerlist, mark_backtrace):
13195 Declare only if BYTE_MARK_STACK.
13196 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
13197 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13198 (message_enable_multibyte): Remove decl.
13199 (free_misc, interval_free_list, float_block, float_block_index):
13200 (n_float_blocks, float_free_list, cons_block, cons_block_index):
13201 (cons_free_list, last_marked_index):
13202 Now static.
13203 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
13204 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
13205 (mark_backtrace): Define only if BYTE_MARK_STACK.
13206 * xdisp.c (message_enable_multibyte): Now static.
13207
13208 Declare Lisp_Object Q* variables to be 'static' if not exported.
13209 This makes it easier for human readers (and static analyzers)
13210 to see whether these variables are used from other modules.
13211 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
13212 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
13213 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
13214 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
13215 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
13216 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
13217 * xmenu.c, xselect.c:
13218 Declare Q* vars static if they are not used in other modules.
13219 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
13220 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
13221 Remove decls of unexported vars.
13222 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
13223
13224 * lisp.h (DEFINE_FUNC): Make sname 'static'.
13225
13226 Make Emacs functions such as Fatom 'static' by default.
13227 This makes it easier for human readers (and static analyzers)
13228 to see whether these functions can be called from other modules.
13229 DEFUN now defines a static function. To make the function external
13230 so that it can be used in other C modules, use the new macro DEFUE.
13231 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
13232 (Finit_image_library):
13233 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
13234 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
13235 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
13236 Remove decls, since these functions are now static.
13237 (Funintern, Fget_internal_run_time): New decls, since these functions
13238 were already external.
13239
13240 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
13241 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
13242 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
13243 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
13244 * keyboard.c, keymap.c, lread.c:
13245 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
13246 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
13247 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
13248 Mark functions with DEFUE instead of DEFUN,
13249 if they are used in other modules.
13250 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
13251 decls for now-static functions.
13252 * buffer.h (Fdelete_overlay): Remove decl.
13253 * callproc.c (Fgetenv_internal): Mark as internal.
13254 * composite.c (Fremove_list_of_text_properties): Remove decl.
13255 (Fcomposition_get_gstring): New forward static decl.
13256 * composite.h (Fcomposite_get_gstring): Remove decl.
13257 * dired.c (Ffile_attributes): New forward static decl.
13258 * doc.c (Fdocumntation_property): New forward static decl.
13259 * eval.c (Ffetch_bytecode): New forward static decl.
13260 (Funintern): Remove extern decl; now in .h file where it belongs.
13261 * fileio.c (Fmake_symbolic_link): New forward static decl.
13262 * image.c (Finit_image_library): New forward static decl.
13263 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
13264 * intervals.h (Fprevious_property_change):
13265 (Fremove_list_of_text_properties): Remove decls.
13266 * keyboard.c (Fthis_command_keys): Remove decl.
13267 (Fcommand_execute): New forward static decl.
13268 * keymap.c (Flookup_key): New forward static decl.
13269 (Fcopy_keymap): Now static.
13270 * keymap.h (Flookup_key): Remove decl.
13271 * process.c (Fget_process): New forward static decl.
13272 (Fprocess_datagram_address): Mark as internal.
13273 * syntax.c (Fsyntax_table_p): New forward static decl.
13274 (skip_chars): Remove duplicate decl.
13275 * textprop.c (Fprevious_property_change): New forward static decl.
13276 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
13277 Now internal.
13278 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
13279 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
13280
13281 * editfns.c (Fformat): Remove unreachable code.
13282
13283 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
13284
13285 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
13286 change. (Bug#8496)
13287
13288 2011-04-13 Eli Zaretskii <eliz@gnu.org>
13289
13290 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
13291 when at ZV. (Bug#8487)
13292
13293 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
13294
13295 * charset.c (Fclear_charset_maps): Use xfree instead of free.
13296 (Bug#8437)
13297 * keyboard.c (parse_tool_bar_item): Likewise.
13298 * sound.c (sound_cleanup, alsa_close): Likewise.
13299 * termcap.c (tgetent): Likewise.
13300 * xfns.c (x_default_font_parameter): Likewise.
13301 * xsettings.c (read_and_apply_settings): Likewise.
13302
13303 * alloc.c (overrun_check_malloc, overrun_check_realloc)
13304 (overrun_check_free): Protoize.
13305
13306 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
13307
13308 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
13309 since callers should never pass a negative size.
13310 Change the signature to match that of plain 'read' and 'write'; see
13311 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
13312 * lisp.h: Update prototypes of emacs_write and emacs_read.
13313
13314 2011-04-11 Eli Zaretskii <eliz@gnu.org>
13315
13316 * xdisp.c (redisplay_window): Don't try to determine the character
13317 position of the scroll margin if the window start point w->startp
13318 is outside the buffer's accessible region. (Bug#8468)
13319
13320 2011-04-10 Eli Zaretskii <eliz@gnu.org>
13321
13322 Fix write-region and its subroutines for buffers > 2GB.
13323 * fileio.c (a_write, e_write): Modify declaration of arguments and
13324 local variables to support buffers larger than 2GB.
13325 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
13326
13327 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
13328 argument, local variables, and return value.
13329
13330 * lisp.h: Update prototypes of emacs_write and emacs_read.
13331
13332 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
13333
13334 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
13335
13336 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
13337
13338 Fix more problems found by GCC 4.6.0's static checks.
13339
13340 * xdisp.c (vmessage): Use a better test for character truncation.
13341
13342 * charset.c (load_charset_map): <, not <=, for optimization,
13343 and to avoid potential problems with integer overflow.
13344 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
13345 * casetab.c (set_identity, shuffle): Likewise.
13346 * editfns.c (Fformat): Likewise.
13347 * syntax.c (skip_chars): Likewise.
13348
13349 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
13350 This also lets GCC 4.6.0 generate slightly better loop code.
13351
13352 * callint.c (Fcall_interactively): <, not <=, for optimization.
13353 (Fcall_interactively): Count the number of arguments produced,
13354 not the number of arguments given. This is simpler and lets GCC
13355 4.6.0 generate slightly better code.
13356
13357 * ftfont.c: Distingish more carefully between FcChar8 and char.
13358 The previous code passed unsigned char * to a functions like
13359 strlen and xstrcasecmp that expect char *, which does not
13360 conform to the C standard.
13361 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
13362 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
13363 char * when the C standard requires it.
13364
13365 * keyboard.c (read_char): Remove unused var.
13366
13367 * eval.c: Port to Windows vsnprintf (Bug#8435).
13368 Include <limits.h>.
13369 (SIZE_MAX): Define if the headers do not.
13370 (verror): Do not give up if vsnprintf returns a negative count.
13371 Instead, grow the buffer. This ports to Windows vsnprintf, which
13372 does not conform to C99. Problem reported by Eli Zaretskii.
13373 Also, simplify the allocation scheme, by avoiding the need for
13374 calling realloc, and removing the ALLOCATED variable.
13375
13376 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
13377
13378 Remove invocations of doprnt, as Emacs now uses vsnprintf.
13379 But keep the doprint source code for now, as we might revamp it
13380 and use it again (Bug#8435).
13381 * lisp.h (doprnt): Remove.
13382 * Makefile.in (base_obj): Remove doprnt.o.
13383 * deps.mk (doprnt.o): Remove.
13384
13385 error: Print 32- and 64-bit integers portably (Bug#8435).
13386 Without this change, on typical 64-bit hosts error ("...%d...", N)
13387 was used to print both 32- and 64-bit integers N, which relied on
13388 undefined behavior.
13389 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
13390 * lisp.h (error, verror): Mark as printf-like functions.
13391 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13392 Report overflow in size calculations when allocating printf buffer.
13393 Do not truncate output string at its first null byte.
13394 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13395 Truncate the output at a character boundary, since vsnprintf does not
13396 do that.
13397 * charset.c (check_iso_charset_parameter): Convert internal
13398 character to string before calling 'error', since %c now has the
13399 printf meaning.
13400 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13401 overflow when computing char to be passed to 'error'. Do not
13402 pass Lisp_Object to 'error'; pass the integer instead.
13403 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13404 formatted with plain %d.
13405
13406 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13407
13408 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13409
13410 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13411
13412 * xterm.c (x_catch_errors): Remove duplicate declaration.
13413
13414 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13415
13416 * xdisp.c, lisp.h (message_nolog): Remove; unused.
13417
13418 2011-04-10 Jim Meyering <meyering@redhat.com>
13419
13420 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13421 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13422 return ssize_t not "int", and use size_t as the buffer length.
13423 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13424 * gnutls.h: Update declarations.
13425 * process.c (read_process_output): Use ssize_t, to match.
13426 (send_process): Likewise.
13427
13428 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13429
13430 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13431
13432 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13433
13434 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13435 Use unsigned char, to match FcChar8 type definition.
13436
13437 * xterm.c (handle_one_xevent):
13438 * xmenu.c (create_and_show_popup_menu):
13439 * xselect.c (x_decline_selection_request)
13440 (x_reply_selection_request): Avoid type-punned deref of X events.
13441
13442 2011-04-09 Eli Zaretskii <eliz@gnu.org>
13443
13444 Fix some uses of `int' instead of EMACS_INT.
13445 * search.c (string_match_1, fast_string_match)
13446 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13447 (scan_buffer, find_next_newline_no_quit)
13448 (find_before_next_newline, search_command, Freplace_match)
13449 (Fmatch_data): Make some `int' variables be EMACS_INT.
13450
13451 * xdisp.c (display_count_lines): 3rd argument and return value now
13452 EMACS_INT. All callers changed.
13453 (pint2hrstr): Last argument is now EMACS_INT.
13454
13455 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13456 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13457 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13458 (decode_coding_utf_16, decode_coding_emacs_mule)
13459 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13460 (decode_coding_ccl, decode_coding_charset)
13461 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13462 (decode_coding_iso_2022, decode_coding_emacs_mule)
13463 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13464 <char_offset, last_offset>: Declare EMACS_INT.
13465 (encode_coding_utf_8, encode_coding_utf_16)
13466 (encode_coding_emacs_mule, encode_invocation_designation)
13467 (encode_designation_at_bol, encode_coding_iso_2022)
13468 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13469 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13470 Declare EMACS_INT.
13471 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13472 (encode_invocation_designation): Last argument P_NCHARS is now
13473 EMACS_INT.
13474 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13475 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13476
13477 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13478 All users changed.
13479
13480 * ccl.c (Fccl_execute_on_string): Declare some variables
13481 EMACS_INT.
13482
13483 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
13484
13485 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13486
13487 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
13488
13489 * process.c (Fformat_network_address): Doc fix.
13490
13491 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
13492
13493 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
13494
13495 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
13496
13497 * keyboard.c (read_char): Call Lisp function help-form-show,
13498 instead of using internal_with_output_to_temp_buffer.
13499 (Qhelp_form_show): New var.
13500 (syms_of_keyboard): Use DEFSYM macro.
13501
13502 * print.c (internal_with_output_to_temp_buffer): Function deleted.
13503
13504 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13505
13506 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
13507
13508 * process.c (Flist_processes): Remove to Lisp.
13509 (list_processes_1): Delete.
13510
13511 2011-04-06 Eli Zaretskii <eliz@gnu.org>
13512
13513 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13514
13515 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13516
13517 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
13518
13519 Fix more problems found by GCC 4.6.0's static checks.
13520
13521 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13522
13523 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13524
13525 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
13526
13527 * xdisp.c (vmessage): Mark as a printf-like function.
13528
13529 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
13530
13531 * sound.c (sound_warning): Don't crash if arg contains a printf format.
13532
13533 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
13534 printf-like functions.
13535 (tiff_load): Add casts to remove these marks before passing them
13536 to system-supplied API.
13537
13538 * eval.c (Fsignal): Remove excess argument to 'fatal'.
13539
13540 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
13541 This avoids several warnings with gcc -Wstrict-overflow.
13542 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
13543 directly, rather than having caller test rule sign. This avoids
13544 some unnecessary tests.
13545 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
13546 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
13547 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
13548
13549 * xfont.c (xfont_text_extents): Remove var that was set but not used.
13550 (xfont_open): Avoid unnecessary tests.
13551
13552 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13553
13554 * composite.h, composite.c (composition_gstring_put_cache):
13555 Use EMACS_INT, not int, for length.
13556
13557 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13558 breaking out part of COMPOSITION_DECODE_RULE.
13559 (COMPOSITION_DECODE_RULE): Use it.
13560 * composite.c (get_composition_id): Remove unused local vars,
13561 by using the new macro.
13562
13563 * textprop.c (set_text_properties_1): Change while to do-while,
13564 since the condition is always true at first.
13565
13566 * intervals.c (graft_intervals_into_buffer): Mark var as used.
13567 (interval_deletion_adjustment): Return unsigned value.
13568 All uses changed.
13569
13570 * process.c (list_processes_1, create_pty, read_process_output):
13571 (exec_sentinel): Remove vars that were set but not used.
13572 (create_pty): Remove unnecessary "volatile"s.
13573 (Fnetwork_interface_info): Avoid possibility of int overflow.
13574 (read_process_output): Do adaptive read buffering even if carryover.
13575 (read_process_output): Simplify nbytes computation if buffered.
13576
13577 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13578
13579 * syntax.c (scan_words): Remove var that was set but not used.
13580 (update_syntax_table): Use unsigned instead of int.
13581
13582 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
13583 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
13584 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
13585
13586 * print.c (print_error_message): Avoid int overflow.
13587
13588 * font.c (font_list_entities): Redo for clarity,
13589 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13590
13591 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
13592 (font_score): Avoid potential overflow in diff calculation.
13593
13594 * fns.c (substring_both): Remove var that is set but not used.
13595 (sxhash): Redo loop for clarity and to avoid wraparound warning.
13596
13597 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13598
13599 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13600 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13601 can always succeed if overflow has undefined behavior.
13602
13603 * search.c (boyer_moore, wordify): Remove vars set but not used.
13604 (wordify): Omit three unnecessary tests.
13605
13606 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13607 All callers changed. This avoids the need for an unused var.
13608
13609 * casefiddle.c (casify_region): Remove var that is set but not used.
13610
13611 * dired.c (file_name_completion): Remove var that is set but not used.
13612
13613 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13614
13615 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
13616 (Finsert_file_contents): Remove unnecessary code checking fd.
13617
13618 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13619 Check for integer overflow on size calculations.
13620
13621 * buffer.c (Fprevious_overlay_change): Remove var that is set
13622 but not used.
13623
13624 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13625 Remove vars that are set but not used.
13626 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
13627 (timer_check_2): Mark vars as initialized.
13628
13629 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13630
13631 * image.c (lookup_image): Remove var that is set but not used.
13632 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
13633
13634 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13635 that are set but not used.
13636
13637 * xfns.c (make_invisible_cursor): Don't return garbage
13638 if XCreateBitmapFromData fails (Bug#8410).
13639
13640 * xselect.c (x_get_local_selection, x_handle_property_notify):
13641 Remove vars that are set but not used.
13642
13643 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
13644 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
13645
13646 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13647 Remove var that is set but not used.
13648 (scroll_bar_windows_size): Now size_t, not int.
13649 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13650 Check for overflow.
13651
13652 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13653 (map_tty_color) [!defined MSDOS]: Likewise.
13654
13655 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13656
13657 * coding.c: Remove vars that are set but not used.
13658 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13659 All callers changed.
13660 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13661 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13662 (decode_coding_charset): Remove vars that are set but not used.
13663
13664 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13665 that is set but not used.
13666
13667 * print.c (print_object): Remove var that is set but not used.
13668
13669 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
13670 The gnulib version avoids calling malloc in the usual case,
13671 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13672 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13673 * filelock.c (current_lock_owner): Likewise.
13674 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13675 * sysdep.c: Include allocator.h, careadlinkat.h.
13676 (emacs_no_realloc_allocator): New static constant.
13677 (emacs_readlink): New function.
13678 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13679 ../lib/careadlinkat.h.
13680
13681 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13682
13683 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13684 first non-nil return value).
13685
13686 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13687
13688 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13689 if not defined (Bug#8403).
13690
13691 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13692
13693 * xdisp.c (display_count_lines): Remove parameter `start',
13694 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13695 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13696 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13697 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13698 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13699 and thereabouts. All callers changed.
13700 (get_per_char_metric): Remove parameter `f', unused since
13701 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13702
13703 2011-04-02 Jim Meyering <meyering@redhat.com>
13704
13705 do not dereference NULL upon failed strdup
13706 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13707 (ns_get_family): Likewise.
13708
13709 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13710
13711 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13712
13713 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13714
13715 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13716 later (Bug#8403).
13717
13718 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13719
13720 Add lexical binding.
13721
13722 * window.c (Ftemp_output_buffer_show): New fun.
13723 (Fsave_window_excursion):
13724 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13725
13726 * lread.c (lisp_file_lexically_bound_p): New function.
13727 (Fload): Bind Qlexical_binding.
13728 (readevalloop): Remove `evalfun' arg.
13729 Bind Qinternal_interpreter_environment.
13730 (Feval_buffer): Bind Qlexical_binding.
13731 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13732 Mark as dynamic.
13733 (syms_of_lread): Declare `lexical-binding'.
13734
13735 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13736
13737 * keyboard.c (eval_dyn): New fun.
13738 (menu_item_eval_property): Use it.
13739
13740 * image.c (parse_image_spec): Use Ffunctionp.
13741
13742 * fns.c (concat, mapcar1): Accept byte-code-functions.
13743
13744 * eval.c (Fsetq): Handle lexical vars.
13745 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13746 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13747 (FletX, Flet): Obey lexical binding.
13748 (Fcommandp): Handle closures.
13749 (Feval): New `lexical' arg.
13750 (eval_sub): New function extracted from Feval. Use it almost
13751 everywhere where Feval was used. Look up vars in lexical env.
13752 Handle closures.
13753 (Ffunctionp): Move from subr.el.
13754 (Ffuncall): Handle closures.
13755 (apply_lambda): Remove `eval_flags'.
13756 (funcall_lambda): Handle closures and new byte-code-functions.
13757 (Fspecial_variable_p): New function.
13758 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13759 but without exporting it to Lisp.
13760
13761 * doc.c (Fdocumentation, store_function_docstring):
13762 * data.c (Finteractive_form): Handle closures.
13763
13764 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13765 interactive spec.
13766
13767 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
13768 New byte-codes.
13769 (exec_byte_code): New function extracted from Fbyte_code to handle new
13770 calling convention for byte-code-functions. Add new byte-codes.
13771
13772 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
13773
13774 * alloc.c (Fmake_symbol): Init new `declared_special' field.
13775
13776 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13777
13778 * xdisp.c (redisplay_internal): Fix prototype.
13779
13780 2011-03-31 Eli Zaretskii <eliz@gnu.org>
13781
13782 * xdisp.c (SCROLL_LIMIT): New macro.
13783 (try_scrolling): Use it when setting scroll_limit.
13784 Limit scrolling to 100 screen lines.
13785 (redisplay_window): Even when falling back on "recentering",
13786 position point in the window according to scroll-conservatively,
13787 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
13788
13789 (try_scrolling): When point is above the window, allow searching
13790 as far as scroll_max, or one screenful, to compute vertical
13791 distance from PT to the scroll margin position. This prevents
13792 try_scrolling from unnecessarily failing when
13793 scroll-conservatively is set to a value slightly larger than the
13794 window height. Clean up the case of PT below the margin at bottom
13795 of window: scroll_max can no longer be INT_MAX. When aggressive
13796 scrolling is in use, don't let point enter the opposite scroll
13797 margin as result of the scroll.
13798 (syms_of_xdisp) <scroll-conservatively>: Document the
13799 threshold of 100 lines for never-recentering scrolling.
13800
13801 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13802
13803 * dispextern.h (move_it_by_lines):
13804 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
13805 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
13806 (message_log_check_duplicate): Remove parameters `prev_bol' and
13807 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13808 (redisplay_internal): Remove parameter `preserve_echo_area',
13809 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
13810
13811 * indent.c (Fvertical_motion):
13812 * window.c (window_scroll_pixel_based, Frecenter):
13813 Don't pass `need_y_p' to `move_it_by_lines'.
13814
13815 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
13816
13817 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
13818 steal a few bits to be more compact.
13819 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
13820 Remove unneeded casts.
13821
13822 * bytecode.c (Fbyte_code): CAR and CDR can GC.
13823
13824 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
13825
13826 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
13827 binding" message (bug#7967).
13828
13829 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
13830
13831 Fix more problems found by GCC 4.6.0's static checks.
13832
13833 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
13834 Remove unused local var.
13835
13836 * editfns.c (Fmessage_box): Remove unused local var.
13837
13838 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
13839 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13840 Omit unused local vars.
13841 * window.c (shrink_windows): Omit unused local var.
13842 * menu.c (digest_single_submenu): Omit unused local var.
13843 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
13844 Omit unused local var.
13845
13846 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
13847 Don't assume string length fits in int.
13848 (keyremap_step, read_key_sequence): Use size_t for sizes.
13849 (read_key_sequence): Don't check last_real_key_start redundantly.
13850
13851 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
13852 instead of alloca (Bug#8344).
13853
13854 * eval.c (Fbacktrace): Don't assume nargs fits in int.
13855 (Fbacktrace_frame): Don't assume nframes fits in int.
13856
13857 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
13858
13859 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
13860 concerns.
13861
13862 * term.c (produce_glyphless_glyph): Remove unnecessary test.
13863
13864 * cm.c (calccost): Turn while-do into do-while, for clarity.
13865
13866 * keyboard.c (syms_of_keyboard): Use the same style as later
13867 in this function when indexing through an array. This also
13868 works around GCC bug 48267.
13869
13870 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
13871
13872 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
13873
13874 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13875 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13876
13877 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13878 This avoids undefined behavior on integer overflow, and is a bit
13879 more convenient anyway since it is compared to a size_t variable.
13880
13881 Variadic C functions now count arguments with size_t, not int.
13882 This avoids an unnecessary limitation on 64-bit machines, which
13883 caused (substring ...) to crash on large vectors (Bug#8344).
13884 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13885 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
13886 All variadic functions and their callers changed accordingly.
13887 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13888 * data.c (arith_driver, float_arith_driver): Likewise.
13889 * editfns.c (general_insert_function): Likewise.
13890 * eval.c (struct backtrace.nargs, interactive_p)
13891 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13892 (funcall_lambda, mark_backtrace): Likewise.
13893 * fns.c (concat): Likewise.
13894 * frame.c (x_set_frame_parameters): Likewise.
13895 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13896 0 if not found, not -1. All callers changed.
13897
13898 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13899 (stack_copy_size): Now size_t, not int.
13900 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13901
13902 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13903
13904 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13905 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13906 All callers changed.
13907
13908 * lisp.h (multibyte_char_to_unibyte):
13909 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13910 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13911 * character.h (CHAR_TO_BYTE8):
13912 * cmds.c (internal_self_insert):
13913 * editfns.c (general_insert_function):
13914 * keymap.c (push_key_description):
13915 * search.c (Freplace_match):
13916 * xdisp.c (message_dolog, set_message_1): All callers changed.
13917
13918 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13919
13920 * keyboard.c (safe_run_hook_funcall): New function.
13921 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13922 don't set the hook to nil, but remove the offending function instead.
13923 (Qcommand_hook_internal): Remove, unused.
13924 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13925 Vcommand_hook_internal.
13926
13927 * eval.c (enum run_hooks_condition): Remove.
13928 (funcall_nil, funcall_not): New functions.
13929 (run_hook_with_args): Call each function through a `funcall' argument.
13930 Remove `cond' argument, now redundant.
13931 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13932 (Frun_hook_with_args_until_failure): Adjust accordingly.
13933 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13934
13935 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13936
13937 * dispextern.h (string_buffer_position): Remove declaration.
13938
13939 * print.c (strout): Remove parameter `multibyte', unused since
13940 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13941
13942 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13943 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13944 All callers changed.
13945
13946 * w32.c (_wsa_errlist): Use braces for struct initializers.
13947
13948 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13949 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13950 All callers changed.
13951 (string_buffer_position): Likewise. Also, make static (it's never
13952 used outside xdisp.c).
13953 (cursor_row_p): Remove parameter `w', unused since
13954 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13955 (decode_mode_spec): Remove parameter `precision', introduced during
13956 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13957 All callers changed.
13958
13959 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13960
13961 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13962
13963 2011-03-27 Anders Lindgren <andlind@gmail.com>
13964
13965 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13966 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13967 (ns_update_auto_hide_menu_bar): New functions.
13968 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13969 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13970 ns_constrain_all_frames.
13971 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13972 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13973
13974 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13975
13976 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13977
13978 2011-03-27 Glenn Morris <rgm@gnu.org>
13979
13980 * syssignal.h: Replace RETSIGTYPE with void.
13981 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13982 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13983 Replace SIGTYPE with void everywhere.
13984 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13985 * s/template.h (SIGTYPE): Remove commented out definition.
13986
13987 2011-03-26 Eli Zaretskii <eliz@gnu.org>
13988
13989 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13990 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13991
13992 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
13993
13994 * w32.c (read_unc_volume): Use parameter `henum', instead of
13995 global variable `wget_enum_handle'.
13996
13997 * keymap.c (describe_vector): Remove parameters `indices' and
13998 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13999 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
14000
14001 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
14002
14003 * keyboard.c (timer_check): Remove parameter `do_it_now',
14004 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
14005 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
14006 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
14007
14008 * keyboard.c (read_char):
14009 * w32menu.c (w32_menu_display_help):
14010 * xmenu.c (show_help_event, menu_help_callback):
14011 Adjust calls to `show_help_echo'.
14012
14013 * gtkutil.c (xg_maybe_add_timer):
14014 * keyboard.c (readable_events):
14015 * process.c (wait_reading_process_output):
14016 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
14017
14018 * insdel.c (adjust_markers_gap_motion):
14019 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
14020 (gap_left, gap_right): Don't call it.
14021
14022 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
14023
14024 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
14025 incurred during fontification.
14026
14027 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14028
14029 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
14030 (DEFVAR_PER_BUFFER): Don't pass it.
14031
14032 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
14033 (scrolling_window): Don't pass it.
14034
14035 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14036
14037 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
14038
14039 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
14040 and `suffix'.
14041 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
14042 of variables specific to SELinux and computation of `encoded_absname'.
14043
14044 * image.c (XPutPixel): Remove unused variable `height'.
14045
14046 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
14047
14048 * unexw32.c (get_section_info): Remove unused variable `section'.
14049
14050 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
14051 (system_process_attributes): Remove unused variable `sess'.
14052 (sys_read): Remove unused variable `err'.
14053
14054 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
14055 (w32_wnd_proc): Remove unused variable `isdead'.
14056 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
14057 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
14058 (x_create_tip_frame): Remove unused variable `tem'.
14059
14060 * w32inevt.c (w32_console_read_socket):
14061 Remove unused variable `no_events'.
14062
14063 * w32term.c (x_draw_composite_glyph_string_foreground):
14064 Remove unused variable `width'.
14065
14066 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
14067
14068 * w32term.c (x_set_glyph_string_clipping):
14069 Don't pass uninitialized region to CombineRgn.
14070
14071 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
14072
14073 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
14074 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
14075 (Fx_close_connection): Remove unused variable `i'.
14076
14077 * w32font.c (w32font_draw): Return number of glyphs.
14078 (w32font_open_internal): Remove unused variable `i'.
14079 (w32font_driver): Add missing initializer.
14080
14081 * w32menu.c (utf8to16): Remove unused variable `utf16'.
14082 (fill_in_menu): Remove unused variable `items_added'.
14083
14084 * w32term.c (last_mouse_press_frame): Remove static global variable.
14085 (w32_clip_to_row): Remove unused variable `f'.
14086 (x_delete_terminal): Remove unused variable `i'.
14087
14088 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
14089 (NOTHING): Remove unused static global variable.
14090 (uniscribe_check_otf): Remove unused variable `table'.
14091 (uniscribe_font_driver): Add missing initializers.
14092
14093 2011-03-23 Julien Danjou <julien@danjou.info>
14094
14095 * term.c (Fsuspend_tty, Fresume_tty):
14096 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
14097 * window.c (temp_output_buffer_show):
14098 * insdel.c (signal_before_change):
14099 * frame.c (Fhandle_switch_frame):
14100 * fileio.c (Fdo_auto_save):
14101 * emacs.c (Fkill_emacs):
14102 * editfns.c (save_excursion_restore):
14103 * cmds.c (internal_self_insert):
14104 * callint.c (Fcall_interactively):
14105 * buffer.c (Fkill_all_local_variables):
14106 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
14107 Use Frun_hooks.
14108 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
14109 unconditionally since it does the check itself.
14110
14111 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
14112
14113 Fix more problems found by GCC 4.5.2's static checks.
14114
14115 * coding.c (encode_coding_raw_text): Avoid unnecessary test
14116 the first time through the loop, since we know p0 < p1 then.
14117 This also avoids a gcc -Wstrict-overflow warning.
14118
14119 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
14120 leading to a memory leak, possible in functions like
14121 load_charset_map_from_file that can allocate an unbounded number
14122 of objects (Bug#8318).
14123
14124 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
14125 that could (at least in theory) be that large.
14126
14127 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
14128 This is less likely to overflow, and avoids undefined behavior if
14129 overflow does occur. All callers changed. Use strtoul to scan
14130 for the unsigned long integer.
14131 (pint2hrstr): Simplify and tune code slightly.
14132 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
14133
14134 * scroll.c (do_scrolling): Work around GCC bug 48228.
14135 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
14136
14137 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
14138 This also avoids a warning with gcc -Wstrict-overflow.
14139 (validate_x_resource_name): Simplify count usage.
14140 This also avoids a warning with gcc -Wstrict-overflow.
14141
14142 * fileio.c (Fcopy_file): Report error if fchown or fchmod
14143 fail (Bug#8306).
14144
14145 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
14146
14147 * process.c (Fmake_network_process): Use socklen_t, not int,
14148 where POSIX says socklen_t is required in portable programs.
14149 This fixes a porting bug on hosts like 64-bit HP-UX, where
14150 socklen_t is wider than int (Bug#8277).
14151 (Fmake_network_process, server_accept_connection):
14152 (wait_reading_process_output, read_process_output):
14153 Likewise.
14154
14155 * process.c: Rename or move locals to avoid shadowing.
14156 (list_processes_1, Fmake_network_process):
14157 (read_process_output_error_handler, exec_sentinel_error_handler):
14158 Rename or move locals.
14159 (Fmake_network_process): Define label "retry_connect" only if needed.
14160 (Fnetwork_interface_info): Fix pointer signedness.
14161 (process_send_signal): Add cast to avoid pointer signedness problem.
14162 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
14163 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
14164
14165 Make tparam.h and terminfo.c consistent.
14166 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
14167 Include tparam.h instead, since it declares them.
14168 * cm.h (PC): Remove extern decl; tparam.h now does this.
14169 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
14170 * terminfo.c: Include tparam.h, to check interfaces.
14171 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
14172 (tparam): Adjust signature to match interface in tparam.h;
14173 this removes some undefined behavior. Check that outstring and len
14174 are zero, which they always are with Emacs.
14175 * tparam.h (PC, BC, UP): New extern decls.
14176
14177 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
14178 (xftfont_open): Rename locals to avoid shadowing.
14179
14180 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
14181 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
14182 (OTF_TAG_SYM): Omit macro if not needed.
14183 (ftfont_list): Remove unused local.
14184 (get_adstyle_property, ftfont_pattern_entity):
14185 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
14186 Rename locals to avoid shadowing.
14187
14188 * xfont.c (xfont_list_family): Mark var as initialized.
14189
14190 * xml.c (make_dom): Now static.
14191
14192 * composite.c (composition_compute_stop_pos): Rename local to
14193 avoid shadowing.
14194 (composition_reseat_it): Remove unused locals.
14195 (find_automatic_composition, composition_adjust_point): Likewise.
14196 (composition_update_it): Mark var as initialized.
14197 (find_automatic_composition): Mark vars as initialized,
14198 with a FIXME (Bug#8290).
14199
14200 character.h: Rename locals to avoid shadowing.
14201 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
14202 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
14203 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
14204 (BUF_DEC_POS): Be more systematic about renaming local temporaries
14205 to avoid shadowing.
14206
14207 * textprop.c (property_change_between_p): Remove; unused.
14208
14209 * intervals.c (interval_start_pos): Now static.
14210
14211 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
14212
14213 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
14214 Rename locals to avoid shadowing.
14215
14216 * sound.c (wav_play, au_play, Fplay_sound_internal):
14217 Fix pointer signedness.
14218 (alsa_choose_format): Remove unused local var.
14219 (wav_play): Initialize a variable to 0, to prevent undefined
14220 behavior (Bug#8278).
14221
14222 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
14223
14224 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
14225
14226 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
14227 clobbering (Bug#8298).
14228 * sysdep.c (sys_subshell): Likewise.
14229 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
14230
14231 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
14232 This should get cleaned up, so that child_setup has the
14233 same signature on all platforms.
14234
14235 * callproc.c (call_process_cleanup): Now static.
14236 (relocate_fd): Rename locals to avoid shadowing.
14237
14238 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
14239
14240 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
14241 not to be necessary, and produces flickering.
14242
14243 2011-03-20 Glenn Morris <rgm@gnu.org>
14244
14245 * config.in: Remove file.
14246
14247 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
14248
14249 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
14250 are now in src/globals.h.
14251 (syms_of_minibuf): Remove spurious & from previous change.
14252
14253 2011-03-20 Leo Liu <sdl.web@gmail.com>
14254
14255 * minibuf.c (completing-read-function): New variable.
14256 (completing-read-default): Rename from completing-read.
14257 (completing-read): Call completing-read-function.
14258
14259 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
14260
14261 * xfaces.c (Fx_load_color_file):
14262 Read color file from absolute filename (bug#8250).
14263
14264 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
14265
14266 * makefile.w32-in: Update dependencies.
14267
14268 2011-03-17 Eli Zaretskii <eliz@gnu.org>
14269
14270 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
14271
14272 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
14273
14274 Fix more problems found by GCC 4.5.2's static checks.
14275
14276 * process.c (make_serial_process_unwind, send_process_trap):
14277 (sigchld_handler): Now static.
14278
14279 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
14280 That way, the code declares only the vars that it needs.
14281 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
14282 * s/cygwin.h (PTY_ITERATION): Likewise.
14283 * s/darwin.h (PTY_ITERATION): Likewise.
14284 * s/gnu-linux.h (PTY_ITERATION): Likewise.
14285
14286 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
14287 * process.c (allocate_pty): Don't declare stb unless it's needed.
14288
14289 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
14290 (CONSTANTLIM): Remove; unused.
14291 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
14292 Define only if needed.
14293
14294 * unexelf.c (unexec): Name an expression,
14295 to avoid gcc -Wbad-function-cast warning.
14296 Use a different way to cause a compilation error if anyone uses
14297 n rather than nn, a way that does not involve shadowing.
14298 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
14299
14300 * deps.mk (unexalpha.o): Remove; unused.
14301
14302 New file unexec.h, the (simple) interface for unexec (Bug#8267).
14303 * unexec.h: New file.
14304 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
14305 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
14306 Depend on unexec.h.
14307 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
14308 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
14309 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
14310 Change as necessary to match prototype in unexec.h.
14311
14312 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
14313 shadowing.
14314 (back_comment, skip_chars): Mark vars as initialized.
14315
14316 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
14317 Rename locals to avoid shadowing.
14318
14319 * lread.c (read1): Rewrite so as not to use empty "else".
14320 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
14321
14322 * print.c (Fredirect_debugging_output): Fix pointer signedess.
14323
14324 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
14325 warning when compiling print.c.
14326
14327 * font.c (font_unparse_fcname): Abort in an "impossible" situation
14328 instead of using an uninitialized var.
14329 (font_sort_entities): Mark var as initialized.
14330
14331 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
14332
14333 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
14334 pointers to constants.
14335 (font_parse_fcname): Remove unused vars.
14336 (font_delete_unmatched): Now static.
14337 (font_get_spec): Remove; unused.
14338 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
14339 (font_update_drivers, Ffont_get_glyphs, font_add_log):
14340 Rename or move locals to avoid shadowing.
14341
14342 * fns.c (require_nesting_list, require_unwind): Now static.
14343 (Ffillarray): Rename locals to avoid shadowing.
14344
14345 * floatfns.c (domain_error2): Define only if needed.
14346 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
14347
14348 * alloc.c (mark_backtrace): Move decl from here ...
14349 * lisp.h: ... to here, so that it can be checked.
14350
14351 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
14352 (Fdefvar): Rewrite so as not to use empty "else".
14353 (lisp_indirect_variable): Name an expression,
14354 to avoid gcc -Wbad-function-cast warning.
14355 (Fdefvar): Rename locals to avoid shadowing.
14356
14357 * callint.c (quotify_arg, quotify_args): Now static.
14358 (Fcall_interactively): Rename locals to avoid shadowing.
14359 Use const pointer when appropriate.
14360
14361 * lisp.h (get_system_name, get_operating_system_release):
14362 Move decls here, to check interfaces.
14363 * process.c (get_operating_system_release): Move decl to lisp.h.
14364 * xrdb.c (get_system_name): Likewise.
14365 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
14366 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
14367 some of which prompt warnings from gcc -Wbad-function-cast.
14368 (Fformat_time_string, Fencode_time, Finsert_char):
14369 (Ftranslate_region_internal, Fformat):
14370 Rename or remove local vars to avoid shadowing.
14371 (Ftranslate_region_internal): Mark var as initialized.
14372
14373 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
14374 avoid shadowing.
14375
14376 * lisp.h (eassert): Check that the argument compiles, even if
14377 ENABLE_CHECKING is not defined.
14378
14379 * data.c (Findirect_variable): Name an expression, to avoid
14380 gcc -Wbad-function-cast warning.
14381 (default_value, arithcompare, arith_driver, arith_error): Now static.
14382 (store_symval_forwarding): Rename local to avoid shadowing.
14383 (Fmake_variable_buffer_local, Fmake_local_variable):
14384 Mark variables as initialized.
14385 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
14386
14387 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
14388 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14389 Rename locals to avoid shadowing.
14390 (mark_stack): Move local variables into the #ifdef region where
14391 they're used.
14392 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14393 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14394 needed otherwise.
14395 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14396 (GC_STRING_CHARS): Remove; not used.
14397 (Fmemory_limit): Cast sbrk's returned value to char *.
14398
14399 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14400 avoids undefined behavior in theory.
14401
14402 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14403
14404 Use functions, not macros, for up- and down-casing (Bug#8254).
14405 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14406 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
14407 to use the following functions instead of these macros.
14408 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
14409 EMACS_INT, since callers assume the returned value fits in int.
14410 (upcase1): Likewise, for UPCASE_TABLE.
14411 (uppercasep, lowercasep, upcase): New static inline functions.
14412 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
14413 the race-condition problem in the old DOWNCASE.
14414
14415 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14416 Rename locals to avoid shadowing.
14417 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
14418 (regex_compile, re_search_2, re_match_2_internal):
14419 Remove unused local vars.
14420 (FREE_VAR): Rewrite so as not to use empty "else",
14421 which gcc can warn about.
14422 (regex_compile, re_match_2_internal): Mark locals as initialized.
14423 (RETALLOC_IF): Define only if needed.
14424 (WORDCHAR_P): Likewise. This one is never needed, but is used
14425 only in a comment talking about a compiler bug, so put inside
14426 the #if 0 of that comment.
14427 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14428 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14429 Remove; unused.
14430
14431 * search.c (boyer_moore): Rename locals to avoid shadowing.
14432 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14433 (PREV_CHAR_BOUNDARY): Likewise.
14434
14435 * search.c (simple_search): Remove unused var.
14436
14437 * dired.c (compile_pattern): Move decl from here ...
14438 * lisp.h: ... to here, so that it can be checked.
14439 (struct re_registers): New forward decl.
14440
14441 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14442
14443 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14444 All uses changed.
14445 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14446 Rename locals to avoid shadowing.
14447 (Fvertical_motion): Mark locals as initialized.
14448
14449 * casefiddle.c (casify_object, casify_region): Now static.
14450 (casify_region): Mark local as initialized.
14451
14452 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14453
14454 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14455 New macros, so that the caller can use some names other than
14456 gcpro1, gcpro2, etc.
14457 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14458 of the new macros.
14459 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14460 argument, for consistency with GCPRO2_VAR, etc: it is now the
14461 prefix of the variable, not the variable itself. All uses
14462 changed.
14463 * dired.c (directory_files_internal, file_name_completion):
14464 Rename locals to avoid shadowing.
14465
14466 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14467 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14468 dired.c's scmp function, had undefined behavior.
14469 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14470 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14471 * buffer.h: ... to here, because these macros use current_buffer,
14472 and the new implementation with inline functions needs to have
14473 current_buffer in scope now, rather than later when the macros
14474 are used.
14475 (downcase, upcase1): New static inline functions.
14476 (DOWNCASE, UPCASE1): Reimplement using these functions.
14477 This avoids undefined behavior in expressions like
14478 DOWNCASE (x) == DOWNCASE (y), which previously suffered
14479 from race conditions in accessing the global variables
14480 case_temp1 and case_temp2.
14481 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14482 * lisp.h (case_temp1, case_temp2): Remove their decls.
14483 * character.h (ASCII_CHAR_P): Move from here ...
14484 * lisp.h: ... to here, so that the inline functions mentioned
14485 above can use them.
14486
14487 * dired.c (directory_files_internal_unwind): Now static.
14488
14489 * fileio.c (file_name_as_directory, directory_file_name):
14490 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14491 Now static.
14492 (file_name_as_directory): Use const pointers when appropriate.
14493 (Fexpand_file_name): Likewise. In particular, newdir might
14494 point at constant storage, so make it a const pointer.
14495 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
14496 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14497 signedness issues.
14498 (Fset_file_times, Finsert_file_contents, auto_save_error):
14499 Rename locals to avoid shadowing.
14500
14501 * minibuf.c (choose_minibuf_frame_1): Now static.
14502 (Ftry_completion, Fall_completions): Rename or remove locals
14503 to avoid shadowing.
14504
14505 * marker.c (bytepos_to_charpos): Remove; unused.
14506
14507 * lisp.h (verify_bytepos, count_markers): New decls,
14508 so that gcc does not warn that these functions aren't declared.
14509
14510 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14511 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
14512 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
14513 (copy_text): Remove unused local var.
14514
14515 * filelock.c (within_one_second): Now static.
14516 (lock_file_1): Rename local to avoid shadowing.
14517
14518 * buffer.c (fix_overlays_before): Mark locals as initialized.
14519 (fix_start_end_in_overlays): Likewise. This function should be
14520 simplified by using pointers-to-pointers, but that's a different
14521 matter.
14522 (switch_to_buffer_1): Now static.
14523 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14524 (report_overlay_modification): Rename locals to avoid shadowing.
14525
14526 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
14527 Fix pointer signedness issue.
14528 (sys_subshell): Mark local as volatile if checking for lint,
14529 to suppress a gcc -Wclobbered warning that does not seem to be right.
14530 (MAXPATHLEN): Define only if needed.
14531
14532 * process.c (serial_open, serial_configure): Move decls from here ...
14533 * systty.h: ... to here, so that they can be checked.
14534
14535 * fns.c (get_random, seed_random): Move extern decls from here ...
14536 * lisp.h: ... to here, so that they can be checked.
14537
14538 * sysdep.c (reset_io): Now static.
14539 (wait_for_termination_signal): Remove; unused.
14540
14541 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
14542 (copy_keymap_item, append_key, push_text_char_description):
14543 Now static.
14544 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
14545 (DENSE_TABLE_SIZE): Remove; unused.
14546 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
14547 (describe_map_tree):
14548 Rename locals to avoid shadowing.
14549
14550 * keyboard.c: Declare functions static if they are not used elsewhere.
14551 (echo_char, echo_dash, cmd_error, top_level_2):
14552 (poll_for_input, handle_async_input): Now static.
14553 (read_char, kbd_buffer_get_event, make_lispy_position):
14554 (make_lispy_event, make_lispy_movement, apply_modifiers):
14555 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14556 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14557 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
14558 (read_key_sequence, read_char): Mark locals as initialized.
14559 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
14560
14561 * keyboard.h (make_ctrl_char): New decl.
14562 (mark_kboards): Move decl here ...
14563 * alloc.c (mark_kboards): ... from here.
14564
14565 * lisp.h (force_auto_save_soon): New decl.
14566
14567 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
14568 (DEFINE_DUMMY_FUNCTION): New macro.
14569 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14570 Use it.
14571 (main): Add casts to avoid warnings
14572 if GCC considers string literals to be constants.
14573
14574 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14575
14576 * dbusbind.c: Pointer signedness fixes.
14577 (xd_signature, xd_append_arg, xd_initialize):
14578 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14579 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14580 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14581 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14582
14583 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14584 if GCC considers string literals to be constants.
14585 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
14586
14587 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14588
14589 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14590 (print_preprocess, print_object): New macro to fix last change.
14591
14592 * print.c (print_preprocess): Don't forget font objects.
14593
14594 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
14595
14596 * emacs.c (USAGE3): Doc fixes.
14597
14598 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14599
14600 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14601 structure.
14602
14603 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
14604
14605 * lisp.h (VWindow_system, Qfile_name_history):
14606 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14607 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14608 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14609
14610 * w32select.c: Don't #include "keyboard.h".
14611 (run_protected): Add extern declaration for waiting_for_input.
14612
14613 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14614 * w32console.c (detect_input_pending, read_input_pending)
14615 (encode_terminal_code):
14616 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14617 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14618 (w32_system_caret_y, Qfile_name_history):
14619 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14620 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14621 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14622 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14623 * w32proc.c (Qlocal, report_file_error):
14624 * w32term.c (Vwindow_system, updating_frame):
14625 * w32uniscribe.c (initialized, uniscribe_font_driver):
14626 Remove unneeded extern declarations.
14627
14628 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
14629
14630 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
14631
14632 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
14633
14634 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14635 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14636 These macros can no longer be used for assignment.
14637
14638 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14639 Assign struct members directly, instead of using BUF_BEGV etc.
14640 (record_buffer_markers, fetch_buffer_markers): New functions for
14641 recording and fetching special buffer markers.
14642 (set_buffer_internal_1, set_buffer_temp): Use them.
14643
14644 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14645
14646 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14647
14648 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14649 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14650
14651 * xdisp.c (hscroll_window_tree):
14652 (reconsider_clip_changes): Use PT instead of BUF_PT.
14653
14654 2011-03-13 Eli Zaretskii <eliz@gnu.org>
14655
14656 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14657 $(EMACS_ROOT)/lib/intprops.h.
14658
14659 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14660
14661 Fix more problems found by GCC 4.5.2's static checks.
14662
14663 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14664 to unsigned char * to avoid compiler diagnostic.
14665 (xg_free_frame_widgets): Make it clear that a local variable is
14666 needed only if USE_GTK_TOOLTIP.
14667 (gdk_window_get_screen): Make it clear that this macro is needed
14668 only if USE_GTK_TOOLTIP.
14669 (int_gtk_range_get_value): New function, which avoids a diagnostic
14670 from gcc -Wbad-function-cast.
14671 (xg_set_toolkit_scroll_bar_thumb): Use it.
14672 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14673 diagnostic from gcc -Wbad-function-cast.
14674 (get_utf8_string, xg_get_file_with_chooser):
14675 Rename locals to avoid shadowing.
14676 (create_dialog): Move locals to avoid shadowing.
14677
14678 * xgselect.c (xg_select): Remove unused var.
14679
14680 * image.c (four_corners_best): Mark locals as initialized.
14681 (gif_load): Initialize transparent_p to zero (Bug#8238).
14682 Mark another local as initialized.
14683 (my_png_error, my_error_exit): Mark with NO_RETURN.
14684
14685 * image.c (clear_image_cache): Now static.
14686 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
14687 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
14688 (x_edge_detection): Remove unnecessary cast that
14689 gcc -Wbad-function-cast diagnoses.
14690 (gif_load): Fix pointer signedness.
14691 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14692 (jpeg_load, gif_load): Rename locals to avoid shadowing.
14693
14694 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
14695
14696 Improve quality of tests for time stamp overflow.
14697 For example, without this patch (encode-time 0 0 0 1 1
14698 1152921504606846976) returns the obviously-bogus value (-948597
14699 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14700 reports time overflow. See
14701 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
14702 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14703 * editfns.c: Include limits.h and intprops.h.
14704 (TIME_T_MIN, TIME_T_MAX): New macros.
14705 (time_overflow): Move earlier, to before first use.
14706 (hi_time, lo_time): New functions, for an accurate test for
14707 out-of-range times.
14708 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14709 (Fget_internal_run_time): Don't assume time_t fits in int.
14710 (make_time): Use list2 instead of Fcons twice.
14711 (Fdecode_time): More accurate test for out-of-range times.
14712 (check_tm_member): New function.
14713 (Fencode_time): Use it, to test for out-of-range times.
14714 (lisp_time_argument): Don't rely on undefined left-shift and
14715 right-shift behavior when checking for time stamp overflow.
14716
14717 * editfns.c (time_overflow): New function, refactoring common code.
14718 (Fformat_time_string, Fdecode_time, Fencode_time):
14719 (Fcurrent_time_string): Use it.
14720
14721 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14722 * dired.c (make_time): Move to ...
14723 * editfns.c (make_time): ... here.
14724 * systime.h: Note the move.
14725
14726 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14727
14728 * fringe.c (update_window_fringes): Remove unused variables.
14729
14730 * unexmacosx.c (copy_data_segment): Also copy __got section.
14731 (Bug#8223)
14732
14733 2011-03-12 Eli Zaretskii <eliz@gnu.org>
14734
14735 * termcap.c [MSDOS]: Include "msdos.h".
14736 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14737 Constify `char *' arguments and their references according to
14738 prototypes in tparam.h.
14739
14740 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
14741
14742 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14743 Adapt all references accordingly.
14744
14745 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14746
14747 2011-03-11 Tom Tromey <tromey@redhat.com>
14748
14749 * buffer.c (syms_of_buffer): Remove obsolete comment.
14750
14751 2011-03-11 Eli Zaretskii <eliz@gnu.org>
14752
14753 * termhooks.h (encode_terminal_code): Declare prototype.
14754
14755 * msdos.c (encode_terminal_code): Don't declare prototype.
14756
14757 * term.c (encode_terminal_code): Now external again, used by
14758 w32console.c and msdos.c.
14759
14760 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14761 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
14762
14763 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
14764
14765 Fix some minor problems found by GCC 4.5.2's static checks.
14766
14767 * fringe.c (update_window_fringes): Mark locals as initialized
14768 (Bug#8227).
14769 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
14770
14771 * alloc.c (mark_fringe_data): Move decl from here ...
14772 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
14773 to check its interface.
14774 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
14775
14776 * fontset.c (free_realized_fontset): Now static.
14777 (Fset_fontset_font): Rename local to avoid shadowing.
14778 (fontset_font): Mark local as initialized.
14779 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
14780
14781 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
14782
14783 * xselect.c (x_disown_buffer_selections): Remove; not used.
14784 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
14785 (x_own_selection, Fx_disown_selection_internal): Rename locals
14786 to avoid shadowing.
14787 (x_handle_dnd_message): Remove local to avoid shadowing.
14788
14789 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
14790 so that the caller can use some name other than gcpro1.
14791 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
14792 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14793 (Fx_backspace_delete_keys_p):
14794 Use them to avoid shadowing, and rename vars to avoid shadowing.
14795 (x_decode_color, x_set_name, x_window): Now static.
14796 (Fx_create_frame): Add braces to silence GCC warning.
14797 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
14798 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
14799 Remove unused locals.
14800 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14801 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
14802 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
14803 macros.
14804
14805 * xterm.h (x_mouse_leave): New decl.
14806
14807 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
14808 Remove unused functions.
14809 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
14810 (x_calc_absolute_position): Now static.
14811 (XTread_socket): Don't define label "out" unless it's used.
14812 Don't declare local "event" unless it's used.
14813 (x_iconify_frame, x_free_frame_resources): Don't declare locals
14814 unless they are used.
14815 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
14816 (x_fatal_error_signal): Remove; not used.
14817 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
14818 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
14819 (x_error_catcher, x_connection_closed, x_error_handler):
14820 (x_error_quitter, xembed_send_message, x_iconify_frame):
14821 (my_log_handler): Rename locals to avoid shadowing.
14822 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
14823 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
14824
14825 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
14826 Rename or move locals to avoid shadowing.
14827 (tty_defined_color, merge_face_heights): Now static.
14828 (free_realized_faces_for_fontset): Remove; not used.
14829 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
14830 does not deduce is never used uninitialized.
14831 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
14832 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
14833
14834 * terminal.c (store_terminal_param): Now static.
14835
14836 * xmenu.c (menu_highlight_callback): Now static.
14837 (set_frame_menubar): Remove unused local.
14838 (xmenu_show): Rename parameter to avoid shadowing.
14839 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
14840 since they might point to immutable storage.
14841 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
14842 since it's unused otherwise.
14843
14844 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
14845 Add a FIXME, since the code still doesn't look right. (Bug#8215)
14846 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
14847 avoids a gcc -Wuninitialized diagnostic.
14848 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
14849 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
14850 does not deduce are never used uninitialized.
14851
14852 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
14853
14854 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
14855 * window.c (window_loop, size_window):
14856 (run_window_configuration_change_hook, enlarge_window): Likewise.
14857
14858 * window.c (display_buffer): Now static.
14859 (size_window): Mark variables that gcc -Wuninitialized
14860 does not deduce are never used uninitialized.
14861 * window.h (check_all_windows): New decl, to forestall
14862 gcc -Wmissing-prototypes diagnostic.
14863 * dispextern.h (bidi_dump_cached_states): Likewise.
14864
14865 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
14866 shadowing.
14867 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
14868 Include <limits.h>.
14869 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
14870 and to avoid gcc -Wuninitialized warning.
14871 (load_charset_map): Mark variables that gcc -Wuninitialized
14872 does not deduce are never used uninitialized.
14873 (load_charset): Abort instead of using uninitialized var (Bug#8229).
14874
14875 * coding.c (coding_set_source, coding_set_destination):
14876 Use "else { /* comment */ }" rather than "else /* comment */;"
14877 for clarity, and to avoid gcc -Wempty-body warning.
14878 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14879 a block, when the outer 'i' will do.
14880 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14881 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14882 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14883 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14884 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14885 Rename locals to avoid shadowing.
14886 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
14887 * coding.c (emacs_mule_char, encode_invocation_designation):
14888 Now static, since they're not used elsewhere.
14889 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
14890 (decode_coding_object, encode_coding_object, detect_coding_system):
14891 (decode_coding_emacs_mule): Mark variables that gcc
14892 -Wuninitialized does not deduce are never used uninitialized.
14893 (detect_coding_iso_2022): Initialize a local variable that might
14894 be used uninitialized. Leave a FIXME because it's not clear that
14895 this initialization is needed. (Bug#8211)
14896 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14897 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14898 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14899 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14900 Remove unused macros.
14901
14902 * category.c (hash_get_category_set): Remove unused local var.
14903 (copy_category_table): Now static, since it's not used elsewhere.
14904 * character.c (string_count_byte8): Likewise.
14905
14906 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14907 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14908
14909 * chartab.c (copy_sub_char_table): Now static, since it's not used
14910 elsewhere.
14911 (sub_char_table_ref_and_range, char_table_ref_and_range):
14912 Rename locals to avoid shadowing.
14913 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
14914
14915 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
14916 (BIDI_BOB): Remove unused macro.
14917
14918 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14919 deduce are never used uninitialized.
14920 * term.c (encode_terminal_code): Likewise.
14921
14922 * term.c (encode_terminal_code): Now static. Remove unused local.
14923
14924 * tparam.h: New file.
14925 * term.c, tparam.h: Include it.
14926 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14927 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14928 Move these decls to tparam.h, and make them agree with what
14929 is actually in tparam.c. The previous trick of using incompatible
14930 decls in different modules does not conform to the C standard.
14931 All callers of tparam changed to use tparam's actual API.
14932 * tparam.c (tparam1, tparam, tgoto):
14933 Use const pointers where appropriate.
14934
14935 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14936 * cm.h (struct cm): Likewise.
14937 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14938 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14939 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14940 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14941 (turn_on_face, init_tty): Likewise.
14942 * termchar.h (struct tty_display_info): Likewise.
14943
14944 * term.c (term_mouse_position): Rename local to avoid shadowing.
14945
14946 * alloc.c (mark_ttys): Move decl from here ...
14947 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14948
14949 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14950
14951 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14952
14953 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
14954
14955 * search.c (compile_pattern_1): Remove argument regp, unused since
14956 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14957 (compile_pattern): Don't pass it.
14958
14959 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14960
14961 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14962 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14963 for ! HAVE_GTK3.
14964 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14965
14966 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14967
14968 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14969 gdk_window_get_screen, gdk_window_get_geometry,
14970 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14971 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14972 (xg_get_pixbuf_from_pixmap): New function.
14973 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14974 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14975 Call xg_get_pixbuf_from_pixmap instead of
14976 gdk_pixbuf_get_from_drawable.
14977 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14978 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14979 (xg_check_special_colors): Use GtkStyleContext and its functions
14980 for HAVE_GTK3.
14981 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14982 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14983 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
14984 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14985 Call gtk_widget_get_preferred_size.
14986 (xg_frame_resized): gdk_window_get_geometry only takes 5
14987 parameters.
14988 (xg_win_to_widget, xg_event_is_for_menubar):
14989 Call gdk_x11_window_lookup_for_display.
14990 (xg_set_widget_bg): New function.
14991 (delete_cb): New function.
14992 (xg_create_frame_widgets): Connect delete-event to delete_cb.
14993 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
14994 (xg_set_background_color): Call xg_set_widget_bg.
14995 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14996 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14997 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14998 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14999 if ! HAVE_GTK3.
15000 (update_frame_tool_bar): Call gtk_widget_hide.
15001 (xg_initialize): Use GDK_KEY_g.
15002
15003 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
15004 if ! HAVE_GTK3
15005 (x_session_initialize): Call gdk_x11_set_sm_client_id.
15006
15007 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
15008 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
15009 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
15010
15011 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
15012
15013 * w32xfns.c (select_palette): Check success of RealizePalette against
15014 GDI_ERROR, not zero.
15015
15016 See ChangeLog.11 for earlier changes.
15017
15018 ;; Local Variables:
15019 ;; coding: utf-8
15020 ;; End:
15021
15022 Copyright (C) 2011-2012 Free Software Foundation, Inc.
15023
15024 This file is part of GNU Emacs.
15025
15026 GNU Emacs is free software: you can redistribute it and/or modify
15027 it under the terms of the GNU General Public License as published by
15028 the Free Software Foundation, either version 3 of the License, or
15029 (at your option) any later version.
15030
15031 GNU Emacs is distributed in the hope that it will be useful,
15032 but WITHOUT ANY WARRANTY; without even the implied warranty of
15033 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15034 GNU General Public License for more details.
15035
15036 You should have received a copy of the GNU General Public License
15037 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.