Separate read and write access to Lisp_Object slots of struct window.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
077288cf
DA
12012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Separate read and write access to Lisp_Object slots of struct window.
4 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
10 Adjust users.
11
71688bd7
DA
122012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
13
14 Fix Windows build errors introduced after converting to FGET and FSET.
15 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
16 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
17 (w32_judge_scroll_bars): Change to use FSET.
18 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
19
f99bac93
DA
202012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
21
22 Fix replacement typo.
23 * window.c (replace_window): Set root_window instead of
24 selected_window. This fixes a total window subsystem
25 malfunction reported by Bastien Guerry <bzg@gnu.org>.
26
8c2a0f2d
GM
272012-08-06 Glenn Morris <rgm@gnu.org>
28
29 * lisp.mk (lisp): Add language/persian.elc.
30
edd74c35
DA
312012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
32
33 Separate read and write access to Lisp_Object slots of struct frame.
34 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
35 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
36 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
37 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
38 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
39
8671676c
AS
402012-08-05 Andreas Schwab <schwab@linux-m68k.org>
41
42 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
43
663e2b3f
DA
442012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
45
46 Generalize common compile-time constants.
47 * lisp.h (header_size, bool_header_size, word_size): Now here.
48 (struct Lisp_Vector): Add comment.
49 (struct Lisp_Bool_Vector): Move up to define handy constants.
50 (VECSIZE, PSEUDOVECSIZE): Simplify.
51 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
52 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
53 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
54 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
55 * xfont.c, xmenu.c: Use word_size where appropriate.
56
d32e47af
LM
572012-08-05 Lawrence Mitchell <wence@gmx.li>
58
59 * search.c (Freplace_match): Treat \? in the replacement text
60 literally (Bug#8161).
61
e5d9c0d1
CY
622012-08-05 Chong Yidong <cyd@gnu.org>
63
64 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
65 * frame.c (Vdelete_frame_functions):
66 * emacs.c (Vkill_emacs_hook): Doc fix.
67
8da0576b
EZ
682012-08-04 Eli Zaretskii <eliz@gnu.org>
69
70 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
71 --with-x-toolkit=no builds.
72 Reported by Carsten Mattner <carstenmattner@gmail.com>.
73
02676e5d
CY
742012-08-04 Chong Yidong <cyd@gnu.org>
75
76 * syntax.c (Fmodify_syntax_entry): Doc fix.
77
97147da9
EZ
782012-08-04 Eli Zaretskii <eliz@gnu.org>
79
76151e2c
EZ
80 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
81 * w32.c (init_environment): Change the default values of many
82 environment variables in dflt_envvars[] to NULL, to avoid pushing
83 them into environment when they were not already defined. Remove
84 the code that deletes site-lisp subdirectories from the default
85 value of EMACSLOADPATH, as it is no longer needed.
86 (check_windows_init_file): Now external, not static. Use
87 Vload_path as is, without adding anything, as this function is now
88 called when Vload_path is already set up.
89
90 * w32.h (check_windows_init_file): Add prototype.
91
92 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
93 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
94 compatibility with Posix platforms.
95 (main): Move the call to check_windows_init_file to here from
96 w32.c.
97 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
98 any, in the DEFALT argument into the root of the Emacs build or
99 installation tree, as appropriate.
100
101 * callproc.c (init_callproc_1): Call decode_env_path instead of
102 doing its equivalent by hand.
103 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
104 the code that sets Vexec_path run on MS-Windows.
105
106 * lread.c (init_lread): Add comments to #ifdef's.
107
97147da9
EZ
108 * msdos.c (dos_set_window_size, IT_update_begin)
109 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
110 instead of direct references.
111
185ee146
PE
1122012-08-04 Paul Eggert <eggert@cs.ucla.edu>
113
114 Export DEFAULT_REHASH_* to GDB.
115 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
116 Now constants, not macros.
117
8834c57a
PE
1182012-08-03 Paul Eggert <eggert@cs.ucla.edu>
119
98c6f1e3
PE
120 Remove unnecessary casts involving pointers.
121 These casts are no longer needed now that we assume C89 or later,
122 since they involve casting to or from void *.
123 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
124 (make_pure_float, make_pure_vector):
125 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
126 * macros.c (Fstart_kbd_macro):
127 * menu.c (find_and_return_menu_selection):
128 * minibuf.c (read_minibuf_noninteractive):
129 * sysdep.c (closedir):
130 * xdisp.c (x_produce_glyphs):
131 * xfaces.c (compare_fonts_by_sort_order):
132 * xfns.c (x_real_positions, select_visual):
133 * xselect.c (x_stop_queuing_selection_requests)
134 (x_get_window_property, x_get_window_property_as_lisp_data):
135 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
136 Remove unnecessary pointer casts.
137 * alloc.c (record_xmalloc): New function.
138 * lisp.h (record_xmalloc): New decl.
139 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
140 more like a function. This is because the pointer cast is not
141 needed. All uses changed.
142 * print.c (print_string, print_error_message): Avoid length recalc.
143
8834c57a
PE
144 Improve fix for macroexp crash with debugging (Bug#12118).
145 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
146 ARRAY_MARK_FLAG when checking subscripts, because ASET is
147 not supposed to be invoked from the garbage collector.
148 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
149 (gc_aset): New function, which is like ASET but can be
150 used in the garbage collector.
151 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
152 (set_hash_index): Use it instead of ASET.
153
6dad7178
EZ
1542012-08-03 Eli Zaretskii <eliz@gnu.org>
155
156 Support symlinks on latest versions of MS-Windows.
157 * w32.c: Include winioctl.h and aclapi.h.
158 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
159 (revert_to_self): Forward declarations of static functions.
160 <static BOOL g_b_init_get_security_info>:
161 <g_b_init_create_symbolic_link>: New static flags.
162 (globals_of_w32): Initialize them to zero.
163 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
164 (map_w32_filename): Improve commentary. Simplify switch.
165 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
166 headers (most versions of MinGW w32api don't).
167 (get_security_info, create_symbolic_link)
168 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
169 New functions.
170 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
171 in the argument file name.
172 (sys_access): Call unc_volume_file_attributes only if
173 GetFileAttributes fails with network-related error codes.
174 (sys_rename): Diagnose renaming of a symlink when the user doesn't
175 have the required privileges.
176 (get_file_security_desc_by_name): Renamed from
177 get_file_security_desc.
178 (stat_worker): New function, with most of the guts of 'stat', and
179 with addition of handling of symlinks and support for 'lstat'. If
180 possible, get file's attributes and security information by
181 handle, not by name. Produce S_IFLNK bit for symlinks, when
182 called from 'lstat'.
183 (stat, lstat): New functions, call 'stat_worker'.
184 (symlink, readlink, careadlinkat): Rewritten to create and resolve
185 symlinks when the underlying filesystem supports them.
186
f162bcc3
PE
1872012-08-02 Paul Eggert <eggert@cs.ucla.edu>
188
79ea6c20
PE
189 Fix macroexp crash on Windows with debugging (Bug#12118).
190 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
191 checking subscripts; problem introduced with the recent
192 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
193 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
194 since it's used in non-static inline functions now.
195
c0ce93fd
PE
196 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
197 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 198
f162bcc3
PE
199 Use C99-style 'extern inline' if available.
200 * buffer.h (BUFFER_INLINE):
201 * category.h (CATEGORY_INLINE):
202 * character.h (CHARACTER_INLINE):
203 * charset.h (CHARSET_INLINE):
204 * composite.h (COMPOSITE_INLINE):
205 * dispextern.h (DISPEXTERN_INLINE):
206 * lisp.h (LISP_INLINE):
207 * systime.h (SYSTIME_INLINE):
208 New macro, replacing 'static inline' in this header.
209 * buffer.h, category.h, character.h, charset.h, composite.h:
210 * dispextern.h, lisp.h, systime.h:
211 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
212 * alloc.c (LISP_INLINE):
213 * buffer.c (BUFFER_INLINE):
214 * category.c (CATEGORY_INLINE):
215 * character.c (CHARACTER_INLINE):
216 * charset.c (CHARSET_INLINE):
217 * composite.c (COMPOSITE_INLINE):
218 * dispnew.c (DISPEXTERN_INLINE):
219 * sysdep.c (SYSTIME_INLINE):
220 Define to EXTERN_INLINE, so that the corresponding functions
221 are compiled into code.
222 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
223 (INLINE_HEADER_END): New macros.
224 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
225 since it's used in non-static inline functions now.
a8333d03 226 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 227
837b365b
GM
2282012-08-02 Glenn Morris <rgm@gnu.org>
229
d66b744d
GM
230 * s/: Remove empty directory.
231
837b365b
GM
232 * s/ms-w32.h: Move to ../nt/inc.
233 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
234 Update for new ms-w32.h location.
235
13294f95
PE
2362012-08-02 Paul Eggert <eggert@cs.ucla.edu>
237
238 Port to Solaris 8.
239 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
240
90df0db3
GM
2412012-08-02 Glenn Morris <rgm@gnu.org>
242
243 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
244 hard-coding the path separator.
245
4939150c
PE
2462012-08-01 Paul Eggert <eggert@cs.ucla.edu>
247
248 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
249 This how ASET and AREF are supposed to work, and makes
250 it easier to think about future improvements. See
251 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
252 * charset.h (set_charset_attr): New function.
253 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
254 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
255 (aref_addr): New function. All uses of &AREF(...) changed.
256 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
257 (set_hash_index): New functions. All lvalue-style uses of
258 HASH_KEY etc. changed.
259 * keyboard.c (set_prop): New function. All lvalue-style uses
260 of PROP changed.
261
947b2afd
AA
2622012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
263
264 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
265 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
266 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
267 * nsfns.m (ns_set_name_as_filename): Likewise.
268 * nsmenu.m (ns_update_menubar): Likewise.
269 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
270
4f5d0325
EZ
2712012-08-01 Eli Zaretskii <eliz@gnu.org>
272
2008beae
EZ
273 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
274 Adapt to latest changes in field names of the corresponding Lisp
288479f6 275 objects.
2008beae 276
4f5d0325
EZ
277 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
278
fe3cc771
GM
2792012-08-01 Glenn Morris <rgm@gnu.org>
280
281 * s/msdos.h: Remove file.
282 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
283 * Makefile.in (S_FILE): Remove.
284 (config_h): Remove S_FILE.
285
c90acc54
JB
2862012-08-01 Juanma Barranquero <lekktu@gmail.com>
287
288 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
289 Remove; moved to nt/config.nt.
290
d8a05828
DA
2912012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
292
293 Use INTERNAL_FIELD for conses and overlays.
294 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
295 Remove obsolete comment.
296 (MVAR): New macro.
297 (struct Lisp_Overlay): Use INTERNAL_FIELD.
298 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
299
8271d590
DA
3002012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
301
302 Use INTERNAL_FIELD for symbols.
303 * lisp.h (SVAR): New macro. Adjust users.
304 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
305 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
306
3193acd2
DA
3072012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
308
309 Use INTERNAL_FIELD for processes.
310 * process.h (PVAR): New macro. Adjust style.
311 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
312 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
313
3a45383a
DA
3142012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
315
316 Use INTERNAL_FIELD for windows.
317 * window.h (WVAR): New macro.
318 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
319 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
320 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
321 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
322 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
323 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
324
c1dbc63c
PE
3252012-08-01 Paul Eggert <eggert@cs.ucla.edu>
326
327 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
328
5c0c0e8a
GM
3292012-08-01 Glenn Morris <rgm@gnu.org>
330
331 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
332 Move to configure.ac.
333
552a99b4
JB
3342012-08-01 Juanma Barranquero <lekktu@gmail.com>
335
336 * makefile.w32-in (CONFIG_H): Update dependencies.
337 (CONF_POST_H): New macro.
338
339 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
340
8d8e2dfe
GM
3412012-07-31 Glenn Morris <rgm@gnu.org>
342
bc96620a
GM
343 * Makefile.in (S_FILE): No longer set by configure.
344
476b1b2d
GM
345 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
346 is available.
347 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
348
b2c7a106
GM
349 * process.h (NULL_DEVICE):
350 * emacs.c (SEPCHAR):
351 * editfns.c (USER_FULL_NAME): Let configure set them.
352
d53d062a
GM
353 * s/README, s/template.h: Remove files.
354
4515017f
GM
355 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
356
8d8e2dfe
GM
357 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
358 Move to configure.ac.
359
5b20b3cc
EZ
3602012-07-31 Eli Zaretskii <eliz@gnu.org>
361
1e0afd9a
EZ
362 * .gdbinit (xframe): Adapt to introduction of FVAR and the
363 resulting renaming of 'struct frame' members.
364
5b20b3cc
EZ
365 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
366
367 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
368 after introduction of FVAR.
369
f1310128
JD
3702012-07-31 Jan Djärv <jan.h.d@swipnet.se>
371
79e721e0
JD
372 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
373
374 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
375 instead of compositeToPoint.
376 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
377
8d7c7eed 378 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 379
e34f7f79
DA
3802012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
381
382 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
383 * lisp.h (INTERNAL_FIELD): New macro.
384 * buffer.h (BUFFER_INTERNAL_FIELD): Removed.
385 (BVAR): Change to use INTERNAL_FIELD.
386 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
387 (KVAR): Change to use INTERNAL_FIELD.
388 * frame.h (FVAR): New macro.
389 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
390 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
391 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
392 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
393 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
394
c09bfb2f
DA
3952012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
396
397 Miscellaneous fixes for non-default X toolkits.
398 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
399 * xterm.c (x_frame_of_widget): Remove redundant prototype.
400 Move under #ifdef USE_LUCID.
401 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
402 definition and usage to avoid warnings.
403
14c114ae
JD
4042012-07-31 Jan Djärv <jan.h.d@swipnet.se>
405
406 * nsterm.m (openFiles): Fix previous checkin.
407
3bd21e82
PE
4082012-07-31 Paul Eggert <eggert@cs.ucla.edu>
409
410 * indent.c (compute_motion): Remove unused local.
411
c1529ded
GM
4122012-07-31 Glenn Morris <rgm@gnu.org>
413
400d5621
GM
414 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
415
268e2432
GM
416 * conf_post.h [USG5_4]:
417 Move remaining contents of s/usg5-4-common.h here.
418 * s/usg5-4-common.h: Remove file.
419
7552f3ee
GM
420 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
421 * s/irix6-5.h: Remove file.
422
6a381852
GM
423 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
424 * s/darwin.h: Remove file.
425
c1529ded
GM
426 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
427 * s/hpux10-20.h: Remove file, which is now empty.
428
b429a4ee
GM
4292012-07-30 Glenn Morris <rgm@gnu.org>
430
431 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
432 * Makefile.in (config_h): Add conf_post.h.
433 * makefile.w32-in (CONFIG_H): Add conf_post.h.
434
adff3182
JD
4352012-07-30 Jan Djärv <jan.h.d@swipnet.se>
436
437 * nsterm.m (ns_do_open_file): New variable.
b9031d69 438 (ns_term_init): Set ns_do_open_file to YES after run returns.
adff3182
JD
439 (openFile, openTempFile, openFileWithoutUI, openFiles): Open
440 files only if ns_do_open_file.
441
c32af1e4
PE
4422012-07-30 Paul Eggert <eggert@cs.ucla.edu>
443
7393bcbb
PE
444 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
445 This no-op macro hasn't been needed for many years.
446 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
447
c32af1e4
PE
448 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
449 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
450 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
451 gdb_make_enums_visible.
452 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
453 (DIRECTORY_SEP): Now a constant, not a macro.
454
302fc036
EZ
4552012-07-30 Eli Zaretskii <eliz@gnu.org>
456
457 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
458 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
459
460 * w32term.c <w32_keyboard_codepage>: Renamed from
461 keyboard_codepage and now external. All users changed.
462
463 * w32term.h: Add declaration of w32_keyboard_codepage.
464
465 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
466 the codepage to translate keys to Unicode. If this argument is
467 -1, use the value returned by GetConsoleCP. All callers changed.
468
88fb40b4
PE
4692012-07-30 Paul Eggert <eggert@cs.ucla.edu>
470
0aee6912
PE
471 Update .PHONY listings in makefiles.
472 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
473 bootstrap-clean, distclean, maintainer-clean, versioclean,
474 extraclean, frc.
475
88fb40b4
PE
476 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
477 This is a bit clearer. Fix some commentary typos.
478
0a763bd1
GM
4792012-07-30 Glenn Morris <rgm@gnu.org>
480
32bac6d6
GM
481 * s/netbsd.h: Let configure include signal.h if needed.
482 Remove file, which is now empty.
483
b65e7c46
GM
484 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
485 Let configure set them.
486 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
487 No more need to undefine.
0a763bd1 488
169304bd
AS
4892012-07-30 Andreas Schwab <schwab@linux-m68k.org>
490
491 * keymap.c (Fkey_description): Don't remove 0x80 bit from
492 non-single-byte char when adding meta modifier. (Bug#12090)
493
6cd7a139
DA
4942012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
495
496 Convert safe_call to use variable number of arguments.
497 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
498 (safe_call2): Fix comment.
499 * lisp.h (safe_call): Adjust prototype.
500 * coding.c (encode_coding_object): Change to use safe_call2.
501 * xfaces.c (merge_face_heights): Change to use safe_call1.
502
d34d6ffc
GM
5032012-07-30 Glenn Morris <rgm@gnu.org>
504
7b8a48e4 505 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 506 does that unconditionally. Remove file, which is now empty.
7b8a48e4 507
d34d6ffc
GM
508 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
509 Remove empty files.
510
03a660a6
PE
5112012-07-30 Paul Eggert <eggert@cs.ucla.edu>
512
513 Export to GDB most of lisp.h's remaining object-like macros.
514 * lisp.h (min, max): Move earlier, because they're used earlier now.
515 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
516 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
517 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
518 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
519 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
520 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
521 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
522 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
523 Now constants, for GDB. They need not be macros.
524 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
525 Now constants, for GDB, as well as macros, for static initializers.
526 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
527 Move to after the definition of struct Lisp_Char_Table,
528 since the former now needs that type defined.
529 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
530 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
531 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
532 New enums, for gdb_make_enums_visible.
533 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 534 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
535 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
536 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
537 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
538 enum maxargs, enum MAX_ALLOCA.
539 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
540 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
541 no longer needed, now that they are done in lisp.h.
542
e499d0ee
DA
5432012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
544
545 Cleanup string bytes checking.
546 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
547 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
548 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
549 (check_sblock, compact_small_strings): Simplify.
550
d5040d2d
PE
5512012-07-29 Paul Eggert <eggert@cs.ucla.edu>
552
553 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
554 These macros are confusing and no longer need to be defined, as
555 the enum values now suffice. All uses replaced with definiens.
556 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
557
7f259ae6
JB
5582012-07-29 Juanma Barranquero <lekktu@gmail.com>
559
560 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
561 ($(BLD)/w32console.$(O)): Update dependencies.
562
7e63e0c3
DA
5632012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
564
565 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
566 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
567 time. Adjust users.
568 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
569
ffd817eb
JD
5702012-07-29 Jan Djärv <jan.h.d@swipnet.se>
571
572 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
573 setting sitelisp (Bug#12010).
574
417a7a0e
EZ
5752012-07-29 Eli Zaretskii <eliz@gnu.org>
576
577 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
578
579 * w32heap.c (cache_system_info):
580 * w32.c (sys_rename):
581 * w32proc.c (find_child_console, sys_kill): All users changed.
582
387d4d92
PE
5832012-07-29 Paul Eggert <eggert@cs.ucla.edu>
584
585 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
586
55a6cca6
EZ
5872012-07-29 Eli Zaretskii <eliz@gnu.org>
588
589 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
590
dbcf001c
DA
5912012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
592
593 Cleanup statistics calculation in Fgarbage_collect.
594 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
595 zombies percentage calculation. Simplify elapsed time calculation.
596
e2688e4a
DA
5972012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
598
599 Generalize marker debugging code under MARKER_DEBUG and use eassert.
600 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
601 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
602 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
603 (replace_range, replace_range_2, del_range_2): Change to eassert.
604 * marker.c (byte_char_debug_check): Adjust style.
605
b46a6a83
PE
6062012-07-29 Paul Eggert <eggert@cs.ucla.edu>
607
608 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
609 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
610 long-ago-commented-out code that talks about "WIN32".
611 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
612 All uses changed.
613
e32a5799
PE
6142012-07-28 Paul Eggert <eggert@cs.ucla.edu>
615
616 Use Gnulib stdalign module (Bug#9772, Bug#9960).
617 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
618 Simplify by using alignof.
619 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
620 * lisp.h: Include <stdalign.h>.
621 (GCALIGNMENT): New macro and constant.
622 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
623 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
624 (stdalign): New macro, if not already defined.
625
df81cd29
EZ
6262012-07-28 Eli Zaretskii <eliz@gnu.org>
627
01bd1b0d
EZ
628 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
629 * w32inevt.c: Include w32inevt.h.
630 (w32_read_console_input): New inline function, calls either
631 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
632 w32_console_unicode_input.
633 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
634 (w32_kbd_patch_key, key_event): Use the codepage returned by
635 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
636 (key_event): use uChar.UnicodeChar only if
637 w32_console_unicode_input is non-zero.
638
639 * w32console.c: Include w32heap.h.
640 <w32_console_unicode_input>: New global variable.
641 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
642 family of Windows, zero otherwise.
643
644 * w32inevt.h: Declare w32_console_unicode_input.
645
df81cd29
EZ
646 * xdisp.c (init_iterator): Don't reference tip_frame in a build
647 --without-x. (Bug#11742)
648
c20fdd9e
PE
6492012-07-27 Paul Eggert <eggert@cs.ucla.edu>
650
651 Adjust GDB to reflect pvec_type changes (Bug#12036).
652 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
653 2012-07-04 changes to pseudovector representation. Problem
654 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
655
32770973 6562012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
657
658 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
659 bus address.
660 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
661
3438fe21
EZ
6622012-07-27 Eli Zaretskii <eliz@gnu.org>
663
bcfbc9de
EZ
664 * alloc.c (listn): Fix the order the arguments are consed onto the
665 list.
666
3438fe21
EZ
667 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
668 enumeration constants, as PURE and HEAP are too general, and clash
669 with other headers and sources, such as gmalloc.c and the
670 MS-Windows system headers. All users changed.
671
eeaea515
DA
6722012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
673
674 Revert last save_excursion_save and save_excursion_restore changes.
675 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
676 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
677
073c88c2
DA
6782012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
679
680 Fix recently-introduced typos in Windows port.
681 Reported by Martin Rudalics <rudalics@gmx.at>.
682 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 683 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 684
4706125e
PE
6852012-07-27 Paul Eggert <eggert@cs.ucla.edu>
686
687 Improve GDB symbol export (Bug#12036).
688 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
689 arms of an 'if', not using conditional expressions; otherwise GDB
690 complains about the types in the unevaluated arm when the argument
691 is an integer literal.
692 (xgetint): Simplify expression.
693 * alloc.c (gdb_make_enums_visible): New constant. This ports to
694 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
695 Zaretskii in <http://bugs.gnu.org/12036#13>.
696 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
697 needed now that we have gdb_make_enums_visible.
698 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
699 (enum enum_USE_LSB_TAG):
700 New enum types, packaging up enums that need to be exported to GDB.
701
694b6c97
DA
7022012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
703
704 Utility function to make a list from specified amount of objects.
705 * lisp.h (enum constype): New datatype.
706 (listn): New prototype.
707 * alloc.c (listn): New function.
708 (Fmemory_use_count, syms_of_alloc): Use it.
709 * buffer.c (syms_of_buffer): Likewise.
710 * callint.c (syms_of_callint): Likewise.
711 * charset.c (define_charset_internal): Likewise.
712 * coding.c (syms_of_coding): Likewise.
713 * keymap.c (syms_of_keymap): Likewise.
714 * search.c (syms_of_search): Likewise.
715 * syntax.c (syms_of_syntax): Likewise.
716 * w32.c (init_environment): Likewise.
717 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
718 * xdisp.c (syms_of_xdisp): Likewise.
719 * xfns.c (syms_of_xfns): Likewise.
720
6195f384
DA
7212012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
722
723 Fast save_excursion_save and save_excursion_restore.
724 * lisp.h (struct Lisp_Excursion): New data type.
725 (PVEC_EXCURSION): New pseudovector type.
726 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
727 to deal with it. Adjust comments.
728 (init_marker, attach_marker): New prototype.
729 (unchain_marker): Adjust prototype.
730 * marker.c (attach_marker): Change to global.
731 (init_marker): New function.
732 * alloc.c (Fmake_marker, build_marker): Use it.
733 (build_marker): More easserts.
734 (mark_object): Handle struct Lisp_Excursion.
735 * editfns.c (save_excursion_save, save_excursion_restore):
736 Reimplement to use struct Lisp_Excursion. Add comments.
737
5eceb8fb
PE
7382012-07-26 Paul Eggert <eggert@cs.ucla.edu>
739
740 Fix export of symbols to GDB (Bug#12036).
741 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
742 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
743 emacs.c, as this is a more-suitable home. Had this been done earlier
744 the fix for 12036 would have avoided some of the problems noted in
745 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
746 would have been more obvious.
562157c8
PE
747 * emacs.c: Do not include <verify.h>; no longer needed.
748 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
749 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
750 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
751 Remove; now done in lisp.h.
752 * lisp.h (PUBLISH_TO_GDB): New macro.
753 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
754 (DATA_SEG_BITS): Use it.
755 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
756 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
757 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
758 not be usable in #if. This simplifies things.
759
d6749401
JB
7602012-07-26 Juanma Barranquero <lekktu@gmail.com>
761
762 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
763
1781b9e9
PE
7642012-07-26 Paul Eggert <eggert@cs.ucla.edu>
765
d89518db 766 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
767 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
768 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
769 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
770 Adjust to changes in lisp.h and emacs.c, by using
771 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
772 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
773 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
774 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
775 instead of gdb_valbits.
776 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
777 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
778 instead of gdb_array_mark_flag.
779 (xboolvector): Get size from $->size, not $->header.size.
780 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
781 (xreload, hook-run, hookpost-run): Remove.
782 * emacs.c: Include <verify.h>.
783 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
784 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
785 Remove.
786 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
787 (gdb_USE_LSB_TAG): New enum constants.
788 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
789 Also define these as enum constants, so they're visible to GDB.
790 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
791 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
792 as constants, so they're visible to GDB.
793 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
794 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
795 Now enum constants, not macros, so they're visible to GDB.
796 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
797 more convenient now. All uses changed.
798 (VALMASK) [USE_LSB_TAG]: Also define in this case.
799 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
800
3628596a
DA
8012012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
802
803 Explicitly free restriction data that are not needed anymore.
804 * editfns.c (save_restriction_restore): Free restriction data.
805
7abaf5cc
SM
8062012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
807
808 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
809 add argument, tune behavior, and adjust all callers.
810
71f88e00
PE
8112012-07-25 Paul Eggert <eggert@cs.ucla.edu>
812
813 Use typedef for EMACS_INT, EMACS_UINT.
814 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
815 than macros. This simplifies debugging in the usual case, since
816 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
817 and it allows expressions involving EMACS_INT casts.
818 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
819
57ec3034
JD
8202012-07-25 Jan Djärv <jan.h.d@swipnet.se>
821
822 * nsterm.m (ns_read_socket): Return early if there is a modal
823 window (Bug#12043).
824
8137e7b3
MR
8252012-07-25 Martin Rudalics <rudalics@gmx.at>
826
827 * frame.c (Fredirect_frame_focus): In doc-string don't mention
828 that FOCUS-FRAME can be omitted.
829
04e9897c
DA
8302012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
831
832 Adjust buffer text indirection counters at the end of Fkill_buffer.
833 * buffer.c (Fkill_buffer): Adjust indirection counters when the
834 buffer is definitely dead. This should really fix an issue reported
835 by Christoph Scholtes again. (Bug#12007).
836 (init_buffer_once): Initialize indirection counters of
837 buffer_defaults and buffer_local_symbols (for sanity and safety).
838
8a0484e1
EZ
8392012-07-24 Eli Zaretskii <eliz@gnu.org>
840
841 * xdisp.c (init_iterator): Don't compute dimensions of truncation
842 and continuation glyphs on tooltip frames, leave them at zero.
843 Avoids continued lines in tooltips. (Bug#11832)
844
fa691a83
DA
8452012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
846
847 Simplify copy_overlay.
04e9897c 848 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
849 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
850
436bc8e0
EZ
8512012-07-23 Eli Zaretskii <eliz@gnu.org>
852
853 * print.c (print_object): Don't crash when a frame's name is nil
854 or invalid. (Bug#12025)
855
856 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
857 it signals an error when a tooltip frame is being created.
858
d7a7fda3
DA
8592012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
860
861 Cleanup miscellaneous objects allocation and initialization.
862 * alloc.c (allocate_misc): Change to static. Add argument to
863 specify the subtype. Adjust comment and users.
864 (build_overlay): New function.
865 * buffer.c (copy_overlays, Fmake_overlay): Use it.
866 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
867 (allocate_misc): Remove prototype.
868 (build_overlay): Add prototype.
869
8702012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
871
872 Swap buffer text indirection counters in Fbuffer_swap_text.
873 * buffer.c (Fbuffer_swap_text): Swap indirections too.
874 This avoids crash reported by Christoph Scholtes at
875 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
876
9d7fa573
JD
8772012-07-22 Jan Djärv <jan.h.d@swipnet.se>
878
879 * nsmenu.m (Popdown_data): New struct.
880 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
881 free Popdown_data.
882 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
883 (initWithContentRect): Make imgView and contentView non-static
884 and autorelease them. Also autorelease img and matrix (Bug#12005).
885 (dealloc): Remove (Bug#12005).
886
0dd6d66d
DA
8872012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
888
889 Adjust consing_since_gc when objects are explicitly freed.
890 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
891 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
892 (free_cons, free_misc): Subtract object size from consing_since_gc.
893
d36d71df
DA
8942012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
895
896 Simplify and cleanup markers positioning code.
897 * marker.c (attach_marker): More useful eassert.
898 (live_buffer, set_marker_internal): New function.
899 (Fset_marker, set_marker_restricted): Use set_marker_internal.
900 (set_marker_both, set_marker_restricted_both): Use live_buffer.
901
fb9ea40f
PE
9022012-07-22 Paul Eggert <eggert@cs.ucla.edu>
903
904 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
905 as it's limited by the amount of memory, not by INT_MAX.
906
2d5c5f7d
EZ
9072012-07-21 Eli Zaretskii <eliz@gnu.org>
908
07fb592e
EZ
909 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
910 in special-event-map. See the discussion at
911 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
912 for the reasons.
913
37a9eac8 914 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2d5c5f7d
EZ
915 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
916 Fabrice Popineau <fabrice.popineau@supelec.fr>.
917
c4328746
JD
9182012-07-21 Jan Djärv <jan.h.d@swipnet.se>
919
920 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 921 (conversationIdentifier): Return value is NSInteger.
784051c4 922 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 923
6e5d1c12
CY
9242012-07-21 Chong Yidong <cyd@gnu.org>
925
926 * window.c (decode_any_window): Signal an error if the window is
927 on a dead frame (Bug#11984).
928
9928463d
DA
9292012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
930
931 Add indirection counting to speed up Fkill_buffer.
932 * buffer.h (struct buffer): New member.
933 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
934 (Fmake_indirect_buffer): Set indirection counter to -1, increment
935 base buffer indirection counter.
936 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
937 (Fkill_buffer): Adjust indirection counters as needed, don't walk
938 through buffer list if indirection counter is 0.
939
f8643a6b
DA
9402012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
941
942 Extend the value returned by Fgarbage_collect with heap statistics.
943 * alloc.c (Qheap): New symbol.
944 (syms_of_alloc): DEFSYM it.
945 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
946 (Fmemory_free): Remove.
947 (syms_of_alloc): Don't defsubr it.
948 * buffer.c (Fcompact_buffer): Remove.
949 (syms_of_buffer): Don't defsubr it.
950
dac616ff
DA
9512012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
952
953 Make maybe_gc inline.
954 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
955 * lisp.h (consing_since_gc, gc_relative_threshold)
956 (memory_full_cons_threshold): Revert declaration.
957 (maybe_gc): Remove prototype, define as inline.
958 * alloc.c: Remove old commented-out code.
959 (consing_since_gc, gc_relative_threshold)
960 (memory_full_cons_threshold): Revert to global.
961 (maybe_gc): Remove.
962
d7ea76b4
DA
9632012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
964
965 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
966 * lisp.h (build_unibyte_string): New function.
967 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
968 * sysdep.c, w32fns.c, xfns.c: Use it.
969 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
970 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
971 Adjust users accordingly.
972 * font.h (font_open_by_name): Adjust prototype.
973
765e61e3
DA
9742012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
975
976 Cleanup calls to Fgarbage_collect.
977 * lisp.h (maybe_gc): New prototype.
978 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
979 Remove declarations.
980 * alloc.c (maybe_gc): New function.
981 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
982 Make them static.
983 * bytecode.c (MAYBE_GC): Use maybe_gc.
984 * eval.c (eval_sub, Ffuncall): Likewise.
985 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
986 to avoid dependency from auto-save feature.
987
52b852c7
PE
9882012-07-19 Paul Eggert <eggert@cs.ucla.edu>
989
990 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
991 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
992 'for_each_per_buffer_object_at'.
993 All uses changed. It's better to use upper-case for macros that
994 cannot be implemented as functions, to give the reader a clue
995 that they're special.
996
5db81e33
SM
9972012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
998
999 * alloc.c (Fgarbage_collect): Tweak docstring.
1000
5b835e1d
DA
10012012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1002
1003 Tweak the value returned from Fgarbage_collect again.
1004 * alloc.c (Fgarbage_collect): New return value, as confirmed in
1005 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
1006 Adjust documentation.
1007 (total_vector_bytes): Rename to total_vector_slots, adjust
1008 accounting.
1009 (total_free_vector_bytes): Rename to total_free_vector_slots,
1010 adjust accounting.
1011 (Qstring_bytes, Qvector_slots): New symbols.
1012 (syms_of_alloc): DEFSYM them.
1013
9cd47b72
DA
10142012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1015
1016 Buffer compaction primitive which may be used from Lisp.
1017 * buffer.c (compact_buffer, Fcompact_buffer): New function.
1018 (syms_of_buffer): Register Fcompact_buffer.
1019 * alloc.c (Fgarbage_collect): Use compact_buffer.
1020 * buffer.h (compact_buffer): New prototype.
1021 (struct buffer_text): New member.
1022
d17337e5
DA
10232012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1024
1025 New macro to iterate over all buffers, miscellaneous cleanups.
1026 * lisp.h (all_buffers): Remove declaration.
1027 * buffer.h (all_buffers): Add declaration, with comment.
1028 (for_each_buffer): New macro.
1029 * alloc.c (Fgarbage_collect, mark_object): Use it.
1030 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
1031 (init_buffer): Likewise.
1032 * data.c (Fset_default): Likewise.
1033 * coding.c (code_conversion_restore): Remove redundant check
1034 for dead buffer.
1035 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
1036
60cfd278
AS
10372012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1038
1039 Fix bug that created negative-length intervals.
1040 * intervals.c (merge_interval_right, merge_interval_left):
1041 Do not zero out this interval if it is absorbed by its children,
1042 as this interval's total length doesn't change in that case. See
1043 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
1044
d06714cb
PE
10452012-07-18 Paul Eggert <eggert@cs.ucla.edu>
1046
83713154
PE
1047 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
1048 when invoking (make-bool-vector N t) and N is a positive
1049 multiple of 8 -- the last 8 bits were mistakenly cleared.
1050
d06714cb
PE
1051 Remove some struct layout assumptions in bool vectors.
1052 * alloc.c (bool_header_size): New constant.
1053 (header_size, word_size): Move earlier, as they're now used earlier.
1054 Use 'word_size' in a few more places, where it's appropriate.
1055 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
1056 padding before the data member of a bool vector.
1057 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
1058 than doing the check by hand with an abort ().
1059
464d5a5e
SM
10602012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
1061
5fbc0409
SM
1062 * eval.c (Fdefvar): Don't check constants since we only set the var if
1063 it's not yet defined anyway (bug#11904).
1064
464d5a5e
SM
1065 * lisp.h (last_undo_boundary): Declare new var.
1066 * keyboard.c (command_loop_1): Set it.
1067 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
1068 were auto-added by the command loop (bug#11774).
1069
8dc2e44a
AS
10702012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1071
1072 * w32font.c (Qsymbol): Remove local definition.
1073 (syms_of_w32font): Don't DEFSYM it.
1074
169925ec
DA
10752012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1076
1077 Fix sweep_vectors to handle large bool vectors correctly.
1078 * alloc.c (sweep_vectors): Account total_vector_bytes for
1079 bool vectors larger than VBLOCK_BYTES_MAX.
1080
5fbfb018
CY
10812012-07-18 Chong Yidong <cyd@gnu.org>
1082
1083 * frame.c (x_set_frame_parameters): Revert bogus change introduced
1084 in 2012-05-25 commit by Paul Eggert (Bug#11738).
1085
3ab6e069
DA
10862012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1087
1088 Return more descriptive data from Fgarbage_collect.
1089 Suggested by Stefan Monnier in
1090 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
1091 * alloc.c (bounded_number): New function.
1092 (total_buffers, total_vectors): New variable.
1093 (total_string_size): Rename to total_string_bytes, adjust users.
1094 (total_vector_size): Rename to total_vector_bytes, adjust users.
1095 (sweep_vectors): Account total_vectors and total_vector_bytes.
1096 (Fgarbage_collect): New return value. Adjust documentation.
1097 (gc_sweep): Account total_buffers.
1098 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
1099 (VECTOR_SIZE): Remove.
1100 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
1101 (Qinterval, Qmisc): New symbols.
1102 (syms_of_data): Initialize them.
1103 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
1104 (Qcons, Qbuffer): New declarations.
1105
6d02fe5b
PE
11062012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1107
1108 * alloc.c (Fmemory_free): Account for memory-free's own storage.
1109 Round up, not down. Improve doc.
1110
b7ffe040
DA
11112012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1112
1113 Restore old code in allocate_string_data to avoid Faset breakage.
1114 Reported by Julien Danjou <julien@danjou.info> in
1115 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
1116 * alloc.c (allocate_string_data): Restore old code with minor
1117 adjustments, fix comment to explain this subtle issue.
1118
4dc7c8d5
SM
11192012-07-17 Eli Zaretskii <eliz@gnu.org>
1120
1121 Remove FILE_SYSTEM_CASE.
1122 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
1123
1124 * fileio.c (FILE_SYSTEM_CASE): Don't define.
1125 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
1126 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
1127 call-process-region passes it through expand-file-name.
1128
1129 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
1130
11312012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1132
1133 Fix crash when creating indirect buffer (Bug#11917)
1134 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
1135 Don't handle unbound variables specially if non-zero.
1136 (Fbuffer_local_variables): Pass zero.
1137 (clone_per_buffer_values): Pass non-zero.
1138
11392012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1140
1141 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
1142 to make the loop interruptible.
1143
11442012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1145
1146 * gnutls.c (emacs_gnutls_handshake): Only retry if
1147 GNUTLS_E_INTERRUPTED.
1148
cce7fefc
DA
11492012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1150
1151 Cleanup and convert miscellaneous checks to eassert.
1152 * alloc.c (mark_interval): Fix comment, partially rephrase
1153 old comment from intervals.h (see below).
1154 * intervals.c (find_interval, adjust_intervals_for_insertion)
1155 (delete_interval, adjust_intervals_for_deletion)
1156 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
1157 Convert to eassert.
1158 (adjust_intervals_for_insertion, make_new_interval):
1159 Remove obsolete and unused code.
1160 * intervals.h (struct interval): Remove obsolete comment.
1161 * textprotp.c (erase_properties): Remove unused code.
1162 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
1163 (Fremove_list_of_text_properties): Convert to eassert.
1164
9ea10cc3
CY
11652012-07-17 Chong Yidong <cyd@gnu.org>
1166
1167 * editfns.c (Finsert_char): Doc fix.
1168
3900d5de
DA
11692012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1170
1171 Fix previous change to make Fmemory_free always accurate.
1172 * alloc.c (make_interval): Update total_free_intervals.
1173 (make_float): Likewise for total_free_floats.
1174 (free_cons, Fcons): Likewise for total_free_conses.
1175 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
1176 Likewise for total_free_vector_bytes.
1177 (Fmake_symbol): Likewise for total_free_symbols.
1178 (bytes_free): Remove.
1179
7098646f
DA
11802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1181
1182 Simple free memory accounting feature.
1183 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
1184 (sweep_vectors): Accumulate size of free vectors.
1185 (Fgarbage_collect): Setup bytes_free.
1186 (Fmemory_free): New function.
1187 (syms_of_alloc): Register it.
1188
22657b40
DA
11892012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1190
1191 Cleanup overlays checking.
1192 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
1193 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
1194 eassert and OVERLAYP.
1195 (sort_overlays): Change to use OVERLAYP.
1196
ddfc8813
RK
11972012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
1198
1199 * editfns.c (Finsert_char): Make it interactive, and make the
1200 second arg optional. Copy interactive spec and docstring from
1201 ucs-insert.
1202
7c26cf3c
PE
12032012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1204
1205 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
1206 Unlike the other wrapped functions, fabs has an unspecified
1207 effect on errno.
1208
5d127af9
JD
12092012-07-16 Jan Djärv <jan.h.d@swipnet.se>
1210
1211 * nsterm.m (keyDown): Interpret flags without left/right bits
1212 as the left key (Bug#11670).
1213
6a0dd1d7
DA
12142012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1215
1216 Remove empty and useless init functions.
1217 * lisp.h (init_character_once, init_fns, init_image)
1218 (init_filelock, init_sound): Remove prototype.
1219 * character.c (init_character_once): Remove.
1220 * filelock.c (init_filelock): Likewise.
1221 * fns.c (init_fns): Likewise.
1222 * image.c (init_image): Likewise.
1223 * sound.c (init_sound): Likewise.
1224 * emacs.c (main): Adjust accordingly.
1225
7a6136fd
DA
12262012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1227
1228 * gtkutil.h: Tiny cleanups.
1229 (use_old_gtk_file_dialog): Remove useless declaration.
1230 (xg_uses_old_file_dialog): Add suggested const attribute.
1231
ce811ad9
EZ
12322012-07-15 Eli Zaretskii <eliz@gnu.org>
1233
1234 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
1235 (bidi_paragraph_init): Use it to limit search forward for a strong
1236 directional character in abnormally large paragraphs full of
1237 neutral or weak characters. (Bug#11943)
1238
c9adfeaa
SF
12392012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
1240
1241 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
1242 the toolbar (Bug#9451).
1243 (xg_make_tool_item): Give the widget event box a transparent
1244 background.
1245
fff62aa9
DA
12462012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1247
1248 Cleanup basic allocation variables and functions.
1249 * alloc.c (ignore_warnings, init_intervals, init_float)
1250 (init_cons, init_symbol, init_marker): Remove.
1251 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
1252 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
1253 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
1254 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
1255 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
1256 (staticidx, init_alloc_once, init_strings, free_ablock):
1257 Remove redundant initialization.
1258 * fns.c (init_weak_hash_tables): Remove.
1259 * lisp.h (init_weak_hash_tables): Remove prototype.
1260
9730daca
DA
12612012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1262
1263 Use zero_vector where appropriate.
1264 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
1265 accordingly.
1266 * lisp.h (zero_vector): New declaration.
1267 * font.c (null_vector): Remove.
1268 (syms_of_font): Remove initialization and staticpro.
1269 (font_list_entities, font_find_for_lface): Change to use zero_vector.
1270 * keymap.c (Faccessible_keymaps): Likewise.
1271
2e2d2a13
LL
12722012-07-15 Leo Liu <sdl.web@gmail.com>
1273
1274 * fringe.c: Fix typo in comments.
1275
cd276f6e
LL
12762012-07-14 Leo Liu <sdl.web@gmail.com>
1277
1278 * fringe.c: Add a new bitmap exclamation-mark.
1279
5a1131d9
EZ
12802012-07-14 Eli Zaretskii <eliz@gnu.org>
1281
1282 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
1283
1284 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
1285 (HAVE_MENUS): Don't define, defined by editing config.in with
1286 msdos/sed2v2.inp.
1287 (GMALLOC_INHIBIT_VALLOC): Don't define.
1288 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
1289
22e983b7
JB
12902012-07-14 Juanma Barranquero <lekktu@gmail.com>
1291
1292 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
1293
5b3f250f
GM
12942012-07-14 Glenn Morris <rgm@gnu.org>
1295
1296 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
1297 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
1298 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
1299
33d63ff4
GM
13002012-07-13 Glenn Morris <rgm@gnu.org>
1301
5b633342
GM
1302 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
1303
33d63ff4
GM
1304 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
1305 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
1306
b55b9f85
JD
13072012-07-13 Jan Djärv <jan.h.d@swipnet.se>
1308
0dc8cf50
JD
1309 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
1310 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
1311 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
1312 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
1313 where appropriate.
1314 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
1315 as boolean expression.
1316 (x_set_window_size): Remove unused variable toolbar.
1317 (ns_get_color_default, ns_mod_to_lisp): Remove.
1318 (ns_mouse_position): Remove unused variables xchar and ychar.
1319 (ns_compute_glyph_string_overhangs): Remove unused variable face.
1320 (ns_set_vertical_scroll_bar): Remove unused variable count.
1321 (ns_delete_terminal): Remove unused variable i.
1322 (ns_term_init): Remove unused variables r, g and b.
1323 (mouseDown): Remove unused variable window.
1324 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
1325 (initFrameFromEmacs): Remove unused variable vbextra.
1326 (mouseEntered): Remove unused variables p and dpyinfo.
1327 (mouseExited): Remove unused variables p and r.
1328 (ns_define_frame_cursor, ns_clear_frame_area)
1329 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
1330 (menuDown): Assign [sender tag] to variable and cast the variable.
1331
1332 * nsterm.h (menuDown): Add id as type to argument sender.
1333 (ns_display_info_for_name): Add Lisp_Object argument.
1334 (ns_term_init): Add Lisp_Object argument.
1335 (ns_map_event_to_object): Add void argument.
1336 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
1337 prototype with arguments and only declare if __OBJC__.
1338 (nxatoms_of_nsselect): Add void argument.
1339 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
1340 (ns_alloc_autorelease_pool): Add void argument.
1341 (ns_release_autorelease_pool): Add void* argument.
1342 (ns_get_defaults_value): Add const char* argument.
1343
1344 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
1345 (initFromContents): Use SSDATA where appropriate.
1346 (ns_update_menubar): Add braces to ambigous if-else.
1347 (initWithTitle): Put () around assignment in if statement.
1348 (ns_menu_show): Remove unused variables window and keymap.
1349 (update_frame_tool_bar): Remove unused variable selected_p.
1350 (initWithContentRect): Remove unused variable this_cmd_name.
1351
1352 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
1353 appropriate.
1354 (setXBMColor): Remove unused variable len.
1355 (setPixmapData): Put () around assignment in loop statement.
1356
1357 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
1358 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
1359 where appropriate.
1360 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
1361 around assignment in loop statement.
1362 (nsfont_open): Remove unused variable i.
1363 (nsfont_open): Remove unused variable len.
1364 (nsfont_draw): Remove unused variable cs.
1365
1366 * nsfns.m (x_set_icon_name, ns_set_name_internal)
1367 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
1368 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
1369 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
1370 (Fns_font_name, Fns_perform_service)
1371 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
1372 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
1373 (ns_set_name): Remove unused variable view.
1374 (x_set_menu_bar_lines): Remove unused variable olines.
1375 (x_set_tool_bar_lines): Remove unused variable root_window.
1376 (Fns_list_colors): Put () around assignment in while statement.
1377 (Fns_perform_service): Remove unused variable len.
1378 (Fns_display_usable_bounds): Remove unused variable top.
1379 (syms_of_nsfns): Remove unused variable i.
1380
b55b9f85
JD
1381 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1382 memcpy (Bug#11907).
1383
ed9265fc 13842012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
1385
1386 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1387 and free it with DestroyExceptionInfo (Bug#11558).
1388
ef099b57
JB
13892012-07-13 Juanma Barranquero <lekktu@gmail.com>
1390
1391 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1392 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1393 Set here, not in nt/config.nt.
1394
ea814a5d
EZ
13952012-07-13 Eli Zaretskii <eliz@gnu.org>
1396
1397 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1398 cursor overflow into the last glyph on display line when the right
1399 fringe is off. (Bug#11832)
1400
1a952767
PE
14012012-07-13 Paul Eggert <eggert@cs.ucla.edu>
1402
1403 * xdisp.c (produce_special_glyphs): Now static.
1404 * dispextern.h (produce_special_glyphs): Remove decl.
1405
983188fd
GM
14062012-07-13 Glenn Morris <rgm@gnu.org>
1407
8d7c7eed 1408 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
1409 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1410
983188fd
GM
1411 * s/usg5-4-common.h (USG, USG5):
1412 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1413 * s/sol2-6.h (SOLARIS2):
1414 * s/irix6-5.h (IRIX6_5):
1415 * s/hpux10-20.h (USG, USG5, HPUX):
1416 * s/gnu-linux.h (USG, GNU_LINUX):
1417 * s/freebsd.h (BSD_SYSTEM):
1418 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1419 * s/cygwin.h (CYGWIN):
1420 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1421 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1422
d1e68667 14232012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
1424
1425 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 1426
6de0e799
GM
14272012-07-13 Glenn Morris <rgm@gnu.org>
1428
739ae010
GM
1429 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1430
dbee5793
GM
1431 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1432
6de0e799
GM
1433 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1434 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1435
b82da769
GM
14362012-07-12 Glenn Morris <rgm@gnu.org>
1437
4fae5a7a 1438 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
1439
1440 * process.c (init_process_emacs): Rename from init_process.
1441 The old name is also the name of a Mach system call.
1442 * lisp.h, emacs.c: Update for this name change.
1443 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1444 longer needed.
1445
5a979817
EZ
14462012-07-12 Eli Zaretskii <eliz@gnu.org>
1447
1448 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1449 memmove call that removes glyphs covered by the left truncation
1450 glyph. Improve commentary.
1451 (display_line): Fix display of continuation glyphs on GUI frames
1452 when the right fringe is turned off and variable-size fonts are
1453 used in the window. Move the code that appends a stretch glyph to
1454 produce_special_glyphs, so that it could be used for truncation
1455 and continuation glyphs alike.
1456 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1457 glyph of a suitably computed width, to align the special glyphs at
1458 the window margin. Code moved from display_line. (Bug#11832)
1459
3e91a053
GM
14602012-07-12 Glenn Morris <rgm@gnu.org>
1461
ba9e4b84
GM
1462 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1463
1464 * s/gnu-linux.h, s/hpux10-20.h:
1465 Do not unconditionally define HAVE_XRMSETDATABASE.
1466
3e91a053
GM
1467 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1468
b300b1f4
PE
14692012-07-12 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 Fix typos that broke OS X build.
1472 Reported by Randal L. Schwartz in
1473 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1474 * nsterm.m (ns_timeout): Add missing local decl.
1475 (ns_get_color): snprintf -> sprintf, to fix typo.
1476
6e777848
GM
14772012-07-12 Glenn Morris <rgm@gnu.org>
1478
3f922c37
GM
1479 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1480 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1481 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1482 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1483
0ab7b23a
GM
1484 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1485 Move PTY_OPEN to configure.
1486
6e777848
GM
1487 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1488 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1489 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1490
4a7edc24
DA
14912012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
1492
1493 Use empty_unibyte_string where applicable.
1494 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1495 * lread.c (read1): Likewise.
1496 * xsettings.c (syms_of_xsettings): Likewise.
1497
308aab79
GM
14982012-07-12 Glenn Morris <rgm@gnu.org>
1499
42bd1719
GM
1500 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1501 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
1502 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1503 * s/hpux10-20.h (RUN_TIME_REMAP):
1504 * s/bsd-common.h (TABDLY): Move to configure.
1505
1506 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1507
1508 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1509
ea0bbd17 1510 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 1511 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
1512
1513 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 1514
308aab79
GM
1515 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1516 * s/template.h: Move NARROWPROTO to configure.
1517
ee1cf5cf
GM
15182012-07-11 Glenn Morris <rgm@gnu.org>
1519
30fe9bf4
GM
1520 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
1521 unused since 2011-01-17 change to systty.h.
1522
ee1cf5cf
GM
1523 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
1524 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1525 Move HAVE_PTYS and HAVE_SOCKETS to configure.
1526
63e47e07
PE
15272012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
1530
c43fb4c3
GM
15312012-07-11 Glenn Morris <rgm@gnu.org>
1532
1533 * s/darwin.h, s/gnu-linux.h, s/template.h:
1534 Move INTERRUPT_INPUT to configure.
1535
e8df9267
DA
15362012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1537
1538 Minor adjustments to interning code.
1539 * lisp.h (intern, intern_c_string): Redefine as static inline
1540 wrappers for intern_1 and intern_c_string_1, respectively.
1541 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
1542 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1543 Vobarray checking.
e8df9267
DA
1544 * font.c (font_intern_prop): Likewise. Adjust comment.
1545 * w32font.c (intern_font_name): Likewise.
1546
34348bd4
AS
15472012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1548
d96a1e0c
AS
1549 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1550
34348bd4
AS
1551 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1552 of Fcar/Fcdr if possible.
1553 * font.c (check_otf_features): Likewise.
1554 * fontset.c (Fnew_fontset): Likewise.
1555 * gnutls.c (Fgnutls_boot): Likewise.
1556 * minibuf.c (read_minibuf): Likewise.
1557 * msdos.c (IT_set_frame_parameters): Likewise.
1558 * xmenu.c (Fx_popup_dialog): Likewise.
1559 * w32menu.c (Fx_popup_dialog): Likewise.
1560
c8add24e
GM
15612012-07-11 Glenn Morris <rgm@gnu.org>
1562
4b575b3c
GM
1563 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1564 since nothing has defined it on these platforms.
1565
09f4e3b0
GM
1566 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1567 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1568
172bedef
GM
1569 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1570 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1571 Move CLASH_DETECTION to configure.
1572
249685df
GM
1573 * s/gnu.h: Remove file, which is now empty.
1574
c8add24e
GM
1575 * s/gnu.h, s/gnu-linux.h:
1576 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1577
b41253a3
JW
15782012-07-11 John Wiegley <johnw@newartisans.com>
1579
1580 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1581 function attribute, so we only use it if it exists in the
1582 compiler.
1583
d923b542
DA
15842012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1585
1586 Avoid call to strlen in fast_c_string_match_ignore_case.
1587 * search.c (fast_c_string_match_ignore_case): Change to use
1588 length argument. Adjust users accordingly.
1589 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1590
5ebbef1d
PE
15912012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1592
bb352260
PE
1593 Assume mkdir, rmdir.
1594 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1595 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1596
57054ddd
PE
1597 Assume rename.
1598 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1599
b747d3f7
PE
1600 Assume perror.
1601 * s/hpux10-20.h (HAVE_PERROR): Remove.
1602 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1603 Remove dummy definition, as this problem was obsolete long ago.
1604
5ebbef1d
PE
1605 Assume strerror.
1606 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1607
984e7f30
DA
16082012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1609
1610 Avoid calls to strlen in font processing functions.
1611 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 1612 (font_open_by_name): Change to use length argument. Adjust
984e7f30 1613 users accordingly.
d923b542
DA
1614 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1615 Adjust prototypes.
1616 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1617 Change to return ptrdiff_t.
984e7f30
DA
1618 (xfont_list_pattern, xfont_match): Use length returned by
1619 xfont_decode_coding_xlfd.
1620 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1621
20e94fdd
GM
16222012-07-11 Glenn Morris <rgm@gnu.org>
1623
9d596af3
GM
1624 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1625 Move DONT_REOPEN_PTY to configure.
1626
20e94fdd
GM
1627 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1628 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1629
e99a530f
PE
16302012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1631
22ffb973
PE
1632 Remove "#define unix" that is no longer needed (Bug#11905).
1633 * s/aix4-2.h (unix): Remove; no longer needed.
1634
e9a9ae03
PE
1635 EMACS_TIME simplification (Bug#11875).
1636 This replaces macros (which typically do not work in GDB)
1637 with functions, typedefs and enums, making the code easier to debug.
1638 The functional style also makes code easier to read and maintain.
1639 * systime.h: Include <sys/time.h> on all hosts, not just if
1640 WINDOWSNT, since 'struct timeval' is needed in general.
1641 (EMACS_TIME): Now a typedef, not a macro.
1642 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1643 not macros.
1644 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1645 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1646 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1647 (EMACS_TIME_LE): Now functions, not macros.
1648 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1649 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1650 which are not functions. All uses rewritten to use:
1651 (make_emacs_time): New function.
1652 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1653 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1654 not functions. All uses rewritten to use the following, respectively:
1655 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1656 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 1657 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
1658 * fileio.c (Fcopy_file):
1659 * xterm.c (XTflash): Get the current time closer to when it's used.
1660 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1661
ffacb126
PE
1662 * bytecode.c (targets): Suppress -Woverride-init warnings.
1663
e99a530f
PE
1664 Simplify by avoiding confusing use of strncpy etc.
1665 * doc.c (Fsnarf_documentation):
1666 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1667 * frame.c (Fmake_terminal_frame):
1668 * gtkutil.c (get_utf8_string):
1669 * lread.c (openp):
1670 * nsmenu.m (ns_update_menubar):
1671 * regex.c (regerror):
1672 Prefer memcpy to strncpy and strncat when either will do.
1673 * fileio.c (Fsubstitute_in_file_name):
1674 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1675 (menu_separator_name_p):
1676 * nsmenu.m (ns_update_menubar):
1677 Prefer memcmp to strncmp when either will do.
1678 * nsterm.m: Include <ftoastr.h>.
1679 (ns_get_color):
1680 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1681 Prefer snprintf to strncpy.
1682 * nsterm.m (ns_term_init):
1683 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1684 * nsterm.m (ns_term_init):
1685 Avoid the need for strncpy, by using build_string or
1686 make_unibyte_string directly. Use dtoastr, not snprintf.
1687 * process.c (Fmake_network_process): Diagnose service names that
1688 are too long, rather than silently truncating them or creating
1689 non-null-terminated names.
1690 (Fnetwork_interface_info): Likewise, for interface names.
1691 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1692 Prefer sprintf to strncat.
1693 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1694 Prefer vsnprintf to vsprintf + strncpy.
1695
c59592b3
GM
16962012-07-10 Glenn Morris <rgm@gnu.org>
1697
1698 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1699 Clarify fallback case.
1700
7d7bbefd
DA
17012012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1702
1703 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1704 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1705 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 1706 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
1707 where argument type is known to be a Lisp_Cons.
1708
3a4c8000
TT
17092012-07-10 Tom Tromey <tromey@redhat.com>
1710
1711 * bytecode.c (BYTE_CODE_THREADED): New macro.
1712 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1713 (enum byte_code_op): New type.
1714 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1715 (exec_byte_code): Use them. Use token threading when applicable.
1716
2a0213a6
DA
17172012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1718
1719 Optimize pure C strings initialization.
1720 * lisp.h (make_pure_string): Fix prototype.
1721 (build_pure_c_string): New function, defined as static inline. This
1722 provides a better opportunity to optimize away calls to strlen when
1723 the function is called with compile-time constant argument.
1724 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1725 argument, adjust users accordingly. Use build_pure_c_string where
1726 appropriate.
1727 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1728 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1729 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1730
cb1caeaf
DA
17312012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1732
1733 Avoid calls to strlen in miscellaneous functions.
1734 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1735 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1736 * lread.c (openp): Likewise.
1737
c293e30c
DA
17382012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1739
1740 Avoid calls to strlen in path processing functions.
1741 * fileio.c (file_name_as_directory): Add comment. Change to add
1742 srclen argument and return the length of result. Adjust users
1743 accordingly.
1744 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 1745 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
1746 users accordingly.
1747 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1748
9e059e3f
GM
17492012-07-10 Glenn Morris <rgm@gnu.org>
1750
d02eb359
GM
1751 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1752 Move PENDING_OUTPUT_COUNT definition to configure.
1753
882cf227
GM
1754 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1755 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1756 * s/gnu.h (DATA_START): Move definitions to configure.
1757
af6e839f
GM
1758 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1759 We include usg5-4-common.h, which defines them both.
1760
40289a12
GM
1761 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
1762 O_RDONLY already includes it).
1763
9e059e3f
GM
1764 Stop ns builds setting the EMACSLOADPATH environment variable.
1765 * nsterm.m (ns_load_path): Rename from ns_init_paths.
1766 Now it does not set EMACSLOADPATH, just returns the load-path string.
1767 * nsterm.h: Update accordingly.
1768 * lread.c [HAVE_NS]: Include nsterm.h.
1769 (init_lread) [HAVE_NS]: Use ns_load_path.
1770 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
1771
7c4e8ec0
GM
17722012-07-09 Glenn Morris <rgm@gnu.org>
1773
d4f600ff
GM
1774 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
1775 since the included bsd-common.h does so.
1776
cbb31951
GM
1777 Stop ns builds setting the EMACSPATH environment variable.
1778 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
1779 (ns_init_paths): Do not set EMACSPATH.
1780 * nsterm.h (ns_exec_path): Add it.
1781 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
1782 Use ns_exec_path.
1783
7c4e8ec0
GM
1784 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
1785
26bccfae
PE
17862012-07-09 Paul Eggert <eggert@cs.ucla.edu>
1787
a0bee46f
PE
1788 * process.c (wait_reading_process_output): 'waitchannels' was unset
1789 when read_kbd || !NILP (wait_for_cell); fix this.
1790
5994c183
PE
1791 Add GCC-style 'const' attribute to functions that can use it.
1792 * character.h (char_resolve_modifier_mask):
1793 * keyboard.h (make_ctrl_char):
1794 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
1795 (init_character_once, next_almost_prime, init_fns, init_image)
1796 (flush_pending_output, init_sound):
1797 * mem-limits.h (start_of_data):
1798 * menu.h (finish_menu_items):
1799 Add ATTRIBUTE_CONST.
1800 * emacs.c (DEFINE_DUMMY_FUNCTION):
1801 Declare the dummy function with ATTRIBUTE_CONST.
1802 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
1803 Add decls with ATTRIBUTE_CONST.
1804
26bccfae
PE
1805 Minor improvements to make_formatted_string.
1806 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
1807 where int is good enough, as vsprintf returns an int.
1808 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
1809
a8290ec3
DA
18102012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1811
1812 Use make_formatted_string to avoid double length calculation.
1813 * lisp.h (make_formatted_string): New prototype.
1814 * alloc.c (make_formatted_string): New function.
1815 * buffer.c (Fgenerate_new_buffer_name): Use it.
1816 * dbus.c (syms_of_dbusbind): Likewise.
1817 * editfns.c (Fcurrent_time_zone): Likewise.
1818 * filelock.c (get_boot_time): Likewise.
1819 * frame.c (make_terminal_frame, set_term_frame_name)
1820 (x_report_frame_params): Likewise.
1821 * image.c (gs_load): Likewise.
1822 * minibuf.c (get_minibuffer): Likewise.
1823 * msdos.c (dos_set_window_size): Likewise.
1824 * process.c (make_process): Likewise.
1825 * xdisp.c (ensure_echo_area_buffers): Likewise.
1826 * xsettings.c (apply_xft_settings): Likewise.
1827
d01ba2f1
GM
18282012-07-09 Glenn Morris <rgm@gnu.org>
1829
1830 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
1831 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
1832 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
1833 * nsterm.h (ns_etc_directory): Add it.
1834 * callproc.c [HAVE_NS]: Include nsterm.h.
1835 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
1836
f1f924b6
DA
18372012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1838
1839 Move marker debugging code under MARKER_DEBUG.
1840 * marker.c (MARKER_DEBUG): Move marker debugging code under
1841 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
1842 for bootstrap with --enable-checking (~3x slowdown reported
1843 by Juanma Barranquero <lekktu@gmail.com>).
1844 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
1845
ab531b66
PE
18462012-07-08 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
1849 See <http://bugs.gnu.org/11825#29>.
1850
c4b3bc8a
EZ
18512012-07-08 Eli Zaretskii <eliz@gnu.org>
1852
1853 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
1854 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
1855 (display_line): Add commentary about displaying truncation glyphs
1856 on GUI frames.
1857 (produce_special_glyphs): Move here from term.c.
1858
1859 * term.c (produce_special_glyphs): Move to xdisp.c.
1860
1861 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
1862 section.
c4b3bc8a 1863
b676b881
AS
18642012-07-07 Andreas Schwab <schwab@linux-m68k.org>
1865
f17c5273
AS
1866 * xdisp.c (display_line): Avoid warning about implicit declaration
1867 of FRAME_FONT.
1868
298819b9
AS
1869 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1870
b676b881
AS
1871 * lisp.h: Remove empty conditional.
1872
6045c4fd
PE
18732012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1874
b3350bf9
PE
1875 * lread.c (load_path_check): Now static.
1876
6045c4fd
PE
1877 Fix some minor --with-ns problems found by static checking.
1878 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1879 (x_set_font) [!HAVE_X_WINDOWS]:
1880 * image.c (xpm_load_image) [HAVE_NS]:
1881 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1882 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1883 Remove unused local.
1884 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1885 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1886 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1887 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1888 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1889 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1890 Fix pointer signedness problem.
1891 * xfaces.c (FRAME_X_FONT_TABLE):
1892 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1893
929e7845
GM
18942012-07-07 Glenn Morris <rgm@gnu.org>
1895
1896 * lread.c (load_path_check): New function, split from init_lread.
1897 (init_lread): Reorganize. Motivation:
1898 If EMACSLOADPATH is set, check/warn about that rather than the
1899 defaults, which we are not going to use. Hence we can remove
1900 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1901 Don't warn if site-lisp directories are missing.
1902 If not installed, start from a blank load-path, since
1903 PATH_LOADSEARCH refers to the eventual installation directories.
1904
58dd0aa4
EZ
19052012-07-07 Eli Zaretskii <eliz@gnu.org>
1906
1907 Support truncation and continuation glyphs on GUI frames, when
1908 fringes are disabled. (Bug#11832)
1909 * xdisp.c (init_iterator): Get dimensions of truncation and
1910 continuation glyphs even if on GUI frames. Adjust
1911 it->last_visible_x on GUI frames when the left or right fringes,
1912 or both, are absent.
1913 (start_display, move_it_in_display_line_to): Handle the case of a
1914 GUI frame without a fringe to display continuation or truncation
1915 glyphs.
1916 (insert_left_trunc_glyphs): Support GUI frames: make sure
1917 truncation glyphs overwrite enough glyphs from the current line to
1918 have sufficient space in pixels.
1919 (display_line): Support truncation and continuation glyphs on GUI
1920 frames. If some spare pixels are left on the line after inserting
1921 the truncation glyphs, fill that space with a stretch glyph of a
1922 suitably computed width.
1923
1924 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1925 produce_glyphs, to support GUI sessions.
1926
31571fd7
PE
19272012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1928
5a16b9bc
PE
1929 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1930
f3047c75
PE
1931 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1932
31571fd7
PE
1933 Do not require float-time's arg to fit in time_t (Bug#11825).
1934 This works better on hosts where time_t is unsigned, and where
1935 float-time is applied to the (negative) difference between two times.
1936 * editfns.c (decode_time_components): Last arg is now double *,
1937 not int *, and means to store all the result as a double, without
1938 worrying about whether the seconds part fits in time_t.
1939 All callers changed.
1940 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1941 All callers changed.
1942 (Ffloat_time): Do not fail merely because the specified time falls
1943 outside of time_t range.
1944
4516fbef
GM
19452012-07-07 Glenn Morris <rgm@gnu.org>
1946
1947 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1948 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1949 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1950
07adc2c6
JB
19512012-07-07 Juanma Barranquero <lekktu@gmail.com>
1952
1953 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1954 Update dependencies.
1955
1956 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1957
fd573f31
PE
19582012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1959
fee5959d
PE
1960 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1961 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1962 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1963 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1964 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1965 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1966
fd573f31
PE
1967 * xfont.c (compare_font_names): Redo to omit the need for casts.
1968
ddadbc0e
AS
19692012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1970
fca8d6b6
AS
1971 * xfns.c (Fx_change_window_property): Doc fix.
1972 * w32fns.c (Fx_change_window_property): Doc fix.
1973
ddadbc0e
AS
1974 * w32fns.c (Fx_window_property): Accept the same arguments as the
1975 X Windows version. Doc fix.
1976 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1977
ed9265fc 19782012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
1979 Eli Zaretskii <eliz@gnu.org>
1980
1981 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1982 Windows-specific code from nt/config.nt moved here.
1983 Obsolete settings removed.
1984
216ee680
PE
19852012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1986
1987 * process.c: Avoid unnecessary calls to gettime.
1988 (wait_reading_process_output): Don't get the time of day
1989 when gobbling data immediately and not waiting, as there's no need
1990 for it in that case. This removes a FIXME.
1991
bdd091e4
JD
19922012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1993
1994 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
1995 is defined (Bug#11768).
1996
9d44f8ce
DA
19972012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1998
1999 Fix marker debugging code.
2000 * marker.c (byte_char_debug_check): Do not perform the check
2001 if buffer is not multibyte.
090bd7cb
JB
2002 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2003 Call byte_char_debug_check with correct arguments.
9d44f8ce 2004
90fc4786
DA
20052012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2006
2007 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
2008 * marker.c (byte_char_debug_check, count_markers):
2009 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
2010 (byte_debug_flag): Remove.
2011 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2012 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
2013
7b7ae965
DA
20142012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2015
4e57b342
DA
2016 Avoid code repetition in marker-related functions.
2017 * marker.c (attach_marker): New function.
2018 (Fset_marker, set_marker_restricted, set_marker_both)
2019 (set_marker_restricted_both): Use it.
2020 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
2021 Consistently rename charno to charpos.
2022 (marker_position): Add eassert.
2023 (marker_byte_position): Convert to eassert.
2024
20252012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2026
2027 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 2028 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 2029 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 2030
657924ff
DA
20312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2032
2033 Introduce fast path for the widely used marker operation.
2034 * alloc.c (build_marker): New function.
2035 * lisp.h (build_marker): New prototype.
2036 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
2037 * composite.c (autocmp_chars): Likewise.
2038 * editfns.c (buildmark): Remove.
2039 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
2040 (save_restriction_save): Use build_marker.
2041 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
2042 * window.c (save_window_save): Likewise.
2043
041a49a6
DA
20442012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2045
2046 Do not use Fdelete_overlay in delete_all_overlays
2047 to avoid redundant calls to unchain_overlay.
2048 * buffer.c (drop_overlay): New function.
2049 (delete_all_overlays, Fdelete_overlay): Use it.
2050 * minibuf.c (get_minibuffer): Fix comment.
2051
7dca65a4
PE
20522012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2053
2054 Port to OpenBSD 5.1 amd64.
2055 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
2056 This is needed for OpenBSD, and should be harmless on all BSD systems.
2057 Also, include <sys/sysctl.h>, as it should be available on all
2058 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
2059 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
2060 use p_pid member, not kp_proc.pid.
2061
8eb876e2
GM
20622012-07-06 Glenn Morris <rgm@gnu.org>
2063
2064 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
2065
38182d90
PE
20662012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2067
2068 More xmalloc and related cleanup.
2069 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
2070 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
2071 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
2072 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
2073 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
2074 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
2075 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
2076 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
2077 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
2078 * xterm.c:
2079 Omit needless casts involving void * pointers and allocation.
2080 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
2081 as the former is more robust if P's type is changed.
2082 Prefer xzalloc to xmalloc + memset 0.
2083 Simplify malloc-or-realloc to realloc.
2084 Don't worry about xmalloc returning a null pointer.
2085 Prefer xstrdup to xmalloc + strcpy.
2086 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
2087 growing it.
2088 * keyboard.c (apply_modifiers_uncached): Prefer local array to
2089 alloca of a constant.
2090
6dd5a677
EZ
20912012-07-05 Eli Zaretskii <eliz@gnu.org>
2092
2093 * xdisp.c (display_line): Fix horizontal pixel coordinates when
2094 hscroll is larger than the line width. Fixes long and futile
2095 looping inside extend_face_to_end_of_line (on a TTY) producing
2096 glyphs that are not needed and thrown away.
2097
6b312f0f
DA
20982012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2099
2100 * marker.c (set_marker_restricted_both): Simplify by using
2101 clip_to_bounds.
2102
f520ef9b
PE
21032012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2104
2105 * editfns.c (region_limit): Simplify by using clip_to_bounds.
2106
383b7c95
JD
21072012-07-05 Jan Djärv <jan.h.d@swipnet.se>
2108
2109 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
2110 not defined (Bug#11768).
2111 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
2112 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
2113 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
2114 followed by gtk_box_set_homogeneous (Bug#11768).
2115 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
2116 (update_theme_scrollbar_width, xg_create_scroll_bar):
2117 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
2118 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
2119 (is_box_type): New function (Bug#11768).
2120 (xg_tool_item_stale_p): Call is_box_type.
5293d758 2121 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
2122 with default display (Bug#11768).
2123
d6e7bf45
EZ
21242012-07-05 Eli Zaretskii <eliz@gnu.org>
2125
2126 * xdisp.c (window_hscroll_limited): New function.
2127 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
2128 coordinates when window's hscroll is set to insanely large
2129 values. (Bug#11857)
2130
431391ec
JB
21312012-07-05 Juanma Barranquero <lekktu@gmail.com>
2132
2133 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
2134 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
2135
23f86fce
DA
21362012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2137
2138 Cleanup xmalloc.
2139 * lisp.h (xzalloc): New prototype. Omit needless casts.
2140 * alloc.c (xzalloc): New function. Omit needless casts.
2141 * charset.c: Omit needless casts. Convert all calls to
2142 xmalloc with following memset to xzalloc.
2143 * dispnew.c: Likewise.
2144 * fringe.c: Likewise.
2145 * image.c: Likewise.
2146 * sound.c: Likewise.
2147 * term.c: Likewise.
2148 * w32fns.c: Likewise.
2149 * w32font.c: Likewise.
2150 * w32term.c: Likewise.
2151 * xfaces.c: Likewise.
2152 * xfns.c: Likewise.
2153 * xterm.c: Likewise.
2154 * atimer.c: Omit needless casts.
2155 * buffer.c: Likewise.
2156 * callproc.c: Likewise.
2157 * ccl.c: Likewise.
2158 * coding.c: Likewise.
2159 * composite.c: Likewise.
2160 * doc.c: Likewise.
2161 * doprnt.c: Likewise.
2162 * editfns.c: Likewise.
2163 * emacs.c: Likewise.
2164 * eval.c: Likewise.
2165 * filelock.c: Likewise.
2166 * fns.c: Likewise.
2167 * gtkutil.c: Likewise.
2168 * keyboard.c: Likewise.
2169 * lisp.h: Likewise.
2170 * lread.c: Likewise.
2171 * minibuf.c: Likewise.
2172 * msdos.c: Likewise.
2173 * print.c: Likewise.
2174 * process.c: Likewise.
2175 * region-cache.c: Likewise.
2176 * search.c: Likewise.
2177 * sysdep.c: Likewise.
2178 * termcap.c: Likewise.
2179 * terminal.c: Likewise.
2180 * tparam.c: Likewise.
2181 * w16select.c: Likewise.
2182 * w32.c: Likewise.
2183 * w32reg.c: Likewise.
2184 * w32select.c: Likewise.
2185 * w32uniscribe.c: Likewise.
2186 * widget.c: Likewise.
2187 * xdisp.c: Likewise.
2188 * xmenu.c: Likewise.
2189 * xrdb.c: Likewise.
2190 * xselect.c: Likewise.
2191
0497dc44
PE
21922012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2193
2194 * fileio.c (time_error_value): Check the right error number.
2195 Problem reported by Troels Nielsen in
2196 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
2197
356e7178
PE
21982012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2199
4e71fd89
PE
2200 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
2201 This should be fixed in a better way; see Eli Zaretskii in
2202 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
2203 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
2204
f0941253
PE
2205 * fileio.c (time_error_value): Rename from special_mtime.
2206 The old name's problems were noted by Eli Zaretskii in
2207 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
2208
065c9eb4
PE
2209 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
2210 This variable's comment says Emacs needs at least one GDB-visible
2211 symbol of type enum pvec_type, to work around GDB problems.
2212 The symbol's value doesn't matter.
2213
356e7178
PE
2214 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
2215 that causes compilation to fail on pre-C99 compilers.
2216
ed9265fc 22172012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
2218
2219 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
2220 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
2221
3884d954
DA
22222012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2223
d209e2fb 2224 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
2225 headers for buffer_defaults and buffer_local_symbols.
2226 Reported by Juanma Barranquero <lekktu@gmail.com>.
2227
ee28be33
SM
22282012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
2229
2230 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
2231 * lisp.h (enum pvec_type): Use fewer bits.
2232 (PSEUDOVECTOR_SIZE_BITS): New constant.
2233 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
2234 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
2235 change in pvec_type.
2236 (PSEUDOVECTOR_TYPEP): New macro.
2237 (TYPED_PSEUDOVECTORP): Use it.
2238 * fns.c (internal_equal): Adapt code to extract pvectype.
2239 * emacs.c (gdb_pvec_type): Update type.
2240 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
2241 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
2242 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
2243 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
2244 (sweep_vectors): Use it. Use local var `total_bytes' instead of
2245 abusing vector->header.next.nbytes.
2246 (live_vector_p): Use PVEC_TYPE.
2247 (mark_object): Adapt code to extract pvectype. Use switch.
2248
c7f2cd7f
PE
22492012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
2252 Tighten new eassert a bit.
2253
8ce70ed2
DA
22542012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2255
2256 Fix compilation with --enable-gcc-warnings and -O1
2257 optimization level.
2258 * doprnt.c (doprnt): Change type of tem to int, initialize
2259 to avoid compiler warning. Add eassert.
2260 * search.c (simple_search): Initialize match_byte to avoid
2261 compiler warning. Add eassert.
2262
dea7f1e5
PE
22632012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2264
24a212eb
PE
2265 Avoid weird behavior with large horizontal scrolls.
2266 Without this change, for example, large hscroll values would
2267 mess up Emacs's display on Fedora 15 x86, presumably due to
2268 overflows in int calculations in the display code.
2269 Also, if buffers had long lines, Emacs would freeze.
2270 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
2271 (set_window_hscroll): New function, containing the old guts of
2272 Fset_window_hscroll. Return the clipped value.
2273 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
2274 This avoids the need to check against PTRDIFF_MAX.
2275
dea7f1e5
PE
2276 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
2277
76046526
DA
22782012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2279
2280 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
2281
39adff0d
PE
22822012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2283
63807d47
PE
2284 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
2285 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
2286 since GCC 4.4.6 issues a bogus warning for them.
2287
39adff0d
PE
2288 Fix bugs in file timestamp newness comparisons.
2289 * fileio.c (Ffile_newer_than_file_p):
2290 * lread.c (Fload): Use full timestamp resolution of files,
2291 not just the 1-second resolution, so that files that are only
2292 slightly newer still count as newer.
2293 * fileio.c (Ffile_newer_than_file_p): Don't assume file
2294 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
2295
dbeed9a6
PE
22962012-07-03 Paul Eggert <eggert@cs.ucla.edu>
2297
2298 * fileio.c: Improve handling of file time marker. (Bug#11852)
2299 (special_mtime): New function.
2300 (Finsert_file_contents, Fverify_visited_file_modtime):
2301 Use it to set special mtime values consistently.
2302
636334d6
AS
23032012-07-03 Andreas Schwab <schwab@linux-m68k.org>
2304
2305 * fileio.c (Finsert_file_contents): Properly handle st_mtime
2306 marker for non-existing file. (Bug#11852)
2307
e2017fe2
GM
23082012-07-03 Glenn Morris <rgm@gnu.org>
2309
2310 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
2311 and did not make it into globals.h).
2312
404dbd37
TT
23132012-07-03 Tom Tromey <tromey@redhat.com>
2314
2315 * window.c (Fset_window_margins, Fset_window_fringes)
2316 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
2317 * textprop.c (Fprevious_property_change): No longer static.
2318 * syntax.c (Fsyntax_table_p): No longer static.
2319 * process.c (Fget_process, Fprocess_datagram_address): No longer
2320 static.
2321 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
2322 * keyboard.c (Fcommand_execute): No longer static.
2323 Remove EXFUN.
2324 * insdel.c (Fcombine_after_change_execute): No longer static.
2325 * image.c (Finit_image_library): No longer static.
2326 * fileio.c (Fmake_symbolic_link): No longer static.
2327 * eval.c (Ffetch_bytecode): No longer static.
2328 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
2329 * doc.c (Fdocumentation_property, Fsnarf_documentation):
2330 No longer static.
404dbd37
TT
2331 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
2332 static.
2333 * dired.c (Ffile_attributes): No longer static.
2334 * composite.c (Fcomposition_get_gstring): No longer static.
2335 * callproc.c (Fgetenv_internal): No longer static.
2336
2337 * ccl.h: Remove EXFUNs.
2338 * buffer.h: Remove EXFUNs.
2339 * dispextern.h: Remove EXFUNs.
2340 * intervals.h: Remove EXFUNs.
2341 * fontset.h: Remove EXFUN.
2342 * font.h: Remove EXFUNs.
2343 * dosfns.c (system_process_attributes): Remove EXFUN.
2344 * keymap.h: Remove EXFUNs.
2345 * lisp.h: Remove EXFUNs.
2346 * w32term.h: Remove EXFUNs.
2347 * window.h: Remove EXFUNs.
2348 * xsettings.h: Remove EXFUN.
2349 * xterm.h: Remove EXFUN.
2350
8e4fd1e1
GM
23512012-07-03 Glenn Morris <rgm@gnu.org>
2352
2353 * lisp.h (Frandom): Make it visible to C.
2354 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
2355 buffer for invisible buffers. (Bug#1229)
2356
ca95b3eb
DA
23572012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2358
2359 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
2360 values which aren't power of 2.
2361 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
2362 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
2363 accordingly.
2364
7555c33f
SM
23652012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
2366
2367 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
2368
2369 * alloc.c (mark_object): Revert part of last patch to use `switch'.
2370
d12e8f5a
DA
23712012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2372
2373 * alloc.c (allocate_vector_block): Remove redundant
2374 calls to mallopt if DOUG_LEA_MALLOC is defined.
2375 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
2376 avoid calls to mallopt if zero_vector is returned.
2377
296094c3
DA
23782012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2381 is enabled, avoid dereferencing NULL current_sblock if
2382 running undumped.
2383
36429c89
DA
23842012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2385
2386 Cleanup basic buffer management.
2387 * buffer.h (struct buffer): Change layout to use generic vector
2388 marking code. Fix some comments. Change type of 'clip_changed'
2389 to bitfield. Remove unused #ifndef old.
2390 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2391 (GET_OVERLAYS_AT): Fix indentation.
2392 (for_each_per_buffer_object_at): New macro.
2393 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2394 (Fbuffer_local_variables): Use it.
2395 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2396 * alloc.c (allocate_buffer): Adjust to match new layout of
2397 struct buffer. Fix comment.
2398 (mark_overlay): New function.
2399 (mark_buffer): Use it. Use mark_vectorlike to mark normal
2400 Lisp area of struct buffer.
2401 (mark_object): Use it. Adjust marking of misc objects
2402 and related comments.
2403
3b3e4cac
PE
24042012-07-02 Paul Eggert <eggert@cs.ucla.edu>
2405
2406 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2407 wrapper that is not needed because the wrapped code is a no-op (zero
2408 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2409 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2410
cf5c0175
DA
24112012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
2412
2413 * alloc.c (mark_buffer): Simplify. Remove prototype.
2414 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 2415 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
2416 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
2417 redundant calls to mark_vectorlike for bool vectors.
2418
ca26824c
GM
24192012-06-30 Glenn Morris <rgm@gnu.org>
2420
2e4c5312
GM
2421 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2422
ca26824c
GM
2423 * epaths.in (PATH_SITELOADSEARCH): New.
2424 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2425 This is rather than relying on --enable-locallisppath elements
2426 having "site-lisp" in their names. (Bug#10208#25, 11658)
2427
0d23c240
EZ
24282012-06-30 Eli Zaretskii <eliz@gnu.org>
2429
c9240d7a
EZ
2430 * w32proc.c (sys_select): Accept and ignore one more argument.
2431
2432 * w32.c (emacs_gnutls_pull): Call select with one more argument.
2433
0d23c240 2434 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 2435 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
2436
2437 * sysdep.c: Don't include dos.h and dosfns.h.
2438
2439 * process.c (sys_select):
2440 * msdos.c (sys_select): Accept one more argument and ignore it.
2441
2442 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2443 adapt data types and code to that.
2444
2445 * dosfns.c:
2446 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2447 which clashes with the gnulib function of the same name.
2448
af5a5a98
AS
24492012-06-30 Andreas Schwab <schwab@linux-m68k.org>
2450
c5e4379c
AS
2451 * font.c (font_style_to_value, font_style_symbolic)
2452 (font_prop_validate_style): Add type checks for values in
2453 font_style_table.
2454
af5a5a98
AS
2455 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2456 argument.
2457 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2458 uses.
2459
8d38f461
EZ
24602012-06-29 Eli Zaretskii <eliz@gnu.org>
2461
2e5a6631
EZ
2462 * xdisp.c (try_window_id): Undo last change.
2463
8d38f461
EZ
2464 * w32.c (getwd): Adjust commentary about startup_dir.
2465 (init_environment): Always call sys_access, even in non-MSVC
2466 builds. Don't chdir to the directory of the Emacs executable.
2467 This undoes code from 1997 which was justified by the need to
2468 "avoid conflicts when removing and renaming directories". But its
2469 downside was that every relative file name was being interpreted
2470 relative to the directory of the Emacs executable, which can never
2471 be TRT. In particular, it broke sys_access when called with
2472 relative file names.
2473 (sys_access): Map GetLastError to errno.
2474
2af3565e
DA
24752012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2476
2477 * window.h (struct window): Change type of 'fringes_outside_margins'
2478 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 2479 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
2480 Adjust comment.
2481 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2482 to ptrdiff_t.
2483
c8d3a25c 24842012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 2485
c8d3a25c
GM
2486 * gnutls.c (emacs_gnutls_handshake):
2487 Add QUIT to make the loop interruptible.
57570cd3 2488
c8d3a25c 24892012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 2490
c8d3a25c
GM
2491 * charset.c (init_charset): Make lack of etc/charsets fatal.
2492
3e984ee8
DA
24932012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 * editfns.c (region_limit): Fix type mismatch.
2496
ef884f23
DA
24972012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2498
2499 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2500 undefined. Convert from xassert to eassert.
2501 * nsmenu.m: Convert from xassert to eassert.
2502 * nsterm.m: Likewise.
2503
7d7e0027
SM
25042012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
2505
2506 * editfns.c (region_limit): Clip to narrowing (bug#11770).
2507
aa754e6a
PE
25082012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2509
2510 Avoid integer overflow on scroll-left and scroll-right.
2511 * window.c (HSCROLL_MAX): New macro.
2512 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2513 overflow when requested scroll falls outside ptrdiff_t range.
2514
80b00b08
DA
25152012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2516
2517 * window.h (struct window): Change type of 'hscroll',
2518 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2519 'last_modified' and 'last_overlay_modified' to EMACS_INT.
2520 Adjust users accordingly.
2521 * xdisp.c (try_cursor_movement): Replace type check with eassert.
2522 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
2523 from EMACS_INT to ptrdiff_t.
2524 (make_window): Omit redundant initialization.
2525
62b2bcf6
JB
25262012-06-28 Juanma Barranquero <lekktu@gmail.com>
2527
2528 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2529
45942c7d
DA
25302012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2531
2532 * window.h (struct window): Change type of 'use_time' and
2533 'sequence_number' from Lisp_Object to int.
2534 * frame.c (make_frame): Adjust users accordingly.
2535 * print.c (print_object): Likewise.
2536 * window.c (select_window, Fwindow_use_time, make_parent_window)
2537 (make_window): Likewise.
2538
e509cfa6
DA
25392012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2540
2541 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2542 enabled with --enable-checking=[all,glyphs] configure option.
2543 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2544 adjust comments accordingly.
2545 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2546 undefined, adjust comments accordingly.
2547 * image.c: Likewise.
2548 * scroll.c: Likewise.
2549 * w32fns.c: Likewise.
2550 * w32term.c: Likewise.
2551 * xdisp.c: Likewise.
2552 * xfaces.c: Likewise.
2553 * xfns.c: Likewise.
2554 * xterm.c: Likewise.
2555
a54e2c05
DA
25562012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2557
2558 Generalize run-time debugging checks.
2559 * dispextern.h (XASSERTS): Remove.
2560 * fontset.c (xassert): Remove.
2561 Convert from xassert to eassert.
2562 * alloc.c: Convert from xassert to eassert.
2563 * bidi.c: Likewise.
2564 * dispnew.c: Likewise.
2565 * fns.c: Likewise.
2566 * fringe.c: Likewise.
2567 * ftfont.c: Likewise.
2568 * gtkutil.c: Likewise.
2569 * image.c: Likewise.
2570 * keyboard.c: Likewise.
2571 * menu.c: Likewise.
2572 * process.c: Likewise.
2573 * scroll.c: Likewise.
2574 * sound.c: Likewise.
2575 * term.c: Likewise.
2576 * w32console.c: Likewise.
2577 * w32fns.c: Likewise.
2578 * w32term.c: Likewise.
2579 * window.c: Likewise.
2580 * xdisp.c: Likewise.
2581 * xfaces.c: Likewise.
2582 * xfns.c: Likewise.
2583 * xselect.c: Likewise.
2584 * xterm.c: Likewise.
2585
1ec4b7b2
SM
25862012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2587
2588 * fns.c (maybe_resize_hash_table): Output message when growing the
2589 purify-hashtable.
2590
2014308a
DA
25912012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2592
2593 * alloc.c (allocate_string_data): Remove dead code.
2594 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2595 avoid GCC warning about unused macro.
2596
246155eb
DA
25972012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2598
2599 * alloc.c (allocate_string): Omit intervals initialization.
2600 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2601 as in make_pure_string and make_pure_c_string.
2602
43184b7b
DA
26032012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2604
d209e2fb 2605 * alloc.c (allocate_string): Fix last change.
43184b7b 2606
3fe6dd74
DA
26072012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2608
d209e2fb 2609 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
2610 to memset, add explicit initialization where appropriate.
2611
1ba6038a
GM
26122012-06-27 Glenn Morris <rgm@gnu.org>
2613
2614 * lisp.mk (lisp): Remove paths.elc.
2615
c89926a5
CY
26162012-06-27 Chong Yidong <cyd@gnu.org>
2617
2618 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2619
ed6b3510
JW
26202012-06-26 John Wiegley <johnw@newartisans.com>
2621
1ec4b7b2 2622 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
2623 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2624
ed6b3510
JW
2625 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2626 when building with Clang.
2627
8edd4a2b
SM
26282012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2629
2630 * eval.c (Fapply): Allow calling it with a single argument.
2631
f6f62d1b
EZ
26322012-06-26 Eli Zaretskii <eliz@gnu.org>
2633
2634 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2635 _stricmp and _strnicmp.
2636 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2637
62efea5e
DA
26382012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2639
2640 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2641 allocated window.
2642 (allocate_process): Likewise for new process.
8edd4a2b 2643 (allocate_terminal): Change to use offsetof.
62efea5e
DA
2644 (allocate_frame): Likewise.
2645 * frame.c (make_frame): Omit redundant initialization.
2646 * window.c (make_parent_window): Use memset.
2647 (make_window): Omit redundant initialization.
2648 * process.c (make_process): Omit redundant initialization.
2649 * terminal.c (create_terminal): Likewise.
2650
42997f4d
DA
26512012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 * term.c (delete_tty): Remove redundant call to memset.
2654
1130ecfc
DA
26552012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2656
2657 * alloc.c: Remove build_string.
2658 * lisp.h: Define build_string as static inline. This provides
2659 a better opportunity to optimize away calls to strlen when the
2660 function is called with compile-time constant argument.
2661 * image.c (imagemagick_error): Convert to build_string.
2662 * w32proc.c (sys_spawnve): Likewise.
2663 * xterm.c (x_term_init): Likewise.
2664
cf38a720
PE
26652012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2666
99027bdd
PE
2667 Use sprintf return value instead of invoking strlen on result.
2668 In the old days this wasn't portable, since some sprintf
2669 implementations returned char *. But they died out years ago and
2670 Emacs already assumes sprintf returns int.
2671 Similarly for float_to_string.
2672 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2673 * ccl.c (ccl_driver):
2674 * character.c (string_escape_byte8):
2675 * data.c (Fnumber_to_string):
2676 * doprnt.c (doprnt):
2677 * print.c (print_object):
2678 * xdisp.c (message_dolog):
2679 * xfns.c (syms_of_xfns):
2680 Use sprintf or float_to_string result to avoid need to call strlen.
2681 * data.c (Fnumber_to_string):
2682 Use make_unibyte_string, since the string must be ASCII.
2683 * lisp.h, print.c (float_to_string): Now returns int length.
2684 * term.c (produce_glyphless_glyph):
2685 Use sprintf result rather than recomputing it.
2686
cf38a720
PE
2687 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2688 * Makefile.in (ALL_CFLAGS):
2689 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2690 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2691
3511c784
DA
26922012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2693
0a08eb21 2694 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
2695 strcasecmp if available.
2696 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2697
fb7da12e
AS
26982012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2699
2700 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2701 Avoid comma operator.
2702 * menu.c (push_submenu_start, push_submenu_end)
2703 (push_left_right_boundary, push_menu_pane): Likewise.
2704 * msdos.c (dos_rawgetc): Likewise.
2705
afa2ffd8
DA
27062012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2707
2708 * xfns.c (xic_create_fontsetname): Remove redundant calls
2709 to memset.
2710
b3b4476b
PE
27112012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2712
4495ff38
PE
2713 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2714 sprintf already null-terminates its output.
2715
b3b4476b
PE
2716 * xfns.c (x_window): Remove redundant cast.
2717
b00876c9
DA
27182012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2719
2720 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2721 `const char *' to `char *' to avoid compiler warning.
2722
d188e26b
PE
27232012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2724
885d1d74
PE
2725 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2726 instead of truncating it to 63 (admittedly a generous limit).
2727
d188e26b
PE
2728 * process.c: Fix spelling and caps in comments.
2729
e2f560b1
DN
27302012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2731
e86db54b 2732 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
2733 * sysdep.c (setpgrp): Remove definition, not used in this file.
2734
7583a3a1
JB
27352012-06-24 Juanma Barranquero <lekktu@gmail.com>
2736
2737 * makefile.w32-in: Update dependencies.
2738
696056c2
EZ
27392012-06-24 Eli Zaretskii <eliz@gnu.org>
2740
2741 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2742 (SYSTIME_H): Add nt/inc/sys/time.h.
2743
2744 * systime.h [WINDOWSNT]: Include sys/time.h.
2745
2746 * s/ms-w32.h (struct timespec): Definition moved from
2747 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2748
845ca893
PE
27492012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2750
2751 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2752 * buffer.h (buffer_slot_type_mismatch):
2753 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2754 * eval.c (unwind_to_catch):
2755 * image.c (my_png_error, my_error_exit):
2756 * keyboard.c (quit_throw_to_read_char, user_error)
2757 (Fexit_recursive_edit, Fabort_recursive_edit):
2758 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2759 (wrong_type_argument, buffer_overflow, __executable_start)
2760 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2761 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
2762 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
2763 (fatal):
2764 (child_setup) [!DOS_NT]:
2765 * lread.c (end_of_file_error, invalid_syntax):
2766 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2767 * puresize.h (pure_write_error):
2768 * search.c (matcher_overflow):
2769 * sound.c (sound_perror, alsa_sound_perror):
2770 * sysdep.c, syssignal.h (croak):
2771 * term.c (maybe_fatal, vfatal):
2772 * textprop.c (text_read_only):
2773 * undo.c (user_error):
2774 * unexmacosx.c (unexec_error):
2775 * xterm.c (x_ins_del_lines, x_delete_glyphs):
2776 Use _Noreturn rather than NO_RETURN.
2777 No need for separate decl merely because of _Noreturn.
2778 * sound.c (sound_warning, parse_sound):
2779 Remove unnecessary forward decls.
2780
f1dd8073
PE
27812012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2782
2783 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
2784 * lisp.h (WAIT_READING_MAX): New macro.
2785 * dispnew.c (Fsleep_for, sit_for):
2786 * keyboard.c (kbd_buffer_get_event):
2787 * process.c (Faccept_process_output):
2788 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
2789 This improves on the previous patch, which introduced a bug
2790 when time_t is unsigned and as wide as intmax_t.
2791 See <http://bugs.gnu.org/9000#51>.
2792
b82c1755
EZ
27932012-06-23 Eli Zaretskii <eliz@gnu.org>
2794
2795 * dispnew.c (sit_for, Fsleep_for):
2796 * keyboard.c (kbd_buffer_get_event):
2797 * process.c (Faccept_process_output): Avoid compiler warnings when
2798 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
2799
ca300656
JB
28002012-06-23 Juanma Barranquero <lekktu@gmail.com>
2801
049ec95b
JB
2802 * makefile.w32-in: Update dependencies.
2803
ca300656
JB
2804 * w32.c (ltime): Add return type and declare static.
2805 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
2806
db7b8d06
PE
28072012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2808
2809 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
2810 Privately reported by Herbert J. Skuhra.
2811 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
2812 All uses changed.
2813 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
2814 not make_lisp_timeval, when the argument is of type EMACS_TIME.
2815
0bd8297f
EZ
28162012-06-23 Eli Zaretskii <eliz@gnu.org>
2817
96512555
EZ
2818 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
2819 last argument of make_unibyte_string.
2820
0bd8297f
EZ
2821 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
2822 language ID in the event parameters.
2823
2824 * w32term.c (w32_read_socket): Put the new keyboard codepage into
2825 event.code, not the obscure "character set ID".
2826
63def6b6
CY
28272012-06-23 Chong Yidong <cyd@gnu.org>
2828
2829 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
2830
e8a02204
EZ
28312012-06-23 Eli Zaretskii <eliz@gnu.org>
2832
388cdec0
EZ
2833 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
2834 * w32.c (fdutimens): New function.
2835
2836 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
2837
2838 * s/ms-w32.h (pselect): Redirect to sys_select.
2839
2840 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
2841
e8a02204
EZ
2842 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
2843 in the logic of incrementing and decrementing the value of
2844 use_relocatable_buffers.
2845
d054f3fb
PE
28462012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
2849 Privately reported by Herbert J. Skuhra.
2850 [__FreeBSD__]: Remove "*/" typo after "#include".
2851 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
2852 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
2853 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
2854 Don't assume EMACS_TIME and struct timeval are the same type.
2855
d35af63c
PE
28562012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2857
2858 Support higher-resolution time stamps (Bug#9000).
2859 The time stamps are only nanosecond-resolution at the C level,
2860 since that's the best that any real-world system supports now.
2861 But they are picosecond-resolution at the Lisp level, as that's
2862 easy, and leaves room for future OS improvements.
2863
2864 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
2865 (LIBES): Use it.
2866
2867 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
2868 Don't get current time unless it's needed.
2869
2870 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2871 now provides it if it's absent.
2872 (start_atimer): Port to higher-res time stamps.
2873 Check for time stamp overflow. Don't get current time more
2874 often than is needed.
2875
2876 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2877 Include systime.h, not time.h.
2878 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2879
2880 * dired.c: Include stat-time.h.
2881 (Ffile-attributes): File times now have higher resolution.
2882
2883 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2884 (struct image): Timestamp now has higher resolution.
2885
2886 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2887 has at least microseconds now. All uses removed.
2888 (update_frame, update_single_window, update_window, update_frame_1)
2889 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2890
2891 * editfns.c (time_overflow): Now extern.
2892 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2893 (float-time, Fformat_time_string, Fcurrent_time_string)
2894 (Fcurrent_time_zone): Accept and generate higher-resolution
2895 time stamps.
2896 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2897 (decode_time_components, lisp_seconds_argument): New functions.
2898 (make_time): Now static.
2899 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2900 Report an error if the time is invalid, rather than having the caller
2901 do that.
2902
2903 * fileio.c: Include <stat-time.h>
2904 (Fcopy_file): Copy higher-resolution time stamps.
2905 Prefer to set the time stamp via a file descriptor if that works.
2906 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2907 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2908 (Fvisited_file_modtime, Fset_visited_file_modtime):
2909 Support higher-resolution time stamps.
2910
2911 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2912
2913 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2914
2915 * image.c (prepare_image_for_display, clear_image_cache)
2916 (lookup_image): Port to higer-resolution time stamps.
2917
2918 * keyboard.c (start_polling, bind_polling_period):
2919 Check for time stamp overflow.
2920 (read_char, kbd_buffer_get_event, timer_start_idle)
2921 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2922 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2923 Port to higher-resolution time stamps. Do not assume time_t is signed.
2924 (decode_timer): New function. Timers are now vectors of length 9,
2925 not 8, to accommodate the picosecond component.
2926 (timer_check_2): Use it.
2927
2928 * nsterm.m (select_timeout, timeval_subtract): Remove.
2929 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2930 as they're a bit more accurate and handle overflow better.
2931 (ns_select): Change prototype to be compatible with pselect.
2932 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2933 * nsterm.h (ns_select): Adjust prototype.
2934
2935 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2936 us-resolution time stamps.
2937 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2938
2939 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2940
2941 * lisp.h (time_overflow): New decl.
2942 (wait_reading_process_output): First arg is now intmax_t, not int,
2943 to accommodate larger waits.
2944
2945 * process.h (struct Lisp_Process.read_output_delay):
2946 Now counts nanoseconds, not microseconds.
2947 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2948 EMACS_HAS_USECS.
2949 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2950 (wait_reading_process_output):
2951 Port to ns-resolution time stamps.
2952 (Faccept_process_output, wait_reading_process_output):
2953 Check for time stamp overflow. Do not assume time_t is signed.
2954 (select_wrapper): Remove; we now use pselect.
2955 (Fprocess_attributes): Now generates ns-resolution time stamps.
2956
2957 * sysdep.c: Include utimens.h. Don't include utime.h
2958 or worry about struct utimbuf; gnulib does that for us now.
2959 (gettimeofday): Remove; gnulib provides a substitute.
2960 (make_timeval): New function.
2961 (set_file_times): Now sets ns-resolution time stamps.
2962 New arg FD; all uses changed.
2963 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2964 (system_process_attributes):
2965 Now returns ns-resolution time stamp. All uses changed.
2966 Check for time stamp overflow.
2967
2968 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2969 provides a substitute now.
2970
2971 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2972 since it guarantees struct timespec.
2973 (EMACS_TIME): Now struct timespec, so that we can support
2974 ns-resolution time stamps.
2975 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2976 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2977 (EMACS_USECS): Remove.
2978 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2979 so multiply the arg by 1000 before storing it.
2980 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2981 New macros.
2982 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2983 Port to ns-resolution time stamps.
2984 (EMACS_TIME_NEG_P): Remove; replaced by....
2985 (EMACS_TIME_SIGN): New macro.
2986 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2987 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2988 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2989 (make_timeval, make_lisp_time, decode_time_components): New decls.
2990 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2991 that it mishandled time_t overflow. You can't compare by subtracting!
2992 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2993 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
2994
2995 * term.c: Include <sys/time.h>.
2996 (timeval_to_Time): New function, for proper overflow wraparound.
2997 (term_mouse_position, term_mouse_click): Use it.
2998
2999 * undo.c (record_first_change): Support higher-resolution time stamps
3000 in the undo buffer.
3001 (Fprimitive_undo): Use them when restoring time stamps.
3002
3003 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
3004 (w32_get_internal_run_time):
3005 Port to higher-resolution Emacs time stamps.
3006 (ltime): Now accepts single 64-bit integer, as that's more convenient
3007 for callers.
3008
3009 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
3010
3011 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
3012 for compatibility with pselect. Support ns-resolution time stamps.
3013
3014 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
3015
3016 * xselect.c (wait_for_property_change, x_get_foreign_selection):
3017 Check for time stamp overflow, and support ns-resolution time stamps.
3018
3019 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
3020 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
3021 (timeval_subtract): Remove; no longer needed.
3022 (XTflash, XTring_bell, x_wait_for_event):
3023 Port to ns-resolution time stamps. Don't assume time_t is signed.
3024
b6a92dfe
CY
30252012-06-22 Chong Yidong <cyd@gnu.org>
3026
3027 * xdisp.c (x_consider_frame_title): Revert last change.
3028
d251c37c
EZ
30292012-06-22 Eli Zaretskii <eliz@gnu.org>
3030
3031 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
3032 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
3033 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
3034 staticidx goes up to 1597 out of 1600 = 0x640.)
3035
f10deafb
PE
30362012-06-20 Paul Eggert <eggert@cs.ucla.edu>
3037
3038 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
3039 Otherwise, the umask might be mistakenly 0 while handling input signals.
3040
ec6de1e2
SM
30412012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
3042
3043 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
3044
28be1ada
DA
30452012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
3046
3047 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
3048 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
3049 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
3050 access to `contents' member of Lisp_Vector objects with AREF and ASET
3051 where appropriate.
3052
c6bf3022
CY
30532012-06-19 Chong Yidong <cyd@gnu.org>
3054
3055 * frame.c (delete_frame): When selecting a frame on a different
3056 text terminal, do not alter the terminal's top-frame.
3057
3058 * xdisp.c (format_mode_line_unwind_data): Record the target
3059 frame's selected window and its terminal's top-frame.
3060 (unwind_format_mode_line): Restore them.
3061 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
3062 Callers changed.
3063 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
3064 since tty frames can be explicitly named.
3065 (prepare_menu_bars): Likewise.
3066
3067 * term.c (Ftty_top_frame): New function.
3068
defd4196
PE
30692012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3070
3071 Port byte-code-meter to modern targets.
3072 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
3073 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 3074 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
3075 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
3076 (METER_1, METER_2): Simplify.
3077
1053a871
SM
30782012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
3079
3080 * data.c (Fdefalias): Return `symbol' (bug#11686).
3081
b7e8d081
MR
30822012-06-18 Martin Rudalics <rudalics@gmx.at>
3083
3084 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
3085 gets killed during executing of this function (Bug#11665).
3086 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
3087 (Vkill_buffer_query_functions): In doc-string say that functions
3088 run by this hook should not change the current buffer.
3089
7ea2b339
PE
30902012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 Fix recently-introduced process.c problems found by static checking.
3093 * process.c (write_queue_push, write_queue_pop, send_process):
3094 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
3095 (write_queue_pop): Fix pointer signedness problem.
3096 (send_process): Remove unused local.
3097
96a313a1
CY
30982012-06-17 Chong Yidong <cyd@gnu.org>
3099
3100 * xdisp.c (redisplay_internal): No need to redisplay terminal
3101 frames that are not on top.
3102
20ca2e94
TN
31032012-06-17 Troels Nielsen <bn.troels@gmail.com>
3104
3105 * process.c (make_process): Initialize write_queue.
3106 (write_queue_push, write_queue_pop): New functions.
3107 (send_process): Use them to maintain correct ordering of process
3108 writes (Bug#10815).
3109
9a900ca9
PE
31102012-06-17 Paul Eggert <eggert@cs.ucla.edu>
3111
310fbfa8
PE
3112 * lisp.h (eassert): Assume C89 or later.
3113 This removes the need for CHECK.
3114 (CHECK): Remove. Its comments about always evaluating its
3115 argument were confusing, as 'eassert' typically does not evaluate
3116 its argument.
3117
27bb1ca4
PE
3118 * coding.c (produce_chars): Use ptrdiff_t, not int.
3119
9a900ca9
PE
3120 * xterm.c (x_draw_underwave): Check for integer overflow.
3121 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
3122
41b7f8bc 31232012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
3124
3125 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
3126 referenced (Bug#11583).
3127
9b0e3eba
AA
31282012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
3129
3130 Implement wave-style variant of underlining.
3131 * dispextern.h (face_underline_type): New enum.
3132 (face): Add field for underline type.
3133 * nsterm.m (ns_draw_underwave): New function.
3134 (ns_draw_text_decoration): Use it.
3135 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
3136 New functions.
3137 (x_draw_glyph_string): Use them.
3138 * xfaces.c (Qline, Qwave): New Lisp objects.
3139 (check_lface_attrs, merge_face_ref)
1053a871
SM
3140 (Finternal_set_lisp_face_attribute, realize_x_face):
3141 Handle wave-style underline face attributes.
9b0e3eba
AA
3142 * xterm.c (x_draw_underwave): New function.
3143 (x_draw_glyph_string): Use it.
3144
0fb52f11
JB
31452012-06-16 Juanma Barranquero <lekktu@gmail.com>
3146
3147 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
3148 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
3149 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
3150 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
3151 ($(BLD)/w32select.$(O)): Update dependencies.
3152
e5560ff7
AS
31532012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3154
3155 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
3156 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
3157 * character.c (_fetch_multibyte_char_p): Remove.
3158 * alloc.c: Include "character.h" before "buffer.h".
3159 * bidi.c: Likewise.
3160 * buffer.c: Likewise.
3161 * bytecode.c: Likewise.
3162 * callint.c: Likewise.
3163 * callproc.c: Likewise.
3164 * casefiddle.c: Likewise.
3165 * casetab.c: Likewise.
3166 * category.c: Likewise.
3167 * cmds.c: Likewise.
3168 * coding.c: Likewise.
3169 * composite.c: Likewise.
3170 * dired.c: Likewise.
3171 * dispnew.c: Likewise.
3172 * doc.c: Likewise.
3173 * dosfns.c: Likewise.
3174 * editfns.c: Likewise.
3175 * emacs.c: Likewise.
3176 * fileio.c: Likewise.
3177 * filelock.c: Likewise.
3178 * font.c: Likewise.
3179 * fontset.c: Likewise.
3180 * fringe.c: Likewise.
3181 * indent.c: Likewise.
3182 * insdel.c: Likewise.
3183 * intervals.c: Likewise.
3184 * keyboard.c: Likewise.
3185 * keymap.c: Likewise.
3186 * lread.c: Likewise.
3187 * macros.c: Likewise.
3188 * marker.c: Likewise.
3189 * minibuf.c: Likewise.
3190 * nsfns.m: Likewise.
3191 * nsmenu.m: Likewise.
3192 * print.c: Likewise.
3193 * process.c: Likewise.
3194 * regex.c: Likewise.
3195 * region-cache.c: Likewise.
3196 * search.c: Likewise.
3197 * syntax.c: Likewise.
3198 * term.c: Likewise.
3199 * textprop.c: Likewise.
3200 * undo.c: Likewise.
3201 * unexsol.c: Likewise.
3202 * w16select.c: Likewise.
3203 * w32fns.c: Likewise.
3204 * w32menu.c: Likewise.
3205 * window.c: Likewise.
3206 * xdisp.c: Likewise.
3207 * xfns.c: Likewise.
3208 * xmenu.c: Likewise.
3209 * xml.c: Likewise.
3210 * xselect.c: Likewise.
3211
2f07e6af
EZ
32122012-06-16 Eli Zaretskii <eliz@gnu.org>
3213
1053a871
SM
3214 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
3215 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 3216 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
3217 row.
3218 (handle_face_prop): Use chunk-relative overlay string index when
3219 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
3220 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
3221 the rightmost. (Bug#11720)
2f07e6af 3222
29b83cec
AS
32232012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3224
3225 * category.h (CHAR_HAS_CATEGORY): Define as inline.
3226 (CATEGORY_MEMBER): Enforce 1/0 value.
3227 * category.c (_temp_category_set): Remove.
3228
4c5501e9
EZ
32292012-06-16 Eli Zaretskii <eliz@gnu.org>
3230
3231 * window.c (Fdelete_other_windows_internal)
3232 (Fdelete_window_internal): Don't access frame's mouse highlight
3233 info of the initial frame. (Bug#11677)
3234
2b570124
PE
32352012-06-14 Paul Eggert <eggert@cs.ucla.edu>
3236
e93864f9
PE
3237 * .gdbinit (xgetint): Fix recently-introduced paren typo.
3238 Assume USE_2_TAGS_FOR_INTS.
3239 (xreload): Adjust $tagmask width to match recent lisp.h change.
3240
2b570124
PE
3241 Simplify lisp.h in minor ways that should not affect code.
3242 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
3243 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
3244 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
3245 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
3246 (INTTYPEBITS): New macro, for clarity.
3247 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
3248 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
3249 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
3250 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
3251 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
3252
81755f69
JB
32532012-06-13 Juanma Barranquero <lekktu@gmail.com>
3254
3255 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
3256
16192a57
GM
32572012-06-13 Glenn Morris <rgm@gnu.org>
3258
3259 * s/bsd-common.h (BSD4_3):
3260 * s/usg5-4-common.h (USG5_4): No longer define; unused.
3261
646b5f55
AS
32622012-06-13 Andreas Schwab <schwab@linux-m68k.org>
3263
3264 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
3265 instead of union.
3266 (XLI, XIL): Define.
1053a871
SM
3267 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
3268 Use them.
3269 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 3270 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 3271 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
3272 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
3273 * frame.c (delete_frame): Remove outdated comment.
3274 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
3275 USE_LISP_UNION_TYPE.
3276 (Fw32_unregister_hot_key): Likewise.
3277 (Fw32_toggle_lock_key): Likewise.
3278 * w32menu.c (add_menu_item): Likewise.
3279 (w32_menu_display_help): Use XIL instead of checking
3280 USE_LISP_UNION_TYPE.
3281 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
3282 (init_heap): Likewise.
3283 * w32term.c (w32_read_socket): Update comment.
3284
1d3823c9
GM
32852012-06-13 Glenn Morris <rgm@gnu.org>
3286
c62ff706
GM
3287 * s/usg5-4-common.h, src/s/unixware.h:
3288 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
3289
1d3823c9
GM
3290 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
3291
bfe3e0a2
PE
32922012-06-13 Paul Eggert <eggert@cs.ucla.edu>
3293
3294 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
3295 * alloc.c (make_number) [!defined make_number]:
3296 Remove, as lisp.h always defines this now.
3297 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
3298 (roundup_size): Verify that it is a power of 2.
3299 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
3300 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
3301 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
3302 -DUSE_LSB_TAG=0, to override the automatically-selected default.
3303 USE_LSB_TAG now is always defined to be either 0 or 1.
3304 All uses changed.
3305 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
3306 code works fine either way, and efficiency is not a concern here,
3307 as the union type is for debugging, not for production.
3308 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
3309 Use an inline function on all platforms when using the union type,
3310 since this is simpler and 'static inline' can be used portably
3311 within Emacs now.
3312 (LISP_INITIALLY_ZERO): New macro.
3313 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
3314 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
3315
45fa9c0f
GM
33162012-06-12 Glenn Morris <rgm@gnu.org>
3317
b4492cba
GM
3318 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
3319
3320 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 3321
45fa9c0f
GM
3322 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
3323 Move BROKEN_SIGIO to configure.
3324
3325 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
3326 Move NO_TERMIO to configure.
3327
0e25d334
CY
33282012-06-12 Chong Yidong <cyd@gnu.org>
3329
3330 * image.c (imagemagick_load_image): Use MagickFlattenImage if
3331 MagickMergeImageLayers is undefined. Use pixel pusher loop if
3332 MagickExportImagePixels is undefined.
3333
43682bb6
PE
33342012-06-12 Paul Eggert <eggert@cs.ucla.edu>
3335
3336 * image.c (imagemagick_load_image): Remove unused label.
3337
a9be7d2b
GM
33382012-06-11 Glenn Morris <rgm@gnu.org>
3339
3340 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3341 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
3342 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
3343 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
3344
3017f87f
SM
33452012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
3346
3347 * alloc.c (make_byte_code): New function.
3348 (Fmake_byte_code): Use it. Don't purify here.
3349 * lread.c (read1): Use it as well to avoid extra allocation.
3350
1b9b4cf4
CY
33512012-06-11 Chong Yidong <cyd@gnu.org>
3352
3353 * image.c (imagemagick_load_image): Implement transparency.
3354
95988fcf
AS
33552012-06-10 Andreas Schwab <schwab@linux-m68k.org>
3356
3357 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
3358 account for preceding backslashes. (Bug#11663)
3359
cd4eb164
CY
33602012-06-09 Chong Yidong <cyd@gnu.org>
3361
3362 * term.c: Support italics in capable terminals (Bug#9652).
3363 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
3364 (turn_on_face): Output using TS_enter_italic_mode if available.
3365 Don't handle unused blinking and alt-charset cases.
3366 (turn_off_face): Handle italic case; discard unused tty_blinking_p
3367 and tty_alt_charset_p cases.
3368 (tty_capable_p, init_tty): Support italics.
3369
3370 * termchar.h (struct tty_display_info): Add field for italics.
3371 Remove unused blink field.
3372
3373 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
3374 Handle slant.
3375
3376 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
3377 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
3378 tty_alt_charset_p. Add tty_italic_p.
3379
ff88beb8
MA
33802012-06-09 Michael Albinus <michael.albinus@gmx.de>
3381
3382 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3383 dbus_type_is_basic if available.
3384 (xd_extract_signed, xd_extract_unsigned): Rename from
3385 extract_signed and extract_unsigned, respectively. Adapt callers.
3386
44286096
CY
33872012-06-09 Chong Yidong <cyd@gnu.org>
3388
1682701f
CY
3389 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3390
44286096
CY
3391 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3392 case (Bug#9752).
3393
d86feb17
PE
33942012-06-08 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * xdisp.c (vmessage): Treat frame message as multibyte.
3397 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3398 would generate the diagnostic "Making \302\247 buffer-local while
3399 let-bound!".
3400
d5c20fe8
EZ
34012012-06-08 Eli Zaretskii <eliz@gnu.org>
3402
3403 * dispnew.c (showing_window_margins_p): Undo last change, which
3404 was done due to an inadvertent commit.
3405 (adjust_frame_glyphs_for_frame_redisplay): Do call
3406 showing_window_margins_p.
3407
513749ee
SM
34082012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3409
3410 * eval.c (Fmake_var_non_special): New primitive.
3411 (syms_of_eval): Defsubr it.
3412 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3413
d4a8f5c1
JB
34142012-06-08 Juanma Barranquero <lekktu@gmail.com>
3415
3416 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3417 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3418
8bbbc977
EZ
34192012-06-08 Eli Zaretskii <eliz@gnu.org>
3420
3421 * alloc.c (allocate_vectorlike): Fix last change.
3422
f3372c87
DA
34232012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
3424
3425 Block-based vector allocation of small vectors.
3426 * lisp.h (struct vectorlike_header): New field `nbytes',
3427 adjust comment accordingly.
3428 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3429 to denote vector blocks. Adjust users (live_vector_p,
3430 mark_maybe_pointer, valid_lisp_object_p) accordingly.
3431 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3432 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3433 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3434 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3435 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3436 (roundup_size): New constant.
3437 (struct vector_block): New data type.
3438 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 3439 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
3440 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3441 (sweep_vectors): New functions.
3442 (allocate_vectorlike): Return `zero_vector' as the only vector of
3443 0 items. Allocate new vector from block if vector size is less than
3444 or equal to VBLOCK_BYTES_MAX.
3445 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3446 (init_alloc_once): Add call to init_vectors.
3447
4f18a4ed
SM
34482012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3449
3450 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3451
86f158bc
PE
34522012-06-07 Paul Eggert <eggert@cs.ucla.edu>
3453
3454 * doprnt.c (doprnt): Truncate multibyte char correctly.
3455 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3456 would mishandle a string argument "Xc" if X was a multibyte
3457 character of length 2: it would truncate after X's first byte
3458 rather than including all of X.
3459
c5cfcbe0
CY
34602012-06-06 Chong Yidong <cyd@gnu.org>
3461
3462 * buffer.c (word_wrap): Doc fix.
3463
c05cf390
PE
34642012-06-04 Paul Eggert <eggert@cs.ucla.edu>
3465
3466 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3467
0c3461de
GM
34682012-06-03 Glenn Morris <rgm@gnu.org>
3469
3470 * xdisp.c (tool-bar-style): Doc fix.
3471
c71232db
UM
34722012-06-03 Ulrich Müller <ulm@gentoo.org>
3473
3474 * Makefile.in (PAXCTL): Define.
3475 (temacs$(EXEEXT)): Disable memory randomization for the temacs
3476 binary via PaX flags if the paxctl utility is available.
3477 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3478 Restore PaX flags to their default. (Bug#11398)
3479
383f7350
CY
34802012-06-03 Chong Yidong <cyd@gnu.org>
3481
3482 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3483 buffer (Bug#11226).
3484
5f2c76c6
CY
34852012-06-03 Chong Yidong <cyd@gnu.org>
3486
3487 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3488 (note_mode_line_or_margin_highlight): If there is no help echo,
3489 use mode-line-default-help-echo. Handle the case where the mouse
3490 position is past the end of the mode line string.
3491
3492 * buffer.c (buffer_local_value_1): New function, split from
3493 Fbuffer_local_value; can return Qunbound.
3494 (Fbuffer_local_value): Use it.
3495 (Vmode_line_format): Docstring tweaks.
3496
773d47f6
PE
34972012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3498
3499 * sysdep.c (system_process_attributes): Improve comment.
3500
f2d6a3df
SM
35012012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
3502
3503 * keyboard.c: Export real-this-command to Elisp.
3504 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3505 and DEFVAR it. Update all users.
3506
63810350
PE
35072012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3508
7bd5c1f4
PE
3509 * minibuf.c (Fassoc_string): Remove duplicate declaration.
3510
63810350
PE
3511 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3512 Convert pctcpu and pctmem to Lisp float properly.
3513 Let the compiler fold better, as 100.0/0x8000 is exact.
3514
a2821611
AS
35152012-06-02 Andreas Schwab <schwab@linux-m68k.org>
3516
3517 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3518 cons_block.
3519
5fceba1d
PE
35202012-06-01 Paul Eggert <eggert@cs.ucla.edu>
3521
3522 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
3523
c98ff5dd
DA
35242012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
3525
3526 For a 'struct window', replace some Lisp_Object fields to
3527 bitfields where appropriate, remove unused fields.
3528 * window.h (struct window): Remove unused 'last_mark_x' and
3529 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
3530 change it's type from Lisp_Object to bitfield.
3531 Change type of 'force_start', 'optional_new_start',
3532 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
3533 fields from Lisp_Object to bitfield. Adjust users accordingly.
3534
ca34e0be
PE
35352012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3536
3537 Pacify gcc -Wdouble-precision when using Xaw.
3538 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
3539 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
3540 Use 'float' consistently, rather than 'float' in most places
3541 and 'double' in a couple of places.
3542
efc00ab1 35432012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
3544
3545 * xdisp.c (handle_stop): Detect whether we have overlay strings
3546 loaded by testing it->current.overlay_string_index to be
3547 non-negative, instead of checking whether n_overlay_strings is
3548 positive. (Bug#11587)
3549
efc00ab1 35502012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
3551
3552 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3553
3554 * doc.c (Fsubstitute_command_keys): Doc fix.
3555
efc00ab1 35562012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
3557
3558 * search.c (search_buffer): Remove calls to
3559 r_alloc_inhibit_buffer_relocation, as it is now called by
3560 maybe_unify_char, which was the cause of relocation of buffer text
3561 in bug#11519.
3562
efc00ab1 35632012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
3564
3565 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3566 for the duration of call to load_charset, to avoid problems with
3567 callers of maybe_unify_char that access buffer text through C
3568 pointers.
3569
3570 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3571 decrement the inhibition flag, instead of just setting or
3572 resetting it.
3573
ba93a187
PE
35742012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3575
3576 Remove obsolete '#define static' cruft.
3577 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3578 This #undef was "temporary" in 2000; it is no longer needed
3579 now that '#define static' has gone away.
3580 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3581 (gray_bitmap_bits): Remove; no longer needed.
3582 All uses replaced with definiens.
3583 * xterm.c: Include "bitmaps/gray.xbm".
3584
9e4bf381
PE
35852012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 Clean up __executable_start, monstartup when --enable-profiling.
3588 The following changes affect the code only when profiling.
3589 * dispnew.c (__executable_start): Rename from safe_bcopy.
3590 Define only on platforms that need it.
3591 * emacs.c: Include <sys/gmon.h> when profiling.
3592 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3593 (__executable_start): Remove decl, since lisp.h does it now.
3594 (safe_bcopy): Remove decl; no longer has that name.
3595 (main): Coalesce #if into single bit of code, for simplicity.
3596 Cast pointers to uintptr_t, since standard libraries want integers
3597 and not pointers.
3598 * lisp.h (__executable_start): New decl.
3599
32d72c2f
GM
36002012-05-31 Glenn Morris <rgm@gnu.org>
3601
3602 * image.c (Fimagemagick_types): Doc fix.
3603
baac5bc7
JM
36042012-05-30 Jim Meyering <meyering@redhat.com>
3605
3606 * callproc.c (Fcall_process_region): Include directory component
3607 in mkstemp error message (Bug#11586).
3608
72cb32cf
PE
36092012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 * alloc.c, lisp.h (make_pure_vector): Now static.
3612
61b108cc
SM
36132012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3614
3615 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3616 Move to byte-run.el.
3617 (Fautoload): Do the hash-doc more carefully.
3618 * data.c (Fdefalias): Purify definition, except for keymaps.
3619 (Qdefun): Move from eval.c.
3620 * lisp.h (Qdefun): Remove.
3621 * lread.c (read1): Tiny simplification.
3622
471fe23d
TN
36232012-05-29 Troels Nielsen <bn.troels@gmail.com>
3624
934f3f58 3625 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
3626 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3627 Bug#9642, but explicitly check that the buffer the overlay would
3628 be moved to is live and rearrange lines to make sure that errors
3629 will not put the overlay in an inconsistent state.
3630 (Fdelete_overlay): Cosmetics.
3631
85d0efd1
EZ
36322012-05-28 Eli Zaretskii <eliz@gnu.org>
3633
3634 * w32term.c (my_bring_window_to_top): New function.
3635 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
3636 could be different from the original one.
3637 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
3638 (Bug#11513)
3639
3640 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3641 by calling BringWindowToTop.
3642
3643 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3644 (WM_EMACS_END): Increase by one.
3645
da92a98c
PE
36462012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3647
3648 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3649 This avoids undefined behavior that might cause the eassert
3650 to not catch an out-of-range value.
3651
74d1f848
JB
36522012-05-28 Juanma Barranquero <lekktu@gmail.com>
3653
3654 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3655 Update dependencies.
3656
9e1a06fc
EZ
36572012-05-27 Eli Zaretskii <eliz@gnu.org>
3658
3659 * bidi.c (bidi_mirror_char): Fix last change.
3660
f3dd7312
AS
36612012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3662
3663 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3664 when referring to sectname field in printf format.
3665
81899c91
PE
36662012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3667
57b81a9f
PE
3668 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3669 Only r_alloc_inhibit_buffer_relocation needed to be added;
3670 the others were already declared.
3671
81899c91
PE
3672 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3673 before checking whether it's out of range. Put the check inside
3674 eassert. See
3675 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3676
33017faf 36772012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
3678
3679 * callproc.c (Fcall_process): Restore a line that was accidentally
3680 commented out in the 2011-02-13 change (bug#11547).
3681
33017faf 36822012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
3683
3684 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3685 defined on ralloc.c.
3686
3687 * buffer.c [REL_ALLOC]: Remove prototypes of
3688 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3689 they are now on lisp.h.
3690
3691 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3692
3693 * search.c (search_buffer): Use it to inhibit relocation of buffer
3694 text while re_search_2 is doing its job, because re_search_2 is
3695 passed C pointers to buffer text. (Bug#11519)
3696
23415acf
EZ
3697 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3698 Update value to 24.
3699
44e27368
EZ
3700 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3701 state after an additional call to move_it_in_display_line_to, keep
3702 the values of it->max_ascent and it->max_descent found for the
3703 entire line.
3704 (pos_visible_p): Revert the comparison against bottom_y to what it
3705 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3706 (Bug#11464)
3707
c1892f11
PE
37082012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3709
3710 Fix coding-related core dumps with gcc -ftrapv.
3711 The code was computing A - B, where A and B are pointers, and B is
3712 random garbage. This can lead to core dumps on platforms that
3713 have special pointer registers, and it also leads to core dumps on
3714 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3715 A - B only when B is initialized properly.
3716 * coding.c (coding_set_source, coding_set_destination): Return void.
3717 (coding_change_source, coding_change_destinations): New functions,
3718 with the old behaviors of coding_set_source and coding_set_destination.
3719 All callers that need an offset changed to use these new functions.
3720
eb7afdad
GM
37212012-05-26 Glenn Morris <rgm@gnu.org>
3722
3723 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3724
f12fdf02
EZ
37252012-05-26 Eli Zaretskii <eliz@gnu.org>
3726
53a63be6 3727 Extend mouse support on W32 text-mode console.
61b108cc
SM
3728 * xdisp.c (draw_row_with_mouse_face):
3729 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 3730
eb3f6f01 3731 * w32console.c: Include window.h.
61b108cc
SM
3732 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3733 New functions.
eb3f6f01
EZ
3734 (initialize_w32_display): Initialize mouse-highlight data.
3735
53a63be6
EZ
3736 * w32inevt.c: Include termchar.h and window.h.
3737 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3738 moves, call note_mouse_highlight. If help_echo changed, call
3739 gen_help_event to produce help-echo message in the echo area.
3740 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3741 highlight info.
3742
4cfd81f6
PE
37432012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3744
3745 * lread.c (read1): Simplify slightly to avoid an overflow warning
3746 with GCC 4.7.0 on x86-64.
3747
4446092a
EZ
37482012-05-26 Eli Zaretskii <eliz@gnu.org>
3749
3750 * bidi.c (bidi_mirror_char): Revert last change: an int is
3751 definitely wide enough here.
3752
42b2a986 37532012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 3754
42b2a986 3755 Fix integer width and related bugs (Bug#9874).
eb106a49 3756 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
3757 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3758 (string_bytes, check_sblock, allocate_string_data):
3759 (compact_small_strings, Fmake_bool_vector, make_string)
3760 (make_unibyte_string, make_multibyte_string)
3761 (make_string_from_bytes, make_specified_string)
3762 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
3763 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
3764 (mark_vectorlike):
3765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3766 (allocate_pseudovector):
3767 Use int, not EMACS_INT, where int is wide enough.
3768 (inhibit_garbage_collection, Fgarbage_collect):
3769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3770 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
3771 int might not be wide enough.
3772 (bidi_cache_search, bidi_cache_find, bidi_init_it)
3773 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3774 (bidi_at_paragraph_end, bidi_find_paragraph_start)
3775 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
3776 (bidi_level_of_next_char, bidi_move_to_visually_next):
3777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3778 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
3779 (Fkill_buffer, Fset_buffer_major_mode)
3780 (advance_to_char_boundary, Fbuffer_swap_text)
3781 (Fset_buffer_multibyte, overlays_at, overlays_in)
3782 (overlay_touches_p, struct sortvec, record_overlay_string)
3783 (overlay_strings, recenter_overlay_lists)
3784 (adjust_overlays_for_insert, adjust_overlays_for_delete)
3785 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
3786 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
3787 (Foverlay_recenter, last_overlay_modification_hooks_used)
3788 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
3789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
3790 (validate_region): Omit unnecessary test for b <= e,
3791 since that's guaranteed by the previous test.
d311d28c
PE
3792 (adjust_overlays_for_delete): Avoid pos + length overflow.
3793 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
3794 (report_overlay_modification):
3795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3796 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
3797 Omit pointer cast, which isn't needed anyway, and doesn't work
3798 after the EMACS_INT -> ptrdiff_t change.
02481186 3799 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
3800 * buffer.h: Adjust decls to match defn changes elsewhere.
3801 (struct buffer_text, struct buffer):
3802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3803 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
3804 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
3805 not int, to avoid needless 32-bit limit on 64-bit hosts.
3806 (exec_byte_code): Use tighter memory-full test, one that checks
3807 for alloca overflow. Don't compute the address of the object just
3808 before an array, as that's not portable. Use EMACS_INT, not
3809 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
3810 * callint.c (Fcall_interactively):
3811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3812 * callproc.c (call_process_kill, Fcall_process):
3813 Don't assume pid_t fits into an Emacs fixnum.
3814 (call_process_cleanup, Fcall_process, child_setup):
3815 Don't assume pid_t fits into int.
3816 (call_process_cleanup, Fcall_process, delete_temp_file)
3817 (Fcall_process_region):
3818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3819 (Fcall_process): Simplify handling of volatile integers.
3820 Use int, not EMACS_INT, where int will do.
3821 * casefiddle.c (casify_object, casify_region, operate_on_word)
3822 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
3823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3824 (casify_object): Avoid integer overflow when overallocating buffer.
3825 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 3826 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
3827 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
3828 * category.h (CATEGORYP): Don't assume arg is nonnegative.
3829 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
3830 integers are now checked earlier. All uses replaced with XINT.
3831 (ccl_driver):
3832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3833 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
3834 (ccl_driver, Fregister_code_conversion_map):
3835 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
3836 (resolve_symbol_ccl_program): Check that vector header is in range.
3837 Always copy the vector, so that we can check its contents reliably
3838 now rather than having to recheck each instruction as it's being
3839 executed. Check that vector words fit in 'int'.
3840 (ccl_get_compiled_code, Fregister_ccl_program)
3841 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
3842 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
3843 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
3844 contents are in range.
3845 (Fccl_execute_on_string): Check that status is in range.
3846 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
3847 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
3848 Accept and return EMACS_INT, not int, because callers can pass values
3849 out of 'int' range.
3850 (c_string_width, strwidth, lisp_string_width, chars_in_text)
3851 (multibyte_chars_in_text, parse_str_as_multibyte)
3852 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
3853 (str_as_unibyte, str_to_unibyte, string_count_byte8)
3854 (string_escape_byte8, Fget_byte):
3855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 3856 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
3857 avoid mishandling large integers.
3858 * character.h: Adjust decls to match defn changes elsewhere.
3859 * charset.c (load_charset_map_from_file, find_charsets_in_text)
3860 (Ffind_charset_region):
3861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3862 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
3863 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 3864 Don't assume fixnum fits in int.
d311d28c
PE
3865 (load_charset_map_from_vector, Fmap_charset_chars):
3866 Remove now-unnecessary CHECK_NATNUMs.
3867 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
3868 Don't rely on undefined behavior with signed left shift overflow.
3869 Don't assume unsigned int fits into fixnum, or that fixnum fits
3870 into unsigned int. Don't require max_code to be a valid fixnum;
3871 that's not true for gb10830 4-byte on a 32-bit host. Allow
3872 invalid_code to be a cons, for the same reason. Require code_offset
3873 to be a character. Avoid int overflow if max_char is close
3874 to INT_MAX.
3875 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3876 this is intended anyway and avoids some undefined behavior.
3877 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3878 INDEX_TO_CODE_POINT, as that's what it expects.
3879 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
3880 * charset.h (DECODE_CHAR): Return int, not unsigned;
3881 this is what was intended anyway, and it avoids undefined behavior.
3882 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3883 integer-overflow issues.
3884 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3885 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3886 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
3887 * chartab.c (Fmake_char_table, Fset_char_table_range)
3888 (uniprop_get_decoder, uniprop_get_encoder):
3889 Don't assume fixnum fits in int.
3890 * cmds.c (move_point): New function, that does the gist of
3891 Fforward_char and Fbackward_char, but does so while checking
3892 for integer overflow more accurately.
c96e5d6a 3893 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
3894 (Fforward_line, Fend_of_line, internal_self_insert)
3895 (internal_self_insert):
3896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3897 Fix a FIXME, by checking for integer overflow when calculating
3898 target_clm and actual_clm.
3899 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 3900 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
3901 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3902 (coding_alloc_by_making_gap, alloc_destination)
3903 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3904 (encode_coding_utf_16, detect_coding_emacs_mule)
3905 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3906 (detect_coding_iso_2022, decode_coding_iso_2022)
3907 (encode_invocation_designation, encode_designation_at_bol)
3908 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3909 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3910 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3911 (encode_coding_ccl, encode_coding_raw_text)
3912 (detect_coding_charset, decode_coding_charset)
3913 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3914 (produce_composition, produce_charset, produce_annotation)
3915 (decode_coding, handle_composition_annotation)
3916 (handle_charset_annotation, consume_chars, decode_coding_gap)
3917 (decode_coding_object, encode_coding_object, detect_coding_system)
3918 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3919 (code_convert_region, code_convert_string)
8f50130c
PE
3920 (Fdefine_coding_system_internal)
3921 (coding_set_source, coding_set_destination):
d311d28c
PE
3922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3923 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3924 (Fdefine_coding_system_internal):
3925 Don't assume fixnums fit in int.
3926 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 3927 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
3928 (Funencodable_char_position, Fcheck_coding_systems_region)
3929 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 3930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 3931 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 3932 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 3933 Don't access memory outside of the args array.
d311d28c 3934 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
3935 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3936 result of ENCODE_CHAR.
d311d28c
PE
3937 * coding.h: Adjust decls to match defn changes elsewhere.
3938 (struct coding_system):
3939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3940 * composite.c (get_composition_id, find_composition)
3941 (run_composition_function, update_compositions)
3942 (compose_text, composition_gstring_put_cache)
3943 (composition_gstring_p, composition_gstring_width)
3944 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3945 (composition_compute_stop_pos, composition_reseat_it)
3946 (composition_update_it, struct position_record)
3947 (find_automatic_composition, composition_adjust_point)
3948 (Fcomposition_get_gstring, Ffind_composition_internal):
3949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3950 (update_compositions):
3951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3952 * composite.h: Adjust decls to match defn changes elsewhere.
3953 (struct composition):
3954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3955 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3956 Do not attempt to compute the address of the object just before a
3957 buffer; this is not portable.
3958 (Faref, Faset):
3959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3960 (Faset): Use int, not EMACS_INT, where int is wide enough.
3961 (Fstring_to_number): Don't assume fixnums fit in int.
3962 (Frem): Don't assume arg is nonnegative.
3963 * dbusbind.c (xd_append_arg): Check for integers out of range.
3964 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 3965 (extract_signed, extract_unsigned): New functions.
243e0530
PE
3966 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3967 (xd_get_connection_references): Return ptrdiff_t, not int.
3968 All uses changed.
3969 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3970 (xd_read_message_1):
3971 Use int, not unsigned, where the dbus API uses int.
3972 (Fdbus_message_internal): Don't overflow mtype.
3973 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
3974 * dired.c (directory_files_internal, file_name_completion, scmp)
3975 (file_name_completion_stat):
3976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3977 (file_name_completion): Don't overflow matchcount.
3978 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3979 * dispextern.h: Adjust decls to match defn changes elsewhere.
3980 (struct text_pos, struct glyph, struct bidi_saved_info)
3981 (struct bidi_string_data, struct bidi_it, struct composition_it)
3982 (struct it):
3983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3984 (struct display_pos, struct composition_it, struct it):
3985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3986 * dispnew.c (increment_matrix_positions)
3987 (increment_row_positions, mode_line_string)
3988 (marginal_area_string):
3989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 3990 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
3991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3992 (duration_to_sec_usec): New function, to check for overflow better.
3993 (Fsleep_for, sit_for): Use it.
3994 * doc.c (get_doc_string, store_function_docstring):
3995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3996 (get_doc_string, Fsnarf_documentation):
3997 Use int, not EMACS_INT, where int is wide enough.
3998 (get_doc_string):
3999 Use SAFE_ALLOCA, not alloca.
4000 Check for overflow when converting EMACS_INT to off_t.
4001 * doprnt.c (doprnt):
4002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4003 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
4004 Don't assume uid_t fits into fixnum.
4005 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
4006 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
4007 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
4008 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
4009 (general_insert_function)
4010 (Finsert_char, make_buffer_string, make_buffer_string_both)
4011 (update_buffer_properties, Fbuffer_substring)
4012 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
4013 (Fsubst_char_in_region, check_translation)
4014 (Ftranslate_region_internal, save_restriction_restore, Fformat)
4015 (transpose_markers, Ftranspose_regions):
4016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4017 (clip_to_bounds): Move to lisp.h as an inline function).
4018 (Fconstrain_to_field): Don't assume integers are nonnegative.
4019 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
4020 (Fsubst_char_in_region, Fsave_restriction):
4021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4022 (Femacs_pid): Don't assume pid_t fits into fixnum.
4023 (lo_time): Use int, not EMACS_INT, when int suffices.
4024 (lisp_time_argument): Check for usec out of range.
4025 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
4026 (Fuser_login_name, Fuser_full_name): Signal an error
4027 if a uid argument is out of range, rather than relying on
4028 undefined behavior.
c8d5c857
PE
4029 (Fformat_time_string): Remove now-unnecessary check.
4030 lisp_time_argument checks for out-of-range usec now.
243e0530 4031 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
4032 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
4033 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
4034 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
4035 (init_cmdargs, Fdump_emacs):
4036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4037 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
4038 the bottom (typically) 32 bits of the fixnum.
4039 * eval.c (specpdl_size, call_debugger):
4040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4041 (when_entered_debugger, Fbacktrace_debug):
4042 Don't assume fixnum can fit in int.
4043 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
4044 the object just before a buffer; this is not portable.
4045 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
4046 (grow_specpdl, unbind_to):
4047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4048 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
4049 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 4050 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
4051 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
4052 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
4053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4054 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
4055 (a_write, e_write):
4056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4057 (Fcopy_file, non_regular_nbytes, read_non_regular)
4058 (Finsert_file_contents):
4059 Use int, not EMACS_INT, where int is wide enough.
4060 (READ_BUF_SIZE): Verify that it fits in int.
4061 (Finsert_file_contents): Check that counts are in proper range,
4062 rather than assuming fixnums fit into ptrdiff_t etc.
4063 Don't assume fixnums fit into int.
125b3835 4064 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
4065 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
4066 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
4067 (string_char_to_byte, string_byte_to_char)
4068 (string_make_multibyte, string_to_multibyte)
4069 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
4070 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
4071 (substring_both, Fdelete, internal_equal, Ffillarray)
4072 (Fclear_string, mapcar1)
4073 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
4074 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
4075 (larger_vector, make_hash_table, maybe_resize_hash_table)
4076 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
4077 (Fmaphash, secure_hash):
4078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4079 (concat): Check for string index and length overflow.
4080 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
4081 (Frequire):
4082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4083 (larger_vector): New API (vec, incr_min, size_max) replaces old
4084 one (vec, new_size, init). This catches size overflow.
4085 INIT was removed because it was always Qnil.
4086 All callers changed.
4087 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
4088 the upper bound on a hash table index size.
4089 (make_hash_table, maybe_resize_hash_table): Use it.
4090 (secure_hash): Computer start_byte and end_byte only after
4091 they're known to be in ptrdiff_t range.
4092 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
4093 (Ffont_get_glyphs, Ffont_at):
4094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4095 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
4096 (Flist_fonts, Fopen_font):
4097 Don't assume fixnum can fit in int.
4098 (check_gstring): Don't assume index can fit in int.
4099 (font_match_p): Check that fixnum is a character, not a nonnegative
4100 fixnum, since the later code needs to stuff it into an int.
4101 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
4102 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
4103 conversion overflow issues.
4104 (Fopen_font): Check for integer out of range.
4105 (Ffont_get_glyphs): Don't assume index can fit in int.
4106 * font.h: Adjust decls to match defn changes elsewhere.
4107 * fontset.c (reorder_font_vector): Redo score calculation to avoid
4108 integer overflow.
4109 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
4110 printmax_t, where ptrdiff_t is wide enough.
4111 (Finternal_char_font):
4112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4113 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
4114 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
4115 (Fset_frame_position, x_set_frame_parameters)
4116 (x_set_line_spacing, x_set_border_width)
4117 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
4118 Check that fixnums are in proper range for system types.
4119 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
4120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4121 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
4122 Use SAFE_ALLOCA_LISP, not alloca.
4123 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
4124 intptr_t is wide enough.
4125 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
4126 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
4127 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
4128 Check for fixnum out of range.
4129 * ftfont.c (ftfont_list): Don't assume index fits in int.
4130 Check that fixnums are in proper range for system types.
4131 (ftfont_shape_by_flt):
4132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
4133 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4135 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
4136 Check that fixnums are in proper range for system types.
4137 * gnutls.h: Adjust decls to match defn changes elsewhere.
4138 * gtkutil.c (xg_dialog_run):
4139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4140 (update_frame_tool_bar):
4141 Check that fixnums are in proper range for system types.
4142 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 4143 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
4144 * indent.c (last_known_column, last_known_column_point):
4145 (current_column_bol_cache):
4146 (skip_invisible, current_column, check_display_width):
4147 (check_display_width, scan_for_column, current_column_1)
4148 (Findent_to, Fcurrent_indentation, position_indentation)
4149 (indented_beyond_p, Fmove_to_column, compute_motion):
4150 (Fcompute_motion, Fvertical_motion):
4151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4152 (last_known_column_modified): Use EMACS_INT, not int.
4153 (check_display_width):
4154 (Fcompute_motion):
4155 Check that fixnums and floats are in proper range for system types.
4156 (compute_motion): Don't assume index or fixnum fits in int.
4157 (compute_motion, Fcompute_motion):
4158 Use int, not EMACS_INT, when it is wide enough.
4159 (vmotion): Omit local var start_hpos that is always 0; that way
4160 we don't need to worry about overflow in expressions involving it.
4161 * indent.h: Adjust decls to match defn changes elsewhere.
4162 (struct position):
4163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4164 Use int, not EMACS_INT, where int is wide enough.
4165 Remove unused members ovstring_chars_done and tab_offset;
4166 all uses removed.
4167 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
4168 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
4169 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
4170 (make_gap, copy_text, insert, insert_and_inherit)
4171 (insert_before_markers, insert_before_markers_and_inherit)
4172 (insert_1, count_combining_before, count_combining_after)
4173 (insert_1_both, insert_from_string)
4174 (insert_from_string_before_markers, insert_from_string_1)
4175 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
4176 (adjust_after_replace, adjust_after_insert, replace_range)
4177 (replace_range_2, del_range, del_range_1, del_range_byte)
4178 (del_range_both, del_range_2, modify_region)
4179 (prepare_to_modify_buffer, signal_before_change)
4180 (signal_after_change, Fcombine_after_change_execute):
4181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4182 * intervals.c (traverse_intervals, rotate_right, rotate_left)
4183 (balance_an_interval, split_interval_right, split_interval_left)
4184 (find_interval, next_interval, update_interval)
4185 (adjust_intervals_for_insertion, delete_node, delete_interval)
4186 (interval_deletion_adjustment, adjust_intervals_for_deletion)
4187 (static_offset_intervals, offset_intervals)
4188 (merge_interval_right, merge_interval_left, make_new_interval)
4189 (graft_intervals_into_buffer, temp_set_point_both)
4190 (temp_set_point, set_point, adjust_for_invis_intang)
4191 (set_point_both, move_if_not_intangible, get_property_and_range)
4192 (get_local_map, copy_intervals, copy_intervals_to_string)
4193 (compare_string_intervals, set_intervals_multibyte_1):
4194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4195 * intervals.h: Adjust decls to match defn changes elsewhere.
4196 (struct interval):
4197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4198 * keyboard.c (this_command_key_count, this_single_command_key_start)
4199 (before_command_key_count, before_command_echo_length, echo_now)
4200 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
4201 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
4202 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
4203 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
4204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4205 (last_non_minibuf_size, last_point_position, echo_truncate)
4206 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
4207 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
4208 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
4209 (stuff_buffered_input):
4210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4211 (last_auto_save, command_loop_1, read_char):
4212 Use EMACS_INT, not int, to avoid integer overflow.
4213 (record_char): Avoid overflow in total_keys computation.
4214 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
4215 * keyboard.h: Adjust decls to match defn changes elsewhere.
4216 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
4217 (Fkey_description, Fdescribe_vector, Flookup_key):
4218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4219 (click_position): New function, to check that positions are in range.
4220 (Fcurrent_active_maps):
4221 (describe_command):
4222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4223 (Faccessible_keymaps, Fkey_description):
4224 (preferred_sequence_p):
4225 Don't assume fixnum can fit into int.
4226 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
4227 Check for integer overflow in size calculations.
4228 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
4229 avoid mishandling large integers.
4230 * lisp.h: Adjust decls to match defn changes elsewhere.
4231 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
4232 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
4233 (struct Lisp_Marker):
4234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4235 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
4236 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
4237 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
4238 All callers changed.
4239 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
4240 Assume the arg has valid form, since it always does.
4241 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
4242 unsigned integer system type.
4243 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
4244 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
4245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4246 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
4247 (duration_to_sec_usec): New decl.
4248 * lread.c (read_from_string_index, read_from_string_index_byte)
4249 (read_from_string_limit, readchar, unreadchar, openp)
4250 (read_internal_start, read1, oblookup):
4251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4252 (Fload, readevalloop, Feval_buffer, Feval_region):
4253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4254 (openp): Check for out-of-range argument to 'access'.
4255 (read1): Use int, not EMACS_INT, where int is wide enough.
4256 Don't assume fixnum fits into int.
6efdadfd 4257 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
4258 (read_filtered_event): Use duration_to_sec_usec
4259 to do proper overflow checking on durations.
d311d28c
PE
4260 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
4261 in size calculation.
4262 (Fexecute_kbd_macro):
4263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4264 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
4265 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
4266 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
4267 (set_marker_both, set_marker_restricted_both, marker_position)
4268 (marker_byte_position, Fbuffer_has_markers_at):
4269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4270 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 4271 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
4272 It now merely ensures that the menu is large enough, without
4273 necessarily growing it, as this avoids some integer overflow issues.
4274 All callers changed.
4275 (keymap_panes, parse_single_submenu, Fx_popup_menu):
4276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4277 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
4278 Use SAFE_ALLOCA_LISP, not alloca.
4279 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
4280 to EMACS_INT. Check that fixnums are in proper range for system types.
4281 * minibuf.c (minibuf_prompt_width, string_to_object)
4282 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
4283 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
4284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4285 (get_minibuffer, read_minibuf_unwind):
4286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4287 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
4288 this simplifies overflow checking. All callers changed.
4289 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
4290 (Ftest_completion):
4291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4292 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
4293 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
4294 Check that fixnums are in proper range for system types.
4295 (Fx_create_frame, Fx_show_tip):
4296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4297 * nsfont.m (ns_findfonts, nsfont_list_family):
4298 Don't assume fixnum fits in long.
4299 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
4300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4301 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
4302 wide enough.
17fdb222 4303 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
4304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4305 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
4306 (PRINTDECLARE, PRINTPREPARE):
4307 (strout, print_string):
4308 (print, print_preprocess, print_check_string_charset_prop)
4309 (print_object):
4310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4311 (PRINTDECLARE):
4312 (temp_output_buffer_setup, Fprin1_to_string, print_object):
4313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4314 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 4315 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 4316 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
4317 (print_error_message): Use SAFE_ALLOCA, not alloca.
4318 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
4319 (print_depth, new_backquote_output, print_number_index):
4320 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
4321 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
4322 (Fset_process_window_size, Fformat_network_address)
4323 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 4324 (sigchld_handler):
d311d28c 4325 Check that fixnums are in proper range for system types.
d44287d4 4326 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
4327 Check for process-ids out of pid_t range rather than relying on
4328 undefined behavior.
e4d81efc 4329 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
4330 (Fformat_network_address, read_process_output, send_process)
4331 (Fprocess_send_region, status_notify):
4332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4333 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
4334 (wait_reading_process_output, read_process_output, exec_sentinel):
4335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4336 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
4337 (Faccept_process_output): Use duration_to_sec_usec to do proper
4338 overflow checking on durations.
dde14581
PE
4339 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
4340 Don't assume pid_t fits in int.
02481186
PE
4341 * process.h (struct Lisp_Process): Members tick and update_tick
4342 are now of type EMACS_INT, not int.
b62b53e8
PE
4343 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
4344 configured --with-wide-int.
d311d28c
PE
4345 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
4346 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
4347 * search.c (looking_at_1, string_match_1):
4348 (fast_string_match, fast_c_string_match_ignore_case)
4349 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
4350 (scan_newline, find_before_next_newline, search_command)
4351 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
4352 (set_search_regs, wordify):
4353 (Freplace_match):
4354 (Fmatch_data):
4355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4356 (string_match_1, search_buffer, set_search_regs):
4357 (Fmatch_data):
4358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4359 (wordify): Check for overflow in size calculation.
4360 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
4361 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
4362 Check that fixnums are in proper range for system types.
4363 * sound.c (struct sound_device)
4364 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
4365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4366 (Fplay_sound_internal):
4367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 4368 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
4369 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
4370 (Fparse_partial_sexp):
4371 Don't assume fixnums can fit in int.
4372 (struct lisp_parse_state, find_start_pos, find_start_value)
4373 (find_start_value_byte, find_start_begv)
4374 (update_syntax_table, char_quoted, dec_bytepos)
4375 (find_defun_start, prev_char_comend_first, back_comment):
4376 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
4377 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
4378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4379 (Finternal_describe_syntax_value): Check that match_lisp is a
4380 character, not an integer, since the code stuffs it into int.
4381 (scan_words, scan_sexps_forward):
4382 Check that fixnums are in proper range for system types.
4383 (Fforward_word):
4384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4385 (scan_sexps_forward):
4386 Use CHARACTERP, not INTEGERP, since the value must fit into int.
4387 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4388 * syntax.h: Adjust decls to match defn changes elsewhere.
4389 (struct gl_state_s):
4390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
4391 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4392 MOST_POSITIVE_FIXNUM.
d311d28c
PE
4393 * sysdep.c (wait_for_termination_1, wait_for_termination)
4394 (interruptible_wait_for_termination, mkdir):
4395 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4396 (emacs_read, emacs_write):
4397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
4398 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4399 and double all fit in int.
d311d28c
PE
4400 * term.c (set_tty_color_mode):
4401 Check that fixnums are in proper range for system types.
4402 * termhooks.h (struct input_event):
4403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4404 * textprop.c (validate_interval_range, interval_of)
4405 (Fadd_text_properties, set_text_properties_1)
4406 (Fremove_text_properties, Fremove_list_of_text_properties)
4407 (Ftext_property_any, Ftext_property_not_all)
4408 (copy_text_properties, text_property_list, extend_property_ranges)
4409 (verify_interval_modification):
4410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4411 (Fnext_single_char_property_change)
4412 (Fprevious_single_char_property_change):
4413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
4414 (copy_text_properties):
4415 Check for integer overflow in index calculation.
d311d28c
PE
4416 * undo.c (last_boundary_position, record_point, record_insert)
4417 (record_delete, record_marker_adjustment, record_change)
4418 (record_property_change):
4419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4420 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4422 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4423 (Fx_hide_tip, Fx_file_dialog):
4424 * w32menu.c (set_frame_menubar):
4425 Use ptrdiff_t, not int, for consistency with rest of code.
4426 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4427 (select_window, Fdelete_other_windows_internal)
4428 (window_scroll_pixel_based, window_scroll_line_based)
4429 (Frecenter, Fset_window_configuration):
4430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4431 (Fset_window_hscroll, run_window_configuration_change_hook)
4432 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 4433 (Fscroll_other_window, Frecenter):
d311d28c
PE
4434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4435 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4436 Don't assume fixnum fits in int.
4437 (Fset_window_scroll_bars):
4438 Check that fixnums are in proper range for system types.
4439 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4440 (string_pos, c_string_pos, number_of_chars, init_iterator)
4441 (in_ellipses_for_invisible_text_p, init_from_display_pos)
4442 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4443 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
4444 (face_before_or_after_it_pos, handle_invisible_prop)
4445 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
4446 (display_prop_intangible_p, string_buffer_position_lim)
4447 (string_buffer_position, handle_composition_prop, load_overlay_strings)
4448 (get_overlay_strings_1, get_overlay_strings)
4449 (iterate_out_of_display_property, forward_to_next_line_start)
4450 (back_to_previous_visible_line_start, reseat, reseat_to_string)
4451 (get_next_display_element, set_iterator_to_next)
4452 (get_visually_first_element, compute_stop_pos_backwards)
4453 (handle_stop_backwards, next_element_from_buffer)
4454 (move_it_in_display_line_to, move_it_in_display_line)
4455 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4456 (add_to_log, message_dolog, message_log_check_duplicate)
4457 (message2, message2_nolog, message3, message3_nolog
4458 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4459 (current_message_1, truncate_echo_area, truncate_message_1)
4460 (set_message, set_message_1, store_mode_line_noprop)
4461 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4462 (text_outside_line_unchanged_p, check_point_in_composition)
4463 (reconsider_clip_changes)
4464 (redisplay_internal, set_cursor_from_row, try_scrolling)
4465 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4466 (redisplay_window, find_last_unchanged_at_beg_row)
4467 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4468 (trailing_whitespace_p, find_row_edges, display_line)
4469 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4470 (display_mode_element, store_mode_line_string)
4471 (pint2str, pint2hrstr, decode_mode_spec)
4472 (display_count_lines, display_string, draw_glyphs)
4473 (x_produce_glyphs, x_insert_glyphs)
4474 (rows_from_pos_range, mouse_face_from_buffer_pos)
4475 (fast_find_string_pos, mouse_face_from_string_pos)
4476 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4478 (safe_call, init_from_display_pos, handle_fontified_prop)
4479 (handle_single_display_spec, load_overlay_strings)
4480 (with_echo_area_buffer, setup_echo_area_for_printing)
4481 (display_echo_area, echo_area_display)
4482 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4483 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
4484 (redisplay_window, dump_glyph_row, display_mode_line)
4485 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 4486 (handle_display_spec, display_prop_string_p):
d311d28c
PE
4487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4488 (handle_single_display_spec, build_desired_tool_bar_string)
4489 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4490 (get_specified_cursor_type):
4491 Check that fixnums are in proper range for system types.
4492 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4493 (Flookup_image_map):
4494 Don't assume fixnums fit in int.
4495 (compare_overlay_entries):
4496 Avoid mishandling comparisons due to subtraction overflow.
4497 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4498 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4499 (handle_tool_bar_click):
4500 Use int, not unsigned, since we prefer signed and the signedness
4501 doesn't matter here.
4502 (get_next_display_element, next_element_from_display_vector):
4503 Use int, not EMACS_INT, when int is wide enough.
4504 (start_hourglass): Use duration_to_sec_usec to do proper
4505 overflow checking on durations.
4506 * xfaces.c (Fbitmap_spec_p):
4507 Check that fixnums are in proper range for system types.
4508 (compare_fonts_by_sort_order):
4509 Avoid mishandling comparisons due to subtraction overflow.
4510 (Fx_family_fonts, realize_basic_faces):
4511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4512 (Fx_family_fonts):
4513 Don't assume fixnum fits in int.
4514 Use SAFE_ALLOCA_LISP, not alloca.
4515 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4516 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4517 (face_at_buffer_position, face_for_overlay_string)
4518 (face_at_string_position):
4519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4520 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
4521 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
4522 (Fx_show_tip):
4523 Check that fixnums are in proper range for system types.
4524 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4525 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
4526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4527 (Fx_change_window_property): Don't assume fixnums fit in int.
4528 * xfont.c (xfont_chars_supported):
4529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4530 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
4531 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
4532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4533 * xml.c (parse_region):
4534 * xrdb.c (magic_file_p):
4535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4536 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
4537 (x_get_local_selection, x_reply_selection_request)
4538 (x_handle_selection_request, wait_for_property_change):
4539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4540 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
4541 short is wide enough.
4542 (x_send_client_event): Don't assume fixnum fits in int.
4543 * xterm.c (x_x_to_emacs_modifiers):
4544 Don't assume EMACS_INT overflows nicely into int.
4545 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4546 may come from Lisp.
4547 (handle_one_xevent): NATNUMP can eval its arg twice.
4548 (x_connection_closed):
4549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4550 * xterm.h: Adjust decls to match defn changes elsewhere.
4551 (struct scroll_bar): Use struct vectorlike_header
4552 rather than rolling our own approximation.
4553 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4554
c6574eb5
GM
45552012-05-25 Glenn Morris <rgm@gnu.org>
4556
4557 * lisp.mk (lisp): Update for more files being compiled now.
4558
e8d32c7e
SM
45592012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4560
48def666
SM
4561 * lread.c: Remove `read_pure' which makes no difference.
4562 (read_pure): Remove var.
4563 (unreadpure): Remove function.
4564 (readevalloop): Don't call read_list with -1 flag.
4565 (read1, read_vector): Don't test read_pure any more.
4566 (read_list): Simplify.
4567
e8d32c7e
SM
4568 * fileio.c, character.h: Minor style tweaks.
4569
4b2addb7
DA
45702012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4571
4572 * window.h (clip_changed): Remove useless declaration.
4573
584461b2
JB
45742012-05-22 Juanma Barranquero <lekktu@gmail.com>
4575
4576 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4577 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4578
34374650
PE
45792012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 Remove src/m/*.
4582 This directory predates autoconf and is no longer needed nowadays.
4583 Move its few remaining bits of functionality to where they're needed.
4584 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4585 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4586 * m/template.h: Remove.
4587 * Makefile.in (M_FILE): Remove. All uses removed.
4588 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4589 * lisp.h (USE_LSB_TAG):
4590 * mem-limits.h (EXCEEDS_LISP_PTR):
4591 Use VAL_MAX, not VALBITS, in #if.
4592 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4593 (EMACS_UINT): Define unconditionally now.
4594 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4595 (BITS_PER_EMACS_INT): New constants, replacing
4596 what used to be in config.h, but not useful in #if.
4597 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4598 define them any more.
4599 (VAL_MAX): New macro.
4600 (VALMASK): Use it.
4601 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4602 BITS_PER_EMACS_INT, in #if.
4603 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4604 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4605 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4606 * s/ms-w32.h (DATA_START):
4607 Move here from removed file m/intel386.h.
4608 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4609 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4610
261cb4bb
PE
46112012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 Assume C89 or later.
4614 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4615 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4616 (xrealloc):
4617 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4618 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4619 * textprop.c, tparam.c (NULL): Remove.
4620 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4621 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4622 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4623 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4624 * xterm.c (input_signal_count): Assume volatile works.
4625
ff23cd9f
KB
46262012-05-21 Ken Brown <kbrown@cornell.edu>
4627
4628 * xgselect.c (xg_select): Fix first argument in call to 'select'
4629 (bug#11508).
4630
1b170bc6
KB
46312012-05-20 Ken Brown <kbrown@cornell.edu>
4632
4633 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 4634 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 4635
b2f4d39f
KB
46362012-05-19 Ken Brown <kbrown@cornell.edu>
4637
4638 * xfns.c (x_in_use): Remove `static' qualifier.
4639 * xterm.h (x_in_use): Declare.
4640 * xgselect.c: Include xterm.h.
4641 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4642 and `display_arg' (bug#9754).
4643
003fdae2
PE
46442012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4645
9232a6d9
PE
4646 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4647
003fdae2
PE
4648 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4649 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4650
784b56e2
EZ
46512012-05-18 Eli Zaretskii <eliz@gnu.org>
4652
4653 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4654
4655 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 4656 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
4657
4658 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4659 reference to image_cache->refcount.
4660 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4661
a0a79cde
JL
46622012-05-17 Juri Linkov <juri@jurta.org>
4663
4664 * search.c (Fword_search_regexp, Fword_search_backward)
4665 (Fword_search_forward, Fword_search_backward_lax)
4666 (Fword_search_forward_lax): Move functions to isearch.el
4667 (bug#10145, bug#11381).
4668
b0572523
PE
46692012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4670
4671 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4672
9660f5fc
SM
46732012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4674
4675 * lread.c (init_obarray): Declare Qt and Qnil as special.
4676
4374de83
GM
46772012-05-14 Glenn Morris <rgm@gnu.org>
4678
4679 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 4680 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 4681
dc44c39a
PE
46822012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4683
078c97cb
PE
4684 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4685
dc44c39a
PE
4686 * unexaix.c: Port to more-recent AIX compilers.
4687 (report_error, report_error_1, make_hdr, copy_sym)
4688 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4689 Make arguments const char *, not char *, to avoid violations of C
4690 standard and to fix some AIX warnings reported by Gilles Pion.
4691
e18afed7 46922012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
4693
4694 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4695 already have overlays loaded.
4696 (handle_single_display_spec): Before returning without displaying
4697 fringe bitmap, synchronize the bidi iterator with the main display
4698 iterator, by calling iterate_out_of_display_property.
4699 (iterate_out_of_display_property): Detect buffer iteration by
4700 testing that it->string is a Lisp string.
4701 (get_next_display_element): When the current object is exhausted,
4702 and there's something on it->stack, call set_iterator_to_next to
4703 proceed with what's on the stack, instead of returning zero.
4704 (set_iterator_to_next): If called at the end of a Lisp string,
4705 proceed to consider_string_end without incrementing string
4706 position. Don't increment display vector index past the end of
4707 the display vector. (Bug#11417)
c8fb9dc6
EZ
4708 (pos_visible_p): Don't report a position visible when move_it_to
4709 stopped at the last line of window, which happens to be scanned
4710 backwards by the bidi iteration. (Bug#11464)
ac268e67 4711
e18afed7 47122012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
4713
4714 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4715 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
4716 are on a TTY, and thus unable to display on the fringes.
4717 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
4718 so we need to signal to the caller that this is a "replacing"
4719 display spec. This fixes display when the spec is invalid or we
4720 are on a TTY.
4721
e18afed7 47222012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
4723
4724 * unexaix.c (make_hdr): Fix typo in prototype.
4725 This bug broke the build on AIX. Problem reported by Gilles Pion.
4726
9d0a235a
MA
47272012-05-14 Michael Albinus <michael.albinus@gmx.de>
4728
4729 * keyboard.c (kbd_buffer_get_event): Read special events also in
4730 batch mode. (Bug#11415)
4731
9e6b06ed
GM
47322012-05-12 Glenn Morris <rgm@gnu.org>
4733
4734 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4735
c1a1d7a3
EZ
47362012-05-12 Eli Zaretskii <eliz@gnu.org>
4737
4738 * lisp.mk (lisp): Add newcomment.elc.
4739
3fe7cdc8
GM
47402012-05-12 Glenn Morris <rgm@gnu.org>
4741
4742 * Makefile.in (MKDIR_P): New, set by configure.
4743 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4744
53f7d2c0
PE
47452012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4746
4747 Remove unused function hourglass_started.
4748 * dispextern.h (hourglass_started):
4749 * w32fns.c (hourglass_started):
4750 * xdisp.c (hourglass_started): Remove.
4751
75aafb17
JB
47522012-05-10 Juanma Barranquero <lekktu@gmail.com>
4753
4754 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4755 Update dependencies.
4756
12959e8e
PE
47572012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4758
97107e2e
PE
4759 * xgselect.c (xg_select): Put maxfds+1 into a var.
4760 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4761
12959e8e
PE
4762 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4763
836d29b3
DA
47642012-05-10 Dave Abrahams <dave@boostpro.com>
4765
4766 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
4767 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
4768
5cb67954
MA
47692012-05-09 Michael Albinus <michael.albinus@gmx.de>
4770
4771 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4772 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
4773 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
4774 Initialize xd_registered_buses.
4775
3478ec45
PE
47762012-05-09 Paul Eggert <eggert@cs.ucla.edu>
4777
b263a6b0
PE
4778 Untag more efficiently if USE_LSB_TAG.
4779 This is based on a proposal by YAMAMOTO Mitsuharu in
4780 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
4781 For an admittedly artificial (nth 8000 longlist) benchmark on
4782 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
4783 Emacs's overall text size by 1%.
4784 * lisp.h (XUNTAG): New macro.
4785 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
4786 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
4787 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
4788 * eval.c (Fautoload):
4789 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
4790 * frame.h (XFRAME): Use XUNTAG.
4791
3478ec45
PE
4792 Port recent dbusbind.c changes to 32-bit --with-wide-int.
4793 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
4794 Remove unportable assumptions about print widths of types like
4795 dbus_uint32_t.
4796 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
4797 intptr_t when converting between pointer and integer, to avoid GCC
4798 warnings about wrong width.
4799
666b903b 48002012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
4801
4802 * w32proc.c (new_child): Force Windows to reserve only 64KB of
4803 stack for each reader_thread, instead of defaulting to 8MB
4804 determined by the linker. This avoids failures in creating
4805 subprocesses on Windows 7, see the discussion in this thread:
4806 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
4807
b120cc17
JC
48082012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
4809
4810 Fix up display of the *Minibuf-0* buffer in the mini window.
4811 * keyboard.c (read_char): Don't clear the echo area if there's no
4812 message to clear.
4813 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 4814 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 4815
9a4b36f8
MA
48162012-05-07 Michael Albinus <michael.albinus@gmx.de>
4817
4818 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
4819 batch mode.
4820
e5f9458f
CY
48212012-05-06 Chong Yidong <cyd@gnu.org>
4822
4823 * lisp.mk (lisp): Update.
4824
eceeb5fc 48252012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
4826
4827 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
4828
71873e2b
SM
48292012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4830
4831 * data.c (PUT_ERROR): New macro.
4832 (syms_of_data): Use it. Add new error type `user-error'.
4833 * undo.c (user_error): New function.
4834 (Fprimitive_undo): Use it.
4835 * print.c (print_error_message): Adjust print style for `user-error'.
4836 * keyboard.c (user_error): New function.
4837 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
4838
ab0fa4e4
PE
48392012-05-03 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 Do not limit current-time-string to years 1000..9999.
4842 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
4843 (Fcurrent_time_string): Support any year that is supported by the
4844 underlying localtime representation. Don't use asctime, as it
4845 has undefined behavior for years outside the range -999..9999.
4846
7ed806a7
PE
48472012-05-02 Paul Eggert <eggert@cs.ucla.edu>
4848
4849 Fix race conditions involving setenv, gmtime, localtime, asctime.
4850 Without this fix, interrupts could mess up code that uses these
4851 nonreentrant functions, since setting TZ invalidates existing
4852 tm_zone or tzname values, and since most of these functions return
4853 pointers to static storage.
4854 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
4855 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
4856 Grow the critical sections to include not just invoking
4857 localtime/gmtime, but also accessing these functions' results
4858 including their tm_zone values if any, and any related TZ setting.
4859 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
4860 so that the struct tm is saved in the critical section.
4861 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
4862 motivated by the fact that memory allocation needs to be outside
4863 the critical section.
4864
0c16dfed
DA
48652012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
4866
4867 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
4868 with RESET_INTERVAL.
4869
4870 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4871 Remove duplicated buffer name initialization.
4872
3f83ace8
JM
48732012-05-02 Jim Meyering <jim@meyering.net>
4874
4875 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4876
c7b8541e
JM
4877 * xfns.c (x_window): Use xstrdup (Bug#11375).
4878
90207a15 48792012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
4880
4881 * xdisp.c (pos_visible_p): If already at a newline from the
4882 display string before the 'while' loop, don't walk back the glyphs
4883 from it3.glyph_row. Solves assertion violation when the display
4884 string begins with a newline (egg.el). (Bug#11367)
4885
b593d6a9
AH
48862012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4887
4888 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4889 Move to simple.el.
4890
4737362e
GM
48912012-05-01 Glenn Morris <rgm@gnu.org>
4892
99cf43f9
GM
4893 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4894 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4895 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4896 All were removed before 23.1.
4897
9311dcff
GM
4898 * dispnew.c: Remove HAVE_LIBNCURSES test;
4899 it is always true on relevant platforms.
4900
4d5c6349
GM
4901 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4902 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4903
4737362e
GM
4904 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4905
74dd3a6b
AS
49062012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4907
4908 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4909 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4910 Remove.
4911
13c379ee
PE
49122012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 Do not avoid creating empty evaporating overlays (Bug#9642).
4915 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4916 That is, do not delete an evaporating overlay if it becomes
4917 empty after its bounds are adjusted to fit within its buffer.
4918 This fix caused other problems, and I'm reverting it until we get
4919 to the bottom of them.
4920
a8e7d6d7 49212012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
4922
4923 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4924
a8e7d6d7 49252012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
4926
4927 * xdisp.c (pos_visible_p): If the window start position is beyond
4928 ZV, start the display from buffer beginning. Prevents assertion
4929 violation in init_iterator when the minibuffer window is scrolled
4930 via the scroll bar.
4931
4932 * window.c (window_scroll_pixel_based): Likewise.
4933
a8e7d6d7 49342012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
4935
4936 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4937
a8e7d6d7 49382012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
4939
4940 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4941 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4942
a8e7d6d7 49432012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 4944
b593d6a9
AH
4945 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4946 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 4947
1c6900d9
EZ
49482012-04-26 Eli Zaretskii <eliz@gnu.org>
4949
4c3fa1d9
EZ
4950 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4951 display element, check also the underlying string or buffer
4952 character. (Bug#11341)
4953
1c6900d9
EZ
4954 * w32menu.c: Include w32heap.h.
4955 (add_menu_item): If the call to AppendMenuW (via
4956 unicode_append_menu) fails, disable Unicode menus only if we are
4957 running on Windows 9X/Me.
4958
42bf8205
AS
49592012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4960
4961 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4962 (xgetint): Add missing shift for LSB tags.
4963
b1bac16e
MR
49642012-04-24 Martin Rudalics <rudalics@gmx.at>
4965
4966 * keyboard.c (read_char): Don't wipe echo area for select window
4967 events: These might get delayed via `mouse-autoselect-window'
4968 (Bug#11304).
4969
d69621cc
JB
49702012-04-24 Juanma Barranquero <lekktu@gmail.com>
4971
4972 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4973 manipulation of :loaded-from data.
4974
02fd101b
JB
49752012-04-23 Juanma Barranquero <lekktu@gmail.com>
4976
4977 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4978 now a cons (bug#11311).
4979
888bec30
PE
49802012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4981
89a438bd
PE
4982 Do not create empty overlays with the evaporate property (Bug#9642).
4983 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4984 if it becomes empty after its bounds are adjusted to fit within
4985 its buffer. Without this fix, in a nonempty buffer (let ((o
4986 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4987 yields an empty overlay that has the evaporate property, which is
4988 not supposed to happen.
4989
1068fe4d
PE
4990 Fix minor GTK3 problems found by static checking.
4991 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4992 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4993 (struct _EmacsFixedClass, emacs_fixed_get_type):
4994 Move decls here from emacsgtkfixed.h, since they needn't be public.
4995 (emacs_fixed_get_type): Now static.
4996 (emacs_fixed_class_init): Omit unused local.
4997 (emacs_fixed_child_type): Remove; unused.
4998 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4999 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5000 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
5001 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
5002 (EMACS_FIXED_GET_CLASS): Remove; unused.
5003 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
5004
888bec30
PE
5005 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
5006 Problem reported by Juanma Barranquero for Windows -Wunused-function.
5007
de85e130
PE
50082012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5009
d0baac98 5010 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 5011 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
5012 (__malloc_size_t, __malloc_ptrdiff_t):
5013 Remove. All uses removed, replaced by the definiens if needed,
5014 since we can assume C89 or better now.
5015 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
5016 (protect_malloc_state, align, get_contiguous_space)
5017 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
5018 (malloc_atfork_handler_child, malloc_enable_thread)
5019 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
5020 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
5021 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
5022 (special_realloc, _realloc_internal_nolock, _realloc_internal)
5023 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
5024 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
5025 Define using prototypes, not old style.
5026 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
5027 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
5028 (align): Don't assume that signed integer overflow wraps around.
5029 Omit unused local var.
5030 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
5031 (_free_internal_nolock, memalign, mallochook, reallochook):
5032 Omit no-longer-needed casts.
5033 (valloc): Use getpagesize, not __getpagesize.
5034 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
5035 (struct hdr): The 'magic' member is now size_t, not unsigned long.
5036
de85e130
PE
5037 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
5038
dcbf5805
MA
50392012-04-22 Michael Albinus <michael.albinus@gmx.de>
5040
5041 Move functions from C to Lisp. Make non-blocking method calls
5042 the default. Implement further D-Bus standard interfaces.
5043
5044 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
5045 (QCdbus_request_name_allow_replacement)
5046 (QCdbus_request_name_replace_existing)
5047 (QCdbus_request_name_do_not_queue)
5048 (QCdbus_request_name_reply_primary_owner)
5049 (QCdbus_request_name_reply_in_queue)
5050 (QCdbus_request_name_reply_exists)
5051 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
5052 (QCdbus_registered_serial, QCdbus_registered_method)
5053 (QCdbus_registered_signal): New Lisp objects.
5054 (XD_DEBUG_MESSAGE): Use sizeof.
5055 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
5056 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
5057 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
5058 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
5059 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
5060 (xd_signature, xd_append_arg): Allow float for integer types.
5061 (xd_get_connection_references): New function.
b593d6a9
AH
5062 (xd_get_connection_address): Rename from xd_initialize.
5063 Return cached address.
dcbf5805
MA
5064 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
5065 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
5066 level.
5067 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 5068 Return number of refcounts.
dcbf5805
MA
5069 (Fdbus_get_unique_name): Make stronger parameter check.
5070 (Fdbus_message_internal): New defun.
5071 (Fdbus_call_method, Fdbus_call_method_asynchronously)
5072 (Fdbus_method_return_internal, Fdbus_method_error_internal)
5073 (Fdbus_send_signal, Fdbus_register_service)
5074 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
5075 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
5076 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
5077 (Vdbus_compiled_version, Vdbus_runtime_version)
5078 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
5079 (Vdbus_message_type_method_return, Vdbus_message_type_error)
5080 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
5081 (Vdbus_registered_buses, Vdbus_registered_objects_table):
5082 Adapt docstring.
dcbf5805 5083
52828e02
PE
50842012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5085
da05bc4c
PE
5086 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
5087 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
5088 Do not assume ptrdiff_t is the same width as 'int'.
5089
52828e02
PE
5090 * alloc.c: Handle unusual debugging option combinations.
5091 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5092 since the two debugging options are incompatible.
5093 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
5094 is defined.
5095 (mem_init, mem_insert, mem_insert_fixup):
5096 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
5097 (NEED_MEM_INSERT): Remove; no longer needed.
5098
f01769f9
LL
50992012-04-22 Leo Liu <sdl.web@gmail.com>
5100
5101 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
5102
5790543d
PE
51032012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5104
5105 * sysdep.c [__FreeBSD__]: Minor cleanups.
5106 (list_system_processes, system_process_attributes) [__FreeBSD__]:
5107 Use Emacs indenting style more consistently. Avoid some casts.
5108 Use 'double' consistently rather than mixing 'float' and 'double'.
5109
b91b7e4d
EW
51102012-04-21 Eduard Wiebe <usenet@pusto.de>
5111
b593d6a9
AH
5112 * sysdep.c (list_system_processes, system_process_attributes):
5113 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 5114
6114eb15
AS
51152012-04-21 Andreas Schwab <schwab@linux-m68k.org>
5116
5117 * lisp.mk (lisp): Update.
5118
2f38dff7
PE
51192012-04-20 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
5122 It is never used otherwise.
5123
4ae29f89
SM
51242012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
5125
5126 * print.c (print_preprocess): Only check print_depth if print-circle
5127 is nil.
5128 (print_object): Check for cycles even when print-circle is nil and
5129 print-gensym is t, but only check print_depth if print-circle is nil.
5130
f30d612a
CY
51312012-04-20 Chong Yidong <cyd@gnu.org>
5132
5133 * process.c (wait_reading_process_output): If EIO occurs on a pty,
5134 set the status to "failed" and ensure that sentinel is run.
5135
c07a4c0b 51362012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
5137
5138 * process.c (Fset_process_inherit_coding_system_flag)
5139 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 5140 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 5141
c07a4c0b 51422012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
5143
5144 * xdisp.c (string_buffer_position_lim): Limit starting position to
5145 BEGV.
5146 (set_cursor_from_row): If called for a mode-line or header-line
5147 row, return zero immediately.
5148 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
5149 farther than the first row after the header line, if any.
5150 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
5151 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
5152
c07a4c0b 51532012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 5154
4ae29f89
SM
5155 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
5156 (bug#11238).
ad3a2b41 5157
c07a4c0b 51582012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 51592012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
5160
5161 configure: new option --enable-gcc-warnings (Bug#11207)
5162 * Makefile.in (C_WARNINGS_SWITCH): Remove.
5163 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
5164 (ALL_CFLAGS): Use new macros rather than old.
5165 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
5166 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
5167 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
5168 -Wunused-result, -Wunused-variable. This should go away once
5169 the Emacs and Gnulib regex code is merged.
5170 (xmalloc, xrealloc): Now static.
5171
aba027e8
PE
51722012-04-17 Paul Eggert <eggert@cs.ucla.edu>
5173
5174 * dired.c (Fsystem_groups): Remove unused local.
5175
e5a36063
GM
51762012-04-17 Glenn Morris <rgm@gnu.org>
5177
5178 * dired.c (Fsystem_users): Doc fix.
5179
316411f0
DA
51802012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
5181
5182 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
5183 (syms_of_dired): Add them.
5184
9426aba4
PE
51852012-04-16 Paul Eggert <eggert@cs.ucla.edu>
5186
b62a57be
PE
5187 Fix minor alloc.c problems found by static checking.
5188 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
5189 New extern decls, to avoid calling undeclared functions.
5190 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
5191 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
5192 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
5193 (NEED_MEM_INSERT): New macro.
5194 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 5195 Remove one incorrect comment and fix another.
b62a57be 5196
3539f31f
PE
5197 Fix minor ralloc.c problems found by static checking.
5198 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5199 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
5200 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
5201 (r_alloc_sbrk): Now static.
5202
a041960a
PE
5203 Improve ralloc.c interface checking.
5204 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5205 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
5206 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
5207 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
5208 [REL_ALLOC]: ... to here, to check interface.
5209 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
5210 Remove decls. This fixes an "It stinks!".
5211
9426aba4
PE
5212 * alloc.c (which_symbols): Fix alignment issue / type clash.
5213
d55c12ed
AS
52142012-04-15 Andreas Schwab <schwab@linux-m68k.org>
5215
5216 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
5217 (struct Lisp_Misc_Any): Likewise.
5218 (struct Lisp_Free): Likewise.
5219 * alloc.c (union aligned_Lisp_Symbol): Define.
5220 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
5221 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
5222 (union aligned_Lisp_Misc): Define.
5223 (MARKER_BLOCK_SIZE, struct marker_block): Use union
5224 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 5225 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 5226
b948ce8b
PE
52272012-04-14 Paul Eggert <eggert@cs.ucla.edu>
5228
5229 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
5230 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
5231 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
5232 * s/netbsd.h, s/sol2-6.h:
5233 Remove definition of GC_MARK_STACK, since the default now works.
5234 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
5235 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
5236 no longer the default.
5237 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
5238
35dc09a1 52392012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 5240
35dc09a1
GM
5241 * lread.c (lisp_file_lexically_bound_p):
5242 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 5243
35dc09a1
GM
52442012-04-14 Eli Zaretskii <eliz@gnu.org>
5245
5246 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
5247 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
5248
52492012-04-14 Jan Djärv <jan.h.d@swipnet.se>
5250
5251 * nsterm.m (constrainFrameRect): Always constrain when there is only
5252 one screen (Bug#10962).
5253
bcd86815
KB
52542012-04-13 Ken Brown <kbrown@cornell.edu>
5255
5256 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
5257
c25df26e
RT
52582012-04-13 Reuben Thomas <rrt@sc3d.org>
5259
5260 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
5261
0fc59f1e
DC
52622012-04-11 Daniel Colascione <dancol@dancol.org>
5263
5264 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
5265 against is gone. It's better to use vfork now so that when Cygwin
5266 gains a new, working vfork, we use it automatically (bug#10398).
5267
de8c03dc
SM
52682012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5269
5270 * window.c (save_window_save): Obey window-point-insertion-type.
5271
2f097256
GM
52722012-04-11 Glenn Morris <rgm@gnu.org>
5273
5274 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
5275
453b951e
SM
52762012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5277
5278 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
5279
75f1671a 52802012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
5281
5282 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
5283 (force_quit_count): New var.
5284 (handle_interrupt): Use it.
5285
2a8ce227
JB
52862012-04-10 Juanma Barranquero <lekktu@gmail.com>
5287
5288 * w32.c (w32_delayed_load): Record the full path of the library
5289 being loaded (bug#10424).
5290
935396c0
GM
52912012-04-09 Glenn Morris <rgm@gnu.org>
5292
05920a43
GM
5293 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
5294 not just in the obarray, before snarfing them. (Bug#11036)
5295
935396c0
GM
5296 * Makefile.in ($(leimdir)/leim-list.el):
5297 Pass EMACS rather than BUILT_EMACS.
5298
a18ecafa
TZ
52992012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
5300
5301 * process.c (make_process):
5302 * process.h: Add integer `gnutls_handshakes_tried' member to
5303 process struct.
5304
6bbef4e5
JC
5305 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
5306 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
5307
5308 * gnutls.c (gnutls_log_function2i): Convenience log function.
5309 (emacs_gnutls_read): Use new log functions,
5310 `gnutls_handshakes_tried' process member, and
5311 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
5312 attempts per process (connection).
5313
b4d3bc10
CY
53142012-04-09 Chong Yidong <cyd@gnu.org>
5315
5316 * eval.c (Fuser_variable_p, user_variable_p_eh)
5317 (lisp_indirect_variable): Functions deleted.
5318 (Fdefvar): Caller changed.
5319
5320 * callint.c (Finteractive, Fcall_interactively):
5321 * minibuf.c (Fread_variable): Callers changed.
5322
70f4d973
EZ
53232012-04-09 Eli Zaretskii <eliz@gnu.org>
5324
5325 * xdisp.c (set_cursor_from_row): If the display string appears in
5326 the buffer at position that is closer to point than the position
5327 after the display string, display the cursor on the first glyph of
5328 the display string. Fixes cursor display when a 'display' text
5329 property immediately follows invisible text. (Bug#11094)
5330
cb3c2e3e
PE
53312012-04-09 Paul Eggert <eggert@cs.ucla.edu>
5332
5333 composite.c: use 'double' consistently
5334 * composite.c (get_composition_id): Use 'double' consistently
5335 instead of converting 'float' to 'double' and vice versa; this is
5336 easier to understand and avoids a GCC warning.
5337
fd06db5d
GM
53382012-04-09 Glenn Morris <rgm@gnu.org>
5339
50fe702a
GM
5340 * Makefile.in: Generate leim-list with bootstrap-emacs, in
5341 preparation for dumping it with emacs. (Bug#4789)
5342 (leimdir): New variable.
5343 ($(leimdir)/leim-list.el): New rule.
5344 (emacs$(EXEEXT)): Depend on leim-list.el.
5345
fd06db5d
GM
5346 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
5347 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
5348 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
5349
55c131ee
AS
53502012-04-08 Andreas Schwab <schwab@linux-m68k.org>
5351
5352 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
5353 proper alignment.
5354
9209588f
JB
53552012-04-07 Juanma Barranquero <lekktu@gmail.com>
5356
5357 * xml.c (init_libxml2_functions) [WINDOWSNT]:
5358 Remove unused local variable.
5359
e3fb2efb
PE
53602012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5361
5362 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
5363 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
5364 (mark_memory): Mark Lisp_Objects only if pointers might hide in
5365 objects, as mark_maybe_pointer will catch them otherwise.
5366 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
5367 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
5368
b5385551
PE
53692012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5370
5371 Fix typo that broke non-Windows builds.
5372 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
5373
9078ead6
EZ
53742012-04-07 Eli Zaretskii <eliz@gnu.org>
5375
5376 Support building on MS-Windows with libxml2.
5377
5378 * makefile.w32-in (OBJ2): Add xml.$(O).
5379 (GLOBAL_SOURCES): Add xml.c.
5380 ($(BLD)/xml.$(O)): New dependency list.
5381
5382 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5383 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5384 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5385 [!WINDOWSNT]: New macros.
5386 (init_libxml2_functions, libxml2_loaded_p): New functions.
5387 (parse_region): Call fn_xmlCheckVersion instead of using the macro
5388 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
5389 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5390 Calls xmlCleanupParser only if libxml2 was loaded (or statically
5391 linked in).
6bbef4e5
JC
5392 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5393 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
5394 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5395
5396 * emacs.c: Don't include libxml/parser.h.
5397 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5398 xmlCleanupParser directly.
5399
5400 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5401
3811fdf3
EZ
54022012-04-07 Eli Zaretskii <eliz@gnu.org>
5403
5404 * indent.c (Fvertical_motion): If there is a display string at
5405 point, use it.vpos to compute how many lines to backtrack after
5406 move_it_to point. (Bug#11133)
5407
2f8e16b2
EZ
54082012-04-06 Eli Zaretskii <eliz@gnu.org>
5409
5410 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5411 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5412 about subtle differences between FETCH_CHAR* and STRING_CHAR*
5413 macros related to unification of CJK characters. For the details,
5414 see the discussion following the message here:
5415 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5416
3d439cd1
CY
54172012-04-04 Chong Yidong <cyd@gnu.org>
5418
5419 * keyboard.c (Vdelayed_warnings_list): Doc fix.
5420
8bc53d00
EZ
54212012-04-01 Eli Zaretskii <eliz@gnu.org>
5422
5423 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5424 instead of alloca. (Bug#11138)
5425
3b0512a3
AS
54262012-04-01 Andreas Schwab <schwab@linux-m68k.org>
5427
5428 * w32menu.c (is_simple_dialog): Properly check lisp types.
5429 (Bug#11141)
5430
8427ddd2
EZ
54312012-03-31 Eli Zaretskii <eliz@gnu.org>
5432
979022ef
EZ
5433 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5434 position we get to after a call to move_it_to fails the
5435 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5436 only if we wind up in a string from display property. (Bug#11063)
5437
a6b1c7cc
EZ
5438 * window.c (Fdelete_other_windows_internal): Invalidate the row
5439 and column information about mouse highlight, so that redisplay
5440 restores it after reallocating the glyph matrices. (Bug#7464)
5441
8427ddd2
EZ
5442 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5443 string comes from a `display' text property, use the buffer
5444 position of that property as if we actually saw that position in
5445 the row's glyphs.
697ba24b
EZ
5446 (move_it_by_lines): Remove the assertion that
5447 "it->current_x == 0 && it->hpos == 0" which can be legitimately
5448 violated when there's a before-string at the beginning of a line.
5449 (Bug#11063)
8427ddd2 5450
65a0a738
EZ
54512012-03-30 Eli Zaretskii <eliz@gnu.org>
5452
5453 * xdisp.c (append_space_for_newline): If the default face was
5454 remapped, use the remapped face for the appended newline.
5455 (extend_face_to_end_of_line): Use the remapped default face for
5456 extending the face to the end of the line.
5457 (display_line): Call extend_face_to_end_of_line when the default
5458 face was remapped. (Bug#11068)
5459
581355cc
EZ
54602012-03-29 Eli Zaretskii <eliz@gnu.org>
5461
5462 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5463
e8fc049f
SM
54642012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5465
5466 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5467
4fb9a543
GM
54682012-03-27 Glenn Morris <rgm@gnu.org>
5469
5470 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5471 Doc fixes.
5472
679910f1
KH
54732012-03-26 Kenichi Handa <handa@m17n.org>
5474
5475 * dispextern.h (struct glyph): Fix previous change. Change the
5476 bit length of glyphless.ch to 25 (Bug#11082).
5477
90d49b7f
CY
54782012-03-26 Chong Yidong <cyd@gnu.org>
5479
5480 * keyboard.c (Vselection_inhibit_update_commands): New variable.
5481 (command_loop_1): Use it; inhibit selection update for
5482 handle-select-window too (Bug#8996).
5483
f514f6f0
FP
54842012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
5485
e8fc049f 5486 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 5487
bf43fa51
KH
54882012-03-25 Kenichi Handa <handa@m17n.org>
5489
5490 * dispextern.h (struct glyph): Change the bit length of
5491 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5492
8a0c01dd
EZ
54932012-03-24 Eli Zaretskii <eliz@gnu.org>
5494
5495 * s/ms-w32.h (tzname): Include time.h before redirecting to
5496 _tzname. Fixes the MSVC build. (Bug#9960)
5497
7d1c3a76
AS
54982012-03-24 Andreas Schwab <schwab@linux-m68k.org>
5499
8ed79523
AS
5500 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5501 characters.
5502
7d1c3a76
AS
5503 * xterm.c (XTread_socket): Only modify handling_signal if
5504 !SYNC_INPUT. (Bug#11080)
5505
e99a9b8b
EZ
55062012-03-23 Eli Zaretskii <eliz@gnu.org>
5507
5508 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5509 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
5510 when fetching a multibyte character consumes more bytes than
5511 CHAR_BYTES returns, due to unification of CJK characters in
5512 string_char. (Bug#11073)
5513
5063c0e1
TN
55142012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
5515
5516 * process.c (wait_reading_process_output): Handle pty disconnect
5517 by refraining from sending oneself a SIGCHLD (bug#10933).
5518
9f851fbd
CY
55192012-03-22 Chong Yidong <cyd@gnu.org>
5520
5521 * dispextern.h (struct it): New member string_from_prefix_prop_p.
5522
5063c0e1 5523 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
5524 Mark string as coming from a prefix property.
5525 (handle_face_prop): Use default face for prefix strings (Bug#4281).
5526 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
5527
fb5b8aca
CY
55282012-03-21 Chong Yidong <cyd@gnu.org>
5529
5530 * xfaces.c (Vface_remapping_alist): Doc fix.
5531
62356a1b
EZ
55322012-03-20 Eli Zaretskii <eliz@gnu.org>
5533
5534 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
5535 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
5536 Doc fixes.
62356a1b 5537
025de85b
CY
55382012-03-20 Chong Yidong <cyd@gnu.org>
5539
5540 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
5541 to reflect default non-nil value of redisplay-dont-pause.
5542
4827f94e
KH
55432012-03-19 Kenichi Handa <handa@m17n.org>
5544
5545 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5546 it fit in a valid range (Bug#11003).
5547
e50a24a2
EZ
55482012-03-18 Eli Zaretskii <eliz@gnu.org>
5549
5550 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5551 that is not from display property, accept the row as a "cursor
5552 row" if one of the string's character has a non-nil `cursor'
5553 property. Fixes cursor positioning when there are newlines in
5554 overlay strings, e.g. in icomplete.el. (Bug#11035)
5555
9af5ed87
PE
55562012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5557
5558 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5559
d1f55f16
CY
55602012-03-12 Chong Yidong <cyd@gnu.org>
5561
5562 * eval.c (inhibit_lisp_code): Rename from
5563 inhibit_window_configuration_change_hook; move from window.c.
5564
5565 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5566 * window.c (run_window_configuration_change_hook)
5567 (syms_of_window): Callers changed.
5568
66c5eebd
CY
55692012-03-11 Chong Yidong <cyd@gnu.org>
5570
413df973
CY
5571 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5572
66c5eebd
CY
5573 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5574
1de11f56
CY
55752012-03-10 Chong Yidong <cyd@gnu.org>
5576
5577 * frame.c (other_visible_frames): Don't assume the selected frame
5578 is visible (Bug#10955).
5579
cae07000
SM
55802012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5581
5582 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5583
89c94350
JD
55842012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5585
5586 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5587 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5588 zero (Bug#10954).
5589
999dd333
GM
55902012-03-03 Glenn Morris <rgm@gnu.org>
5591
01a6dcc8 5592 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 5593
de0100f2
EZ
55942012-03-02 Eli Zaretskii <eliz@gnu.org>
5595
5596 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5597 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
5598 (redisplay_window, next_element_from_string): Fix typos in
5599 comments.
3e441275
EZ
5600 (redisplay_window): Pass to move_it_vertically the margin in
5601 pixels, not in screen lines.
de0100f2 5602
96a72ee9
GM
56032012-03-02 Glenn Morris <rgm@gnu.org>
5604
5605 * buffer.c (buffer-list-update-hook): Doc fix.
5606
312508d7
EZ
56072012-02-29 Eli Zaretskii <eliz@gnu.org>
5608
5609 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5610 push_it before setting up the iterator for the first overlay
5611 string, even if we have an empty string loaded.
5612 (next_overlay_string): If there's an empty string on the iterator
5613 stack, pop the stack. (Bug#10903)
5614
27f3c637
PE
56152012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5616
5617 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5618 Suggested by Stefan Monnier in
5619 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5620 * alloc.c (widen_to_Lisp_Object): New static function.
5621 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5622 and widening them to Lisp_Objects. This would work even if
5623 USE_LSB_TAG is defined and wide integers are used, which might
5624 happen in a future version of Emacs.
5625
3c9dfce6
CY
56262012-02-25 Chong Yidong <cyd@gnu.org>
5627
fa74b241
CY
5628 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5629 Doc fix.
5630
3c9dfce6
CY
5631 * xselect.c (Fx_selection_exists_p): Doc fix.
5632 (x_clipboard_manager_save_all): Print an informative message
5633 before saving to clipboard manager.
5634
9486df08
CY
56352012-02-24 Chong Yidong <cyd@gnu.org>
5636
5637 * keyboard.c (process_special_events): Handle all X selection
5638 requests in kbd_buffer, not just the next one (Bug#8869).
5639
f01d3321
CY
56402012-02-23 Chong Yidong <cyd@gnu.org>
5641
5642 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5643 call when setting menu-bar-lines and tool-bar-lines parameters.
5644 (unwind_create_frame_1): New helper function.
5645
5646 * window.c (inhibit_window_configuration_change_hook): New var.
5647 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 5648 (syms_of_window): Initialize it.
f01d3321 5649
86b847b6
CY
56502012-02-22 Chong Yidong <cyd@gnu.org>
5651
5652 * xterm.c (x_draw_image_relief): Add missing type check for
5653 Vtool_bar_button_margin (Bug#10743).
5654
a59225b1
CY
56552012-02-21 Chong Yidong <cyd@gnu.org>
5656
5657 * fileio.c (Vfile_name_handler_alist): Doc fix.
5658
5659 * buffer.c (Fget_file_buffer): Protect against invalid file
5660 handler return value.
5661
310f5bd4
PE
56622012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5663
cb3a28cc
PE
5664 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5665 when computing $valmask.
5666
310f5bd4
PE
5667 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5668 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5669 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5670 It's useless in that case, and it can cause problems on hosts
5671 that allocate halves of EMACS_INT values separately.
5672 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5673 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5674 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5675 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5676 it avoids undefined behavior on hosts where shifting right by more
5677 than the word width has undefined behavior.
5678
2375c96a
CY
56792012-02-19 Chong Yidong <cyd@gnu.org>
5680
5681 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5682 (Funhandled_file_name_directory, Ffile_name_as_directory)
5683 (Fdirectory_file_name, Fexpand_file_name)
5684 (Fsubstitute_in_file_name): Protect against invalid file handler
5685 return values (Bug#10845).
5686
3eb49e71
EZ
56872012-02-18 Eli Zaretskii <eliz@gnu.org>
5688
5689 * .gdbinit (pitx): Fix incorrect references to fields of the
5690 iterator stack.
5691
7b926f3f
CY
56922012-02-17 Chong Yidong <cyd@gnu.org>
5693
5694 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5695
11273115
PE
56962012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5697
5698 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5699 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5700
c3a70e2b
CY
57012012-02-15 Chong Yidong <cyd@gnu.org>
5702
5703 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5704 marked as special. Also, starting docstrings with * is obsolete.
5705
0ca43699
AS
57062012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5707
5708 * gnutls.c (emacs_gnutls_write): Fix last change.
5709
2e8f3c56
LI
57102012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5711
5712 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5713 send_process.
5714
af70074f
SM
57152012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5716
5717 * keymap.c (Fsingle_key_description): Handle char ranges.
5718
95986d52
CY
57192012-02-12 Chong Yidong <cyd@gnu.org>
5720
afd83bd1
CY
5721 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5722 as that creates a dangerous corner case.
5723
95986d52
CY
5724 * window.c (Fdelete_window_internal): Invalidate the mouse
5725 highlight (Bug#9904).
5726
bd7da63e
GM
57272012-02-12 Glenn Morris <rgm@gnu.org>
5728
5729 * xselect.c (Fx_own_selection_internal)
5730 (Fx_get_selection_internal, Fx_disown_selection_internal)
5731 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5732 * nsselect.m (Fx_own_selection_internal)
5733 (Fx_disown_selection_internal, Fx_selection_exists_p)
5734 (Fx_selection_owner_p, Fx_get_selection_internal):
5735 Sync docs and argument specs with the xselect.c versions.
5736
77abcbc2
LI
57372012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5738
5739 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5740
90b671e2
EZ
57412012-02-11 Eli Zaretskii <eliz@gnu.org>
5742
1c0ca0b7
EZ
5743 * w32select.c (Fx_selection_exists_p): Sync doc string and
5744 argument list with xselect.c. (Bug#10783)
5745
5746 * w16select.c (Fx_selection_exists_p): Sync doc string and
5747 argument list with xselect.c. (Bug#10783)
90b671e2 5748
49241268
GM
57492012-02-10 Glenn Morris <rgm@gnu.org>
5750
5751 * fns.c (Fsecure_hash): Doc fix.
5752
f998bbe7 57532012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
5754
5755 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5756
0992bd9c
CY
57572012-02-07 Chong Yidong <cyd@gnu.org>
5758
5759 * buffer.c (Fbuffer_local_variables)
5760 (buffer_lisp_local_variables): Handle unbound vars correctly;
5761 don't let Qunbound leak into Lisp.
5762
af008560
GM
57632012-02-07 Glenn Morris <rgm@gnu.org>
5764
dd605cc4
GM
5765 * image.c (Fimagemagick_types): Doc fix.
5766
af008560
GM
5767 * image.c (imagemagick-render-type): Change it from a lisp object
5768 to an integer. Move the doc here from the lisp manual.
5769 Treat all values not equal to 0 the same.
5770
1449fa1d
CY
57712012-02-06 Chong Yidong <cyd@gnu.org>
5772
5773 * doc.c (store_function_docstring): Avoid applying docstring of
5774 alias to base function (Bug#2603).
5775
3723ec07
AS
57762012-02-04 Andreas Schwab <schwab@linux-m68k.org>
5777
5778 * .gdbinit (pp1, pv1): Remove redundant defines.
5779 (pr): Use pp.
5780
79c1cc1e
CY
57812012-02-04 Chong Yidong <cyd@gnu.org>
5782
5783 * nsterm.m: Declare a global (Bug#10694).
5784
d7f29f8e
EZ
57852012-02-04 Eli Zaretskii <eliz@gnu.org>
5786
cae07000
SM
5787 * w32.c (get_emacs_configuration_options):
5788 Include --enable-checking, if specified, in the return value.
d7f29f8e 5789
3b95a6f9
MR
57902012-02-04 Martin Rudalics <rudalics@gmx.at>
5791
5792 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
5793 after rounding frame sizes. (Bug#9723)
5794
d6fa96a6
EZ
57952012-02-04 Eli Zaretskii <eliz@gnu.org>
5796
5797 * keyboard.c (adjust_point_for_property): Don't position point
5798 before BEGV. (Bug#10696)
5799
df0b2940
PE
58002012-02-03 Paul Eggert <eggert@cs.ucla.edu>
5801
5802 Handle overflow when computing char display width (Bug#9496).
5803 * character.c (char_width): Return EMACS_INT, not int.
5804 (char_width, c_string_width): Check for overflow when
5805 computing the width; this is possible now that individual
5806 characters can have unbounded width. Problem introduced
5807 by merge from Emacs 23 on 2012-01-19.
5808
6bee44d6
MA
58092012-02-02 Michael Albinus <michael.albinus@gmx.de>
5810
5811 * dbusbind.c (Fdbus_register_method): Mention the return value
5812 :ignore in the docstring.
5813
44f92739
GM
58142012-02-02 Glenn Morris <rgm@gnu.org>
5815
1b9f60cc
GM
5816 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
5817
44f92739
GM
5818 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5819 Unconditionally set to t. (Bug#10673)
5820 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5821 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5822 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
5823
c5d3843c
KH
58242012-02-02 Kenichi Handa <handa@m17n.org>
5825
5826 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
5827 0, do not call append_composite_glyph.
5828
159462d4 58292012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
5830
5831 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
5832 NULL (Bug#6988).
5833 (x_produce_glyphs): If the component of a composition is a null
5834 string, set it->pixel_width to 1 to avoid zero-width glyph.
5835
78cef877
EZ
58362012-02-01 Eli Zaretskii <eliz@gnu.org>
5837
5838 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
5839 first 2 arguments are identical. This makes inserting large
5840 output from a subprocess an order of magnitude faster on
5841 MS-Windows, where all sbrk'ed memory is always contiguous.
5842
97897668
GM
58432012-01-31 Glenn Morris <rgm@gnu.org>
5844
5845 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 5846 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
5847 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
5848
31fd3586
GM
58492012-01-29 Glenn Morris <rgm@gnu.org>
5850
5851 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
5852
0e24a8b2
CY
58532012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
5854
5855 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
5856
cc0adcb0
CY
58572012-01-28 Chong Yidong <cyd@gnu.org>
5858
5859 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
5860
acc28cb9
CY
58612012-01-26 Chong Yidong <cyd@gnu.org>
5862
9c69cfb7
CY
5863 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
5864
acc28cb9
CY
5865 * search.c (Fsearch_forward, Fsearch_backward): Document negative
5866 repeat counts (Bug#10507).
5867
48da7392
GM
58682012-01-26 Glenn Morris <rgm@gnu.org>
5869
5870 * lread.c (syms_of_lread): Doc fix.
5871
14af5f7f
CY
58722012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5873
5874 * coding.c (encode_designation_at_bol): Change return value to
5875 EMACS_INT.
5876
0b21c100
CY
58772012-01-25 Chong Yidong <cyd@gnu.org>
5878
5879 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5880
3c2907f7
CY
58812012-01-21 Chong Yidong <cyd@gnu.org>
5882
5883 * floatfns.c (Fcopysign): Make the second argument non-optional,
5884 since nil is not allowed anyway.
5885
959ad23f
AS
58862012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5887
5888 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5889 (send_process): Likewise.
5890
34a02f46
MR
58912012-01-19 Martin Rudalics <rudalics@gmx.at>
5892
5893 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
5894 (Vwindow_persistent_parameters): Do not use Qstate.
5895 Rewrite doc-strings.
34a02f46 5896
1259009a 58972012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
5898
5899 * character.c (char_width): New function.
70d4fdf6
GM
5900 (Fchar_width, c_string_width, lisp_string_width):
5901 Use char_width (Bug#9496).
25ed9e61 5902
6a6ee00d
MR
59032012-01-16 Martin Rudalics <rudalics@gmx.at>
5904
5905 * window.c (Vwindow_persistent_parameters): New variable.
5906 (Fset_window_configuration, save_window_save): Handle persistent
5907 window parameters.
5908
c85efaf7
EZ
59092012-01-14 Eli Zaretskii <eliz@gnu.org>
5910
5911 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5912 thrashing the stack of the thread. (Bug#9087)
5913
5944709e
PE
59142012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5915
5916 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5917
e71f5d99
EZ
59182012-01-11 Eli Zaretskii <eliz@gnu.org>
5919
5920 * xdisp.c (rows_from_pos_range): Handle the case where the
5921 highlight ends on a newline. (Bug#10464)
5922 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5923 he end column for display of highlight that ends on a newline
5924 before a R2L line.
5925
ce316182
GM
59262012-01-11 Glenn Morris <rgm@gnu.org>
5927
5928 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5929 from load-path also when installation-directory is nil. (Bug#10208)
5930
5b43da69
GM
59312012-01-10 Glenn Morris <rgm@gnu.org>
5932
74cc8ff9
GM
5933 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5934
7d8d6e4e
GM
5935 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5936 Update template values to be closer to their typical values these days.
5b43da69 5937
a0db8d43
EZ
59382012-01-09 Eli Zaretskii <eliz@gnu.org>
5939
5940 * xdisp.c (rows_from_pos_range): Accept additional argument
5941 DISP_STRING, and accept any glyph in a row whose object is that
5942 string as eligible for mouse highlight. Fixes mouse highlight of
5943 display strings from overlays. (Bug#10464)
5944
9a0115ab 59452012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 5946
b9110d6a 5947 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
5948 * fileio.c (auto_saving_dir_umask): New static var.
5949 (Fmake_directory_internal): Use it.
5950 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5951 creating the directory. The old code temporarily assigns
5952 too-generous permissions to the directory.
5953 (do_auto_save_eh): Clear it.
b9110d6a 5954 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
5955 that the var is always cleared.
5956
6c1bd3f3
EZ
59572012-01-07 Eli Zaretskii <eliz@gnu.org>
5958
5959 * search.c (scan_buffer): Pass character positions to
5960 know_region_cache, not byte positions. (Bug#6540)
5961
069d2b50
L
59622012-01-07 LynX <_LynX@bk.ru> (tiny change)
5963
5964 * w32.c (sys_rename): Report EXDEV when rename of a directory
5965 fails because the target is on another logical disk. (Bug#10284)
5966
75bf0d33
DB
59672012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5968
5969 * xterm.c (x_embed_request_focus): New function.
5970
5971 * xterm.h: Add prototype.
5972
5973 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5974
1c6e5a32
GM
59752012-01-05 Glenn Morris <rgm@gnu.org>
5976
5977 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5978
651e947e
EZ
59792012-01-01 Eli Zaretskii <eliz@gnu.org>
5980
5981 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5982 Load gnutls_transport_set_lowat only if GnuTLS version is below
5983 2.11.1.
5984 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5985 GnuTLS versions below 2.11.1.
5986
3778cdd8
AL
59872011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5988
5989 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5990 to the doc string advising against its use for altering the way
5991 windows are scrolled.
5992
0e5317f7
KH
59932011-12-28 Kenichi Handa <handa@m17n.org>
5994
5995 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
5996 coding-system ASCII compatible only when it does not produce BOM
5997 on encoding (Bug#10383).
5998
93d5ca1f
JD
59992011-12-26 Jan Djärv <jan.h.d@swipnet.se>
6000
6001 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
6002 can scroll.
6003 (create_and_show_popup_menu): Always use menu_position_func for
6004 Gtk3 (Bug#10361).
6005
ca22b785
AS
60062011-12-24 Andreas Schwab <schwab@linux-m68k.org>
6007
6008 * callint.c (Fcall_interactively): Don't truncate prompt string.
6009
d048e1e6
EZ
60102011-12-23 Eli Zaretskii <eliz@gnu.org>
6011
6012 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
6013 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 6014 resumed from there (after widening). (Bug#10360)
d048e1e6 6015
5ccaba1f
JD
60162011-12-22 Jan Djärv <jan.h.d@swipnet.se>
6017
6018 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
6019
204ee57f
JD
60202011-12-21 Jan Djärv <jan.h.d@swipnet.se>
6021
b81d40f0
JB
6022 * nsterm.m (x_free_frame_resources):
6023 Release f->output_data.ns->miniimage.
204ee57f
JD
6024 (ns_index_color): Fix indentation. Do not retain
6025 color_table->colors[i].
6026
6027 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
6028 before returning.
6029
6030 * nsfns.m (x_set_background_color): Assign return value from
6031 ns_index_color to face-background instead of NSColor*.
6032 (ns_implicitly_set_icon_type): Fix indentation.
6033 Change assignment in for loop to comparison.
6034
6035 * emacs.c (ns_pool): New variable.
6036 (main): Assign ns_pool.
6037 (Fkill_emacs): Call ns_release_autorelease_pool.
6038
6039 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
6040 autorelease fdesc, release fdAttrs and tdict.
6041 (ns_get_covering_families): Release charset.
6042 (ns_findfonts): Release NSFontDescriptor created with new.
6043 (ns_uni_to_glyphs): Fix indentation.
6044 (setString): Release attrStr before assigning new value.
6045
c803b2b7
JD
60462011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6047
678f4426
JD
6048 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
6049 and NS_IMPL_COCOA.
6050 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
6051 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
6052
cd394be1 60532011-12-18 David Reitter <reitter@cmu.edu>
678f4426 6054
5fecd5fc
JD
6055 * nsterm.m (ns_term_init): Subscribe for notifications
6056 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
6057 to method trackingNotification in EmacsMenu.
6058
6059 * nsmenu.m (trackingMenu): New variable.
3771cb17 6060 (trackingNotification): New method (from Aquamacs).
5fecd5fc 6061 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 6062 from Aquamacs (Bug#7030).
678f4426
JD
6063
60642011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 6065
c803b2b7
JD
6066 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
6067 (symbol_to_nsstring): Fix indentation.
6068 (ns_symbol_to_pb): New function.
cae07000
SM
6069 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
6070 (Fns_rotate_cut_buffers_internal): Remove.
6071 (Fns_store_selection_internal): Rename from
c803b2b7
JD
6072 Fns_store_cut_buffer_internal.
6073 (ns_get_foreign_selection, Fx_own_selection_internal)
6074 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
6075 (Fns_get_selection_internal, Fns_store_selection_internal):
6076 Use ns_symbol_to_pb and check if return value is nil.
6077 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
6078 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
6079 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
6080 renamed to Sns_store_selection_internal.
6081 (ns_handle_selection_request): Move code to Fx_own_selection_internal
6082 and remove this function.
6083 (ns_handle_selection_clear): Remove, never used.
6084 (Fx_own_selection_internal): Move code from ns_handle_selection_request
6085 here.
6086
e1b01a3a
KB
60872011-12-17 Ken Brown <kbrown@cornell.edu>
6088
6089 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
6090 GID is unknown (Bug#10257).
6091
2adb6e85
PE
60922011-12-17 Paul Eggert <eggert@cs.ucla.edu>
6093
6094 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
6095 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
6096 which caused a build failure on GNU/Linux IA-64. This problem was
6097 introduced by my 2011-10-07 patch.
6098
d1d7b339
JL
60992011-12-15 Juri Linkov <juri@jurta.org>
6100
6101 * image.c (imagemagick_error): New function. (Bug#10112)
6102 (imagemagick_load_image): Comment out `MagickSetResolution' call.
6103 Use `imagemagick_error' where ImageMagick functions return
6104 `MagickFalse'.
6105 (Fimagemagick_types): Add `Fnreverse' to return the list in the
6106 proper order.
6107
100d5755
KH
61082011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6109
6110 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
6111 fill background (Bug#8992).
6112
454592a6
MR
61132011-12-13 Martin Rudalics <rudalics@gmx.at>
6114
6115 * window.c (Vwindow_combination_resize)
6116 (Vwindow_combination_limit): Use t instead of non-nil in
6117 doc-strings.
61d4b438
MR
6118 (Vrecenter_redisplay): Add first sentence of doc-string on
6119 separate line.
53524d93 6120 (Frecenter): Fix doc-string typo.
454592a6 6121
3633e3aa
KH
61222011-12-11 Kenichi Handa <handa@m17n.org>
6123
6124 * coding.c (Funencodable_char_position): Pay attention to the
6125 buffer text relocation (Bug#9389).
6126
7b9d523a 61272011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 6128
7b9d523a
JD
6129 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
6130 gtk_init (Bug#10100).
6131
b73189c6
EZ
61322011-12-10 Eli Zaretskii <eliz@gnu.org>
6133
6134 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
6135 IT->string is nil. (Bug#10263)
6136
f7dfe5d6
JD
61372011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6138
83faebb4
JD
6139 * nsterm.h (x_free_frame_resources): Declare.
6140
f7dfe5d6
JD
6141 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
6142 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
6143
6144 * nsterm.h (ns_get_defaults_value): Declare.
6145
6146 * nsterm.m (ns_default): Call ns_get_defaults_value.
6147
7cd4e72c
EZ
61482011-12-09 Eli Zaretskii <eliz@gnu.org>
6149
6150 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
6151 (Bug#10170)
6152
b34d7317
YM
61532011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6154
6155 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
6156 that where the value of an _OBJC_* symbol points to is in the .bss
6157 section (Bug#10240).
6158
76470ad1
KH
61592011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6160
6161 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 6162 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 6163
745fff94
KH
61642011-12-08 Kenichi Handa <handa@m17n.org>
6165
6166 * ftfont.c (get_adstyle_property): Fix previous change
6167 (Bug#10233).
6168
6e44397c
JB
61692011-12-07 Juanma Barranquero <lekktu@gmail.com>
6170
6171 * w32.c (init_environment): If no_site_lisp, remove site-lisp
6172 dirs from the default value of EMACSLOADPATH (bug#10208).
6173
7efa6272
GM
61742011-12-07 Glenn Morris <rgm@gnu.org>
6175
6176 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
6177 installation and source directories as well. (Bug#10208)
6178
f6fc4d87
CY
61792011-12-06 Chong Yidong <cyd@gnu.org>
6180
6181 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
6182
2bf26180
GM
61832011-12-06 Glenn Morris <rgm@gnu.org>
6184
6185 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
6186 as an error, not just -1. (Bug#10217)
6187
3a6ad4f0
CY
61882011-12-05 Chong Yidong <cyd@gnu.org>
6189
6190 * keyboard.c (process_special_events): New function.
6191 (swallow_events, Finput_pending_p): Use it (Bug#10195).
6192
75a3b399
PE
61932011-12-05 Paul Eggert <eggert@cs.ucla.edu>
6194
6195 * coding.c (encode_designation_at_bol): Don't use uninitialized
6196 local variable (Bug#9318).
6197
c3c9e25e
KH
61982011-12-05 Kenichi Handa <handa@m17n.org>
6199
6200 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
6201 return Qnil (Bug#8046, Bug#10193).
6202
5eb05ea3
KH
62032011-12-05 Kenichi Handa <handa@m17n.org>
6204
6205 * coding.c (encode_designation_at_bol): New args charbuf_end and
6206 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
6207 (coding_set_source): Return how many bytes coding->source was
6208 relocated.
6209 (coding_set_destination): Return how many bytes
6210 coding->destination was relocated.
6211 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 6212 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
6213
62142011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6215
6216 * coding.c (CODING_CHAR_CHARSET_P): New macro.
6217 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
6218 macro (Bug#9318).
6219
62202011-12-05 Andreas Schwab <schwab@linux-m68k.org>
6221
6222 The following changes are to fix Bug#9318.
6223
a79703f5 6224 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
6225 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
6226 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 6227 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 6228
7dbda6df
JB
62292011-12-05 Juanma Barranquero <lekktu@gmail.com>
6230
6231 * lisp.h (process_quit_flag): Fix external declaration.
6232
6d5eb5b0
SM
62332011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
6234
6235 Don't macro-inline non-performance-critical code.
6236 * eval.c (process_quit_flag): New function.
6237 * lisp.h (QUIT): Use it.
6238
a0c3fad0
JD
62392011-12-04 Jan Djärv <jan.h.d@swipnet.se>
6240
6241 * nsfns.m (get_geometry_from_preferences): New function.
6242 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
6243
6c07aac2
AS
62442011-12-04 Andreas Schwab <schwab@linux-m68k.org>
6245
6246 * emacs.c (Qkill_emacs): Define.
6247 (syms_of_emacs): Initialize it.
6248 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
6249 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
6250 (quit_throw_to_read_char): Add parameter `from_signal'.
6251 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
6252 * lisp.h (QUIT): Call Fkill_emacs if requested.
6253
c052ead4
JD
62542011-12-03 Jan Djärv <jan.h.d@swipnet.se>
6255
6256 * widget.c (update_wm_hints): Return if wmshell is null.
6257 (widget_update_wm_size_hints): New function.
6258
6259 * widget.h (widget_update_wm_size_hints): Declare.
6260
6261 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
6262 widget_update_wm_size_hints (Bug#10104).
6263
9e49252b
EZ
62642011-12-03 Eli Zaretskii <eliz@gnu.org>
6265
6266 * xdisp.c (handle_invisible_prop): If the invisible text ends just
6267 before a newline, prepare the bidi iterator for consuming the
6268 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 6269 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 6270
02b16839
JL
62712011-12-02 Juri Linkov <juri@jurta.org>
6272
6273 * search.c (Fword_search_regexp): New Lisp function created from
6274 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
6275 (Fword_search_backward, Fword_search_forward)
6276 (Fword_search_backward_lax, Fword_search_forward_lax):
6277 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
6278 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
6279
0068070e
SM
62802011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
6281
6282 * fileio.c (Finsert_file_contents): Move after-change-function call
6283 to before the "handled:" label, since all "goto handled" appear in
6284 cases where the *-change-functions have already been properly called
6285 (bug#10117).
6286
3360a3fc
AS
62872011-12-01 Andreas Schwab <schwab@linux-m68k.org>
6288
6289 * keyboard.c (interrupt_signal): Don't call kill-emacs when
6290 waiting for input. (Bug#10169)
6291
73d6c093
EZ
62922011-11-30 Eli Zaretskii <eliz@gnu.org>
6293
6294 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
6295 verifies glyph row's hash code--we have just reallocated the
6296 glyphs, so their contents can be complete garbage. (Bug#10164)
6297
febe6bea
JB
62982011-11-30 Juanma Barranquero <lekktu@gmail.com>
6299
6300 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
6301
801a4313
EZ
63022011-11-30 Eli Zaretskii <eliz@gnu.org>
6303
6304 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
6305 attributes are tested _before_ calling verify_row_hash, to protect
6306 against GCC re-ordering of the tests. (Bug#10164)
6307
2b56b87e
JD
63082011-11-29 Jan Djärv <jan.h.d@swipnet.se>
6309
6310 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
6311
6312 * xterm.c (handle_one_xevent): Only set async_visible and friends
6313 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 6314 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
6315 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
6316
dbf31225
PE
63172011-11-28 Paul Eggert <eggert@cs.ucla.edu>
6318
6319 Remove GCPRO-related macros that exist only to avoid shadowing locals.
6320 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
6321 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
6322 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6323 All uses changed to use GCPRO1 etc.
6324 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
6325 Revert to old implementation (i.e., before 2011-03-11).
6326
1305621b
YM
63272011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6328
6329 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
6330 of scroll runs so as to avoid assigning disabled bogus rows and
6331 unnecessary graphics copy operations.
6332
8c9afb46
EZ
63332011-11-27 Eli Zaretskii <eliz@gnu.org>
6334
6335 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
6336 (snprintf) [_MSC_VER]: Redirect to _snprintf.
6337 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
6338 (malloc, free, realloc, calloc): Redirect to e_* only when
6339 compiling Emacs.
6340
6341 * lisp.h (GCTYPEBITS): Move before first use.
6342 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
6343 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
6344 this macro definition.
6345
6346 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
6347 _MSC_VER.
6348
54e9e3bf
JD
63492011-11-27 Jan Djärv <jan.h.d@swipnet.se>
6350
6d5eb5b0
SM
6351 * gtkutil.c (xg_create_frame_widgets):
6352 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
6353 present with Gtk+ 2.0.
6354
83aca1cb
PE
63552011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6356
6357 * fileio.c (Finsert_file_contents): Undo previous change; see
6358 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6359
5b76caa4
PE
63602011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6361
6362 Rename locals to avoid shadowing.
6363 * fileio.c (Finsert_file_contents):
6364 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
6365 * process.c (wait_reading_process_output):
6366 Rename inner 'proc' to 'p' to avoid shadowing.
6367 Indent for consistency with usual Emacs style.
6368
8c535114
EZ
63692011-11-25 Eli Zaretskii <eliz@gnu.org>
6370
6371 * xdisp.c (redisplay_window): If cursor row is not fully visible
6372 after recentering, and scroll-conservatively is set to a large
6373 number, scroll window by a few more lines to make the cursor fully
6374 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
6375 (start_display): Don't move to the next line if the display should
6376 start at a newline that is part of a display vector or an overlay
6377 string. (Bug#10119)
8c535114 6378
fa4fdb5c
JL
63792011-11-24 Juri Linkov <juri@jurta.org>
6380
6381 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6382 after the `MagickPingImage' call. (Bug#10112)
6383
90ec88df
CY
63842011-11-23 Chong Yidong <cyd@gnu.org>
6385
6386 * window.c (Fcoordinates_in_window_p): Accept only live windows.
6387
56e2e794
MR
63882011-11-23 Martin Rudalics <rudalics@gmx.at>
6389
6390 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6391 making another buffer current. (Bug#10114)
6392
b6e64c41
GM
63932011-11-23 Glenn Morris <rgm@gnu.org>
6394
6395 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
6396
6b21de18
CY
63972011-11-23 Chong Yidong <cyd@gnu.org>
6398
6399 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6400 using it (Bug#5984).
6401
b12cd789
EZ
64022011-11-22 Eli Zaretskii <eliz@gnu.org>
6403
6404 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6405 and header-lines, as they don't have one computed for them.
6406 (Bug#10098)
6407
6408 * .gdbinit (prow): Make displayed values more self-explaining.
6409 Add row's hash code.
6410
261b6fd4
LMI
64112011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
6412
6413 * process.c (wait_reading_process_output): Fix asynchrounous
6414 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 6415 (wait_reading_process_output): Add comment and URL.
261b6fd4 6416
e7cfd277
JD
64172011-11-21 Jan Djärv <jan.h.d@swipnet.se>
6418
6419 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6420
a9b9b7f5
CY
64212011-11-21 Chong Yidong <cyd@gnu.org>
6422
6423 * window.c (Fnext_window, Fprevious_window): Doc fix.
6424
b0d15b4f
SM
64252011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6426
6427 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6428
fe7a3057
JB
64292011-11-20 Juanma Barranquero <lekktu@gmail.com>
6430
6431 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6432
d2999b1a
MR
64332011-11-20 Martin Rudalics <rudalics@gmx.at>
6434
6435 * window.c (Fset_window_combination_limit): Rename argument
6436 STATUS to LIMIT.
6437 (Vwindow_combination_limit): Remove "status" from doc-string.
6438
d5ff9cd0
AS
64392011-11-20 Andreas Schwab <schwab@linux-m68k.org>
6440
6441 * m/ibms390.h: Remove.
6442 * m/ibms390x.h: Don't include "ibms390.h".
6443
a5bb9bd3
SM
64442011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6445
6446 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6447 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6448
cd1181db
JB
64492011-11-20 Juanma Barranquero <lekktu@gmail.com>
6450
6451 * casetab.c (Fset_case_table):
6452 * charset.c (Fcharset_after): Fix typos.
6453
615a3b8d 64542011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 6455
17e845af
PE
6456 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6457 Otherwise, valgrind does not work on some platforms.
6458 Problem reported by Andreas Schwab in
6a0bf43d
PE
6459 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6460 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6461 is set, removing the need for VIRT_ADDRESS_VARIES.
6462 (PURE_P): Use a more-efficient implementation that needs just one
6463 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6464 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6465 to 4 (xorl, subq, cmpq, setbe).
6466 * alloc.c (pure): Always extern now, since that's the
6467 VIRT_ADDR_VARIES behavior.
6468 (PURE_POINTER_P): Use a single comparison, not two, for
6469 consistency with the new puresize.h.
6470 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6471 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6472 Remove VIRT_ADDR_VARIES no longer needed.
6473
f8fe6f96
EZ
64742011-11-19 Eli Zaretskii <eliz@gnu.org>
6475
6476 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6477 (erase_phys_cursor, update_window_cursor, show_mouse_face)
6478 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6479 behave as if the cursor position were at the window margin.
6480
6481 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6482 and the cursor position is out of bounds, behave as if the cursor
6483 position were at the window margin. (Bug#10075)
6484
df05a53c
CY
64852011-11-18 Chong Yidong <cyd@gnu.org>
6486
6487 * window.c (Fwindow_combination_limit): Make first argument
6488 non-optional, since it is meaningless for live windows like the
6489 selected window.
61ccba97 6490
2071918e
DA
64912011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
6492
6493 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6494
b50a28de
SM
64952011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
6496
6497 * intervals.c: Fix grafting over the whole buffer (bug#10071).
6498 (graft_intervals_into_buffer): Simplify.
6499
015137db
EZ
65002011-11-18 Eli Zaretskii <eliz@gnu.org>
6501
6502 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6503 hash values of the two rows.
6504 (copy_row_except_pointers): Preserve the used[] arrays and the
6505 hash values of the two rows. (Bug#10035)
68c95424 6506 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
6507
6508 * xdisp.c (row_hash): New function, body extracted from
6509 compute_line_metrics.
6510 (compute_line_metrics): Call row_hash, instead of computing the
6511 hash code inline.
6512
6513 * dispnew.c (verify_row_hash): Call row_hash for computing the
6514 hash code of a row, instead of duplicating code from xdisp.c.
6515
6516 * dispextern.h (row_hash): Add prototype.
6517
a2addb04
TH
65182011-11-18 Tassilo Horn <tassilo@member.fsf.org>
6519
6520 * frame.c (delete_frame): Don't delete the terminal when the last
6521 X frame is closed if emacs is built with GTK toolkit.
6522
df85d315
JB
65232011-11-17 Juanma Barranquero <lekktu@gmail.com>
6524
6525 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
6526
a0c2d0ae
MR
65272011-11-17 Martin Rudalics <rudalics@gmx.at>
6528
6529 * window.c (Vwindow_splits): Rename to
6530 Vwindow_combination_resize. Suggested by Juri Linkov.
6531 (Fsplit_window_internal): Use Vwindow_combination_resize instead
6532 of Vwindow_splits.
6533
58179cce
JB
65342011-11-16 Juanma Barranquero <lekktu@gmail.com>
6535
7877f373
JB
6536 * nsfns.m (Fns_font_name):
6537 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 6538
b6f67890
MR
65392011-11-16 Martin Rudalics <rudalics@gmx.at>
6540
6541 * window.h (window): Rename slot "nest" to "combination_limit".
6542 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6543 (Fset_window_nest): Rename to Fset_window_combination_limit.
6544 (Vwindow_nest): Rename to Vwindow_combination_limit.
6545 (recombine_windows, make_parent_window, make_window)
6546 (Fsplit_window_internal, saved_window)
6547 (Fset_window_configuration, save_window_save): Rename all
6548 occurrences of window_nest to window_combination_limit.
6549
c7015153
JB
65502011-11-15 Juanma Barranquero <lekktu@gmail.com>
6551
6552 * image.c (imagemagick_load_image): Fix typo.
6553
322ad6ec
EZ
65542011-11-14 Eli Zaretskii <eliz@gnu.org>
6555
6556 * xdisp.c (display_line): Move the call to
6557 highlight_trailing_whitespace before the call to
6558 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
6559 faces of all the glyphs to compute ROW's hash value.
6560 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 6561
f067b8ec
JB
65622011-11-14 Juanma Barranquero <lekktu@gmail.com>
6563
6564 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6565 just return (bug#10044).
6566
1e5b2111
EZ
65672011-11-12 Eli Zaretskii <eliz@gnu.org>
6568
7ef3cbd5
EZ
6569 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6570 with user-defined heap size. Bump the default size of the temacs
6571 heap to 27MB, to avoid memory warning when running temacs.
6572 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6573
1e5b2111
EZ
6574 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6575 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
6576 (verify_row_hash) [XASSERTS]: New function.
6577 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6578 that the hash value of glyph rows is correct.
1e5b2111 6579
89d61221
MR
65802011-11-12 Martin Rudalics <rudalics@gmx.at>
6581
6582 * window.h (window): Remove splits slot.
6583 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6584 (Fdelete_other_windows_internal, make_parent_window)
6585 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6586 (Fset_window_configuration, save_window_save): Don't deal with
6587 split status of windows.
6588 (saved_window): Remove splits slot.
6589 (Vwindow_splits): Rewrite doc-string.
6590
97f18cc8
JD
65912011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6592
6593 * xfns.c (unwind_create_frame):
6594 * nsfns.m (unwind_create_frame):
6595 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6596 Vframe_list (Bug#9999).
6597
22a648b4
DA
65982011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6599
0b381c7e 6600 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 6601
659afede
KH
66022011-11-11 Kenichi Handa <handa@m17n.org>
6603
6604 * callproc.c (Fcall_process): Set the member dst_multibyte of
6605 process_coding.
6606
9ac0394b
KH
66072011-11-11 Johan Bockgård <bojohan@gnu.org>
6608
6609 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6610 avoid a crash (bug#9496).
6611
2fbdc249
CY
66122011-11-09 Chong Yidong <cyd@gnu.org>
6613
6614 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6615 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6616
ac6b1f81
PE
66172011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6618
6619 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6620
09db192c
PE
66212011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 Avoid some portability problems by eschewing 'extern inline' functions.
6624 The trivial performance wins aren't worth the portability hassles; see
6625 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6626 et seq.
6627 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6628 (window_box_width, window_box_left, window_box_left_offset)
6629 (window_box_right, window_box_right_offset): Undo previous change,
6630 by removing the "extern"s.
6631 * intervals.c (adjust_intervals_for_insertion)
6632 (adjust_intervals_for_deletion): Undo previous change,
6633 making these static again.
6634 (offset_intervals, temp_set_point_both, temp_set_point)
6635 (copy_intervals_to_string): No longer inline.
6636 * xdisp.c (window_text_bottom_y, window_box_width)
6637 (window_box_height, window_box_left_offset)
6638 (window_box_right_offset, window_box_left, window_box_right)
6639 (window_box): No longer inline.
6640
105216ed
CY
66412011-11-08 Chong Yidong <cyd@gnu.org>
6642
6643 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
6644 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6645 Signal an error if not a live window.
105216ed
CY
6646 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6647 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6648
ae9e237f
JB
66492011-11-07 Juanma Barranquero <lekktu@gmail.com>
6650
6651 * lisp.h (syms_of_abbrev): Remove declaration.
6652 Reported by CHENG Gao <chenggao@royau.me>.
6653
c7aa8333
EZ
66542011-11-07 Eli Zaretskii <eliz@gnu.org>
6655
6656 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6657 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6658 of temacs in GUI mode.
6659
be7f5545
MR
66602011-11-07 Martin Rudalics <rudalics@gmx.at>
6661
6662 * window.h: Declare delete_all_child_windows instead of
6663 delete_all_subwindows.
6664 * window.c (Fwindow_nest, Fset_window_nest)
6665 (Fset_window_new_total, Fset_window_new_normal)
6666 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6667 (delete_all_subwindows): Rename to delete_all_child_windows.
6668 (Fdelete_other_windows_internal, Fset_window_configuration):
6669 Call delete_all_child_windows instead of delete_all_subwindows.
6670 * frame.c (delete_frame): Call delete_all_child_windows instead
6671 of delete_all_subwindows.
6672
ca78dc43
PE
66732011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6676 This is also needed for porting to any host where GC_MARK_STACK is
6677 not GC_MAKE_GCPROS_NOOPS.
6678 (which_symbols): Use it.
6679
a0241d01
KH
66802011-11-07 Kenichi Handa <handa@m17n.org>
6681
6682 * coding.c (coding_set_destination): Check coding->src_pos only
6683 when coding->src_object is a buffer (bug#9910).
6684
6685 * process.c (send_process): Set the member src_multibyte of coding
6686 to 0 (bug#9911) when sending a unibyte text.
6687
6688 * callproc.c (Fcall_process): Set the member src_multibyte of
6689 process_coding to 0 (bug#9912).
6690
a64bfdfa 66912011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
6692
6693 * xmenu.c (cleanup_widget_value_tree): New function.
6694 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6695 calling free_menubar_widget_value_tree directly (Bug#9830).
6696
cb41b32a
PE
66972011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6698
6699 Fix some portability problems with 'inline'.
6700 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6701 (window_box_width, window_box_left, window_box_left_offset)
6702 (window_box_right, window_box_right_offset): Declare extern.
6703 Otherwise, these inline functions do not conform to C99 and
6704 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6705 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6706 * intervals.c (adjust_intervals_for_insertion)
6707 (adjust_intervals_for_deletion): Now extern, because otherwise the
6708 extern inline functions 'offset_intervals' couldn't refer to it.
6709 (static_offset_intervals): Remove.
6710 (offset_intervals): Rewrite using the old contents of
6711 static_offset_intervals. The old version didn't conform to C99
6712 because an extern inline function contained a reference to an
6713 identifier with static linkage.
6714
b7041366
AS
67152011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6716
6717 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6718 GC.
6719
88a37c4d
EZ
67202011-11-06 Eli Zaretskii <eliz@gnu.org>
6721
6722 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6723 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6724 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6725 return Qleft_to_right.
6726
49745b39
CY
67272011-11-06 Chong Yidong <cyd@gnu.org>
6728
6729 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6730 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6731 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6732 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6733 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6734 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6735 (Fwindow_vscroll): Doc fix.
6736 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6737 argument, since it makes no sense to pass a live window and for
6738 consistency with window-child.
6739
1f05cd82
CS
67402011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6741
6742 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6743 support MSVC.
6744
22610910
JR
67452011-11-05 Jason Rumney <jasonr@gnu.org>
6746
6747 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6748 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6749 fonts (Bug#6029).
6750 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6751 bitwise arithmetic preventing use of unicode-sip and non-truetype
6752 opentype fonts.
6753
a06776b2
EZ
67542011-11-05 Eli Zaretskii <eliz@gnu.org>
6755
3ad924ba
EZ
6756 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6757 "emacs"-only part.
6758
a06776b2
EZ
6759 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6760 initialization code to keep similarity to xfns.c after changes
6761 from 2011-11-05.
6762
c9e7db78
JD
67632011-11-05 Jan Djärv <jan.h.d@swipnet.se>
6764
a97f8f3f
JD
6765 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
6766 (unwind_create_frame): New function (Bug#9943).
6767 (Fx_create_frame): Restructure code to be more similar to the one in
6768 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
6769 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
6770 Move terminal->reference_count++ just before making the frame official
6771 (Bug#9943).
6772
6773 * nsterm.m (x_free_frame_resources): New function.
6774 (x_destroy_window): Move code to x_free_frame_resources.
6775
c9e7db78 6776 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
6777 (Fx_create_frame, x_create_tip_frame):
6778 Move terminal->reference_count++ just before making the frame
75f1671a 6779 official. Move initialization of image_cache_refcount and
c9e7db78
JD
6780 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
6781
a6fc3b5c
EZ
67822011-11-05 Eli Zaretskii <eliz@gnu.org>
6783
6784 Support MSVC build with newer versions of Visual Studio.
6785 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
6786 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
6787 nt/gmake.defs.
6788
6789 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
6790 which are not supported by MSVC.
6791 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
6792 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
6793 bitfields.
6794 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
6795 types in bitfields.
6796 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
6797
6798 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
6799
58179cce 68002011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
6801
6802 Support MSVC build with newer versions of Visual Studio.
6803 * w32.c: Don't include w32api.h for MSVC.
6804 (init_environment) [_MSC_VER]: Call sys_access, not _access.
6805
6806 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
6807 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
6808 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
6809 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
6810 e_* cousins.
6811 (alloca) [_MSC_VER]: Define to _alloca.
6812
6813 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
6814
6815 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
6816
a58c13ed
EZ
68172011-11-04 Eli Zaretskii <eliz@gnu.org>
6818
6819 * xdisp.c (note_mouse_highlight): If either of
6820 previous/next-single-property-change returns nil, treat that as
6821 the beginning or the end of the buffer. (Bug#9955)
6822
fe0b6370
JD
68232011-11-04 Jan Djärv <jan.h.d@swipnet.se>
6824
a58c13ed 6825 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
6826 label is not null (Bug#9951).
6827 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6828 may be NULL.
6829
89bd5ee1
EZ
68302011-11-04 Eli Zaretskii <eliz@gnu.org>
6831
6832 * window.c (Fwindow_body_size): Mention in the doc string that the
6833 return value is in frame's canonical units. (Bug#9949)
6834
84c3edb9
EZ
68352011-11-03 Eli Zaretskii <eliz@gnu.org>
6836
4e2fb5c7
EZ
6837 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
6838
84c3edb9 6839 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 6840 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 6841 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 6842
bc17a887
EZ
68432011-11-01 Eli Zaretskii <eliz@gnu.org>
6844
6845 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
6846 Don't stop backward scan on the continuation glyph, even though
6847 its CHARPOS is positive.
6d5eb5b0
SM
6848 (mouse_face_from_buffer_pos, note_mouse_highlight):
6849 Rename cover_string to disp_string.
bc17a887 6850
4ee88440
MR
68512011-11-01 Martin Rudalics <rudalics@gmx.at>
6852
6853 * window.c (temp_output_buffer_show): Don't use
6854 Vtemp_buffer_show_specifiers.
6855 (Vtemp_buffer_show_specifiers): Remove unused variable.
6856
c2ff3c02
EZ
68572011-10-30 Eli Zaretskii <eliz@gnu.org>
6858
6859 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
6860 past the beginning of the current glyph matrix.
6861
58179cce 68622011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
6863
6864 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
6865 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
6866 HAVE_GTK3 (Bug#9869).
b77a6a7f 6867
3b574623
JD
6868 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6869 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6870
b77a6a7f
JD
6871 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6872
6873 * xterm.c: Declare x_handle_net_wm_state to return int.
6874 (handle_one_xevent): Check if we are iconified but don't have
6875 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6876 (get_current_wm_state): Return non-zero if not hidden,
6877 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6878 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6879 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6880 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6881
196e41e4
PE
68822011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6883
6884 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6885 so that this new function doesn't get optimized away by a
6886 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6887
021f2e1a
AS
68882011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6889
6890 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6891
8b058d44
EZ
68922011-10-29 Eli Zaretskii <eliz@gnu.org>
6893
6894 Fix the `xbytecode' command.
6895 * .gdbinit (xprintbytestr): New command.
b50a28de 6896 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
6897 (xbytecode): Print the byte-code string as well.
6898
4452fb80
EZ
68992011-10-29 Kim Storm <storm@cua.dk>
6900
8b058d44
EZ
6901 * alloc.c (which_symbols): New function.
6902
21b72067
AS
69032011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6904
6905 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6906 line. (Bug#9903)
6907
83ed7b5c
GM
69082011-10-29 Glenn Morris <rgm@gnu.org>
6909
6910 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6911 Not clear what it was for, and it causes various bugs. (Bug#9839)
6912
5a7a728b
EZ
69132011-10-28 Eli Zaretskii <eliz@gnu.org>
6914
6915 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6916 possible random value that matches one of those tested as
6917 condition to clear the mouse face.
6918
d3d0842f
CY
69192011-10-28 Chong Yidong <cyd@gnu.org>
6920
6921 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6922
31b39d13
DN
69232011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6924
6925 * window.c (make_window): Initialize phys_cursor_on_p.
6926
9aba6043
SM
69272011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6928
6929 * lisp.h (struct Lisp_Symbol): Update comments.
6930
c20992f4
JB
69312011-10-28 Juanma Barranquero <lekktu@gmail.com>
6932
6933 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6934
db4f02f2
EZ
69352011-10-28 Eli Zaretskii <eliz@gnu.org>
6936
6937 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6938 <oslsachem@gmail.com> for helping to debug this.
6939
6940 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6941 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6942 (g_b_init_get_glyph_outline_w): New static variables.
6943 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6944 (GetGlyphOutlineW_Proc): New typedefs.
6945 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
6946 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6947 New functions.
6948 (w32font_open_internal, compute_metrics):
6949 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
6950 instead of calling the "wide" APIs directly.
6951
6952 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6953
6954 * w32.h (syms_of_w32font): Add prototype.
6955
87e68db4
JB
69562011-10-27 Juanma Barranquero <lekktu@gmail.com>
6957
6958 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6959 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6960 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6961 (Fmove_to_window_line): Doc fix.
6962
435c1d67
CY
69632011-10-27 Chong Yidong <cyd@gnu.org>
6964
6965 * process.c (make_process): Set gnutls_state to NULL.
6966
6967 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6968 non-NULL, regardless of GNUTLS_INITSTAGE.
6969 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6970 an error. Set process slots as soon as we allocate them.
6971
6972 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6973
9c6c6f49
CY
69742011-10-27 Chong Yidong <cyd@gnu.org>
6975
9aba6043
SM
6976 * gnutls.c (emacs_gnutls_deinit): New function.
6977 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
6978 (Fgnutls_deinit, Fgnutls_boot): Use it.
6979
6980 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6981 (deactivate_process): Call emacs_gnutls_deinit.
6982
657d08d3
JB
69832011-10-27 Juanma Barranquero <lekktu@gmail.com>
6984
6985 * image.c (x_create_x_image_and_pixmap):
6986 * w32.c (sys_rename, w32_delayed_load):
6987 * w32font.c (fill_in_logfont):
6988 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6989
5430d399
JB
69902011-10-26 Juanma Barranquero <lekktu@gmail.com>
6991
6992 * w32fns.c (w32_default_color_map): New function,
6993 extracted from Fw32_default_color_map.
a7ef684b 6994 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 6995
fe0055fa
PE
69962011-10-25 Paul Eggert <eggert@cs.ucla.edu>
6997
6998 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
6999
e6346438
SM
70002011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
7001
7002 * keyboard.c (test_undefined): New function (bug#9751).
7003 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
7004
e112cc37
ET
70052011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
7006
7007 * sysdep.c (init_sys_modes): Fix the check for the controlling
7008 terminal (Bug#6649).
7009
7b5d6677
EZ
70102011-10-20 Eli Zaretskii <eliz@gnu.org>
7011
7012 * dispextern.h (struct bidi_it): New member next_en_type.
7013
7014 * bidi.c (bidi_line_init): Initialize the next_en_type member.
7015 (bidi_resolve_explicit_1): When next_en_pos is valid for the
7016 current character, check also for next_en_type being WEAK_EN.
7017 (bidi_resolve_weak): Don't enter the expensive loop if the current
7018 position is before next_en_pos. Record the bidi type of the first
7019 non-ET, non-BN character we find, in addition to its position.
7020 (bidi_level_of_next_char): Invalidate next_en_type when
7021 next_en_pos is over-stepped.
7022
7da0b018
PE
70232011-10-20 Paul Eggert <eggert@cs.ucla.edu>
7024
7025 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
7026 * editfns.c: Rewrite current-time-zone so that it invokes
7027 the equivalent of (format-time-string "%Z") to get the time zone name.
7028 This fixes a bug when the time zone name contains characters that
7029 need converting from the system time locale to Emacs internal format.
7030 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
7031 that patch fixed format-time-string to do the conversion, but
7032 I forgot to fix current-time-zone.
7033 (format_time_string): New function, containing most of
7034 what Fformat_time_string used to contain.
7035 (Fformat_time_string): Rewrite in terms of format_time_string.
7036 This doesn't change this function's behavior.
7037 (current-time-zone): Rewrite to use format_time_string.
7038 This fixes the bug reported by Michael Schierl in
7039 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
7040 Jason Rumney's 2007-06-07 change worked around this bug, but
7041 didn't fix it.
7042 * systime.h (tzname, timezone): Remove no-longer-used declarations.
7043
8547b010
EZ
70442011-10-19 Eli Zaretskii <eliz@gnu.org>
7045
7046 * xdisp.c (start_display): If the character at POS is displayed
7047 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
7048 (try_window_reusing_current_matrix): If a line ends in a display
7049 vector or the next line starts in a display vector, continue
7050 redrawing the window even though the character position of
7051 start_row was reached.
8547b010
EZ
7052 (Bug#9771, part 2)
7053
4e948d15
CY
70542011-10-18 Chong Yidong <cyd@gnu.org>
7055
7056 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
7057 with nobreak-char-display too.
7058
4787455f
EZ
70592011-10-18 Eli Zaretskii <eliz@gnu.org>
7060
7061 Fix part 3 of bug#9771.
7062 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
7063 (bidi_resolve_neutral): Don't enter the expensive loop looking for
7064 non-neutral characters if the current character is a paragraph
7065 separator (a.k.a. Newline). This avoids running the same
7066 expensive loop twice, once when we consume the preceding newline
7067 and the other time when the line actually needs to be displayed.
7068 Avoid the loop when we see neutrals on the base embedding level
7069 following a character whose directionality is the same as the
7070 paragraph's. This avoids running the expensive loop when a line
7071 ends in a long sequence of neutrals, like control characters.
7072 Add assertion against STRONG_AL type. Slightly rearrange code
7073 that determines the type of a neutral given the first non-neutral
7074 that follows it.
7075 (bidi_level_of_next_char): Set next_en_pos to zero when
7076 invalidating its info.
7077
2c91f553
EZ
70782011-10-17 Eli Zaretskii <eliz@gnu.org>
7079
7080 * xdisp.c (push_display_prop): Determine whether to record string
7081 or buffer position by IT->string, not by IT->method. Allow
7082 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
7083 (move_it_vertically_backward): Don't look for character position
7084 immediately after the newline when in a continuation line.
7085 (Bug#9771, part 1)
2c91f553 7086
c7b08b0d
MR
70872011-10-15 Martin Rudalics <rudalics@gmx.at>
7088
7089 * window.c (coordinates_in_window): Rewrite and delabelize
7090 vertical border check. (Bug#5357) (Bug#9618)
7091
6b02f655
SM
70922011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7093
7094 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
7095 errors in XSetWindowBorder (bug#9310).
7096
81d40c92
DA
70972011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
7098
7099 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
7100 avoid crash when xmalloc overrun checking is enabled.
7101
d4172c3b
EZ
71022011-10-13 Eli Zaretskii <eliz@gnu.org>
7103
7104 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
7105 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
7106 cursor motion with <left> and <right> arrow keys.
7107
7108 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
7109 some callers set that themselves.
7110
b00eea75
EZ
71112011-10-12 Eli Zaretskii <eliz@gnu.org>
7112
7113 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
7114 display string and the previous row comes from the same string and
7115 is empty. (Bug#9739) (Bug#9738)
7116
8fe012c4
SM
71172011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
7118
7119 * doc.c (get_doc_string): Encode file name (bug#9735).
7120
0074aef2
EZ
71212011-10-12 Eli Zaretskii <eliz@gnu.org>
7122
79beb178
EZ
7123 * bidi.c (bidi_level_of_next_char):
7124 * xdisp.c (get_visually_first_element): Remove old incorrect
7125 comments regarding the Unicode Line Separator character.
7126
0074aef2
EZ
7127 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
7128
6e4b3fbe
DA
71292011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
7130
7131 * alloc.c (Fgc_status): Do not access beyond zombies array
7132 boundary if nzombies > MAX_ZOMBIES.
7133 * alloc.c (dump_zombies): Add missing format specifier.
7134
0324f3af
PE
71352011-10-12 Paul Eggert <eggert@cs.ucla.edu>
7136
b5525cac
PE
7137 * xdisp.c (set_cursor_from_row): Simplify conditionals,
7138 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
7139
0324f3af
PE
7140 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
7141 Some packages use them to denote characters with modifiers.
7142
e9b5f888
AS
71432011-10-11 Andreas Schwab <schwab@linux-m68k.org>
7144
7145 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
7146 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
7147 matching a pp-number. Rename parameter var to var1.
7148
127827c0
SM
71492011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
7150
7151 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
7152
c8fd3bd0
GM
71532011-10-08 Glenn Morris <rgm@gnu.org>
7154
7155 * callint.c (Fcall_interactively): Give a more explicit error for the
7156 'c' case with a non-character input. (Bug#8479)
7157
352ec8ff
EZ
71582011-10-08 Eli Zaretskii <eliz@gnu.org>
7159
03669ccb
EZ
7160 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
7161 lines.
7061c986
EZ
7162 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
7163 lines that are hscrolled on the left.
03669ccb 7164
352ec8ff
EZ
7165 * dispnew.c (buffer_posn_from_coords): Account for a possible
7166 presence of header-line. (Bug#4426)
7167
a66cfb1c
SM
71682011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
7169
6b02f655
SM
7170 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
7171 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 7172
7c5ee88e
PE
71732011-10-07 Paul Eggert <eggert@cs.ucla.edu>
7174
7175 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
7176 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
7177 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
7178 this makes Emacs dump core during garbage collection on rare
7179 occasions. sizeof is obviously inferior to offsetof here, so
7180 stick with offsetof.
7181 (GC_POINTER_ALIGNMENT): New macro.
7182 (mark_memory): Omit 3rd (offset) arg; caller changed.
7183 Don't assume EMACS_INT alignment is the same as pointer alignment.
7184
df1bbe5b
SM
71852011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
7186
7187 * keyboard.c (read_key_sequence_remapped): New var.
7188 (read_key_sequence): Compute remapping in the right buffer.
7189 (command_loop_1): Use read_key_sequence's remapping directly.
7190
51553db6
SM
71912011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
7192
32c1fffd
SM
7193 * dired.c (file_name_completion): Don't expand file name.
7194 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
7195 before checking file name handler.
7196
51553db6
SM
7197 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
7198 they've been requested explicitly (bug#9591).
7199
b6bd1599 72002011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
7201
7202 * keymap.c (Fsingle_key_description): Use make_specified_string
7203 instead of build_string to build string from push_key_description.
7204 (Bug#5193)
7205
f701dc2a
PE
72062011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7207
4222c55d
PE
7208 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
7209 This fixes a Y2038 bug on 64-bit hosts.
7210 * buffer.c (reset_buffer):
7211 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
7212 (Fclear_buffer_auto_save_failure):
7213 Use 0, not -1, to represent an unset failure time, since time_t
7214 might not be signed.
7215
f701dc2a
PE
7216 Remove dependency on glibc malloc internals.
7217 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7218 Move back here from lisp.h, but with their new implementations.
7219 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7220 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
7221 * charset.c (charset_table_init): New static var.
7222 (syms_of_charset): Use it instead of xmalloc. This removes a
7223 dependency on glibc malloc internals. See Eli Zaretskii's comment in
7224 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
7225 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7226 Move back to alloc.c.
7227 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7228 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
7229
9ceebf39
JD
72302011-09-30 Jan Djärv <jan.h.d@swipnet.se>
7231
7232 * nsterm.m (windowDidResize): Call x_set_window_size only when
7233 ns_in_resize is true. Otherwise set pixelwidth/height and
7234 call change_frame_size (Bug#9628).
7235
cb993c58
PE
72362011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7237
3930c88b
PE
7238 Port --enable-checking=all to Fedora 14 x86-64.
7239 * charset.c (syms_of_charset): Also account for glibc malloc's
7240 internal overhead when calculating the initial malloc maximum.
7241
cb993c58
PE
7242 Port --enable-checking=all to Fedora 14 x86.
7243 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7244 Move to lisp.h.
7245 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
7246 (overrun_check_realloc, overrun_check_free):
7247 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
7248 That way, xmalloc returns a properly-aligned pointer even if
7249 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
7250 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
7251 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
7252 into account when calculating the initial malloc maximum.
7253 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7254 Move here from alloc.c, so that charset.c can use it too.
7255 Properly align; the old code wasn't right for common 32-bit hosts
7256 when configured with --enable-checking=all.
7257 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7258 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
7259
31bed486
EZ
72602011-09-29 Eli Zaretskii <eliz@gnu.org>
7261
04c70788 7262 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
7263 use EDOM.
7264
fbcaa2f3
EZ
72652011-09-28 Eli Zaretskii <eliz@gnu.org>
7266
7267 * xdisp.c (compute_display_string_end): If there's no display
7268 string at CHARPOS, return -1.
7269
7270 * bidi.c (bidi_fetch_char): When compute_display_string_end
7271 returns a negative value, treat the character as a normal
7272 character not covered by a display string. (Bug#9624)
7273
a239d4e9
JB
72742011-09-28 Juanma Barranquero <lekktu@gmail.com>
7275
7276 * lread.c (Fread_from_string): Fix typo in docstring.
7277
88652fd5
EZ
72782011-09-27 Eli Zaretskii <eliz@gnu.org>
7279
7280 * xdisp.c (handle_invisible_prop): If invisible text ends on a
7281 newline, reseat the iterator instead of bidi-iterating there one
7282 character at a time. (Bug#9610)
32c1fffd
SM
7283 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
7284 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 7285
ed497dd4
AS
72862011-09-27 Andreas Schwab <schwab@linux-m68k.org>
7287
7288 * lread.c (readevalloop): Use correct code for NBSP.
7289 (read1): Likewise. (Bug#9608)
7290
b2bf61aa
MA
72912011-09-25 Michael Albinus <michael.albinus@gmx.de>
7292
7293 * dbusbind.c (Fdbus_register_signal): When service is not
7294 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
7295
32bbb17c
GM
72962011-09-25 Glenn Morris <rgm@gnu.org>
7297
7298 * buffer.c (truncate-lines): Doc fix.
7299
94e0933e
CY
73002011-09-24 Chong Yidong <cyd@stupidchicken.com>
7301
7302 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
7303 (Fset_window_next_buffers): Doc fix.
7304
cddde921
GM
73052011-09-24 Glenn Morris <rgm@gnu.org>
7306
7307 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
7308
1260aef1
PE
73092011-09-24 Paul Eggert <eggert@cs.ucla.edu>
7310
25b4bfa0
PE
7311 Fix minor problems found by static checking.
7312 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
7313 * indent.c (Fvertical_motion): Fix == vs = typo.
7314
e3cbd34b
EZ
73152011-09-24 Eli Zaretskii <eliz@gnu.org>
7316
a66cfb1c
SM
7317 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
7318 Default value is now t. Doc fix.
6bf7006f 7319
e3cbd34b 7320 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 7321 logic when moving up, not only when moving down. Fix the
e3cbd34b 7322 confusing name and values of the it_overshoot_expected variable;
32c1fffd 7323 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
7324
7325 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
7326 CHARPOS is covered by a display string which includes newlines.
7327 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
7328 is covered by a display string with embedded newlines.
7329
a3de0cbd
MA
73302011-09-24 Michael Albinus <michael.albinus@gmx.de>
7331
7332 * dbusbind.c (Fdbus_register_signal): Add match rule to
7333 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
7334 (Fdbus_register_method, Vdbus_registered_objects_table):
7335 Fix docstring.
a3de0cbd 7336
b260039d
JM
73372011-09-24 Jim Meyering <meyering@redhat.com>
7338
32c1fffd 7339 do not ignore write error for any output size
b260039d
JM
7340 The previous change was incomplete.
7341 While it makes emacs --batch detect the vast majority of stdout
7342 write failures, errors were still ignored whenever the output size is
7343 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
7344 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
7345 && echo FAIL: ignored write error
7346 FAIL: ignored write error
7347 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
7348 && echo FAIL: ignored write error
7349 FAIL: ignored write error
7350 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
7351
8eca8a7c
AS
73522011-09-23 Andreas Schwab <schwab@linux-m68k.org>
7353
7354 * emacs.c (Fkill_emacs): In noninteractive mode exit
7355 non-successfully if a write error occurred on stdout. (Bug#9574)
7356
3341db62
EZ
73572011-09-21 Eli Zaretskii <eliz@gnu.org>
7358
7359 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
7360 the xassert test.
7361
7362 * dispextern.h (struct it): Update the comment documenting what
7363 can it->OBJECT be.
7364
8c203dbf
EZ
73652011-09-20 Eli Zaretskii <eliz@gnu.org>
7366
7367 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
7368 a display string, extend search for cursor position to end of row.
7369 (find_row_edges): If the row ends in a newline from a display
7370 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
7371 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
7372 (Fcurrent_bidi_paragraph_direction): Fix search for previous
7373 non-empty line. Fixes confusing cursor motion with arrow keys at
7374 the beginning of a line that starts with whitespace.
8c203dbf 7375
a4824228
LMI
73762011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7377
7378 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7379 (bug#9493).
7380
33ed493b
CY
73812011-09-18 Chong Yidong <cyd@stupidchicken.com>
7382
7383 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7384 boolean (Bug#9154).
7385
56cd55c8
EZ
73862011-09-18 Eli Zaretskii <eliz@gnu.org>
7387
7388 * xdisp.c (display_line): Record maximum and minimum buffer
7389 positions even if no glyphs were produced (e.g., by a zero-width
7390 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
7391 buffer positions that will be removed from the glyph row because
7392 they don't fit.
c02dcedf
EZ
7393 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7394 column is beyond frame width: don't subtract 1 "pixel" when
7395 computing width of the stretch.
3e62b7e0
EZ
7396 (reseat_at_next_visible_line_start): Undo the change made on
7397 2011-09-17 that saved paragraph information and restored it after
7398 the call to `reseat'. (Bug#9545)
56cd55c8 7399
5ed99d36 74002011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
7401
7402 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7403 and turn window cursor on if cleared (Bug#9415).
7404
5ed99d36 74052011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
7406
7407 * search.c (boyer_moore): Take unibyte characters from pattern
7408 literally. (Bug#9458)
7409
9bade7b2
EZ
74102011-09-18 Eli Zaretskii <eliz@gnu.org>
7411
7412 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7413
e5e9d610
PE
74142011-09-18 Paul Eggert <eggert@cs.ucla.edu>
7415
87e4427a
PE
7416 Fix minor problem found by static checking.
7417 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7418 initialized, to pacify gcc -Wuninitialized.
7419
e5e9d610
PE
7420 * fileio.c: Report proper errno when syscall falls.
7421 (Finsert_file_contents): Save and restore errno,
7422 so that report_file_error outputs the correct diagnostic.
7423 (Fwrite_region) [CLASH_DETECTION]: Likewise.
7424
a1674f0b
EZ
74252011-09-18 Eli Zaretskii <eliz@gnu.org>
7426
7427 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7428
fbfb6dd4
EZ
74292011-09-17 Eli Zaretskii <eliz@gnu.org>
7430
7431 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7432 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
7433
bb187662
EZ
74342011-09-17 Eli Zaretskii <eliz@gnu.org>
7435
1137e8b8 7436 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 7437 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
7438
7439 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7440 (bidi_find_paragraph_start): Search back for paragraph beginning
7441 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7442 (bidi_move_to_visually_next): Only trigger paragraph-related
7443 computations when the last character is a newline or at EOB, not
7444 just any NEUTRAL_B. (Bug#9470)
7445
bb187662
EZ
7446 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7447 truncated lines if point is covered by a display string. (Bug#9524)
7448
2e621251
PE
74492011-09-16 Paul Eggert <eggert@cs.ucla.edu>
7450
7451 * xselect.c: Relax test for outgoing X longs (Bug#9498).
7452 (cons_to_x_long): New function.
7453 (lisp_data_to_selection_data): Use it. Correct the test for
7454 short-versus-long data; it was negated. Break out of vector
7455 loop, for efficiency, when a long datum is discovered.
7456
91a15bc6
SM
74572011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
7458
7459 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7460
b41c3a35
EZ
74612011-09-16 Eli Zaretskii <eliz@gnu.org>
7462
7463 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7464 GCC PR/17406) by declaring this function with external scope.
7465
7812ba2d
PE
74662011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7467
7468 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7469 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7470
cf7edc2a
AS
74712011-09-15 Andreas Schwab <schwab@linux-m68k.org>
7472
7473 * editfns.c (Fformat): Correctly handle text properties on "%%".
7474
bd01620e
EZ
74752011-09-15 Eli Zaretskii <eliz@gnu.org>
7476
7477 * xterm.c (x_draw_composite_glyph_string_foreground):
7478 * w32term.c (x_draw_composite_glyph_string_foreground):
7479 * term.c (encode_terminal_code):
7480 * composite.c (composition_update_it, get_composition_id):
7481 * xdisp.c (get_next_display_element)
7482 (fill_composite_glyph_string): Add comments about special meaning
7483 of TAB characters in a composition.
7484
a02719a3
PE
74852011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
7488 This occurs when processing a multibyte format.
7489 Problem reported by Wolfgang Jenker.
a02719a3 7490
72589a3c
JB
74912011-09-15 Johan Bockgård <bojohan@gnu.org>
7492
7493 * xdisp.c (try_cursor_movement): Only check for exact match if
7494 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
7495
1c14176c
PE
74962011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7497
7498 Remove unused external symbols.
7499 * dispextern.h (calc_pixel_width_or_height): Remove decl.
7500 * xdisp.c (calc_pixel_width_or_height): Now static.
7501 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7502 * indent.c (check_display_width):
7503 * w32term.c: Fix comment to match code.
7504 * xterm.c, xterm.h (x_catching_errors): Remove.
7505
d2eea5b5
PE
75062011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7507
7508 * xselect.c: Use signed conversions more consistently (Bug#9498).
7509 (selection_data_to_lisp_data): Assume incoming selection data are
7510 signed integers, not unsigned. This is to be consistent with
7511 outgoing selection data, which was modified to use signed integers
7512 in as part of the fix to Bug#9196 in response to Jan D.'s comment
7513 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7514 expects long, not unsigned long.
7515
46888499
EZ
75162011-09-14 Eli Zaretskii <eliz@gnu.org>
7517
7518 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7519 computation of loop end. Reported by Johan Bockgård
7520 <bojohan@gnu.org>.
7521
ef8ef9fb
CY
75222011-09-13 Chong Yidong <cyd@stupidchicken.com>
7523
7524 * frame.c (Fother_visible_frames_p): Function deleted.
7525
fa819fed
EZ
75262011-09-12 Eli Zaretskii <eliz@gnu.org>
7527
7528 * indent.c (compute_motion): Process display vector front to back
7529 rather than the other way around. (Bug#2496)
7530
2ba8e008
SM
75312011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7532
7533 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
7534
20f53c69
CY
75352011-09-11 Chong Yidong <cyd@stupidchicken.com>
7536
7537 * minibuf.c (Fread_from_minibuffer): Doc fix.
7538
d562d7a4
EZ
75392011-09-11 Eli Zaretskii <eliz@gnu.org>
7540
7541 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7542 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7543
1c4d7f3d
LMI
75442011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7545
7546 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7547 value for non-existent files.
7548
b885bf36
EZ
75492011-09-11 Eli Zaretskii <eliz@gnu.org>
7550
7551 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7552 set its "size" to -1. This will set the modtime_size field of
7553 the corresponding buffer to -1, which is what
7554 verify-visited-file-modtime expects for files that do not exist.
7555 (Bug#9139)
7556
6612f0bf
PE
75572011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7558
7559 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7560 here ...
7561 * lisp.h: ... from here. push_key_description is no longer
7562 defined in keyboard.c, so its declaration should not be in
7563 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7564 logically belongs with push_key_description.
7565
dfb3f755
PE
75662011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 * buffer.h: Include <sys/types.h> instead of <time.h>.
7569 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7570 Problem reported by Herbert J. Skuhra.
7571
3134906c
LMI
75722011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7573
7574 * xml.c (parse_region): Make the parsing work for
7575 non-comment-starting XML files again (bug#9144).
7576
8d903f4e
AS
75772011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7578
7579 * image.c (gif_load): Fix calculation of bottom and right corner.
7580 (Bug#9468)
7581
80ad64f4
EZ
75822011-09-10 Eli Zaretskii <eliz@gnu.org>
7583
7584 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7585 redisplay in small windows.
7586
208a048d
EZ
75872011-09-09 Eli Zaretskii <eliz@gnu.org>
7588
7589 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7590
9b1c252e
MR
75912011-09-08 Martin Rudalics <rudalics@gmx.at>
7592
7593 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7594 Operate on live windows only.
7595
2949f33b
JB
75962011-09-08 Juanma Barranquero <lekktu@gmail.com>
7597
7598 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7599
e08dcafd
EZ
76002011-09-07 Eli Zaretskii <eliz@gnu.org>
7601
7602 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7603 only under bidi iteration.
7604
115b96bd
JD
76052011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7606
7607 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7608
c8199d0f
PE
76092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7610
7611 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7612 Without this fix, the command to link temacs failed due to an
7613 undefined symbol __builtin_isnan. This is because
7614 /usr/include/iso/math_c99.h #defines isnan(x) to
7615 __builtin_isnan(x), but the bundled gcc, which identifies itself
7616 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7617 a __builtin_isnan.
7618 * floatfns.c (isnan): #undef, and then #define to a clone of
7619 what's in data.c.
7620 (Fisnan): Always define, since it's always available now.
7621 (syms_of_floatfns): Always define isnan at the Lisp level.
7622
e39b275c 76232011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
7624
7625 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7626
b2db44d9 76272011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 7628
f4af5137 7629 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
7630 The previous code assumed that file offsets (off_t values) fit in
7631 EMACS_INT variables, which is not true on typical 32-bit hosts.
7632 The code messed up by falsely reporting buffer overflow in cases
7633 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7634 when "big" contains more than 2**29 bytes, even though this
7635 inserts just one byte and does not overflow the buffer.
7636 (Finsert_file_contents): Store file offsets as off_t
7637 values, not as EMACS_INT values. Check for overflow when
7638 converting between EMACS_INT and off_t. When checking for
7639 buffer overflow or for overlap, take the offsets into account.
7640 Don't use EMACS_INT for small values where int suffices.
7641 When checking for overlap, fix a typo: ZV was used where
7642 ZV_BYTE was intended.
7643 (Fwrite_region): Don't assume off_t fits into 'long'.
7644 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7645
ecfc0a49
MA
76462011-09-05 Michael Albinus <michael.albinus@gmx.de>
7647
7648 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7649
6511acf2 76502011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 7651
0999621a 7652 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
7653
7654 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 7655 (esprintf, exprintf, evxprintf): New functions.
62f19c19 7656 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 7657 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
7658 (modify_event_symbol): Do not assume that the length of
7659 name_alist_or_stem is safe to alloca and fits in int.
7660 (Fexecute_extended_command): Likewise for function name and binding.
7661 (Frecursion_depth): Wrap around reliably on integer overflow.
7662 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7663 since some callers pass EMACS_INT values.
7664 (Fsingle_key_description): Don't crash if symbol name contains more
7665 than MAX_ALLOCA bytes.
7666 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7667 (get_minibuffer): Arg is now EMACS_INT, not int.
7668 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 7669 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
7670 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7671
2be7d702
PE
7672 * dbusbind.c (signature_cat): New function.
7673 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
7674 Do not overrun buffer; instead, report string overflow.
7675
9d1df220
PE
7676 * dispnew.c (add_window_display_history): Don't overrun buffer.
7677 Truncate instead; this is OK since it's just a log.
7678
33ef5c64
PE
7679 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7680 even if the time zone offset is outlandishly large.
7681 Don't mishandle offset == INT_MIN.
7682
66c6fdd5
PE
7683 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7684 when creating daemon; the previous buffer-overflow check was incorrect.
7685
d749b01b
PE
7686 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7687 which has the guts of the old verror function.
7688
b5cd1905
PE
7689 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7690 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7691
6e1a67fb
PE
7692 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7693 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 7694 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 7695 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
7696 length of string rather than counting it via multiple sprintfs;
7697 that's simpler and more reliable.
c21721cc
PE
7698 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7699 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7700 sprintf, in case result does not fit in int.
7701
c57b67fc
PE
7702 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7703 (fontset_from_font): Print it.
7704
8a401434
PE
7705 * frame.c (tty_frame_count): Now printmax_t, not int.
7706 (make_terminal_frame, set_term_frame_name): Print it.
7707 (x_report_frame_params): In X, window IDs are unsigned long,
7708 not signed long, so print them as unsigned.
7709 (validate_x_resource_name): Check for implausibly long names,
7710 and don't assume name length fits in 'int'.
7711 (x_get_resource_string): Don't blindly alloca invocation name;
7712 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7713 not fit in int.
7714
6e1a67fb
PE
7715 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7716 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
7717 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7718
0df02bf3
PE
7719 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7720 Use esprintf, not sprintf, in case result does not fit in int.
7721
48e30793
PE
7722 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7723 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7724 it as a large positive number.
7725 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7726 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7727
a66ff6d8
PE
7728 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7729 in case result does not fit in int.
7730
aca216ff
PE
7731 * print.c (float_to_string): Detect width overflow more reliably.
7732 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7733 buffer overrun. Don't assume list length fits in 'int'. Treat
7734 print length of 0 as 0, not as infinity; to be consistent with other
7735 uses of print length in this function. Don't overflow print length
7736 index. Don't assume hash table size fits in 'long', or that
7737 vectorlike size fits in 'unsigned long'.
7738
31c286f7
PE
7739 * process.c (make_process): Use printmax_t, not int, to format
7740 process-name gensyms.
7741
55e5faa1
PE
7742 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7743
80f2e268
PE
7744 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7745 to avoid potential buffer overrun.
7746
670741ab
PE
7747 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7748 if X resource line is longer than 512 bytes.
7749
b7163a50
PE
7750 * xfns.c (x_window): Make sprintf buffer a bit bigger
7751 to avoid potential buffer overrun.
7752
ae58ff1f
PE
7753 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7754
c43c8a6a
PE
7755 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7756
3f8236f4
PE
77572011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7758
53e9fe90 7759 Integer overflow fixes for scrolling, etc.
6511acf2
PE
7760 Without these, Emacs silently mishandles large integers sometimes.
7761 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
7762 it were "C-u 1 M-x recenter" on a typical 64-bit host.
7763
6511acf2
PE
7764 * xdisp.c (try_window_id): Check Emacs fixnum range before
7765 converting to 'int'.
806add1d 7766
6511acf2 7767 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
7768 Check that an Emacs fixnum is in range before assigning it to 'int'.
7769 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
7770 values converted from Emacs fixnums.
7771 (Frecenter): Don't wrap around a line count if it is out of 'int'
7772 range; instead, treat it as an extreme value.
7773 (Fset_window_configuration, compare_window_configurations):
7774 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
7775
6511acf2
PE
7776 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
7777 that can exceed INT_MAX. Check that EMACS_INT value is in range
7778 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
7779 (match_limit): Don't assume that a fixnum can fit in 'int'.
7780
6511acf2 7781 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
7782 exceed INT_MAX.
7783
6511acf2 7784 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
7785 (Fvertical_motion): Don't wrap around LINES values that don't fit
7786 in 'int'. Instead, treat them as extreme values. This is good
7787 enough for windows, which can't have more than INT_MAX lines anyway.
7788
fcb901a7
LMI
77892011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7790
0f2f6b6d
LMI
7791 * Require libxml/parser.h to avoid compilation warning.
7792
fcb901a7
LMI
7793 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
7794
7795 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
7796 since this reportedly can destroy thread storage.
7797
6e20a0d4
CY
77982011-08-30 Chong Yidong <cyd@stupidchicken.com>
7799
7800 * syntax.c (find_defun_start): Update all cache variables if
7801 exiting early (Bug#9401).
7802
148ae00e
EZ
78032011-08-30 Eli Zaretskii <eliz@gnu.org>
7804
f6cfbd8f
EZ
7805 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
7806
148ae00e
EZ
7807 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
7808 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
7809 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
7810
7811 * term.c (tty_append_glyph): New function.
7812 (produce_stretch_glyph): Static function and its prototype deleted.
7813
a66cfb1c
SM
7814 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
7815 Add prototypes.
148ae00e 7816
c4a07a4c
PE
78172011-08-29 Paul Eggert <eggert@cs.ucla.edu>
7818
7819 * image.c (parse_image_spec): Check for nonnegative, not for positive,
7820 when checking :margin (Bug#9390).
7821 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 7822 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
7823 so that the name doesn't mislead. All uses changed.
7824
6bc8cd65
JB
78252011-08-28 Johan Bockgård <bojohan@gnu.org>
7826
7827 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
7828 set_tty_hooks.
7829
dca4927e
EZ
78302011-08-27 Eli Zaretskii <eliz@gnu.org>
7831
7832 * xdisp.c (move_it_to): Don't bail out early when reaching
7833 position beyond to_charpos, if we are scanning backwards.
7834 (move_it_vertically_backward): When DY == 0, make sure we get to
7835 the first character in the line after the newline.
7836
f2cad773
PE
78372011-08-27 Paul Eggert <eggert@cs.ucla.edu>
7838
7839 * ccl.c: Improve and simplify overflow checking (Bug#9196).
7840 (ccl_driver): Do not generate an out-of-range pointer.
7841 (Fccl_execute_on_string): Remove unnecessary check for
7842 integer overflow, noted by Stefan Monnier in
7843 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
7844 Remove a FIXME that didn't need fixing.
7845 Simplify the newly-introduced buffer reallocation code.
7846
0cae2cdb
JB
78472011-08-27 Juanma Barranquero <lekktu@gmail.com>
7848
7849 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
7850
5fc295a4 78512011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 7852
70c60eb2 7853 Integer and memory overflow issues (Bug#9196).
726e0ab1 7854
d31850da
PE
7855 * doc.c (get_doc_string): Rework so that
7856 get_doc_string_buffer_size is the actual buffer size, rather than
7857 being 1 less than the actual buffer size; this makes xpalloc more
7858 convenient.
7859
a69fbedb
PE
7860 * image.c (x_allocate_bitmap_record, cache_image):
7861 * xselect.c (Fx_register_dnd_atom):
7862 Simplify previous changes by using xpalloc.
7863
fe5c5d37
PE
7864 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
7865 since either will do and ptrdiff_t is convenient with xpalloc.
7866
0065d054
PE
7867 * charset.c (charset_table_size)
7868 (struct charset_sort_data.priority): Now ptrdiff_t.
7869 (charset_compare): Don't overflow if priorities differ greatly.
7870 (Fsort_charsets): Don't assume list length fits in int.
7871 Check for size-calculation overflow when allocating sort data.
7872 (syms_of_charset): Allocate an initial charset table that is
7873 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7874
7875 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7876
7877 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7878 The actual value is always <= INT_MAX, and leaving it unsigned made
7879 overflow checking harder.
7880
7881 * dispextern.h (struct glyph_matrix.rows_allocated)
7882 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7883 with xpalloc. The values are still always <= INT_MAX.
7884
7885 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7886
7887 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7888 (SAFE_NALLOCA): New macro.
7889
7890 * region-cache.c (struct boundary.pos, find_cache_boundary)
7891 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7892 (set_cache_region, invalidate_region_cache)
7893 (revalidate_region_cache, know_region_cache, region_cache_forward)
7894 (region_cache_backward, pp_cache):
7895 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7896 so that ptrdiff_t * can be passed to xpalloc.
7897 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7898 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7899 (pp_cache): Don't assume cache_len fits in int.
7900 * region-cache.h: Adjust extern decls to match.
7901
7902 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7903 EMACS_INT, since either will do, for xpalloc.
7904
7905 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7906 (xnmalloc, xnrealloc, xpalloc): New functions.
7907
726e0ab1
PE
7908 * bidi.c (bidi_shelve_header_size): New constant.
7909 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7910 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7911
51f30bc5 7912 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
7913 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7914 (overlay_strings):
7915 Don't update size of array until after memory allocation succeeds,
7916 because xmalloc/xrealloc may not return.
0065d054
PE
7917 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7918 now that we have proper integer overflow checking.
7919 (record_overlay_string, overlay_strings): Catch overflows when
7920 calculating size of overlay_str_buf.
726e0ab1 7921
0065d054
PE
7922 * callproc.c (Fcall_process): Check for size overflow when
7923 calculating size of args2.
7924 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7925 Normally we prefer signed values, but sticking with ptrdiff_t would
7926 require adding more-complicated checks.
726e0ab1
PE
7927
7928 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7929 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7930 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 7931 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
7932
7933 * character.c (Fstring): Check for size-calculation overflow.
7934
7935 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7936 unnecessary integer overflow. Check for size overflow.
7937 (encode_coding_object): Don't update size until xmalloc succeeds.
7938
7939 * composite.c (get_composition_id): Check for overflow in glyph
7940 length calculations.
7941
7942 Integer and memory overflow fixes for display code.
7943 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7944 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7945 (scrolling_window): Check for overflow in size calculations.
7946 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7947 Don't assume glyph table len fits in int.
7948 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7949 (row_table_size): Now ptrdiff_t, not int.
7950 (scrolling_window): Avoid overflow in size calculations.
7951 Don't update size until allocation succeeds.
7952 * fns.c (concat): Check for overflow in size calculations.
7953 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7954 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7955 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7956
7957 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7958 (get_doc_string): Check for size calculation overflow.
7959 Don't update size until allocation succeeds.
7960 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7961 EMACS_INT, where ptrdiff_t will do.
7962 (Fsubstitute_command_keys): Check for string overflow.
7963
7964 * editfns.c (set_time_zone_rule): Don't assume environment length
7965 fits in int.
7966 (message_length): Now ptrdiff_t, not int.
7967 (Fmessage_box): Don't update size until allocation succeeds.
7968 Don't assume message length fits in int.
7969 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7970
0065d054
PE
7971 * emacs.c (main): Do not reallocate argv, since there is a null at
7972 the end that can be overwritten, and this way there's no need to
7973 worry about size-calculation overflow.
7974 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
7975
7976 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7977 alloc succeeds.
7978 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7979
7980 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7981 (x_set_scroll_bar_width, x_figure_window_size):
7982 Check for integer overflow.
7983 (x_set_alpha): Do not assume XINT fits in int.
7984
7985 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7986 This is for the members text_lines, text_cols, total_lines, total_cols,
7987 where the system imposes an 'int' limit.
7988
7989 * fringe.c (Fdefine_fringe_bitmap):
7990 Don't update size until alloc works.
7991
7992 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7993 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
7994
7995 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
7996 Check for size-calculation overflow.
7997 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
7998 do, as we prefer signed integers.
7999 (id_to_widget.max_size, id_to_widget.used)
8000 (xg_store_widget_in_map, xg_remove_widget_from_map)
8001 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
8002 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
8003 Use and return ptrdiff_t, not int.
8004 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
8005 * gtkutil.h: Change prototypes to match the above.
8006
8007 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
8008 are duplicate now that they've been promoted to lisp.h.
8009 (x_allocate_bitmap_record, x_alloc_image_color)
8010 (make_image_cache, cache_image, xpm_load):
8011 Don't update size until alloc is done.
8012 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
8013 (x_detect_edges):
3256efce 8014 Check for size calculation overflow.
726e0ab1
PE
8015 (ct_colors_allocated_max): New constant.
8016 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
8017 overflow.
3256efce 8018
726e0ab1
PE
8019 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
8020 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
8021 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
8022 Use ptrdiff_t, not int, to count maps.
8023 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
8024 calculations. Don't update size until allocation succeeds.
8025 Redo calculations to avoid overflow.
726e0ab1
PE
8026 * keyboard.h: Change prototypes to match the above.
8027
8028 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
8029 to count maps.
8030 (current_minor_maps): Check for size calculation overflow.
8031 * keymap.h: Change prototypes to match the above.
8032
8033 * lread.c (read1, init_obarray): Don't update size until alloc done.
8034
8035 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
8036 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
8037
726e0ab1
PE
8038 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
8039 Now ptrdiff_t, not int.
8040 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
8041 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
8042
8043 * process.c (Fnetwork_interface_list): Check for overflow
8044 in size calculation.
8045
8046 * region-cache.c (move_cache_gap): Check for size calculation overflow.
8047
8048 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
8049 overflow. Don't bother calling xmalloc when xrealloc will do.
8050
8051 * search.c (Freplace_match): Check for size calculation overflow.
8052 (Fset_match_data): Don't assume list lengths fit in 'int'.
8053
8054 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
8055 for command line length. Do not attempt to address one before the
8056 beginning of an array, as that's not portable.
8057
8058 * term.c (max_frame_lines): Remove; unused.
8059 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
8060 not int.
8061 (encode_terminal_code, calculate_costs): Check for size
8062 calculation overflow.
8063 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
8064 table lengths and related sizes. Don't update size until alloc
8065 done. Redo calculations to avoid overflow.
8066 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
8067
8068 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
8069 subtracting pointers.
8070 (gobble_line): Check for overflow more carefully. Don't update size
8071 until alloc done.
8072
8073 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
8074 Don't update size until alloc done.
8075 Redo size calculations to avoid overflow.
8076 Check for size calculation overflow.
0065d054 8077 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
8078
8079 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
8080 Use ptrdiff_t, not int, for sizes.
8081 (store_mode_line_noprop_char): Don't update size until alloc done.
8082
0065d054
PE
8083 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
8084 Use ptrdiff_t, not int, for sizes.
8085 (Finternal_make_lisp_face, cache_face):
8086 Check for size calculation overflow.
8087 (cache_face): Treat size calculation overflows as if they were
8088 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
8089
8090 * xfns.c (x_encode_text, x_set_name_internal)
8091 (Fx_change_window_property): Use ptrdiff_t, not int, to count
8092 sizes, since they can exceed INT_MAX in size. Check for size
8093 calculation overflow.
8094
0065d054
PE
8095 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
8096 (xg_select): Check for size calculation overflow.
726e0ab1
PE
8097 Don't update size until alloc done.
8098
0065d054 8099 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 8100 as sprintf is limited to int lengths.
1d526e2f 8101
252c5ee1
PE
8102 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
8103 (X_LONG_MIN): New macros.
864d7ce7
PE
8104 Use them to make the following changes clearer.
8105 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
8106 This change doesn't affect the value now, but it may help remind
8107 future maintainers not to raise the value too much later.
8108 (SELECTION_QUANTUM): Remove, replacing with ...
8109 (selection_quantum): ... new function, which avoids overflow.
8110 All uses changed.
8111 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
8112 assumption that selection length fits in 'int'.
8113 (x_reply_selection_request, x_handle_selection_request)
8114 (x_get_window_property, receive_incremental_selection)
8115 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
8116 (lisp_data_to_selection_data, clean_local_selection_data):
8117 Use ptrdiff_t, not int, to record length of selection.
8118 (x_reply_selection_request, x_get_window_property)
8119 (receive_incremental_selection, x_property_data_to_lisp):
8120 Redo calculations to avoid overflow.
8121 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 8122 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
8123 something.
8124 (x_get_window_property, receive_incremental_selection)
8125 (lisp_data_to_selection_data, x_property_data_to_lisp):
8126 Check for size-calculation overflow.
8127 (x_get_window_property, receive_incremental_selection)
8128 (lisp_data_to_selection_data, Fx_register_dnd_atom):
8129 Don't store size until memory allocation succeeds.
8130 (x_get_window_property): Plug memory leak on memory exhaustion.
8131 Don't double-block input; malloc is safe here. Don't assume 2**34
8132 - 4 fits in unsigned long. Add an xassert to check
8133 XGetWindowProperty overflow. Be more careful about overflow
8134 calculations, and distinguish size from memory overflow better.
8135 (receive_incremental_selection): When tracing, don't assume
8136 unsigned int is less than INT_MAX.
8137 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
8138 harmful) conversions of unsigned short to int.
8139 (lisp_data_to_selection_data): Don't assume that integers
8140 in the range -65535 through -1 fit in an X unsigned short.
8141 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
8142 result parameters unless successful. Rely on cons_to_unsigned
8143 to report problems with elements; the old code wasn't right anyway.
8144 (x_check_property_data): Check for int overflow; we cannot use
8145 a wider type due to X limits.
8146 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
8147
726e0ab1 8148 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 8149
0065d054
PE
8150 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
8151 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
8152 (x_color_cells): Don't store size until memory allocation succeeds.
8153 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 8154 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
8155 (x_term_init): Don't assume length fits in int (sprintf is limited
8156 to int size).
bc18e09d 8157
ebfa62c0
PE
8158 Use ptrdiff_t for composition IDs.
8159 * character.c (lisp_string_width):
8160 * composite.c (composition_table_size, n_compositions)
8161 (get_composition_id, composition_gstring_from_id):
8162 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
8163 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
8164 * window.c (Frecenter):
8165 Use ptrdiff_t, not int, for composition IDs.
8166 * composite.c (get_composition_id): Check for integer overflow.
8167 * composite.h: Adjust prototypes to match the above changes.
8168
d3411f89
PE
8169 Use ptrdiff_t for hash table indexes.
8170 * category.c (hash_get_category_set):
8171 * ccl.c (ccl_driver):
8172 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
8173 * coding.c (coding_system_charset_list, detect_coding_system):
8174 * coding.h (struct coding_system.id):
8175 * composite.c (get_composition_id, gstring_lookup_cache):
8176 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
8177 * image.c (xpm_get_color_table_h):
8178 * lisp.h (hash_lookup, hash_put):
8179 * minibuf.c (Ftest_completion):
8180 Use ptrdiff_t for hash table indexes, not int (which is too
8181 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
8182 32-bit --with-wide-int hosts).
8183
e097a6fa
PE
8184 * charset.c (Fdefine_charset_internal): Check for integer overflow.
8185 Add a FIXME comment about memory leaks.
8186 (syms_of_charset): Don't assume xmalloc returns.
8187
5637687f
PE
8188 Don't assume that stated character widths fit in int.
8189 * character.c (Fchar_width, c_string_width, lisp_string_width):
8190 * character.h (CHAR_WIDTH):
8191 * indent.c (MULTIBYTE_BYTES_WIDTH):
8192 Use sanitize_char_width to avoid undefined and/or bad behavior
8193 with outlandish widths.
a66cfb1c 8194 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
8195 now that we have two such functions. All uses changed.
8196 (sanitize_char_width): New inline function.
8197
a2271ba2
PE
8198 Don't assume that tab-width fits in int.
8199 * character.h (sanitize_width): New inline function.
8200 (SANE_TAB_WIDTH): New macro.
8201 (ASCII_CHAR_WIDTH): Use it.
8202 * indent.c (sane_tab_width): Remove. All uses replaced by
8203 SANE_TAB_WIDTH (current_buffer).
8204 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
8205
18c52557
PE
8206 * fileio.c: Integer overflow issues with file modes.
8207 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
8208
caeeedc1
PE
8209 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
8210 Remove unreachable code.
8211 (read_hex, load_charset_map_from_file): Check for integer overflow.
8212
6df6ae42 8213 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
8214 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
8215 (x_send_scroll_bar_event): Likewise. Check that the size does not
8216 exceed limits imposed by XClientMessageEvent, as well as the usual
8217 ptrdiff_t and size_t limits.
8218
b13995db
PE
8219 * keyboard.c: Overflow, signedness and related fixes.
8220 (make_lispy_movement): Use same integer type in forward decl
8221 that is used in the definition.
8222 (read_key_sequence, keyremap_step):
8223 Change bufsize argument back to int, undoing my 2011-03-30 change.
8224 We prefer signed types, and int is wide enough here.
8225 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
8226 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
8227 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
8228 length, not size_t. Use ptrdiff_t for index, not int.
8229 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
8230 possibility of integer overflow.
8231
13464394
PE
8232 Overflow, signedness and related fixes for images.
8233
8234 * dispextern.h (struct it.stack[0].u.image.image_id)
8235 (struct_it.image_id, struct image.id, struct image_cache.size)
8236 (struct image_cache.used, struct image_cache.ref_count):
8237 * gtkutil.c (update_frame_tool_bar):
8238 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
8239 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
8240 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
8241 * nsmenu.m (update_frame_tool_bar):
8242 * xdisp.c (calc_pixel_width_or_height):
8243 * xfns.c (image_cache_refcount):
8244 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
8245 on typical 64-bit hosts.
8246
8247 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8248 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
8249 Omit unnecessary casts to int.
8250 (parse_image_spec): Check that integers fall into 'int' range
8251 when the callers expect that.
8252 (image_ascent): Redo ascent calculation to avoid int overflow.
8253 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
8254 (lookup_image): Remove unnecessary tests.
8255 (xbm_image_p): Locals are now of int, not EMACS_INT,
8256 since parse_image_check makes sure they fit into int.
8257 (png_load, gif_load, svg_load_image):
8258 Prefer int to unsigned where either will do.
8259 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
8260 old tiff_error_handler and tiff_warning_handler.
8261 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
8262 stack buffer overflows. It uses only the features of vsnprintf
8263 that are common to both POSIX and native Microsoft.
8264 (tiff_error_handler, tiff_warning_handler): Use it.
8265 (tiff_load, gif_load, imagemagick_load_image):
8266 Don't assume :index value fits in 'int'.
8267 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
8268 (imagemagick_load_image): Check that crop parameters fit into
8269 the integer types that MagickCropImage accepts. Don't assume
8270 Vimagemagick_render_type has a nonnegative value. Don't assume
8271 size_t fits in 'long'.
8272 (gs_load): Use printmax_t to print the widest integers possible.
8273 Check for integer overflow when computing image height and width.
8274
c11821d4
EZ
82752011-08-26 Eli Zaretskii <eliz@gnu.org>
8276
8277 * xdisp.c (redisplay_window): Don't force window start if point
8278 will be invisible in the resulting window. (Bug#9324)
8279
0c95fcf7
EZ
82802011-08-25 Eli Zaretskii <eliz@gnu.org>
8281
8282 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
8283 the display spec is of the form `(space ...)'.
8284 (handle_display_spec): Return the value returned by
8285 handle_single_display_spec, not just 1 or zero.
8286 (handle_single_display_spec): If the display spec is of the form
8287 `(space ...)', and specifies display in the text area, return 2
8288 rather than 1.
fee65a97 8289 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
8290 accurately, and prefer exact match for point under bidi.
8291 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
8292
8293 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
8294 into disp_prop; all users changed.
8295
8296 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
8297 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
8298 for the text covered by the display property.
8299
e4ed06f1
CY
83002011-08-25 Chong Yidong <cyd@stupidchicken.com>
8301
8302 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
8303 Change return value to nil.
8304 (Frecord_buffer): Delete unused function.
8305
f67cdd7f
EZ
83062011-08-24 Eli Zaretskii <eliz@gnu.org>
8307
5980d4c6
EZ
8308 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
8309 buffers, return left-to-right.
8610fe8b
EZ
8310 (set_cursor_from_row): Consider candidate row a win if its glyph
8311 represents a newline and point is on that newline. Fixes cursor
8312 positioning on the newline at EOL of R2L text within L2R
8313 paragraph, and vice versa.
8314 (try_cursor_movement): Check continued rows, in addition to
8315 continuation rows. Fixes unwarranted scroll when point enters a
8316 continued line of R2L text within an L2R paragraph, or vice versa.
8317 (cursor_row_p): Consider the case of point being equal to
8318 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
8319 from the end of a short line to the beginning of a continued line
8320 of R2L text within L2R paragraph.
8321 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
8322 composed characters.
5980d4c6 8323
f67cdd7f
EZ
8324 * bidi.c (bidi_check_type): Use xassert.
8325 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
8326 members.
8327
bca633fb
EZ
83282011-08-23 Eli Zaretskii <eliz@gnu.org>
8329
8330 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
8331 a character.
8332
4a5885a7
CY
83332011-08-23 Chong Yidong <cyd@stupidchicken.com>
8334
8335 * nsfont.m (ns_otf_to_script): Fix typo.
8336
0902a04e
KH
83372011-08-22 Kenichi Handa <handa@m17n.org>
8338
8339 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
8340 extra slot even if the purpose is char-code-property-table.
8341
1a2e6670
EZ
83422011-08-23 Eli Zaretskii <eliz@gnu.org>
8343
8ddde651
EZ
8344 * xdisp.c (redisplay_window): When computing centering_position,
8345 account for the height of the header line. (Bug#8874)
8346
425cc014
EZ
8347 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
8348 instead of CHAR_TO_BYTE. Fixes a crash when a completion
8349 candidate is selected by the mouse, and that candidate has a
8350 composed character under the mouse.
8351
1a2e6670
EZ
8352 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
8353 coordinates reported by pos-visible-in-window-p for a composed
8354 character in column zero.
8355
8b76d6f8
SM
83562011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
8357
8358 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
8359
dac347dd
EZ
83602011-08-22 Eli Zaretskii <eliz@gnu.org>
8361
8362 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
8363 consider it a hit if to_charpos is anywhere in the range of the
8364 composed buffer positions.
8365
e013fb34
CY
83662011-08-22 Chong Yidong <cyd@stupidchicken.com>
8367
8368 * image.c (gif_load): Don't assume that each subimage has the same
8369 dimensions as the base image. Handle disposal method that is
8370 "undefined" by the gif spec (Bug#9335).
8371
bd1ba3e8
CY
83722011-08-20 Chong Yidong <cyd@stupidchicken.com>
8373
8374 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 8375 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 8376
54a1215b
EZ
83772011-08-19 Eli Zaretskii <eliz@gnu.org>
8378
823564e5
EZ
8379 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8380 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8381 from an Org mode buffer to a Speedbar frame.
8382
54a1215b
EZ
8383 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8384 a composition, take its buffer position from IT->cmp_it.charpos.
8385 Fixes cursor positioning at the beginning of a line that begins
8386 with a composed character.
8387
9778ebcc
EZ
83882011-08-18 Eli Zaretskii <eliz@gnu.org>
8389
0be6ee06
EZ
8390 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8391 character bidirectional type, use STRONG_L instead. Fixes crashes
8392 in a buffer produced by `describe-categories'.
8393
9778ebcc
EZ
8394 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8395 members before the level stack, so they would be saved and
8396 restored when copying iterator state. Fixes incorrect reordering
8397 around TABs covered by display properties.
8398
156bffbe
AS
83992011-08-18 Andreas Schwab <schwab@linux-m68k.org>
8400
6b02f655 8401 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 8402
72ad093b
CY
84032011-08-17 Chong Yidong <cyd@stupidchicken.com>
8404
8405 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
8406 (internal_condition_case_2, internal_condition_case_n):
8407 Remove unnecessary aborts (Bug#9081).
72ad093b 8408
35774242
EZ
84092011-08-17 Eli Zaretskii <eliz@gnu.org>
8410
8411 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8412 has no `load' handler, try opening the file locally. (Bug#9311)
8413
db76dd85
KB
84142011-08-16 Ken Brown <kbrown@cornell.edu>
8415
8416 * gmalloc.c: Expand comment.
8417
b215eee5
EZ
84182011-08-16 Eli Zaretskii <eliz@gnu.org>
8419
8420 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8421 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
8422
a4579d33
KB
84232011-08-16 Ken Brown <kbrown@cornell.edu>
8424
8425 Fix memory allocation problems in Cygwin build (Bug#9273).
8426
8427 * unexcw.c ( __malloc_initialized): Declare external variable.
8428 (fixup_executable): Force the dumped emacs to reinitialize malloc.
8429
8b76d6f8
SM
8430 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8431 New variables.
a4579d33
KB
8432 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8433 dumped emacs.
8434 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8435 in the static heap.
8436 [CYGWIN] (special_realloc): New function.
8437 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8438 requests to realloc storage in the static heap.
8439
3ebec551
PE
84402011-08-15 Paul Eggert <eggert@cs.ucla.edu>
8441
8442 * bidi.c (bidi_initialize): Remove unused local.
8443
9fd8be00
EZ
84442011-08-15 Eli Zaretskii <eliz@gnu.org>
8445
6b02f655
SM
8446 * bidimirror.h:
8447 * biditype.h: Remove file.
8448 * makefile.w32-in ($(BLD)/bidi.$(O)):
8449 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
8450
8451 * dispextern.h: Fix a typo in the comment to bidi_type_t.
8452
8453 * chartab.c: Improve commentary for the uniprop_table API.
8454
32413314
EZ
8455 * bidi.c (bidi_paragraph_init): Support zero value of
8456 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
8457 (bidi_initialize): Use uniprop_table instead of including
8458 biditype.h and bidimirror.h.
32413314 8459
9fd8be00
EZ
8460 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8461 coordinates of the iterator when restoring from ppos_it.
8462 (Bug#9296)
8463
5cf2b69b
KH
84642011-08-14 Kenichi Handa <handa@m17n.org>
8465
8466 * process.c (create_process): Call setup_process_coding_systems
72ad093b 8467 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 8468
daf17d00
EZ
84692011-08-14 Eli Zaretskii <eliz@gnu.org>
8470
8471 * xdisp.c (move_it_in_display_line_to): Don't invoke
8472 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8473 ppos_it. Fixes vertical cursor motion when line beginning is
8474 covered by an image. (Bug#9296)
8475
08e3161a
JD
84762011-08-14 Jan Djärv <jan.h.d@swipnet.se>
8477
8478 * nsterm.h (ns_run_ascript): Declare.
8479 (NSAPP_DATA2_RUNASSCRIPT): Define.
8480
8481 * nsfns.m (as_script, as_result, as_status): New static variables.
8482 (ns_run_ascript): New function.
5e617bc2 8483 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
8484 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8485 the event loop. Get status from as_status (Bug#7276).
8486
8487 * nsterm.m (sendEvent): If event is NSApplicationDefined and
8488 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8489 the event loop (Bug#7276).
8490
a3720aa2
AS
84912011-08-14 Andreas Schwab <schwab@linux-m68k.org>
8492
8493 * gnutls.c (QCgnutls_bootprop_priority)
8494 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8495 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8496 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8497 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8498 (QCgnutls_bootprop_verify_hostname_error)
8499 (QCgnutls_bootprop_callbacks_verify): Rename from
8500 Qgnutls_bootprop_..., all uses changed.
8501
8502 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8503 uses changed.
8504
0a0d27fb
PE
85052011-08-14 Paul Eggert <eggert@cs.ucla.edu>
8506
19d5c50c
PE
8507 * xfaces.c (Qframe_set_background_mode): Now static.
8508 * dispextern.h (Qframe_set_background_mode): Remove decl.
8509
0a0d27fb
PE
8510 * process.c (Fnetwork_interface_info): Declare local only if needed.
8511
377538cb
JD
85122011-08-13 Jan Djärv <jan.h.d@swipnet.se>
8513
8514 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8515 (Fnetwork_interface_list): Allocate in increments of bytes instead
8516 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
8517 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
8518 sockaddr.
8519 (struct ifflag_def): notrailers is smart on OSX.
8520 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
8521 Get hardware address with getifaddrs if available.
8522
08fff70c
EZ
85232011-08-12 Eli Zaretskii <eliz@gnu.org>
8524
8525 * xdisp.c (iterate_out_of_display_property): xassert that
8526 IT->position is set to within IT->object's boundaries. Break from
8527 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
8528 when IT->position is set up wrongly due to some bug.
8529 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
8530 (push_display_prop): Allow GET_FROM_STRING as IT->method on
8531 entry. Force push_it to save on the stack the current
8532 buffer/string position, to be restored by pop_it. Fix flags in
8533 the iterator structure wrt the object coming from a display
8534 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
8535 properties. (Bug#9284)
8536
7be1c708 85372011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 8538
7be1c708
CY
8539 * fontset.c (fontset_get_font_group): Add proper type checks.
8540 (Bug#9172)
aac0c6e3 8541
7be1c708 85422011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 8543
7be1c708
CY
8544 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8545 and LC_VERSION_MIN_MACOSX.
8546 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8547 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 8548
97bb72a6
EZ
85492011-08-08 Eli Zaretskii <eliz@gnu.org>
8550
8551 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
8552 no-display-properties-and-no-overlays under bidi display.
8553 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 8554 properties and overlays.
97bb72a6 8555
d5617611
CY
85562011-08-08 Chong Yidong <cyd@stupidchicken.com>
8557
37e11a63
CY
8558 * editfns.c (Fset_time_zone_rule): Document relationship with the
8559 setenv function.
8560
d5617611
CY
8561 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8562 the font entity extracted from the cache (Bug#8109).
8563
58872834
CY
85642011-08-07 Chong Yidong <cyd@stupidchicken.com>
8565
8566 * composite.c (autocmp_chars): Don't reset point. That is done by
8567 restore_point_unwind (Bug#5984).
8568
75bfc667
JL
85692011-08-07 Juri Linkov <juri@jurta.org>
8570
8571 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8572 to show the arg `TIME' instead of `TIMEVAL'.
8573
d1410150
EZ
85742011-08-06 Eli Zaretskii <eliz@gnu.org>
8575
8576 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8577 display property strides EOL and includes a newline, as in
8578 longlines-mode. (Bug#9254)
75b771e4
EZ
8579 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8580 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
8581
8582 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8583 is non-zero, even if the data buffer is NULL. Fixes a crash in
8584 vertical-motion with longlines-mode. (Bug#9254)
8585
35928349
EZ
85862011-08-05 Eli Zaretskii <eliz@gnu.org>
8587
ec7cc85b
EZ
8588 * bidi.c <bidi_cache_total_alloc>: Now static.
8589 (bidi_initialize): Initialize bidi_cache_total_alloc.
8590
8b76d6f8 8591 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
8592 cache. (Bug#9221)
8593
8594 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8595 amount allocated this far in `bidi_cache_total_alloc'.
8596 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8597 non-zero, only free the data buffer without restoring the cache
8598 contents. All callers changed.
8599
8600 * dispextern.h (bidi_unshelve_cache): Update prototype.
8601
8602 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8603 (move_it_in_display_line, move_it_to)
8604 (move_it_vertically_backward, move_it_by_lines): Replace the call
8605 to xfree to an equivalent call to bidi_unshelve_cache.
8606 (move_it_in_display_line_to): Fix logic of returning
412b6358 8607 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 8608
e2e2423b
EZ
86092011-08-05 Eli Zaretskii <eliz@gnu.org>
8610
8611 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8612 came from a string character with a `cursor' property. (Bug#9229)
8613
ae9e757a
JD
86142011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8615
8616 * Makefile.in (LIB_PTHREAD): New variable.
8617 (LIBES): Add LIB_PTHREAD (Bug#9216).
8618
8619 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8620 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8621
213bd7f2
AS
86222011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8623
6b02f655 8624 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 8625
99aaf75f
JD
86262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8627
8628 * xterm.c (x_find_topmost_parent): New function.
8629 (x_set_frame_alpha): Find topmost parent window with
8630 x_find_topmost_parent and set the property there also (bug#9181).
8631 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8632
c74e9d86
PE
86332011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8634
8635 * callproc.c (Fcall_process): Avoid vfork clobbering
8636 the local vars buffer, coding_systems, current_dir.
8637
640c8776
SM
86382011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8639
8640 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8641
f26d0e4c
PE
86422011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8643
8a10d76c
PE
8644 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8645 so that it is not optimized away.
8646
f26d0e4c
PE
8647 * xdisp.c (compute_display_string_pos): Remove unused local.
8648
55439c61
EZ
86492011-08-02 Eli Zaretskii <eliz@gnu.org>
8650
8651 Fix slow cursor motion and scrolling in large buffers with
8652 selective display, like Org Mode buffers. (Bug#9218)
8653
8654 * dispextern.h (struct bidi_it): New member disp_prop_p.
8655
8656 * xdisp.c: Remove one-slot cache of display string positions.
8657 (compute_display_string_pos): Accept an additional argument
5e617bc2 8658 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
8659 for a display string or property. If found, set DISP_PROP_P
8660 non-zero.
8661
8662 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
8663 DISP_PROP_P, and pass it to compute_display_string_pos.
8664 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
8665 non-zero. All callers of bidi_fetch_char changed.
8666
fb33fa43
SM
86672011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8668
8669 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8670
b099e063
DM
86712010-12-03 Don March <don@ohspite.net>
8672
8673 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8674 last character M-[char] is translated to ESC [char] (bug#7541).
8675
5cc7f7af
KH
86762011-08-02 Kenichi Handa <handa@m17n.org>
8677
d0fffa3f 8678 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
8679
8680 * chartab.c (uniprop_table): Make it non-static.
8681
525d5e6e
EZ
86822011-08-01 Eli Zaretskii <eliz@gnu.org>
8683
8684 * xdisp.c (forward_to_next_line_start): Accept additional argument
8685 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8686 on the newline.
8687 (reseat_at_next_visible_line_start): Use the bidi iterator state
8688 returned by forward_to_next_line_start to restore the state of
8689 it->bidi_it after backing up to previous newline. (Bug#9212)
8690
31011111
AS
86912011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8692
8693 * regex.c (re_comp): Protoize.
8694 (re_exec): Fix return type.
8695 (regexec): Fix type of `ret'. (Bug#9203)
8696
476371c4
PE
86972011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8698
e5d76069
PE
8699 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8700 This is needed if max-image-size is a floating-point number.
8701
9a79b20c
AS
87022011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8703
8704 * print.c (print_object): Print empty symbol as ##.
8705
8706 * lread.c (read1): Read ## as empty symbol.
8707
d8c2fa78
AA
87082011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8709
8710 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8711 setting frame foreground color (Bug#9175).
8712 (x_set_background_color): Likewise.
8713
ffe57a7a
AA
8714 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8715 contents (Bug#9176).
8716 (EmacsTooltip -init): Remove bezels and add shadows to
8717 tooltip windows.
8718
bf3492a5
AA
8719 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8720 or scroll bar (Bug#8470).
8721
d55e9c53
AA
8722 * nsfont.m (nsfont_open): Remove assignment to voffset and
8723 unnecessary vars hshink, expand, hd, full_height, min_height.
8724 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8725
8726 * nsterm.h (nsfont_info): Remove voffset field.
8727
d8c2fa78 87282011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
8729
8730 Implement strike-through and overline on NextStep (Bug#8863).
8731
8732 * nsfont.m (nsfont_open): Use underline position provided by font,
8733 instead of hard-coded value of 2.
8734 (nsfont_draw): Call ns_draw_text_decoration instead.
8735
8736 * nsterm.h: Add declaration for ns_draw_text_decoration.
8737
8738 * nsterm.m (ns_draw_text_decoration): New function for drawing
8739 underline, overline, and strike-through.
8740 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8741 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 8742 accommodate underlining, etc.
4843aac3 8743
4cc60b9b
EZ
87442011-07-28 Eli Zaretskii <eliz@gnu.org>
8745
bc7ece87
EZ
8746 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8747 default.
4cc60b9b 8748
476371c4
PE
87492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8750
66606eea
PE
8751 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8752 Without this fix, if a signal arrives just after memory fills up,
8753 'malloc' might be invoked reentrantly.
8754
476371c4
PE
8755 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8756 In other words, assume that every image size is allowed, on non-X
8757 hosts. This assumption is probably wrong, but it lets Emacs compile.
8758
f3fcc40d
AS
87592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8760
8761 * regex.c (re_iswctype): Convert return values to boolean.
8762
350c992f
EZ
87632011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
8764
8765 * xdisp.c (compute_display_string_pos): Don't use cached display
8766 string position if the buffer had its restriction changed.
8767 (Bug#9184)
8768
5266b4bb
PE
87692011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8770
8771 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8772
2573a837 87732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 8774
41f55ccd 8775 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 8776
39e378da
PE
8777 * bidi.c: Integer size and overflow fixes.
8778 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
8779 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
8780 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8781 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
8782 (bidi_find_other_level_edge):
8783 Use ptrdiff_t instead of EMACS_INT where either will do.
8784 This works better on 32-bit hosts configured --with-wide-int.
8785 (bidi_cache_ensure_space): Check for size-calculation overflow.
8786 Use % rather than repeated addition, for better worst-case speed.
8787 Don't set bidi_cache_size until after xrealloc returns, because it
8788 might not return.
8789 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
8790 (bidi_cache_ensure_space): Also check that the bidi cache size
8791 does not exceed that of the largest Lisp string or buffer. See Eli
8792 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 8793
5e927815
PE
8794 * alloc.c (__malloc_size_t): Remove.
8795 All uses replaced by size_t. See Andreas Schwab's note
8796 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
8797
ca4aa935
PE
8798 * image.c: Improve checking for integer overflow.
8799 (check_image_size): Assume that f is nonnull, since
8800 it is always nonnull in practice. This is one less thing to
8801 worry about when checking for integer overflow later.
8802 (x_check_image_size): New function, which checks for integer
8803 overflow issues inside X.
8804 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
8805 This removes the need for a memory_full check.
8806 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
8807 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
8808 (xbm_read_bitmap_data): Change locals back to 'int', since
8809 their values must fit in 'int'.
8810 (xpm_load_image, png_load, tiff_load):
8811 Invoke x_create_x_image_and_pixmap earlier,
8812 to avoid much needless work if the image is too large.
8813 (tiff_load): Treat overly large images as if
8814 x_create_x_image_and_pixmap failed, not as malloc failures.
8815 (gs_load): Use x_check_image_size.
8816
5f8f9cc2
PE
8817 * gtkutil.c: Omit integer casts.
8818 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
8819 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
8820
5adf60bc
PE
8821 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
8822
c8907a93
PE
8823 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
8824 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
8825 would wrongly return t on a 64-bit host.
8826
e3c25c68
PE
8827 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
8828 The plain *_OVERFLOW macros run afoul of GCC bug 49705
8829 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
8830 and therefore cause GCC to emit a bogus diagnostic in some cases.
8831
3f791afe
PE
8832 * image.c: Integer signedness and overflow and related fixes.
8833 This is not an exhaustive set of fixes, but it's time to
8834 record what I've got.
8835 (lookup_pixel_color, check_image_size): Remove redundant decls.
8836 (check_image_size): Don't assume that arbitrary EMACS_INT values
8837 fit in 'int', or that arbitrary 'double' values fit in 'int'.
8838 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
8839 (tiff_load, imagemagick_load_image):
8840 Check for overflow in size calculations.
8841 (x_create_x_image_and_pixmap): Remove unnecessary test for
8842 xmalloc returning NULL; that can't happen.
8843 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
8844 (xpm_color_bucket): Use better integer hashing function.
8845 (xpm_cache_color): Don't possibly over-allocate memory.
8846 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
8847 (gif_memory_source):
8848 Use ptrdiff_t, not int or size_t, to record sizes.
8849 (png_load): Don't assume values greater than 2**31 fit in 'int'.
8850 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
8851 either works, as we prefer signed integers.
8852 (tiff_read_from_memory, tiff_write_from_memory):
8853 Return tsize_t, not size_t, since that's what the TIFF API wants.
8854 (tiff_read_from_memory): Don't fail simply because the read would
8855 go past EOF; instead, return a short read.
8856 (tiff_load): Omit no-longer-needed casts.
8857 (Fimagemagick_types): Don't assume size fits into 'int'.
8858
3cc5a532
PE
8859 Improve hashing quality when configured --with-wide-int.
8860 * fns.c (hash_string): New function, taken from sxhash_string.
8861 Do not discard information about ASCII character case; this
8862 discarding is no longer needed.
8863 (sxhash-string): Use it. Change sig to match it. Caller changed.
8864 * lisp.h: Declare it.
8865 * lread.c (hash_string): Remove, since we now use fns.c's version.
8866 The fns.c version returns a wider integer if --with-wide-int is
8867 specified, so this should help the quality of the hashing a bit.
8868
b312a492
PE
8869 * emacs.c: Integer overflow minor fix.
8870 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8871 Define only if GNU_LINUX.
8872 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8873
dfd153ae
PE
8874 * dispnew.c: Integer signedness and overflow fixes.
8875 Remove unnecessary forward decls, that were a maintenance hassle.
8876 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8877 All uses changed.
8878 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8879 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8880 (prepare_desired_row, line_draw_cost):
8881 Use int, not unsigned, where either works.
8882 (save_current_matrix, restore_current_matrix):
8883 Use ptrdiff_t, not size_t, where either works.
8884 (init_display): Check for overflow more accurately, and without
8885 relying on undefined behavior.
8886
a81d11a3
PE
8887 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8888 Remove, replacing with the new symbols in lisp.h. All uses changed.
8889 * fileio.c (make_temp_name):
8890 * filelock.c (lock_file_1, lock_file):
8891 * xdisp.c (message_dolog):
8892 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8893 Use pMd etc. instead.
8894 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8895 replacing the pWIDE etc. symbols removed from editfns.c.
8896
3300e6fd
PE
8897 * keyboard.h (num_input_events): Now uintmax_t.
8898 This is (very slightly) less likely to mess up due to wraparound.
8899 All uses changed.
8900
fd05c7e9
PE
8901 * buffer.c: Integer signedness fixes.
8902 (alloc_buffer_text, enlarge_buffer_text):
8903 Use ptrdiff_t rather than size_t when either will do, as we prefer
8904 signed integers.
8905
903fe15d
PE
8906 * alloc.c: Integer signedness and overflow fixes.
8907 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8908 (__malloc_size_t): Default to size_t, not to int.
8909 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8910 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8911 Prefer ptrdiff_t to size_t when either would do, as we prefer
8912 signed integers.
8913 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8914 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8915 Now const. Initialize with values that are in range even if char
8916 is signed.
8917 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8918 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8919 These functions do the right thing with sizes > 2**32.
8920 (check_depth): Now ptrdiff_t, not int.
8921 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8922 Adjust to new way of storing sizes. Check for size overflow bugs
8923 in rest of code.
8924 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8925 slightly wrong anyway, as it missed one instance of
8926 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8927 (refill_memory_reserve): Omit needless cast to size_t.
8928 (mark_object_loop_halt): Mark as externally visible.
8929
ac82cc6a
PE
8930 * xselect.c: Integer signedness and overflow fixes.
8931 (Fx_register_dnd_atom, x_handle_dnd_message):
8932 Use ptrdiff_t, not size_t, since we prefer signed.
8933 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8934 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8935 x_dnd_atoms_size and x_dnd_atoms_length.
8936
c2d1e36d
PE
8937 * doprnt.c: Prefer signed to unsigned when either works.
8938 * eval.c (verror):
8939 * doprnt.c (doprnt):
8940 * lisp.h (doprnt):
8941 * xdisp.c (vmessage):
8942 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8943 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8944 prefer signed arithmetic to avoid comparison confusion.
8945 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8946 but is a bit tricky.
8947
0e926e56
PE
8948 Assume freestanding C89 headers, string.h, stdlib.h.
8949 * data.c, doprnt.c, floatfns.c, print.c:
8950 Include float.h unconditionally.
8951 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8952 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8953 * regex.c: Likewise for stddef.h, string.h.
8954 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8955 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8956 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8957 (STDC_HEADERS): Remove obsolete defines.
8958 * sysdep.c: Include limits.h unconditionally.
8959
9cfdb3ec
PE
8960 Assume support for memcmp, memcpy, memmove, memset.
8961 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8962 * regex.c (memcmp, memcpy):
8963 Remove; we assume C89 now.
8964
8965 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8966 (__malloc_safe_bcopy): Remove; no longer needed.
8967
cf950e6b 8968 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
8969 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8970 well either way, and we prefer signed to unsigned.
8971
dbf38e02
LMI
89722011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8973
8974 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8975 closes the connection while we're reading (bug#9182).
8976
d6f0886c 89772011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 8978
d6f0886c
JD
8979 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8980 are specified (Bug#9168).
24e0f6b1 8981
2eb1f9e6
PE
89822011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8983
8984 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8985 Found by GCC static checking and --with-wide-int on a 32-bit host.
8986
22381272 89872011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
8988
8989 * xdisp.c (compute_display_string_pos): Fix logic of caching
8990 previous display string position. Initialize cached_prev_pos to
8991 -1. Fixes slow-down at the beginning of a buffer.
8992
f25e39b4
EZ
89932011-07-24 Eli Zaretskii <eliz@gnu.org>
8994
8995 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
8996 for attrs[LFACE_FONTSET_INDEX].
8997
04c4b52e
PE
89982011-07-23 Paul Eggert <eggert@cs.ucla.edu>
8999
9000 * xml.c (parse_region): Remove unused local
9001 that was recently introduced.
9002
c1734fbd
EZ
90032011-07-23 Eli Zaretskii <eliz@gnu.org>
9004
be18c5a5
EZ
9005 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
9006 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
9007
c1734fbd
EZ
9008 * xdisp.c (move_it_in_display_line_to): Record the best matching
9009 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
9010 exit if none of the characters scanned was an exact match.
9011 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
9012 when exact match is impossible due to invisible text, and the
9013 lines are truncated.
9014
a258d627
JD
90152011-07-23 Jan Djärv <jan.h.d@swipnet.se>
9016
9017 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
9018 for OSX >= 10.7.
9019
b6d5a689
EZ
90202011-07-22 Eli Zaretskii <eliz@gnu.org>
9021
0f74f785
EZ
9022 Fix a significant slow-down of cursor motion with C-n, C-p,
9023 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
9024 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 9025 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
9026 (next_element_from_buffer): Call compute_stop_pos_backwards to
9027 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
9028 base_level_stop.
9029 (reseat): Don't look for prev_stop, as that could mean a very long
9030 run.
9031 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
9032 <cached_disp_overlay_modiff>: Cache for last found display string
9033 position.
551918c1 9034 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
9035 about the same buffer in the same area of character positions, and
9036 the buffer wasn't changed since the time the display string
9037 position was cached.
551918c1 9038
b2d0c91a
EZ
90392011-07-22 Eli Zaretskii <eliz@gnu.org>
9040
9041 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
9042 is an integer, which is important for empty lines. (Bug#9149)
9043
043604ee
CY
90442011-07-22 Chong Yidong <cyd@stupidchicken.com>
9045
9046 * frame.c (Fmodify_frame_parameters): In tty case, update the
9047 default face if necessary (Bug#4238).
9048
da4adb04
CY
90492011-07-21 Chong Yidong <cyd@stupidchicken.com>
9050
9051 * editfns.c (Fstring_to_char): No need to explain what a character
9052 is in the docstring (Bug#6576).
9053
9abd0532
LMI
90542011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9055
9056 * xml.c (parse_region): Make sure we always return a tree.
9057
36881d16
HK
90582011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
9059
9060 * xml.c (parse_region): If a document contains only comments,
9061 return that, too.
9062
1e98674d
LMI
90632011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9064
9065 * xml.c (make_dom): Return comments, too.
9066
590bd467
PE
90672011-07-19 Paul Eggert <eggert@cs.ucla.edu>
9068
9069 Port to OpenBSD.
9070 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
9071 and the surrounding thread.
9072 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
9073 rather than fgets, and retry after EINTR. Otherwise, 'emacs
9074 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
9075 timer goes off.
9076 * s/openbsd.h (BROKEN_SIGIO): Define.
9077 * unexelf.c (unexec) [__OpenBSD__]:
9078 Don't update the .mdebug section of the Alpha COFF symbol table.
9079
f41628b2
LMI
90802011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9081
9082 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
9083 (bug#8460).
9084
b59b67c5
PE
90852011-07-18 Paul Eggert <eggert@cs.ucla.edu>
9086
15e3a074
PE
9087 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
9088 This fixes some race conditions on the permissions of any newly
9089 created file.
9090
41bed37d
PE
9091 * alloc.c (valid_pointer_p): Use pipe, not open.
9092 This fixes some permissions issues when debugging.
9093
b59b67c5
PE
9094 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
9095 If fchown fails to set both uid and gid, try to set just gid,
9096 as that is sometimes allowed. Adjust the file's mode to eliminate
9097 setuid or setgid bits that are inappropriate if fchown fails.
9098
925a6be7
SM
90992011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9100
9101 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
9102 to compare Lisp_Objects.
9103 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
9104 global_gnutls_log_level, don't mistake it for a Lisp_Object.
9105 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9106
52968808
AS
91072011-07-17 Andreas Schwab <schwab@linux-m68k.org>
9108
0a6a104b
AS
9109 * lread.c (read_integer): Unread even EOF character.
9110 (read1): Likewise. Properly record start position of symbol.
9111
52968808
AS
9112 * lread.c (read1): Read `#:' as empty uninterned symbol if no
9113 symbol character follows.
9114
9e381cdd
PE
91152011-07-17 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
9118 This works around a problem with the previous change to Fcopy_file.
9119 Recent glibc declares fchown with __attribute__((warn_unused_result)),
9120 and without this change, GCC might complain about discarding
9121 fchown's return value.
9122
b5641435
JB
91232011-07-16 Juanma Barranquero <lekktu@gmail.com>
9124
9125 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
9126
a8031457
PE
91272011-07-16 Paul Eggert <eggert@cs.ucla.edu>
9128
9129 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
9130
dd889327
LMI
91312011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
9132
750c33f7
LMI
9133 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
9134 it's used from the C level.
9135
dd889327
LMI
9136 * process.c: Use the same condition for POLL_FOR_INPUT in both
9137 keyboard.c and process.c (bug#1858).
9138
87e86684
LM
91392011-07-09 Lawrence Mitchell <wence@gmx.li>
9140
9141 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
9142 (Fgnutls_boot): Use it.
9143
64348f40
AS
91442011-07-15 Andreas Schwab <schwab@linux-m68k.org>
9145
9146 * doc.c (Fsubstitute_command_keys): Revert last change.
9147
1d698799
LMI
91482011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
9149
f863868c
LMI
9150 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
9151 quotes the next character, and doesn't affect other longer
9152 sequences (bug#8935).
9153
1d698799
LMI
9154 * lread.c (syms_of_lread): Clarify that is isn't only
9155 `eval-buffer' and `eval-defun' that's affected by
9156 `lexical-binding' (bug#8460).
9157
aa4b6df6
EZ
91582011-07-15 Eli Zaretskii <eliz@gnu.org>
9159
9160 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 9161 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 9162
5d856da6
PE
91632011-07-14 Paul Eggert <eggert@cs.ucla.edu>
9164
ad6042bb
PE
9165 Fix minor problems found by static checking.
9166 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
9167 (elsz): Now a signed constant, not a size_t var. We prefer signed
9168 types to unsigned, to avoid integer comparison confusion. Without
9169 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
9170 "cannot optimize loop, the loop counter may overflow", a symptom
9171 of the confusion.
f00bbb22 9172 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
9173 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
9174
6468f31c
LMI
91752011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9176
49080b10
LMI
9177 * search.c (Fre_search_backward): Mention `case-fold-search' in
9178 all the re_search_* functions (bug#8138).
9179
6468f31c
LMI
9180 * keyboard.c (Fopen_dribble_file): Document when the file is
9181 closed (bug#8056).
9182
c965adc5
EZ
91832011-07-14 Eli Zaretskii <eliz@gnu.org>
9184
df9733bf
EZ
9185 * bidi.c (bidi_dump_cached_states): Fix format of displaying
9186 bidi_cache_idx.
9187
0bb23927
EZ
9188 Support bidi reordering of display and overlay strings.
9189 * xdisp.c (compute_display_string_pos)
9190 (compute_display_string_end): Accept additional argument STRING.
9191 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
9192 (reseat_to_string): Initialize bidi_it->string.s and
9193 bidi_it->string.schars.
9194 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
9195 NULL (avoids a crash in bidi_paragraph_init).
9196 Initialize itb.string.lstring.
0bb23927
EZ
9197 (init_iterator): Call bidi_init_it only of a valid
9198 buffer position was specified. Initialize paragraph_embedding to
9199 L2R.
9200 (reseat_to_string): Initialize the bidi iterator.
9201 (display_string): If we need to ignore text properties of
9202 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
9203 original value of -1 will not work with bidi.)
9204 (compute_display_string_pos): First arg is now struct
9205 `text_pos *'; all callers changed. Support display properties on
9206 Lisp strings.
9207 (compute_display_string_end): Support display properties on Lisp
9208 strings.
9209 (init_iterator, reseat_1, reseat_to_string): Initialize the
9210 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
9211 when iterating on a string not from display properties).
640c8776
SM
9212 (compute_display_string_pos, compute_display_string_end):
9213 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
9214 arrow keys.
9215 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
9216 base_level_stop; instead, set base_level_stop to BEGV.
9217 Fixes crashes in vertical-motion.
0bb23927
EZ
9218 (next_element_from_buffer): Improve commentary for when
9219 the iterator is before prev_stop.
9220 (init_iterator): Initialize bidi_p from the default value of
9221 bidi-display-reordering, not from buffer-local value. Use the
9222 buffer-local value only if initializing for buffer iteration.
9223 (handle_invisible_prop): Support invisible properties on strings
9224 that are being bidi-reordered.
9225 (set_iterator_to_next): Support bidi reordering of C strings and
9226 Lisp strings.
9227 (next_element_from_string): Support bidi reordering of Lisp
9228 strings.
9229 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
9230 (display_string): Support display of R2L glyph rows.
9231 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
9232 (init_iterator): Don't initialize it->bidi_p for strings
9233 here.
9234 (reseat_to_string): Initialize it->bidi_p for strings here.
9235 (next_element_from_string, next_element_from_c_string)
9236 (next_element_from_buffer): Add xassert's for correspondence
9237 between IT's object being iterated and it->bidi_it.string
9238 structure.
9239 (face_before_or_after_it_pos): Support bidi iteration.
9240 (next_element_from_c_string): Handle the case of the first string
9241 character that is not the first one in the visual order.
9242 (get_visually_first_element): New function, refactored from common
9243 parts of next_element_from_buffer, next_element_from_string, and
9244 next_element_from_c_string.
9245 (tool_bar_lines_needed, redisplay_tool_bar)
9246 (display_menu_bar): Force left-to-right direction. Add a FIXME
9247 comment for making that be controlled by a user option.
9248 (push_it, pop_it): Save and restore the state of the
9249 bidi iterator. Save and restore the bidi_p flag.
9250 (pop_it): Iterate out of display property for string iteration as
9251 well.
9252 (iterate_out_of_display_property): Support iteration over strings.
9253 (handle_single_display_spec): Set up it->bidi_it for iteration
9254 over a display string, and call bidi_init_it.
9255 (handle_single_display_spec, next_overlay_string)
9256 (get_overlay_strings_1, push_display_prop): Set up the bidi
9257 iterator for displaying display or overlay strings.
9258 (forward_to_next_line_start): Don't use the shortcut if
9259 bidi-iterating.
9260 (back_to_previous_visible_line_start): If handle_display_prop
9261 pushed the iterator stack, restore the internal state of the bidi
9262 iterator by calling bidi_pop_it same number of times.
9263 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
9264 and we are bidi-iterating, don't decrement the iterator position;
9265 instead, set the first_elt flag in the bidi iterator, to produce
9266 the same effect.
9267 (reseat_1): Remove redundant setting of string_from_display_prop_p.
9268 (push_display_prop): xassert that we are iterating a buffer.
9269 (push_it, pop_it): Save and restore paragraph_embedding member.
9270 (handle_single_display_spec, next_overlay_string)
9271 (get_overlay_strings_1, reseat_1, reseat_to_string)
9272 (push_display_prop): Set up the `unibyte' member of bidi_it.string
9273 correctly. Don't assume unibyte strings are not bidi-reordered.
9274 (compute_display_string_pos)
9275 (compute_display_string_end): Fix handling the case of C string.
9276 (push_it, pop_it): Save and restore from_disp_prop_p.
9277 (handle_single_display_spec, push_display_prop): Set the
9278 from_disp_prop_p flag.
9279 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
9280 (pop_it): Call iterate_out_of_display_property only if we are
9281 popping after iteration over a string that came from a display
9282 property. Fix a typo in popping stretch info. Add an assertion
9283 for verifying that the iterator position is in sync with the bidi
9284 iterator.
9285 (handle_single_display_spec, get_overlay_strings_1)
9286 (push_display_prop): Fix initialization of paragraph direction for
9287 string when that of the parent object is not yet determined.
9288 (reseat_1): Call bidi_init_it to resync the bidi
9289 iterator with IT's position. (Bug#7616)
9290 (find_row_edges): If ROW->start.pos gives position
9291 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
9292 (handle_stop, back_to_previous_visible_line_start, reseat_1):
9293 Reset the from_disp_prop_p flag.
9294 (SAVE_IT, RESTORE_IT): New macros.
9295 (pos_visible_p, face_before_or_after_it_pos)
9296 (back_to_previous_visible_line_start)
9297 (move_it_in_display_line_to, move_it_in_display_line)
9298 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9299 (try_scrolling, redisplay_window, display_line): Use them when
9300 saving a temporary copy of the iterator and restoring it back.
9301 (back_to_previous_visible_line_start, reseat_1)
9302 (init_iterator): Empty the bidi cache "stack".
9303 (move_it_in_display_line_to): If iterator ended up at
9304 EOL, but we never saw any buffer positions smaller than
9305 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
9306 motion in bidi-reordered lines.
9307 (move_it_in_display_line_to): Record prev_method and prev_pos
9308 immediately before the call to set_iterator_to_next. Fixes cursor
9309 motion in bidi-reordered lines with stretch glyphs and strings
9310 displayed in margins. (Bug#8133) (Bug#8867)
9311 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
9312 TO_CHARPOS.
640c8776
SM
9313 (pos_visible_p): Support positions in bidi-reordered lines.
9314 Save and restore bidi cache.
0bb23927
EZ
9315
9316 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
9317 (bidi_paragraph_info): Delete unused struct.
9318 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
9319 (bidi_cache_start): New variable.
9320 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
9321 to zero.
9322 (bidi_cache_fetch_state, bidi_cache_search)
9323 (bidi_cache_find_level_change, bidi_cache_iterator_state)
9324 (bidi_cache_find, bidi_peek_at_next_level)
9325 (bidi_level_of_next_char, bidi_find_other_level_edge)
9326 (bidi_move_to_visually_next): Compare cache index with
9327 bidi_cache_start rather than with zero.
9328 (bidi_fetch_char): Accept new argument STRING; all callers
9329 changed. Support iteration over a string. Support strings with
9330 display properties. Support unibyte strings. Fix the type of
9331 `len' according to what STRING_CHAR_AND_LENGTH expects.
9332 (bidi_paragraph_init, bidi_resolve_explicit_1)
9333 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
9334 (bidi_level_of_next_char, bidi_move_to_visually_next):
9335 Support iteration over a string.
0bb23927
EZ
9336 (bidi_set_sor_type, bidi_resolve_explicit_1)
9337 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
9338 can now be zero (for strings); special values 0 and -1 were
9339 changed to -1 and -2, respectively.
9340 (bidi_char_at_pos): New function.
9341 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
9342 Call it instead of FETCH_MULTIBYTE_CHAR.
9343 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
9344 initialized to valid values.
9345 (bidi_init_it): Don't initialize charpos and bytepos with invalid
9346 values.
9347 (bidi_level_of_next_char): Allow the sentinel "position" to pass
9348 the test for valid cached positions. Fix the logic for looking up
9349 the sentinel state in the cache. GCPRO the Lisp string we are
9350 iterating.
9351 (bidi_push_it, bidi_pop_it): New functions.
9352 (bidi_initialize): Initialize the bidi cache start stack pointer.
9353 (bidi_cache_ensure_space): New function, refactored from part of
9354 bidi_cache_iterator_state. Don't assume the required size is just
9355 one BIDI_CACHE_CHUNK away.
9356 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
9357 (bidi_count_bytes, bidi_char_at_pos): New functions.
9358 (bidi_cache_search): Don't assume bidi_cache_last_idx is
9359 always valid if bidi_cache_idx is valid.
9360 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
9361 is valid if it's going to be used.
9362 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
9363 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
9364 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9365 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
9366 (bidi_find_other_level_edge, bidi_cache_start_stack):
9367 All variables related to cache indices are now EMACS_INT.
c965adc5 9368
0bb23927
EZ
9369 * dispextern.h (struct bidi_string_data): New structure.
9370 (struct bidi_it): New member `string'. Make flag members be 1-bit
9371 fields, and put them last in the struct.
640c8776
SM
9372 (compute_display_string_pos, compute_display_string_end):
9373 Update prototypes.
0bb23927
EZ
9374 (bidi_push_it, bidi_pop_it): Add prototypes.
9375 (struct iterator_stack_entry): New members bidi_p,
9376 paragraph_embedding, and from_disp_prop_p.
9377 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
9378 (bidi_shelve_cache, bidi_unshelve_cache):
9379 Declare prototypes.
0bb23927
EZ
9380
9381 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9382 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9383 and vector-like objects.
9384
9385 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9386 cache around display iteration.
9387
9388 * window.c (Fwindow_end, window_scroll_pixel_based)
9389 (displayed_window_lines, Frecenter): Save and restore the bidi
9390 cache around display iteration.
9391
3bbd2265
LMI
93922011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9393
9394 * editfns.c (Fdelete_region): Clarify the use of the named
9395 parameters (bug#6788).
9396
adc47434
MR
93972011-07-14 Martin Rudalics <rudalics@gmx.at>
9398
9399 * indent.c (Fvertical_motion): Set and restore w->pointm when
9400 saving and restoring the window's buffer (Bug#9006).
9401
837c31f8
LMI
94022011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
9403
9404 * editfns.c (Fstring_to_char): Clarify just what is returned
9405 (bug#6576). Text by Eli Zaretskii.
9406
ac389d0c
JB
94072011-07-13 Juanma Barranquero <lekktu@gmail.com>
9408
9409 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9410
0be0ce47
EZ
94112011-07-13 Eli Zaretskii <eliz@gnu.org>
9412
9413 * buffer.c (mmap_find): Fix a typo.
9414
cd18e7e3
JB
94152011-07-13 Johan Bockgård <bojohan@gnu.org>
9416
9417 Fix execution of x selection hooks.
9418 * xselect.c (Qx_lost_selection_functions)
9419 (Qx_sent_selection_functions): New vars.
9420 (syms_of_xselect): DEFSYM them.
9421 (x_handle_selection_request): Pass Qx_sent_selection_functions
9422 rather than Vx_sent_selection_functions to Frun_hook_with_args.
9423 (x_handle_selection_clear,x_clear_frame_selections):
9424 Pass Qx_lost_selection_functions rather than
9425 Vx_lost_selection_functions to Frun_hook_with_args.
9426
47ea7f44
PE
94272011-07-13 Paul Eggert <eggert@cs.ucla.edu>
9428
ac389d0c 9429 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
9430 The old code sometimes used this field without initializing it.
9431
47ea7f44
PE
9432 * alloc.c (gc_sweep): Don't read past end of array.
9433 In theory, the old code could also have corrupted Emacs internals,
9434 though it'd be very unlikely.
9435
bc985c87
AS
94362011-07-12 Andreas Schwab <schwab@linux-m68k.org>
9437
9438 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 9439 argument. (Bug#4026)
bc985c87 9440
0cf34688
LMI
94412011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
9442
b3dadd76
LMI
9443 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9444 key" (bug#4257).
9445
0cf34688
LMI
9446 * window.c (Fset_window_start): Doc fix (bug#4199).
9447 (Fset_window_hscroll): Ditto.
9448
270768cd
PE
94492011-07-12 Paul Eggert <eggert@cs.ucla.edu>
9450
077e3dda 9451 Fix minor new problems caught by GCC 4.6.1.
270768cd 9452 * term.c (init_tty): Remove unused local.
490011a6 9453 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 9454 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 9455 not used otherwise.
270768cd 9456
b1f58454
CY
94572011-07-12 Chong Yidong <cyd@stupidchicken.com>
9458
9459 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9460
22b9578d
LMI
94612011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9462
6e70ab07
LMI
9463 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9464 are the mini-buffer and the echo area (bug#3320).
9465
22b9578d
LMI
9466 * term.c (init_tty): Remove support for supdup, c10 and perq
9467 terminals, which are no longer supported (bug#1482).
9468
8974cc9f
JB
94692011-07-10 Johan Bockgård <bojohan@gnu.org>
9470
9471 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9472
a560d974
JD
94732011-07-10 Jan Djärv <jan.h.d@swipnet.se>
9474
9475 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9476 for non-popups (Bug#3642).
9477
1dae0f0a
AS
94782011-07-10 Andreas Schwab <schwab@linux-m68k.org>
9479
268c2c36 9480 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 9481 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
9482 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9483 * cm.c (losecursor): Likewise.
1dae0f0a
AS
9484 * data.c (fmod): Likewise.
9485 * dispnew.c (swap_glyphs_in_rows): Likewise.
9486 * emacs.c (memory_warning_signal): Likewise.
9487 * floatfns.c (float_error): Likewise.
9488 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9489 (otf_open, font_otf_capability, generate_otf_features)
9490 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9491 Likewise.
9492 * image.c (pbm_read_file): Likewise.
9493 * indent.c (string_display_width): Likewise.
9494 * intervals.c (check_for_interval, search_for_interval)
9495 (inc_interval_count, count_intervals, root_interval)
9496 (adjust_intervals_for_insertion, make_new_interval): Likewise.
9497 * lread.c (defalias): Likewise.
268c2c36 9498 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
9499 * regex.c (set_image_of_range_1, set_image_of_range)
9500 (regex_grow_registers): Likewise.
9501 * sysdep.c (strerror): Likewise.
9502 * termcap.c (valid_filename_p, tprint, main): Likewise.
9503 * tparam.c (main): Likewise.
9504 * unexhp9k800.c (run_time_remap, save_data_space)
9505 (update_file_ptrs, read_header, write_header, calculate_checksum)
9506 (copy_file, copy_rest, display_header): Likewise.
9507 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9508 Likewise.
9509 * xdisp.c (check_it): Likewise.
9510 * xfaces.c (register_color, unregister_color, unregister_colors):
9511 Likewise.
9512 * xfns.c (print_fontset_result): Likewise.
9513 * xrdb.c (member, fatal, main): Likewise.
9514
99033785
PE
95152011-07-10 Paul Eggert <eggert@cs.ucla.edu>
9516
9517 Fix minor problems found by static checking (Bug#9031).
9518 * chartab.c (char_table_set_range, map_sub_char_table):
9519 Remove unused locals.
9520 (uniprop_table): Now static.
9521 * composite.c (_work_char): Remove unused static var.
9522
9cb2ac56
JB
95232011-07-09 Juanma Barranquero <lekktu@gmail.com>
9524
9525 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
9526
f25661f0
JD
95272011-07-09 Jan Djärv <jan.h.d@swipnet.se>
9528
9529 * gtkutil.c (qttip_cb): Remove code without function.
9530
8278c4fe
EZ
95312011-07-09 Eli Zaretskii <eliz@gnu.org>
9532
9533 * w32.c (pthread_sigmask): New stub.
9534
1692ae2d 95352011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 9536
8a6ebd58 9537 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
9538 sigprocmask is portable only for single-threaded applications, and
9539 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
9540 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
9541 (LIBES): Use it.
9542 * callproc.c (Fcall_process):
9543 * process.c (create_process):
9544 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9545 Use pthread_sigmask, not sigprocmask.
123403e4 9546
1b854618
JD
95472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9548
9549 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9550 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9551 wrong (Bug#8591).
9552
3fe4b549
JD
95532011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9554
0ce7e563
JD
9555 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9556 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9557 (xg_hide_tooltip): Fix comment.
9558
3fe4b549
JD
9559 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9560 in registerServicesMenuSendTypes.
9561 (validRequestorForSendType): Don't check ns_return_types.
9562
9563 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9564 ns_return_type.
9565
5df75e47
JR
95662011-07-08 Jason Rumney <jasonr@gnu.org>
9567
22610910
JR
9568 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9569 SH_SHOW for hidden windows (Bug#5482).
9570
5df75e47
JR
9571 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9572 frame struct members of non-existent frames (Bug#6284).
9573
699c10bd
JD
95742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9575
4393663b
JD
9576 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9577 variable firstTime not needed on OSX >= 10.6.
9578 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9579 >= 10.5. Use setKnobProportion, setDoubleValue.
9580
9581 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9582 (MAC_OS_X_VERSION_10_5): Define if not defined.
9583 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9584 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9585 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9586
9587 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 9588 cString and lossyCString on OSX >= 10.4.
4393663b 9589
58179cce 9590 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
9591 sizeToFit on OSX >= 10.2.
9592
9593 * nsimage.m (allocInitFromFile): Don't use deprecated method
9594 bestRepresentationForDevice on OSX >= 10.6.
9595
9596 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9597 to avoid warning.
9598
9599 * emacs.c: Declare unexec_init_emacs_zone.
9600
a63e0781
JD
9601 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9602
699c10bd
JD
9603 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9604
9605 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9606 on svcsMenu (Bug#8842).
9607
9608 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9609 ns_return_types.
9610 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9611
9612 * nsterm.m (QUTF8_STRING): Declare.
9613 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9614 (validRequestorForSendType): Return type is (id).
9615 Change indexOfObjectIdenticalTo to indexOfObject.
9616 Check if we have local selection before returning self (Bug#8842).
9617 (writeSelectionToPasteboard): Put local selection into paste board
9618 if we have a local selection (Bug#8842).
9619 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9620
9621 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9622 (ns_get_local_selection): Declare.
9623
54e10184
LMI
96242011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9625
9888ff71
LMI
9626 * keymap.c (describe_map_tree): Don't insert a double newline at
9627 the end of the buffer (bug#1169) and return whether we inserted
9628 something.
9629
54e10184
LMI
9630 * callint.c (Fcall_interactively): Change "reading args" to
9631 "providing args" to try to clarify what it does (bug#1010).
9632
15fa4783
KH
96332011-07-07 Kenichi Handa <handa@m17n.org>
9634
9635 * composite.c (composition_compute_stop_pos): Ignore a static
9636 composition starting before CHARPOS (Bug#8915).
9637
9638 * xdisp.c (handle_composition_prop): Likewise.
9639
a8815b00
EZ
96402011-07-07 Eli Zaretskii <eliz@gnu.org>
9641
9642 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9643 (Bug#9015)
9644
ef7b981d 96452011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
9646
9647 * character.h (unicode_category_t): New enum type.
9648
9649 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9650 (Qchar_code_property_table): New variable.
9651 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9652 (UNIPROP_COMPRESSED_FORM_P): New macros.
9653 (char_table_ascii): Uncompress the compressed values.
9654 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9655 Uncompress the compressed values.
ac389d0c 9656 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
9657 (char_table_ref_and_range): Uncompress the compressed values.
9658 (sub_char_table_set): New arg is_uniprop. Callers changed.
9659 Uncompress the compressed values.
9660 (sub_char_table_set_range): Args changed. Callers changed.
9661 (char_table_set_range): Adjuted for the above change.
9662 (map_sub_char_table): Delete args default_val and parent. Add arg
9663 top. Give decoded values to a Lisp function.
640c8776 9664 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
9665 values to a Lisp function. Gcpro more variables.
9666 (uniprop_table_uncompress)
9667 (uniprop_decode_value_run_length): New functions.
9668 (uniprop_decoder, uniprop_decoder_count): New variables.
9669 (uniprop_get_decoder, uniprop_encode_value_character)
9670 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9671 New functions.
9672 (uniprop_encoder, uniprop_encoder_count): New variables.
9673 (uniprop_get_encoder, uniprop_table)
9674 (Funicode_property_table_internal, Fget_unicode_property_internal)
9675 (Fput_unicode_property_internal): New functions.
9676 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9677 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 9678 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
9679 char-code-property-alist.
9680
640c8776 9681 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
9682 Vunicode_category_table.
9683
640c8776 9684 * font.c (font_range): Adjust for the change of
c805dec0
KH
9685 Vunicode_category_table.
9686
76b397fb
DN
96872011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9688
9689 * m/iris4d.h: Remove file, move contents ...
9690 * s/irix6-5.h: ... here.
9691
22b4128e
PE
96922011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9693
9694 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
9695 * alloc.c (mark_buffer):
9696 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9697 (clone_per_buffer_values): Don't assume that
22b4128e
PE
9698 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9699 This isn't true in general, and it's particularly not true
9700 if Emacs is configured with --with-wide-int.
9701 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9702 New macros, used in the buffer.c change.
9703
869795d6
JD
97042011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9705
9706 * xsettings.c: Use both GConf and GSettings if both are available.
9707 (store_config_changed_event): Add comment.
9708 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9709 (store_tool_bar_style_changed): New functions.
5e617bc2 9710 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
9711 (struct xsettings): Move font inside HAVE_XFT.
9712 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 9713 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 9714 Move inside HAVE_XFT.
640c8776 9715 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
9716 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9717 also.
9718 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 9719 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 9720 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
9721 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9722 (parse_settings): Move check for font inside HAVE_XFT.
9723 (read_settings, apply_xft_settings): Add comment.
9724 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9725 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9726 call store_font_name_changed.
9727 (xft_settings_event): Add comment.
9728 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9729 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9730 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9731 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9732 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
9733 (xsettings_get_system_font, xsettings_get_system_normal_font):
9734 Add comment.
869795d6 9735
d8ed26bd
PE
97362011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 Random fixes. E.g., (random) never returned negative values.
9739 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9740 subseconds part to the entropy, as that's a bit more random.
9741 Prefer signed to unsigned, since the signedness doesn't matter and
9742 in general we prefer signed. When given a limit, use a
9743 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9744 latter isn't right if USE_2_TAGS_FOR_INTS.
9745 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9746 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9747
cabf1cac
SM
97482011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9749
9750 * textprop.c (text_property_stickiness):
9751 Obey Vtext_property_default_nonsticky.
9752 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9753 * w32fns.c (syms_of_w32fns):
9754 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9755
6e9b2be9
PE
97562011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9757
9758 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9759 This is more efficient than Ffile_directory_p and avoids a minor race.
9760
90186c68
LMI
97612011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
9762
7c301272
LMI
9763 * buffer.c (Foverlay_put): Say what the return value is
9764 (bug#7835).
9765
c4f2d8d4
LMI
9766 * fileio.c (barf_or_query_if_file_exists): Check first if the file
9767 is a directory before asking whether to use the file name
9768 (bug#7564).
ad637907
LMI
9769 (barf_or_query_if_file_exists): Make the "File is a directory"
9770 error be more correct.
c4f2d8d4 9771
90186c68
LMI
9772 * fns.c (Frequire): Remove the mention of the .gz files, since
9773 that's installation-specific, but keep the mention of
9774 `get-load-suffixes'.
9775
da64016e
PE
97762011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
9779 Report string overflow if the output is too long.
9780
7d47b580
JB
97812011-07-04 Juanma Barranquero <lekktu@gmail.com>
9782
a555cb87
JB
9783 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
9784 (syms_of_gnutls): Remove duplicate DEFSYM for
9785 Qgnutls_bootprop_verify_hostname_error, an error for
9786 Qgnutls_bootprop_verify_error (which is no longer used).
9787
7d47b580
JB
9788 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
9789 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
9790 Also (re)move comments that are misplaced or no longer relevant.
9791
1e49bfab
LMI
97922011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9793
9794 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
9795
1485f4c0
CY
97962011-07-03 Chong Yidong <cyd@stupidchicken.com>
9797
9798 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
9799 and background color parameters if they have been changed.
9800
a9ab721e
LMI
98012011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9802
9803 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
9804
cf7cff57
PE
98052011-07-03 Paul Eggert <eggert@cs.ucla.edu>
9806
2e13213d
PE
9807 * xsettings.c (SYSTEM_FONT): Define only when used.
9808 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
9809
cf7cff57
PE
9810 * keymap.c (access_keymap_1): Now static.
9811
7a8e04f7
CY
98122011-07-02 Chong Yidong <cyd@stupidchicken.com>
9813
9814 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
9815 leave any prefix arg for the up event (Bug#1586).
9816
61352f62
LMI
98172011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
9818
69bb1ef7
LMI
9819 * lread.c (syms_of_lread): Mention single symbols defined by
9820 `defvar' or `defconst' (bug#7154).
9821
61352f62 9822 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 9823 (Frequire): Mention get-load-suffixes.
61352f62 9824
28545e04
MR
98252011-07-02 Martin Rudalics <rudalics@gmx.at>
9826
9827 * window.h (window): Remove clone_number slot.
9828 * window.c (Fwindow_clone_number, Fset_window_clone_number):
9829 Remove.
9830 (make_parent_window, make_window, saved_window)
9831 (Fset_window_configuration, save_window_save): Don't deal with
9832 clone numbers.
9833 * buffer.c (Qclone_number): Remove declaration.
9834 (sort_overlays, overlay_strings): Don't deal with clone numbers.
9835
3349e122
SM
98362011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
9837
9838 Add multiple inheritance to keymaps.
9839 * keymap.c (Fmake_composed_keymap): New function.
9840 (Fset_keymap_parent): Simplify.
9841 (fix_submap_inheritance): Remove.
9842 (access_keymap_1): New function extracted from access_keymap to handle
9843 embedded parents and handle lists of maps.
9844 (access_keymap): Use it.
9845 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
9846 (Fcopy_keymap): Handle embedded parents.
9847 (Fcommand_remapping, define_as_prefix): Simplify.
9848 (Fkey_binding): Simplify.
9849 (syms_of_keymap): Move minibuffer-local-completion-map,
9850 minibuffer-local-filename-completion-map,
9851 minibuffer-local-must-match-map, and
9852 minibuffer-local-filename-must-match-map to Elisp.
9853 (syms_of_keymap): Defsubr make-composed-keymap.
9854 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
9855 (parse_menu_item): Trivial simplification.
9856
3279eb87
GM
98572011-07-01 Glenn Morris <rgm@gnu.org>
9858
9859 * Makefile.in (SETTINGS_LIBS): Fix typo.
9860
4550efdf
KI
98612011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
9862
9863 * coding.c (Fencode_coding_string): Record the last coding system
9864 used, as the function doc string says (bug#8738).
9865
0949d2b6
JD
98662011-07-01 Jan Djärv <jan.h.d@swipnet.se>
9867
9868 * xsettings.c (store_monospaced_changed): Take new font as arg and
9869 check for change against current_mono_font.
9870 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9871 (emacs_settings_constructor, emacs_settings_get_property)
9872 (emacs_settings_set_property, emacs_settings_class_init)
9873 (emacs_settings_init, gsettings_obj): Remove.
9874 (something_changedCB): New function for HAVE_GSETTINGS.
9875 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9876 with value as argument.
9877 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9878 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 9879 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
9880 "changed".
9881
9882 * xgselect.c: Add defined (HAVE_GSETTINGS).
9883 (xgselect_initialize): Ditto.
9884
9885 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9886 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9887 xg_select.
9888
bbc6b304
PE
98892011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9890
9891 * eval.c (struct backtrace): Simplify and port the data structure.
9892 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9893 signed bit field, as this assumption is not portable and it makes
9894 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9895 "char debug_on_exit : 1" as this is not portable either; instead,
9896 use the portable "unsigned int debug_on_exit : 1". Remove unused
9897 member evalargs. Remove obsolete comments about cc bombing out.
9898
9851bfc5
JD
98992011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9900
51bb811f 9901 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
9902 Let HAVE_GSETTINGS override HAVE_GCONF.
9903 (store_monospaced_changed): New function.
9904 (EMACS_SETTINGS): A new type derived from GObject to handle
9905 GSettings notifications.
9906 (emacs_settings_constructor, emacs_settings_get_property)
9907 (emacs_settings_set_property, emacs_settings_class_init):
9908 New functions.
9909 (gsettings_client, gsettings_obj): New variables.
9910 (GSETTINGS_SCHEMA): New define.
9911 (something_changedCB): Call store_monospaced_changed.
9912 (init_gsettings): New function.
9913 (xsettings_initialize): Call init_gsettings.
9914 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9915 to NULL.
9916
640c8776 9917 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
9918 GCONF_CFLAGS/LIBS.
9919
5386012d
MR
99202011-06-29 Martin Rudalics <rudalics@gmx.at>
9921
9922 * window.c (resize_root_window, grow_mini_window)
9923 (shrink_mini_window): Rename Qresize_root_window to
9924 Qwindow_resize_root_window and Qresize_root_window_vertically to
9925 Qwindow_resize_root_window_vertically.
9926
f13e0b08
PE
99272011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9930
94515237
JB
99312011-06-27 Juanma Barranquero <lekktu@gmail.com>
9932
9933 * makefile.w32-in: Redesign dependencies so they reflect more
9934 clearly which files are directly included by each source file,
9935 and not through other includes.
9936
e43b6e43
MR
99372011-06-27 Martin Rudalics <rudalics@gmx.at>
9938
9939 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9940 (sort_overlays, overlay_strings): When an overlay's clone number
9941 matches the window's clone number process the overlay even if
9942 the overlay's window property doesn't match the current window.
9943
d68443dc
MR
9944 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9945 (Fwindow_hchild): Rename to Fwindow_left_child.
9946 (Fwindow_next): Rename to Fwindow_next_sibling.
9947 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
9948 (resize_window_check): Rename to window_resize_check.
9949 (resize_window_apply): Rename to window_resize_apply.
9950 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9951 (Fdelete_other_windows_internal, resize_frame_windows)
9952 (Fsplit_window_internal, Fdelete_window_internal)
9953 (grow_mini_window, shrink_mini_window)
9954 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 9955
c7e73be5
JD
99562011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9957
9958 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9959 (emacs_fixed_set_min_size): Remove.
9960 (emacs_fixed_new): Take frame as argument.
9961
9962 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9963 (_EmacsFixedPrivate): Remove minwidth/height.
9964 Add struct frame *f.
9965 (emacs_fixed_init): Initialize priv->f.
9966 (get_parent_class, emacs_fixed_set_min_size): Remove.
9967 (emacs_fixed_new): Set priv->f to argument.
9968 (emacs_fixed_get_preferred_width)
9969 (emacs_fixed_get_preferred_height): Use min_width/height from
9970 frames size_hint to set minimum and natural (Bug#8919).
9971 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9972 and use min_width/height from frames size_hint to set
9973 min_width/height (Bug#8919).
9974
9975 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
9976 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9977 Fix indentation.
c7e73be5 9978
cf99dcf8
EZ
99792011-06-26 Eli Zaretskii <eliz@gnu.org>
9980
9981 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9982 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9983 called at ZV.
9984
029529ac
CY
99852011-06-26 Chong Yidong <cyd@stupidchicken.com>
9986
9987 * process.c (wait_reading_process_output): Bypass select if
9988 waiting for a cell while ignoring keyboard input, and input is
9989 pending. Suggested by Jan Djärv (Bug#8869).
9990
7a7ef429
PE
99912011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9992
9993 Use gnulib's dup2 module instead of rolling our own.
9994 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
9995
11fdef7d 99962011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
9997
9998 * dispnew.c (scrolling_window): Before scrolling, turn off a
9999 mouse-highlight in the window being scrolled.
10000
cd3520a4
JB
100012011-06-24 Juanma Barranquero <lekktu@gmail.com>
10002
10003 Move DEFSYM to lisp.h and use everywhere.
10004
10005 * character.h (DEFSYM): Move declaration...
10006 * lisp.h (DEFSYM): ...here.
10007
10008 * gnutls.c:
10009 * minibuf.c:
10010 * w32menu.c:
10011 * w32proc.c:
10012 * w32select.c: Don't include character.h.
10013
10014 * alloc.c (syms_of_alloc):
10015 * buffer.c (syms_of_buffer):
10016 * bytecode.c (syms_of_bytecode):
10017 * callint.c (syms_of_callint):
10018 * casefiddle.c (syms_of_casefiddle):
10019 * casetab.c (init_casetab_once):
10020 * category.c (init_category_once, syms_of_category):
10021 * ccl.c (syms_of_ccl):
10022 * cmds.c (syms_of_cmds):
10023 * composite.c (syms_of_composite):
10024 * dbusbind.c (syms_of_dbusbind):
10025 * dired.c (syms_of_dired):
10026 * dispnew.c (syms_of_display):
10027 * doc.c (syms_of_doc):
10028 * editfns.c (syms_of_editfns):
10029 * emacs.c (syms_of_emacs):
10030 * eval.c (syms_of_eval):
10031 * fileio.c (syms_of_fileio):
10032 * fns.c (syms_of_fns):
10033 * frame.c (syms_of_frame):
10034 * fringe.c (syms_of_fringe):
10035 * insdel.c (syms_of_insdel):
10036 * keymap.c (syms_of_keymap):
10037 * lread.c (init_obarray, syms_of_lread):
10038 * macros.c (syms_of_macros):
10039 * msdos.c (syms_of_msdos):
10040 * print.c (syms_of_print):
10041 * process.c (syms_of_process):
10042 * search.c (syms_of_search):
10043 * sound.c (syms_of_sound):
10044 * syntax.c (init_syntax_once, syms_of_syntax):
10045 * terminal.c (syms_of_terminal):
10046 * textprop.c (syms_of_textprop):
10047 * undo.c (syms_of_undo):
10048 * w32.c (globals_of_w32):
10049 * window.c (syms_of_window):
10050 * xdisp.c (syms_of_xdisp):
10051 * xfaces.c (syms_of_xfaces):
10052 * xfns.c (syms_of_xfns):
10053 * xmenu.c (syms_of_xmenu):
10054 * xsettings.c (syms_of_xsettings):
10055 * xterm.c (syms_of_xterm): Use DEFSYM.
10056
4228cf16
TZ
100572011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
10058
cd3520a4 10059 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 10060
7fcccf1e
PE
100612011-06-23 Paul Eggert <eggert@cs.ucla.edu>
10062
7efb4e0e
PE
10063 Integer and buffer overflow fixes (Bug#8873).
10064
ff5844ad
PE
10065 * print.c (printchar, strout): Check for string overflow.
10066 (PRINTPREPARE, printchar, strout):
10067 Don't set size unless allocation succeeds.
10068
90532f02
PE
10069 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
10070 for sizes. Check for string overflow more accurately.
10071 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
10072
6d84508d
PE
10073 * macros.c: Integer and buffer overflow fixes.
10074 * keyboard.h (struct keyboard.kbd_macro_bufsize):
10075 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
10076 Use ptrdiff_t, not int, for sizes.
10077 Don't increment bufsize until after realloc succeeds.
10078 Check for size-calculation overflow.
10079 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
10080
437b2cb4
PE
10081 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
10082
8b9ac8b4
PE
10083 * lread.c: Integer overflow fixes.
10084 (read_integer): Radix is now EMACS_INT, not int,
10085 to improve quality of diagnostics for out-of-range radices.
10086 Calculate buffer size correctly for out-of-range radices.
10087 (read1): Check for integer overflow in radices, and in
10088 read-circle numbers.
82cb60d3
PE
10089 (read_escape): Avoid int overflow.
10090 (Fload, openp, read_buffer_size, read1)
10091 (substitute_object_recurse, read_vector, read_list, map_obarray):
10092 Use ptrdiff_t, not int, for sizes.
10093 (read1): Use EMACS_INT, not int, for sizes.
20270765 10094 Check for size overflow.
8b9ac8b4 10095
7fcccf1e
PE
10096 * image.c (cache_image): Check for size arithmetic overflow.
10097
bfbbd7e7
PE
10098 * lread.c: Integer overflow issues.
10099 (saved_doc_string_size, saved_doc_string_length)
10100 (prev_saved_doc_string_size, prev_saved_doc_string_length):
10101 Now ptrdiff_t, not int.
10102 (read1): Don't assume doc string length fits in int. Check for
10103 out-of-range doc string lengths.
10104 (read_list): Don't assume file position fits in int.
39019e54 10105 (read_escape): Check for hex character overflow.
bfbbd7e7 10106
4e323265
LL
101072011-06-22 Leo Liu <sdl.web@gmail.com>
10108
10109 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
10110 Move to minibuffer.el.
10111
85fece3e
PE
101122011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10113
20b84ce9 10114 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
10115 The following patches are for when GLYPH_DEBUG && !XASSERT.
10116 * dispextern.h (trace_redisplay_p, dump_glyph_string):
10117 * dispnew.c (flush_stdout):
10118 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
10119 Mark as externally visible.
10120 * dispnew.c (check_window_matrix_pointers): Now static.
10121 * dispnew.c (window_to_frame_vpos):
10122 * xfns.c (unwind_create_frame):
10123 * xterm.c (x_check_font): Remove unused local.
10124 * scroll.c (CHECK_BOUNDS):
10125 * xfaces.c (cache_fache): Rename local to avoid shadowing.
10126 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
10127 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
10128 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
10129 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
10130 Now static.
10131 (debug_method_add): Use va_list and vsprintf rather than relying
10132 on undefined behavior with wrong number of arguments.
10133 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
10134 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
10135 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
10136 since we're not interested in debugging glyphs with old libraries.
10137 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
10138 GCC 4.6.0's static checking.
10139
0766b489
PE
101402011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10141
31fd4b32
PE
10142 Integer overflow and signedness fixes (Bug#8873).
10143 A few related buffer overrun fixes, too.
10144
b79e8648
PE
10145 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
10146
0766b489
PE
10147 * dispextern.h (struct face.stipple):
10148 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
10149 (x_bitmap_mask, x_allocate_bitmap_record)
10150 (x_create_bitmap_from_data, x_create_bitmap_from_file)
10151 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
10152 (x_create_bitmap_from_xpm_data):
10153 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
10154 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
10155 (.bitmaps_last):
10156 * xfaces.c (load_pixmap):
10157 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
10158 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
10159 (.bitmaps_last, struct x_output.icon_bitmap):
10160 Use ptrdiff_t, not int, for bitmap indexes.
10161 (x_allocate_bitmap_record): Check for size overflow.
10162 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
10163
b081724f
PE
10164 Use ptrdiff_t, not int, for overlay counts.
10165 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
10166 * editfns.c (overlays_around, get_pos_property):
10167 * textprop.c (get_char_property_and_overlay):
10168 * xdisp.c (next_overlay_change, note_mouse_highlight):
10169 * xfaces.c (face_at_buffer_position):
21514da7
PE
10170 * buffer.c (OVERLAY_COUNT_MAX): New macro.
10171 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
10172 (Fnext_overlay_change, Fprevious_overlay_change)
10173 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 10174 Use ptrdiff_t, not int, for sizes.
21514da7 10175 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 10176
3de73e5e
PE
10177 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
10178
2606c57b
PE
10179 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
10180 (x_session_initialize): Do not assume string length fits in int.
10181
aaafe47a
PE
10182 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
10183 This is unlikely, but can occur if DPI is outlandish.
10184
2674ddc8 10185 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
10186 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
10187
28154962
PE
10188 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
10189 * xrdb.c (magic_file_p, search_magic_path):
10190 Omit last arg SUFFIX; it was always 0. All callers changed.
10191 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
10192
7de51af5
PE
10193 * xfont.c (xfont_match): Avoid need for strlen.
10194
25ed6cc3
PE
10195 * xfns.c: Don't assume strlen fits in int.
10196 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
10197
4eab31dd
PE
10198 * xdisp.c (message_log_check_duplicate): Return intmax_t,
10199 not unsigned long, as we prefer signed integers. All callers changed.
10200 Detect integer overflow in repeat count.
10201 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 10202 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 10203
171e2a58
PE
10204 * termcap.c: Don't assume sizes fit in int and never overflow.
10205 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
10206 (gobble_line): Check for size-calculation overflow.
10207
ad39faca 10208 * minibuf.c (Fread_buffer):
6e5bb2dc 10209 * lread.c (intern, intern_c_string):
74ca2eb3
PE
10210 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
10211 Don't assume string length fits in int.
10212
52c61c22 10213 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
10214 * gtkutil.c (style_changed_cb): Avoid need for strlen.
10215
b5b8c9e5
PE
10216 * font.c: Don't assume string length fits in int.
10217 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
10218 Use ptrdiff_t, not int.
ccd6111c
PE
10219 (font_intern_prop): Don't assume string length fits in int.
10220 Don't assume integer property fits in fixnum.
10221 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 10222
882f0d81 10223 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 10224 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
10225 Reformulate so as not to need the command string.
10226 Invoke gzip -cd rather than gunzip, as it's more portable.
10227 (lock_info_type, lock_file_1, lock_file):
10228 Don't assume pid_t and time_t fit in unsigned long.
10229 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
10230 (current_lock_owner): Prefer signed type for sizes.
10231 Use memcpy, not strncpy, where memcpy is what is really wanted.
10232 Don't assume (via atoi) that time_t and pid_t fit in int.
10233 Check for time_t and/or pid_t out of range, e.g., via a network share.
10234 Don't alloca where an auto var works fine.
10235
93f4cf88
PE
10236 * fileio.c: Fix some integer overflow issues.
10237 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
10238 Don't assume string length fits in int.
10239 (directory_file_name): Don't assume string length fits in long.
10240 (make_temp_name): Don't assume pid fits in int, or that its print
10241 length is less than 20.
10242
f3e92b69
PE
10243 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
10244
1bfdaf10
PE
10245 * coding.c (make_subsidiaries): Don't assume string length fits in int.
10246
35016e9a
PE
10247 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
10248
3d1e65a1
PE
10249 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
10250 We prefer signed integers, even for size calculations.
10251
0b963a93
PE
10252 * emacs.c: Don't assume string length fits in 'int'.
10253 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
10254 (main): Don't invoke strlen when not needed.
10255
573f4b54
PE
10256 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
10257 (XD_DEBUG_MESSAGE): Don't waste a byte.
10258
989f33ba
PE
10259 * callproc.c (getenv_internal_1, getenv_internal)
10260 (Fgetenv_internal):
965d34eb
PE
10261 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
10262
e4d29b33
PE
10263 * lread.c (invalid_syntax): Omit length argument.
10264 All uses changed. This doesn't fix a bug, but it simplifies the
10265 code away from its former Hollerith-constant appearance, and it's
10266 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 10267 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 10268
eb49b136
PE
10269 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
10270 This didn't break anything, but it didn't help either.
10271 It's confusing to put a bogus integer in a place where the actual
10272 value does not matter.
9f62aeb1 10273 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 10274 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 10275
15375a22
PE
10276 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
10277 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
10278 implementation.
b61cc01c
PE
10279 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
10280 We prefer signed types, and the value cannot exceed the EMACS_INT
10281 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
10282 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
10283 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
10284 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 10285
53b2623d
PE
10286 * indent.c (sane_tab_width): New function.
10287 (current_column, scan_for_column, Findent_to, position_indentation)
10288 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 10289 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 10290
51cab52b 10291 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 10292
f2ed8a70
PE
10293 * lisp.h (lint_assume): New macro.
10294 * composite.c (composition_gstring_put_cache):
10295 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
10296
abe80cc6
PE
10297 * editfns.c, insdel.c:
10298 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 10299
b02c740e
PE
10300 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
10301
ebc96716
PE
10302 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
10303
b4e50fa0 10304 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 10305 Use much-faster test for byte-length change.
311d5d7c 10306 Don't assume string byte-length fits in 'int'.
a4cf38e4 10307 Check that character arg fits in 'int'.
85461888 10308 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 10309
c0c1ee9f
PE
10310 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
10311
a498d7f4
PE
10312 * fns.c (concat): Catch string overflow earlier.
10313 Do not rely on integer wraparound.
10314
51cab52b
PE
10315 * dispextern.h (struct it.overlay_strings_charpos)
10316 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
10317 * xdisp.c (forward_to_next_line_start)
10318 (back_to_previous_visible_line_start)
10319 (reseat_at_next_visible_line_start, next_element_from_buffer):
10320 Don't arbitrarily truncate the value of 'selective' to int.
10321
76031fad
PE
10322 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
10323
5eb55db9
PE
10324 * composite.c: Don't truncate sizes to 'int'.
10325 (composition_gstring_p, composition_reseat_it)
10326 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
10327 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
10328 not EMACS_UINT, for indexes.
5eb55db9 10329
0703a717
PE
10330 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
10331
d6202519
PE
10332 * buffer.c: Include <verify.h>.
10333 (struct sortvec.priority, struct sortstr.priority):
8961a454 10334 Now EMACS_INT, not int.
c20998a7 10335 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
10336 (struct sortstr.size, record_overlay_string)
10337 (struct sortstrlist.size, struct sortlist.used):
10338 Don't truncate size to int.
10339 (record_overlay_string): Check for size-calculation overflow.
d6202519 10340 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 10341
d5a19415
JM
103422011-06-22 Jim Meyering <meyering@redhat.com>
10343
029529ac 10344 Don't leak an XBM-image-sized buffer
d5a19415
JM
10345 * image.c (xbm_load): Free the image buffer after using it.
10346
a9041e6c
PE
103472011-06-21 Paul Eggert <eggert@cs.ucla.edu>
10348
10349 Port to Sun C.
10350 * composite.c (find_automatic_composition): Omit needless 'return 0;'
10351 that Sun C diagnosed.
10352 * fns.c (secure_hash): Fix pointer signedness issue.
10353 * intervals.c (static_offset_intervals): New function.
10354 (offset_intervals): Use it.
10355
7f3f739f
LL
103562011-06-21 Leo Liu <sdl.web@gmail.com>
10357
10358 * deps.mk (fns.o):
10359 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
10360 sha512.h.
10361
10362 * fns.c (secure_hash): Rename from crypto_hash_function and change
10363 the first arg to accept symbols.
5b66d427 10364 (Fsecure_hash): New primitive.
7f3f739f
LL
10365 (syms_of_fns): New symbols.
10366
76147d94
DD
103672011-06-20 Deniz Dogan <deniz@dogan.se>
10368
10369 * process.c (Fset_process_buffer): Clarify return value in
10370 docstring.
10371
7d7d0045
CY
103722011-06-18 Chong Yidong <cyd@stupidchicken.com>
10373
10374 * dispnew.c (add_window_display_history): Use BVAR.
10375
10376 * xdisp.c (debug_method_add): Use BVAR.
10377 (check_window_end, dump_glyph_matrix, dump_glyph)
10378 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10379
10380 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10381 Likewise.
10382
10383 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10384 check till after the cache is created in init_frame_faces.
10385
ff2bc410
SM
103862011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
10387
10388 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10389
28177add
PE
103902011-06-16 Paul Eggert <eggert@cs.ucla.edu>
10391
dd3482fe
PE
10392 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10393 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10394 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10395
393d71f3 10396 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
10397 * fileio.c (Finsert_file_contents):
10398 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10399 Remove the old (too-loose) buffer overflow checks.
10400 They weren't needed, since make_gap checks for buffer overflow.
10401 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10402 The old code merely checked for Emacs fixnum overflow, and relied
10403 on undefined (wraparound) behavior. The new code avoids undefined
10404 behavior, and also checks for ptrdiff_t and/or size_t overflow.
10405
2e6813b0 10406 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
10407 Tune. Don't use wider integers than needed. Don't use alloca.
10408 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 10409
599a9e4f
PE
10410 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10411
99561444
PE
10412 * insdel.c, lisp.h (buffer_overflow): New function.
10413 (insert_from_buffer_1, replace_range, replace_range_2):
10414 * insdel.c (make_gap_larger):
10415 * editfns.c (Finsert_char):
10416 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10417
28177add
PE
10418 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10419
e69dafad
PE
104202011-06-15 Paul Eggert <eggert@cs.ucla.edu>
10421
4baa020d 10422 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 10423
b1c46f02
PE
10424 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10425 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10426
e69dafad
PE
10427 * fileio.c: Don't assume EMACS_INT fits in off_t.
10428 (emacs_lseek): New static function.
10429 (Finsert_file_contents, Fwrite_region): Use it.
10430 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10431
566684ea
PE
10432 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10433
e6966cd6
PE
10434 * fns.c: Don't overflow int when computing a list length.
10435 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10436 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10437 truncation on 64-bit hosts. Check for QUIT every
10438 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10439 faster and is responsive enough.
10440 (Flength): Report an error instead of overflowing an integer.
10441 (Fsafe_length): Return a float if the value is not representable
10442 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 10443 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 10444 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 10445
dd0b0efb
PE
10446 * alloc.c: Check that resized vectors' lengths fit in fixnums.
10447 (header_size, word_size): New constants.
10448 (allocate_vectorlike): Don't check size overflow here.
10449 (allocate_vector): Check it here instead, since this is the only
10450 caller of allocate_vectorlike that could cause overflow.
10451 Check that the new vector's length is representable as a fixnum.
10452
86fe5cfe
PE
10453 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10454 The previous code was bogus. For example, next_almost_prime (32)
10455 returned 39, which is undesirable as it is a multiple of 3; and
10456 next_almost_prime (24) returned 25, which is a multiple of 5 so
10457 why was the code bothering to check for multiples of 7?
10458
80e88859
PE
10459 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10460
4a2f0ad6
PE
10461 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10462
f66c7cf8
PE
10463 Variadic C functions now count arguments with ptrdiff_t.
10464 This partly undoes my 2011-03-30 change, which replaced int with size_t.
10465 Back then I didn't know that the Emacs coding style prefers signed int.
10466 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
10467 were being counted with int, which may truncate counts on 64-bit
10468 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
10469 * lisp.h (struct Lisp_Subr.function.aMANY)
10470 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10471 Arg counts are now ptrdiff_t, not size_t.
10472 All variadic functions and their callers changed accordingly.
10473 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
10474 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10475 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
10476 * callint.c (Fcall_interactively): Check arg count for overflow,
10477 to avoid potential buffer overrun. Use signed char, not 'int',
10478 for 'varies' array, so that we needn't bother to check its size
10479 calculation for overflow.
10480 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10481 * eval.c (apply_lambda):
10482 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10483 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
10484 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10485
a1759b76
PE
10486 * callint.c (Fcall_interactively): Don't use index var as event count.
10487
d96be9fc
PE
10488 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10489 * mem-limits.h (SIZE): Remove; no longer used.
10490
a690a978 10491 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 10492
578c21e6
PE
10493 Remove unnecessary casts.
10494 * xterm.c (x_term_init):
10495 * xfns.c (x_set_border_pixel):
10496 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10497 These aren't needed now that we assume ANSI C.
10498
96f53c6c
PE
10499 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10500 It's more likely to cause problems (due to unsigned overflow)
10501 than to cure them.
10502
83c77d31
PE
10503 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10504
ee2079f1
PE
10505 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10506
6da65536
PE
10507 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10508
7147c4a4
PE
10509 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10510
193e32d9
PE
10511 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10512
e5533da6
PE
10513 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10514
9910e595
PE
10515 GLYPH_CODE_FACE returns EMACS_INT, not int.
10516 * dispextern.h (merge_faces):
10517 * xfaces.c (merge_faces):
01103c44
PE
10518 * xdisp.c (get_next_display_element, next_element_from_display_vector):
10519 Don't assume EMACS_INT fits in int.
9910e595 10520
2638320e
PE
10521 * character.h (CHAR_VALID_P): Remove unused parameter.
10522 * fontset.c, lisp.h, xdisp.c: All uses changed.
10523
045eb8d9
PE
10524 * editfns.c (Ftranslate_region_internal): Omit redundant test.
10525
c1f134b5
PE
10526 * fns.c (concat): Minor tuning based on overflow analysis.
10527 This doesn't fix any bugs. Use int to hold character, instead
10528 of constantly refetching from Emacs object. Use XFASTINT, not
10529 XINT, for value known to be a character. Don't bother comparing
10530 a single byte to 0400, as it's always less.
10531
395fcb93 10532 * floatfns.c (Fexpt):
327eeec8
PE
10533 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
10534
abbd3d23
PE
10535 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
10536 for characters.
10537
684a03ef
PE
10538 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
10539
0fed43f3
PE
10540 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
10541 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10542 incorrectly succeed when S was a string, because 4294967386 was
10543 truncated before it was used.
10544
8fd02eb7
PE
10545 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10546 Otherwise, an out-of-range integer could cause undefined behavior
10547 on a 64-bit host.
10548
f8c86b69
PE
10549 * composite.c: Use int, not EMACS_INT, for characters.
10550 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10551 EMACS_INT, for values that are known to be in character range.
10552 This doesn't fix any bugs but is the usual style inside Emacs and
10553 may generate better code on 32-bit machines.
10554
34206dd2
PE
10555 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10556 This is for reasons similar to the recent CHAR_STRING fix.
10557 * charset.c (Fencode_char): Check that character arg is actually
10558 a character. Pass an int to ENCODE_CHAR.
10559 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10560 wider than 'int', as a compile-time check to prevent future regressions
10561 in this area.
10562
c5958d4c 10563 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
10564
10565 Make sure a 64-bit char is never passed to CHAR_STRING.
10566 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10567 by silently ignoring the top 32 bits, allowing some values
10568 that were far too large to be valid characters.
10569 * character.h: Include <verify.h>.
10570 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10571 arguments are no wider than unsigned, as a compile-time check
10572 to prevent future regressions in this area.
10573 * data.c (Faset):
01103c44 10574 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
10575 (Fsubst_char_in_region):
10576 * fns.c (concat):
10577 * xdisp.c (decode_mode_spec_coding):
10578 Adjust to CHAR_STRING's new requirement.
10579 * editfns.c (Finsert_char, Fsubst_char_in_region):
10580 * fns.c (concat): Check that character args are actually
10581 characters. Without this test, these functions did the wrong
10582 thing with wildly out-of-range values on 64-bit hosts.
10583
d37ca623
PE
10584 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10585 These casts should not be needed on 32-bit hosts, either.
10586 * keyboard.c (read_char):
10587 * lread.c (Fload): Remove casts to unsigned.
10588
ea204efb
PE
10589 * lisp.h (UNSIGNED_CMP): New macro.
10590 This fixes comparison bugs on 64-bit hosts.
10591 (ASCII_CHAR_P): Use it.
10592 * casefiddle.c (casify_object):
01103c44 10593 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
10594 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10595 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10596 * dispextern.h (FACE_FROM_ID):
10597 * keyboard.c (read_char): Use UNSIGNED_CMP.
10598
41cb286c
PE
10599 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10600 not to EMACS_INT, to avoid GCC warning.
10601
4a1b9832
PE
10602 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10603
55daad71
PE
10604 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10605 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10606 isn't needed on 32-bit machines.
8f95c75c 10607
01103c44
PE
10608 * buffer.c (Fgenerate_new_buffer_name):
10609 Use EMACS_INT for count, not int.
0ceccced 10610 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
10611
10612 * data.c (Qcompiled_function): Now static.
10613
c6f072e7
PE
10614 * window.c (window_body_lines): Now static.
10615
20ce5912
PE
10616 * image.c (gif_load): Rename local to avoid shadowing.
10617
9c4c5f81
PE
10618 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10619 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10620 * alloc.c (make_save_value): Integer argument is now of type
10621 ptrdiff_t, not int.
10622 (mark_object): Use ptrdiff_t, not int.
10623 * lisp.h (pD): New macro.
10624 * print.c (print_object): Use it.
10625
c0c5c8ae
PE
10626 * alloc.c: Use EMACS_INT, not int, to count objects.
10627 (total_conses, total_markers, total_symbols, total_vector_size)
10628 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
10629 (total_free_floats, total_floats, total_free_intervals)
10630 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
10631 Now EMACS_INT, not int. All uses changed.
10632 (Fgarbage_collect): Compute overall total using a double, so that
10633 integer overflow is less likely to be a problem. Check for overflow
10634 when converting back to an integer.
5a25e253
PE
10635 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10636 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10637 These were 'int' variables that could overflow on 64-bit hosts;
10638 they were never used, so remove them instead of repairing them.
211a0b2a 10639 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
10640 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10641 Previously, this ceilinged at INT_MAX, but that doesn't work on
10642 64-bit machines.
e46bb31a 10643 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 10644
c78baabf 10645 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 10646 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
10647 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10648 when a (possibly-narrower) signed value would do just as well.
10649 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 10650
c9d624c6
PE
10651 * alloc.c: Catch some string size overflows that we were missing.
10652 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10653 for convenience in STRING_BYTES_MAX.
10654 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10655 The definition here is exact; the one in lisp.h was approximate.
10656 (allocate_string_data): Check for string overflow. This catches
10657 some instances we weren't catching before. Also, it catches
10658 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10659 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10660 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 10661
c9d624c6
PE
10662 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10663 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 10664 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 10665
353032ce
PE
10666 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10667
2bccce07
PE
10668 * alloc.c (Fmake_string): Check for out-of-range init.
10669
0ac30604
SM
106702011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10671
10672 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10673
c195f2de
JD
106742011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10675
10676 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10677 xg_get_default_scrollbar_width.
10678
10679 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10680 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10681 (style_changed_cb): Call update_theme_scrollbar_width and call
10682 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10683 all frames (Bug#8505).
10684 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10685 Call gtk_window_set_resizable if HAVE_GTK3.
10686 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10687 and height if HAVE_GTK3 (Bug#8505).
10688 (scroll_bar_width_for_theme): New variable.
10689 (update_theme_scrollbar_width): New function.
10690 (xg_get_default_scrollbar_width): Move code to
10691 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10692 (xg_initialize): Call update_theme_scrollbar_width.
10693
10694 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10695
10696 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10697
e10ac9f1
MR
106982011-06-12 Martin Rudalics <rudalics@gmx.at>
10699
10700 * frame.c (make_frame): Call other_buffer_safely instead of
10701 other_buffer.
10702
10703 * window.c (temp_output_buffer_show): Call display_buffer with
10704 second argument Vtemp_buffer_show_specifiers and reset latter
10705 immediately after the call.
10706 (Vtemp_buffer_show_specifiers): New variable.
10707 (auto_window_vscroll_p, next_screen_context_lines)
10708 (Vscroll_preserve_screen_position): Remove leading asterisks from
10709 doc-strings.
10710
2d3c217e 107112011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 10712
7b7f97e8 10713 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
10714 * buffer.c (Qclone_number): Remove for now, as it's unused.
10715 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10716 (record_buffer): Remove unused local.
10717 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10718 (set_frame_buffer_list): Remove; unused.
10719 * frame.h (other_visible_frames): Remove decl.
10720 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10721 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10722 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10723 if HAVE_GPM.
10724 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10725 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10726 Define only if HAVE_GPM.
10727 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10728 (update_hints_inhibit): Remove; never set. All uses removed.
10729 * widgetprv.h (emacsFrameClassRec): Remove decl.
10730 * window.c (delete_deletable_window): Now returns void, since it
10731 wasn't returning anything.
10732 (compare_window_configurations): Remove unused locals.
10733 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10734 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
10735 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10736 the same widths as pointers. This follows up on the 2011-05-06 patch.
10737 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10738 * xterm.h: Likewise.
10739 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10740
1384b89e
JB
107412011-06-12 Juanma Barranquero <lekktu@gmail.com>
10742
10743 * makefile.w32-in: Update dependencies.
10744 (LISP_H): Add lib/intprops.h.
10745
1100a63c
CY
107462011-06-11 Chong Yidong <cyd@stupidchicken.com>
10747
10748 * image.c (gif_load): Add animation frame delay to the metadata.
10749 (syms_of_image): Use DEFSYM. New symbol `delay'.
10750
6198ccd0
MR
107512011-06-11 Martin Rudalics <rudalics@gmx.at>
10752
10753 * window.c (delete_deletable_window): Re-add.
10754 (Fset_window_configuration): Rewrite to handle dead buffers and
10755 consequently deletable windows.
10756 (window_tree, Fwindow_tree): Remove. Supply functionality in
10757 window.el.
10758 (compare_window_configurations): Simplify code.
10759
b6e3633c
AS
107602011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10761
1ab0dee5
AS
10762 * image.c (imagemagick_load_image): Fix type mismatch.
10763 (Fimagemagick_types): Likewise.
10764
b6e3633c
AS
10765 * window.h (replace_buffer_in_windows): Declare.
10766
9397e56f
MR
107672011-06-11 Martin Rudalics <rudalics@gmx.at>
10768
10769 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
10770 Qclone_number. Remove external declaration of Qdelete_window.
10771 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
10772 code.
640c8776
SM
10773 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
10774 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
10775 (Fother_buffer): Rewrite doc-string. Major rewrite for new
10776 buffer list implementation.
10777 (other_buffer_safely): New function.
10778 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
10779 calls to replace_buffer_in_windows and
10780 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
10781 if allowed.
10782 (record_buffer): Inhibit quitting and rewrite using quittable
10783 functions. Run Qbuffer_list_update_hook if allowed.
10784 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
10785 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
10786 Move switch-to-buffer to window.el.
9397e56f
MR
10787 (bury-buffer): Move to window.el.
10788 (Vbuffer_list_update_hook): New variable.
10789
10790 * lisp.h (other_buffer_safely): Add prototype in buffer.c
10791 section.
10792
10793 * window.h (resize_frame_windows): Move up in code.
10794 (Fwindow_frame): Remove EXFUN.
10795 (replace_buffer_in_all_windows): Remove prototype.
10796 (replace_buffer_in_windows_safely): Add prototype.
10797
10798 * window.c: Declare Qdelete_window static again. Move down
10799 declaration of select_count.
10800 (Fnext_window, Fprevious_window): Rewrite doc-strings.
10801 (Fother_window): Move to window.el.
10802 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
10803 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
10804 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
10805 window.el.
10806 (replace_buffer_in_windows): Implement by calling
10807 Qreplace_buffer_in_windows.
10808 (replace_buffer_in_all_windows): Remove with some functionality
10809 moved into replace_buffer_in_windows_safely.
10810 (replace_buffer_in_windows_safely): New function.
10811 (select_window_norecord, select_frame_norecord): Move in front
10812 of run_window_configuration_change_hook. Remove now obsolete
10813 declarations.
640c8776
SM
10814 (Fset_window_buffer): Rewrite doc-string.
10815 Call Qrecord_window_buffer.
9397e56f
MR
10816 (keys_of_window): Move binding for other-window to window.el.
10817
b50691aa
CY
108182011-06-11 Chong Yidong <cyd@stupidchicken.com>
10819
10820 * dispextern.h (struct image): Replace data member, whose int_val
10821 and ptr_val fields were not used by anything, with a single
10822 lisp_val object.
10823
10824 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
10825 (gif_clear_image, gif_load, imagemagick_load_image)
10826 (gs_clear_image, gs_load): Callers changed.
10827
3f754b86
PE
108282011-06-10 Paul Eggert <eggert@cs.ucla.edu>
10829
cca69397
PE
10830 * buffer.h: Include <time.h>, for time_t.
10831 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
10832
109e28d0
PE
10833 Fix minor problems found by static checking.
10834
60737f02
PE
10835 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
10836
4b66faf3
PE
10837 Make identifiers static if they are not used in other modules.
10838 * data.c (Qcompiled_function, Qframe, Qvector):
10839 * image.c (QimageMagick, Qsvg):
10840 * minibuf.c (Qmetadata):
10841 * window.c (resize_window_check, resize_root_window): Now static.
10842 * window.h (resize_window_check, resize_root_window): Remove decls.
10843
109e28d0
PE
10844 * window.c (window_deletion_count, delete_deletable_window):
10845 Remove; unused.
46a4ce9e
PE
10846 (window_body_lines): Now static.
10847 (Fdelete_other_windows_internal): Mark vars as initialized.
10848 Make sure 'resize_failed' is initialized.
10849 (run_window_configuration_change_hook): Rename local to avoid shadowing.
10850 (resize_window_apply): Remove unused local.
10851 * window.h (delete_deletable_window): Remove decl.
10852
109e28d0 10853 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
10854 (imagemagick_load_image): Fix pointer signedness problem by changing
10855 last arg from unsigned char * to char *. All uses changed.
10856 Also, fix a local for similar reasons.
10857 Remove unused locals. Remove locals to avoid shadowing.
10858 (fn_rsvg_handle_free): Remove; unused.
10859 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 10860 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 10861
3f754b86
PE
10862 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
10863
2547adb1
CY
108642011-06-10 Chong Yidong <cyd@stupidchicken.com>
10865
10866 * image.c (gif_load): Fix omitted cast error introduced by
10867 2011-06-06 change.
10868
2c8e37d4
MR
108692011-06-10 Martin Rudalics <rudalics@gmx.at>
10870
10871 * window.h (resize_proportionally, orig_total_lines)
10872 (orig_top_line): Remove from window structure.
10873 (set_window_height, set_window_width, change_window_heights)
10874 (Fdelete_window): Remove prototypes.
10875 (resize_frame_windows): Remove duplicate declaration.
10876
440a42e3
EZ
108772011-06-10 Eli Zaretskii <eliz@gnu.org>
10878
10879 * window.h (resize_frame_windows, resize_window_check)
10880 (delete_deletable_window, resize_root_window)
10881 (resize_frame_windows): Declare prototypes.
10882
10883 * window.c (resize_window_apply): Make definition be "static" to
10884 match the prototype.
10885
562dd5e9
MR
108862011-06-10 Martin Rudalics <rudalics@gmx.at>
10887
10888 * window.c: Remove declarations of Qwindow_size_fixed,
10889 window_min_size_1, window_min_size_2, window_min_size,
10890 size_window, window_fixed_size_p, enlarge_window, delete_window.
10891 Remove static from declaration of Qdelete_window, it's
10892 temporarily needed by Fbury_buffer.
10893 (replace_window): Don't assign orig_top_line and
10894 orig_total_lines.
10895 (Fdelete_window, delete_window): Remove. Window deletion is
10896 handled by window.el.
640c8776
SM
10897 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10898 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
10899 (Fdelete_other_windows): Remove. Deleting other windows is
10900 handled by window.el.
10901 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10902 handled in window.el.
10903 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10904 Window minimum sizes are handled in window.el.
10905 (shrink_windows, size_window, set_window_height)
10906 (set_window_width, change_window_heights, window_height)
10907 (window_width, CURBEG, CURSIZE, enlarge_window)
10908 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10909 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10910 handled in window.el.
10911 (make_dummy_parent): Rename to make_parent_window and give it a
10912 second argument horflag.
10913 (make_window): Don't set resize_proportionally any more.
10914 (Fsplit_window): Remove. Windows are split in window.el.
10915 (save_restore_action, save_restore_orig_size)
10916 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10917 Resize mini windows in window.el.
10918 (grow_mini_window, shrink_mini_window): Implement by calling
10919 Qresize_root_window_vertically, resize_window_check and
10920 resize_window_apply.
640c8776
SM
10921 (saved_window, Fset_window_configuration, save_window_save):
10922 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
10923 resize_proportionally.
10924 (window_min_height, window_min_width): Move to window.el.
10925 (keys_of_window): Move bindings for delete-other-windows,
10926 split-window, delete-window and enlarge-window to window.el.
10927
10928 * buffer.c: Temporarily extern Qdelete_window.
10929 (Fbury_buffer): Temporarily call Qdelete_window instead of
10930 Fdelete_window (Fbury_buffer will move to window.el soon).
10931
10932 * frame.c (set_menu_bar_lines_1): Remove code handling
10933 orig_top_line and orig_total_lines.
10934
10935 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10936 set_window_height but set heights directly.
10937 (change_frame_size_1): Use resize_frame_windows.
10938
10939 * xdisp.c (init_xdisp): Don't use set_window_height but set
10940 heights directly.
10941
640c8776
SM
10942 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10943 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
10944 run_window_configuration_change_hook.
10945
10946 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10947 instead of change_window_heights and run
10948 run_window_configuration_change_hook.
10949
1a13852e
MR
109502011-06-09 Martin Rudalics <rudalics@gmx.at>
10951
10952 * window.c (replace_window): Rename second argument REPLACEMENT to
10953 NEW. New third argument SETFLAG. Rewrite.
10954 (delete_window, make_dummy_parent): Call replace_window with
10955 third argument 1.
10956 (window_list_1): Move down in code.
10957 (run_window_configuration_change_hook): Move set_buffer part
10958 before select_frame_norecord part in order to unwind correctly.
10959 Rename count1 to count.
10960 (recombine_windows, delete_deletable_window, resize_root_window)
10961 (Fdelete_other_windows_internal)
10962 (Frun_window_configuration_change_hook, make_parent_window)
10963 (resize_window_check, resize_window_apply, Fresize_window_apply)
10964 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
10965 (Fdelete_window_internal, Fresize_mini_window_internal):
10966 New functions.
1a13852e
MR
10967 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10968
f3d1777e
MR
109692011-06-08 Martin Rudalics <rudalics@gmx.at>
10970
496e208e
MR
10971 * window.h (window): Add some new members to window structure -
10972 normal_lines, normal_cols, new_total, new_normal, clone_number,
10973 splits, nest, prev_buffers, next_buffers.
10974 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 10975 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 10976
f3d1777e
MR
10977 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10978 Remove.
496e208e
MR
10979 (make_dummy_parent): Set new members of windows structure.
10980 (make_window): Move down in code. Handle new members of window
10981 structure.
10982 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10983 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10984 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10985 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
10986 (Fset_window_next_buffers, Fset_window_clone_number):
10987 New functions.
496e208e
MR
10988 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10989 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10990 Doc-string fixes.
10991 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10992 Argument WINDOW can be now internal window too.
10993 (Fwindow_use_time): Move up in code.
10994 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
10995 Rewrite doc-string.
10996 (Fset_window_configuration, saved_window)
10997 (Fcurrent_window_configuration, save_window_save): Handle new
10998 members of window structure.
b9e809c2
MR
10999 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
11000 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
11001 (syms_of_window): New Lisp objects Qrecord_window_buffer,
11002 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
11003 Qget_mru_window, Qresize_root_window,
11004 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
11005 Qauto_buffer_name; staticpro them.
f3d1777e 11006
abde8f8c
MR
110072011-06-07 Martin Rudalics <rudalics@gmx.at>
11008
11009 * window.c (Fwindow_total_size, Fwindow_left_column)
11010 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
11011 (Fwindow_list_1): New functions.
11012 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
11013 (Fwindow_width, Fscroll_left, Fscroll_right):
11014 Use window_body_cols instead of window_box_text_cols.
11015 (delete_window, Fset_window_configuration):
11016 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
11017 (delete_all_subwindows): Take a window as argument and not a
11018 structure. Rewrite.
190b47e6
MR
11019 (window_loop): Remove handling of GET_LRU_WINDOW and
11020 GET_LARGEST_WINDOW.
11021 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
11022
11023 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
11024 window_box_text_cols. delete_all_subwindows now takes a
11025 Lisp_Object as argument.
abde8f8c 11026
640c8776
SM
11027 * indent.c (compute_motion, Fcompute_motion):
11028 Use window_body_cols instead of window_box_text_cols.
abde8f8c 11029
fa8a67e6
MR
11030 * frame.c (delete_frame): Call delete_all_subwindows with root
11031 window as argument.
11032
a54e3482
DC
110332011-06-07 Daniel Colascione <dan.colascione@gmail.com>
11034
11035 * fns.c (Fputhash): Document return value.
11036
60002bf5
CY
110372011-06-06 Chong Yidong <cyd@stupidchicken.com>
11038
11039 * image.c (gif_load): Implement gif89a spec "no disposal" method.
11040
0c671da6 110412011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 11042
b862a52a 11043 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 11044
be44ca6c
PE
11045 Check for overflow when converting integer to cons and back.
11046 * charset.c (Fdefine_charset_internal, Fdecode_char):
11047 Use cons_to_unsigned to catch overflow.
11048 (Fencode_char): Use INTEGER_TO_CONS.
11049 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
11050 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
11051 * data.c (long_to_cons, cons_to_long): Remove.
11052 (cons_to_unsigned, cons_to_signed): New functions.
11053 These signal an error for invalid or out-of-range values.
11054 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
11055 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
11056 * font.c (Ffont_variation_glyphs):
11057 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
11058 * lisp.h: Include <intprops.h>.
11059 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
11060 (cons_to_signed, cons_to_unsigned): New decls.
11061 (long_to_cons, cons_to_long): Remove decls.
11062 * undo.c (record_first_change): Use INTEGER_TO_CONS.
11063 (Fprimitive_undo): Use CONS_TO_INTEGER.
11064 * xfns.c (Fx_window_property): Likewise.
11065 * xselect.c: Include <limits.h>.
11066 (x_own_selection, selection_data_to_lisp_data):
11067 Use INTEGER_TO_CONS.
11068 (x_handle_selection_request, x_handle_selection_clear)
11069 (x_get_foreign_selection, Fx_disown_selection_internal)
11070 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
11071 (lisp_data_to_selection_data): Use cons_to_unsigned.
11072 (x_fill_property_data): Use cons_to_signed.
11073 Report values out of range.
11074
d1f3d2af
PE
11075 Check for buffer and string overflow more precisely.
11076 * buffer.h (BUF_BYTES_MAX): New macro.
11077 * lisp.h (STRING_BYTES_MAX): New macro.
11078 * alloc.c (Fmake_string):
11079 * character.c (string_escape_byte8):
11080 * coding.c (coding_alloc_by_realloc):
11081 * doprnt.c (doprnt):
11082 * editfns.c (Fformat):
11083 * eval.c (verror):
11084 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
11085 since they may not be the same number.
11086 * editfns.c (Finsert_char):
11087 * fileio.c (Finsert_file_contents):
11088 Likewise for BUF_BYTES_MAX.
11089
dd52fcea
PE
11090 * image.c: Use ptrdiff_t, not int, for sizes.
11091 (slurp_file): Switch from int to ptrdiff_t.
11092 All uses changed.
11093 (slurp_file): Check that file size fits in both size_t (for
11094 malloc) and ptrdiff_t (for sanity and safety).
11095
7f9bbdbb
PE
11096 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
11097 if b->modtime has its maximal value.
11098
dfe18f82
PE
11099 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
11100
84acfcf0
PE
11101 Don't assume time_t can fit into int.
11102 * buffer.h (struct buffer.modtime): Now time_t, not int.
11103 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
11104 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
11105
ccd9a01a
PE
11106 Minor fixes for signed vs unsigned integers.
11107 * character.h (MAYBE_UNIFY_CHAR):
11108 * charset.c (maybe_unify_char):
11109 * keyboard.c (read_char, reorder_modifiers):
11110 XINT -> XFASTINT, since the integer must be nonnegative.
11111 * ftfont.c (ftfont_spec_pattern):
11112 * keymap.c (access_keymap, silly_event_symbol_error):
11113 XUINT -> XFASTINT, since the integer must be nonnegative.
11114 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
11115 since it makes no difference and we prefer signed.
11116 * keyboard.c (record_char): Use XUINT when all the neighbors do.
11117 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
11118 nonnegative.
11119
d6d100dd
SM
111202011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
11121
11122 * window.h (Fwindow_frame): Declare.
11123
2b6148e4
PE
111242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11125
11126 * alloc.c: Simplify handling of large-request failures (Bug#8800).
11127 (SPARE_MEMORY): Always define.
11128 (LARGE_REQUEST): Remove.
11129 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
11130
f230ecc9
MR
111312011-06-06 Martin Rudalics <rudalics@gmx.at>
11132
727e958e
MR
11133 * lisp.h: Move EXFUNS for Fframe_root_window,
11134 Fframe_first_window and Fset_frame_selected_window to window.h.
11135
11136 * window.h: Move EXFUNS for Fframe_root_window,
11137 Fframe_first_window and Fset_frame_selected_window here from
11138 lisp.h.
11139
11140 * frame.c (Fwindow_frame, Fframe_first_window)
11141 (Fframe_root_window, Fframe_selected_window)
11142 (Fset_frame_selected_window): Move to window.c.
11143 (Factive_minibuffer_window): Move to minibuf.c.
11144 (Fother_visible_frames_p): New function.
11145
11146 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
11147
f230ecc9
MR
11148 * window.c (decode_window, decode_any_window): Move up in code.
11149 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
11150 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
11151 (Fwindow_buffer): Move up and rewrite doc-string.
11152 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
11153 (Fwindow_prev): New functions.
727e958e
MR
11154 (Fwindow_frame): Move here from frame.c. Accept any window as
11155 argument.
11156 (Fframe_root_window, Fframe_first_window)
11157 (Fframe_selected_window): Move here from frame.c. Accept frame
11158 or arbitrary window as argument. Update doc-strings.
11159 (Fminibuffer_window): Move up in code.
11160 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
11161 (Fset_frame_selected_window): Move here from frame.c.
11162 Marginal rewrite.
727e958e
MR
11163 (Fselected_window, select_window, Fselect_window): Move up in
11164 code. Minor doc-string fixes.
f230ecc9 11165
4d09bcf6
PE
111662011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11167
11168 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
11169 Do not assume that spare memory exists; that assumption is valid
11170 only if SYSTEM_MALLOC.
11171 (LARGE_REQUEST): New macro, so that the issue of large requests
11172 is separated from the issue of spare memory.
11173
810928a2
AS
111742011-06-05 Andreas Schwab <schwab@linux-m68k.org>
11175
172418ad
AS
11176 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
11177 format. (Bug#8806)
11178
43f862f7
AS
11179 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
11180
810928a2
AS
11181 * xfns.c (x_set_scroll_bar_default_width): Move declarations
11182 before statements.
11183
a059fe24
JD
111842011-06-05 Jan Djärv <jan.h.d@swipnet.se>
11185
11186 * gtkutil.c (xg_get_default_scrollbar_width): New function.
11187
11188 * gtkutil.h: Declare xg_get_default_scrollbar_width.
11189
11190 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
11191 min width by calling x_set_scroll_bar_default_width (Bug#8505).
11192
989bf368
JB
111932011-06-05 Juanma Barranquero <lekktu@gmail.com>
11194
11195 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
11196
4b80f674
CY
111972011-06-04 Chong Yidong <cyd@stupidchicken.com>
11198
11199 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
11200 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
11201 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
11202 New error handlers.
4b80f674
CY
11203 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
11204 Obey Vx_select_enable_clipboard_manager. Catch errors in
11205 x_clipboard_manager_save (Bug#8779).
11206 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 11207 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 11208
99a33b77 112092011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
11210
11211 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
11212
99a33b77 112132011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
11214
11215 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
11216 in the current matrix if keep_current_p is non-zero.
11217
8264569d
EZ
112182011-06-04 Eli Zaretskii <eliz@gnu.org>
11219
11220 * bidi.c (bidi_level_of_next_char): Fix last change.
11221
57f97249
EZ
112222011-06-03 Eli Zaretskii <eliz@gnu.org>
11223
fec2107c 11224 Support bidi reordering of text covered by display properties.
57f97249 11225
fec2107c
EZ
11226 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
11227 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
11228 (bidi_cache_search, bidi_cache_iterator_state)
11229 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
11230 (bidi_level_of_next_char, bidi_move_to_visually_next):
11231 Support character positions inside a run of characters covered by a
fec2107c
EZ
11232 display string.
11233 (bidi_paragraph_init, bidi_resolve_explicit_1)
11234 (bidi_level_of_next_char): Call bidi_fetch_char and
11235 bidi_fetch_char_advance instead of FETCH_CHAR and
11236 FETCH_CHAR_ADVANCE.
11237 (bidi_init_it): Initialize new members.
11238 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
11239 definitions.
11240 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
11241 instead of using explicit *_CHAR codes.
d6d100dd
SM
11242 (bidi_resolve_explicit, bidi_resolve_weak):
11243 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
11244 bidirectional text is supported only in multibyte buffers.
11245 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
11246 it to initialize the frame_window_p member of struct bidi_it.
11247 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
11248 (bidi_resolve_explicit, bidi_resolve_weak)
11249 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
11250 bidi_it->nchars is non-positive.
11251 (bidi_level_of_next_char): Don't try to lookup the cache for the
11252 next/previous character if nothing is cached there yet, or if we
11253 were just reseat()'ed to a new position.
c40e2fb2 11254
0e14fe90
EZ
11255 * xdisp.c (set_cursor_from_row): Set start and stop points
11256 according to the row's direction when priming the loop that looks
11257 for the glyph on which to display cursor.
11258 (single_display_spec_intangible_p): Function deleted.
11259 (display_prop_intangible_p): Reimplement to call
11260 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
11261 Accept 3 additional arguments needed by handle_display_spec.
11262 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
11263 values: lists, `(when COND...)' forms, etc.
11264 (single_display_spec_string_p): Support property values that are
11265 lists with the argument STRING its top-level element.
11266 (display_prop_string_p): Fix the condition for processing a
11267 property that is a list to be consistent with handle_display_spec.
fec2107c 11268 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
11269 last portion of handle_display_prop.
11270 (compute_display_string_pos): Accept additional argument
11271 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
11272 value of a `display' property is a "replacing spec".
11273 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
11274 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
11275 the display property, but just return a value indicating whether
11276 the display property will replace the characters it covers.
11277 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
11278 frame_window_p members of struct bidi_it.
d6d100dd
SM
11279 (compute_display_string_pos, compute_display_string_end):
11280 New functions.
fec2107c
EZ
11281 (push_it): Accept second argument POSITION, where pop_it should
11282 jump to continue iteration.
11283 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 11284
fec2107c
EZ
11285 * keyboard.c (adjust_point_for_property): Adjust the call to
11286 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
11287
11288 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
11289 (bidi_init_it): Update prototypes.
11290 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
11291 (compute_display_string_pos, compute_display_string_end):
11292 Declare prototypes.
fec2107c
EZ
11293 (struct bidi_it): New members nchars and disp_pos. ch_len is now
11294 EMACS_INT.
fc6f18ce 11295
40087514 112962011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 11297
57f53182
PE
11298 Malloc failure behavior now depends on size of allocation.
11299 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
11300 * lisp.h: Change signatures accordingly.
11301 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
11302 All callers changed. (Bug#8762)
11303
11304 * gnutls.c: Use Emacs's memory allocators.
11305 Without this change, the gnutls library would invoke malloc etc.
11306 directly, which causes problems on non-SYNC_INPUT hosts, and which
11307 runs afoul of improving memory_full behavior. (Bug#8761)
11308 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
11309 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
11310 xfree instead of the default malloc, realloc, free.
11311 (Fgnutls_boot): No need to check for memory allocation failure,
11312 since xmalloc does that for us.
11313
ac32cd99 11314 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
11315 * category.c (hash_get_category_set):
11316 * ccl.c (ccl_driver):
11317 * charset.c (Fdefine_charset_internal):
11318 * charset.h (struct charset.hash_index):
11319 * composite.c (get_composition_id, gstring_lookup_cache)
11320 (composition_gstring_put_cache):
11321 * composite.h (struct composition.hash_index):
11322 * dispextern.h (struct image.hash):
11323 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
11324 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
11325 (hashfn_equal, hashfn_user_defined, make_hash_table)
11326 (maybe_resize_hash_table, hash_lookup, hash_put)
11327 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
11328 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
11329 (Fsxhash, Fgethash, Fputhash, Fmaphash):
11330 * image.c (make_image, search_image_cache, lookup_image)
11331 (xpm_put_color_table_h):
11332 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 11333 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 11334 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 11335 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
11336 * alloc.c (allocate_vectorlike):
11337 Check for overflow in vector size calculations.
11338 * ccl.c (ccl_driver):
11339 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
11340 * fns.c, image.c: Remove unnecessary static decls that would otherwise
11341 need to be updated by these changes.
40087514
PE
11342 * fns.c (make_hash_table, maybe_resize_hash_table):
11343 Check for integer overflow with large hash tables.
0de4bb68
PE
11344 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
11345 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
11346 (SXHASH_REDUCE): New macro.
11347 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
11348 Use it instead of discarding useful hash info with large hash values.
11349 (sxhash_float): New function.
11350 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
11351 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
11352 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
11353 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
11354 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
11355 Adjust signatures to match updated version of code.
11356 (consing_since_gc): Now EMACS_INT, since a single hash table can
11357 use more than INT_MAX bytes.
11358
698d32e2
DN
113592011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
11360
11361 Make it possible to build with GCC-4.6+ -O2 -flto.
11362
11363 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
11364
fd6fa53f
SM
113652011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
11366
11367 * minibuf.c (get_minibuffer, read_minibuf_unwind):
11368 Call minibuffer-inactive-mode.
11369
864db017
JB
113702011-05-31 Juanma Barranquero <lekktu@gmail.com>
11371
11372 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
11373 Update dependencies.
11374
2ad0baf4
DN
113752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11376
11377 * data.c (init_data): Remove code for UTS, this system is not
11378 supported anymore.
11379
4fcc2638
DN
113802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11381
11382 Don't force ./temacs to start in terminal mode.
11383
11384 * frame.c (make_initial_frame): Initialize faces in all cases, not
11385 only when CANNOT_DUMP is defined.
11386 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11387
c56e0fd5
DN
113882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11389
11390 * dispnew.c (add_window_display_history): Use const for the string
11391 pointer. Remove declaration, not needed.
11392
333d54da 113932011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 11394
55d4c1b2 11395 Use 'inline', not 'INLINE'.
333d54da 11396 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
11397 * alloc.c, fontset.c (INLINE): Remove.
11398 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11399 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11400 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11401 * gmalloc.c (register_heapinfo): Use inline unconditionally.
11402 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11403
738db178
DN
114042011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11405
11406 Make it possible to run ./temacs.
11407
11408 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11409 syms_of_callproc does the same thing. Remove test for
11410 "initialized", do it in the caller.
11411 * emacs.c (main): Avoid calling set_initial_environment when dumping.
11412
620c53a6
SM
114132011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
11414
11415 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11416 (read_minibuf): Use get_minibuffer.
11417 (syms_of_minibuf): Use DEFSYM.
11418 (Qmetadata): New var.
11419 * data.c (Qbuffer): Don't make it static.
11420 (syms_of_data): Use DEFSYM.
11421
e003a292
PE
114222011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11423
11424 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
11425 (CCL_CODE_MIN): New macro.
11426
ed008a6d
PE
114272011-05-30 Paul Eggert <eggert@cs.ucla.edu>
11428
3687c2ef
PE
11429 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11430
ed008a6d
PE
11431 * eval.c (Qdebug): Now static.
11432 * lisp.h (Qdebug): Remove decl. This reverts a part of the
11433 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11434 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11435
d66c4c7c
CY
114362011-05-29 Chong Yidong <cyd@stupidchicken.com>
11437
11438 * image.c: Various fixes to ImageMagick code comments.
11439 (Fimagemagick_types): Doc fix.
11440
5fbc2025
PE
114412011-05-29 Paul Eggert <eggert@cs.ucla.edu>
11442
0196f88a
PE
11443 Minor fixes prompted by GCC 4.6.0 warnings.
11444
11445 * xselect.c (converted_selections, conversion_fail_tag): Now static.
11446
5fbc2025
PE
11447 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11448 (x_clipboard_manager_save_all): Move extern decl to ...
11449 * xterm.h: ... here, so that it can be checked for consistency.
11450
1dd3c2d9
CY
114512011-05-29 Chong Yidong <cyd@stupidchicken.com>
11452
11453 * xselect.c (x_clipboard_manager_save_frame)
11454 (x_clipboard_manager_save_all): New functions.
11455 (Fx_clipboard_manager_save): Lisp function deleted.
11456
11457 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11458 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11459
11460 * xterm.h: Update prototype.
11461
5ba6571d
WX
114622011-05-28 William Xu <william.xwl@gmail.com>
11463
11464 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11465 exiting (Bug#8239).
11466
3eaff834
JM
114672011-05-28 Jim Meyering <meyering@redhat.com>
11468
e1900994 11469 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
11470 * fns.c (to_uchar): Define.
11471 (crypto_hash_function): Use it to convert some newly-signed
11472 variables to unsigned, to avoid sign-extension bugs. For example,
11473 without this change, (md5 "truc") would evaluate to
11474 45723a2aff78ff4fff7fff1114760e62 rather than the expected
11475 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 11476 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 11477
0f6990a7
PE
114782011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11479
11480 Integer overflow fixes.
c8a9ca5a 11481
08686060
PE
11482 * dbusbind.c: Serial number integer overflow fixes.
11483 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
11484 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11485 to hold a serial number that is too large for a fixnum.
11486 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11487 Check for serial numbers out of range. Decode any serial number
59568bf0 11488 that was so large that it became a float. (Bug#8722)
08686060 11489
2d1fc3c7
PE
11490 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11491 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11492 Use XFASTINT rather than XUINT when numbers are nonnegative.
11493 (xd_append_arg, Fdbus_method_return_internal):
11494 (Fdbus_method_error_internal): Likewise. Also, for unsigned
11495 arguments, check that Lisp number is nonnegative, rather than
59568bf0 11496 silently wrapping negative numbers around. (Bug#8722)
30217ff0 11497 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 11498 (Bug#8722)
2d1fc3c7 11499
c8a9ca5a
PE
11500 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11501
519e1d69
PE
11502 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11503
6df6ae42 11504 ccl: Add integer overflow checks.
30569699
PE
11505 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11506 (IN_INT_RANGE): New macros.
11507 (ccl_driver): Use them to check for integer overflow when
11508 decoding a CCL program. Many of the new checks are whether XINT (x)
11509 fits in int; it doesn't always, on 64-bit hosts. The new version
11510 doesn't catch all possible integer overflows, but it's an
847044ea 11511 improvement. (Bug#8719)
30569699 11512
c11285dc
PE
11513 * alloc.c (make_event_array): Use XINT, not XUINT.
11514 There's no need for unsigned here.
11515
fdccd48e
PE
11516 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11517 This follows up to the 2011-05-06 change that substituted uintptr_t
11518 for EMACS_INT. This case wasn't caught back then.
11519
37910ab2
PE
11520 Rework Fformat to avoid integer overflow issues.
11521 * editfns.c: Include <float.h> unconditionally, as it's everywhere
11522 now (part of C89). Include <verify.h>.
11523 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
11524 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
11525 (Fformat): Avoid the prepass trying to compute sizes; it was only
11526 approximate and thus did not catch overflow reliably. Instead, walk
11527 through the format just once, formatting and computing sizes as we go,
11528 checking for integer overflow at every step, and allocating a larger
11529 buffer as needed. Keep track separately whether the format is
11530 multibyte. Keep only the most-recently calculated precision, rather
11531 than them all. Record whether each argument has been converted to
11532 string. Use EMACS_INT, not int, for byte and char and arg counts.
11533 Support field widths and precisions larger than INT_MAX. Avoid
11534 sprintf's undefined behavior with conversion specifications such as %#d
11535 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
11536 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
11537 formatting out-of-range floating point numbers with int
9173deec 11538 formats. (Bug#8668)
37910ab2 11539
2e6578fb
PE
11540 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
11541
0ae6bdee
PE
11542 * data.c: Avoid integer truncation in expressions involving floats.
11543 * data.c: Include <intprops.h>.
11544 (arith_driver): When there's an integer overflow in an expression
11545 involving floating point, convert the integers to floating point
11546 so that the resulting value does not suffer from catastrophic
11547 integer truncation. For example, on a 64-bit host (* 4
11548 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11549 Do not rely on undefined behavior after integer overflow.
11550
de883a70
PE
11551 merge count_size_as_multibyte, parse_str_to_multibyte
11552 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 11553 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
11554 Check for integer overflow.
11555 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11556 since it's now a duplicate of the other. This is more of
11557 a character than a buffer op, so better that it's in character.c.
11558 * fns.c, print.c: Adjust to above changes.
11559
2ff916cb
PE
115602011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11561
11562 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11563
f1b54466
PE
115642011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11565
fb1ac845
PE
11566 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11567 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11568 (x_clipboard_manager_save): Now static.
11569 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11570
f1b54466
PE
11571 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11572 (crypto_hash_function): Now static.
11573 Fix pointer signedness problems. Avoid unnecessary initializations.
11574
a9f737ee
CY
115752011-05-27 Chong Yidong <cyd@stupidchicken.com>
11576
11577 * termhooks.h (Vselection_alist): Make it terminal-local.
11578
11579 * terminal.c (create_terminal): Initialize it.
11580
11581 * xselect.c: Support for clipboard managers.
11582 (Vselection_alist): Move to termhooks.h as terminal-local var.
11583 (LOCAL_SELECTION): New macro.
11584 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11585 (symbol_to_x_atom): Remove gratuitous arg.
11586 (x_handle_selection_request, lisp_data_to_selection_data)
11587 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
11588 (x_own_selection, x_get_local_selection, x_convert_selection):
11589 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
11590 (some_frame_on_display): Delete unused function.
11591 (Fx_own_selection_internal, Fx_get_selection_internal)
11592 (Fx_disown_selection_internal, Fx_selection_owner_p)
11593 (Fx_selection_exists_p): New optional frame arg.
11594 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11595 (x_handle_selection_clear): Don't treat other terminals with the
11596 same keyboard specially. Use the terminal-local Vselection_alist.
11597 (x_clear_frame_selections): Use Frun_hook_with_args.
11598
11599 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11600
11601 * xterm.h: Add support for those atoms.
11602
e067f0c1
CY
116032011-05-26 Chong Yidong <cyd@stupidchicken.com>
11604
11605 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11606 (converted_selections, conversion_fail_tag): New global variables.
11607 (x_selection_request_lisp_error): Free the above.
11608 (x_get_local_selection): Remove unnecessary code.
11609 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
11610 of converted selections stored in converted_selections.
11611 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
11612 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11613 (x_convert_selection): New function.
11614 (x_handle_selection_event): Simplify.
11615 (x_get_foreign_selection): Don't ignore incoming requests while
11616 waiting for an answer; this will fail when we implement
11617 SAVE_TARGETS, and seems unnecessary anyway.
11618 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11619 (Vx_sent_selection_functions): Doc fix.
11620
0f4aebc0
LL
116212011-05-26 Leo Liu <sdl.web@gmail.com>
11622
11623 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11624
e61124cd
YM
116252011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11626
11627 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11628
11629 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11630 for fringe update if it has periodic bitmap.
ac389d0c 11631 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
11632 and fringe_bitmap_periodic_p.
11633
11634 * fringe.c (get_fringe_bitmap_data): New function.
11635 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11636 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11637 row. Mark glyph row for fringe update if periodicity changed.
11638
11639 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11640 for fringe update unless it has periodic bitmap.
11641
f16d9837
KH
116422011-05-25 Kenichi Handa <handa@m17n.org>
11643
11644 * xdisp.c (get_next_display_element): Set correct it->face_id for
11645 a static composition.
11646
e1b90ef6
LL
116472011-05-24 Leo Liu <sdl.web@gmail.com>
11648
11649 * deps.mk (fns.o):
11650 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11651
11652 * fns.c (crypto_hash_function, Fsha1): New function.
11653 (Fmd5): Use crypto_hash_function.
11654 (syms_of_fns): Add Ssha1.
11655
7400048f
PE
116562011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11657
11658 * gnutls.c: Remove unused macros.
11659 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11660 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11661 Remove macros that are defined and never used.
11662 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11663
abb71cf4
CY
116642011-05-22 Chong Yidong <cyd@stupidchicken.com>
11665
11666 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11667 (Fx_get_selection_internal): Minor cleanup.
11668 (Fx_own_selection_internal): Rename arguments for consistency with
11669 select.el.
11670
6307db39
PE
116712011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11672
11673 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11674
f3d4e0a4
CY
116752011-05-22 Chong Yidong <cyd@stupidchicken.com>
11676
11677 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11678
4d8ade89
YM
116792011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11680
11681 * dispnew.c (scrolling_window): Don't exclude the case that the
11682 last enabled row in the desired matrix touches the bottom boundary.
11683
32078c8d
GM
116842011-05-21 Glenn Morris <rgm@gnu.org>
11685
11686 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
11687 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11688 and add some more files.
32078c8d 11689
7285dc67
EZ
116902011-05-20 Eli Zaretskii <eliz@gnu.org>
11691
11692 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11693 report_file_error introduced by the change from 2011-05-07.
11694
89d1bd22
PE
116952011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11696
11697 * systime.h (Time): Define only if emacs is defined.
11698 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11699 where the include path doesn't have X11/X.h by default. See
11700 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11701
cd394be1 117022011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
11703
11704 * composite.c (find_automatic_composition): Fix previous change.
11705
b9704ad9
GM
117062011-05-20 Glenn Morris <rgm@gnu.org>
11707
11708 * lisp.mk: New file, split from Makefile.in.
11709 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11710 (shortlisp): Remove.
11711 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11712
4a720484
GM
117132011-05-19 Glenn Morris <rgm@gnu.org>
11714
11715 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11716 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11717 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11718 (lisp): Set the order to that of loadup.el.
11719 (shortlisp): Make it a copy of $lisp.
11720 (SOME_MACHINE_LISP): Remove.
11721 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11722 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11723
a28d4396
KH
117242011-05-18 Kenichi Handa <handa@m17n.org>
11725
11726 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11727 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11728 (find_automatic_composition): Mostly rewrite for efficiency.
11729
a2b1fa8e
JB
117302011-05-18 Juanma Barranquero <lekktu@gmail.com>
11731
11732 * makefile.w32-in: Update dependencies.
11733
8e1f5610
CS
117342011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11735
11736 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 11737 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 11738
7025ee00 117392011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 11740
cdfa6eab
PE
11741 Fix some integer overflow issues, such as string length overflow.
11742
06d6db33
PE
11743 * insdel.c (count_size_as_multibyte): Check for string overflow.
11744
2b4560a8
PE
11745 * character.c (lisp_string_width): Check for string overflow.
11746 Use EMACS_INT, not int, for string indexes and lengths; in
11747 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11748 the resulting string length overflows an EMACS_INT; instead,
11749 report a string overflow if no precision given. When checking for
11750 precision exhaustion, use a check that cannot possibly have
11751 integer overflow. (Bug#8675)
11752 * character.h (lisp_string_width): Adjust to new signature.
11753
cb93f9be
PE
11754 * alloc.c (string_overflow): New function.
11755 (Fmake_string): Use it. This doesn't change behavior, but saves
11756 a few bytes and will simplify future changes.
11757 * character.c (string_escape_byte8): Likewise.
11758 * lisp.h (string_overflow): New decl.
11759
1a1f3366
PE
11760 Fixups, following up to the user-interface timestamp change.
11761 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
11762 for UI timestamps, instead of unsigned long.
9fbd6841
PE
11763 * msdos.c (mouse_get_pos): Likewise.
11764 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
11765 * w32gui.h (Time): Define by including "systime.h" rather than by
11766 declaring it ourselves. (Bug#8664)
11767
d4e3e4d3
PE
11768 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
11769 * image.c (clear_image_cache): Likewise.
11770
f6a24d19
PE
11771 * term.c (term_mouse_position): Don't assume time_t wraparound.
11772
08dc5ae6
PE
11773 Be more systematic about user-interface timestamps.
11774 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
11775 and sometimes 'EMACS_UINT', to represent these timestamps.
11776 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
11777 This makes the code easier to follow, and makes it easier to catch
11778 integer overflow bugs such as Bug#8664.
11779 * frame.c (Fmouse_position, Fmouse_pixel_position):
11780 Use Time, not unsigned long, for user-interface timestamps.
11781 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
11782 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
11783 * keyboard.h (last_event_timestamp): Likewise.
11784 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
11785 * menu.h (xmenu_show): Likewise.
11786 * term.c (term_mouse_position): Likewise.
11787 * termhooks.h (struct input_event.timestamp): Likewise.
11788 (struct terminal.mouse_position_hook): Likewise.
11789 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
11790 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
11791 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
11792 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
11793 what it was before.
11794 * menu.h, termhooks.h: Include "systime.h", for Time.
11795
8e55734a
PE
11796 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
11797 Don't assume that the difference between two unsigned long values
11798 can fit into an integer. At this point, we know button_down_time
11799 <= event->timestamp, so the difference must be nonnegative, so
11800 there's no need to cast the result if double-click-time is
11801 nonnegative, as it should be; check that it's nonnegative, just in
11802 case. This bug is triggered when events are more than 2**31 ms
86db42d2 11803 apart (about 25 days). (Bug#8664)
8e55734a 11804
841f1b75 11805 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 11806 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 11807
3e26f69c
PE
11808 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
11809 that always fit in int. Use a sentinel instead of a counter, to
11810 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
11811 * frame.h (struct frame): Use int for menu_bar_items_used
11812 instead of EMACS_INT, since it always fits in int.
3e26f69c 11813
5cc152c0
PE
11814 * menu.c (grow_menu_items): Check for int overflow.
11815
d89eb65e
PE
11816 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
11817
5235bd3e
PE
11818 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
11819 Before, the code was not consistent. These values cannot exceed
11820 2**31 - 1 so there's no need to make them unsigned.
11821 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
11822 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
11823 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
11824 as modifiers.
11825 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
11826
bc827e23
PE
11827 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
11828 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
11829 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
11830 presumably because the widths might not match.
11831
78eb494e
PE
11832 * window.c (size_window): Avoid needless test at loop start.
11833
04f2d78b
CB
118342011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
11835
11836 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
11837
d2fc7e3d 118382011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
11839
11840 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
11841
d2fc7e3d 118422011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
11843
11844 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
11845 `width' to `bar_area_x' and `bar_area_width', respectively.
11846 (x_scroll_run): Take account of fringe background extension.
11847
04f2d78b
CB
11848 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
11849 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
11850 `bar_area_width', respectively.
11851 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
11852 background extension.
11853
79b70037
GM
118542011-05-10 Jim Meyering <meyering@redhat.com>
11855
11856 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
11857
2f142cc5
JB
118582011-05-10 Juanma Barranquero <lekktu@gmail.com>
11859
11860 * image.c (Finit_image_library): Return t for built-in image types,
11861 like pbm and xbm. (Bug#8640)
11862
57679c86
AS
118632011-05-09 Andreas Schwab <schwab@linux-m68k.org>
11864
11865 * w32menu.c (set_frame_menubar): Fix submenu allocation.
11866
888c9e86
EZ
118672011-05-07 Eli Zaretskii <eliz@gnu.org>
11868
b0512a1d
EZ
11869 * w32console.c (Fset_screen_color): Doc fix.
11870 (Fget_screen_color): New function.
11871 (syms_of_ntterm): Defsubr it.
11872
7285dc67
EZ
11873 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11874 unlink the temporary file if Fcall_process didn't create it in the
11875 first place.
11876 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11877 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
11878 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11879 cue to call_process_cleanup not to close that handle.
11880
4d3fcc8e
BK
118812011-05-07 Ben Key <bkey76@gmail.com>
11882
11883 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11884 one of two shell specific rules, either bootstrap-temacs-CMD or
11885 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11886 to the previous implementation of the bootstrap-temacs rule.
11887 The bootstrap-temacs-CMD rule is similar to the previous
11888 implementation of the bootstrap-temacs rule except that it
11889 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11890 variable.
11891
11892 These changes, along with some changes to nt/configure.bat,
11893 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11894 earlier fix to add support for --cflags and --ldflags options
11895 that include quotes so that it works whether make uses cmd or
11896 sh as the shell.
11897
b4289b64
MA
118982011-05-06 Michael Albinus <michael.albinus@gmx.de>
11899
11900 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11901 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11902 is a constant.
11903 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11904 a string. Handle both cases.
11905 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11906 (Fdbus_register_method): Use Qinvalid_function.
11907
af4c0e28
JB
119082011-05-06 Juanma Barranquero <lekktu@gmail.com>
11909
11910 * makefile.w32-in: Update dependencies.
11911 (LISP_H): Add inttypes.h and stdin.h.
11912 (PROCESS_H): Add unistd.h.
11913
c51453d9
EZ
119142011-05-06 Eli Zaretskii <eliz@gnu.org>
11915
11916 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11917 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11918
8ff0ac3c 119192011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 11920
4c4b566b
PE
11921 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11922
aab2b9b5
PE
11923 * term.c (vfatal): Remove stray call to va_end.
11924 It's not needed and the C Standard doesn't allow it here anyway.
11925
c378da0b
PE
11926 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11927 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11928
288b08c7
PE
11929 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11930 bytes.
11931
e3601888
PE
11932 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11933
db6c0e74
PE
11934 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11935
dd5963ea
PE
11936 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11937
88c9450f
PE
11938 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11939
2f9442b8
PE
11940 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11941
c032b5f8
PE
11942 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11943 * charset.c (Fdefine_charset_internal): Don't initialize
11944 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 11945 32-bit int (Bug#8600).
a108c10b
PE
11946
11947 * lread.c (read_integer): Be more consistent with string-to-number.
11948 Use string_to_number to do the actual conversion; this avoids
11949 rounding errors and fixes some other screwups. Without this fix,
11950 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11951 (digit_to_number): Move earlier, for benefit of read_integer.
11952 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 11953 not a digit in any supported base. (Bug#8602)
a108c10b 11954
ad5f9eea
PE
11955 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11956
aec1708a
PE
11957 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11958 to match comment at start of function. This also removes a
11959 GCC warning about overflow in a 32+64-bit port.
11960
47be4ab5
PE
11961 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11962
371cac43
PE
11963 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11964 Reported by Stefan Monnier in
11965 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
11966 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11967 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 11968
d01a7826
PE
11969 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11970 (EMACS_UINTPTR): Likewise, with uintptr_t.
11971
7fd47d5c
PE
11972 * lisp.h: Prefer 64-bit EMACS_INT if available.
11973 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11974 on 32-bit hosts that have 64-bit int, so that they can access
11975 large files.
122b0c86
PE
11976 However, temporarily disable this change unless the temporary
11977 symbol WIDE_EMACS_INT is defined.
7fd47d5c 11978
8727937b
PE
11979 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11980
8ac068ac
PE
11981 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11982 This removes an assumption that EMACS_INT and long are the same
11983 width as pointers. The assumption is true for Emacs porting targets
11984 now, but we want to make other targets possible.
11985 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11986 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11987 In the rest of the code, change types of integers that hold casted
11988 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11989 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11990 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11991 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11992 No need to cast type when ORing.
11993 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
11994 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
11995 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
11996 assume EMACS_INT is the same width as char *.
11997 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
11998 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
11999 Remove no-longer-needed casts.
12000 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
12001 (xg_tool_bar_help_callback, xg_make_tool_item):
12002 Use EMACS_INTPTR to hold an integer
12003 that will be cast to void *; this can avoid a GCC warning
12004 if EMACS_INT is not the same width as void *.
12005 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
12006 * xdisp.c (display_echo_area_1, resize_mini_window_1):
12007 (current_message_1, set_message_1):
12008 Use a local to convert to proper width without a cast.
12009 * xmenu.c (dialog_selection_callback): Likewise.
12010
ede49d71
PE
12011 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
12012 Also, don't assume VALBITS / RAND_BITS is less than 5,
12013 and don't rely on undefined behavior when shifting a 1 left into
12014 the sign bit.
12015 * lisp.h (get_random): Change signature to match.
12016
2f30ecd0
PE
12017 * lread.c (hash_string): Use size_t, not int, for hash computation.
12018 Normally we prefer signed values; but hashing is special, because
12019 it's better to use unsigned division on hash table sizes so that
12020 the remainder is nonnegative. Also, size_t is the natural width
12021 for hashing into memory. The previous code used 'int', which doesn't
12022 retain enough info to hash well into very large tables.
12023 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
12024
2a866e7b
PE
12025 * dbusbind.c: Don't possibly lose pointer info when converting.
12026 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12027 Use XPNTR rather than XHASH, so that the high-order bits of
12028 the pointer aren't lost when converting through void *.
12029
51639eac
PE
12030 * eval.c (Fautoload): Don't double-shift a pointer.
12031
92394119
PE
12032 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
12033
dbdb9a7c
JB
120342011-05-06 Juanma Barranquero <lekktu@gmail.com>
12035
12036 * gnutls.c (DEF_GNUTLS_FN):
12037 * image.c (DEF_IMGLIB_FN): Make function pointers static.
12038
db7a0b4f
AS
120392011-05-05 Andreas Schwab <schwab@linux-m68k.org>
12040
12041 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
12042 marker. (Bug#8610)
12043
cd394be1 120442011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
12045
12046 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
12047 New version that can reserve upto 2GB of heap space.
12048
f7ff1b0f 120492011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
12050
12051 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
12052
639c109b
TZ
120532011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
12054
12055 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
12056 `gnutls_certificate_set_x509_key_file'.
12057
d2127135
JB
120582011-05-05 Juanma Barranquero <lekktu@gmail.com>
12059
12060 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
12061 Update dependencies.
12062
e968f4f3
JB
120632011-05-04 Juanma Barranquero <lekktu@gmail.com>
12064
12065 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
12066 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12067 Remove unused parameter `fildes'.
12068 * process.c (read_process_output, send_process): Don't pass it.
12069
84d358f0
JB
120702011-05-04 Juanma Barranquero <lekktu@gmail.com>
12071
12072 Fix previous change: the library cache is defined in w32.c.
12073 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
12074 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
12075
0898ca10
JB
120762011-05-04 Juanma Barranquero <lekktu@gmail.com>
12077
12078 Implement dynamic loading of GnuTLS on Windows.
12079
12080 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
12081 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
12082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12083 Declare.
12084
12085 * gnutls.c (Qgnutls_dll): Define.
12086 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
12087 (gnutls_*): Declare function pointers.
12088 (init_gnutls_functions): New function to initialize function pointers.
12089 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
12090 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
12091 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12092 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
12093 (emacs_gnutls_write, emacs_gnutls_read)
12094 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
12095 (Fgnutls_available_p): New function.
12096 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
12097 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
12098 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
12099
12100 * image.c: Include w32.h.
12101 (Vimage_type_cache): Delete.
12102 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
12103 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
12104 (w32_delayed_load): Move to w32.c.
12105
12106 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
12107
12108 * w32.c (QCloaded_from, Vlibrary_cache): Define.
12109 (w32_delayed_load): Move from image.c. When loading a library, record
12110 its filename in the :loaded-from property of the library id.
12111 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
12112 Initialize and staticpro them.
12113 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
12114
12115 * process.c: Include lisp.h before w32.h, not after.
12116 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
12117 instead of gnutls_record_check_pending.
12118
12119 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
12120
ff4de4aa
TZ
121212011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
12122
12123 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
12124 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
12125 as passed in.
12126
abe95abb
JD
121272011-05-03 Jan Djärv <jan.h.d@swipnet.se>
12128
12129 * xterm.c (x_set_frame_alpha): Do not set property on anything
12130 else than FRAME_X_OUTER_WINDOW (Bug#8608).
12131
e16e55d4
JB
121322011-05-02 Juanma Barranquero <lekktu@gmail.com>
12133
12134 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
12135
bafcf6a5
JB
121362011-05-02 Juanma Barranquero <lekktu@gmail.com>
12137
12138 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
12139 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
12140 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
12141 (gnutls_global_initialized, Qgnutls_bootprop_priority)
12142 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
12143 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
12144 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
12145 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
12146 (Qgnutls_bootprop_callbacks_verify): Make static.
12147
e7a6747f
AS
121482011-05-01 Andreas Schwab <schwab@linux-m68k.org>
12149
19ed11ba
AS
12150 * callproc.c: Indentation fixup.
12151
e7a6747f 12152 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
12153 (wait_for_termination, interruptible_wait_for_termination):
12154 Move after wait_for_termination_1.
e7a6747f 12155
1ef14cb4
LMI
121562011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
12157
12158 * sysdep.c (interruptible_wait_for_termination): New function
12159 which is like wait_for_termination, but allows keyboard
12160 interruptions.
12161
12162 * callproc.c (Fcall_process): Add (:file "file") as an option for
12163 the STDOUT buffer.
12164 (Fcall_process_region): Ditto.
12165
330d880c
EZ
121662011-04-30 Eli Zaretskii <eliz@gnu.org>
12167
8db90b73
EZ
12168 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
12169 rather than `XVECTOR (FOO)->size'.
12170
330d880c
EZ
12171 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
12172 inttypes.h, as a gnulib replacement is used if it not available in
12173 system headers.
12174
15cbd324
EZ
121752011-04-21 Eli Zaretskii <eliz@gnu.org>
12176
12177 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
12178 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
12179 of MOST_POSITIVE_FIXNUM. (Bug#8528)
12180
12181 * coding.c (coding_alloc_by_realloc): Error out if destination
12182 will grow beyond MOST_POSITIVE_FIXNUM.
12183 (decode_coding_emacs_mule): Abort if there isn't enough place in
12184 charbuf for the composition carryover bytes. Reserve an extra
12185 space for up to 2 characters produced in a loop.
12186 (decode_coding_iso_2022): Abort if there isn't enough place in
12187 charbuf for the composition carryover bytes.
12188
121892011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 12190
ae940cca
EZ
12191 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
12192 aborting when %lld or %lll format is passed.
12193 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
12194 %llo or %llx format is passed. (Bug#8545)
12195
03ab8921
EZ
12196 * window.c (window_scroll_line_based): Use a marker instead of
12197 simple variables to record original value of point. (Bug#7952)
12198
afda1437
EZ
12199 * doprnt.c (doprnt): Fix the case where a multibyte sequence
12200 produced by %s or %c overflows available buffer space. (Bug#8545)
12201
f76dee0c
PE
122022011-04-28 Paul Eggert <eggert@cs.ucla.edu>
12203
12204 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 12205 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 12206
fdc5744d
JB
122072011-04-28 Juanma Barranquero <lekktu@gmail.com>
12208
12209 * w32.c (init_environment): Warn about defaulting HOME to C:\.
12210
638f053a
JB
122112011-04-28 Juanma Barranquero <lekktu@gmail.com>
12212
12213 * keyboard.c (Qdelayed_warnings_hook): Define.
12214 (command_loop_1): Run `delayed-warnings-hook'
12215 if Vdelayed_warnings_list is non-nil.
12216 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
12217 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
12218
d178f871
EZ
122192011-04-28 Eli Zaretskii <eliz@gnu.org>
12220
12221 * doprnt.c (doprnt): Don't return value smaller than the buffer
12222 size if the message was truncated. (Bug#8545).
12223
b124fd93
JB
122242011-04-28 Juanma Barranquero <lekktu@gmail.com>
12225
12226 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
12227 (Fx_window_property): #if-0 the whole functions, not just the bodies.
12228
e810457d
PE
122292011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12230
12231 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
12232
ea51cceb
JB
122332011-04-27 Juanma Barranquero <lekktu@gmail.com>
12234
12235 * makefile.w32-in: Update dependencies.
12236
94dcfacf
EZ
122372011-04-27 Eli Zaretskii <eliz@gnu.org>
12238
12239 Improve `doprnt' and its usage. (Bug#8545)
12240 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
12241 `format_end'. Remove support for %l as a conversion specifier.
12242 Don't use xrealloc. Improve diagnostics when the %l size modifier
12243 is used. Update the commentary.
12244
12245 * eval.c (verror): Simplify calculation of size_t.
12246
12247 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
12248 messages.
12249
f61f41d7
PE
122502011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
12251
12252 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
12253 change.
12254
96fb4434
PE
122552011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
12258 This makes this file independent of the recent pseudovector change.
12259
671875da 122602011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 12261
69e9b5a3
PE
12262 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
12263
b5f869a7 12264 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 12265 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 12266 Remove unused local.
c8926152 12267 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 12268
841a1577 12269 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
12270 GCC 4.6.0 optimizes based on type-based alias analysis.
12271 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
12272 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
12273 != &v->size, and therefore "v->size = 1; b->size = 2; return
12274 v->size;" must therefore return 1. This assumption is incorrect
12275 for Emacs, since it type-puns struct Lisp_Vector * with many other
12276 types. To fix this problem, this patch adds a new type struct
f904488f 12277 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
12278 and pseudovectors, and helps optimizing compilers not get fooled
12279 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
12280 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
12281 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
12282 the size member.
eab3844f
PE
12283 (XSETPVECTYPE): Rewrite in terms of new macro.
12284 (XSETPVECTYPESIZE): New macro, specifying both type and size.
12285 This is a bit clearer, and further avoids the possibility of
12286 undesirable aliasing.
12287 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 12288 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
12289 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
12290 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
12291 (ASIZE): Now uses header.size rather than size.
12292 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
12293 to avoid the hassle of writing XVECTOR (foo)->header.size.
12294 (struct vectorlike_header): New type.
eab3844f
PE
12295 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
12296 object, to help avoid aliasing.
12297 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
12298 (SUBRP): Likewise, since Lisp_Subr is a special case.
12299 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
12300 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
12301 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 12302 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
12303 changed to be "header.size" and "header.next".
12304 * buffer.h (struct buffer): Likewise.
12305 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
12306 * frame.h (struct frame): Likewise.
12307 * process.h (struct Lisp_Process): Likewise.
12308 * termhooks.h (struct terminal): Likewise.
12309 * window.c (struct save_window_data, struct saved_window): Likewise.
12310 * window.h (struct window): Likewise.
12311 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
12312 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
12313 * buffer.c (init_buffer_once): Likewise.
12314 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
12315 special case.
12316 * process.c (Fformat_network_address): Use local var for size,
12317 for brevity.
12318
0df1eac5
PE
12319 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
12320
847ab9d1 12321 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
12322 * data.c (atof): Remove decl; no longer used or needed.
12323 (digit_to_number): Move to lread.c.
12324 (Fstring_to_number): Use new string_to_number function, to be
12325 consistent with how the Lisp reader treats infinities and NaNs.
12326 Do not assume that floating-point numbers represent EMACS_INT
12327 without losing information; this is not true on most 64-bit hosts.
12328 Avoid double-rounding errors, by insisting on integers when
12329 parsing non-base-10 numbers, as the documentation specifies.
12330 * lisp.h (string_to_number): New decl, replacing ...
12331 (isfloat_string): Remove.
bc0a5c13 12332 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 12333 (read1): Do not accept +. and -. as integers; this
452f4150
PE
12334 appears to have been a coding error. Similarly, do not accept
12335 strings like +-1e0 as floating point numbers. Do not report
12336 overflow for integer overflows unless the base is not 10 which
12337 means we have no simple and reliable way to continue.
12338 Break out the floating-point parsing into a new
12339 function string_to_number, so that Fstring_to_number parses
12340 floating point numbers consistently with the Lisp reader.
04f2d78b 12341 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
12342 (E_CHAR, EXP_INT): Remove, replacing with ...
12343 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
12344 (string_to_number): New function, replacing isfloat_string.
12345 This function checks for valid syntax and produces the resulting
12346 Lisp float number too. Rework it so that string-to-number
bc0a5c13 12347 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
12348 so that overflow for non-base-10 numbers is reported only when
12349 there's no portable and simple way to convert to floating point.
452f4150 12350
67769ffc
PE
12351 * textprop.c (set_text_properties_1): Rewrite for clarity,
12352 and to avoid GCC warning about integer overflow.
12353
c20db43f
PE
12354 * intervals.h (struct interval): Use EMACS_INT for members
12355 where EMACS_UINT might cause problems. See
12356 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
12357 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
12358 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
12359 All uses changed.
37aa2f85
PE
12360 (offset_intervals): Tell GCC not to worry about length overflow
12361 when negating a negative length.
c20db43f 12362
2538aa2f
PE
12363 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
12364 (overrun_check_free): Likewise.
12365
f2d3008d
PE
12366 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
12367 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
12368 word size.
12369
ec8df744
PE
12370 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12371 (gnutls_make_error): Rename local to avoid shadowing.
12372 (gnutls_emacs_global_deinit): ifdef out; not used.
12373 (Fgnutls_boot): Use const for pointer to readonly storage.
12374 Comment out unused local. Fix pointer signedness problems.
12375
640ee02d
PE
12376 * lread.c (openp): Don't stuff size_t into an 'int'.
12377 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
12378 about possible signed overflow.
12379
6048fb2a
PE
12380 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12381 (GDK_KEY_g): Don't define if already defined.
12382 (xg_prepare_tooltip): Avoid pointer signedness problem.
12383 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12384
fa3c87e1
PE
12385 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12386 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
12387
2172544b
PE
12388 * xfns.c (Fx_window_property): Simplify a bit,
12389 to make a bit faster and to avoid GCC 4.6.0 warning.
12390 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12391
9b821a21
PE
12392 * fns.c (internal_equal): Don't assume size_t fits in int.
12393
3c616cfa
PE
12394 * alloc.c (compact_small_strings): Tighten assertion a little.
12395
c2982e87
PE
12396 Replace pEd with more-general pI, and fix some printf arg casts.
12397 * lisp.h (pI): New macro, generalizing old pEd macro to other
12398 conversion specifiers. For example, use "...%"pI"d..." rather
12399 than "...%"pEd"...".
12400 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 12401 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
12402 * alloc.c (check_pure_size): Don't overflow by converting size to int.
12403 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12404 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12405 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12406 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12407 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12408 64-bit hosts.
12409 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12410 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12411 * print.c (safe_debug_print, print_object): Likewise.
12412 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12413 to int.
6f04d126
PE
12414 Use pI instead of if-then-else-abort. Use %p to avoid casts,
12415 avoiding the 0 flag, which is not portable.
c2982e87
PE
12416 * process.c (Fmake_network_process): Use pI to avoid cast.
12417 * region-cache.c (pp_cache): Likewise.
12418 * xdisp.c (decode_mode_spec): Likewise.
12419 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12420 behavior on 64-bit hosts with printf arg.
6f04d126 12421 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
12422 (x_stop_queuing_selection_requests): Likewise.
12423 (x_get_window_property): Don't truncate byte count to an 'int'
12424 when tracing.
0b432f21 12425
5e073ec7
PE
12426 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12427 here, since it parses constructs like leading '-' and spaces,
12428 which are not wanted; and it overflows with large numbers.
12429 Instead, simply match F[0-9]+, which is what is wanted anyway.
12430
36372bf9
PE
12431 * alloc.c: Remove unportable assumptions about struct layout.
12432 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12433 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12434 (allocate_vectorlike, make_pure_vector): Use the new macros,
12435 plus offsetof, to remove unportable assumptions about struct layout.
12436 These assumptions hold on all porting targets that I know of, but
12437 they are not guaranteed, they're easy to remove, and removing them
12438 makes further changes easier.
12439
0b432f21
PE
12440 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12441 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
12442 (string_overrun_cookie): Now const. Use initializers that
12443 don't formally overflow signed char, to avoid warnings.
000098c1
PE
12444 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12445 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
12446 (allocate_buffer): Don't assume sizeof (struct buffer) is a
12447 multiple of sizeof (EMACS_INT); it need not be, if
12448 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 12449 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 12450
895009e1
JB
124512011-04-26 Juanma Barranquero <lekktu@gmail.com>
12452
12453 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
12454
6a7a1b0b
TZ
124552011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
12456
12457 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 12458 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
12459 Reported by Paul Eggert <eggert@cs.ucla.edu>.
12460
841a1577 124612011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
12462
12463 * lisp.h (Qdebug): List symbol.
895009e1 12464 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
12465 * keyboard.c (debug-on-event): New variable.
12466 (handle_user_signal): Break into debugger when debug-on-event
12467 matches the current signal symbol.
12468
f2d3ba6f
DN
124692011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
12470
12471 * alloc.c (check_sblock, check_string_bytes)
12472 (check_string_free_list): Convert to standard C.
12473
42ce4c63
TZ
124742011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
12475
12476 * w32.c (emacs_gnutls_push): Fix typo.
12477
825cd63c
EZ
124782011-04-25 Eli Zaretskii <eliz@gnu.org>
12479
fb11d64d
EZ
12480 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12481 "cast to pointer from integer of different size".
12482
825cd63c
EZ
12483 Improve doprnt and its use in verror. (Bug#8545)
12484 * doprnt.c (doprnt): Document the set of format control sequences
12485 supported by the function. Use SAFE_ALLOCA instead of always
12486 using `alloca'.
12487
12488 * eval.c (verror): Don't limit the buffer size at size_max-1, that
12489 is one byte too soon. Don't use xrealloc; instead xfree and
12490 xmalloc anew.
12491
e061a11b
TZ
124922011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
12493
12494 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12495 callbacks stage.
12496
12497 * gnutls.c: Renamed global_initialized to
12498 gnutls_global_initialized. Added internals for the
12499 :verify-hostname-error, :verify-error, and :verify-flags
12500 parameters of `gnutls-boot' and documented those parameters in the
12501 docstring. Start callback support.
9173deec
JB
12502 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
12503 unless a fatal error occurred. Call gnutls_alert_send_appropriate
12504 on error. Return error code.
e061a11b
TZ
12505 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12506 (emacs_gnutls_read): Likewise.
12507 (Fgnutls_boot): Return handshake error code.
12508 (emacs_gnutls_handle_error): New function.
12509 (wsaerror_to_errno): Likewise.
12510
12511 * w32.h (emacs_gnutls_pull): Add prototype.
12512 (emacs_gnutls_push): Likewise.
12513
12514 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12515 (emacs_gnutls_push): Likewise.
12516
125172011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
12518
12519 * process.c (wait_reading_process_output): Check if GnuTLS
12520 buffered some data internally if no FDs are set for TLS
12521 connections.
12522
12523 * makefile.w32-in (OBJ2): Add gnutls.$(O).
12524 (LIBS): Link to USER_LIBS.
12525 ($(BLD)/gnutls.$(0)): New target.
12526
fa6996bc
EZ
125272011-04-24 Eli Zaretskii <eliz@gnu.org>
12528
eb35682e
EZ
12529 * xdisp.c (handle_single_display_spec): Rename the
12530 display_replaced_before_p argument into display_replaced_p, to
12531 make it consistent with the commentary. Fix typos in the
12532 commentary.
12533
e2ad650c
EZ
12534 * textprop.c (syms_of_textprop): Remove dead code.
12535 (copy_text_properties): Delete obsolete commentary about an
12536 interface that was deleted long ago. Fix typos in the description
12537 of arguments.
12538
1b2de274
EZ
12539 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
12540 to changes in oldXMenu/XMenu.h from 2011-04-16.
12541 <menu_help_message, prev_menu_help_message>: Constify.
12542 (IT_menu_make_room): menu->help_text is now `const char **';
12543 adjust.
12544
12545 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12546 to changes in oldXMenu/XMenu.h from 2011-04-16.
12547 (struct XMenu): Declare `help_text' `const char **'.
12548
12549 * xfaces.c <Qunspecified>: Make extern again.
12550
12551 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 12552 required by POSIX.
1b2de274 12553
762b15be
EZ
12554 * doc.c (get_doc_string): Improve the format passed to `error'.
12555
12556 * doprnt.c (doprnt): Improve commentary.
12557
12558 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12559
12560 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12561 them with etags.
12562
f1052e5d
EZ
12563 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12564 changes in globals.h immediately force recompilation.
762b15be
EZ
12565 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12566 $(CURDIR)/s/ms-w32.h.
12567 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 12568
fa6996bc
EZ
12569 * character.c (Fchar_direction): Function deleted.
12570 (syms_of_character): Don't defsubr it.
12571 <char-direction-table>: Deleted.
12572
e6c3da20
EZ
125732011-04-23 Eli Zaretskii <eliz@gnu.org>
12574
12575 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12576 * doprnt.c: Include limits.h.
12577 (SIZE_MAX): New macro.
04f2d78b
CB
12578 (doprnt): Return a size_t value. 2nd arg is now size_t.
12579 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
12580 Improve overflow protection. Support `l' modifier for integer
12581 conversions. Support %l conversion. Don't assume an EMACS_INT
12582 argument for integer conversions and for %c.
12583
12584 * lisp.h (doprnt): Restore prototype.
12585
12586 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12587 $(SRC)/character.h.
12588
12589 * Makefile.in (base_obj): Add back doprnt.o.
12590
12591 * deps.mk (doprnt.o): Add back prerequisites.
12592 (callint.o): Depend on character.h.
12593
12594 * eval.c (internal_lisp_condition_case): Include the handler
12595 representation in the error message.
12596 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12597 when breaking from the loop.
12598
12599 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12600
12601 * callint.c (Fcall_interactively): When displaying error message
12602 about invalid control letter, pass the character's codepoint, not
12603 a pointer to its multibyte form. Improve display of the character
12604 in octal and display also its hex code.
12605
12606 * character.c (char_string): Use %x to display the (unsigned)
12607 codepoint of an invalid character, to avoid displaying a bogus
12608 negative value.
12609
12610 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12611 `error', not SYMBOL_NAME itself.
12612
12613 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12614 character arguments to `error'.
12615
12616 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12617 to `error' in error message about FINAL_CHAR argument. Make sure
12618 FINAL_CHAR is a character, and use %c when it is passed as
12619 argument to `error'.
12620
4ffd0d6b 126212011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
12622
12623 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12624
12625 * w32.c: Include <time.h>.
12626 (sys_localtime): New function.
12627
4ffd0d6b 126282011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
12629
12630 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12631
4ffd0d6b 12632 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 12633
4ffd0d6b 126342011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 12635
4ffd0d6b
GM
12636 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12637 zombies (Bug#8467).
aac0c6e3 12638
04c56954
EZ
126392011-04-19 Eli Zaretskii <eliz@gnu.org>
12640
12641 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12642 gl_state.e_property when gl_state.object is Qt.
12643
12644 * insdel.c (make_gap_larger): Remove limitation of buffer size
12645 to <= INT_MAX.
12646
16a43933
CY
126472011-04-18 Chong Yidong <cyd@stupidchicken.com>
12648
12649 * xdisp.c (lookup_glyphless_char_display)
12650 (produce_glyphless_glyph): Handle cons cell entry in
12651 glyphless-char-display.
12652 (Vglyphless_char_display): Document it.
12653
12654 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12655 glyphless-char-display.
12656
4581706e
CY
126572011-04-17 Chong Yidong <cyd@stupidchicken.com>
12658
12659 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12660
12661 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12662
12663 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12664 definition for no-X builds.
12665
4887c6e2 126662011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 12667
fd35b6f9
PE
12668 Static checks with GCC 4.6.0 and non-default toolkits.
12669
5c1ccb01
PE
12670 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12671
006c5daa
PE
12672 * process.c (keyboard_bit_set): Define only if SIGIO.
12673 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12674 (send_process): Repair possible setjmp clobbering.
12675
efc736d3
PE
12676 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12677
4e2fe2e6
PE
12678 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12679
f97334a2
PE
12680 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12681
4e75f29d
PE
12682 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12683 Define only if needed.
12684
90efadd1
PE
12685 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12686 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 12687 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 12688
3c647824
PE
12689 * dispextern.h (struct redisplay_interface): Rename param
12690 to avoid shadowing.
e264f262 12691 * termhooks.h (struct terminal): Likewise.
761383f4 12692 * xterm.c (xembed_send_message): Likewise.
3c647824 12693
b58c5c4a
PE
12694 * insdel.c (make_gap_smaller): Define only if
12695 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12696
cad59032
PE
12697 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12698 it.
12699
c339dc2e
PE
12700 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12701 so that we aren't warned about unused symbols.
12702
91a3e27b
PE
12703 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12704
399c71d3 12705 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 12706
8ffc96f5
PE
12707 * xfns.c (x_real_positions): Mark locals as initialized.
12708
eef9bc79
PE
12709 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12710
098db9dd
PE
12711 * xterm.c: Fix problems found by static analysis with other toolkits.
12712 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
12713 (x_dispatch_event): Declare static if USE_GTK, and
12714 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 12715 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 12716 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
12717 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12718 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 12719
eb18f6cc
PE
12720 * xmenu.c (menu_help_callback): Pointer type fixes.
12721 Use const pointers when pointing at readonly data. Avoid pointer
12722 signedness clashes.
12723 (FALSE): Remove unused macro.
12724 (update_frame_menubar): Remove unused decl.
12725
1fe72bf8
PE
12726 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12727
60d9e1db
PE
12728 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12729 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12730 (single_menu_item): Rename local to avoid shadowing.
12731
39261c26
PE
12732 * keyboard.c (make_lispy_event): Remove unused local var.
12733
018c5e19
PE
12734 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12735 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12736
63d2b86e
PE
12737 * bitmaps: Change bitmaps from unsigned char back to the X11
12738 compatible char. Avoid the old compiler warnings about
12739 out-of-range initializers by using, for example, '\xab' rather
12740 than 0xab.
12741
aefd87e1
PE
12742 * xgselect.c (xgselect_initialize): Check vs interface
12743 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12744
bf501fb9
PE
12745 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12746
e9829fdf
PE
12747 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12748 to read-only memory.
12749
1086c095
PE
12750 * fns.c (vector): Remove; this old hack is no longer needed.
12751
2baccd04 12752 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 12753 Remove unused var.
dde42981 12754 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 12755
72391843 12756 * xrdb.c (x_load_resources): Omit unused local.
3565b346 12757
436c16df 12758 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 12759 (x_window): Rename locals to avoid shadowing.
dc5ddd85 12760 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 12761
92bb796d 12762 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 12763 (x_term_init): Remove local to avoid shadowing.
92bb796d 12764
764430a3 12765 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
12766
12767 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
12768 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
12769
d1dfb56c
EZ
127702011-04-16 Eli Zaretskii <eliz@gnu.org>
12771
c4354cb4
EZ
12772 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
12773
d1dfb56c
EZ
12774 Fix regex.c, syntax.c and friends for buffers > 2GB.
12775 * syntax.h (struct gl_state_s): Declare character position members
12776 EMACS_INT.
12777
12778 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
12779
04f2d78b
CB
12780 * textprop.c (verify_interval_modification, interval_of):
12781 Declare arguments EMACS_INT.
d1dfb56c
EZ
12782
12783 * intervals.c (adjust_intervals_for_insertion): Declare arguments
12784 EMACS_INT.
12785
12786 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
12787
12788 * indent.c (Fvertical_motion): Local variable it_start is now
12789 EMACS_INT.
12790
12791 * regex.c (re_match, re_match_2, re_match_2_internal)
12792 (bcmp_translate, regcomp, regexec, print_double_string)
12793 (group_in_compile_stack, re_search, re_search_2, regex_compile)
12794 (re_compile_pattern, re_exec): Declare arguments and local
12795 variables `size_t' and `ssize_t' and return values `regoff_t', as
12796 appropriate.
12797 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
12798 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
12799 <compile_stack_type>: `size' and `avail' are now `size_t'.
12800
12801 * regex.h <regoff_t>: Use ssize_t, not int.
12802 (re_search, re_search_2, re_match, re_match_2): Arguments that
12803 specify buffer/string position and length are now ssize_t and
12804 size_t. Return type is regoff_t.
12805
613052cd
BK
128062011-04-16 Ben Key <bkey76@gmail.com>
12807
12808 * nsfont.m: Fixed bugs in ns_get_family and
12809 ns_descriptor_to_entity that were caused by using free to
12810 deallocate memory blocks that were allocated by xmalloc (via
12811 xstrdup). This caused Emacs to crash when compiled with
12812 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
12813 --enable-checking=xmallocoverrun). xfree is now used to
12814 deallocate these memory blocks.
12815
4170f62f 128162011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 12817
71b41406
PE
12818 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
12819
9587a89d
PE
12820 emacs_write: Accept and return EMACS_INT for sizes.
12821 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
12822 et seq.
12823 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
12824 Accept and return EMACS_INT.
12825 (emacs_gnutls_write): Return the number of bytes written on
12826 partial writes.
12827 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
12828 (emacs_read, emacs_write): Remove check for negative size, as the
12829 Emacs source code has been audited now.
9587a89d
PE
12830 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
12831 (emacs_read, emacs_write): Use it.
273a5f82
PE
12832 * process.c (send_process): Adjust to the new signatures of
12833 emacs_write and emacs_gnutls_write. Do not attempt to store
12834 a byte offset into an 'int'; it might overflow.
9587a89d 12835 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 12836
3e047f51
PE
12837 * sound.c: Don't assume sizes fit in 'int'.
12838 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 12839 Return EMACS_INT, not int.
3e047f51 12840 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
12841 Accept EMACS_INT, not int.
12842 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
12843 record read return values.
12844
cc39a9db
BK
128452011-04-15 Ben Key <bkey76@gmail.com>
12846
c9d0ec6d
JB
12847 * keyboard.c (Qundefined): Don't declare static since it is used
12848 in nsfns.m.
12849 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
12850 static since they are used in nsfont.m.
cc39a9db 12851
6c60eb9f
SM
128522011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
12853
12854 * process.c (Qprocessp): Don't declare static.
12855 * lisp.h (Qprocessp): Declare again.
12856
7990b61a
JB
128572011-04-15 Juanma Barranquero <lekktu@gmail.com>
12858
12859 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
12860
5d4cb038
PE
128612011-04-14 Paul Eggert <eggert@cs.ucla.edu>
12862
8bd7b830 12863 Improve C-level modularity by making more things 'static'.
cd64ea1d 12864
e3b27b31
PE
12865 Don't publish debugger-only interfaces to other modules.
12866 * lisp.h (safe_debug_print, debug_output_compilation_hack):
12867 (verify_bytepos, count_markers): Move decls to the only modules
12868 that need them.
12869 * region-cache.h (pp_cache): Likewise.
12870 * window.h (check_all_windows): Likewise.
12871 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12872
5d4cb038
PE
12873 * sysdep.c (croak): Now static, if
12874 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12875 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
12876
12877 * alloc.c (refill_memory_reserve): Now static if
12878 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12879 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 12880
e87b6180
PE
12881 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12882 Define only if USE_LUCID.
12883
ac64929e
PE
12884 * xrdb.c (x_customization_string, x_rm_string): Now static.
12885
6f37259d
PE
12886 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12887 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12888
1683e3ab
PE
12889 * xdisp.c (draw_row_with_mouse_face): Now static.
12890 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12891
de9c2632
PE
12892 * window.h (check_all_windows): Mark externally visible.
12893
2b96acb7
PE
12894 * window.c (window_deletion_count): Now static.
12895
12896 * undo.c: Make symbols static if they're not exported.
12897 (last_undo_buffer, last_boundary_position, pending_boundary):
12898 Now static.
12899
50436f33
PE
12900 * textprop.c (interval_insert_behind_hooks): Now static.
12901 (interval_insert_in_front_hooks): Likewise.
12902
64520e5c
PE
12903 * term.c: Make symbols static if they're not exported.
12904 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12905 (max_frame_lines, tty_set_terminal_modes):
12906 (tty_reset_terminal_modes, tty_turn_off_highlight):
12907 (get_tty_terminal): Now static.
12908 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12909 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 12910 HAVE_WINDOW_SYSTEM.
64520e5c
PE
12911 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12912 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12913
1fa53021
PE
12914 * sysdep.c: Make symbols static if they're not exported.
12915 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12916 Now static.
12917 (sigprocmask_set, full_mask): Remove; unused.
12918 (wait_debugging): Mark as visible.
12919 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12920 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12921
d4b43b22
PE
12922 * syntax.c (syntax_temp): Define only if !__GNUC__.
12923
b7c513d0
PE
12924 * sound.c (current_sound_device, current_sound): Now static.
12925
989b29ad
PE
12926 * search.c (searchbufs, searchbuf_head): Now static.
12927
13a55a78
PE
12928 * scroll.c (scroll_cost): Remove; unused.
12929 * dispextern.h (scroll_cost): Remove decl.
12930
de68a1fc
PE
12931 * region-cache.h (pp_cache): Mark as externally visible.
12932
40ccffa6
PE
12933 * process.c: Make symbols static if they're not exported.
12934 (process_tick, update_tick, create_process, chan_process):
12935 (Vprocess_alist, proc_buffered_char, datagram_access):
12936 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12937 (deactivate_process): Mark defn as static, as well as decl.
12938 * lisp.h (create_process): Remove decl.
12939 * process.h (chan_process, Vprocess_alist): Remove decls.
12940
ad64fc97
PE
12941 * print.c: Make symbols static if they're not exported.
12942 (print_depth, new_backquote_output, being_printed, print_buffer):
12943 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12944 (print_interval, print_number_index, initial_stderr_stream):
12945 Now static.
12946 * lisp.h (Fprinc): Remove decl.
12947 (debug_output_compilation_hack): Mark as externally visible.
12948
adddb265
PE
12949 * sysdep.c (croak): Move decl from here to syssignal.h.
12950 * syssignal.h (croak): Put it here, so the API can be checked when
12951 'croak' is called from dissociate_if_controlling_tty.
12952
1717ede2
PE
12953 * minibuf.c: Make symbols static if they're not exported.
12954 (minibuf_save_list, choose_minibuf_frame): Now static.
12955 * lisp.h (choose_minibuf_frame): Remove decl.
12956
fa5fb2bc
PE
12957 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12958
1e3890d1
PE
12959 * lread.c: Make symbols static if they're not exported.
12960 (read_objects, initial_obarray, oblookup_last_bucket_number):
12961 Now static.
12962 (make_symbol): Remove; unused.
12963 * lisp.h (initial_obarray, make_symbol): Remove decls.
12964
8a1414fa
PE
12965 * keyboard.c: Make symbols static if they're not exported.
12966 (single_kboard, recent_keys_index, total_keys, recent_keys):
12967 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12968 (this_single_command_key_start, echoing, last_auto_save):
12969 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12970 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12971 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12972 (Vlispy_mouse_stem, double_click_count):
12973 Now static.
12974 (force_auto_save_soon): Define only if SIGDANGER.
12975 (ignore_mouse_drag_p): Now static if
12976 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12977 (print_help): Remove; unused.
12978 (stop_character, last_timer_event): Mark as externally visible.
12979 * keyboard.h (ignore_mouse_drag_p): Declare only if
12980 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12981 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12982 * lisp.h (echoing): Remove decl.
12983 (force_auto_save_soon): Declare only if SIGDANGER.
12984 * xdisp.c (redisplay_window): Simplify code, to make it more
12985 obvious that ignore_mouse_drag_p is not accessed if !defined
12986 USE_GTK && !defined HAVE_NS.
12987
93ea6e8f
PE
12988 * intervals.c: Make symbols static if they're not exported.
12989 (merge_properties_sticky, merge_interval_right, delete_interval):
12990 Now static.
12991 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12992
77382fcc
PE
12993 * insdel.c: Make symbols static if they're not exported.
12994 However, leave prepare_to_modify_buffer alone. It's never
12995 called from outside this function, but that appears to be a bug.
12996 (combine_after_change_list, combine_after_change_buffer):
4889fc82 12997 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
12998 (adjust_after_replace_noundo): Remove; unused.
12999 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 13000 (signal_before_change): Remove decls.
77382fcc 13001
9306c32e
PE
13002 * indent.c (val_compute_motion, val_vmotion): Now static.
13003
cd44d2eb
PE
13004 * image.c: Make symbols static if they're not exported.
13005 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
13006 if USE_GTK.
13007 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
13008 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
13009
ad9a7a06
PE
13010 * fringe.c (standard_bitmaps): Now static.
13011 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
13012
81626931
PE
13013 * frame.c: Make symbols static if they're not exported.
13014 (x_report_frame_params, make_terminal_frame): Now static.
13015 (get_frame_param): Now static, unless HAVE_NS.
13016 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
13017 (x_get_resource_string): Remove; not used.
13018 * frame.h (make_terminal_frame, x_report_frame_params):
13019 (x_get_resource_string); Remove decls.
13020 (x_fullscreen_adjust): Declare only if WINDOWSNT.
13021 * lisp.h (get_frame_param): Declare only if HAVE_NS.
13022
239f9db9
PE
13023 * font.c, fontset.c: Make symbols static if they're not exported.
13024 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
13025 (FACE_SUITABLE_FOR_CHAR_P): Use it.
13026 * font.c (font_close_object): Now static.
13027 * font.h (font_close_object): Remove.
13028 * fontset.c (FONTSET_OBJLIST): Remove.
13029 (free_realized_fontset) #if-0 the body, which does nothing.
13030 (face_suitable_for_char_p): #if-0, as it's never called.
13031 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
13032 * xfaces.c (face_at_string_position):
13033 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
13034 since 0 is always ASCII.
13035
dfcf3579
PE
13036 * fns.c (weak_hash_tables): Now static.
13037
5045092b
PE
13038 * fileio.c: Make symbols static if they're not exported.
13039 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
13040 (Vwrite_region_annotation_buffers): Now static.
13041
57a96f5c
PE
13042 * eval.c: Make symbols static if they're not exported.
13043 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
13044 * lisp.h (backtrace_list): Remove decl.
13045
35f08c38
PE
13046 * emacs.c: Make symbols static if they're not exported.
13047 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
13048 (fatal_error_code, fatal_error_signal_hook, standard_args):
13049 Now static.
13050 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
13051 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
13052 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
13053 * lisp.h (fatal_error_signal_hook): Remove decl.
13054 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
13055
f44bd759
PE
13056 * editfns.c: Move a (normally-unused) function to its only use.
13057 * editfns.c, lisp.h (get_operating_system_release): Remove.
13058 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
13059 worth the hassle of breaking this out.
13060
b532497d
PE
13061 * xterm.c: Make symbols static if they're not exported.
13062 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
13063 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
13064 (x_destroy_window, x_delete_display):
13065 Now static.
13066 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
13067 (x_mouse_leave): Remove; unused.
13068 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
13069 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
13070 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
13071 Remove decls.
13072 (x_mouse_leave): Declare only if WINDOWSNT.
13073 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
13074 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
13075 USE_X_TOOLKIT.
13076
1675728f
PE
13077 * ftxfont.c: Make symbols static if they're not exported.
13078 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
13079 HAVE_FREETYPE.
13080 * font.h (ftxfont_driver): Likewise.
13081
e4cebfca
PE
13082 * xfns.c: Make symbols static if they're not exported.
13083 (x_last_font_name, x_display_info_for_name):
13084 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
13085 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
13086 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
13087 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
13088 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
13089 (last_show_tip_args): Now static.
13090 (xic_defaut_fontset, xic_create_fontsetname): Define only if
13091 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
13092 (x_screen_planes): Remove; unused.
13093 * dispextern.h (x_screen_planes): Remove decl.
13094
5bf46f05
PE
13095 * dispnew.c: Make symbols static if they're not exported.
13096 * dispextern.h (redraw_garbaged_frames, scrolling):
13097 (increment_row_positions): Remove.
13098 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
13099 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
13100 Now static.
13101 (redraw_garbaged_frames): Remove; unused.
13102
435f4c28
PE
13103 * xfaces.c: Make symbols static if they're not exported.
13104 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
13105 Remove decls.
13106 * xterm.h (defined_color): Remove decls.
13107 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
13108 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
13109 (menu_face_changed_default, defined_color, free_realized_face):
13110 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
13111 (ascii_face_of_lisp_face): Remove; unused.
13112
8524aef3
PE
13113 * xdisp.c: Make symbols static if they're not exported.
13114 * dispextern.h (scratch_glyph_row, window_box_edges):
13115 (glyph_to_pixel_coords, set_cursor_from_row):
13116 (get_next_display_element, set_iterator_to_next):
13117 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
13118 (show_mouse_face): Remove decls
13119 * frame.h (message_buf_print): Likewise.
13120 * lisp.h (pop_message, set_message, check_point_in_composition):
13121 Likewise.
13122 * xterm.h (set_vertical_scroll_bar): Likewise.
13123 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
13124 (message_buf_print, scratch_glyph_row, displayed_buffer):
13125 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
13126 (get_next_display_element, show_mouse_face, window_box_edges):
13127 (frame_to_window_pixel_xy, check_point_in_composition):
13128 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
13129 (glyph_to_pixel_coords): Remove; unused.
13130
16390cd2
PE
13131 * dired.c (file_name_completion): Now static.
13132
13133 * dbusbind.c (xd_in_read_queued_messages): Now static.
13134
a25f4dfa
PE
13135 * lisp.h (circular_list_error, FOREACH): Remove; unused.
13136 * data.c (circular_list_error): Remove.
13137
14a9c8df
PE
13138 * commands.h (last_point_position, last_point_position_buffer):
13139 (last_point_position_window): Remove decls.
13140 * keyboard.c: Make these variables static.
13141
04f2d78b
CB
13142 * coding.h (coding, code_convert_region, encode_coding_gap):
13143 Remove decls.
74ab6df5
PE
13144 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
13145 (iso_code_class, detect_coding, code_convert_region): Now static.
13146 (encode_coding_gap): Remove; unused.
13147
38dfbee1
PE
13148 * chartab.c (chartab_chars, chartab_bits): Now static.
13149
a2cb4e63
PE
13150 * charset.h (charset_iso_8859_1): Remove decl.
13151 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
13152 Now static.
13153
127198fd
PE
13154 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
13155 * ccl.c (Vccl_program_table): Now static.
13156 (check_ccl_update): Remove; unused.
13157
d85b608f
PE
13158 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
13159 * category.h: ... from here.
13160 * category.c (check_category_table, set_category_set): Now static.
13161
31cd66f3
PE
13162 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
13163 * lisp.h: Remove these decls.
13164
c358e587
PE
13165 * buffer.c (buffer_count): Remove unused var.
13166
e78aecca
PE
13167 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
13168 so that it's not optimized away.
13169 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
13170 * dispextern.h (bidi_dump_cached_states): Remove, since it's
13171 exported only to the debugger.
13172
e192d7d3 13173 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 13174 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 13175
92470028
PE
13176 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
13177 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
13178 was inaccessible from Lisp.
13179 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
13180 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
13181
244ed907
PE
13182 alloc.c: Import and export fewer symbols, and remove unused items.
13183 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
13184 is defined.
13185 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
13186 it's not optimized away by whole-program optimization.
13187 (message_enable_multibyte, free_misc): Remove.
13188 (catchlist, handlerlist, mark_backtrace):
13189 Declare only if BYTE_MARK_STACK.
13190 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
13191 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13192 (message_enable_multibyte): Remove decl.
13193 (free_misc, interval_free_list, float_block, float_block_index):
13194 (n_float_blocks, float_free_list, cons_block, cons_block_index):
13195 (cons_free_list, last_marked_index):
13196 Now static.
13197 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
13198 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
13199 (mark_backtrace): Define only if BYTE_MARK_STACK.
13200 * xdisp.c (message_enable_multibyte): Now static.
13201
61c2b50e 13202 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
13203 This makes it easier for human readers (and static analyzers)
13204 to see whether these variables are used from other modules.
13205 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
13206 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
13207 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
13208 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
13209 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
13210 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
13211 * xmenu.c, xselect.c:
13212 Declare Q* vars static if they are not used in other modules.
13213 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
13214 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
13215 Remove decls of unexported vars.
13216 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
13217
95c82688
PE
13218 * lisp.h (DEFINE_FUNC): Make sname 'static'.
13219
16a97296
PE
13220 Make Emacs functions such as Fatom 'static' by default.
13221 This makes it easier for human readers (and static analyzers)
13222 to see whether these functions can be called from other modules.
13223 DEFUN now defines a static function. To make the function external
13224 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
13225 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
13226 (Finit_image_library):
16a97296
PE
13227 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
13228 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
13229 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
13230 Remove decls, since these functions are now static.
13231 (Funintern, Fget_internal_run_time): New decls, since these functions
13232 were already external.
95c82688 13233
16a97296
PE
13234 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
13235 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
13236 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
13237 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
13238 * keyboard.c, keymap.c, lread.c:
13239 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
13240 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
13241 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
13242 Mark functions with DEFUE instead of DEFUN,
13243 if they are used in other modules.
13244 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
13245 decls for now-static functions.
13246 * buffer.h (Fdelete_overlay): Remove decl.
13247 * callproc.c (Fgetenv_internal): Mark as internal.
13248 * composite.c (Fremove_list_of_text_properties): Remove decl.
13249 (Fcomposition_get_gstring): New forward static decl.
13250 * composite.h (Fcomposite_get_gstring): Remove decl.
13251 * dired.c (Ffile_attributes): New forward static decl.
13252 * doc.c (Fdocumntation_property): New forward static decl.
13253 * eval.c (Ffetch_bytecode): New forward static decl.
13254 (Funintern): Remove extern decl; now in .h file where it belongs.
13255 * fileio.c (Fmake_symbolic_link): New forward static decl.
13256 * image.c (Finit_image_library): New forward static decl.
13257 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
13258 * intervals.h (Fprevious_property_change):
13259 (Fremove_list_of_text_properties): Remove decls.
13260 * keyboard.c (Fthis_command_keys): Remove decl.
13261 (Fcommand_execute): New forward static decl.
13262 * keymap.c (Flookup_key): New forward static decl.
13263 (Fcopy_keymap): Now static.
13264 * keymap.h (Flookup_key): Remove decl.
13265 * process.c (Fget_process): New forward static decl.
13266 (Fprocess_datagram_address): Mark as internal.
13267 * syntax.c (Fsyntax_table_p): New forward static decl.
13268 (skip_chars): Remove duplicate decl.
13269 * textprop.c (Fprevious_property_change): New forward static decl.
13270 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
13271 Now internal.
13272 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
13273 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
13274
785bbd42
PE
13275 * editfns.c (Fformat): Remove unreachable code.
13276
8b913b57
AS
132772011-04-14 Andreas Schwab <schwab@linux-m68k.org>
13278
13279 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
13280 change. (Bug#8496)
13281
a6744a35
EZ
132822011-04-13 Eli Zaretskii <eliz@gnu.org>
13283
13284 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
13285 when at ZV. (Bug#8487)
13286
e7974947
AS
132872011-04-12 Andreas Schwab <schwab@linux-m68k.org>
13288
baad03f0
AS
13289 * charset.c (Fclear_charset_maps): Use xfree instead of free.
13290 (Bug#8437)
13291 * keyboard.c (parse_tool_bar_item): Likewise.
13292 * sound.c (sound_cleanup, alsa_close): Likewise.
13293 * termcap.c (tgetent): Likewise.
13294 * xfns.c (x_default_font_parameter): Likewise.
13295 * xsettings.c (read_and_apply_settings): Likewise.
13296
e7974947
AS
13297 * alloc.c (overrun_check_malloc, overrun_check_realloc)
13298 (overrun_check_free): Protoize.
13299
28272684
PE
133002011-04-12 Paul Eggert <eggert@cs.ucla.edu>
13301
13302 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
13303 since callers should never pass a negative size.
13304 Change the signature to match that of plain 'read' and 'write'; see
13305 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
13306 * lisp.h: Update prototypes of emacs_write and emacs_read.
13307
11997c76
EZ
133082011-04-11 Eli Zaretskii <eliz@gnu.org>
13309
13310 * xdisp.c (redisplay_window): Don't try to determine the character
13311 position of the scroll margin if the window start point w->startp
e896f03c 13312 is outside the buffer's accessible region. (Bug#8468)
11997c76 13313
8a2cbd72
EZ
133142011-04-10 Eli Zaretskii <eliz@gnu.org>
13315
13316 Fix write-region and its subroutines for buffers > 2GB.
13317 * fileio.c (a_write, e_write): Modify declaration of arguments and
13318 local variables to support buffers larger than 2GB.
13319 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
13320
13321 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
13322 argument, local variables, and return value.
13323
13324 * lisp.h: Update prototypes of emacs_write and emacs_read.
13325
13326 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
13327
4073e537 133282011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 13329
1ebfdcb6
PE
13330 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
13331
b2ded58d
PE
13332 Fix more problems found by GCC 4.6.0's static checks.
13333
7d66342c
PE
13334 * xdisp.c (vmessage): Use a better test for character truncation.
13335
bbf47d44
PE
13336 * charset.c (load_charset_map): <, not <=, for optimization,
13337 and to avoid potential problems with integer overflow.
9248994d 13338 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 13339 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 13340 * editfns.c (Fformat): Likewise.
1e69125e 13341 * syntax.c (skip_chars): Likewise.
3befa583 13342
e3019616
PE
13343 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
13344 This also lets GCC 4.6.0 generate slightly better loop code.
13345
becfa255
PE
13346 * callint.c (Fcall_interactively): <, not <=, for optimization.
13347 (Fcall_interactively): Count the number of arguments produced,
13348 not the number of arguments given. This is simpler and lets GCC
13349 4.6.0 generate slightly better code.
13350
dae0cd48
PE
13351 * ftfont.c: Distingish more carefully between FcChar8 and char.
13352 The previous code passed unsigned char * to a functions like
13353 strlen and xstrcasecmp that expect char *, which does not
13354 conform to the C standard.
13355 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
13356 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
13357 char * when the C standard requires it.
13358
76032d70
PE
13359 * keyboard.c (read_char): Remove unused var.
13360
eb3f1cc8
PE
13361 * eval.c: Port to Windows vsnprintf (Bug#8435).
13362 Include <limits.h>.
13363 (SIZE_MAX): Define if the headers do not.
13364 (verror): Do not give up if vsnprintf returns a negative count.
13365 Instead, grow the buffer. This ports to Windows vsnprintf, which
13366 does not conform to C99. Problem reported by Eli Zaretskii.
13367 Also, simplify the allocation scheme, by avoiding the need for
13368 calling realloc, and removing the ALLOCATED variable.
13369
70476b54
PE
13370 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
13371
12020a9e
PE
13372 Remove invocations of doprnt, as Emacs now uses vsnprintf.
13373 But keep the doprint source code for now, as we might revamp it
13374 and use it again (Bug#8435).
ea6c7ae6
PE
13375 * lisp.h (doprnt): Remove.
13376 * Makefile.in (base_obj): Remove doprnt.o.
13377 * deps.mk (doprnt.o): Remove.
13378
5fdb398c
PE
13379 error: Print 32- and 64-bit integers portably (Bug#8435).
13380 Without this change, on typical 64-bit hosts error ("...%d...", N)
13381 was used to print both 32- and 64-bit integers N, which relied on
13382 undefined behavior.
61bdb816 13383 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
13384 * lisp.h (error, verror): Mark as printf-like functions.
13385 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13386 Report overflow in size calculations when allocating printf buffer.
13387 Do not truncate output string at its first null byte.
13388 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13389 Truncate the output at a character boundary, since vsnprintf does not
13390 do that.
13391 * charset.c (check_iso_charset_parameter): Convert internal
13392 character to string before calling 'error', since %c now has the
13393 printf meaning.
13394 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13395 overflow when computing char to be passed to 'error'. Do not
13396 pass Lisp_Object to 'error'; pass the integer instead.
13397 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13398 formatted with plain %d.
13399
b189fa66
PE
13400 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13401
bff87ef0
PE
13402 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13403
7e2cac20
PE
13404 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13405
ce4d90b5
PE
13406 * xterm.c (x_catch_errors): Remove duplicate declaration.
13407
266c9547
PE
13408 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13409
79c49ad2
PE
13410 * xdisp.c, lisp.h (message_nolog): Remove; unused.
13411
368f4090
JM
134122011-04-10 Jim Meyering <meyering@redhat.com>
13413
13414 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13415 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13416 return ssize_t not "int", and use size_t as the buffer length.
13417 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13418 * gnutls.h: Update declarations.
13419 * process.c (read_process_output): Use ssize_t, to match.
13420 (send_process): Likewise.
13421
a32d4040
CY
134222011-04-09 Chong Yidong <cyd@stupidchicken.com>
13423
13424 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13425
8546720e 134262011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 13427
04f2d78b
CB
13428 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13429 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 13430
8546720e
GM
13431 * xterm.c (handle_one_xevent):
13432 * xmenu.c (create_and_show_popup_menu):
13433 * xselect.c (x_decline_selection_request)
13434 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 13435
0a2f5c1a 134362011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
13437
13438 Fix some uses of `int' instead of EMACS_INT.
13439 * search.c (string_match_1, fast_string_match)
13440 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13441 (scan_buffer, find_next_newline_no_quit)
13442 (find_before_next_newline, search_command, Freplace_match)
13443 (Fmatch_data): Make some `int' variables be EMACS_INT.
13444
13445 * xdisp.c (display_count_lines): 3rd argument and return value now
13446 EMACS_INT. All callers changed.
13447 (pint2hrstr): Last argument is now EMACS_INT.
13448
13449 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13450 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13451 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13452 (decode_coding_utf_16, decode_coding_emacs_mule)
13453 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13454 (decode_coding_ccl, decode_coding_charset)
13455 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13456 (decode_coding_iso_2022, decode_coding_emacs_mule)
13457 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13458 <char_offset, last_offset>: Declare EMACS_INT.
13459 (encode_coding_utf_8, encode_coding_utf_16)
13460 (encode_coding_emacs_mule, encode_invocation_designation)
13461 (encode_designation_at_bol, encode_coding_iso_2022)
13462 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13463 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13464 Declare EMACS_INT.
13465 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13466 (encode_invocation_designation): Last argument P_NCHARS is now
13467 EMACS_INT.
13468 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13469 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13470
13471 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13472 All users changed.
13473
13474 * ccl.c (Fccl_execute_on_string): Declare some variables
13475 EMACS_INT.
13476
8546720e 134772011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
13478
13479 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13480
4e19a977
CS
134812011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
13482
13483 * process.c (Fformat_network_address): Doc fix.
13484
87302331
R
134852011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
13486
ee7683eb 13487 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 13488
cbb59342
CY
134892011-04-08 Chong Yidong <cyd@stupidchicken.com>
13490
13491 * keyboard.c (read_char): Call Lisp function help-form-show,
13492 instead of using internal_with_output_to_temp_buffer.
13493 (Qhelp_form_show): New var.
e0d38eeb 13494 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
13495
13496 * print.c (internal_with_output_to_temp_buffer): Function deleted.
13497
13498 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13499
e67a13ab
CY
135002011-04-06 Chong Yidong <cyd@stupidchicken.com>
13501
04f2d78b
CB
13502 * process.c (Flist_processes): Remove to Lisp.
13503 (list_processes_1): Delete.
e67a13ab 13504
973f782d
EZ
135052011-04-06 Eli Zaretskii <eliz@gnu.org>
13506
7c106b1e
EZ
13507 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13508
973f782d
EZ
13509 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13510
41cf7d1a 135112011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 13512
ca23cc88
PE
13513 Fix more problems found by GCC 4.6.0's static checks.
13514
f390e2d5
PE
13515 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13516
42eea0d0
PE
13517 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13518
b69769da 13519 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 13520
f9541e84
PE
13521 * xdisp.c (vmessage): Mark as a printf-like function.
13522
13841b55
PE
13523 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
13524
c136c10f
PE
13525 * sound.c (sound_warning): Don't crash if arg contains a printf format.
13526
5e2d4a30
PE
13527 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
13528 printf-like functions.
13529 (tiff_load): Add casts to remove these marks before passing them
13530 to system-supplied API.
13531
583f48b9
PE
13532 * eval.c (Fsignal): Remove excess argument to 'fatal'.
13533
b25d760e
PE
13534 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
13535 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
13536 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
13537 directly, rather than having caller test rule sign. This avoids
13538 some unnecessary tests.
13539 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
13540 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
13541 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 13542
bc7b6697 13543 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 13544 (xfont_open): Avoid unnecessary tests.
bc7b6697 13545
27ccc379
PE
13546 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13547
dcd5c89a
PE
13548 * composite.h, composite.c (composition_gstring_put_cache):
13549 Use EMACS_INT, not int, for length.
13550
b13a45c6
PE
13551 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13552 breaking out part of COMPOSITION_DECODE_RULE.
13553 (COMPOSITION_DECODE_RULE): Use it.
13554 * composite.c (get_composition_id): Remove unused local vars,
13555 by using the new macro.
13556
1e792e4d
PE
13557 * textprop.c (set_text_properties_1): Change while to do-while,
13558 since the condition is always true at first.
13559
dc6c6455 13560 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
13561 (interval_deletion_adjustment): Return unsigned value.
13562 All uses changed.
dc6c6455 13563
aba7731a
PE
13564 * process.c (list_processes_1, create_pty, read_process_output):
13565 (exec_sentinel): Remove vars that were set but not used.
afd4052b 13566 (create_pty): Remove unnecessary "volatile"s.
bc57d757 13567 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 13568 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 13569 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 13570
fdfc4bf3
PE
13571 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13572
fca8fe46 13573 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 13574 (update_syntax_table): Use unsigned instead of int.
fca8fe46 13575
06a0259a 13576 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 13577 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 13578 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 13579
e7b9e80f
PE
13580 * print.c (print_error_message): Avoid int overflow.
13581
56201685
PE
13582 * font.c (font_list_entities): Redo for clarity,
13583 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13584
78834453 13585 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 13586 (font_score): Avoid potential overflow in diff calculation.
78834453 13587
0bc0b309 13588 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 13589 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 13590
e610eaca
PE
13591 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13592
b895abce
PE
13593 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13594 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13595 can always succeed if overflow has undefined behavior.
13596
1f1d9321 13597 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 13598 (wordify): Omit three unnecessary tests.
1f1d9321 13599
c59478bc
PE
13600 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13601 All callers changed. This avoids the need for an unused var.
13602
79b73827
PE
13603 * casefiddle.c (casify_region): Remove var that is set but not used.
13604
a4db5dfe
PE
13605 * dired.c (file_name_completion): Remove var that is set but not used.
13606
43aae36e
PE
13607 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13608
2a47c44d 13609 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 13610 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 13611
a37c69bf
PE
13612 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13613 Check for integer overflow on size calculations.
13614
328ab8e7
PE
13615 * buffer.c (Fprevious_overlay_change): Remove var that is set
13616 but not used.
13617
e5a2a5cb
PE
13618 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13619 Remove vars that are set but not used.
8d84a6eb 13620 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 13621 (timer_check_2): Mark vars as initialized.
e5a2a5cb 13622
a60e5f68
PE
13623 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13624
f661cb61 13625 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 13626 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 13627
f0397f5a
PE
13628 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13629 that are set but not used.
13630
8664db06 13631 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 13632 if XCreateBitmapFromData fails (Bug#8410).
8664db06 13633
6abdaa4a
PE
13634 * xselect.c (x_get_local_selection, x_handle_property_notify):
13635 Remove vars that are set but not used.
13636
0ce7538d 13637 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 13638 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 13639
9ae848fc
PE
13640 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13641 Remove var that is set but not used.
0b918413
PE
13642 (scroll_bar_windows_size): Now size_t, not int.
13643 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13644 Check for overflow.
9ae848fc 13645
a5a62657
PE
13646 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13647 (map_tty_color) [!defined MSDOS]: Likewise.
13648
5c5cdd39
PE
13649 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13650
66ebf983
PE
13651 * coding.c: Remove vars that are set but not used.
13652 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13653 All callers changed.
13654 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13655 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13656 (decode_coding_charset): Remove vars that are set but not used.
13657
1be4d761
PE
13658 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13659 that is set but not used.
13660
47553fa8
PE
13661 * print.c (print_object): Remove var that is set but not used.
13662
1f7196bf 13663 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
13664 The gnulib version avoids calling malloc in the usual case,
13665 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13666 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13667 * filelock.c (current_lock_owner): Likewise.
13668 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13669 * sysdep.c: Include allocator.h, careadlinkat.h.
13670 (emacs_no_realloc_allocator): New static constant.
13671 (emacs_readlink): New function.
fdb61804
PE
13672 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13673 ../lib/careadlinkat.h.
d1fdcab7 13674
f84c17c7
SM
136752011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13676
13677 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13678 first non-nil return value).
13679
ef3862ad
JD
136802011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13681
13682 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13683 if not defined (Bug#8403).
13684
376a7006
JB
136852011-04-02 Juanma Barranquero <lekktu@gmail.com>
13686
13687 * xdisp.c (display_count_lines): Remove parameter `start',
13688 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13689 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13690 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13691 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13692 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13693 and thereabouts. All callers changed.
13694 (get_per_char_metric): Remove parameter `f', unused since
13695 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13696
6ca3801d
JM
136972011-04-02 Jim Meyering <meyering@redhat.com>
13698
13699 do not dereference NULL upon failed strdup
13700 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13701 (ns_get_family): Likewise.
13702
d8e2b5ba
JB
137032011-04-02 Juanma Barranquero <lekktu@gmail.com>
13704
13705 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13706
8c74fcbd
JD
137072011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13708
13709 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13710 later (Bug#8403).
13711
7200d79c
SM
137122011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13713
03408648 13714 Add lexical binding.
7200d79c 13715
03408648
SM
13716 * window.c (Ftemp_output_buffer_show): New fun.
13717 (Fsave_window_excursion):
13718 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13719
13720 * lread.c (lisp_file_lexically_bound_p): New function.
13721 (Fload): Bind Qlexical_binding.
13722 (readevalloop): Remove `evalfun' arg.
13723 Bind Qinternal_interpreter_environment.
13724 (Feval_buffer): Bind Qlexical_binding.
13725 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13726 Mark as dynamic.
13727 (syms_of_lread): Declare `lexical-binding'.
13728
13729 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13730
13731 * keyboard.c (eval_dyn): New fun.
13732 (menu_item_eval_property): Use it.
ca105506
SM
13733
13734 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 13735
03408648
SM
13736 * fns.c (concat, mapcar1): Accept byte-code-functions.
13737
13738 * eval.c (Fsetq): Handle lexical vars.
13739 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13740 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13741 (FletX, Flet): Obey lexical binding.
13742 (Fcommandp): Handle closures.
13743 (Feval): New `lexical' arg.
13744 (eval_sub): New function extracted from Feval. Use it almost
13745 everywhere where Feval was used. Look up vars in lexical env.
13746 Handle closures.
13747 (Ffunctionp): Move from subr.el.
13748 (Ffuncall): Handle closures.
13749 (apply_lambda): Remove `eval_flags'.
13750 (funcall_lambda): Handle closures and new byte-code-functions.
13751 (Fspecial_variable_p): New function.
13752 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13753 but without exporting it to Lisp.
23aba0ea 13754
23aba0ea 13755 * doc.c (Fdocumentation, store_function_docstring):
03408648 13756 * data.c (Finteractive_form): Handle closures.
23aba0ea 13757
03408648
SM
13758 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13759 interactive spec.
ba83908c 13760
04f2d78b
CB
13761 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
13762 New byte-codes.
03408648
SM
13763 (exec_byte_code): New function extracted from Fbyte_code to handle new
13764 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 13765
03408648 13766 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 13767
03408648 13768 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 13769
e2abce01
JB
137702011-03-31 Juanma Barranquero <lekktu@gmail.com>
13771
13772 * xdisp.c (redisplay_internal): Fix prototype.
13773
63696a73 137742011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 13775
63696a73 13776 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
13777 (try_scrolling): Use it when setting scroll_limit.
13778 Limit scrolling to 100 screen lines.
63696a73
EZ
13779 (redisplay_window): Even when falling back on "recentering",
13780 position point in the window according to scroll-conservatively,
13781 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
13782
13783 (try_scrolling): When point is above the window, allow searching
13784 as far as scroll_max, or one screenful, to compute vertical
13785 distance from PT to the scroll margin position. This prevents
13786 try_scrolling from unnecessarily failing when
13787 scroll-conservatively is set to a value slightly larger than the
13788 window height. Clean up the case of PT below the margin at bottom
13789 of window: scroll_max can no longer be INT_MAX. When aggressive
13790 scrolling is in use, don't let point enter the opposite scroll
13791 margin as result of the scroll.
13792 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
13793 threshold of 100 lines for never-recentering scrolling.
13794
e4cc2dfc
JB
137952011-03-31 Juanma Barranquero <lekktu@gmail.com>
13796
13797 * dispextern.h (move_it_by_lines):
13798 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
13799 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
13800 (message_log_check_duplicate): Remove parameters `prev_bol' and
13801 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13802 (redisplay_internal): Remove parameter `preserve_echo_area',
13803 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
13804
13805 * indent.c (Fvertical_motion):
13806 * window.c (window_scroll_pixel_based, Frecenter):
13807 Don't pass `need_y_p' to `move_it_by_lines'.
13808
1c470562
SM
138092011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
13810
44f230aa
SM
13811 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
13812 steal a few bits to be more compact.
13813 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
13814 Remove unneeded casts.
13815
1c470562
SM
13816 * bytecode.c (Fbyte_code): CAR and CDR can GC.
13817
888adce9
ZK
138182011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
13819
13820 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
13821 binding" message (bug#7967).
13822
f838ed7b
PE
138232011-03-30 Paul Eggert <eggert@cs.ucla.edu>
13824
77861b95
PE
13825 Fix more problems found by GCC 4.6.0's static checks.
13826
de6dbc14
PE
13827 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
13828 Remove unused local var.
13829
f838ed7b
PE
13830 * editfns.c (Fmessage_box): Remove unused local var.
13831
792c7b2b
PE
13832 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
13833 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13834 Omit unused local vars.
c499e557 13835 * window.c (shrink_windows): Omit unused local var.
b01a1c29 13836 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
13837 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
13838 Omit unused local var.
13839
ba0165e1
PE
13840 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
13841 Don't assume string length fits in int.
32ad8845 13842 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 13843 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 13844
3c59b4c9
PE
13845 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
13846 instead of alloca (Bug#8344).
13847
a3eed478 13848 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 13849 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 13850
eb4d412d
PE
13851 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
13852
1658b401
PE
13853 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
13854 concerns.
13855
13856 * term.c (produce_glyphless_glyph): Remove unnecessary test.
13857
13858 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 13859
9a2c6e05
PE
13860 * keyboard.c (syms_of_keyboard): Use the same style as later
13861 in this function when indexing through an array. This also
13862 works around GCC bug 48267.
13863
03d0a109
PE
13864 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
13865
44f730c8
PE
13866 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
13867
fe75f926
PE
13868 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13869 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13870
ffa8c828
PE
13871 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13872 This avoids undefined behavior on integer overflow, and is a bit
13873 more convenient anyway since it is compared to a size_t variable.
13874
c5101a77
PE
13875 Variadic C functions now count arguments with size_t, not int.
13876 This avoids an unnecessary limitation on 64-bit machines, which
13877 caused (substring ...) to crash on large vectors (Bug#8344).
13878 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13879 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 13880 All variadic functions and their callers changed accordingly.
c5101a77
PE
13881 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13882 * data.c (arith_driver, float_arith_driver): Likewise.
13883 * editfns.c (general_insert_function): Likewise.
13884 * eval.c (struct backtrace.nargs, interactive_p)
13885 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13886 (funcall_lambda, mark_backtrace): Likewise.
13887 * fns.c (concat): Likewise.
13888 * frame.c (x_set_frame_parameters): Likewise.
13889 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13890 0 if not found, not -1. All callers changed.
13891
dd3f25f7
PE
13892 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13893 (stack_copy_size): Now size_t, not int.
13894 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13895
461c2ab9
JB
138962011-03-28 Juanma Barranquero <lekktu@gmail.com>
13897
13898 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13899 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13900 All callers changed.
13901
13902 * lisp.h (multibyte_char_to_unibyte):
13903 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13904 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13905 * character.h (CHAR_TO_BYTE8):
13906 * cmds.c (internal_self_insert):
13907 * editfns.c (general_insert_function):
13908 * keymap.c (push_key_description):
13909 * search.c (Freplace_match):
13910 * xdisp.c (message_dolog, set_message_1): All callers changed.
13911
f6d62986
SM
139122011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13913
13914 * keyboard.c (safe_run_hook_funcall): New function.
13915 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13916 don't set the hook to nil, but remove the offending function instead.
13917 (Qcommand_hook_internal): Remove, unused.
13918 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13919 Vcommand_hook_internal.
13920
13921 * eval.c (enum run_hooks_condition): Remove.
13922 (funcall_nil, funcall_not): New functions.
13923 (run_hook_with_args): Call each function through a `funcall' argument.
13924 Remove `cond' argument, now redundant.
13925 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13926 (Frun_hook_with_args_until_failure): Adjust accordingly.
13927 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13928
1db5b1ad
JB
139292011-03-28 Juanma Barranquero <lekktu@gmail.com>
13930
13931 * dispextern.h (string_buffer_position): Remove declaration.
13932
13933 * print.c (strout): Remove parameter `multibyte', unused since
13934 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13935
13936 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13937 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13938 All callers changed.
13939
13940 * w32.c (_wsa_errlist): Use braces for struct initializers.
13941
13942 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13943 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13944 All callers changed.
13945 (string_buffer_position): Likewise. Also, make static (it's never
13946 used outside xdisp.c).
13947 (cursor_row_p): Remove parameter `w', unused since
13948 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13949 (decode_mode_spec): Remove parameter `precision', introduced during
13950 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13951 All callers changed.
13952
5ffb62aa
JD
139532011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13954
13955 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13956
461c2ab9 139572011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
13958
13959 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13960 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13961 (ns_update_auto_hide_menu_bar): New functions.
13962 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13963 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13964 ns_constrain_all_frames.
13965 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13966 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13967
5c380ffb
JD
139682011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13969
13970 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13971
9af30bdf
GM
139722011-03-27 Glenn Morris <rgm@gnu.org>
13973
13974 * syssignal.h: Replace RETSIGTYPE with void.
13975 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13976 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13977 Replace SIGTYPE with void everywhere.
13978 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13979 * s/template.h (SIGTYPE): Remove commented out definition.
13980
e2abce01
JB
139812011-03-26 Eli Zaretskii <eliz@gnu.org>
13982
13983 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13984 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13985
f868cd8a
JB
139862011-03-26 Juanma Barranquero <lekktu@gmail.com>
13987
59eb0929
JB
13988 * w32.c (read_unc_volume): Use parameter `henum', instead of
13989 global variable `wget_enum_handle'.
13990
13991 * keymap.c (describe_vector): Remove parameters `indices' and
13992 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13993 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
13994
f868cd8a
JB
13995 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
13996
13997 * keyboard.c (timer_check): Remove parameter `do_it_now',
13998 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
13999 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
14000 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
14001
14002 * keyboard.c (read_char):
14003 * w32menu.c (w32_menu_display_help):
14004 * xmenu.c (show_help_event, menu_help_callback):
14005 Adjust calls to `show_help_echo'.
14006
14007 * gtkutil.c (xg_maybe_add_timer):
14008 * keyboard.c (readable_events):
14009 * process.c (wait_reading_process_output):
14010 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
14011
14012 * insdel.c (adjust_markers_gap_motion):
14013 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
14014 (gap_left, gap_right): Don't call it.
14015
2ecf6fdb
CY
140162011-03-25 Chong Yidong <cyd@stupidchicken.com>
14017
14018 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
14019 incurred during fontification.
14020
6b1f9ba4
JB
140212011-03-25 Juanma Barranquero <lekktu@gmail.com>
14022
14023 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
14024 (DEFVAR_PER_BUFFER): Don't pass it.
14025
14026 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
14027 (scrolling_window): Don't pass it.
14028
0f4a96b5
JB
140292011-03-25 Juanma Barranquero <lekktu@gmail.com>
14030
14031 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
14032
14033 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
14034 and `suffix'.
14035 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
14036 of variables specific to SELinux and computation of `encoded_absname'.
14037
14038 * image.c (XPutPixel): Remove unused variable `height'.
14039
14040 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
14041
14042 * unexw32.c (get_section_info): Remove unused variable `section'.
14043
14044 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
14045 (system_process_attributes): Remove unused variable `sess'.
14046 (sys_read): Remove unused variable `err'.
14047
14048 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
14049 (w32_wnd_proc): Remove unused variable `isdead'.
14050 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
14051 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
14052 (x_create_tip_frame): Remove unused variable `tem'.
14053
14054 * w32inevt.c (w32_console_read_socket):
14055 Remove unused variable `no_events'.
14056
14057 * w32term.c (x_draw_composite_glyph_string_foreground):
14058 Remove unused variable `width'.
14059
1149507c
JB
140602011-03-24 Juanma Barranquero <lekktu@gmail.com>
14061
14062 * w32term.c (x_set_glyph_string_clipping):
14063 Don't pass uninitialized region to CombineRgn.
14064
9c88f339
JB
140652011-03-23 Juanma Barranquero <lekktu@gmail.com>
14066
14067 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
14068 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
14069 (Fx_close_connection): Remove unused variable `i'.
14070
14071 * w32font.c (w32font_draw): Return number of glyphs.
14072 (w32font_open_internal): Remove unused variable `i'.
14073 (w32font_driver): Add missing initializer.
14074
14075 * w32menu.c (utf8to16): Remove unused variable `utf16'.
14076 (fill_in_menu): Remove unused variable `items_added'.
14077
14078 * w32term.c (last_mouse_press_frame): Remove static global variable.
14079 (w32_clip_to_row): Remove unused variable `f'.
14080 (x_delete_terminal): Remove unused variable `i'.
14081
14082 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
14083 (NOTHING): Remove unused static global variable.
14084 (uniscribe_check_otf): Remove unused variable `table'.
14085 (uniscribe_font_driver): Add missing initializers.
14086
dee091a3
JD
140872011-03-23 Julien Danjou <julien@danjou.info>
14088
14089 * term.c (Fsuspend_tty, Fresume_tty):
14090 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
14091 * window.c (temp_output_buffer_show):
14092 * insdel.c (signal_before_change):
14093 * frame.c (Fhandle_switch_frame):
14094 * fileio.c (Fdo_auto_save):
14095 * emacs.c (Fkill_emacs):
14096 * editfns.c (save_excursion_restore):
14097 * cmds.c (internal_self_insert):
14098 * callint.c (Fcall_interactively):
14099 * buffer.c (Fkill_all_local_variables):
14100 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
14101 Use Frun_hooks.
0f4a96b5 14102 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 14103 unconditionally since it does the check itself.
dee091a3 14104
2c520ab5 141052011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 14106
c9c49752
PE
14107 Fix more problems found by GCC 4.5.2's static checks.
14108
8abc3f12
PE
14109 * coding.c (encode_coding_raw_text): Avoid unnecessary test
14110 the first time through the loop, since we know p0 < p1 then.
14111 This also avoids a gcc -Wstrict-overflow warning.
14112
a2d26660
PE
14113 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
14114 leading to a memory leak, possible in functions like
14115 load_charset_map_from_file that can allocate an unbounded number
b12ef411 14116 of objects (Bug#8318).
a2d26660 14117
916c72e9
PE
14118 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
14119 that could (at least in theory) be that large.
14120
19ab8a18
PE
14121 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
14122 This is less likely to overflow, and avoids undefined behavior if
14123 overflow does occur. All callers changed. Use strtoul to scan
14124 for the unsigned long integer.
b7cbbd6f
PE
14125 (pint2hrstr): Simplify and tune code slightly.
14126 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 14127
f0641eff
PE
14128 * scroll.c (do_scrolling): Work around GCC bug 48228.
14129 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
14130
7f650bb9
PE
14131 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
14132 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
14133 (validate_x_resource_name): Simplify count usage.
14134 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 14135
37dd57d1
PE
14136 * fileio.c (Fcopy_file): Report error if fchown or fchmod
14137 fail (Bug#8306).
81e56e61 14138
699979fc 14139 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 14140
401bf9b4
PE
14141 * process.c (Fmake_network_process): Use socklen_t, not int,
14142 where POSIX says socklen_t is required in portable programs.
14143 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 14144 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
14145 (Fmake_network_process, server_accept_connection):
14146 (wait_reading_process_output, read_process_output):
14147 Likewise.
14148
b93aacde
PE
14149 * process.c: Rename or move locals to avoid shadowing.
14150 (list_processes_1, Fmake_network_process):
14151 (read_process_output_error_handler, exec_sentinel_error_handler):
14152 Rename or move locals.
4dc343ee 14153 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 14154 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 14155 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 14156 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 14157 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 14158
af8a867c 14159 Make tparam.h and terminfo.c consistent.
44f230aa
SM
14160 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
14161 Include tparam.h instead, since it declares them.
af8a867c
PE
14162 * cm.h (PC): Remove extern decl; tparam.h now does this.
14163 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
14164 * terminfo.c: Include tparam.h, to check interfaces.
14165 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
14166 (tparam): Adjust signature to match interface in tparam.h;
14167 this removes some undefined behavior. Check that outstring and len
14168 are zero, which they always are with Emacs.
14169 * tparam.h (PC, BC, UP): New extern decls.
14170
0248044d 14171 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 14172 (xftfont_open): Rename locals to avoid shadowing.
0248044d 14173
8ff096c1 14174 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
14175 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
14176 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 14177 (ftfont_list): Remove unused local.
49eaafba
PE
14178 (get_adstyle_property, ftfont_pattern_entity):
14179 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
14180 Rename locals to avoid shadowing.
8ff096c1 14181
e2be39f6
PE
14182 * xfont.c (xfont_list_family): Mark var as initialized.
14183
c9735e30
PE
14184 * xml.c (make_dom): Now static.
14185
8f5201ae
PE
14186 * composite.c (composition_compute_stop_pos): Rename local to
14187 avoid shadowing.
b246f932
PE
14188 (composition_reseat_it): Remove unused locals.
14189 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 14190 (composition_update_it): Mark var as initialized.
11b61122
PE
14191 (find_automatic_composition): Mark vars as initialized,
14192 with a FIXME (Bug#8290).
8f5201ae 14193
760fbc2c
PE
14194 character.h: Rename locals to avoid shadowing.
14195 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
14196 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
14197 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
14198 (BUF_DEC_POS): Be more systematic about renaming local temporaries
14199 to avoid shadowing.
14200
ff08eb85
PE
14201 * textprop.c (property_change_between_p): Remove; unused.
14202
fc7bf025
PE
14203 * intervals.c (interval_start_pos): Now static.
14204
235d7abc
PE
14205 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
14206
44f230aa
SM
14207 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
14208 Rename locals to avoid shadowing.
3e7d6594 14209
50060332
PE
14210 * sound.c (wav_play, au_play, Fplay_sound_internal):
14211 Fix pointer signedness.
d01f234b 14212 (alsa_choose_format): Remove unused local var.
c83b8872
PE
14213 (wav_play): Initialize a variable to 0, to prevent undefined
14214 behavior (Bug#8278).
50060332 14215
c4fc4e30
PE
14216 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
14217
918436ed
PE
14218 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
14219
c939f91b
PE
14220 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
14221 clobbering (Bug#8298).
b9c7f648
PE
14222 * sysdep.c (sys_subshell): Likewise.
14223 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 14224
6bd8c144
PE
14225 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
14226 This should get cleaned up, so that child_setup has the
14227 same signature on all platforms.
14228
7710357c 14229 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 14230 (relocate_fd): Rename locals to avoid shadowing.
7710357c 14231
c59da222
CY
142322011-03-22 Chong Yidong <cyd@stupidchicken.com>
14233
14234 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
14235 not to be necessary, and produces flickering.
14236
66b87493
GM
142372011-03-20 Glenn Morris <rgm@gnu.org>
14238
14239 * config.in: Remove file.
14240
45b6f6d5
JB
142412011-03-20 Juanma Barranquero <lekktu@gmail.com>
14242
14243 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
14244 are now in src/globals.h.
14245 (syms_of_minibuf): Remove spurious & from previous change.
14246
cd394be1 142472011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
14248
14249 * minibuf.c (completing-read-function): New variable.
14250 (completing-read-default): Rename from completing-read.
14251 (completing-read): Call completing-read-function.
14252
b14e3e21
CY
142532011-03-19 Juanma Barranquero <lekktu@gmail.com>
14254
14255 * xfaces.c (Fx_load_color_file):
14256 Read color file from absolute filename (bug#8250).
14257
f2b726e6
JB
142582011-03-19 Juanma Barranquero <lekktu@gmail.com>
14259
14260 * makefile.w32-in: Update dependencies.
14261
09f6ff02
EZ
142622011-03-17 Eli Zaretskii <eliz@gnu.org>
14263
14264 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
14265
29a6015a
PE
142662011-03-17 Paul Eggert <eggert@cs.ucla.edu>
14267
a3a6c54e
PE
14268 Fix more problems found by GCC 4.5.2's static checks.
14269
b766f867
PE
14270 * process.c (make_serial_process_unwind, send_process_trap):
14271 (sigchld_handler): Now static.
14272
be02381c
PE
14273 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
14274 That way, the code declares only the vars that it needs.
14275 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
14276 * s/cygwin.h (PTY_ITERATION): Likewise.
14277 * s/darwin.h (PTY_ITERATION): Likewise.
14278 * s/gnu-linux.h (PTY_ITERATION): Likewise.
14279
57048744
PE
14280 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
14281 * process.c (allocate_pty): Don't declare stb unless it's needed.
14282
7914961c 14283 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
14284 (CONSTANTLIM): Remove; unused.
14285 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
14286 Define only if needed.
7914961c 14287
b3967b18
PE
14288 * unexelf.c (unexec): Name an expression,
14289 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
14290 Use a different way to cause a compilation error if anyone uses
14291 n rather than nn, a way that does not involve shadowing.
73366a00 14292 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 14293
29a6015a
PE
14294 * deps.mk (unexalpha.o): Remove; unused.
14295
43cfc33e 14296 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 14297 * unexec.h: New file.
ce701a33
PE
14298 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
14299 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
14300 Depend on unexec.h.
14301 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
14302 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
14303 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 14304 Change as necessary to match prototype in unexec.h.
ce701a33 14305
01f44d5a
PE
14306 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
14307 shadowing.
4f63c6bb 14308 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 14309
a6670b0b
PE
14310 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
14311 Rename locals to avoid shadowing.
14312
cef2010d 14313 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 14314 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 14315
d4d7173a
PE
14316 * print.c (Fredirect_debugging_output): Fix pointer signedess.
14317
f08b802a
PE
14318 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
14319 warning when compiling print.c.
14320
3ddb0639
PE
14321 * font.c (font_unparse_fcname): Abort in an "impossible" situation
14322 instead of using an uninitialized var.
5ad03b97 14323 (font_sort_entities): Mark var as initialized.
3ddb0639 14324
170a2692
PE
14325 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
14326
e663c700
PE
14327 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
14328 pointers to constants.
89bc529a 14329 (font_parse_fcname): Remove unused vars.
7b81e2d0 14330 (font_delete_unmatched): Now static.
ea838e10 14331 (font_get_spec): Remove; unused.
13a547c6
PE
14332 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
14333 (font_update_drivers, Ffont_get_glyphs, font_add_log):
14334 Rename or move locals to avoid shadowing.
e663c700 14335
2a80c887 14336 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 14337 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 14338
1384fa33 14339 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 14340 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 14341
8b2c52e9
PE
14342 * alloc.c (mark_backtrace): Move decl from here ...
14343 * lisp.h: ... to here, so that it can be checked.
14344
475545b5 14345 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 14346 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
14347 (lisp_indirect_variable): Name an expression,
14348 to avoid gcc -Wbad-function-cast warning.
1faed8ae 14349 (Fdefvar): Rename locals to avoid shadowing.
475545b5 14350
b1349114 14351 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 14352 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 14353 Use const pointer when appropriate.
b1349114 14354
a2928364
PE
14355 * lisp.h (get_system_name, get_operating_system_release):
14356 Move decls here, to check interfaces.
14357 * process.c (get_operating_system_release): Move decl to lisp.h.
14358 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
14359 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
14360 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
14361 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
14362 (Fformat_time_string, Fencode_time, Finsert_char):
14363 (Ftranslate_region_internal, Fformat):
14364 Rename or remove local vars to avoid shadowing.
9710023e 14365 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 14366
a415e694
PE
14367 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
14368 avoid shadowing.
14369
8ef4622d
PE
14370 * lisp.h (eassert): Check that the argument compiles, even if
14371 ENABLE_CHECKING is not defined.
14372
946f9a5b
PE
14373 * data.c (Findirect_variable): Name an expression, to avoid
14374 gcc -Wbad-function-cast warning.
112396d6 14375 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 14376 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
14377 (Fmake_variable_buffer_local, Fmake_local_variable):
14378 Mark variables as initialized.
52746918 14379 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 14380
e5aab7e7 14381 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
14382 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14383 Rename locals to avoid shadowing.
dff45157
PE
14384 (mark_stack): Move local variables into the #ifdef region where
14385 they're used.
7bc26fdb
PE
14386 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14387 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14388 needed otherwise.
14389 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14390 (GC_STRING_CHARS): Remove; not used.
d40d4be1 14391 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 14392
e5aab7e7
PE
14393 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14394 avoids undefined behavior in theory.
14395
4da60324
PE
14396 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14397
88043301
PE
14398 Use functions, not macros, for up- and down-casing (Bug#8254).
14399 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14400 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
14401 to use the following functions instead of these macros.
14402 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
14403 EMACS_INT, since callers assume the returned value fits in int.
14404 (upcase1): Likewise, for UPCASE_TABLE.
14405 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 14406 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 14407 the race-condition problem in the old DOWNCASE.
88043301 14408
19ed5445
PE
14409 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14410 Rename locals to avoid shadowing.
14411 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
14412 (regex_compile, re_search_2, re_match_2_internal):
14413 Remove unused local vars.
952db0d7
PE
14414 (FREE_VAR): Rewrite so as not to use empty "else",
14415 which gcc can warn about.
da053e48 14416 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
14417 (RETALLOC_IF): Define only if needed.
14418 (WORDCHAR_P): Likewise. This one is never needed, but is used
14419 only in a comment talking about a compiler bug, so put inside
14420 the #if 0 of that comment.
14421 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14422 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14423 Remove; unused.
19ed5445 14424
1f3561e4 14425 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
14426 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14427 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 14428
ded6f8f7
PE
14429 * search.c (simple_search): Remove unused var.
14430
dbd37a95
PE
14431 * dired.c (compile_pattern): Move decl from here ...
14432 * lisp.h: ... to here, so that it can be checked.
14433 (struct re_registers): New forward decl.
14434
7e47afad
PE
14435 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14436
85f24f61
PE
14437 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14438 All uses changed.
14439 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14440 Rename locals to avoid shadowing.
5671df8f 14441 (Fvertical_motion): Mark locals as initialized.
85f24f61 14442
181aa2be 14443 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 14444 (casify_region): Mark local as initialized.
181aa2be 14445
930d429c
PE
14446 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14447
7082eac6
PE
14448 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14449 New macros, so that the caller can use some names other than
14450 gcpro1, gcpro2, etc.
14451 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14452 of the new macros.
14453 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14454 argument, for consistency with GCPRO2_VAR, etc: it is now the
14455 prefix of the variable, not the variable itself. All uses
14456 changed.
38b2c076
PE
14457 * dired.c (directory_files_internal, file_name_completion):
14458 Rename locals to avoid shadowing.
14459
15206ed9
PE
14460 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14461 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14462 dired.c's scmp function, had undefined behavior.
14463 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14464 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14465 * buffer.h: ... to here, because these macros use current_buffer,
14466 and the new implementation with inline functions needs to have
14467 current_buffer in scope now, rather than later when the macros
14468 are used.
14469 (downcase, upcase1): New static inline functions.
14470 (DOWNCASE, UPCASE1): Reimplement using these functions.
14471 This avoids undefined behavior in expressions like
14472 DOWNCASE (x) == DOWNCASE (y), which previously suffered
14473 from race conditions in accessing the global variables
14474 case_temp1 and case_temp2.
14475 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14476 * lisp.h (case_temp1, case_temp2): Remove their decls.
14477 * character.h (ASCII_CHAR_P): Move from here ...
14478 * lisp.h: ... to here, so that the inline functions mentioned
14479 above can use them.
14480
4a6bea26
PE
14481 * dired.c (directory_files_internal_unwind): Now static.
14482
f14b7e14
PE
14483 * fileio.c (file_name_as_directory, directory_file_name):
14484 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14485 Now static.
2893f146
PE
14486 (file_name_as_directory): Use const pointers when appropriate.
14487 (Fexpand_file_name): Likewise. In particular, newdir might
14488 point at constant storage, so make it a const pointer.
fd4ead52 14489 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
14490 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14491 signedness issues.
f839df0c
PE
14492 (Fset_file_times, Finsert_file_contents, auto_save_error):
14493 Rename locals to avoid shadowing.
f14b7e14 14494
5716756e 14495 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
14496 (Ftry_completion, Fall_completions): Rename or remove locals
14497 to avoid shadowing.
5716756e 14498
b4c3046a
PE
14499 * marker.c (bytepos_to_charpos): Remove; unused.
14500
b45db522
PE
14501 * lisp.h (verify_bytepos, count_markers): New decls,
14502 so that gcc does not warn that these functions aren't declared.
14503
85876d07
PE
14504 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14505 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 14506 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 14507 (copy_text): Remove unused local var.
85876d07 14508
03d78a21 14509 * filelock.c (within_one_second): Now static.
b3dd38ab 14510 (lock_file_1): Rename local to avoid shadowing.
03d78a21 14511
5df8f01b
PE
14512 * buffer.c (fix_overlays_before): Mark locals as initialized.
14513 (fix_start_end_in_overlays): Likewise. This function should be
14514 simplified by using pointers-to-pointers, but that's a different
14515 matter.
b1d876f1 14516 (switch_to_buffer_1): Now static.
8f54f30a
PE
14517 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14518 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 14519
a70072c9 14520 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 14521 Fix pointer signedness issue.
edced198
PE
14522 (sys_subshell): Mark local as volatile if checking for lint,
14523 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 14524 (MAXPATHLEN): Define only if needed.
a70072c9 14525
a0977c44
PE
14526 * process.c (serial_open, serial_configure): Move decls from here ...
14527 * systty.h: ... to here, so that they can be checked.
14528
a884fdcc
PE
14529 * fns.c (get_random, seed_random): Move extern decls from here ...
14530 * lisp.h: ... to here, so that they can be checked.
14531
604efe86 14532 * sysdep.c (reset_io): Now static.
b8950c94 14533 (wait_for_termination_signal): Remove; unused.
604efe86 14534
38fc62d9
PE
14535 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
14536 (copy_keymap_item, append_key, push_text_char_description):
14537 Now static.
1004a21a 14538 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 14539 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
14540 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
14541 (describe_map_tree):
14542 Rename locals to avoid shadowing.
38fc62d9 14543
2f2650da
PE
14544 * keyboard.c: Declare functions static if they are not used elsewhere.
14545 (echo_char, echo_dash, cmd_error, top_level_2):
14546 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
14547 (read_char, kbd_buffer_get_event, make_lispy_position):
14548 (make_lispy_event, make_lispy_movement, apply_modifiers):
14549 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14550 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14551 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 14552 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 14553 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 14554
a053e86c 14555 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
14556 (mark_kboards): Move decl here ...
14557 * alloc.c (mark_kboards): ... from here.
a053e86c 14558
4752793e
PE
14559 * lisp.h (force_auto_save_soon): New decl.
14560
74f10ca7 14561 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
14562 (DEFINE_DUMMY_FUNCTION): New macro.
14563 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14564 Use it.
c03cd23f
PE
14565 (main): Add casts to avoid warnings
14566 if GCC considers string literals to be constants.
74f10ca7 14567
022e70d4
PE
14568 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14569
59d6fe83
PE
14570 * dbusbind.c: Pointer signedness fixes.
14571 (xd_signature, xd_append_arg, xd_initialize):
14572 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14573 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14574 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14575 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14576
78320123
PE
14577 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14578 if GCC considers string literals to be constants.
49cebcca 14579 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 14580
35ac2a97
SM
145812011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14582
fb103ca9
SM
14583 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14584 (print_preprocess, print_object): New macro to fix last change.
14585
35ac2a97
SM
14586 * print.c (print_preprocess): Don't forget font objects.
14587
62973b41
JB
145882011-03-16 Juanma Barranquero <lekktu@gmail.com>
14589
14590 * emacs.c (USAGE3): Doc fixes.
14591
0e48bb22
AS
145922011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14593
14594 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14595 structure.
14596
7684e57b
JB
145972011-03-14 Juanma Barranquero <lekktu@gmail.com>
14598
14599 * lisp.h (VWindow_system, Qfile_name_history):
14600 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14601 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14602 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14603
14604 * w32select.c: Don't #include "keyboard.h".
c96bbc66 14605 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
14606
14607 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14608 * w32console.c (detect_input_pending, read_input_pending)
14609 (encode_terminal_code):
14610 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14611 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14612 (w32_system_caret_y, Qfile_name_history):
14613 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14614 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14615 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14616 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14617 * w32proc.c (Qlocal, report_file_error):
14618 * w32term.c (Vwindow_system, updating_frame):
14619 * w32uniscribe.c (initialized, uniscribe_font_driver):
14620 Remove unneeded extern declarations.
14621
2aa46d6c
CY
146222011-03-14 Chong Yidong <cyd@stupidchicken.com>
14623
c96bbc66 14624 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 14625
cffc6f3b
CY
146262011-03-13 Chong Yidong <cyd@stupidchicken.com>
14627
14628 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14629 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14630 These macros can no longer be used for assignment.
14631
44f230aa
SM
14632 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14633 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
14634 (record_buffer_markers, fetch_buffer_markers): New functions for
14635 recording and fetching special buffer markers.
14636 (set_buffer_internal_1, set_buffer_temp): Use them.
14637
14638 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14639
14640 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14641
14642 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14643 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14644
14645 * xdisp.c (hscroll_window_tree):
14646 (reconsider_clip_changes): Use PT instead of BUF_PT.
14647
d251f04b
EZ
146482011-03-13 Eli Zaretskii <eliz@gnu.org>
14649
14650 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14651 $(EMACS_ROOT)/lib/intprops.h.
14652
f0c77cd1
PE
146532011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14654
3eca4629
PE
14655 Fix more problems found by GCC 4.5.2's static checks.
14656
7c86ee98
PE
14657 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14658 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
14659 (xg_free_frame_widgets): Make it clear that a local variable is
14660 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
14661 (gdk_window_get_screen): Make it clear that this macro is needed
14662 only if USE_GTK_TOOLTIP.
1e5524e7
PE
14663 (int_gtk_range_get_value): New function, which avoids a diagnostic
14664 from gcc -Wbad-function-cast.
14665 (xg_set_toolkit_scroll_bar_thumb): Use it.
14666 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14667 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
14668 (get_utf8_string, xg_get_file_with_chooser):
14669 Rename locals to avoid shadowing.
14670 (create_dialog): Move locals to avoid shadowing.
7c86ee98 14671
41729b81
PE
14672 * xgselect.c (xg_select): Remove unused var.
14673
f0c77cd1
PE
14674 * image.c (four_corners_best): Mark locals as initialized.
14675 (gif_load): Initialize transparent_p to zero (Bug#8238).
14676 Mark another local as initialized.
ec6cf4c6 14677 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 14678
ce0ad53d 14679 * image.c (clear_image_cache): Now static.
d5d5a617 14680 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 14681 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
14682 (x_edge_detection): Remove unnecessary cast that
14683 gcc -Wbad-function-cast diagnoses.
2037898d 14684 (gif_load): Fix pointer signedness.
6ae141d6
PE
14685 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14686 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 14687
33383987 146882011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 14689
d32df629
PE
14690 Improve quality of tests for time stamp overflow.
14691 For example, without this patch (encode-time 0 0 0 1 1
14692 1152921504606846976) returns the obviously-bogus value (-948597
14693 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14694 reports time overflow. See
14695 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
14696 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14697 * editfns.c: Include limits.h and intprops.h.
14698 (TIME_T_MIN, TIME_T_MAX): New macros.
14699 (time_overflow): Move earlier, to before first use.
14700 (hi_time, lo_time): New functions, for an accurate test for
14701 out-of-range times.
14702 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14703 (Fget_internal_run_time): Don't assume time_t fits in int.
14704 (make_time): Use list2 instead of Fcons twice.
14705 (Fdecode_time): More accurate test for out-of-range times.
14706 (check_tm_member): New function.
14707 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
14708 (lisp_time_argument): Don't rely on undefined left-shift and
14709 right-shift behavior when checking for time stamp overflow.
8be6f318 14710
fe31d94c
PE
14711 * editfns.c (time_overflow): New function, refactoring common code.
14712 (Fformat_time_string, Fdecode_time, Fencode_time):
14713 (Fcurrent_time_string): Use it.
14714
8be6f318
PE
14715 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14716 * dired.c (make_time): Move to ...
14717 * editfns.c (make_time): ... here.
14718 * systime.h: Note the move.
14719
09d9db2c 147202011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 14721
126bc0dc
YM
14722 * fringe.c (update_window_fringes): Remove unused variables.
14723
c47cbdfd
YM
14724 * unexmacosx.c (copy_data_segment): Also copy __got section.
14725 (Bug#8223)
14726
7ac80be9
EZ
147272011-03-12 Eli Zaretskii <eliz@gnu.org>
14728
c96bbc66 14729 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
14730 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14731 Constify `char *' arguments and their references according to
14732 prototypes in tparam.h.
14733
ecb0f94d 14734 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 14735
7ac80be9
EZ
14736 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14737 Adapt all references accordingly.
14738
14739 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14740
ef1fd07e
TT
147412011-03-11 Tom Tromey <tromey@redhat.com>
14742
14743 * buffer.c (syms_of_buffer): Remove obsolete comment.
14744
7ef4b50c
EZ
147452011-03-11 Eli Zaretskii <eliz@gnu.org>
14746
14747 * termhooks.h (encode_terminal_code): Declare prototype.
14748
14749 * msdos.c (encode_terminal_code): Don't declare prototype.
14750
14751 * term.c (encode_terminal_code): Now external again, used by
14752 w32console.c and msdos.c.
14753
44f230aa
SM
14754 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14755 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 14756
4b1ec863 147572011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 14758
1714f52b 14759 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 14760
4b1ec863
PE
14761 * fringe.c (update_window_fringes): Mark locals as initialized
14762 (Bug#8227).
14763 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 14764
524c7aa6
PE
14765 * alloc.c (mark_fringe_data): Move decl from here ...
14766 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
14767 to check its interface.
14768 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
14769
a5c0af81 14770 * fontset.c (free_realized_fontset): Now static.
7519b8cd 14771 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 14772 (fontset_font): Mark local as initialized.
a9a06e0b 14773 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 14774
b4716021
PE
14775 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
14776
811e9bac 14777 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 14778 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
14779 (x_own_selection, Fx_disown_selection_internal): Rename locals
14780 to avoid shadowing.
14781 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 14782
7e3ab302
PE
14783 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
14784 so that the caller can use some name other than gcpro1.
14785 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
14786 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14787 (Fx_backspace_delete_keys_p):
14788 Use them to avoid shadowing, and rename vars to avoid shadowing.
14789 (x_decode_color, x_set_name, x_window): Now static.
6b437900 14790 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 14791 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
14792 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
14793 Remove unused locals.
7e3ab302
PE
14794 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14795 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
14796 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
14797 macros.
f78faa98 14798
e2b13473
PE
14799 * xterm.h (x_mouse_leave): New decl.
14800
77f23912
PE
14801 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
14802 Remove unused functions.
cdf4ba58
PE
14803 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
14804 (x_calc_absolute_position): Now static.
7411c686 14805 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 14806 Don't declare local "event" unless it's used.
ed7bf3a5
PE
14807 (x_iconify_frame, x_free_frame_resources): Don't declare locals
14808 unless they are used.
38d0b34a
PE
14809 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
14810 (x_fatal_error_signal): Remove; not used.
a6067996
PE
14811 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
14812 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
14813 (x_error_catcher, x_connection_closed, x_error_handler):
14814 (x_error_quitter, xembed_send_message, x_iconify_frame):
14815 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 14816 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 14817 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 14818
44f230aa
SM
14819 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
14820 Rename or move locals to avoid shadowing.
6b463e58 14821 (tty_defined_color, merge_face_heights): Now static.
5967d051 14822 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
14823 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
14824 does not deduce is never used uninitialized.
73719eba
PE
14825 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
14826 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 14827
426994c3 14828 * terminal.c (store_terminal_param): Now static.
5489860b 14829
032f1620 14830 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 14831 (set_frame_menubar): Remove unused local.
d4323972 14832 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
14833 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
14834 since they might point to immutable storage.
281585b0
PE
14835 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
14836 since it's unused otherwise.
032f1620 14837
367c19e5 14838 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 14839 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
14840 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
14841 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 14842 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
14843 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
14844 does not deduce are never used uninitialized.
70739cbe 14845
07b48fa9
PE
14846 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
14847
8868a238 14848 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
14849 * window.c (window_loop, size_window):
14850 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 14851
7e5cf297 14852 * window.c (display_buffer): Now static.
d6550a9f
PE
14853 (size_window): Mark variables that gcc -Wuninitialized
14854 does not deduce are never used uninitialized.
a586633d
PE
14855 * window.h (check_all_windows): New decl, to forestall
14856 gcc -Wmissing-prototypes diagnostic.
5b555da1 14857 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 14858
f6095868
PE
14859 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
14860 shadowing.
14861 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
14862 Include <limits.h>.
14863 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
14864 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
14865 (load_charset_map): Mark variables that gcc -Wuninitialized
14866 does not deduce are never used uninitialized.
53df7c11 14867 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 14868
f38b440c
PE
14869 * coding.c (coding_set_source, coding_set_destination):
14870 Use "else { /* comment */ }" rather than "else /* comment */;"
14871 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
14872 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14873 a block, when the outer 'i' will do.
14874 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14875 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14876 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14877 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14878 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14879 Rename locals to avoid shadowing.
14880 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
14881 * coding.c (emacs_mule_char, encode_invocation_designation):
14882 Now static, since they're not used elsewhere.
413bb2db 14883 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 14884 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
14885 (decode_coding_emacs_mule): Mark variables that gcc
14886 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
14887 (detect_coding_iso_2022): Initialize a local variable that might
14888 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 14889 this initialization is needed. (Bug#8211)
5f58e762
PE
14890 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14891 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14892 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14893 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14894 Remove unused macros.
f38b440c 14895
232b38b9 14896 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 14897 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 14898 * character.c (string_count_byte8): Likewise.
232b38b9 14899
fb90da1b
PE
14900 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14901 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14902
fb93dbc2
PE
14903 * chartab.c (copy_sub_char_table): Now static, since it's not used
14904 elsewhere.
5c156ace
PE
14905 (sub_char_table_ref_and_range, char_table_ref_and_range):
14906 Rename locals to avoid shadowing.
bbcd0949 14907 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 14908
7d3b3862 14909 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 14910 (BIDI_BOB): Remove unused macro.
7d3b3862 14911
6be7d3da
PE
14912 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14913 deduce are never used uninitialized.
c2ed9c8b 14914 * term.c (encode_terminal_code): Likewise.
6be7d3da 14915
75f8807f 14916 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 14917
50938595
PE
14918 * tparam.h: New file.
14919 * term.c, tparam.h: Include it.
14920 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14921 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14922 Move these decls to tparam.h, and make them agree with what
14923 is actually in tparam.c. The previous trick of using incompatible
14924 decls in different modules does not conform to the C standard.
14925 All callers of tparam changed to use tparam's actual API.
14926 * tparam.c (tparam1, tparam, tgoto):
14927 Use const pointers where appropriate.
14928
fbceeba2
PE
14929 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14930 * cm.h (struct cm): Likewise.
14931 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14932 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14933 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14934 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14935 (turn_on_face, init_tty): Likewise.
14936 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 14937
7f3f1250
PE
14938 * term.c (term_mouse_position): Rename local to avoid shadowing.
14939
e6ca6543
PE
14940 * alloc.c (mark_ttys): Move decl from here ...
14941 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14942
c40f8d15
AS
149432011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14944
14945 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14946
cfe0661d
JB
149472011-03-09 Juanma Barranquero <lekktu@gmail.com>
14948
14949 * search.c (compile_pattern_1): Remove argument regp, unused since
14950 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14951 (compile_pattern): Don't pass it.
14952
0afb4571
J
149532011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14954
14955 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14956 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14957 for ! HAVE_GTK3.
14958 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14959
14960 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14961
14962 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14963 gdk_window_get_screen, gdk_window_get_geometry,
14964 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14965 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14966 (xg_get_pixbuf_from_pixmap): New function.
14967 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14968 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14969 Call xg_get_pixbuf_from_pixmap instead of
14970 gdk_pixbuf_get_from_drawable.
14971 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14972 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14973 (xg_check_special_colors): Use GtkStyleContext and its functions
14974 for HAVE_GTK3.
14975 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14976 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14977 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
14978 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14979 Call gtk_widget_get_preferred_size.
0afb4571
J
14980 (xg_frame_resized): gdk_window_get_geometry only takes 5
14981 parameters.
44f230aa
SM
14982 (xg_win_to_widget, xg_event_is_for_menubar):
14983 Call gdk_x11_window_lookup_for_display.
0afb4571
J
14984 (xg_set_widget_bg): New function.
14985 (delete_cb): New function.
895009e1 14986 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 14987 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
14988 (xg_set_background_color): Call xg_set_widget_bg.
14989 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14990 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14991 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14992 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14993 if ! HAVE_GTK3.
14994 (update_frame_tool_bar): Call gtk_widget_hide.
14995 (xg_initialize): Use GDK_KEY_g.
14996
14997 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
14998 if ! HAVE_GTK3
14999 (x_session_initialize): Call gdk_x11_set_sm_client_id.
15000
15001 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
15002 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
15003 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
15004
1c2cc4ef
JB
150052011-03-08 Juanma Barranquero <lekktu@gmail.com>
15006
15007 * w32xfns.c (select_palette): Check success of RealizePalette against
15008 GDI_ERROR, not zero.
15009
33383987 15010See ChangeLog.11 for earlier changes.
aac0c6e3
MR
15011
15012;; Local Variables:
15013;; coding: utf-8
aac0c6e3
MR
15014;; End:
15015
2f097256 15016 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
15017
15018 This file is part of GNU Emacs.
15019
15020 GNU Emacs is free software: you can redistribute it and/or modify
15021 it under the terms of the GNU General Public License as published by
15022 the Free Software Foundation, either version 3 of the License, or
15023 (at your option) any later version.
15024
15025 GNU Emacs is distributed in the hope that it will be useful,
15026 but WITHOUT ANY WARRANTY; without even the implied warranty of
15027 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15028 GNU General Public License for more details.
15029
15030 You should have received a copy of the GNU General Public License
15031 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.