* bookmark.el: Define a face to highlight bookmark names in
[bpt/emacs.git] / src / ChangeLog
CommitLineData
4aae1914
EZ
12013-03-07 Eli Zaretskii <eliz@gnu.org>
2
3 * .gdbinit (prowlims): Display the enabled_p flag of the row.
4
c54aa166
DA
52013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
6
7 Avoid character to byte conversions in motion subroutines.
8 * indent.h (compute_motion, vmotion): Add byte position argument.
9 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
10 Add eassert.
11 (Fcompute_motion): Break long line. Adjust call to compute_motion.
12 Use list5 for return value.
13 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
14 Adjust comments, style and calls to compute_motion.
15 (Fvertical_motion): Adjust call to vmotion.
16 * window.c (Fdelete_other_windows_internal): Record window start
17 byte position and adjust call to vmotion.
18 (window_scroll_line_based): Likewise with call to compute_motion.
19 Use SET_PT_BOTH.
20 (Frecenter): Adjust calls to vmotion.
21
3de717bd
DA
222013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
23
24 * lisp.h (list2i, list3i): New functions.
25 (list4i): Move from window.c and make LISP_INLINE.
26 * editfns.c (make_lisp_time):
27 * fns.c (Flocale_info):
28 * keyboard.c (parse_modifiers):
29 * xterm.c (x_ewmh_activate_frame): Use list2i.
30 * instel.c (signal_after_change):
31 * nsfns.m (Fx_server_version, Fxw_color_values):
32 * w32fns.c (Fxw_color_values, Fx_server_version):
33 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
34 * fileio.c (Fvisited_file_modtime):
35 * nsfns.m (Fns_display_usable_bounds):
36 * w32.c (ltime): Use list4i.
37
d26e478e
EZ
382013-03-06 Eli Zaretskii <eliz@gnu.org>
39
a611149e
EZ
40 * search.c (find_newline_no_quit): Rename from find_next_newline.
41 Add commentary.
42
43 * lisp.h (find_newline_no_quit): Rename prototype.
44
45 * xdisp.c (back_to_previous_line_start)
46 (forward_to_next_line_start, get_visually_first_element)
47 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
48 * indent.c (vmotion): Callers of find_newline_no_quit changed.
49 * bidi.c (bidi_find_paragraph_start): Callers of
50 find_newline_no_quit changed.
51
d26e478e
EZ
52 * msdos.c: Change encoding to cp850. (Bug#13879)
53 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
54
1af1a51a
DA
552013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
56
57 Coding system support cleanup and minor refactoring.
58 * coding.h (enum coding_result_code): Remove
59 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
60 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
61 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
62 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
63 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
64 (decode_coding_region, encode_coding_region, decode_coding_string):
65 Remove unused compatibility macros.
66 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
67 (record_conversion_result): Adjust user.
68 (syms_of_coding): Likewise.
69 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
70 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
71 (decode_coding_object): Simplify since xrealloc never returns NULL.
72 Add eassert.
73
0bafabe7 742013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 75
9b1c3271 76 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
77 * sysdep.c (list_system_processes)
78 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 79 Make it a stub in this case; otherwise the build might fail,
0845a75c 80 and this code hasn't been tested on such hosts anyway.
725eb027 81 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
82 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
83 and analyzed by Jérémie Courrèges-Anglas in
84 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 85
ffc65bee
DA
862013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
87
88 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
89 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
90 (get_visually_first_element, move_it_vertically_backward): Ajust users.
91 * bidi.c (bidi_find_paragraph_start): Likewise.
92 * indent.c (vmotion): Likewise.
93
70743157
PE
942013-03-05 Paul Eggert <eggert@cs.ucla.edu>
95
96 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
97 * filelock.c: Include <c-ctype.h>.
98 (MAX_LFINFO): New top-level constant.
99 (lock_info_type): Remove members pid, boot_time. Add members at,
100 dot, colon. Change user member to be the entire buffer, not a
101 pointer. This allows us to handle the case where a foreign
102 pid or boot time exceeds the local range. All uses changed.
103 (LINKS_MIGHT_NOT_WORK): New constant.
104 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
105 (defined_WINDOWSNT): Remove.
106 (MAKE_LOCK_NAME, file_in_lock_file_name):
107 Always use .#FILE (not .#-FILE) for the file lock,
108 even if it is a regular file.
109 (rename_lock_file): New function.
110 (create_lock_file): Use it.
111 (create_lock_file, read_lock_data):
112 Prefer a symbolic link for the lock file, falling back on a
113 regular file if symlinks don't work. Do not try to create
114 symlinks on MS-Windows, due to security hassles. Stick with
115 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
116 link, rename, unlink, mkstemp) when creating locks, as a GNUish
117 host may be using a Windowsish file system, and cannot use
118 MS-Windows-only system calls. Fall back on mktemp if mkstemp
119 doesn't work. Don't fail merely because of a symlink-contents
120 length limit in the current file system; fall back on regular
121 files. Increase the symlink contents length limit to 8 KiB, this
122 should be big enough for any real use and doesn't crunch the
123 stack.
124 (create_lock_file, lock_file_1, read_lock_data):
125 Simplify allocation of lock file buffers now that they fit in 8 KiB.
126 (lock_file_1): Return error number, not bool. All callers changed.
127 (ELOOP): New macro, if not already defined.
128 (read_lock_data): Return size of lock file contents, not Lisp object.
129 All callers changed. Handle a race condition if some other process
130 replaces a regular-file lock with a symlink lock or vice versa,
131 while we're trying to read the lock.
132 (current_lock_owner): Parse contents more carefully, to help avoid
133 confusing a regular-file lock with some other application's use
134 of the file. Check for lock file contents being too long, or
135 not parsing correctly.
136 (current_lock_owner, lock_file):
137 Allow foreign pid and boot times that exceed the local range.
138 (current_lock_owner, lock_if_free, lock_file):
139 Simplify allocation of lock file contents.
140 * w32.c (sys_rename_replace): New function, containing most of
141 the contents of the old sys_rename.
142 (sys_rename): Use it.
143 (fchmod): New dummy function.
144 * w32.h (sys_rename_replace, fchmod): New decls.
145
05e193f1
EZ
1462013-03-05 Eli Zaretskii <eliz@gnu.org>
147
148 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
149 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
150 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
151 <dmantipov@yandex.ru>.
152
3bfc46eb
DA
1532013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
154
155 * composite.c (get_composition_id, fill_gstring_header):
156 Use make_uninit_vector where appropriate.
157 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
158 * xselect.c (clean_local_selection_data): Likewise.
159
84ac6f9d
PE
1602013-03-04 Paul Eggert <eggert@cs.ucla.edu>
161
162 Fix misuse of ImageMagick that caused core dump (Bug#13846).
163 * image.c (imagemagick_load_image): Calculate height and width
164 after flattening the image, not before.
165
42926ec8
DA
1662013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
167
168 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
169 * ftfont.c (ftfont_shape_by_flt): Likewise.
170 * w32uniscribe.c (uniscribe_shape): Likewise.
171
b5029e23
PE
1722013-03-02 Paul Eggert <eggert@cs.ucla.edu>
173
174 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
175 The old approach, which fell back on DIR/.#FILE.0 through
176 DIR/.#FILE.9, had race conditions that could not be easily fixed.
177 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
178 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
179 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
180 because the locking mechanism was never reliable in that case).
181 This patch fixes this and other bugs discovered by a code
182 inspection that was prompted by
183 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
184 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
185 to avoid interoperability problems between the MS-Windows and
186 non-MS-Windows implementations. MS-Windows and non-MS-Windows
187 instances of Emacs now ignore each others' locks.
188 * filelock.c (defined_WINDOWSNT): New constant.
189 (MAKE_LOCK_NAME, fill_in_lock_file_name):
190 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
191 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
192 regular files on MS-Windows hosts.
193 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
194 Use SAFE_ALLOCA to avoid problems with long file names.
195 (MAX_LFINFO): Now a local constant, not a global macro.
196 (IS_LOCK_FILE): Remove.
197 (lock_file_1): Don't inspect errno if symlink call succeeds;
198 that's not portable.
199 (lock_file): Document that this function can return if lock
200 creation fails.
2db41375 201 (lock_file): Don't access freed storage.
b5029e23 202
b270d116
AS
2032013-03-02 Andreas Schwab <schwab@linux-m68k.org>
204
205 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
206
81c23309
PE
2072013-03-02 Paul Eggert <eggert@cs.ucla.edu>
208
209 * textprop.c: Use bool for booleans.
210 (validate_interval_range, Fadd_text_properties)
211 (Fremove_text_properties): Prefer bool to int when either works.
212
18f2ac09
EZ
2132013-03-02 Eli Zaretskii <eliz@gnu.org>
214
215 * textprop.c (Fadd_text_properties, Fremove_text_properties): If
216 the interval tree changes as a side effect of calling
217 modify_region, re-do processing starting from the call to
218 validate_interval_range. (Bug#13743)
219
929aeac6 2202013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
221
222 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
223 (Bug#13546).
224
531e70ec
EZ
2252013-02-27 Eli Zaretskii <eliz@gnu.org>
226
227 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
228 _SH_DENYRW flag, instead of emacs_open, to deny any other process
229 access to the lock file until it is written and closed.
230 (Bug#13807)
231
6e65b9cc
PE
2322013-02-27 Paul Eggert <eggert@cs.ucla.edu>
233
234 * callint.c (Qcall_interactively):
235 * macros.c (Qexecute_kbd_macro):
236 Now static.
237
3b166f09
BG
2382013-02-26 Bastien Guerry <bzg@gnu.org>
239
240 * window.c (Frecenter): Tiny docstring enhancement.
241
ecc0fdd4
PE
2422013-02-26 Paul Eggert <eggert@cs.ucla.edu>
243
244 Minor textprop integer cleanup.
245 * intervals.h, textprop.c (add_text_properties_from_list):
246 Return void, not int, since nobody uses the return value.
247 * textprop.c (validate_plist, add_properties, remove_properties)
248 (Fadd_text_properties):
249 Don't assume list length fits in int.
250 (interval_has_all_properties, interval_has_some_properties)
251 (interval_has_some_properties_list, add_properties, remove_properties)
252 (Fadd_text_properties, Fremove_text_properties)
253 (Fremove_list_of_text_properties, text_property_stickiness):
254 Use bool for booleans.
255 (Fadd_text_properties, Fremove_text_properties):
256 (Fremove_list_of_text_properties):
257 Reindent do-while as per GNU style.
258
0248b0d7
EZ
2592013-02-25 Eli Zaretskii <eliz@gnu.org>
260
343a2aef
EZ
261 Implement CLASH_DETECTION for MS-Windows.
262
263 * filelock.c [WINDOWSNT]: Include w32.h.
264 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
265 function of that name. Up-case the macro arguments.
266 (IS_LOCK_FILE): New macro.
267 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
268 (create_lock_file): New function, with body extracted from
269 lock_file_1.
270 [WINDOWSNT]: Implement lock files by writing a regular file with
271 the lock information as its contents.
272 (read_lock_data): New function, on Posix platforms just calls
273 emacs_readlinkat.
274 [WINDOWSNT]: Read the lock info from the file.
275 (current_lock_owner): Call read_lock_data instead of calling
276 emacs_readlinkat directly.
277 (lock_file) [WINDOWSNT]: Run the file name through
278 dostounix_filename.
279
280 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
281 just check if the process by that PID exists.
282
283 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
284 also present, as doing so will fail to error out if the file
285 already exists.
286
287 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
288
0248b0d7
EZ
289 * textprop.c (Fadd_text_properties, Fremove_text_properties)
290 (Fremove_list_of_text_properties): Skip all of the intervals in
291 the region between START and END that already have resp. don't
292 have the requested properties, not just the first one. Add
293 assertions that the loop afterwards always modifies the
294 properties. (Bug#13743)
295
b5071fc7
SM
2962013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
297
298 * callint.c (Fcall_interactively): Use the right lexical environment
299 for `interactive' specs (bug#13811).
300 * eval.c (Feval): Accept a lexical environment.
301
1ddc2bd6
PE
3022013-02-25 Paul Eggert <eggert@cs.ucla.edu>
303
304 Simplify data_start configuration (Bug#13783).
305 This is a followon simplification to the fix for Bug#13650.
306 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
307 (START_FILES): Remove. All uses removed.
308 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
309 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
310 (buildobj.h): Use it.
311 ($(ALLOBJS)): Depend on globals.h.
312 (temacs$(EXEEXT)): Use $(ALLOBJS).
313 * autodeps.mk (ALLOBJS): Move to Makefile.in.
314 * deps.mk (vm-limit.o):
315 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
316 Do not depend on mem-limits.h.
317 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
318 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
319 [__GNUC__ && !ORDINARY_LINK]: Remove.
320 * mem-limits.h, pre-crt0.c: Remove.
321 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
322 * unexcoff.c (etext): New decl.
323 (make_hdr): Use DATA_START instead of start_of_data.
324 * vm-limit.c: Move most of mem-limits.h's contents here.
325 (data_start): New decl. It's OK if this is approximate,
326 so simplify-away some unnecessary exactness.
327 (POINTER): Remove; all uses removed.
328 (data_space_start): Now char *, to avoid casts.
329 (exceeds_lisp_ptr): New function, replacing the old
330 EXCEEDS_LISP_PTR macro. All uses changed.
331 (check_memory_limits): Simplify and remove casts.
332 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
333 (memory_warnings): Use data_start instead of start_of_data.
334
51aa2a8b
AS
3352013-02-24 Andreas Schwab <schwab@linux-m68k.org>
336
337 * xdisp.c (set_message): Only check for debug-on-message if STRING
338 is a string. (Bug#13797)
339
1938d88c
PE
3402013-02-24 Paul Eggert <eggert@cs.ucla.edu>
341
342 Fix regression introduced by July 10 filelock.c patch.
343 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
344 2012-07-10 patch to this file. Reported by Eli Zaretskii in
345 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
346 and diagnosed by Andreas Schwab in
347 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
348
fcee5028
PE
3492013-02-22 Paul Eggert <eggert@cs.ucla.edu>
350
351 Assume C89 or better.
352 * ralloc.c (SIZE, POINTER, NIL):
353 * vm-limit.c (POINTER):
354 Remove, replacing all uses with C89 equivalents. These old
355 symbols were present only for porting to pre-C89 platforms.
356
d78cf5ed
CB
3572013-02-22 Claudio Bley <claudio.bley@gmail.com>
358
359 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
360 This avoids warning messages reported as part of Bug#13546.
361
6bcd97a4
KB
3622013-02-21 Ken Brown <kbrown@cornell.edu>
363
364 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
365
b6c2bfff
SM
3662013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
367
e11dacb5
SM
368 * sheap.c (report_sheap_usage): Prefer message1_nolog.
369
b6c2bfff
SM
370 * keyboard.c (Qcommand_execute): New var.
371 (command_loop_1, read_char): Use it.
372 (Fcommand_execute): Remove, replace by an Elisp implementation.
373 (syms_of_keyboard): Adjust accordingly.
374
d69f1120 3752013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 376
d69f1120
DC
377 * sheap.c (report_sheap_usage): Use message, not message1, so
378 that we don't try to create a buffer while we're in the middle
379 of dumping Emacs. Explain why.
b6c2bfff 380
2a14a4f1 3812013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 382
2a14a4f1
DA
383 * search.c (find_newline): Return byte position in bytepos.
384 Adjust comment.
b6c2bfff
SM
385 (find_next_newline_no_quit, find_before_next_newline):
386 Add bytepos argument.
2a14a4f1
DA
387 * lisp.h (find_newline, find_next_newline_no_quit)
388 (find_before_next_newline): Adjust prototypes.
389 * bidi.c (bidi_find_paragraph_start):
390 * editfns.c (Fconstrain_to_field, Fline_end_position):
391 * indent.c (compute_motion, vmotion):
392 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
393 (get_visually_first_element, move_it_vertically_backward):
394 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
395
872faefb 3962013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
397
398 * w32proc.c (new_child): Avoid leaking handles if the subprocess
399 resources were not orderly released.
400
fd80c659
EZ
4012013-02-17 Eli Zaretskii <eliz@gnu.org>
402
403 * xdisp.c (x_draw_vertical_border): For a window that is neither
404 the leftmost nor the rightmost, redraw both the left and the right
405 vertical borders. (Bug#13723)
406
2f73da9c
SM
4072013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
408
409 * xml.c (init_libxml2_functions):
410 * sound.c (sound_warning):
411 * sheap.c (report_sheap_usage):
412 * process.c (wait_reading_process_output):
413 * msdos.c (XMenuActivate):
414 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
415 * keyboard.c (top_level_1):
416 * editfns.c (Fmessage, Fmessage_box):
417 * callint.c (Fcall_interactively):
418 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
419
fd9547e8
JD
4202013-02-17 Jan Djärv <jan.h.d@swipnet.se>
421
422 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
423 * frame.c (syms_of_frame): ... to here.
424
f277993b
EZ
4252013-02-16 Eli Zaretskii <eliz@gnu.org>
426
c7939585
EZ
427 * w32.c (sys_chown): Remove unused function.
428
cd91fb4b
EZ
429 * w32term.c <input_signal_count>: Declare 'volatile'
430 unconditionally. (Bug#9066)
431
f277993b
EZ
432 * w32.c (set_errno): Reset h_errno and don't set it to any other
433 value. Set errno instead.
434 (check_errno): Reset h_errno.
435 (sys_socket, socket_to_fd, sys_bind, sys_connect)
436 (sys_gethostname, sys_getservbyname, sys_getpeername)
437 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
438 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
439 h_errno.
440 (sys_gethostbyname): Set h_errno only errors detected.
441
e454145b
PE
4422013-02-15 Paul Eggert <eggert@cs.ucla.edu>
443
444 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
445
bcf7fe2a
EZ
4462013-02-15 Eli Zaretskii <eliz@gnu.org>
447
ef9c57e2
EZ
448 * keyboard.c (read_char): Fix calculation of auto-save time out
449 when auto-save-timeout is less than 4. (Bug#13720)
450
ef862e20 451 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 452 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 453
bcf7fe2a
EZ
454 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
455 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
456 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
457 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
458 make sure errno is set to an appropriate value. (Bug#13546)
459 (socket_to_fd): Add assertion against indexing fd_info[] with a
460 value that is out of bounds.
461 (sys_accept): If fd is negative, do not set up the child_process
462 structure for reading.
463
0063fdb1
DA
4642013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
465
466 * composite.c (fill_gstring_header): Remove useless prototype.
467 Break long line.
468 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
469 * print.c (PRINTDECLARE, print_object):
470 * search.c (compile_pattern, fast_looking_at, search_buffer):
471 (simple_search, boyer_moore, Freplace_match):
472 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
473 (get_overlay_arrow_glyph_row, display_mode_element):
474 (decode_mode_spec_coding, message3):
475 * xfaces.c (face_at_string_position): Use bool for booleans.
476 Adjust comments.
477
648e5523 4782013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 479
35b3a27e
PE
480 Fix AIX port (Bug#13650).
481 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
482 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
483 was #undeffed earlier, so it cannot be used as a macro here.
484 Use the constant and not the macro.
35b3a27e 485
648e5523 4862013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 487
0e4e7b74
EZ
488 * w32proc.c (new_child): If no vacant slots are found in
489 child_procs[], make another pass looking for slots whose process
490 has exited or died. (Bug#13546)
491
6e432f0c
EZ
492 * w32.c (sys_pipe): When failing due to file descriptors above
493 MAXDESC, set errno to EMFILE.
494 (_sys_read_ahead): Update cp->status when failing to read serial
495 communications input, so that the status doesn't stay at
496 STATUS_READ_IN_PROGRESS. (Bug#13546)
497
51b3a99c
JD
4982013-02-14 Jan Djärv <jan.h.d@swipnet.se>
499
500 * gtkutil.c (tb_size_cb): New function.
501 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
502
e31560a7
SM
5032013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
504
505 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
506 an event.
507
fe336261
SM
5082013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
509
510 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
511
5a655b9f
DA
5122013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
513
514 * font.c (font_range): Add pos_byte argument. Adjust comment
515 and break long line.
516 * font.h (font_range): Adjust prototype.
517 * composite.c (autocmp_chars): Pass byte position to font_range.
518 Break long line. Remove useless prototype and format comment.
519
1a359750
GM
5202013-02-13 Glenn Morris <rgm@gnu.org>
521
522 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
523
01fcc3a5 5242013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 525
f53f992a
PE
526 Improve AIX port some more (Bug#13650).
527 With this, it should be as good as it was in 23.3, though it's
528 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
529 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
530 * unexaix.c (start_of_text): Remove.
531 (_data, _text): Declare as char[], not int, as AIX manual suggests.
532 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
533 (orig_load_scnptr, orig_data_scnptr):
534 Now off_t, not long, since they are file offsets.
535 (make_hdr): Use _data, not start_of_data ().
536 This is the key part of the fix.
537 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
538 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
539
4458c255
PE
540 * pre-crt0.c (data_start): Initialize to 1.
541 This ports to compilers that optimize the external declaration
542 'int x = 0;' as if it were 'int x;' to shrink the executable.
543
227be86d
PE
544 Improve AIX port (Bug#13650).
545 This doesn't fix the bug, but it makes progress: Emacs builds now.
546 * unexaix.c: Include inttypes.h, stdarg.h.
547 (report_error, report_error_1): Mark as _Noreturn.
548 (report_error): Don't report the wrong errno.
549 (report_error_1): Now varargs. All callers changed.
550 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
551 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
552 (write_ptr): Use %p to print address rather than %lx and a cast
553 to unsigned long. Grow buffer a bit, to be safer.
554
01fcc3a5 5552013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
556
557 * bidi.c (bidi_resolve_neutral): After finding the next
558 non-neutral character, accept NEUTRAL_ON type as well, because
559 directional control characters, such as LRE and RLE, have their
560 type converted to that by bidi_resolve_weak. This avoids aborts
561 when LRE/RLE follows a run of neutrals.
562 (bidi_move_to_visually_next): Assert that return value of
563 bidi_peek_at_next_level is non-negative. Negative values will
564 cause an infloop.
565
83be8524
PE
5662013-02-13 Paul Eggert <eggert@cs.ucla.edu>
567
568 Minor getenv-related fixes.
569 * callproc.c (Fcall_process_region) [!DOS_NT]:
570 Avoid unnecessary duplicate call to getenv.
571 * callproc.c (init_callproc):
572 * dispnew.c (init_display):
573 * sysdep.c (sys_subshell):
574 Omit unnecessary cast of getenv or egetenv.
575
45b2b768
JB
5762013-02-13 Juanma Barranquero <lekktu@gmail.com>
577
578 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
579 Update dependencies.
580
33b49d71
EZ
5812013-02-12 Eli Zaretskii <eliz@gnu.org>
582
583 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
584 marker's position.
585 (display_line): Set w->region_showing to the value of
586 it->region_beg_charpos, not to -1. This fixes redisplay
587 optimization when cursor is moved up after M->. (Bug#13623)
588 (Bug#13626)
c4131562
EZ
589 (try_scrolling): Scroll text up more if point is too close to ZV
590 and inside the scroll margin. This makes sure point is moved
591 outside the scroll margin in these cases.
33b49d71
EZ
592
593 * window.h (struct window): region_showing can no longer be
594 negative.
595
b09a4810
PE
5962013-02-11 Paul Eggert <eggert@cs.ucla.edu>
597
a84b7c53
PE
598 Tune by using memchr and memrchr.
599 * doc.c (Fsnarf_documentation):
600 * fileio.c (Fsubstitute_in_file_name):
601 * search.c (find_newline, scan_newline):
602 * xdisp.c (pos_visible_p, display_count_lines):
603 Use memchr and memrchr rather than scanning byte-by-byte.
604 * search.c (find_newline): Rename from scan_buffer.
605 Omit first arg TARGET, as it's always '\n'. All callers changed.
606
b09a4810
PE
607 Clean up read_key_sequence a tiny bit more.
608 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
609 (read_key_sequence): Remove unused locals.
610
99d0d6dc
SM
6112013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
612
613 Clean up read_key_sequence a bit; reread active keymaps after first event.
614 * keyboard.c (read_char, read_char_x_menu_prompt)
615 (read_char_minibuf_menu_prompt):
616 Replace nmaps+maps with a single `map' arg.
617 (follow_key): Operate on a single map.
618 (active_maps): New function.
619 (test_undefined): Also return true for nil bindings.
620 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
621 a single (composed) keymap. Remember `first_event' to choose the right
622 set of active keymaps. Recompute the set of keymaps after receiving
623 the first event. Remove GOBBLE_FIRST_EVENT.
624 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
625 * keyboard.h (read_char): Update declaration.
626 * lread.c (read_filtered_event): Adjust call to read_char.
627
f5e1b680
EZ
6282013-02-11 Eli Zaretskii <eliz@gnu.org>
629
99d0d6dc
SM
630 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
631 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
632 in the window. (Bug#13675)
633
f74de345
DA
6342013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
635
636 * marker.c (set_marker_internal): If desired position is passed
637 as a marker, avoid call to buf_charpos_to_bytepos.
638 * window.c (Fset_window_point): Omit redundant type checking.
639 (Fset_window_start): Likewise. Format comment.
640 (window_scroll_pixel_based): Use set_marker_restricted_both
641 with character and byte positions obtained from an iterator.
642 (Fset_window_configuration): Use set_marker_restricted_both.
643 * xdisp.c (message_dolog): Likewise.
644
a4ba3963
EZ
6452013-02-10 Eli Zaretskii <eliz@gnu.org>
646
99d0d6dc
SM
647 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
648 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
649 too far. This speeds up some redisplay operations. (Bug#13675)
650
68643cde
DA
6512013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
652
653 * syntax.c (scan_sexps_forward): Fix byte position calculation
654 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
655
7ba11bee
PE
6562013-02-10 Paul Eggert <eggert@cs.ucla.edu>
657
658 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
659 that was not needed.
660
eff1c190
PE
6612013-02-09 Paul Eggert <eggert@cs.ucla.edu>
662
663 Minor hashing refactoring.
664 * fns.c (SXHASH_REDUCE): Move to lisp.h.
665 (sxhash_float): Return EMACS_UINT, for consistency with the other
666 hash functions.
667 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
668 non-static inline function and therefore can't use static vars.
669 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
670 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
671 with the other hash functions.
672
6b48c831
EZ
6732013-02-09 Eli Zaretskii <eliz@gnu.org>
674
4dde2087
EZ
675 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
676 XXXXXX part of the temporary file pattern is not downcased even
677 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 678
8549f9e8
EZ
679 * xdisp.c (decode_mode_spec): Remove handling of %t.
680
6b48c831
EZ
681 * msdos.c (careadlinkatcwd): Remove.
682
75a65c7e
SM
6832013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
684
685 * lread.c (skip_dyn_bytes): New function (bug#12598).
686 (read1): Use it. Use getc instead of READCHAR to read bytes.
687 (load_each_byte): Remove. Update users.
688
8ca30920
DA
6892013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
690
691 * search.c (scan_buffer): Calculate end byte position just once.
692 (scan_newline): Do not recalculate start_byte.
693 (search_command): Use eassert.
694 * syntax.c (struct lisp_parse_state): New member location_byte.
695 (scan_sexps_forward): Record from_byte and avoid redundant
696 character to byte position calculation ...
697 (Fparse_partial_sexp): ... here. Break too long line.
698
25721f5b
DA
6992013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
700
701 * lisp.h (make_uninit_vector): New function.
702 * alloc.c (Fvector, Fmake_byte_code):
703 * ccl.c (Fregister_ccl_program):
704 * charset.c (Fdefine_charset_internal, define_charset_internal):
705 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
706 * composite.c (syms_of_composite):
707 * font.c (Fquery_font, Ffont_info, syms_of_font):
708 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
709 * ftfont.c (ftfont_shape_by_flt):
710 * indent.c (recompute_width_table):
711 * nsselect.m (clean_local_selection_data):
712 * syntax.c (init_syntax_once):
713 * w32unsubscribe.c (uniscribe_shape):
714 * window.c (Fcurrent_window_configuration):
715 * xfaces.c (Fx_family_fonts):
716 * xselect.c (selection_data_to_lisp_data): Use it.
717
9a9d91d9
DA
7182013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
719
720 * coding.c (Fdefine_coding_system_internal): Use AREF where
721 argument is known to be a vector.
722 * fns.c (Flocale_info): Likewise for ASET.
723 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
724 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
725
6871e574
JD
7262013-02-05 Jan Djärv <jan.h.d@swipnet.se>
727
728 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
729 height.
730
731 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
732 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
733 updateCollectionBehaviour.
734
735 * nsterm.m (NEW_STYLE_FS): Remove.
736 (ns_last_use_native_fullscreen): New variable.
737 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
738 (x_set_window_size): Do not take title bar and tool bar into account
739 if isFullscreen returns YES.
740 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
741 (check_native_fs): New function.
742 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
743 (ns_term_init): Remove NEW_STYLE_FS.
744 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
745 and tool bar if isFullscreen returns NO.
746 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
747 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
748 with HAVE_NATIVE_FS.
749 (window:willUseFullScreenPresentationOptions:): New method.
750 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
751 Hide toolbar if not enabled (Bug#13444).
752 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
753 Restore tool bar if enabled, hide it otherwise (Bug#13444).
754 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
755 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
756 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
757 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
758 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
759 (syms_of_nsterm): Add ns-use-native-fullscreen.
760
3f011c7f
PE
7612013-02-04 Paul Eggert <eggert@cs.ucla.edu>
762
763 * fileio.c (Qchoose_write_coding_system): Now static.
764
86f7c0fe
EZ
7652013-02-04 Eli Zaretskii <eliz@gnu.org>
766
767 * xdisp.c (window_buffer_changed): region_showing can be negative,
768 which still means region is being displayed.
769 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
770 whole window when showing region and the mark has changed.
771 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
772 (display_line): If it->region_beg_charpos is non-zero, set the
773 window's region_showing member to -1. (Bug#13623) (Bug#13626)
774
775 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
776 not bitfield of 1 bit.
777
5257b701
DC
7782013-02-03 Daniel Colascione <dancol@dancol.org>
779
780 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
781 daemon mode works on cygw32 when Emacs is installed and not just
782 during development.
783
8ea41ea9
PE
7842013-02-02 Paul Eggert <eggert@cs.ucla.edu>
785
786 Avoid file time stamp bug on MS-Windows (Bug#13149).
787 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
788 as FAT32 doesn't update time stamps when truncating them.
789 Also, check that a file time stamp is not a multiple of 100 ns;
790 this should catch all instances of the problem on MS-Windows,
791 as its native file system resolution is 100 ns or worse, and
792 checking for a non-multiple of 100 ns should impose only a small
793 overhead on systems with ns resolution.
794
94fbc901 7952013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 796
e7ac588e
EZ
797 Avoid encoding file names on MS-Windows when they need to be run
798 through dostounix_filename.
799 * w32.c (normalize_filename): Accept an additional argument
800 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
801 downcase it even if w32-downcase-file-names is non-nil.
802 (dostounix_filename): Accept an additional argument MULTIBYTE and
803 pass it to normalize_filename.
804 (emacs_root_dir): Adjust.
805
806 * msdos.h (dostounix_filename): Adjust prototype.
807
808 * w32.h (dostounix_filename): Adjust prototype.
809
810 * msdos.c (dostounix_filename): Accept an additional argument and
811 ignore it.
812 (init_environment): Adjust callers of dostounix_filename.
813
814 * fileio.c (Ffile_name_directory, file_name_as_directory)
815 (directory_file_name, Fexpand_file_name)
816 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
817 dostounix_filename.
818 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
819 non-nil.
820 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
821 variables, as egetenv is case-insensitive for DOS_NT.
822
823 * dired.c (file_name_completion): Don't call Fdirectory_file_name
824 with an encoded file name.
825
99d0d6dc
SM
826 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
827 Adjust calls to dostounix_filename.
e7ac588e
EZ
828
829 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
830
831 * unexw32.c (unexec): Adjust call to dostounix_filename.
832
833 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
834
835 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
836 dostounix_filename.
837
838 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
839 dostounix_filename.
840
e7c3fb06
EZ
841 * callproc.c (Fcall_process): Make sure program name in PATH and
842 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
843 is passed to exec/spawnve, which fails unless the file-name
844 encoding is UTF-8.
845
18a80473
EZ
846 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
847 even if w32-quote-process-args is nil.
848
35e85499
PE
8492013-02-01 Paul Eggert <eggert@cs.ucla.edu>
850
851 Fix timestamp bug when write-region appends nothing (Bug#13149).
852 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
853 the file's time stamp doesn't change if Emacs happens to write nothing
854 to the file, and on a buggy file system this could cause Emacs to
855 incorrectly infer that the file system doesn't have the bug.
856 Avoid this problem by inhibiting the inference in this case.
857
422ff52b
DA
8582013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
859
860 * window.h (struct window): Convert base_line_number, base_line_pos
861 and column_number_displayed members from Lisp_Object to ptrdiff_t.
862 Convert region_showing member from Lisp_Object to bitfield.
863 Remove sequence_number member. Adjust comments.
864 * window.c (sequence_number): Remove.
865 (make_window): Initialize column_number_displayed.
866 * print.c (print_object): Follow the printed representation of
867 frames and print window pointer to distinguish between windows.
868 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
869 * xdisp.c (wset_base_line_number, wset_base_line_pos)
870 (wset_column_number_displayed, wset_region_showing): Remove.
871 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
872 (try_scrolling, try_cursor_movement, redisplay_window)
873 (try_window_reusing_current_matrix, try_window_id, display_line)
874 (display_mode_lines, decode_mode_spec): Adjust users.
875 * .gdbinit (pwinx): Do not print sequence_number.
876
8654f9d7
PE
8772013-02-01 Paul Eggert <eggert@cs.ucla.edu>
878
879 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
880 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
881 * dired.c: Include <fcntl.h>.
882 (open_directory): New function, which uses open and fdopendir
883 rather than opendir. DOS_NT platforms still use opendir, though.
884 (directory_files_internal, file_name_completion): Use it.
885 (file_attributes): New function, with most of the old Ffile_attributes.
886 (directory_files_internal, Ffile_attributes): Use it.
887 (file_attributes, file_name_completion_stat): First arg is now fd,
888 not dir name. All uses changed. Use fstatat rather than lstat +
889 stat.
890 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
891 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
892 (emacs_readlinkat): New function, with much of the old
893 Ffile_symlink_p, but with an fd argument for speed.
894 It uses readlinkat rather than careadlinkatcwd, so that it
895 need not assume the working directory.
896 (Ffile_symlink_p): Use it.
897 * filelock.c (current_lock_owner): Use emacs_readlinkat
898 rather than emacs_readlink.
899 * lisp.h (emacs_readlinkat): New decl.
900 (READLINK_BUFSIZE, emacs_readlink): Remove.
901 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
902 (emacs_norealloc_allocator, emacs_readlink): Remove.
903 This stuff is moved to fileio.c.
904 * w32.c (fstatat, readlinkat): New functions.
905 (careadlinkat): Don't check that fd == AT_FDCWD.
906 (careadlinkatcwd): Remove; no longer needed.
907
9dbda100
GM
9082013-01-31 Glenn Morris <rgm@gnu.org>
909
910 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
911 (Fwrite_region): Update for new choose_write_coding_system args.
912 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
913 (syms_of_fileio): Add choose-write-coding-system.
914
3f82a88a 9152013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
916
917 * w32.c (sys_open): Zero out the flags for the new file descriptor.
918 (sys_close): Zero out the flags for the file descriptor before
919 closing it. (Bug#13546)
920
806fed21 921 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
922 (logon_network_drive, stat_worker, symlink, chase_symlinks):
923 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
924 DBCS. (Bug#13553)
925
6ee4509a
EZ
926 * w32.c (w32_get_long_filename, init_environment, readlink):
927 Support file names encoded in DBCS codepages.
26854e9c
EZ
928 (readlink): Use the current file-name-coding-system, not the ANSI
929 codepage, to decode and handle targets of symlinks.
6ee4509a 930
cf01a359
EZ
9312013-01-28 Eli Zaretskii <eliz@gnu.org>
932
933 * w32.c (opendir): Now accepts a 'const char *'.
934
6fd326b7
DA
9352013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
936
937 Remove obsolete redisplay code. See the discussion at
938 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
939 * dispnew.c (preemption_period, preemption_next_check): Remove.
940 (Vredisplay_preemption_period): Likewise.
941 (update_frame, update_single_window, update_window, update_frame_1):
942 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
943 used, following the 2012-06-22 change.
944
d8cd7742
EZ
9452013-01-25 Eli Zaretskii <eliz@gnu.org>
946
947 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
948
266fee4f
DA
9492013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
950
951 * font.c (num_fonts): Remove the leftover from old
952 debugging code. Adjust comment style here and there.
59e624b3
DA
953 * insdel.c (insert_1): Remove.
954 * lisp.h (insert_1): Remove prototype.
955 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 956
830e46e6 9572013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
958
959 * w32.c (max_filename_mbslen): New function.
960 (normalize_filename, readdir): Use it to detect locales where ANSI
961 encoding of file names uses a double-byte character set (DBCS).
962 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
963 CharNextExA, instead of incrementing a 'char *' pointer.
964 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 965
81abbb95
EZ
966 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
967 request of memory reservation to 1.7GB. (Bug#13065)
968
830e46e6 9692013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
970
971 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
972 at check_extra_latin label. (Bug#13505)
973
fd3ceb09
DA
9742013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
975
976 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
977 Avoid redundant calls to strlen.
978
edfa7fa0
DA
9792013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
980
981 Drop async_visible and async_iconified fields of struct frame.
982 This is possible because async input is gone; for details, see
983 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
984 * frame.h (struct frame): Remove async_visible and async_iconified
985 members, convert garbaged to unsigned bitfield. Adjust comments.
986 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
987 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
988 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
989 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
990 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
991 * w32term.c: Ditto.
992 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
993 properly. Likewise for obscured.
994 * xterm.c: Ditto.
266fee4f 995 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
996 properly.
997 * nsterm.m: Ditto.
998 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
999
5ad86e34
DA
10002013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1001
1002 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1003 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1004
b09cca6a
SM
10052013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1006
1007 * xdisp.c (message2, message2_nolog): Remove functions.
1008 (message3, message3_nolog): Extract nbytes and multibyteness directly
1009 from the string. Change all callers.
1010 (message3_nolog): Don't set message_enable_multibyte since set_message
1011 will reset it anyway.
1012 (message1, message1_nolog): Use message3.
1013 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1014 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1015 (set_message): Drop all but the second arg, which has to be a string.
1016 (set_message_1): Simplify now that we know that a1 is NULL and the
1017 second arg is a string.
1018 * frame.h (struct frame): Remove `message_buf' field.
1019 Use glyphs_initialized_p instead.
1020 (FRAME_MESSAGE_BUF): Remove macro.
1021 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1022 * lisp.h (message2, message2_nolog): Remove declarations.
1023 (message3, message3_nolog): Update declarations.
1024 * keyboard.c (read_char_minibuf_menu_text)
1025 (read_char_minibuf_menu_width): Remove vars.
1026 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1027 to correctly handle multibyte strings.
1028 * frame.c (delete_frame): Don't free message_buf any more.
1029 * editfns.c (message_text, message_length): Remove vars.
1030 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1031 * fileio.c (auto_save_error): Use message3 instead of message2.
1032 * dispnew.c (adjust_frame_message_buffer): Remove function.
1033
54ab1c5a
EZ
10342013-01-23 Eli Zaretskii <eliz@gnu.org>
1035
1036 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1037 real estate used for the tool bar and the menu bar.
1038
6c27465b
DA
10392013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1040
1041 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1042 hidden buffer is prepared to modification (Bug#13164).
1043
9d93ce29
DA
10442013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1045
1046 * window.h (struct window): Change window_end_valid member from
1047 Lisp_Object to a bitfield. Adjust comments.
1048 (wset_window_end_valid): Remove.
1049 * window.c (adjust_window_count): Clear window_end_valid.
1050 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1051 (Fwindow_line_height, set_window_buffer, Frecenter)
1052 (Fsplit_window_internal, Fdelete_other_windows_internal)
1053 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1054 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1055 * xdisp.c (check_window_end, reconsider_clip_changes)
1056 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1057 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1058 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1059
1dcb8ea2
DA
10602013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1061
1062 * xdisp.c (mark_window_display_accurate): Simplify the loop
1063 assuming that the only one of vchild, hchild or buffer window
1064 slots is non-nil. Call mark_window_display_accurate_1 for
1065 the leaf windows only.
1066 (mark_window_display_accurate_1): Always assume leaf window.
1067 Adjust comment.
1068
b41b8a7e
PE
10692013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1070
593a5f2e
PE
1071 * emacs.c (Qkill_emacs_hook): Now static.
1072
b41b8a7e
PE
1073 * fileio.c (Finsert_file_contents): Simplify.
1074 Remove unnecessary assignments and tests.
1075
84e5ed96
EZ
10762013-01-21 Eli Zaretskii <eliz@gnu.org>
1077
1078 * w32.c (acl_set_file): Don't test for errors unless
1079 set_file_security returns FALSE. Avoids spurious errors when
1080 saving files.
1081
2ef88fd4
DA
10822013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1083
1084 * fileio.c (Finsert_file_contents): Revert code introduced at
1085 2013-01-18 in favor of the simpler and generally better fix.
1086 Save stack space by removing 'buffer' and reusing 'read_buf'
1087 where appropriate.
1088
d7a0a7c9
PE
10892013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1090
1091 * lisp.h (eabs): Define unconditionally (Bug#13419).
1092 The old "#if !defined (eabs)" was an unnecessary revenant of back
1093 when this macro was called "abs". Document 'eabs' better.
1094
795e7a5b 10952013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
1096
1097 * fns.c (Frandom): Doc fix.
1098
59ac2d13
EZ
10992013-01-19 Eli Zaretskii <eliz@gnu.org>
1100
1101 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1102 segfault when there are lots of overlays.
1103
1104 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
1105 when there are lots of overlays.
1106 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
1107 for the details and a way to reproduce.
1108
b3fbb395
PE
11092013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1110
3a955a1f
PE
1111 * fileio.c: Use O_APPEND to append.
1112 This corresponds better to the natural interpretation of "append",
1113 and avoids the need to open the output file twice, or to invoke
1114 lseek when APPEND is neither nil nor a number.
1115 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1116 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1117 file possibly twice, and lseeking to its end; this avoids the
1118 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1119 at the same time: the combination is never needed and apparently
1120 it doesn't work with DOS_NT.
1121
21cd50b8
PE
1122 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1123 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1124
b3fbb395
PE
1125 Allow floating-point file offsets.
1126 Problem reported by Vitalie Spinu in
1127 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1128 * fileio.c (emacs_lseek): Remove.
1129 (file_offset): New function.
1130 (Finsert_file_contents, Fwrite_region): Use it.
1131
73c14218
CY
11322013-01-19 Chong Yidong <cyd@gnu.org>
1133
1134 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1135 aborting on Fsignal (Bug#13289).
1136
6a9465f3
EZ
11372013-01-19 Eli Zaretskii <eliz@gnu.org>
1138
1139 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1140 set_file_security as failure due to insufficient privileges.
1141 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 1142 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 1143
fa705c99
PE
11442013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1145
9fe43ff6
PE
1146 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1147 The bug was observed on Ubuntu operating inside a virtual machine,
1148 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1149 The workaround introduces a race condition on non-buggy hosts,
1150 but it's an unlikely race and anyway there's a nearly identical
1151 nearby race that can't be fixed.
1152 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1153 New static vars.
1154 (Fwrite_region): Test for file system time stamp bug.
1155 (init_fileio): New function.
1156 * lisp.h (init_fileio): Declare it.
1157 * emacs.c (main): Call it.
1158
fa705c99
PE
1159 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1160 and make it more consistent with other stat-failure diagnostics.
1161
e07469fa
DA
11622013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1163
99d0d6dc
SM
1164 Fix crash when inserting data from non-regular files.
1165 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
1166 for the error description produced by valgrind.
1167 * fileio.c (read_non_regular): Rename to read_contents.
1168 Free Lisp_Save_Value object used to pass parameters.
1169 (read_non_regular_quit): Rename to read_contents_quit.
1170 (Finsert_file_contents): Redesign internal file reading loop to adjust
1171 gap and end positions after each read and so help make_gap to work
1172 properly. Do not signal an I/O error too early and so do not leave
1173 not yet decoded characters in a buffer, which was the reason of
1174 redisplay crash. Use list2 to build return value. Adjust comments.
1175
67722112
PE
11762013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1177
1178 Close a race when statting and reading files (Bug#13149).
1179 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1180 This avoids a race if the file is renamed between stat and open.
1181 This race is not the problem originally noted in Bug#13149;
1182 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1183
468afbac
DA
11842013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1185
1186 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1187 objects, related functions and macros.
1188 (make_save_value): Adjust prototype.
1189 (make_save_pointer): New prototype.
1190 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1191 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1192 * alloc.c (format_save_value): Rename to make_save_value.
1193 (make_save_pointer): New function.
1194 (record_xmalloc): Use make_save_pointer.
1195 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1196 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1197 Change users of make_save_value to make_save_pointer.
1198 Likewise for format_save_value and make_save_value.
1199
0e70695a
DA
12002013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1201
1202 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1203 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1204 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1205 debugging stubs.
1206
963ea40f
PE
12072013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1208
1209 * alloc.c (free_save_value): Now static.
1210
3346c1d0
DA
12112013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1212
1213 * keymap.c (map_keymap_internal): Use format_save_value.
1214 (map_keymap_char_table_item): Adjust accordingly.
1215 * fileio.c (non_regular_fd, non_regular_inserted)
1216 (non_regular_nbytes): Remove.
99d0d6dc
SM
1217 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1218 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
1219 (read_non_regular): Use XSAVE_ macros to extract parameters.
1220 Adjust comment.
1221 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1222 format_save_value.
1223 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1224
2b30549c
DA
12252013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1226
1227 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1228 extraction from any Lisp_Save_Value slot. Add type checking.
1229 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1230 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1231 * xselect.c: All users changed.
1232
1b971ac1
DA
12332013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1234
1235 Some convenient bits to deal with Lisp_Save_Values.
1236 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1237 (allocate_misc): Remove prototype.
1238 (format_save_value): New prototype.
1239 * alloc.c (allocate_misc): Revert back to static.
1240 (format_save_value): New function to build Lisp_Save_Value
1241 object with the specified internal structure.
1242 (make_save_value): Reimplement using format_save_value.
1243 * editfns.c (save_excursion_save): Use format_save_value.
1244 (save_excursion_restore): Use XSAVE_OBJECT.
1245
c50cf2ea
PE
12462013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1247
1248 Avoid needless casts with XSAVE_POINTER.
1249 * alloc.c (mark_object) [GC_MARK_STACK]:
1250 * dired.c (directory_files_internal_unwind):
1251 * fileio.c (do_auto_save_unwind):
1252 * gtkutil.c (pop_down_dialog):
1253 * keymap.c (map_keymap_char_table_item):
1254 * lread.c (load_unwind):
1255 * nsmenu.m (pop_down_menu):
1256 * print.c (print_object) [GC_MARK_STACK]:
1257 * xfns.c (clean_up_file_dialog):
1258 * xmenu.c (cleanup_widget_value_tree):
1259 Omit casts between XSAVE_POINTER and a pointer type.
1260
9d5a1260
DA
12612013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1262
1263 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1264 * eval.c (eval_sub): Protect `form' from being GCed before its
1265 car and cdr becomes protected with the backtrace entry.
1266
73ebd38f
DA
12672013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1268
1269 Make Lisp_Save_Value more versatile storage for up to four objects.
1270 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1271 (struct Lisp_Save_Value): New layout. Adjust comments.
1272 (XSAVE_POINTER): New macro.
1273 (XSAVE_INTEGER): Likewise.
1274 (allocate_misc): Add prototype.
1275 (free_misc): Likewise.
1276 * alloc.c (allocate_misc): Now global.
1277 (free_misc): Likewise. Adjust comment.
1278 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1279 (free_save_value): Likewise.
1280 (mark_object): Likewise.
1281 * editfns.c (save_excursion_save): Pack everything within
1282 Lisp_Save_Value and so avoid xmalloc.
1283 (save_excursion_restore): Adjust to match new layout. Use free_misc
1284 because we do not allocate extra memory any more. Add eassert.
1285 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1286 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1287 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1288 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1289 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1290
b826986f
JD
12912013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1292
1293 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1294 (nsfont_draw): Remove disabling of LCD smoothing.
1295 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 1296 Bug#11484 with LCD smoothing on.
b826986f 1297
c0511b57 12982013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 1299
b6f960a0
PE
1300 Fix SIGDANGER handlers, for AIX (Bug#13408).
1301 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1302 Move handlers here from emacs.c; they were out of place.
1303
616763d5
JD
13042013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1305
1306 * xterm.c (syms_of_xterm): Adjust documentation for
1307 scroll-bar-adjust-thumb-portion.
1308
0b59090b 13092012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
1310
1311 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1312 determine whether scroll bar thumb size should be adjusted or
1313 not. Use variable for MOTIF.
1314
1315 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1316 GTK.
1317
7bc916b4
JD
13182013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1319
eac4d08f
JD
1320 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1321 event is generated.
1322 (doCommandBySelector:): Set processingCompose to NO.
1323
7bc916b4
JD
1324 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1325 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1326 (nsfont_list_family): Add block/unblock_input calls.
1327 (nsfont_open): Move block_input earlier. Add unblock_input before early
1328 return.
1329 (nsfont_draw): Add block/unblock_input calls.
1330
bdc9b756
PE
13312013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1332
1333 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1334 for old_charpos and old_bytepos.
1335
ee56a6dc
PE
13362013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1337
1338 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1339 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1340 Clear tzvalbuf_in_environ if this workaround is in effect.
1341 Problem and fix reported by Kazuhiro Ito.
1342
9fc9a531
AH
13432013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1344
99d0d6dc
SM
1345 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1346 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
1347
1348 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1349 doc string cross-reference(s).
1350
1351 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1352 string cross-reference(s).
1353
6020559a
DA
13542013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1355
1356 Avoid unnecessary byte position calculation for the gap movement.
1357 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1358 anyway, all of them should use move_gap_both instead.
1359 * lisp.h (move_gap): Remove prototype.
1360 * insdel.c (move_gap): Remove.
1361 (move_gap_both): Add eassert.
1362 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1363 * xml.c (parse_region): Likewise.
1364
b8956427
PE
13652013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1366
1367 emacsclient -t should not suspend Emacs server (Bug#13387)
1368 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1369 New functions.
1370 * term.c (init_tty): Use them instead of rolling our own code.
1371 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1372 switches from 'signal' to 'pthread_sigmask', which is safer in
1373 multithreaded applications.
1374 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1375 which has already arranged for that.
1376 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1377 This is the main part of the bug fix.
1378
0b59090b 13792013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
1380
1381 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1382 x_last_font_name (Bug#13403).
1383
58cc0a01
DA
13842013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1385
1386 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1387 the type of per-buffer values where appropriate.
1388 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1389 predicate, which is how it's really used now. Adjust comment.
1390 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1391 * buffer.c (buffer_slot_type_mismatch): Remove.
1392 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1393 predicate. Adjust comment.
1394 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1395 fill-column, left-margin, tab-width, buffer-saved-size,
1396 left-margin-width, right-margin-width, left-fringe-width,
1397 right-fringe-width, scroll-bar-width and buffer-display-count.
1398 Use Qstringp for default-directory, buffer-file-name,
1399 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1400 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1401 line-spacing.
1402 * data.c (store_symval_forwarding): Adjust to call the predicate.
1403
5104861e
JB
14042013-01-09 Juanma Barranquero <lekktu@gmail.com>
1405
1406 * w32.c (get_name_and_id, acl_set_file):
1407 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1408
eefd7278
DA
14092013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1410
1411 * lisp.h (make_gap_1): New prototype.
1412 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1413 gap size values.
1414 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1415 naming convention.
1416 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 1417 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
1418 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1419 (make_gap_1): New function to adjust the gap of any buffer.
1420 * coding.c (coding_alloc_by_making_gap): Use it.
1421 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1422 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1423
073ca75b
JL
14242013-01-08 Juri Linkov <juri@jurta.org>
1425
1426 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1427 of (supports :underline (:style wave)). (Bug#13000)
1428
3bace969
AH
14292013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1430
1431 * undo.c (Fprimitive_undo): Move to simple.el.
1432 (syms_of_undo): Remove declarations for Sprimitive_undo.
1433
63a63bd4
SM
14342013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1435
1436 * keyboard.c (echo_add_key): Rename from echo_add_char.
1437
56ed110a
CY
14382013-01-06 Chong Yidong <cyd@gnu.org>
1439
1440 * keyboard.c (echo_add_char): New function, factored out from
1441 echo_char. Don't add a space if the previous echo string was
1442 empty (Bug#13255).
1443 (echo_char): Use it.
1444 (read_key_sequence): When echoing mock input, ensure that the
1445 trailing dash is properly added.
1446
b630991b
EZ
14472013-01-05 Eli Zaretskii <eliz@gnu.org>
1448
1449 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1450 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
1451 digits for buffer positions, before misalignment starts.
1452 Display "0" for integer "object" field.
b630991b
EZ
1453 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1454 Display the newline glyph more unambiguously.
1455
f032a318
YM
14562013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1457
1458 * nsterm.m (ns_draw_underwave):
1459 * w32term.c (w32_draw_underwave):
1460 * xterm.c (x_draw_underwave): Make underwave look more triangular
1461 and also degrade gracefully for small fonts. (Bug#13000)
1462
4240dd3c
YM
1463 * nsterm.m (ns_draw_text_decoration):
1464 * w32term.c (x_draw_glyph_string):
1465 * xterm.c (x_draw_glyph_string): Don't use previous underline
1466 thickness and position if previous underline type is underwave.
1467
553081a5
SM
14682013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1469
1470 * fileio.c (Ffile_acl): Undocument return format.
1471
9539d465 14722013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
1473
1474 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1475
71376d4b
PE
14762013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1477
1478 Simplify via eabs.
1479 * dired.c (file_name_completion):
1480 * doc.c (get_doc_string):
1481 * floatfns.c (round2):
1482 * font.c (font_score, font_delete_unmatched):
1483 * fringe.c (compute_fringe_widths):
1484 * lread.c (read_list):
1485 * minibuf.c (Ftry_completion):
1486 * term.c (tty_ins_del_lines):
1487 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1488 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1489
a7f11948
EZ
14902012-12-31 Eli Zaretskii <eliz@gnu.org>
1491
1492 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
1493 correctly.
1494 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
1495 for the bug this caused.
1496
84cc1ab6
PE
14972012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1498
1499 * coding.c (Qmac): Now static.
1500
5a1d858b
JD
15012012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1502
1503 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1504 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1505 handlebox_widget. Set toolbar_in_hbox to false/true, set
1506 toolbar_is_packed to true.
1507 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1508 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1509 Show all on TOOLBAR_TOP_WIDGET.
1510 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1511 by TOOLBAR_TOP_WIDGET.
1512 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1513 Check toolbar_is_packed.
8b745d92
JD
1514 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1515 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1516 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1517 false.
1518 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1519 (xg_update_menubar): Update title only if
1520 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1521 (xg_update_submenu): Skip tearoff only if
1522 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1523 (xg_initialize): Initialize xg_detached_menus only if
1524 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
1525
1526 * xterm.h (struct x_output): Surround handlebox_widget with
1527 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1528 toolbar_in_hbox is bool.
1529
d5e5e7b4 15302012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
1531
1532 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1533 (LIBS_GNUSTEP): Define.
1534 (LIBES): Add $(LIBS_GNUSTEP).
1535 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1536
d5e5e7b4 15372012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
1538
1539 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1540 continuation glyph on a TTY with an indication of an empty line.
1541 (Bug#13277)
1542
e7ae8039
EZ
15432012-12-29 Eli Zaretskii <eliz@gnu.org>
1544
ccad023b
EZ
1545 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1546 file's SELinux context or ACLs successfully set, nil otherwise.
1547 (Bug#13298)
8d23a331 1548 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 1549
e7ae8039
EZ
1550 * w32proc.c (reader_thread): Avoid passing NULL handles to
1551 SetEvent and WaitForSingleObject.
1552
7456e13f
PE
15532012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1554
1555 Port EXTERNALLY_VISIBLE to Clang 3.2.
1556 * conf_post.h (__has_attribute): New macro.
1557 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1558
1ab0c851
GM
15592012-12-27 Glenn Morris <rgm@gnu.org>
1560
1561 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1562 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1563
82e2a1f0 15642012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 1565
63a63bd4
SM
1566 * fileio.c (file_name_as_directory, directory_file_name):
1567 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
1568 came from a multibyte or a unibyte Lisp string; all callers
1569 adjusted. Don't assume the input string is always multibyte.
1570 (Bug#13262)
1571 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1572 don't ENCODE_FILE them, and return a unibyte string if the input
1573 was unibyte.
1574 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1575 don't assume the input strings will always be multibyte. If the
1576 input strings are multibyte, decode strings obtained from C
1577 library functions.
1578
8847a0de
DA
15792012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1580
1581 * lisp.h (toplevel): Add two notices to the comment about
1582 defining a new Lisp data type.
6cda572a
DA
1583 * print.c (print_object): If Lisp_Save_Value object's pointer
1584 is the address of a memory area containing Lisp_Objects, try
1585 to print them.
1586 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 1587
4b298d5a
DA
15882012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1589
1590 * keyboard.c (record_asynch_buffer_change): Initialize an event
1591 only if it's really needed.
1592 * frame.h (enum output_method): Remove output_mac member since
1593 it's a leftover from the deleted code.
1594 * frame.c (Fframep): Adjust user here ...
1595 * terminal.c (Fterminal_live_p): ... and here.
1596 * coding.c (Qmac): Now here because it's only used to denote
1597 end-of-line encoding type.
1598 (syms_of_coding): DEFSYM it.
1599 * frame.h (Qmac): Remove duplicated declaration.
1600
12384b01
PE
16012012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1602
1603 * window.c (select_window_1): Now static, since it's used only here.
1604
f1665bdc
EZ
16052012-12-25 Eli Zaretskii <eliz@gnu.org>
1606
1607 * window.c (window_body_cols): Subtract display margins from the
1608 window body width on TTYs as well. See
1609 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1610 for the original report.
1611
9a0d4f34
DA
16122012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1613
1614 * xdisp.c (redisplay_window): Remove inner local variable
1615 because the outer shadowed one has the same meaning.
cd78d9b1
DA
1616 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1617 set but never used.
1618 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1619 (xg_create_tool_bar): Adjust users.
9a0d4f34 1620
f9e7c67e
DA
16212012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1622
1623 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1624 * buffer.c (Fget_buffer_create): Use it to set compact field of
1625 struct buffer_text to avoid accessing an uninitialized value
1626 when compact_buffer is called for the first time.
1627 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
1628 (Fset_buffer_modified_p): Use buffer_window_count to check
1629 whether the buffer is displayed in some window.
1630 * xdisp.c (message_dolog): Likewise.
f9e7c67e 1631
299614f3
EZ
16322012-12-23 Eli Zaretskii <eliz@gnu.org>
1633
40ff07a5
EZ
1634 * w32.c (acl_set_file): If setting the file security descriptor
1635 fails, and the new DACL is identical to the existing one, silently
1636 return success. This fixes problems for users backing up their
1637 own files without having the necessary privileges for setting
1638 security descriptors.
1639
299614f3
EZ
1640 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1641 values.
1642 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1643 after WaitForSingleObject returns normally. This expedites reader
1644 thread shutdown when delete_child triggers it.
1645 (reap_subprocess): More accurate commentary for why we call
1646 delete_child only when cp->fd is negative.
1647
1648 * w32.c (sys_close): Do not call delete_child on a subprocess
1649 whose handle is not yet closed. Instead, set its file descriptor
1650 to a negative value, so that reap_subprocess will call
63a63bd4
SM
1651 delete_child on that subprocess when its SIGCHLD arrives.
1652 This avoids closing handles used for communications between sys_select
299614f3
EZ
1653 and reader_thread, which doesn't give sys_select a chance to
1654 notice that the process exited and invoke the SIGCHLD handler for
1655 it.
1656
cf162aee
JD
16572012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1658
1659 * nsfns.m (Fns_do_applescript): Run event loop until script has
1660 been executed (Bug#12969).
1661 (ns_run_ascript): Chech as_script for nil, set to nil after
1662 executing script.
1663
94900bfe
MR
16642012-12-22 Martin Rudalics <rudalics@gmx.at>
1665
1666 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1667
b2faf49c
EZ
16682012-12-22 Eli Zaretskii <eliz@gnu.org>
1669
1670 * w32term.c (w32fullscreen_hook): New function.
1671 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1672
7efa3fb3
EZ
16732012-12-21 Eli Zaretskii <eliz@gnu.org>
1674
bb085aed
EZ
1675 * fileio.c (Finsert_file_contents): Doc fix.
1676
7efa3fb3
EZ
1677 * w32proc.c (new_child, delete_child, find_child_pid): For a
1678 subprocess, consider its slot being in use as long as its process
1679 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1680 slot when a new process is started immediately after killing
1681 another one, without waiting enough time for the first process to
1682 be reaped and resources allocated for it be orderly freed.
1683 (Bug#13086)
1684 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1685
c1f02afa
CY
16862012-12-21 Chong Yidong <cyd@gnu.org>
1687
1688 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1689
5bec25eb
CY
1690 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1691
a4b0cca1 16922012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
1693
1694 * w32.c (get_name_and_id): Always pass NULL as the first argument
1695 of lookup_account_sid. Avoids crashes with UNC file names that
1696 refer to DFS domains, not to specific machine names. (Bug#12621)
1697 Remove now unused argument FNAME; all callers changed.
1698 (get_file_owner_and_group): Remove now unused argument FNAME; all
1699 callers changed.
1700
34b4b7eb
CY
17012012-12-21 Chong Yidong <cyd@gnu.org>
1702
1703 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1704 error for invalid chars, don't check for a nil return value.
1705
13002885
DA
17062012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1707
1708 Avoid calls to CHAR_TO_BYTE if byte position is known.
1709 * editfns.c (make_buffer_string_both): Use move_gap_both.
1710 (Fbuffer_string): Use make_buffer_string_both.
1711 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1712 Adjust comment.
1713 (buf_bytepos_to_charpos): Likewise.
1714 (charpos_to_bytepos): Remove.
1715 * fileio.c (Finsert_file_contents): Use move_gap_both.
1716 * search.c (Freplace_match): Likewise.
9a0d4f34 1717 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
1718 names for byte positions.
1719 * lisp.h (charpos_to_bytepos): Remove prototype.
1720 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1721 * insdel.c (move_gap): Likewise.
1722
99e9311c
PE
17232012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1724
1725 * xdisp.c (redisplay_internal): Remove now-unused local.
1726
e02230bf
SM
17272012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1728
1729 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1730 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 1731 proper value of frame-local variables (bug#13225).
e02230bf 1732
1687fb14
DA
17332012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1734
1735 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1736 Rename 4th argument since it may be buffer or string. Adjust comment.
1737 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1738
a2f07cd2
DA
17392012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1740
1741 * coding.c (Fdetect_coding_region): Do not check start and end with
1742 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1743 (code_convert_region): Likewise.
1744
474d441e
EZ
17452012-12-18 Eli Zaretskii <eliz@gnu.org>
1746
1747 * w32.c (acl_get_file, acl_set_file): Run the file name through
1748 map_w32_filename, and resolve any symlinks in the file name, like
1749 Posix platforms do.
1750 (acl_set_file): Call revert_to_self, if any privileges were
1751 enabled.
1752
8725c076
JB
17532012-12-17 Juanma Barranquero <lekktu@gmail.com>
1754
1755 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1756 ($(BLD)/w32.$(O)): Update dependencies.
1757
1e101a4b
SM
17582012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1759
1760 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1761 propagate redisplay's scrolling (if any) to the right window.
1762 (redisplay_internal): Use ensure_selected_frame.
1763 (display_mode_lines): Complete last fix.
1764 * window.c (select_window_1): New func, extracted from select_window.
1765 (select_window): Use it.
1766 * window.h (select_window_1): Declare.
1767
66447e07
EZ
17682012-12-17 Eli Zaretskii <eliz@gnu.org>
1769
1770 Emulate Posix ACL APIs on MS-Windows.
1771 * w32.c: Include sddl.h and sys/acl.h.
1772 (SDDL_REVISION_1): Define if not already defined.
1773 (g_b_init_get_security_descriptor_dacl)
1774 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1775 (g_b_init_is_valid_security_descriptor)
1776 (g_b_init_set_file_security): New static flags.
1777 (globals_of_w32): Initialize them to zero.
1778 (SetFileSecurity_Name): New string constant.
1779 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1780 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1781 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1782 (IsValidSecurityDescriptor_Proc): New typedefs.
1783 (get_file_security, get_security_descriptor_owner)
1784 (get_security_descriptor_group): Set errno to ENOTSUP.
1785 (set_file_security, get_security_descriptor_dacl)
1786 (is_valid_security_descriptor, convert_sd_to_sddl)
1787 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1788 (acl_free, acl_get_file, acl_set_file): New functions.
1789
1790 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1791
207a7ef0
PE
17922012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1793
1794 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1795 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1796 for some of that bug's symptoms can now cause Emacs to abort.
1797 Remove the workaround.
1798 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1799 The bug that caused SIGCHLD to get lost has been fixed, and the
1800 workaround for it can now cause Emacs to abort.
1801
17fdfc15
PE
18022012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1803
1804 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1805 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1806 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1807
7c3d167f
RF
18082012-12-16 Romain Francoise <romain@orebokech.com>
1809
1810 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1811 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 1812 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
1813 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1814
1815 * Makefile.in (LIBACL_LIBS): New macro.
1816 (LIBES): Use it.
1817
7d80ea23
PE
18182012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1819
1820 * fileio.c (internal_delete_file): Use bool for boolean.
1821
b0728617
EZ
18222012-12-15 Eli Zaretskii <eliz@gnu.org>
1823
1824 Fix bug #13079 on MS-Windows with temp files not being deleted.
1825 * w32.h (_child_process): New members input_file and
1826 pending_deletion.
1827 (register_child): First argument is now pid_t.
1828 (record_infile, record_pending_deletion): New prototypes.
1829
1830 * w32proc.c (new_child): Initialize input_file and
1831 pending_deletion members of the child.
1832 (delete_child): Delete the child's temporary input file, if any,
1833 that is pending deletion.
1834 (register_child): First argument is now pid_t.
1835 (record_infile, record_pending_deletion): New functions.
1836 (reap_subprocess): Fix a typo in DebPrint string.
1837 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1838
1839 * fileio.c (internal_delete_file): Return an int again: non-zero
1840 if delete-file succeeds, zero otherwise.
1841
1842 * lisp.h (internal_delete_file): Adjust prototype.
1843
1844 * callproc.c (Fcall_process): Don't overwrite infile with result
1845 of DECODE_FILE.
1846 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1847 asynchronous subprocess, record the name of the input file name,
1848 if any.
1849 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1850 delete the file, record it as pending deletion when the subprocess
1851 exits.
1852
7e90af26
EZ
18532012-12-14 Eli Zaretskii <eliz@gnu.org>
1854
1855 * editfns.c [HAVE_PWD_H]: Include grp.h.
1856
1857 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1858
97976f9f
PE
18592012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1860
1861 Fix permissions bugs with setgid directories etc. (Bug#13125)
1862 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1863 to mark it as a placeholder. The old value was often wrong.
1864 The only user of this attribute has been changed to use
1865 file-ownership-preserved-p instead, with its new group arg.
1866 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1867
26ec1f49
SM
18682012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1869
ad966fe7
SM
1870 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1871 Keep selected_window and selected_frame in sync.
26ec1f49 1872
5c207910
EZ
18732012-12-14 Eli Zaretskii <eliz@gnu.org>
1874
1875 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1876 try to get accurate owner and group information from NT file
1877 security APIs. This is to make most callers of 'stat' and
1878 'lstat', which don't need that information, much faster.
1879
26ec1f49
SM
1880 * dired.c (Ffile_attributes) [WINDOWSNT]:
1881 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
1882 owner and group information from 'lstat'.
1883
893f52d8
PE
18842012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1885
4c95c9a5
PE
1886 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1887 as that confuses set-auto-coding, so insist on the head-read
1888 returning the full 1024 bytes. Let lseek compute the tail offset;
1889 less work for us. Do not ignore I/O errors when reading the tail.
1890
893f52d8
PE
1891 * xdisp.c: Minor style fixes.
1892 (init_iterator): Hoist assignment out of if-expression.
1893 (markpos_of_region): Callers now test for sign, not for -1.
1894
40d1e434
DA
18952012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1896
1897 Minor redisplay optimization when the region length is zero.
1898 * xdisp.c (markpos_of_region): New function.
1899 (init_iterator): Do not highlight the region of zero length.
1900 (redisplay_window): Check whether the region is of non-zero length.
1901 (try_cursor_movement): Allow if the region length is zero.
1902 (try_window_reusing_current_matrix, try_window_id): Likewise.
1903
727f9739 19042012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
1905
1906 * search.c (search_buffer): Check the inverse translations of each
1907 character in pattern when the buffer being searched is unibyte.
1908 (Bug#13084)
1909
727f9739 19102012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
1911
1912 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1913 files, fixing a regression from 24.2.
645c6a30 1914 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 1915
d20704ef
PE
19162012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1917
1918 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1919 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1920 Remove unnecessary S_ISLNK test, as (contra the comments) this
1921 function can't copy symlinks. Improve quality of error message
1922 when attempting to copy files that are neither regular files nor
1923 directories.
1924
2dd61a9b
DA
19252012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1926
1927 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1928 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1929 * window.c (Frecenter):
1930 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1931 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1932
cc98b684
DC
19332012-12-12 Daniel Colascione <dancol@dancol.org>
1934
1e101a4b 1935 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
1936 the dumped Emacs is not a sparse file, greatly improving Cygwin
1937 "make bootstrap" performance.
1938
38e791fd
MA
19392012-12-11 Michael Albinus <michael.albinus@gmx.de>
1940
1941 * inotify.c (inotify_callback): Generate an Emacs event for every
1942 incoming inotify event.
1943
f9d1448f
EZ
19442012-12-11 Eli Zaretskii <eliz@gnu.org>
1945
1946 * xdisp.c (handle_face_prop): Fix logic of computing
1947 it->start_of_box_run_p.
1948 (append_space_for_newline): If the glyph row is R2L, reset the
1949 iterator's end_of_box_run_p flag before prepending the space glyph.
1950 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1951 iterator's start_of_box_run_p flag before prepending the stretch.
1952 (append_glyph, produce_image_glyph, append_composite_glyph)
1953 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1954 left_box_line_p and right_box_line_p flags of the glyph for R2L
1955 glyph rows. (Bug#13011)
1956
c6afe371
DA
19572012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1958
1959 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1960 if changed buffer is not shown in a window.
1961 * insdel.c (prepare_to_modify_buffer): Likewise.
1962 * window.c (replace_buffer_in_windows_safely): Do nothing
1963 if buffer is not shown in a window.
1964 (Fforce_window_update): Likewise if string or buffer argument
1965 is passed.
1966
1b47babd
EZ
19672012-12-11 Eli Zaretskii <eliz@gnu.org>
1968
1969 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1970 encoded_file_name, which is what it is.
1971
4c1acb95
DA
19722012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1973
1974 Consistently use marker_position and marker_byte_position.
1975 * fringe.c (Ffringe_bitmaps_at_pos):
1976 * indent.c (Fvertical_motion):
1977 * insdel.c (prepare_to_modify_buffer):
1978 * keyboard.c (make_lispy_position):
1979 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1980 (window_scroll_pixel_based, displayed_window_lines)
1981 (Fset_window_configuration):
1982 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1983 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1984 Replace direct access to marker fields with calls
1985 to marker_position and/or marker_byte_position.
1986
0eeb69fe
JB
19872012-12-11 Juanma Barranquero <lekktu@gmail.com>
1988
1989 * makefile.w32-in (SIG2STR_H): New macro.
1990 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1991 ($(BLD)/w32notify.$(O)): Update dependencies.
1992
1cf1bbd5
DC
19932012-12-10 Daniel Colascione <dancol@dancol.org>
1994
8db4b52f
DC
1995 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1996 Windows file notification functionality unless WINDOWSNT.
1997
1cf1bbd5
DC
1998 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1999 declarations.
2000
2001 * w32fns.c (cache_system_info): Initialize the global hinst
2002 variable here so various initialization calls DTRT.
2003
1e101a4b 2004 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
2005 (hinst): Remove unneeded extern declaration.
2006 (_start): Remove initialization of above variables; remove
2007 initialization of hinst, as cache_system_info now does that.
2008
2009 * emacs.c (main): Call cache_system_info early in startup; we
2010 previously weren't calling it in Cygwin builds.
2011
26ec1f49
SM
2012 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2013 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
2014 and link it to Emacs.
2015
98a07056
DA
20162012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2017
2018 Per-buffer window counters.
2019 * buffer.h (struct buffer): New member window_count.
2020 (buffer_window_count): New function.
2021 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2022 Initialize window_count.
2023 (Fkill_buffer): Verify window_count for the buffer being killed.
2024 (modify_overlay): Do not force redisplay if buffer is not shown
2025 in any window.
2026 (init_buffer_once): Initialize window_count for buffer_defaults
2027 and buffer_local_symbols.
2028 * window.h (buffer_shared): Remove declaration.
2029 (wset_buffer): Convert from inline ...
2030 * window.c (wset_buffer): ... to an ordinary function.
2031 (adjust_window_count): New function.
2032 (make_parent_window): Use it.
2033 * xdisp.c (buffer_shared): Remove.
2034 (redisplay_internal, redisplay_window): Adjust users.
2035 (buffer_shared_and_changed): Use per-buffer window counter.
2036
2b8c9064
EZ
20372012-12-10 Eli Zaretskii <eliz@gnu.org>
2038
2039 Support for filesystem notifications on MS-Windows.
2040 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2041 and this is a TTY frame, signal the caller that keyboard input is
2042 available.
2043
2044 * w32xfns.c (drain_message_queue): Now returns an int: an
2045 indication whether any WM_EMACS_FILENOTIFY messages were found in
2046 the queue.
2047
2048 * w32inevt.c (handle_file_notifications): New function.
2049 (w32_console_read_socket): Call it to process file notifications.
2050
2051 * w32console.c (initialize_w32_display): Record the main thread ID
2052 in dwMainThreadId.
2053
2054 * deps.mk (inotify.o): New dependency list.
2055
2056 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2057
2058 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2059 (WM_EMACS_END): Bump value by 1.
2060 (notification_buffer_in_use, file_notifications)
2061 (notifications_size, notifications_desc): Declare.
2062 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2063 Add prototypes.
2064
2065 * w32term.c (lispy_file_action, queue_notifications): New functions.
2066 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2067 <Qrenamed_to>: New symbols.
2068 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2069
2070 * w32notify.c: New file, implements file event notifications for
2071 MS-Windows.
2072
2073 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2074 by posting it to the w32_read_socket queue.
2075
1e101a4b 2076 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
2077
2078 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2079 (GLOBAL_SOURCES): Add w32notify.c
2080 ($(BLD)/w32notify.$(O)): New set of dependencies.
2081
2082 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2083
1e101a4b
SM
2084 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2085 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
2086 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2087 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2088 w32notify-handle-event by default.
2089
2090 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2091 syms_of_w32notify.
2092
81606b10
RS
20932012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2094
2b8c9064 2095 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 2096 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
2097
2098 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2099
2100 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2101 (syms_of_keyboard): DEFSYM it.
2102 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2103 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2104 Qfile_inotify events.
2105 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2106 special-event-map to inotify-handle-event.
2107
2108 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2109
2110 * Makefile.in (base_obj): Add inotify.o.
2111
2112 * inotify.c: New file.
2113
265c2fbf 21142012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
2115
2116 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2117
265c2fbf 21182012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
2119
2120 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2121 DWORD_PTR, for compatibility with 64-bit builds.
2122
a06ae17d 2123 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
2124 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2125 (system_process_attributes): Use SIZE_T rather than DWORD, for
2126 compatibility with 64-bit builds.
2127
265c2fbf 21282012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
2129
2130 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2131
265c2fbf 21322012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
2133
2134 * indent.c (Fvertical_motion): If a display string will be
2135 displayed on the left or the right margin, don't consider it as a
2136 factor in cursor positioning. (Bug#13108)
2137
265c2fbf 21382012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
2139
2140 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2141
5f460827
PE
21422012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2143
2144 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2145 for string length.
2146
a16e75cd
EZ
21472012-12-08 Eli Zaretskii <eliz@gnu.org>
2148
2149 * w32.c (unsetenv): Return 0 if the input string is too long.
2150
5745a7df
PE
21512012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2152
2153 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2154 * alloc.c (xputenv): New function.
2155 * dbusbind.c (Fdbus_init_bus):
2156 * emacs.c (main):
2157 * xterm.c (x_term_init):
2158 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2159 * editfns.c (initial_tz): Move static var decl up.
2160 (tzvalbuf_in_environ): New static var.
2161 (init_editfns): Initialize these two static vars.
2162 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2163 Save old TZ value on stack, if it's small.
2164 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2165 instead, use xputenv+unsetenv to set and restore TZ.
2166 (environbuf): Remove static var. All uses removed.
2167 (Fset_time_zone_rule): Do not save TZ and environ;
2168 no longer needed here.
2169 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2170 Move to inside set_time_zone_rule; they don't need file scope any more.
2171 (set_time_zone_rule): Maintain the TZ=value string separately.
2172 (syms_of_editfns): Don't initialize initial_tz;
2173 init_editfns now does it.
2174 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2175 * lisp.h (xputenv): New decl.
2176
c56efa40
FP
21772012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2178
2179 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2180
75ceee05
EZ
21812012-12-08 Eli Zaretskii <eliz@gnu.org>
2182
2183 * w32.c (unsetenv, sys_putenv): New functions.
2184
1b6dbfeb
CY
21852012-12-08 Chong Yidong <cyd@gnu.org>
2186
2187 * editfns.c (Finsert_char): Make the error message more
2188 informative (Bug#12992).
2189
d983a10b
PE
21902012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2191
7be78020
PE
2192 Simplify get_lim_data.
2193 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2194 Remove USG and vlimit methods; no longer used these days.
2195 Add #error catchall just in case.
2196
d983a10b
PE
2197 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2198 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2199 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2200 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2201 (deleted_pid_list, Fdelete_process, create_process)
2202 (record_child_status_change, handle_child_signal, deliver_child_signal)
2203 (init_process_emacs, syms_of_process):
2204 Assume SIGCHLD is defined.
2205 (parse_signal): Remove. All uses removed.
2206 (abbr_to_signal): New static function.
2207 (Fsignal_process): Use it to convert signal names to ints.
2208 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2209 kill (getpgrp (), ...).
2210 (emacs_sigaction_init): Assume SIGCHLD is defined.
2211 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2212 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2213 * syssignal.h (EMACS_KILLPG): Remove.
2214 All uses replaced by 'kill' with a negative pid.
2215 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2216 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2217
9cdde1e2
PE
22182012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2219
2220 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2221 This will cause a production Emacs to dump core instead of
2222 infinite-looping.
2223
822995f8
DA
22242012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 * frame.c (make_frame): Do not set window's buffer to t.
2227 * window.c (Fsplit_window_internal): Likewise. Previously it was
2228 used to indicate that the window is being set up. Now we use
2229 set_window_buffer for all new windows, so the condition in ...
2230 (Fset_window_buffer): ... is always true and can be removed.
2231
ed08365b
DA
22322012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2233
2234 Convenient macro to check whether the buffer is hidden.
2235 * buffer.h (BUFFER_HIDDEN_P): New macro.
2236 * frame.c (make_frame): Use it. Adjust comment.
2237 * buffer.c (candidate_buffer): New function.
2238 (Fother_buffer, other_buffer_safely): Use it.
2239
e86f5134
EZ
22402012-12-06 Eli Zaretskii <eliz@gnu.org>
2241
2242 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2243 if the child process is still running. Instead, exit the wait
2244 loop and return zero. (Bug#13086)
2245
1700db3c
DA
22462012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2247
2248 * frame.h (x_char_width, x_char_height): Remove prototypes.
2249 * w32term.h (x_char_width, x_char_height): Likewise.
2250 * xfns.c (x_char_width, x_char_height): Remove.
2251 * w32fns.c (x_char_width, x_char_height): Likewise.
2252 * nsfns.c (x_char_width, x_char_height): Likewise.
2253 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2254 all window frames.
2255 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2256 * keyboard.c (command_loop_1): Remove prototype.
2257 (command_loop_2, top_level_1): Add static to match prototype.
2258
35fb8050
PE
22592012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2260
2261 Fix a recently-introduced delete-process race condition.
2262 * callproc.c, process.h (record_kill_process):
2263 New function, containing part of the old call_process_kill.
2264 (call_process_kill): Use it.
2265 This does not change call_process_kill's behavior.
2266 * process.c (Fdelete_process): Use record_kill_process to fix a
2267 race condition that could cause Emacs to lose track of a child.
2268
565212e5
DA
22692012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2270
2271 Avoid code duplication between prev_frame and next_frame.
2272 * frame.c (candidate_frame): New function. Add comment.
2273 (prev_frame, next_frame): Use it. Adjust comment.
2274
d8ad4d3f 22752012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
2276
2277 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2278 fails, signal an error instead of continuing with an empty
2279 string. (Bug#13079)
7c2fcf9b
EZ
2280 Encode expanded temp file pattern before passing it to mkstemp or
2281 mktemp.
d3cefd13 2282
2e7cddd3
EZ
2283 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2284 Encode the file name before passing it to dostounix_filename, in
2285 case it will downcase it (under w32-downcase-file-names).
2286 (Bug#12933)
2287
644d3f0d
PE
22882012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2289
2290 Minor call-process cleanups.
2291 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2292 at the same time as other platforms, to simplify analysis.
2293 No need for fd0_volatile since we have synch_process_fd.
2294 Avoid needless emacs_close; arg is always negative.
2295
396376f1
AS
22962012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2297
2298 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2299 processes.
2300
350f51ad
DA
23012012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2302
2303 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2304 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2305 and mouse_face_hidden members to a bitfields.
2306 * frame.h (struct frame): Remove set-but-not-used space_width member.
2307 (FRAME_SPACE_WIDTH): Remove.
2308 * nsterm.m, w32term.c, xterm.c: Adjust users.
2309 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2310 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2311 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2312 members to a bitfields.
2313
bc9dbce6
PE
23142012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2315
bb5f74ee
PE
2316 Don't let call-process be a zombie factory (Bug#12980).
2317 Fixing this bug required some cleanup of the signal-handling code.
2318 As a side effect, this change also fixes a longstanding rare race
2319 condition whereby Emacs could mistakenly kill unrelated processes,
2320 and it fixes a bug where a second C-g does not kill a recalcitrant
2321 synchronous process in GNU/Linux and similar platforms.
2322 The patch should also fix the last vestiges of Bug#9488,
2323 a bug which has mostly been fixed on the trunk by other changes.
2324 * callproc.c, process.h (synch_process_alive, synch_process_death)
2325 (synch_process_termsig, sync_process_retcode):
2326 Remove. All uses removed, to simplify analysis and so that
2327 less consing is done inside critical sections.
2328 * callproc.c (call_process_exited): Remove. All uses replaced
2329 with !synch_process_pid.
2330 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2331 These take the role of what used to be in unwind-protect arg.
2332 All uses changed.
2333 (block_child_signal, unblock_child_signal):
2334 New functions, to avoid races that could kill innocent-victim processes.
2335 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2336 (call_process_kill): Record killed processes as deleted, so that
2337 zombies do not clutter up the system. Do this inside a critical
2338 section, to avoid a race that would allow the clutter.
2339 (call_process_cleanup): Fix code so that the second C-g works again
2340 on common platforms such as GNU/Linux.
2341 (Fcall_process): Create the child process in a critical section,
2342 to fix a race condition. If creating an asynchronous process,
2343 record it as deleted so that zombies do not clutter up the system.
2344 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2345 light of these changes. Omit unnecessary call to emacs_close
2346 before failure, as the unwind-protect code does that.
2347 * callproc.c (call_process_cleanup):
2348 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2349 * process.c (record_deleted_pid): New function, containing
2350 code refactored out of Fdelete_process.
2351 (Fdelete_process): Use it.
2352 (process_status_retrieved): Remove. All callers changed to use
2353 child_status_change.
2354 (record_child_status_change): Remove, folding its contents into ...
2355 (handle_child_signal): ... this signal handler. Now, this
2356 function is purely a handler for SIGCHLD, and is not called after
2357 a synchronous waitpid returns; the synchronous code is moved to
2358 wait_for_termination. There is no need to worry about reaping
2359 more than one child now.
2360 * sysdep.c (get_child_status, child_status_changed): New functions.
2361 (wait_for_termination): Now takes int * status and bool
2362 interruptible arguments, too. Do not record child status change;
2363 that's now the caller's responsibility. All callers changed.
2364 Reimplement in terms of get_child_status.
2365 (wait_for_termination_1, interruptible_wait_for_termination):
2366 Remove. All callers changed to use wait_for_termination.
2367 * syswait.h: Include <stdbool.h>, for bool.
2368 (record_child_status_change, interruptible_wait_for_termination):
2369 Remove decls.
2370 (record_deleted_pid, child_status_changed): New decls.
2371 (wait_for_termination): Adjust to API changes noted above.
2372
bc9dbce6
PE
2373 * bytecode.c, lisp.h (Qbytecode): Remove.
2374 No longer needed after 2012-11-20 interactive-p changes.
2375
3cf3c607
EZ
23762012-12-03 Eli Zaretskii <eliz@gnu.org>
2377
2378 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2379 the scroll margin, move point outside the margin. (Bug#13055)
2380
005c8d13
JD
23812012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2382
2383 * gtkutil.c (my_log_handler): New function.
2384 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2385
20edc1c9
DA
23862012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2387
2388 * lisp.h (modify_region): Rename to...
2389 (modify_region_1): ...new prototype.
2390 * textprop.c (modify_region): Now static. Adjust users.
2391 * insdel.c (modify_region): Rename to...
2392 (modify_region_1): ...new function to work with current buffer.
2393 Adjust comment and users. Use true and false for booleans.
2394
62c2e5ed
DA
23952012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2396
2397 * alloc.c (free_save_value): New function.
2398 (safe_alloca_unwind): Use it.
2399 * lisp.h (free_save_value): New prototype.
2400 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2401 Add comment.
2402 (save_excursion_restore): Adjust to match saved data structure.
2403 Use free_save_value to offload some work from GC. Drop obsolete
2404 #if 0 code.
2405
c5bc2d1d 24062012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
2407
2408 * fileio.c (Vauto_save_list_file_name): Doc fix.
2409
c5bc2d1d 24102012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
2411
2412 * w32fns.c: Remove prototype of atof.
1e101a4b 2413 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 2414 builds.
1e101a4b 2415 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
2416
2417 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2418 with 64-bit builds.
2419
2420 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2421 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2422 defined.
2423
c5bc2d1d 24242012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 2425
a9de9f0c 2426 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 2427
21e54a94
PE
24282012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2429
2dd2e622
PE
2430 Fix xpalloc confusion after memory is exhausted.
2431 * alloc.c (xpalloc): Comment fix.
2432 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2433 and signals an error, do not clear charset_table_size, as
2434 charset_table is still valid.
2435 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2436
21e54a94
PE
2437 Use execve to avoid need to munge environ (Bug#13054).
2438 * callproc.c (Fcall_process):
2439 * process.c (create_process):
2440 Don't save and restore environ; no longer needed.
2441 * callproc.c (child_setup):
2442 Use execve, not execvp, to preserve environ.
2443
3e5490f7
PE
24442012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2445
2446 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2447
75b4f59c
YM
24482012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2449
2450 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2451 display for sliced images (Bug#10500).
2452
2453 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2454
f8aff4c6
JB
24552012-11-30 Juanma Barranquero <lekktu@gmail.com>
2456
2457 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2458 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2459
3940b924
DA
24602012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2461
2462 * xdisp.c (window_outdated): Remove eassert since it hits
2463 some suspicious corner cases (see Bug#13007 and Bug#13012).
2464 (mode_line_update_needed): New function.
2465 (redisplay_internal, redisplay_window): Use it.
2466 (ensure_selected_frame): New function.
2467 (redisplay_internal, unwind_redisplay): Use it.
2468 (redisplay_internal): Move comment about buffer_shared...
2469 (buffer_shared_and_changed): ...near to its real use.
2470
4a9204fe
PE
24712012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2472
2473 * callproc.c (Fcall_process): Don't misreport vfork failure.
2474
60aeceb8
PE
24752012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2476
2477 * callproc.c (Fcall_process): Fix vfork portability problems.
2478 Do not assume that fd[0], count, filefd, and save_environ survive
2479 vfork. Fix bug whereby wrong errno value could be reported for
2480 pipe failure. Some minor cleanups, too, as follows. Move buf and
2481 bufsize to the context where they're needed. Change new_argv to
2482 be of type char **, as this is more convenient and avoids casts.
2483 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2484 Now local constants, not macros.
2485
00dc3ead
KH
24862012-11-18 Kenichi Handa <handa@gnu.org>
2487
2488 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2489 for the variable "f".
2490
e1bf05c1
KH
24912012-11-13 Kenichi Handa <handa@gnu.org>
2492
2493 * font.c (font_unparse_xlfd): Exclude special characters from the
2494 generating XLFD name.
2495
22626a85
PE
24962012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2497
350e0088
PE
2498 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2499 * dired.c (stat_uname, stat_gname):
2500 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2501
22626a85
PE
2502 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2503 * dired.c (directory_files_internal, file_name_completion):
2504 Assume EAGAIN and EINTR are defined.
350e0088 2505
22626a85
PE
2506 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2507 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2508 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2509 * lread.c (readbyte_from_file): Assume EINTR is defined.
2510 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2511 Assume EIO and EAGAIN are defined.
2512 * unexcoff.c (write_segment): Assume EFAULT is defined.
2513
5c9cf0a3 25142012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
2515
2516 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2517 (Bug#11964)
2518
22294a56
EZ
2519 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2520 highlighting on the frame was cleared. Prevents assertion
2521 violations when repeatedly clicking on the "Top" link of the
2522 "bread-crumbs" in Info buffers.
2523
5fbab051
PE
25242012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2527
bcd77a2b
KB
25282012-11-24 Ken Brown <kbrown@cornell.edu>
2529
2530 * keyboard.c (HAVE_MOUSE):
2531 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2532 were always defined.
2533
d125ca15 25342012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 2535
24becea4
EZ
2536 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2537 between bpos_covered and bpos_max. This fixes cursor display when
2538 several display strings follow each other.
2539
8654a41b
EZ
2540 * .gdbinit (pgx): If the glyph's object is a string, display the
2541 pointer to string data, rather than the value of the string object
2542 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2543
cb5867b1
EZ
2544 * indent.c (Fvertical_motion): If the starting position is covered
2545 by a display string, return to one position before that, to avoid
2546 overshooting it inside move_it_to. (Bug#12930)
2547
f418b22e
DA
25482012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2549
2550 * frame.h (struct frame): Remove display_preempted member
2551 since all users are dead long ago.
2552 * nsterm.h (struct x_output): Use the only dummy member.
2553 * w32menu.c (pending_menu_activation): Remove since not
2554 really used.
2555 (set_frame_menubar): Adjust user.
2556 * w32term.h (struct x_output): Drop outdated #if 0 code.
2557 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
2558 asked_for_visible and menubar_active members.
2559 Drop unused pending_menu_activation member.
f418b22e
DA
2560 * xterm.h (struct x_output): Drop outdated #if 0 code.
2561 Use bitfields for explicit_parent, asked_for_visible,
2562 has_been_visible and net_wm_state_hidden_seen members.
2563
a879f0ea
EZ
25642012-11-23 Eli Zaretskii <eliz@gnu.org>
2565
2566 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2567 of a literal "/". (Bug#12955)
2568 (gl-stamp): Invoke fc.exe directly, not through cmd.
2569
95ef7787
PE
25702012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2571
2572 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2573 * dired.c: Assume HAVE_DIRENT_H.
2574 (NAMLEN): Remove, replacing with ...
2575 (dirent_namelen): New function. All uses changed. Use the GNU macro
2576 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2577 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2578 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2579 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2580 $(NT_INC)/dirent.h.
2581 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2582 * ndir.h: Rename to ../nt/inc/dirent.h.
2583 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2584 Do not include <dirent.h>; no longer needed.
2585 * w32.c: Include <dirent.h> rather than "ndir.h".
2586
12645ae6
CY
25872012-11-23 Chong Yidong <cyd@gnu.org>
2588
2589 * xftfont.c (xftfont_open): Remove duplicate assignment.
2590
5c747675
DA
25912012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2592
2593 * alloc.c (Fgarbage_collect): Unblock input after clearing
2594 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2595 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2596 * msdos.c (IT_frame_up_to_date): Use it here...
2597 * w32term.c (w32_frame_up_to_date): ...here...
2598 * xterm.c (XTframe_up_to_date): ...and here...
2599 * nsterm.m (ns_frame_up_to_date): ...but not here.
2600 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2601 Adjust users.
2602 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2603 Do not check whether GC is in progress.
2604
6ceeb5f1
DA
26052012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2606
2607 * xdisp.c (window_buffer_changed): New function.
2608 (update_menu_bar, update_tool_bar): Use it to
2609 simplify large 'if' statements.
2610 (redisplay_internal): Generalize commonly used
2611 'tail' and 'frame' local variables.
2612
ec84768f
EZ
26132012-11-22 Eli Zaretskii <eliz@gnu.org>
2614
2615 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2616 with Windows system header.
2617
9239d970
PE
26182012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2619
2620 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2621 * alloc.c: Assume unistd.h exists.
2622 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2623 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2624 (getwd) [USG]: Remove; no longer needed.
2625 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2626 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2627 * w32.h (getcwd): Remove decl.
2628
954bba56
SM
26292012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2630
2631 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2632 Make it set selected_window as well.
2633 (update_tool_bar): Use it.
2634
6ef2e5ef 26352012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
2636
2637 * emacs.c (main): Set the G_SLICE environment variable for all
2638 Cygwin builds, not just GTK builds. See
2639 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2640
6ef2e5ef 26412012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
2642
2643 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2644 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2645 Define for the MSVC compiler.
2646
6ef2e5ef 2647 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
2648
2649 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2650 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2651 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
2652 dostounix_filename assumes it gets a unibyte string.
2653 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
2654 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2655
eadf1faa
SM
26562012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2657
2658 Conflate Qnil and Qunbound for `symbol-function'.
2659 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2660 * lread.c (init_obarray): Set `function' fields to Qnil.
2661 * eval.c (Fcommandp): Ignore Qunbound.
2662 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2663 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2664 Test NILP rather than Qunbound.
2665 (Ffmakunbound): Set to Qnil.
2666 (Fsymbol_function): Never signal an error.
2667 (Finteractive_form): Ignore Qunbound.
2668
b83fdfa9
PE
26692012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2670
2671 * eval.c (interactive_p): Remove no-longer-used decl.
2672
952580c5
DA
26732012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2674
2675 * xdisp.c (buffer_shared): Adjust comment.
2676 (buffer_shared_and_changed): New function.
2677 (prepare_menu_bars, redisplay_internal): Use it to
2678 decide whether all windows or frames should be updated.
ea6de9b1
DA
2679 (window_outdated): New function.
2680 (text_outside_line_unchanged_p, redisplay_window): Use it.
2681 (redisplay_internal): Likewise. Fix indentation.
952580c5 2682
23ba2705
SM
26832012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2684
2685 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2686 (syms_of_eval): Remove corresponding defsubr.
2687 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2688
6e9f7997
DC
26892012-11-19 Daniel Colascione <dancol@dancol.org>
2690
2691 * w32fns.c (Fx_file_dialog):
2692 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2693 cygwin_convert_file_name*.
2694
2695 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2696 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2697
552a1590
PE
26982012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2701
2ac9538d 27022012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
2703
2704 * w32select.c: Include w32common.h before w32term.h, so that
2705 windows.h gets included before w32term.h uses some of its
2706 features, see below.
2707
23ba2705
SM
2708 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2709 New typedefs.
2710 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2711 New prototypes.
d8715cdf
EZ
2712 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2713
2ac9538d 27142012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
2715
2716 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2717 (ns_select): Return at once if events are held (Bug#12834).
2718
2ac9538d 27192012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 2720
2721 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2722 Needed following 2012-10-20 change. (Bug#12902)
2723
c1f7ba3a
JB
27242012-11-18 Juanma Barranquero <lekktu@gmail.com>
2725
2726 * w32proc.c (waitpid): Remove unused label get_result.
2727
a75ce9d3
JB
27282012-11-17 Juanma Barranquero <lekktu@gmail.com>
2729
2730 * makefile.w32-in (SYSWAIT_H): New macro.
2731 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2732 ($(BLD)/sysdep.$(O)): Update dependencies.
2733
49cdacda
PE
27342012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2735
2736 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2737 * callproc.c (relocate_fd): Assume F_DUPFD.
2738 * emacs.c, term.c (O_RDWR): Remove.
2739 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2740 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2741 * nsterm.m: Assume <fcntl.h> exists.
2742 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2743 (create_pty, Fmake_network_process, server_accept_connection)
2744 (wait_reading_process_output, init_process_emacs):
2745 Assume O_NONBLOCK.
2746 (wait_reading_process_output): Put in a special case for WINDOWSNT
2747 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2748 It's not clear this is needed, but it's a more-conservative change.
2749 (create_process): Assume FD_CLOEXEC.
2750 (create_process, create_pty): Assume O_NOCTTY.
2751 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2752 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2753 Omit if not DOS_NT, since F_GETFL is not defined there.
2754 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2755 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2756 (O_NOCTTY): Remove.
2757 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2758 lack it, since gnulib guarantees this.
2759 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2760
22bae83f
EZ
27612012-11-17 Eli Zaretskii <eliz@gnu.org>
2762
6ad30855
EZ
2763 * w32.c (faccessat): Pretend that directories have the execute bit
2764 set. Emacs expects that, e.g., in files.el:cd-absolute.
2765
22bae83f
EZ
2766 * w32proc.c (create_child): Don't clip the PID of the child
2767 process to fit into an Emacs integer, as this is no longer a
2768 restriction.
2769 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2770 reaping only the process specified by PID argument, if that is
2771 positive. Use PID instead of dead_child to know which process to
2772 reap. Wait for the child to die only if WNOHANG is not in
2773 OPTIONS.
2774 (sys_select): Don't set dead_child.
2775
2776 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2777 as it is no longer needed.
2778
2779 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2780 no longer needed.
2781 (record_child_status_change): Remove the setting of
2782 record_at_most_one_child for the !WNOHANG case.
2783
a631d0e0
PE
27842012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2785
2786 Fix problems in ns port found by static checking.
2787 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2788 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2789 not to process group.
2790 (ns_select): Use emacs_write, not write, as that's more robust
2791 in the presence of signals.
2792 (fd_handler:): Check for read errors.
2793
d56f2e49
GM
27942012-11-16 Glenn Morris <rgm@gnu.org>
2795
2796 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2797
96e05507 27982012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
2799
2800 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2801
96e05507 28022012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
2803
2804 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2805 use the same value of thread handle.
2806 (start_timer_thread): If the timer thread exited (due to error),
2807 clean up by closing the two handles it used. Duplicate the caller
2808 thread's handle here, so it gets duplicated only once, when
2809 launching the timer thread. Set priority of the timer thread, not
2810 the caller thread.
2811 (getitimer): Don't duplicate the caller thread's handle here.
2812 (Bug#12832)
2813
96e05507 28142012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
2815
2816 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2817 called (Bug#12834).
2818
3d082a26
PE
28192012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2820
2821 Remove no-longer-used pty_max_bytes variable.
2822 * process.c (pty_max_bytes): Remove; unused.
2823 (send_process): Do not set it.
2824
b72c161c
JB
28252012-11-15 Juanma Barranquero <lekktu@gmail.com>
2826
2827 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2828 Update dependencies.
2829
bf20ea80
PE
28302012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2831
2832 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2833 This follows up on the 2012-09-29 patch that removed indirection
2834 for the 'function' field. Reported by Sergey Vinokurov in
2835 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2836
14f20728
EZ
28372012-11-14 Eli Zaretskii <eliz@gnu.org>
2838
2839 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2840 different name, as the MS runtime does not have such a function,
2841 and probably never will.) All callers changed. Ignore DIRFD
2842 value if PATH is an absolute file name, to match Posix spec
2843 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2844 symlinks.
2845
77731919
DA
28462012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2847
2848 * xdisp.c (echo_area_display, redisplay_internal):
2849 Omit redundant check whether frame_garbaged is set.
2850
73dcdb9f
PE
28512012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2852
2853 Use faccessat, not access, when checking file permissions (Bug#12632).
2854 This fixes a bug that has been present in Emacs since its creation.
2855 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2856 which must set some sort of record. (Torek's bug report was against
2857 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2858 same common flaw.) See Torek's Usenet posting
2859 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2860 Posted: Fri Apr 8 14:18:56 1983.
2861 * Makefile.in (LIB_EACCESS): New macro.
2862 (LIBES): Use it.
2863 * callproc.c (init_callproc):
2864 * charset.c (init_charset):
2865 * fileio.c (check_existing, check_executable, check_writable)
2866 (Ffile_readable_p):
2867 * lread.c (openp, load_path_check):
2868 * process.c (allocate_pty):
2869 * xrdb.c (file_p):
2870 Use effective UID when checking permissions, not real UID.
2871 * callproc.c (init_callproc):
2872 * charset.c (init_charset):
2873 * lread.c (load_path_check, init_lread):
2874 Test whether directories are accessible, not merely whether they exist.
2875 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2876 * fileio.c (check_existing, check_executable, check_writable)
2877 (Ffile_readable_p):
2878 Use symbolic names instead of integers for the flags, as they're
2879 portable now.
2880 (check_writable): New arg AMODE. All uses changed.
2881 Set errno on failure.
2882 (Ffile_readable_p): Use faccessat, not stat + open + close.
2883 (Ffile_writable_p): No need to call check_existing + check_writable.
2884 Just call check_writable and then look at errno. This saves a syscall.
2885 dir should never be nil; replace an unnecessary runtime check
2886 with an eassert. When checking the parent directory of a nonexistent
2887 file, check that the directory is searchable as well as writable, as
2888 we can't create files in unsearchable directories.
2889 (file_directory_p): New function, which uses 'stat' on most platforms
2890 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2891 (Ffile_directory_p, Fset_file_times): Use it.
2892 (file_accessible_directory_p): New function, which uses a single
2893 syscall for efficiency.
2894 (Ffile_accessible_directory_p): Use it.
2895 * xrdb.c (file_p): Use file_directory_p.
2896 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2897 * lread.c (openp): When opening a file, use fstat rather than
2898 stat, as that avoids a permissions race. When not opening a file,
2899 use file_directory_p rather than stat.
2900 (dir_warning): First arg is now a usage string, not a format.
2901 Use errno. All uses changed.
2902 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2903 that merely introduced a race.
2904 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2905 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2906 and similarly for the other O_* flags.
2907 * w32.c (sys_faccessat): Rename from sys_access and switch to
2908 faccessat's API. All uses changed.
2909 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2910 (magic_db): Rename from magic_file_p.
2911 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2912 char *, so that we don't have to test for file existence
2913 separately from opening the file for reading. This removes a race
2914 fixes a permission-checking problem, and simplifies the code.
2915 All uses changed.
2916 (file_p): Remove; no longer needed.
2917
2a14f83b
DA
29182012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2919
2920 Omit glyphs initialization at startup.
2921 * dispnew.c (glyphs_initialized_initially_p): Remove.
2922 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2923 (Fredraw_frame): Move actual code from here...
c7085245 2924 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
2925 (Fredraw_display): Use redraw_frame.
2926 * xdisp.c (clear_garbaged_frames): Likewise.
2927
f78ee6af 29282012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
2929
2930 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2931 passed to pint2str and pint2hrstr to be at most the size of the
2932 frame's decode_mode_spec_buffer. This avoids crashes with very
2933 large values of FIELD_WIDTH argument to decode_mode_spec.
2934 (Bug#12867)
2935
b95a9c0c
PE
29362012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2937
2938 Fix a race with verify-visited-file-modtime (Bug#12863).
2939 Since at least 1991 Emacs has ignored an mtime difference of no
2940 more than one second, but my guess is that this was to work around
2941 file system bugs that were fixed long ago. Since the race is
2942 causing problems now, let's remove that code.
2943 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2944 whose time stamp is off by no more than a second. Insist that the
2945 file time stamps match exactly.
2946
be49ba74
DA
29472012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2948
2949 * frame.h (struct frame): Convert external_tool_bar member to
2950 1-bit unsigned bitfield.
2951 * termhooks.h (struct terminal): Remove mouse_moved member since
2952 all users are long dead. Adjust comment on mouse_position_hook.
2953
5b04e9f9
DA
29542012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2955
2956 Simplify by using FOR_EACH_FRAME here and there.
2957 * frame.c (next_frame, prev_frame, other_visible_frames)
2958 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2959 * w32term.c (x_window_to_scroll_bar): Likewise.
2960 * window.c (window_list): Likewise.
2961 * xdisp.c (x_consider_frame_title): Likewise.
2962 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2963 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2964 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2965 * xmenu.c (menubar_id_to_frame): Likewise.
2966 * xselect.c (frame_for_x_selection): Likewise.
2967 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2968 (x_window_to_menu_bar): Likewise.
2969 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2970
76ae24d7
PE
29712012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2972
12cc4337
PE
2973 * data.c (Qdefalias_fset_function): Now static.
2974
76ae24d7
PE
2975 Another tweak to vectorlike_header change.
2976 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2977 Remove, and replace all uses with ...
2978 (next_in_free_list, set_next_in_free_list):
2979 New functions, which respect C's aliasing rules better.
2980
1479c557
PE
29812012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2982
2983 * window.c (list4i): Rename from 'quad'. All uses changed.
2984 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2985
11235c03
JB
29862012-11-11 Juanma Barranquero <lekktu@gmail.com>
2987
2988 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2989 warning about mixing declarations and code in ISO C90.
2990
6baf66d5 29912012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
2992
2993 * window.c (Fsplit_window_internal): Set combination limit of
2994 new parent window to t iff Vwindow_combination_limit is t;
2995 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 2996 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 2997
6baf66d5 29982012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
2999
3000 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3001 amount when the scroll margins are too large. When scrolling
3002 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
3003 scroll margin within a reasonable number of screen lines.
3004 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
3005 point is positioned many lines beyond the window top/bottom.
3006 (Bug#12811)
3007
508f51f5
EZ
3008 * ralloc.c (relinquish): If real_morecore fails to return memory
3009 to the system, don't crash; instead, leave the last heap
3010 unchanged and return. (Bug#12774)
3011
32e5c58c
SM
30122012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3013
3014 * lisp.h (AUTOLOADP): New macro.
3015 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3016 * data.c (Ffset): Remove special ad-advice-info handling.
3017 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3018 (Fsubr_arity): CSE.
3019 (Finteractive_form): Simplify.
3020 (Fquo): Don't insist on having at least 2 arguments.
3021 (Qdefalias_fset_function): New var.
3022
719b0aa5
JD
30232012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3024
4ab15c3e
JD
3025 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3026
719b0aa5
JD
3027 * nsfont.m (Qcondensed, Qexpanded): New variables.
3028 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3029 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3030
535cc8e9
DA
30312012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3032
3033 Fix recently introduced crash on MS-Windows (Bug#12839).
3034 * w32term.h (struct scroll_bar): Use convenient header.
3035 (SCROLL_BAR_VEC_SIZE): Remove.
3036 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3037
7d377c48
DA
30382012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3039
3040 Tweak last vectorlike_header change.
3041 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3042 vectorlike object on the free list. This is introduced to avoid
3043 some (but not all) pointer casting and aliasing problems, see
3044 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3045 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3046 objects.
3047 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3048
7ad27466
JD
30492012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3050
32e5c58c 3051 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
3052 been removed, so remove them here also.
3053
57618ecf
SM
30542012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3055
3056 * doc.c (Fdocumentation): Handle new property
3057 dynamic-docstring-function to replace the old ad-advice-info.
3058
53371430
PE
30592012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3060
3061 * fns.c (Qeql, hashtest_eq): Now static.
3062
61ddb1b9
SM
30632012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3064
3065 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3066 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3067 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3068 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3069
04a2d0d3
PE
30702012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3071
3072 Use same hash function for hashfn_profiler as for hash_string etc.
3073 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3074 * lisp.h (sxhash_combine): New inline function, with the contents
3075 of the old SXHASH_COMBINE.
3076 * profiler.c (hashfn_profiler): Use it, instead of having a
3077 special hash function containing a comparison that always yields 1.
3078
de5ef41a
SM
30792012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3080
3081 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3082 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3083 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3084 Remove unused vars.
3085
a23c4171
JD
30862012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3087
3088 * image.c (xpm_make_color_table_h): Fix compiler error because
3089 make_hash_table changed.
3090
0b59090b 30912012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
3092
3093 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3094
b7432bb2
SM
30952012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3096
3097 Use ad-hoc comparison function for the profiler's hash-tables.
3098 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3099 (make_log): Use them.
3100 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3101 call Fequal any more.
3102 (Ffunction_equal): New function.
3103 (cmpfn_profiler, hashfn_profiler): New functions.
3104 (syms_of_profiler): Initialize them.
3105 * lisp.h (struct hash_table_test): New struct.
3106 (struct Lisp_Hash_Table): Use it.
3107 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3108 * fns.c (make_hash_table): Take a struct to describe the test.
3109 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3110 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3111 (hash_lookup, hash_remove_from_table): Move assertion checking of
3112 hashfn result here. Check hash-equality before calling cmpfn.
3113 (Fmake_hash_table): Adjust call to make_hash_table.
3114 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3115 (syms_of_fns): Initialize them.
3116 * emacs.c (main): Move syms_of_fns earlier.
3117 * xterm.c (syms_of_xterm):
3118 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3119 * print.c (print_object): Adjust to new hash-table struct.
3120 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3121
88002743
EZ
31222012-11-08 Eli Zaretskii <eliz@gnu.org>
3123
3124 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3125 value of w32-scroll-lock-modifier is neither nil nor one of the
3126 known key modifiers. (Bug#12806)
3127
914adc42
DA
31282012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3129
3130 Shrink struct vectorlike_header to the only size field.
3131 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3132 Adjust comment.
3133 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3134 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3135 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3136 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3137 information from the vector header. Adjust comment.
3138 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3139 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3140 layout.
3141 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3142 (struct vectorlike_header): Remove next member. Adjust comment.
3143 (struct Lisp_Subr): Add convenient header. Adjust comment.
3144 (allocate_pseudovector): Adjust prototype.
3145 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3146 (sweep_string, lisp_malloc): Remove useless prototypes.
3147 (enum mem_type): Adjust comment.
3148 (NEXT_IN_FREE_LIST): New macro.
3149 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3150 (Fmake_bool_vector): Likewise.
3151 (struct large_vector): New type to represent allocation unit for
3152 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3153 (large_vectors): Change type to struct large_vector.
3154 (allocate_vector_from_block): Simplify.
3155 (PSEUDOVECTOR_NBYTES): Replace with...
3156 (vector_nbytes): ...new function. Adjust users.
3157 (sweep_vectors): Adjust processing of large vectors.
3158 (allocate_vectorlike): Likewise.
3159 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3160 Add easserts. Adjust XSETPVECTYPESIZE usage.
3161 (allocate_buffer): Use BUFFER_PVEC_INIT.
3162 (live_vector_p): Adjust to match large vector.
3163 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3164 * buffer.h (struct buffer): Add next member.
3165 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3166 New macros.
3167 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3168 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3169 (copy_hash_table): Adjust to match vector header change.
3170 * lread.c (defsubr): Use XSETPVECTYPE.
3171 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3172 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3173 (xvecsize): New command.
3174
c66f21ea
DA
31752012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3176
3177 * keyboard.c (event_to_kboard): Do not dereference
3178 frame_or_window field of SELECTION_REQUEST_EVENT
3179 and SELECTION_CLEAR_EVENT events (Bug#12814).
3180 * xterm.h (struct selection_input_event): Adjust comment.
3181
eb147960
EZ
31822012-11-07 Eli Zaretskii <eliz@gnu.org>
3183
dab72075
EZ
3184 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3185 such as Scroll Lock, if the respective keys are treated as
3186 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 3187 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 3188
5890e400
DA
31892012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3190
3191 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3192
b6b3b294
PE
31932012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3194
3195 Restore some duplicate definitions (Bug#12814).
3196 This undoes part of the 2012-11-03 changes. Some people build
3197 with plain -g rather than with -g3, and they need the duplicate
3198 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3199 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3200 Define as macros, as well as as enums or as constants.
3201
e770aad5
JD
32022012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3203
3204 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3205 to keypad keys (Bug#12816).
3206
68f8f1c0
PE
32072012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3208
3209 Minor adjustments of recently-changed frame functions.
3210 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3211 known to be a frame (we're in the FRAMEP branch).
3212 * lisp.h (Qframep): Remove decl. frame.h declares this.
3213 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3214 since they're meant for Lisp fixnum values.
3215
72f94d4b
DA
32162012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3217
3218 * window.c (Fwindow_combination_limit): Revert to the only
3219 required argument and adjust docstring as suggested in
3220 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3221 by Martin Rudalics <rudalics@gmx.at>.
3222
d9f07150
DA
32232012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3224
3225 Widely used frame validity and checking functions.
3226 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3227 * frame.c (decode_live_frame, decode_any_frame): New functions.
3228 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3229 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3230 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3231 (Fframe_pointer_visible_p): Use decode_any_frame.
3232 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3233 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3234 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3235 (Fframe_focus): Likewise. Allow zero number of arguments.
3236 Adjust docstring.
3237 (frame_buffer_list, frame_buffer_predicate): Remove.
3238 * lisp.h (frame_buffer_predicate): Remove prototype.
3239 * buffer.c (Fother_buffer): Use decode_any_frame.
3240 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3241 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3242 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3243 (Fclose_font, Ffont_info): Use decode_live_frame.
3244 * fontset.c (check_fontset_name): Likewise.
3245 * terminal.c (Fframe_terminal): Likewise.
3246 * w32fns.c (check_x_frame): Likewise.
3247 * window.c (Fminibuffer_window, Fwindow_at)
3248 (Fcurrent_window_configuration): Likewise.
3249 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3250 Likewise. Allow zero number of arguments. Adjust docstring.
3251 * dispnew.c (Fredraw_frame): Likewise.
3252 * xfaces.c (frame_or_selected_frame): Remove.
3253 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3254 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3255 (Fframe_face_alist): Use decode_live_frame.
3256 * xfns.c (check_x_frame): Likewise.
3257
89bc0592
DA
32582012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3259
3260 * window.c (quad): New function.
3261 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3262 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3263 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3264 (Fwindow_line_height): Use it.
3265 (Fwindow_fringes): Use list3.
3266 (Fwindow_scroll_bars): Use list4.
3267 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3268 (Fwindow_combination_limit): Allow zero number of arguments.
3269
c8e3a9c3
EZ
32702012-11-05 Eli Zaretskii <eliz@gnu.org>
3271
3272 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3273
8e2417bf 3274 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 3275 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 3276 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 3277
209c6a58
CY
32782012-11-05 Chong Yidong <cyd@gnu.org>
3279
3280 * process.c (wait_reading_process_output): Revert previous change.
3281
8148369c
PE
32822012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3283
dd0333b6
PE
3284 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3285 This removes code that has been obsolete since around 1990.
3286 * callproc.c (Fcall_process):
3287 * emacs.c (main):
3288 * process.c (create_process):
3289 * term.c (dissociate_if_controlling_tty):
3290 Assume setsid exists.
3291 * callproc.c (child_setup): Assume setpgid exists and behaves as
3292 per POSIX.1-1988 or later.
3293 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3294 * emacs.c (shut_down_emacs):
3295 * sysdep.c (sys_suspend, init_foreground_group):
3296 Assume getpgrp behaves as per POSIX.1-1998 or later.
3297 * msdos.c (setpgrp): Remove.
3298 (tcgetpgrp, setpgid, setsid): New functions.
3299 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3300 * term.c (no_controlling_tty): Remove; unused.
3301 * w32proc.c (setpgrp): Remove.
3302 (setsid, tcgetpgrp): New functions.
3303
8148369c
PE
3304 Simplify by assuming __fpending.
3305 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3306 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3307 Do not assume that __fpending's result fits in int.
3308
76abf5e5
PE
33092012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3310
06b63c9b
PE
3311 Remove EMACS_OUTQSIZE+sleep hack.
3312 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
3313 than 2400 bps, which throttled Emacs by having it sleep.
3314 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
3315 was added, and anyway those old terminals are long dead.
3316 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3317 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3318
76abf5e5
PE
3319 Fix data-loss with --version (Bug#9574).
3320 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3321 as we can't assume that emacs_strerror is initialized, and strerror
3322 is good enough here.
3323 (main): Invoke atexit earlier, to catch earlier instances of
3324 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3325
8f31e74b
MM
33262012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3327
3328 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3329 (keyDown): Remap keypad keys to X11 virtual key codes.
3330
0d879dca
PE
33312012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3332
7ccfb720
PE
3333 Fix data-loss with --batch (Bug#9574).
3334 * emacs.c: Include <close-stream.h>.
3335 (close_output_streams): New function.
3336 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3337 and handles errors appropriately.
3338 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3339 does that now.
3340
0b3d4a47
PE
3341 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3342 The symptom is a diagnostic "GLib-WARNING **: In call to
3343 g_spawn_sync(), exit status of a child process was requested but
3344 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3345 waitpid(), so exit status can't be returned." The diagnostic
3346 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3347 The real bug is a race condition between Emacs and glib: Emacs
3348 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3349 so that glib can't find it. Work around the bug by invoking
3350 waitpid only on subprocesses that Emacs itself creates.
3351 * process.c (create_process, record_child_status_change):
3352 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
3353 know the pid rather than having the callee infer it.
3354 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
3355 (create_process): Set new 'alive' member if child is created.
3356 (process_status_retrieved): New function.
3357 (record_child_status_change): Use it.
3358 Accept negative 1st argument, which means to wait for the
3359 processes that Emacs already knows about. Move special-case code
3360 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3361 processes that have already been waited for, by testing and
3362 clearing new 'alive' member.
3363 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3364 now does this internally.
3365 (handle_child_signal): Let record_child_status_change do all
3366 the work, since we do not want to reap all exited child processes,
3367 only the child processes that Emacs itself created.
3368 * process.h (Lisp_Process): New boolean member 'alive'.
3369
0d879dca
PE
3370 Omit duplicate definitions no longer needed with gcc -g3.
3371 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3372 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3373 Define only as macros. There's no longer any need to also define
3374 these symbols as enums or as constants, since we now assume
3375 gcc -g3 when debugging.
3376
3478f4b5
EZ
33772012-11-03 Eli Zaretskii <eliz@gnu.org>
3378
3379 * lisp.mk: Adjust comments to the fact that term/internal is now
3380 loaded from loadup.el.
3381
3382 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3383 (msdos_fatal_signal): New function.
3384 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3385 its argument list.
3386
3387 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3388 for GCC versions before 4.
3389 (emacs_raise): Define to call msdos_fatal_signal.
3390
3391 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3392 iterator when starting in the middle of a display or overlay
3393 string. (Bug#12745)
3394
85fabcb7
CY
33952012-11-03 Chong Yidong <cyd@gnu.org>
3396
3397 * process.c (wait_reading_process_output): Clean up the last
3398 change.
3399
893cc455
CY
34002012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3401
3402 * process.c (wait_reading_process_output): Avoid a race condition
3403 with SIGIO delivery (Bug#11536).
3404
0f7b074f
CY
34052012-11-03 Chong Yidong <cyd@gnu.org>
3406
3407 * buffer.c (cursor_type): Untabify docstring.
3408
3737fee7
DA
34092012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3410
3411 * frame.h (struct frame): Drop can_have_scroll_bars member
3412 which is meaningless for a long time. Adjust comments.
3413 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3414 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3415
b6a9e8b1
DA
34162012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3417
3418 * window.c (decode_next_window_args): Update window arg after
3419 calling decode_live_window and so fix crash reported at
3420 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3421 by Juanma Barranquero <lekktu@gmail.com>.
3422 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3423 * font.c (Ffont_at): Likewise.
3424
600d4768
JD
34252012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3426
3427 * widget.c (resize_cb): New function.
3428 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3429 (EmacsFrameResize): Check if all is up to date before changing frame
3430 size.
3431
1005b4b9
EZ
34322012-11-02 Eli Zaretskii <eliz@gnu.org>
3433
3434 Implement backtrace output for fatal errors on MS-Windows.
3435 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3436 (BACKTRACE_LIMIT_MAX): New macro.
3437 (w32_backtrace): New function.
3438 (emacs_abort): Use w32_backtrace when the user chooses not to
3439 attach a debugger. Update the text of the abort dialog.
3440
b9e9df47
DA
34412012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3442
3443 Window-related stuff cleanup here and there.
3444 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3445 Use decode_any_window.
3446 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3447 * xdisp.c (Fformat_mode_line): Likewise.
3448 * font.c (Ffont_at): Use decode_live_window.
3449 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3450 * window.c (decode_next_window_args): Likewise.
3451 (decode_any_window): Remove static.
3452 * window.h (decode_any_window): Add prototype.
3453 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3454 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3455 respectively.
3456
2b371ff7
DA
34572012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3458
3459 Remove pad from struct input_event.
3460 * termhooks.h (struct input_event): Remove padding field.
3461 Adjust comment.
3462 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3463 member is never cons for a long time. Adjust comment.
3464 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3465 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3466 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3467 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3468
7e8b50d9
EZ
34692012-11-01 Eli Zaretskii <eliz@gnu.org>
3470
3471 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3472
322aea6d
PE
34732012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3474
3475 Fix crash when using Emacs as commit editor for git (Bug#12697).
3476 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3477 and it is configured in conf_post.h.
3478 (Fcall_process): Don't invoke both setsid and setpgid; the former
3479 is enough, if it exists.
3480 * callproc.c (Fcall_process, child_setup):
3481 * process.c (create_process): Use setpgid.
3482 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3483 for the real thing.
3484 * dispnew.c (init_display): Initialize the foreground group
3485 if we are running a tty display.
3486 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3487 * lisp.h (init_foreground_group): New decl.
3488 * sysdep.c (inherited_pgroup): New static var.
3489 (init_foreground_group, tcsetpgrp_without_stopping)
3490 (narrow_foreground_group, widen_foreground_group): New functions.
3491 (init_sys_modes): Narrow foreground group.
3492 (reset_sys_modes): Widen foreground group.
3493
220cb2bd
MA
34942012-10-31 Michael Albinus <michael.albinus@gmx.de>
3495
3496 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3497
218e997a
MR
34982012-10-31 Martin Rudalics <rudalics@gmx.at>
3499
3500 * minibuf.c (read_minibuf): Restore current buffer since
3501 choose_minibuf_frame calling Fset_frame_selected_window may
3502 change it (Bug#12766).
3503
02615da0
JD
35042012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3505
3506 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3507
aee5b18e
KH
35082012-10-30 Kenichi Handa <handa@gnu.org>
3509
3510 * font.c (Ffont_at): If WINDOW is specified and it is not
3511 displaying the current buffer, signal an error.
3512
ba116008
DC
35132012-10-29 Daniel Colascione <dancol@dancol.org>
3514
de5ef41a
SM
3515 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3516 In preparation for fixing bug#12739, move these functions from
ba116008
DC
3517 here...
3518
3519 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
3520 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3521 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 3522
640bf8ad
EZ
35232012-10-28 Eli Zaretskii <eliz@gnu.org>
3524
3525 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3526 (timer_loop, getitimer, setitimer): Use it instead of
3527 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3528 'clock'.
3529 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3530 literal 10000.
3531
64ccff5f
JD
35322012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3533
3534 * nsterm.m (NO_APPDEFINED_DATA): New define.
3535 (last_appdefined_event_data): New variable
3536 (last_appdefined_event): Remove.
3537 (ns_select): Initialize t from last_appdefined_event_data instead
3538 of [last_appdefined_event data1].
3539 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3540 remove last_appdefined_event (Bug#12698).
3541
e483264c
SM
35422012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3543
3544 * frame.c (x_set_font): Catch internal error.
3545
6c16c13e
EZ
35462012-10-27 Eli Zaretskii <eliz@gnu.org>
3547
e483264c
SM
3548 Avoid overflow in w32 implementation of interval timers.
3549 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
3550 actually executes.
3551 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
3552 'volatile ULONGLONG' types. All the other data which was
3553 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
3554 (GetThreadTimes_Proc): New typedef.
3555 (w32_get_timer_time): New function, returns a suitable time value
3556 for the timer.
3557 (timer_loop): Enter critical section when accessing ULONGLONG
3558 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
3559 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3560 Remove unused variable.
6c16c13e
EZ
3561 (init_timers): Initialize s_pfn_Get_Thread_Times.
3562 (start_timer_thread): Don't assign itimer->caller_thread here.
3563 (getitimer): Assign itimer->caller_thread here.
3564 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 3565 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 3566
ccc83f50
EZ
35672012-10-26 Eli Zaretskii <eliz@gnu.org>
3568
3569 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3570 mouse movement events if the menu bar is active. This avoids
3571 producing a busy "hour-glass" cursor by Windows if the mouse
3572 pointer is positioned over a tooltip shown for some menu item.
3573
69deda53
PE
35742012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3575
3576 Don't assume process IDs fit in int.
3577 * emacs.c (shut_down_emacs) [!DOS_NT]:
3578 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3579 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3580 Use pid_t, not int, to store process IDs, as 'int'
3581 is not wide enough on a few platforms (e.g., AIX and IRIX).
3582
7e70a152
KH
35832012-10-23 Kenichi Handa <handa@gnu.org>
3584
3585 The following change is to make face-font-rescale-alist work
3586 correctly for non-ASCII fonts.
3587
3588 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3589 (font_open_for_lface): Handle Vface_font_rescale_alist.
3590
49238e7f
CY
35912012-10-23 Chong Yidong <cyd@gnu.org>
3592
3593 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3594
5ec86886
JD
35952012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3596
ef446959
JD
3597 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3598 for screen font.
3599 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3600
5ec86886
JD
3601 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3602 event (Bug#12681).
3603
ee7a418d
GM
36042012-10-21 Glenn Morris <rgm@gnu.org>
3605
3606 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3607
4973679b
PE
36082012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3609
3610 Port to OpenBSD 5.1.
3611 * frame.c (Fmouse_position, Fmouse_pixel_position):
3612 * xdisp.c (produce_stretch_glyph):
3613 Declare local vars only when they're needed.
3614 This is clearer and avoids a warning on OpenBSD about unused vars.
3615 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3616 This is safer, and avoids OpenBSD warnings about unused vars.
3617 * keyboard.c (record_menu_key): Remove unnecessary decl.
3618 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3619 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3620 as our definition clashes with OpenBSD's.
3621 * xfaces.c (load_face_colors, check_lface_attrs)
3622 (get_lface_attributes_no_remap, get_lface_attributes)
3623 (lface_fully_specified_p, x_supports_face_attributes_p)
3624 (tty_supports_face_attributes_p, face_fontset, realize_face)
3625 (realize_x_face, realize_tty_face):
3626 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3627 merely Lisp_Object *. This is more informative and avoids
3628 a warning on OpenBSD about accessing beyond an object's size.
3629
c664f463
CY
36302012-10-20 Chong Yidong <cyd@gnu.org>
3631
3632 * lread.c (Fload): Doc fix (Bug#12592).
3633
6ec83f92 36342012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
3635
3636 * font.c (Ffont_at): Fix previous change.
3637
d2824928
EZ
36382012-10-19 Eli Zaretskii <eliz@gnu.org>
3639
e483264c
SM
3640 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3641 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
3642 for the reasons.
3643
d2824928
EZ
3644 * alloc.c (NSTATICS): Decrease to 0x800.
3645
f60d391f
SM
36462012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3647
4a0e1924 3648 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
3649 error (bug#12677).
3650
1a9327d5
JD
36512012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3652
3653 * nsterm.m (ns_select): Check writefds before call to
3654 FD_ISSET (Bug#12668).
3655
14145a1e
DC
36562012-10-18 Daniel Colascione <dancol@dancol.org>
3657
3658 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3659 (staticpro): If we run out of staticpro slots, die with an
3660 informative error instead of just calling emacs_abort.
3661
1f76f6f5
MR
36622012-10-18 Martin Rudalics <rudalics@gmx.at>
3663
3664 Fix two flaws reported by Dmitry Antipov.
3665 * window.c (Ftemp_output_buffer_show): Remove.
3666 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3667 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3668
fcf14875
EZ
36692012-10-17 Eli Zaretskii <eliz@gnu.org>
3670
1f76f6f5
MR
3671 * makefile.w32-in ($(BLD)/w32.$(O)):
3672 ($(BLD)/vm-limit.$(O)):
3673 ($(BLD)/term.$(O)):
3674 ($(BLD)/unexw32.$(O)):
3675 ($(BLD)/fileio.$(O)):
a68089e4
EZ
3676 ($(BLD)/dispnew.$(O)): Update dependencies.
3677
3678 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3679 Add prototypes.
3680
3681 * w32proc.c: Include ctype.h.
3682
3683 * w32.h (init_environment, check_windows_init_file)
3684 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3685 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3686 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3687 (sys_link): Add prototypes.
3688
3689 * w32.c: Include w32select.h.
3690 (sys_access, e_malloc, sys_select): Add prototypes.
3691 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3692
3693 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3694
3695 * unexw32.c: Include lisp.h and w32.h.
3696
3697 * term.c [WINDOWSNT]: Include w32term.h.
3698
3699 * process.c [WINDOWSNT]: Add prototype of sys_select.
3700
3701 * fileio.c [WINDOWSNT]: Include w32.h.
3702
3703 * dispnew.c [WINDOWSNT]: Include w32.h.
3704
fcf14875
EZ
3705 * cygw32.c (Fcygwin_convert_path_to_windows)
3706 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3707 Lisp_Object values. (Bug#12661)
3708
3709 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3710 to Lisp_Object. (Bug#12661)
3711
fe0b1ec4
KH
37122012-10-17 Kenichi Handa <handa@gnu.org>
3713
3714 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3715 invalidate.
3716
d556ebf9
DA
37172012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3718
3719 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 3720 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 3721
f0863a54
DA
37222012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3723
3724 Do not verify indirection counters of killed buffers (Bug#12579).
3725 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3726 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3727
12fbe755
DA
37282012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3729
3730 * alloc.c (Fmake_byte_code): Fix typo in comment.
3731 * print.c (print_interval): Define as static to match prototype.
3732 * indent.c (disptab_matches_widthtab, recompute_width_table):
3733 Convert to eassert.
3734
61655b89
DA
37352012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3736
3737 * editfns.c (get_system_name): Remove.
3738 * lisp.h (get_system_name): Remove prototype.
3739 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3740 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3741
9520f2f2
DC
37422012-10-15 Daniel Colascione <dancol@dancol.org>
3743
3744 * dbusbind.c: Add comment explaining reason for previous change.
3745
dca778d5
MR
37462012-10-15 Martin Rudalics <rudalics@gmx.at>
3747
3748 * window.c (Fwindow_end): Rewrite check whether cached position
3749 can be used (Bug#12600).
3750 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3751 Set windows_or_buffers_changed.
3752
3e0341b0
DC
37532012-10-15 Daniel Colascione <dancol@dancol.org>
3754
3755 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3756 enabled by undefining the symbol "interface", which the platform
3757 headers define to something incompatible.
3758
33d4113c
DC
37592012-10-14 Daniel Colascione <dancol@dancol.org>
3760
3761 * image.c (init_tiff_functions, init_imagemagick_functions)
3762 (init_svg_functions): Fix cygw32 build break by using these
3763 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3764
a36fb15e
JD
37652012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3766
3767 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3768
537f336d
JD
37692012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3770
3771 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3772
0ba06a77
KH
37732012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3774
3775 * coding.c (detect_coding): Set coding->id before calling
3776 this->detector.
3777
ce2fe65a
AS
37782012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3779
3780 * fileio.c: Formatting fixes.
3781
d6453ce4
PE
37822012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 Fix some stat-related races.
3785 * fileio.c (Fwrite_region): Avoid race condition if a file is
3786 removed or renamed by some other process immediately after Emacs
3787 writes it but before Emacs stats it. Do not assume that stat (or
3788 fstat) succeeds.
3789 * image.c (slurp_file): Resolve the file name with fopen + fstat
3790 rather than stat + fopen.
3791 (pbm_read_file) [0]: Remove unused code with stat race.
3792 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3793 Remove ineffective code with stat race.
3794
06485aa8
SM
37952012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3796
3797 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3798
167e3640
JD
37992012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3800
3801 * nsterm.m (hold_event_q): New static variable.
3802 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3803 ! q_event_ptr.
3804 (hold_event): New function.
3805 (ns_read_socket): If hold_event_q have events, store them and
3806 return (Bug#12384).
3807 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3808 is zero (Bug#12384).
3809
c40239df
JB
38102012-10-12 Juanma Barranquero <lekktu@gmail.com>
3811
3812 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3813
bb385a92
EZ
38142012-10-12 Eli Zaretskii <eliz@gnu.org>
3815
2a9f1099
EZ
3816 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3817
bb385a92
EZ
3818 * fileio.c (check_existing): New function.
3819 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3820 instead of calling 'stat', when what's needed is to check whether
3821 a file exists. This avoids expensive system calls on MS-Windows.
3822 (Bug#12587)
3823
8599b23a 3824 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
3825
3826 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3827 determine whether a file exists and is not a directory.
3828
3829 * lisp.h (check_existing): Add prototype.
3830
2b9c2e68
JD
38312012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3832
3833 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3834
81749a23
GM
38352012-10-12 Glenn Morris <rgm@gnu.org>
3836
3837 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3838
5253a5fd
SM
38392012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3840
389a94a5
SM
3841 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3842
5253a5fd
SM
3843 * eval.c (Fautoload): Remember previous autoload status in load-history.
3844
7cded46f
PE
38452012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3846
3847 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3848 * lread.c (load_each_byte, new_backquote_flag, readchar)
3849 (read_filtered_event, lisp_file_lexically_bound_p)
3850 (safe_to_load_version, Fload, complete_filename_p, openp)
3851 (build_load_history, readevalloop, read_escape, read1)
3852 (string_to_number, read_vector, read_list):
3853 * macros.c (Fstart_kbd_macro):
3854 * marker.c (CONSIDER):
3855 * menu.c (parse_single_submenu, digest_single_submenu)
3856 (find_and_return_menu_selection, Fx_popup_menu):
3857 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3858 (Ftry_completion):
3859 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3860 (ns_menu_show):
3861 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3862 (xmenu_show, xdialog_show):
3863 Use bool for booleans.
3864 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3865 as it's not a predicate. All uses changed. Omit unnecessary
3866 buffer termination.
3867
549c3414
DA
38682012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3869
3870 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3871 (save_excursion_restore): Do not restore mark if it was not saved.
3872
e85aafe7
PE
38732012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3874
fd2f90cf
PE
3875 * marker.c (cached_modiff): EMACS_INT, not int.
3876
c1af190b
PE
3877 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3878 instead of having a wrong decl.
e85aafe7
PE
3879 * nsmenu.m (waiting_for_input): Remove wrong decl.
3880
e738ca56
PE
38812012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3882
9fa1de30
PE
3883 keyboard.c, keymap.c: Use bool for booleans.
3884 * dispnew.c (sit_for): Distinguish between 3-way display_option
3885 and boolean do_display.
3886 * keyboard.c (single_kboard, this_command_key_count_reset)
3887 (waiting_for_input, echoing, immediate_quit, input_pending)
3888 (interrupt_input, interrupts_deferred, pop_kboard)
3889 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3890 (command_loop_1, adjust_point_for_property)
3891 (safe_run_hooks_error, input_polling_used, read_char):
3892 (help_char_p, readable_events, kbd_buffer_events_waiting)
3893 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3894 (lucid_event_type_list_p, get_input_pending):
3895 (gobble_input, menu_separator_name_p, menu_bar_item)
3896 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3897 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3898 (keyremap_step, test_undefined, read_key_sequence)
3899 (detect_input_pending, detect_input_pending_ignore_squeezables)
3900 (detect_input_pending_run_timers, requeued_events_pending_p)
3901 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3902 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3903 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3904 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3905 (accessible_keymaps_1, Fkey_description, push_key_description):
3906 (shadow_lookup, struct where_is_internal_data)
3907 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3908 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3909 (describe_map, describe_vector):
3910 * menu.c (single_menu_item):
3911 * nsmenu.m (ns_update_menubar):
3912 * process.c (wait_reading_process_output):
3913 * search.c (scan_buffer, scan_newline):
3914 Use bool for boolean.
3915 * keyboard.c (timers_run, swallow_events)
3916 (detect_input_pending_run_timers):
3917 * process.c (wait_reading_process_output):
3918 Use unsigned for counter where wraparound-on-overflow is desired,
3919 since unsigned is guaranteed to have that behavior and signed is not.
3920 (read_char): Use ptrdiff_t for string length.
3921 (get_input_pending): Remove first argument, since it was always
3922 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3923 and behave as if it had that value. Return new value of
3924 input_pending. All callers changed.
3925 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3926 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3927 a string length.
3928 * keymap.c (push_key_description): Omit last arg, which was always 1.
3929 All callers changed.
3930
e738ca56
PE
3931 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3932
29f21cdf
JB
39332012-10-10 Juanma Barranquero <lekktu@gmail.com>
3934
3935 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3936 ($(BLD)/term.$(O)): Update dependencies.
3937
6aea7528
DA
39382012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3939
3940 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3941 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3942 initializer for PVEC_NORMAL_VECTOR.
3943
5f3f57be
PE
39442012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3945
3946 Clean out old termopts cruft.
3947 * termopts.h (flow_control, meta_key): Remove unused decls.
3948 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3949 Don't include termopts.h.
3950
3e98c68e
DA
39512012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3952
3953 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3954
77e344e5
PE
39552012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3956
3957 * commands.h (immediate_quit): Remove duplicate decl.
3958
5683d7cd
JD
39592012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3960
3961 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3962 caching.
3963 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 3964 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 3965
cf5fc6db
EZ
39662012-10-09 Eli Zaretskii <eliz@gnu.org>
3967
b15736e6
EZ
3968 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3969 match what GetLastError returns. Explain why the function is
3970 needed.
3971
cf5fc6db
EZ
3972 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3973 'is_tooltip_frame', to avoid confusion with its global namesake.
3974
f99714ce
DC
39752012-10-08 Daniel Colascione <dancol@dancol.org>
3976
3977 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
3978 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3979 build that caused Emacs to display the hourglass cursor forever.
f99714ce 3980
fd59cb29
GM
3981 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3982 which is broken under remote desktop, calculate the number of
3983 colors available for a display based on the display's number of
3984 planes and number of bits per pixel per plane. (bug#10397).
3985
62c480c9 39862012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 3987
62c480c9
JD
3988 * nsfont.m (Vfonts_in_cache): New variable.
3989 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3990 are used. Add cached fonts to Vfonts_in_cache.
3991 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3992
607446ba
JB
39932012-10-08 Juanma Barranquero <lekktu@gmail.com>
3994
fd5125ad
JB
3995 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3996 in nt/config.nt.
46979e0b
JB
3997 (FONT_H): Define after FRAME_H.
3998 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3999 Update dependencies.
fd5125ad 4000
607446ba
JB
4001 * w32term.c: Remove leftover declaration of keyboard_codepage.
4002
b6f4e300
EZ
40032012-10-08 Eli Zaretskii <eliz@gnu.org>
4004
c54ebba4
EZ
4005 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4006 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4007 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4008 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
4009 ($(BLD)/unexw32.$(O)):
4010 ($(BLD)/w32.$(O)):
4011 ($(BLD)/w32console.$(O)):
4012 ($(BLD)/w32fns.$(O)):
4013 ($(BLD)/w32heap.$(O)):
4014 ($(BLD)/w32menu.$(O)):
15c720a3 4015 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 4016
b6f4e300
EZ
4017 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4018 'const char *'.
4019 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4020
501199a3
DC
40212012-10-08 Daniel Colascione <dancol@dancol.org>
4022
4023 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4024 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4025 accidental message numbering hole. Change other messages to
4026 match.
4027
4028 * w32select.h (HAVE_W32SELECT): Remove.
4029
4030 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 4031 w32common.h instead of w32heap.h.
501199a3
DC
4032
4033 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4034 (get_allocation_unit, get_processor_type, get_w32_major_version)
4035 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4036 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4037 (OS_NT, os_subtype, cache_system_info): Move declarations to
4038 w32common.
4039
4040 * w32heap.c: Include w32common.h.
4041 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
4042 (w32_minor_version, w32_build_number, w32_subtype):
4043 Remove duplicate definitions.
501199a3
DC
4044
4045 * w32fns.c: Include w32common.h; include w32heap.h only in
4046 WINDOWSNT.
4047
4048 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4049 Use `report_file_error' instead of `error' in order to better
4050 inform users of what went wrong. Increase NTGUI_UNICODE file
4051 dialog box file name length to 32k, the maximum allowed by the NT
4052 kernel.
4053
4054 * w32common.h: New file.
4055 (ROUND_UP, ROUND_DOWN, get_page_size)
4056 (get_allocation_unit, get_processor_type, get_w32_major_version)
4057 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4058 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4059 (OS_NT, os_subtype, cache_system_info): Move here.
4060
4061 * unexw32.c, unexcw.c: Include w32common.h.
4062
4063 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4064 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4065 to call syms_of_w32select.
4066
4067 * cygw32.h: Remove obsolete EXFUN declarations.
4068
4069 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4070
4071 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4072 of w32inevt.o from SOME_MACHINE_OBJECTS.
4073
93aa5c81
DC
40742012-10-08 Daniel Colascione <dancol@dancol.org>
4075
4076 * image.c: Permanent fix for JPEG compilation issue --- limit
4077 jpeglib `boolean' redefinition to Cygwin builds.
4078
d424f3d8
EZ
40792012-10-08 Eli Zaretskii <eliz@gnu.org>
4080
8ee4c6ce
EZ
4081 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4082
d424f3d8
EZ
4083 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4084 Cygwin.
4085
e08348a0
DC
40862012-10-08 Daniel Colascione <dancol@dancol.org>
4087
4088 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4089 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4090 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4091 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4092 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4093 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4094 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4095 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4096 now a supported configuration.
4097
4098 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 4099 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
4100
4101 * conf_post.h:
4102 (_DebPrint) declare tracing facility for W32 debugging. We need
4103 to unify tracing later.
4104
4105 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4106 unconditional use of W32 Unicode functions. Cygwin runs only on
4107 100% Unicode operating systems.
4108
4109 * cygw32.c: New file. Define Cygwin-specific facilities.
4110 (Fcygwin_convert_path_to_windows)
4111 (Fcygwin_convert_path_from_windows): New user functions for
4112 accessing Cygwin path-munging routines.
4113
4114 * cygw32.h: New file.
4115 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4116 UTF-16LE strings temporarily inside non-Lisp-visible string
4117 objects.
4118
4119 (w32_strerror): Just what it says on the tin.
4120
4121 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4122 also run for Cygwin; both systems have the same problem with using
4123 GUI facilities in a forked child. Also call syms_of_cygw32,
4124 syms_of_w32select in correct places.
4125
4126 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4127 needs fork-then-exec for daemon launching.
4128
4129 * font.h: Include frame.h.
4130
4131 * image.c: Use the image library cache machinery only when we're
4132 compiling for native WINDOWSNT; Cygwin can use shared libraries
4133 like any other Unixlike system.
4134
4135 * keyboard.c: Clarify a comment regarding the input loop.
4136
4137 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4138 functions directly instead of trying to detect at runtime that our
4139 host operating system supports them. We make this change for two
4140 reasons: Cygwin lacks support for the multibyte character
4141 conversion functions used by the legacy menu code, and Cygwin
4142 never needs to rely on non-Unicode APIs.
4143
4144 * unexw32.c (hinst): Declare extern.
4145
4146 * w32.c: Change header order;
4147 (w32_strerror): Move to w32fns.c because we need it for
4148 non-WINDOWSNT builds.
4149
4150 * w32.h: Add #error macro to make sure we don't include w32.h for
4151 Cygwin builds. Remove w32select declarations.
4152
4153 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 4154 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
4155
4156 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4157 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4158 POSIXy alternative.
4159 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4160 (w32_major_version, w32_minor_version, w32_build_number)
4161 (os_subtype, sound_type): Define here
4162 (w32_defined_color): Make color parameter const for consistency
4163 with other _defined_color functions.
4164 (w32_createwindow): Unconditionally call w32_init_class instead of
4165 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4166 through the code is complex and unnecessary because class
4167 registration is practically free.
4168 (w32_name_of_message): New EMACSDEBUG-only function.
4169 (Fset_message_beep): Move here
4170 (Fx_open_connection): Require that the display name for Windows be
4171 "w32" for consistency, emacsclient disambiguation, and maybe, one
4172 day, multi-window-system support.
4173 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4174 Cygwin files for W32 GUI facilities, since these clearly don't
4175 expect Cygwin names.
4176 (_DebPrint): Define.
4177 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4178 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4179 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4180 (w32_last_error): Remove.
4181
4182 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4183
4184 * w32heap.c (syspage_mask): Declare here.
4185 (cache_system_info): Remove.
4186
4187 * w32inevt.c (faked_key): Define globally, not statically.
4188 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4189 (w32_console_toggle_lock_key): Move to w32fns.c.
4190
4191 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4192
4193 * w32proc.c (_DebPrint): Move to w32fns.c.
4194 * w32select.c: Include string.h, stdio.h for Cygwin.
4195 * w32select.h: New File.
4196
4197 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4198 get_osfhandle.
4199 (w32_message_fd): New variable. Under Cygwin, holds the file
4200 descriptor the system used to tell us about pending thread
4201 messages.
4202
4203 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4204 that prevented compilation under non-WINDOWSNT systems.
4205
4206 (w32_initialize): Open /dev/windows and assign it to
4207 w32_message_fd. Provide w32 feature.
4208
4209 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4210 (WM_EMACS_INPUT_READY): add.
4211 (prepend_msg, w32_message_fd): Declare globally.
4212
4213 * w32xfns.c:
4214 (keyboard_handle): Use only when WINDOWSNT.
4215 (notify_msg_ready): New function. Posts a message to the main
4216 thread's message queue under CYGWIN, which wakes up the main
4217 thread from select(2) by making the /dev/windows file descriptor
4218 ready. Under WINDOWSNT, it sets an event the same way the old
4219 code did.
4220
4221 (post, prepend_msg): Actually call notify_msg_ready instead of
4222 setting the input event directly.
4223
98daa893
EZ
42242012-10-07 Eli Zaretskii <eliz@gnu.org>
4225
4226 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4227 but it still has blocs in it, don't return it to the system,
4228 instead of aborting. (Bug#12402)
4229
3bc0a2f7
JD
42302012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4231
8ad5b73b 4232 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 4233
335f5ae4
JD
4234 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4235 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
4236 (syms_of_nsterm): Remove comment about Panther and above for
4237 ns-antialias-text.
335f5ae4
JD
4238 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4239 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4240 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4241
4242 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4243 MAC_OS_X_VERSION_10_4.
4244
8ad5b73b
JD
4245 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4246 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
4247
4248 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4249
4250 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4251 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4252
3bc0a2f7
JD
4253 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4254 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
4255 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4256 Remove ns_in_resize check.
3bc0a2f7
JD
4257 (ns_clear_frame_area): Remove resize handle code.
4258
4259 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
4260 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4261 Remove ns_in_resize check.
3bc0a2f7 4262
c622b48f
PE
42632012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4264
4265 Improve sys_siglist detection.
4266 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4267 defined as a macro, as is done in Solaris.
4268 (sys_siglist_entries): New macro.
4269 (save_strsignal): Use it.
4270 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4271 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4272
04fafa46
JD
42732012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4274
4275 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4276 fullscreen/Fullscreen.
4277
4278 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4279 tobar_height is new.
4280
4281 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4282 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4283 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4284 (windowDidResize:): Check for correct window if old style fullscreen.
4285 Capitalize word in comment. Remove incorrect comment.
4286 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4287 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4288 error in drawing background.
1f9f395d 4289 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
4290 Set toolbar values to zero, save old height in tobar_height.
4291 Restore tool bar height when leaving fullscreen.
4292 (canBecomeMainWindow): New function.
4293
c6e21c03
PE
42942012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4295
4296 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4297
0d9f584b
EZ
42982012-10-05 Eli Zaretskii <eliz@gnu.org>
4299
a65fbb5f
EZ
4300 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4301
0d9f584b 4302 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
4303 that time stamps of directories could also be changed.
4304 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
4305 FILE_WRITE_ATTRIBUTES access rights.
4306
4307 * fileio.c (Fset_file_times): Special-case ignoring errors for
4308 directories only on MSDOS, not on MS-Windows.
4309
e8757f09 43102012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
4311
4312 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4313
7604f298
EZ
43142012-10-04 Eli Zaretskii <eliz@gnu.org>
4315
4316 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4317 see whether CreateFile failed.
4318
88d69b7d
PE
43192012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4320
4321 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4322 to avoid similar races.
4323 * keyboard.c (pending_signals): Now bool, not int.
4324
7509f454
PE
4325 Port timers to OpenBSD, plus check for timer failures.
4326 OpenBSD problem reported by Han Boetes.
4327 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4328 and/or setitimer.
4329 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4330 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4331 like OpenBSD, which has timer_settime but does not declare it.
4332 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4333 whether to use itimerspec-related primitives. All uses of
4334 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4335
a3c5c0c5
PE
43362012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4337
4338 * profiler.c (handle_profiler_signal): Fix a malloc race
4339 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4340
914e743b
JD
43412012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4342
4343 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4344
d8ab37a8
EZ
43452012-10-02 Eli Zaretskii <eliz@gnu.org>
4346
4347 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4348 consistent with the change in return value of 'safe_strsignal'.
4349
b3ecad33
PE
43502012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4351
0a99eee1
PE
4352 Prefer plain 'static' to 'static inline' (Bug#12541).
4353 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4354 (bidi_set_sor_type, bidi_push_embedding_level)
4355 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4356 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4357 (bidi_cache_search, bidi_cache_ensure_space)
4358 (bidi_cache_iterator_state, bidi_cache_find)
4359 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4360 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4361 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4362 Now 'static', not 'static inline'.
4363
b3ecad33
PE
4364 Count overruns when profiling; change units to ns.
4365 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4366 Give extra weight to samples after overruns, to attempt to count
4367 the time more accurately.
4368 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4369 the underlying primitives nominally do ns.
4370 (Fprofiler_cpu_start): Document the change. Mention that
4371 the sampling intervals are only approximate.
4372
090cf9db
SM
43732012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4374
4375 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4376
4377 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4378 case for the special 0 coding-system.
4379
4380 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4381 (Fmake_overlay): Remove redundant tests.
64edc777 4382 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 4383
81550bf4
JB
43842012-10-02 Juanma Barranquero <lekktu@gmail.com>
4385
4386 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4387 Update dependencies.
4388
aa1ba90e
PE
43892012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4390
4391 Fix a malloc race condition involving strsignal.
4392 A signal can arrive in the middle of a malloc, and Emacs's signal
4393 handler can invoke strsignal, which can invoke malloc, which is
4394 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4395 Fix it by altering the signal handler so that it does not invoke
4396 strsignal.
4397 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4398 * process.c (status_message): Use const pointer, in case strsignal
4399 is #defined to safe_strsignal.
4400 * sysdep.c (sys_siglist, init_signals): Always define and
4401 initialize a substitute sys_siglist if the system does not define
4402 one, even if HAVE_STRSIGNAL.
4403 (safe_strsignal): Rename from strsignal. Always define,
4404 using sys_siglist. Return a const pointer.
4405 * syssignal.h (safe_strsignal): New decl.
4406 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4407
ace917bd
EZ
44082012-10-01 Eli Zaretskii <eliz@gnu.org>
4409
4410 * w32proc.c (timer_loop): Fix code that waits for timer
4411 expiration, to avoid high CPU usage.
4412
9eb71b9c
SM
44132012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4414
4415 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4416 (sweep_weak_table): Remove redundant prototypes.
4417
b3317662
FP
44182012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4419
4420 * emacs.c: Move the inclusion of TERM_HEADER after including
4421 windows.h on WINDOWSNT. This avoids compilation problems with
4422 MSVC.
4423
f0e5f225
EZ
44242012-10-01 Eli Zaretskii <eliz@gnu.org>
4425
2d7d1608
EZ
4426 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4427 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4428 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4429 as the previous version used 'void *'.
4430
4431 * ralloc.c (ROUNDUP): Fix last change.
4432 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4433 'size_t'.
4434
f0e5f225
EZ
4435 * w32proc.c <disable_itimers>: New static flag.
4436 (init_timers): Initialize it to zero, after creating the critical
4437 sections used by the timer threads.
4438 (term_timers): Set to 1 before deleting the critical sections.
4439 (getitimer, setitimer): If disable_itimers is non-zero, return an
4440 error indication without doing anything. Reported by Fabrice
4441 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
4442 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4443 return results.
4444 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4445 support timers.
f0e5f225
EZ
4446
4447 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4448 term_ntproc after all the other bookkeeping, to get timers working
4449 as long as possible.
4450
82ef37c1
PE
44512012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4452
b3a4c387
PE
4453 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4454 Suggested by Juri Linkov in
4455 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4456
b0ab8123
PE
4457 Prefer plain 'static' to 'static inline' (Bug#12541).
4458 With static functions, modern compilers inline pretty well by
4459 themselves; advice from programmers often hurts as much as it helps.
4460 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4461 this change shrinks the text size of the Emacs executable by 1.1%
4462 without affecting CPU significantly in my benchmark.
4463 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4464 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4465 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4466 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4467 (bset_auto_fill_function, bset_auto_save_file_format)
4468 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4469 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4470 (bset_cache_long_line_scans, bset_case_fold_search)
4471 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4472 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4473 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4474 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4475 (bset_header_line_format, bset_indicate_buffer_boundaries)
4476 (bset_indicate_empty_lines, bset_invisibility_spec)
4477 (bset_left_fringe_width, bset_major_mode, bset_mark)
4478 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4479 (bset_name, bset_overwrite_mode, bset_pt_marker)
4480 (bset_right_fringe_width, bset_save_length)
4481 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4482 (bset_scroll_up_aggressively, bset_selective_display)
4483 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4484 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4485 (set_buffer_overlays_after):
4486 * category.c (bset_category_table):
4487 * charset.c (read_hex):
4488 * coding.c (produce_composition, produce_charset)
4489 (handle_composition_annotation, handle_charset_annotation)
4490 (char_encodable_p):
4491 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4492 (assign_row, set_frame_matrix_frame, make_current)
4493 (add_row_entry):
4494 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4495 * fns.c (maybe_resize_hash_table):
4496 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4497 * gmalloc.c (register_heapinfo):
4498 * image.c (lookup_image_type):
4499 * intervals.c (set_interval_object, set_interval_left)
4500 (set_interval_right, copy_interval_parent, rotate_right)
4501 (rotate_left, balance_possible_root_interval):
4502 * keyboard.c (kset_echo_string, kset_kbd_queue)
4503 (kset_keyboard_translate_table, kset_last_prefix_arg)
4504 (kset_last_repeatable_command, kset_local_function_key_map)
4505 (kset_overriding_terminal_local_map, kset_real_last_command)
4506 (kset_system_key_syms, clear_event, set_prop):
4507 * lread.c (digit_to_number):
4508 * marker.c (attach_marker, live_buffer, set_marker_internal):
4509 * nsterm.m (ns_compute_glyph_string_overhangs):
4510 * process.c (pset_buffer, pset_command)
4511 (pset_decode_coding_system, pset_decoding_buf)
4512 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4513 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4514 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4515 * syntax.c (bset_syntax_table, dec_bytepos):
4516 * terminal.c (tset_param_alist):
4517 * textprop.c (interval_has_some_properties)
4518 (interval_has_some_properties_list):
4519 * window.c (wset_combination_limit, wset_dedicated)
4520 (wset_display_table, wset_hchild, wset_left_fringe_width)
4521 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4522 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4523 (wset_right_fringe_width, wset_right_margin_cols)
4524 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4525 (wset_vertical_scroll_bar_type, wset_window_parameters):
4526 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4527 (wset_column_number_displayed, wset_region_showing)
4528 (window_box_edges, run_window_scroll_functions)
4529 (append_glyph_string_lists, prepend_glyph_string_lists)
4530 (append_glyph_string, set_glyph_string_background_width)
4531 (append_glyph, append_composite_glyph)
4532 (take_vertical_position_into_account):
4533 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4534 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4535 (lface_hash, lface_same_font_attributes_p, lookup_face):
4536 * xml.c (libxml2_loaded_p):
4537 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4538 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4539 Now 'static', not 'static inline'.
4540
05584c31
PE
4541 * bidi.c: Tune.
4542 (bidi_copy_it): Do the whole copy with a single memcpy.
4543 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4544
86ec63ba
PE
4545 Revert the FOLLOW-SYMLINKS change for file-attributes.
4546 Doing it right would require several changes to Tramp, and there's
4547 not enough time to get that tested before the freeze today.
4548 * dired.c (directory_files_internal, Ffile_attributes):
4549 Undo last change.
4550
82ef37c1
PE
4551 * frame.c (x_report_frame_params): Port better to wider ints.
4552 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4553 or that pointers can be printed in 15 decimal digits.
4554 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4555
62aba0d4
FP
45562012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4557
4558 Support x64 build on MS-Windows.
4559 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4560 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4561 compatibility with x64.
5e4daaf3 4562 (x_get_focus_frame): Add prototype.
62aba0d4
FP
4563
4564 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4565 defining an XRectangle structure.
4566
4567 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4568 arithmetics for compatibility with x64.
4569
4570 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4571 compatibility with x64.
4572
4573 * w32heap.h: Adjust prototypes and declarations.
4574
4575 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4576 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4577 DWORD, long, and unsigned long, for compatibility with x64.
4578 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4579 (sbrk): Argument is now of type ptrdiff_t.
4580
4581 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4582 less than 0x0500.
4583 (w32_msg_pump): Use WPARAM type for 'result'.
4584
4585 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4586 architecture.
4587 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4588 compatibility with x64.
4589
4590 * vm-limit.c (lim_data): Now size_t.
4591 (check_memory_limits): Adjust prototypes of real_morecore and
4592 __morecore to receive argument of type ptrdiff_t. Use size_t for
4593 five_percent and data_size.
4594
4595 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4596 variables, for compatibility with x64.
4597 (rva_to_section, offset_to_section, relocate_offset)
4598 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4599 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4600 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4601 for compatibility with x64.
4602
4603 * sysdep.c (STDERR_FILENO): Define if not already defined.
4604
4605 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4606 (__morecore): Argument type is now ptrdiff_t.
4607 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4608 (relinquish): Use ptrdiff_t type for 'excess'.
4609 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4610
4611 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4612 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4613 instead of a literal number.
4614
4615 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4616 (min): Define only if not already defined.
4617
4618 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4619 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4620 hosts.
4621
4622 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4623 'bitmaps' is a pointer.
4624
4625 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4626
4627 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4628
e7a2937b
PE
46292012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4630
4631 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4632 * dired.c (directory_files_internal, Ffile_attributes):
4633 New arg follow_symlinks. All uses changed.
4634
b43d62ae
SM
46352012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4636
4637 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4638
c06c382a
EZ
46392012-09-30 Eli Zaretskii <eliz@gnu.org>
4640
4641 Support atimers and CPU profiler via profile.c on MS-Windows.
4642 * w32proc.c (sig_mask, crit_sig): New static variables.
4643 (sys_signal): Support SIGALRM and SIGPROF.
4644 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 4645 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
4646 sigfillset, and sigprocmask are no longer no-ops.
4647 (sigismember): New function.
4648 (struct itimer_data): New definition.
4649 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4650 (crit_prof): New static variables.
4651 (MAX_SINGLE_SLEEP): New definition.
4652 (timer_loop, stop_timer_thread, term_timers, init_timers)
4653 (start_timer_thread, getitimer, setitimer): New functions.
4654 (alarm): No longer a no-op, calls setitimer.
4655
4656 * w32.c (term_ntproc): Call term_timers.
4657 (init_ntproc): Make sure all signals are unblocked at startup, to
4658 erase any traces of dumping. Call init_timers.
4659
4660 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4661 Windows-specific code to display the hourglass mouse pointer is no
4662 longer used.
4663 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4664 to hourglass timer expiration.
4665 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4666 Remove, no longer used.
b43d62ae
SM
4667 (w32_note_current_window, show_hourglass, hide_hourglass):
4668 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
4669 window systems.
4670 (syms_of_w32fns): Don't initialize hourglass_timer.
4671
4672 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4673 WINDOWSNT as well.
4674 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4675
4676 * w32.h (init_timers, term_timers): Add prototypes.
4677
95402d5f
KH
46782012-09-30 Kenichi Handa <handa@gnu.org>
4679
4680 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4681 to the buffer relocation which may be caused by ccl_driver.
4682
dd946752
JD
46832012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4684
d7e642cc
JD
4685 * xfns.c (Fx_file_dialog): Update comment.
4686
4687 * w32fns.c (Fx_file_dialog): Update comment.
4688
4689 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4690 Initialize panel name field if OSX >= 10.6.
4691
4692 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4693
dd946752
JD
4694 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4695
4696 * nsterm.m (NEW_STYLE_FS): New define.
4697 (ns_fullscreen_hook, windowWillEnterFullScreen)
4698 (windowDidEnterFullScreen, windowWillExitFullScreen)
4699 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4700 (setFSValue): New functions.
4701 (EmacsFSWindow): New implementation.
4702 (canBecomeKeyWindow): New function for EmacsFSWindow.
4703 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4704 (dealloc): Release nonfs_window if in fullscreen.
4705 (updateFrameSize:): Call windowDidMove to update top/left.
4706 (windowWillResize:toSize:): Check if frame is still maximized.
4707 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4708 next_maximized, maximized_width, maximized_height and nonfs_window.
4709 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4710 tbar_height.
4711 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 4712 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
4713
4714 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4715 (EmacsView): Add variables for fullscreen.
4716 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4717 (EmacsFSWindow): New interface for fullscreen.
4718
427730eb
JB
47192012-09-30 Juanma Barranquero <lekktu@gmail.com>
4720
4721 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4722
48de8b12
CY
47232012-09-30 Chong Yidong <cyd@gnu.org>
4724
4725 * fns.c (Frandom): Doc fix.
4726
5938d519
MR
47272012-09-30 Martin Rudalics <rudalics@gmx.at>
4728
4729 * window.c (Vwindow_combination_limit): New default value.
4730 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4731
cb5b0266
PE
47322012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4733
4734 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4735 Suggested by Eli Zaretskii in
4736 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4737
84f72efd
EZ
47382012-09-30 Eli Zaretskii <eliz@gnu.org>
4739
4740 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4741 HAVE_TIMER_SETTIME is defined.
4742
9d4dcdc9
PE
47432012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4744
d89460ed
PE
4745 Profiler improvements: more-accurate timers, overflow checks.
4746 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4747 signal.h, setjmp.h. Include systime.h instead.
4748 (saturated_add): New function.
4749 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4750 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4751 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4752 New static vars.
84f72efd 4753 (enum profiler_cpu_running): New enum.
d89460ed
PE
4754 (profiler_cpu_running): Now of that enum type, not bool.
4755 All uses changed to store the new value.
4756 (handle_profiler_signal): Rename from sigprof_handler_1,
4757 for consistency with other handlers. Do not check whether
4758 cpu_log is a hash-table if garbage collecting, since it
4759 doesn't matter in that case.
4760 (deliver_profiler_signal): Rename from sigprof_handler,
4761 for consistency with other handlers.
4762 (setup_cpu_timer): New function, with much of what used to be in
4763 Fprofiler_cpu_start. Check for out-of-range argument.
4764 Prefer timer_settime if available, and prefer
4765 thread cputime clocks, then process cputime clocks, then
4766 monotonic clocks, to the old realtime clock. Use make_timeval
4767 to round more-correctly when falling back to setitimer.
4768 (Fprofiler_cpu_start): Use it.
4769 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4770 Don't assume that passing NULL as the 2nd argument of setitimer
4771 is the same as passing a pointer to all-zero storage.
4772 Ignore SIGPROF afterwards.
4773 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4774 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4775 non-fatal signal handlers. Ignore SIGPROF on startup.
4776 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4777 in profiler.c, since sysdep.c now uses it.
4778
9d4dcdc9
PE
4779 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4780 Suggested by Eli Zaretskii in
4781 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4782
8e5691a0
JB
47832012-09-29 Juanma Barranquero <lekktu@gmail.com>
4784
4785 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4786
e7c1b6ef
SM
47872012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4788
4789 * lisp.h (struct backtrace): Remove indirection for `function' field.
4790 * xdisp.c (redisplay_internal):
4791 * profiler.c (record_backtrace, sigprof_handler_1):
4792 * alloc.c (Fgarbage_collect):
4793 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4794 (Fbacktrace_frame): Adjust accordingly.
4795
e61d39cd 47962012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
4797
4798 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4799 (Frun_hook_with_args_until_failure): Doc fixes.
4800
404043ea
EZ
48012012-09-28 Eli Zaretskii <eliz@gnu.org>
4802
4803 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4804 Qautomatic_redisplay and change the symbol name. All users changed.
4805
704d3f45
TM
48062012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4807
4808 * profiler.c (sigprof_handler): Fix race condition.
4809
757140ff
GM
48102012-09-28 Glenn Morris <rgm@gnu.org>
4811
4812 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4813
a615a3ae
PE
48142012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 Check more robustly for timer_settime.
89d17fd0
PE
4817 * Makefile.in (LIB_TIMER_TIME): New macro.
4818 (LIBES): Add it.
a615a3ae
PE
4819 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4820 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4821 call timer_settime.
4822
3670daf7
TM
48232012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4824
4825 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4826
6a586b7f
JB
48272012-09-26 Juanma Barranquero <lekktu@gmail.com>
4828
4829 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4830
41c8bfcf
PE
48312012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4832
4833 * character.h (MAYBE_UNIFY_CHAR): Remove.
4834 * charset.c, charset.h (maybe_unify_char): Now static.
4835 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4836 Since this stuff is now private to charset.c, there's no need for
4837 a public macro and no need to inline by hand.
4838
3a880af4
SM
48392012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4840 Stefan Monnier <monnier@iro.umontreal.ca>
4841 Juanma Barranquero <lekktu@gmail.com>
611b7507 4842
3a880af4
SM
4843 * profiler.c: New file.
4844 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
4845 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4846 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
4847 * emacs.c (main): Call syms_of_profiler.
4848 * alloc.c (Qautomatic_gc): New constant.
4849 (MALLOC_PROBE): New macro.
4850 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4851 (total_bytes_of_live_objects): New function.
4852 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4853 Call malloc_probe for the memory profiler.
4854 (syms_of_alloc): Define Qautomatic_gc.
4855 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4856 race condition.
4857 (struct backtrace): Move definition...
4858 * lisp.h (struct backtrace): ..here.
4859 (Qautomatic_gc, profiler_memory_running): Declare vars.
4860 (malloc_probe, syms_of_profiler): Declare functions.
4861 * xdisp.c (Qautomatic_redisplay): New constant.
4862 (redisplay_internal): Record itself in backtrace_list.
4863 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 4864
5938d519 48652012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
48662012-09-25 Juanma Barranquero <lekktu@gmail.com>
4867
4868 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4869
e26fd2e4
PE
48702012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4871
4872 Prefer POSIX timers if available.
4873 They avoid a race if the timer is too close to the current time.
4874 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4875 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 4876 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 4877
eedec3ee
EZ
48782012-09-25 Eli Zaretskii <eliz@gnu.org>
4879
4880 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4881 CHAR_STRING_ADVANCE.
4882 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4883 STRING_CHAR_ADVANCE.
4884
aa15c6bb
JB
48852012-09-25 Juanma Barranquero <lekktu@gmail.com>
4886
4887 Move Vlibrary_cache to emacs.c and reset before dumping.
4888
4889 * lisp.h (reset_image_types): Declare.
4890 [WINDOWSNT] (Vlibrary_cache): Declare.
4891
4892 * image.c (reset_image_types): New function.
4893
4894 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4895 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4896 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4897
4898 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4899 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4900
4901 * w32.h (Vlibrary_cache): Do not declare.
4902
54d629be
EZ
49032012-09-25 Eli Zaretskii <eliz@gnu.org>
4904
16b22fef
EZ
4905 * w32proc.c (sys_signal): Handle all signals defined by the
4906 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4907 handlers for signals supported by Windows. Don't override
4908 term_ntproc as the handler for SIGABRT.
4909 (sigaction): Rewrite to call sys_signal instead of duplicating its
4910 code.
4911 (sys_kill): Improve commentary.
4912
4913 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4914 consistency with a signature of a signal handler. All callers
4915 changed.
4916 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4917 install term_ntproc as a signal handler for SIGABRT, as that
4918 should be done by the dumped Emacs.
4919
4920 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4921
4922 * w32select.c (term_w32select): Protect against repeated
4923 invocation by setting clipboard_owner to NULL after calling
4924 DestroyWindow.
4925
4926 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4927 and term_ntproc to their modified signatures.
4928
54d629be
EZ
4929 * character.c (char_string, string_char): Remove calls to
4930 MAYBE_UNIFY_CHAR. See the discussion starting at
4931 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4932 for the details.
4933
59f7af81
CY
49342012-09-25 Chong Yidong <cyd@gnu.org>
4935
4936 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4937
22e8cf4a
SM
49382012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4939
4940 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4941 when encountering an unknown bytecode.
4942
578098f3
PE
49432012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 image.c, indent.c: Use bool for booleans.
4946 * dispextern.h (struct image_type): Members valid_p, load, init
4947 now return bool, not int. All uses changed.
4948 * image.c: Omit unnecessary static decls.
4949 (x_create_bitmap_mask, x_build_heuristic_mask):
4950 Return void, not int, since callers don't care about the return value.
4951 (x_create_bitmap_mask, define_image_type, valid_image_p)
4952 (struct image_keyword, parse_image_spec, image_spec_value)
4953 (check_image_size, image_background)
4954 (image_background_transparent, x_clear_image_1)
4955 (postprocess_image, lookup_image, x_check_image_size)
4956 (x_create_x_image_and_pixmap, xbm_image_p)
4957 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4958 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4959 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4960 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4961 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4962 (png_image_p, init_png_functions, png_load_body, png_load)
4963 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4964 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4965 (init_gif_functions, gif_load, imagemagick_image_p)
4966 (imagemagick_load_image, imagemagick_load, svg_image_p)
4967 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4968 (gs_load):
4969 * nsimage.m (ns_load_image):
4970 * nsterm.m (ns_defined_color):
4971 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4972 * xfns.c (x_defined_color):
4973 * xterm.c (x_alloc_lighter_color_for_widget)
4974 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4975 (x_alloc_lighter_color):
4976 * indent.c (disptab_matches_widthtab, current_column)
4977 (scan_for_column, string_display_width, indented_beyond_p)
4978 (compute_motion, vmotion, Fvertical_motion):
4979 Use bool for booleans.
4980
a5f2b6ec
CY
49812012-09-24 Chong Yidong <cyd@gnu.org>
4982
4983 * chartab.c (Fset_char_table_default): Obsolete function removed.
4984
18e27ea8
PE
49852012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4986
afea8a8a
PE
4987 Move pid_t related decls out of lisp.h.
4988 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4989 (interruptible_wait_for_termination):
4990 Move these decls from lisp.h to syswait.h, since they use pid_t.
4991 Needed on FreeBSD; see Herbert J. Skuhra in
4992 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4993 * callproc.c: Include syswait.h.
4994
18e27ea8
PE
4995 gnutls.c, gtkutil.c: Use bool for boolean.
4996 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4997 (emacs_gnutls_handle_error):
4998 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4999 (xg_hide_tooltip, xg_create_frame_widgets)
5000 (create_dialog, xg_uses_old_file_dialog)
5001 (xg_get_file_with_chooser, xg_get_file_with_selection)
5002 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5003 (xg_item_label_same_p, xg_update_menubar)
5004 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5005 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5006 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5007 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5008 (update_frame_tool_bar, free_frame_tool_bar):
5009 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5010 * nsmenu.m (ns_update_menubar):
5011 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5012 * xfns.c (Fx_show_tip) [USE_GTK]:
5013 Use bool for boolean.
5014 * gtkutil.c (xg_update_frame_menubar):
5015 * xmenu.c (update_frame_menubar):
5016 Return void, not int, since caller ignores return value.
5017 * gtkutil.c (xg_change_toolbar_position):
5018 Return void, not 1.
5019
af0e9f75
JB
50202012-09-23 Juanma Barranquero <lekktu@gmail.com>
5021
5022 * makefile.w32-in (BLOCKINPUT_H): Remove.
5023 (SYSSIGNAL_H): New macro.
5024 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5025 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5026 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5027 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5028 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5029 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5030 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5031 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5032 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5033 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5034 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5035 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5036 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5037 ($(BLD)/w32xfns.$(O)): Update dependencies.
5038
5101529e
EZ
50392012-09-23 Eli Zaretskii <eliz@gnu.org>
5040
5041 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5042 fatal_error_backtrace.
5043
5044 * w32proc.c (sys_kill): Undo last change: don't do anything when
5045 invoked to deliver SIGABRT to our own process. This is now
5046 handled by emacs_raise.
5047
2c3ee0ad
JB
50482012-09-23 Juanma Barranquero <lekktu@gmail.com>
5049
5050 * w32term.c (w32_read_socket): Remove leftover reference to
5051 interrupt_input_pending.
5052
62a1d661
PE
50532012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5054
5055 Do not use SA_NODEFER.
5056 Problem reported by Dani Moncayo in
5057 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5058 * alloc.c (die):
5059 * sysdep.c (emacs_abort): Do not reset signal handler.
5060 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5061 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5062 wanted even on POSIXish hosts, and it doesn't work on Windows.
5063
a0942b9a
JD
50642012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5065
5066 * xterm.c (x_term_init): Call fixup_locale before and after calling
5067 gtk_init (Bug#12392).
5068
d07ff9db
CY
50692012-09-23 Chong Yidong <cyd@gnu.org>
5070
5071 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5072 Vdynamic_library_alist.
5073
5074 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5075 (Fgnutls_available_p): Caller changed.
5076
5077 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5078 (Flibxml_parse_xml_region): Likewise.
5079
5080 * dispextern.h (struct image_type): Remove arg from init function.
5081
5082 * image.c (Finit_image_library, lookup_image_type)
5083 (define_image_type): Remove now-unneeded second arg.
5084 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5085 (init_tiff_functions, init_gif_functions, init_svg_functions):
5086 Arglist and w32_delayed_load calling convention changed.
5087 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 5088 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 5089
4d7e6e51
PE
50902012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5091
5092 Simplify and avoid signal-handling races (Bug#12471).
5093 * alloc.c (die):
5094 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5095 Avoid recursive loop if there's a fatal error in the function itself.
5096 * atimer.c (pending_atimers):
5097 * blockinput.h: Don't include "atimer.h"; no longer needed.
5098 (interrupt_input_pending): Remove. All uses removed.
5099 pending_signals now counts both atimers and ordinary interrupts.
5100 This is less racy than having three separate pending-signal flags.
5101 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5102 (input_blocked_p):
5103 Rename from their upper-case counterparts BLOCK_INPUT,
5104 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5105 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5106 This makes it easier to access volatile variables more accurately.
5107 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5108 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5109 that's more reliable if the code is buggy and sets
5110 interrupt_input_blocked to a negative value. All uses changed.
5111 * atimer.c (deliver_alarm_signal):
5112 Remove. No need to deliver this to the parent; any thread can
5113 handle this signal now. All uses replaced by underlying handler.
5114 * atimer.c (turn_on_atimers):
5115 * dispnew.c (handle_window_change_signal):
5116 * emacs.c (handle_danger_signal):
5117 * keyboard.c (kbd_buffer_get_event):
5118 Don't reestablish signal handler; not needed with sigaction.
5119 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5120 (UNBLOCK_INPUT_TO):
5121 Rework to avoid unnecessary accesses to volatile variables.
5122 (UNBLOCK_INPUT_TO): Now a function.
5123 (totally_unblock_input, unblock_input): New decls.
5124 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5125 (init_data): Remove. Necessary stuff now done in init_signal.
5126 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5127 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5128 (fatal_error_code): Remove; no longer needed.
5129 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5130 it doesn't always backtrace. All uses changed. No need to reset
5131 signal to default, since sigaction and/or die does that for us now.
5132 Use emacs_raise (FOO), not kill (getpid (), FOO).
5133 (main): Check more-accurately whether we're dumping.
5134 Move fatal-error setup to sysdep.c
5135 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5136 * gtkutil.c (xg_get_file_name, xg_get_font):
5137 Remove no-longer-needed signal-mask manipulation.
5138 * keyboard.c, process.c (POLL_FOR_INPUT):
5139 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5140 * keyboard.c (read_avail_input): Remove.
5141 All uses replaced by gobble_input.
5142 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5143 (kbd_buffer_store_event_hold, gobble_input):
5144 (record_asynch_buffer_change) [USABLE_SIGIO]:
5145 (store_user_signal_events):
5146 No need to mess with signal mask.
5147 (gobble_input): If blocking input and there are terminals, simply
5148 set pending_signals to 1 and return. All hooks changed to not
5149 worry about whether input is blocked.
5150 (process_pending_signals): Clear pending_signals before processing
5151 them, in case a signal comes in while we're processing.
5152 By convention callers now test pending_signals before calling us.
5153 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5154 New functions, to support changes to blockinput.h.
5155 (handle_input_available_signal): Now extern.
5156 (reinvoke_input_signal): Remove. All uses replaced by
5157 handle_async_input.
5158 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
5159 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5160 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
5161 Clear sigmask reliably, even if Fsignal returns, which it can.
5162 Omit unnecessary accesses to volatile var.
5163 (quit_throw_to_read_char): No need to restore sigmask.
5164 * keyboard.c (gobble_input, handle_user_signal):
5165 * process.c (wait_reading_process_output):
5166 Call signal-handling code rather than killing ourselves.
5167 * lisp.h: Include <float.h>, for...
5168 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5169 (pending_signals): Now volatile.
5170 (syms_of_data): Now const if IEEE floating point.
5171 (handle_input_available_signal) [USABLE_SIGIO]:
5172 (terminate_due_to_signal, record_child_status_change): New decls.
5173 * process.c (create_process): Avoid disaster if memory is exhausted
5174 while we're processing a vfork, by tightening the critical section
5175 around the vfork.
5176 (send_process_frame, process_sent_to, handle_pipe_signal)
5177 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5178 ignores SIGPIPE.
5179 (send_process): No need for setjmp/longjmp any more, since the
5180 SIGPIPE stuff is now gone. Instead, report an error if errno
5181 is EPIPE.
5182 (record_child_status_change): Now extern. PID and W are now args.
5183 Return void, not bool. All callers changed.
5184 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5185 Remove. All uses removed. This bug should be fixed now in a
5186 different way.
5187 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5188 and record the child status change directly. This avoids the
5189 need to futz with the signal mask.
5190 (process_fatal_action): Move here from emacs.c.
5191 (emacs_sigaction_flags): New function, containing
5192 much of what used to be in emacs_sigaction_init.
5193 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5194 caught by emacs, to make races less likely.
5195 (deliver_process_signal): Rename from handle_on_main_thread.
5196 All uses changed.
5197 (BACKTRACE_LIMIT_MAX): Now at top level.
5198 (thread_backtrace_buffer, threadback_backtrace_pointers):
5199 New static vars.
5200 (deliver_thread_signal, deliver_fatal_thread_signal):
5201 New functions, for more-accurate delivery of thread-specific signals.
5202 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5203 (deliver_arith_signal): Handle in this thread, not
5204 in the main thread, since it's triggered by this thread.
5205 (maybe_fatal_sig): New function.
5206 (init_signals): New arg DUMPING so that we can be more accurate
5207 about whether we're dumping. Caller changed.
5208 Treat thread-specific signals differently from process-general signals.
5209 Block all signals while handling fatal error; that's safer.
5210 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5211 on IEEE hosts.
5212 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5213 Ignore SIGPIPE unless batch.
5214 (emacs_backtrace): Output backtrace for the appropriate thread,
5215 which is not necessarily the main thread.
5216 * syssignal.h: Include <stdbool.h>.
5217 (emacs_raise): New macro.
5218 * xterm.c (x_connection_signal): Remove; no longer needed
5219 now that we use sigaction.
5220 (x_connection_closed): No need to mess with sigmask now.
5221 (x_initialize): No need to reset SIGPIPE handler here, since
5222 init_signals does this for us now.
5223
8f4635e9
JD
52242012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5225
5226 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 5227 background rect may be larger (Bug#12245).
8f4635e9 5228
3296976d
CY
52292012-09-23 Chong Yidong <cyd@gnu.org>
5230
5231 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5232
d41e491e
PE
52332012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5234
5235 * .gdbinit: Just stop at fatal_error_backtrace.
5236 See Stefan Monnier's request in
5237 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5238 Remove no-longer-used query of system type.
5239
c88b867f
CY
52402012-09-22 Chong Yidong <cyd@gnu.org>
5241
5242 * search.c (Freplace_match): Doc fix (Bug#12325).
5243
5244 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5245
5246 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5247 (Fline_end_position): Doc fix.
5248
5249 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5250
bb4d86b4
CY
52512012-09-22 Chong Yidong <cyd@gnu.org>
5252
5253 * dispextern.h (struct image_type): Add new slot, storing a type
5254 initialization function.
5255
5256 * image.c (define_image_type): Call the image initializer function
5257 if it is defined. Arguments and return value changed.
5258 (valid_image_p, make_image): Callers changed.
5259 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
5260 (gif_type, imagemagick_type, svg_type, gs_type):
5261 Add initialization functions.
bb4d86b4
CY
5262 (Finit_image_library): Call lookup_image_type.
5263 (CHECK_LIB_AVAILABLE): Macro deleted.
5264 (lookup_image_type): Call define_image_type here, rather than via
5265 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5266 (syms_of_image): Move define_image_type calls for xbm_type and
5267 pbm_type to lookup_image_type.
5268
df9685f3
EZ
52692012-09-22 Eli Zaretskii <eliz@gnu.org>
5270
5271 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5272 'idle_timers' from here ...
5273 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5274 lists, to avoid infloops when the timer does something stupid,
5275 like reinvoke itself with the same or smaller time-out.
5276 (Bug#12447)
5277
8e17c9ba
MR
52782012-09-22 Martin Rudalics <rudalics@gmx.at>
5279
5280 * window.c (Fsplit_window_internal): Handle only Qt value of
5281 Vwindow_combination_limit separately.
5282 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
5283 (Vwindow_combination_limit): New default value.
5284 Rewrite doc-string.
8e17c9ba 5285
589bd69b
EZ
52862012-09-22 Eli Zaretskii <eliz@gnu.org>
5287
5288 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5289 the new overlay string. (Bug#10159)
5290
01108e3f
PE
52912012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5292
5293 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5294 or that fprintf is async-signal-safe. POSIX doesn't require
5295 either assumption.
5296
82f8cd94
CY
52972012-09-22 Chong Yidong <cyd@gnu.org>
5298
5299 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5300 (Bug#8207).
5301
3cccbd87
KH
53022012-09-22 Kenichi Handa <handa@gnu.org>
5303
5304 * composite.c (composition_reseat_it): Handle the case that a
5305 grapheme cluster is not covered by a single font (Bug#12352).
5306
09c01941
CY
53072012-09-21 Chong Yidong <cyd@gnu.org>
5308
5309 * image.c (define_image_type): Avoid adding duplicate types to
5310 image_types (Bug#12463). Suggested by Jörg Walter.
5311
acfa068f 53122012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
5313
5314 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5315 (print_load_command_name): Add case LC_DATA_IN_CODE.
5316 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5317
acfa068f 53182012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
5319
5320 * eval.c (Frun_hook_with_args_until_success)
5321 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5322
acfa068f 53232012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
5324
5325 * fileio.c (Ffile_selinux_context): Only call freecon when
5326 lgetfilecon succeeded.
5327 (Fset_file_selinux_context): Likewise. (Bug#12444)
5328
acfa068f 53292012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
5330
5331 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5332 reordering, locate the cursor by calling set_cursor_from_row; if
5333 that fails, clear the desired glyph matrix before returning a
5334 failure indication to the caller. Fixes leaving garbled display
5335 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
5336 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5337 scrolling through multibyte text.
aa36e4d2 5338
e99f70c8
SM
53392012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5340
5341 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5342 calling mark_vectorlike since that's the one that marks the window.
5343 (mark_discard_killed_buffers): Mark the final cdr.
5344 * window.h (struct window): Move prev/next_buffers to the
5345 non-standard fields.
5346 * window.c (make_window): Initialize prev/next_buffers manually.
5347
f75beb47
PE
53482012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5349
5350 Omit unused arg EXPECTED from socket hooks.
5351 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5352 * nsterm.m (ns_term_init):
5353 * termhooks.h (struct terminal.read_socket_hook):
5354 * w32inevt.c (w32_console_read_socket):
5355 * w32term.c (w32_read_socket):
5356 * xterm.c (XTread_socket):
5357 Omit unused arg EXPECTED. All callers changed.
5358 (store_user_signal_events): Return void, not int, since callers no
5359 longer care about the return value. All uses changed.
5360
b019b76a
JB
53612012-09-20 Juanma Barranquero <lekktu@gmail.com>
5362
5363 * w32gui.h (XParseGeometry): Do not declare.
5364
05642592
PE
53652012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5366
e4bce92a 5367 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 5368 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
5369 <http://bugs.gnu.org/12471#8> (last line).
5370
05642592
PE
5371 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5372 (XParseGeometry): Now static. Substitute extremal values for
5373 values that are out of range.
5374
e543ae91
JD
53752012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5376
5377 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5378
5379 * nsfns.m (XParseGeometry): Remove.
5380 (Fx_create_frame): Call x_set_offset to correctly interpret
5381 top_pos in geometry.
5382
3a880af4 5383 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
5384 (Fx_parse_geometry): If there is a space in string, call
5385 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5386
45ba16c7
EZ
53872012-09-17 Eli Zaretskii <eliz@gnu.org>
5388
c8b9f1bc
EZ
5389 * search.c (scan_buffer): Use character positions in calls to
5390 region_cache_forward and region_cache_backward, not byte
5391 positions. (Bug#12196)
5392
b4c932a2
EZ
5393 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5394 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5395
45ba16c7
EZ
5396 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5397 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5398 emacs_blocked_malloc, now deleted.
5399
eeceac93
PE
54002012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5401
5402 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5403 The workaround was for improving performance on Solaris 2.4, but
5404 is getting in the way now. Emacs will still work if someone is
5405 still running Solaris 2.4 in a museum somewhere; Sun dropped
5406 support for Solaris 2.4 in 2003.
5407 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5408 * process.c (create_process) [HAVE_WORKING_VFORK]:
5409 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5410 since Emacs no longer uses vfork on that platform.
5411
78f83752
GM
54122012-09-17 Glenn Morris <rgm@gnu.org>
5413
5414 * emacs.c: Use COPYRIGHT.
5415
634b8cac
PE
54162012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5417
0caaedb1
PE
5418 Remove configure's --without-sync-input option (Bug#12450).
5419 When auditing signal-handling in preparation for cleaning it up,
5420 I found that SYNC_INPUT has race conditions and would be a real
5421 pain to fix. Since it's an undocumented and deprecated
5422 configure-time option, now seems like a good time to remove it.
5423 Also see <http://bugs.gnu.org/11080#16>.
5424 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5425 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5426 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5427 (malloc_hysteresis):
5428 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5429 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5430 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5431 (dont_register_blocks, bytes_used_when_reconsidered)
5432 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5433 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5434 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 5435 Remove. All uses removed.
0caaedb1
PE
5436 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5437 implementation, one that depends on whether the new macro
5438 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5439 is defined.
5440 * atimer.c (run_timers, handle_alarm_signal):
5441 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5442 (handle_async_input, process_pending_signals)
5443 (handle_input_available_signal, init_keyboard):
5444 * nsterm.m (ns_read_socket):
5445 * process.c (wait_reading_process_output):
5446 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5447 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5448 (emacs_write):
5449 * xterm.c (XTread_socket):
5450 Assume SYNC_INPUT.
5451 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5452 * eval.c (handling_signal): Remove. All uses removed.
5453 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5454 All uses replaced with the SYNC_INPUT version.
5455 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5456 Remove decls.
5457 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5458 Now static.
5459
634b8cac
PE
5460 * font.c (Ffont_shape_gstring): Remove unused local.
5461
83da1b55
GM
54622012-09-16 Glenn Morris <rgm@gnu.org>
5463
518650a5
GM
5464 * Makefile.in (clean): No longer run nextstep's clean.
5465
83da1b55
GM
5466 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5467 (ns_frag): Remove.
5468 (ns-app): Move here from ns.mk, and simplify.
5469 (clean): Simplify nextstep entry.
5470 * ns.mk: Remove file.
5471
85a43e2e
KH
54722012-09-17 Kenichi Handa <handa@gnu.org>
5473
5474 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5475 not covert the last few charactes.
5476
ba13e616 54772012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
5478
5479 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5480 here, but just check the validity of glyphs in the glyph-string.
5481
a8c729af
MR
54822012-09-16 Martin Rudalics <rudalics@gmx.at>
5483
3a880af4
SM
5484 * window.c (Fwindow_parameter, Fset_window_parameter):
5485 Accept any window as argument (Bug#12452).
a8c729af 5486
c077c059
JD
54872012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5488
5489 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5490 to ns_term_init to avoid memory leak.
5491
5492 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5493 explicit retain/release.
5494 (ns_term_init): Only allow one display. Initialize outerpool and
5495 ns_*_types.
5496
39a57ad0
PE
54972012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5500 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5501 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5502 the Microsoft problem in a different way, by altering ../nt/config.nt.
5503
7105c8cb
EZ
55042012-09-15 Eli Zaretskii <eliz@gnu.org>
5505
5506 * w32xfns.c:
5507 * w32uniscribe.c:
5508 * w32term.c:
5509 * w32select.c:
5510 * w32reg.c:
5511 * w32proc.c:
5512 * w32menu.c:
5513 * w32inevt.c:
5514 * w32heap.c:
5515 * w32font.c:
5516 * w32fns.c:
5517 * w32console.c:
5518 * w32.c:
5519 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5520 by lisp.h. This completes removal of setjmp.h inclusion
5521 erroneously announced in the previous commit. (Bug#12446)
5522
5523 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5524 more accurate.
5525
5526 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5527 not defined as a macro. The latter happens on MS-Windows.
5528 (Bug#12446)
5529
0328b6de
PE
55302012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5531
5532 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5533 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 5534 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
5535 only reason for the instance was because "lisp.h" was included.
5536 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5537 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5538 and _longjmp with the new symbols. Emacs already uses _setjmp if
5539 available, so this change affects only POSIXish hosts that have
5540 sigsetjmp but not _setjmp, such as some versions of Solaris and
5541 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5542 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5543 (png_load_body) [HAVE_PNG]:
5544 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5545 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5546 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5547 since PNG requires jmp_buf. This is the only exception to the
5548 general rule that we now use sys_setjmp and sys_longjmp.
5549 This exception is OK since this code does not change the signal
5550 mask or longjmp out of a signal handler.
5551
2af03429
PE
55522012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5553
5554 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5555 Include "syssignal.h", for 'main_thread'.
5556
2f294edf
DA
55572012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5558
5559 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
5560 * insdel.c (replace_range, replace_range_2):
5561 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
5562 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5563 Remove redundant check before calling offset_intervals.
5564
6b533e9c
MR
55652012-09-14 Martin Rudalics <rudalics@gmx.at>
5566
5567 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5568 current buffer (Bug#12387).
5569
2a7931e3
JB
55702012-09-14 Juanma Barranquero <lekktu@gmail.com>
5571
5572 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5573
c18e885b
PE
55742012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5575
5576 Use a more backwards-compatible timer format (Bug#12430).
5577 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5578 vector element, not from the 4th, since PSECS is now at the end.
5579 (Fcurrent_idle_time): Doc fix.
5580
d59a1afb
DA
55812012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5582
5583 Function to mark objects and remove killed buffers at once.
5584 * alloc.c (discard_killed_buffers): Rename to ...
5585 (mark_discard_killed buffers) ... new name. Add marking
5586 of remaining objects. Fix comment. Adjust users.
5587 (mark_object): Do not touch frame buffer lists here.
5588 * frame.c (delete_frame): Reset frame buffer lists here.
5589
5f0cb45a
PE
55902012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5591
8ea47e3a
PE
5592 Better workaround for GNOME bug when --enable-gcc-warnings.
5593 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5594 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5595 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5596
4a4bbad2
PE
5597 Simplify SIGIO usage (Bug#12408).
5598 The code that dealt with SIGIO was crufty and confusing, e.g., it
5599 played tricks like "#undef SIGIO" but these tricks were not used
5600 consistently. Simplify mostly by not #undeffing standard symbols,
5601 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5602 or not as we please) rather than "defined SIGIO" (standard symbol
5603 that we probably shouldn't #undef).
5604 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5605 Modules that need it can include it.
5606 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5607 * dispextern.h (ignore_sigio): New decl.
5608 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5609 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5610 * emacs.c (shut_down_emacs):
5611 * keyboard.c (kbd_buffer_store_event_hold):
5612 Use ignore_sigio rather than invoking 'signal' directly.
5613 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5614 for FIONREAD.
5615 (FIONREAD, SIGIO): Do not #undef.
5616 (tty_read_avail_input): Use #error rather than a syntax error.
5617 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5618 for I_PIPE, used by SETUP_SLAVE_PTY.
5619 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5620 * sysdep.c (croak): Remove; no longer needed. This bit of
5621 temporary code, with Fred N. Fish's comment that it's temporary,
5622 has been in Emacs since at least 1992!
5623 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5624 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5625 * syssignal.h (croak): Remove decl.
5626 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5627 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5628 now that we're termios-only.
5629 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5630 * term.c (dissociate_if_controlling_tty): Use #error rather than
5631 a run-time error.
5632
5f0cb45a
PE
5633 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5634 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5635 to work around GNOME bug 683906.
5636 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5637 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5638 This works around GCC bug 54561.
5639
40bce90b
PE
56402012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5641
5642 More fixes for 'volatile' and setjmp/longjmp.
5643 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5644 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5645 (png_load_body) [HAVE_PNG]:
5646 (jpeg_load_body) [HAVE_JPEG]:
5647 New function, with most of the old parent function's body.
5648 (png_load) [HAVE_PNG]:
5649 (jpeg_load) [HAVE_JPEG]:
5650 Invoke the new function, to avoid longjmp munging our locals.
5651 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5652 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5653 longjmp is passed 2, as the C standard doesn't guarantee this.
5654 Instead, store the failure code into mgr->failure_code.
5655
bfeae2cf
SM
56562012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5657
5658 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5659 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5660 (syms_of_keyboard): Remove support for unread-command-char.
5661
8099e36b
EZ
56622012-09-12 Eli Zaretskii <eliz@gnu.org>
5663
5664 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5665 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5666 violation. (Bug#12426)
5667
92547ff9
PE
56682012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5669
5670 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5671
45b82ad0
SM
56722012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5673
5674 * eval.c: Add `inhibit-debugger'.
5675 (Qinhibit_debugger): New symbol.
5676 (call_debugger): Bind it instead of Qdebug_on_error.
5677 (maybe_call_debugger): Test Vinhibit_debugger.
5678 (syms_of_eval): Define inhibit-debugger.
5679 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5680 (syms_of_xdisp): Remove inhibit-debug-on-message.
5681
5779a1dc
PE
56822012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5683
50f2e553
PE
5684 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5685 If a nonvolatile local variable is written before a _longjmp to
5686 the frame containing the variable, and is read after the _longjmp,
5687 the value read is indeterminate. Some local variables of type
5688 'struct handler' and 'struct catchtag' are used in this way, so
5689 mark each of their slots as volatile if the slot can be set before
5690 _longjmp and read afterwards.
5691 * lisp.h (struct handler): var and chosen_clause are now volatile.
5692 (struct catchtag): val, next, and pdlcount are now volatile.
5693
ae1d87e2
PE
5694 * bidi.c (bidi_push_it, bidi_pop_it):
5695 * fns.c (copy_hash_table):
5696 * image.c (define_image_type):
5697 * keyboard.c (kbd_buffer_store_event_hold):
5698 * process.c (Fprocess_send_eof):
5699 * xfaces.c (x_create_gc) [HAVE_NS]:
5700 * xgselect.c (xg_select):
5701 Prefer assignment to memcpy when either will do.
5702
5779a1dc
PE
5703 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5704 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5705 time an item is removed. No need to mark this function 'inline';
5706 the compiler knows better than we do.
5707
c4c9756b
JD
57082012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5709
5710 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5711 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5712 to change_frame_size (Bug#12388).
5713 (windowDidResize:): Pass YES to updateFrameSize.
5714
5715 * nsterm.h: Add delay parameter to updateFrameSize.
5716
d73e321c
DA
57172012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5718
5719 Discard killed buffers from deleted window and frame objects.
5720 This reduces an amount of references to killed buffers and
5721 helps GC to reclaim them faster.
5722 * alloc.c (discard_killed_buffers): New function.
5723 (mark_object): Use it for deleted windows and frames.
5724 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 5725 or deleted frame, restore its global binding.
d73e321c
DA
5726 * data.c (swap_in_global_binding): Add GC notice.
5727 (swap_in_symval_forwarding): Use convenient set_blv_where.
5728 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5729 * window.h: ... to here.
5730
e578f381
DA
57312012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5732
5733 Convenient macro to check whether the buffer is live.
5734 * buffer.h (BUFFER_LIVE_P): New macro.
5735 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5736 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5737
3057e615
YM
57382012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5739
5740 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5741 composition cases (Bug#12364).
5742
5743 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5744 overhang of succeeding glyphs overlapping box cursor.
5745
5746 * w32term.c (x_draw_glyph_string): Likewise.
5747
6fda35f2
PE
57482012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5749
c990426a
PE
5750 Simplify, document, and port floating-point (Bug#12381).
5751 The porting part of this patch fixes bugs on non-IEEE platforms
5752 with frexp, ldexp, logb.
5753 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5754 Now static.
5755 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5756 support, by removing commented-out code and briefly listing the
5757 C89 functions excluded. The commented-out stuff was confusing
5758 maintenance, e.g., we thought we needed cbrt but it was commented out.
5759 (logb): Remove decl; no longer needed.
5760 (isfinite): New macro, if not already supplied.
5761 (isnan): Don't replace any existing macro.
5762 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5763 are present on all C89 platforms.
5764 (Ffrexp): Do not special-case zero, as frexp does the right thing
5765 for that case.
5766 (Flogb): Do not use logb, as it doesn't have the desired meaning
5767 on hosts that use non-base-2 floating point. Instead, stick with
5768 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5769 frexp, to avoid getting an unspecified result.
5770
6fda35f2
PE
5771 * xdisp.c (Qinhibit_debug_on_message): Now static.
5772
16130a58
JD
57732012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5774
5775 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5776 NSBezierPath (Bug#12131).
5777
d105a573
CY
57782012-09-10 Chong Yidong <cyd@gnu.org>
5779
5780 * fns.c (Fdelq, Fdelete): Doc fix.
5781
ff55dfe8
PE
57822012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5783
5784 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5785 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5786
e7032e7c
SM
57872012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5788
5789 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5790 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5791 Use it.
5792
e9957956
EZ
57932012-09-09 Eli Zaretskii <eliz@gnu.org>
5794
aba05ce9
EZ
5795 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5796 left fringe if the window has a left margin. This avoids leaving
5797 traces of the cursor because its leftmost pixel is not drawn over.
5798
e9957956
EZ
5799 * dispnew.c (update_window_line): When the left margin area of a
5800 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5801 that screen line. (Bug#12277)
5802
f6196b87
PE
58032012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5804
5805 Assume C89 or later for math functions (Bug#12381).
5806 This simplifies the code, and makes it a bit smaller and faster,
5807 and (most important) makes it easier to clean up signal handling
5808 since we can stop worring about floating-point exceptions in
5809 library code. That was a problem before C89, but the problem
5810 went away many years ago on all practical Emacs targets.
5811 * data.c, image.c, lread.c, print.c:
5812 Don't include <math.h>; no longer needed.
5813 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5814 might be autoconfigured, as that never happens.
5815 * data.c (fmod):
5816 * doprnt.c (DBL_MAX_10_EXP):
5817 * print.c (DBL_DIG):
5818 Remove. C89 or later always defines these.
5819 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5820 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5821 (arith_error, domain_error, domain_error2):
5822 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5823 no longer needed -- we simply return what C returns. All uses removed.
5824 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5825 the wrapped code.
5826 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5827 Remove. All uses expanded, as these macros are no longer used
5828 more than once and are now more trouble than they're worth.
5829 (Ftan): Use tan, not sin / cos.
5830 (Flogb): Assume C89 frexp.
5831 (fmod_float): Assume C89 fmod.
5832 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5833 (init_floatfns): Remove. All uses removed.
5834
9d7f1863
JD
58352012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5836
5837 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5838 compositeToPoint for OSX < 10.6 (Bug#12390).
5839
eabf0404
PE
58402012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5841
5842 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5843 This produces more-accurate results.
5844
0b3b1d23
JD
58452012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5846
5847 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5848 changes (Bug#12088).
5849
6dcef6ec
CY
58502012-09-08 Chong Yidong <cyd@gnu.org>
5851
5852 * syntax.c (Fstring_to_syntax): Doc fix.
5853
aa7d57c5
JD
58542012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5855
5856 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5857 in the internal border.
5858 (x_set_window_size): Remove static variables and their usage.
5859 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
5860 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5861 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
5862 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5863 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5864 (ns_fix_rect_ibw): Remove.
5865 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5866 (ns_dumpglyphs_box_or_relief): Ditto.
5867 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5868 adjustment.
5869 (ns_dumpglyphs_image): Ditto.
fc0c31f8 5870 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
5871 border adjustment.
5872 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5873 their usage. Add fringe_extended_p and its use as in other terms.
5874 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5875 scroll bar was removed.
5876 (updateFrameSize): New function.
5877 (windowDidResize): Move code to updateFrameSize and call it.
5878
5879 * nsterm.h (EmacsView): Add updateFrameSize.
5880
1a5432bc
CY
58812012-09-07 Chong Yidong <cyd@gnu.org>
5882
b4f5313e
CY
5883 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5884
1a5432bc
CY
5885 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5886
1a4f1e9b
PE
58872012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5888
5889 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
5890 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5891 Problem introduced when merging patches. Noted by Eli Zaretskii in
5892 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
5893 * floatfns.c: Comment fix.
5894 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5895 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5896 and anyway the declaration is harmless even if SIGDANGER is not defined.
5897 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5898 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5899 source files not surprisingly expected syssignal.h to define, or
5900 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5901 Include <sys/ioctl.h>, for FIONREAD.
5902 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5903 This eliminates a problem whereby other files mysteriously had
5904 to include "syssignal.h" before including "systty.h" if they
5905 wanted to use "#ifdef SIGIO".
5906
bc8000ff
EZ
59072012-09-07 Eli Zaretskii <eliz@gnu.org>
5908
3e6d6928
EZ
5909 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5910
5911 * w32.c (sigemptyset): Empty the set.
5912 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5913
bc8000ff
EZ
5914 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5915
b4fa72f2
DA
59162012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5917
5918 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5919 (mark_object): Likewise for frame objects.
5920
30730c93
PE
59212012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5922
5923 * syssignal.h (handle_on_main_thread): Always declare,
5924 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5925 This ports to platforms without HAVE_PTHREAD.
5926
2fe28299
PE
59272012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5928
5929 Signal-handler cleanup (Bug#12327).
5930 Emacs's signal handlers were written in the old 4.2BSD style with
5931 sigblock and sigmask and so forth, and this led to some
5932 inefficiencies and confusion. Rewrite these to use
5933 pthread_sigmask etc. without copying signal sets around. Also,
5934 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5935 'signal', and instead use functions that do not attempt to take
5936 over the system name space. This patch causes Emacs's text
5937 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5938 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5939 Do not include <signal.h> or "syssignal.h", as these
5940 modules do not use signals.
5941 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5942 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5943 Do not include <signal.h>, as "syssignal.h" does that for us now.
5944 * atimer.c (sigmask_atimers): New function.
5945 (block_atimers, unblock_atimers): New functions,
5946 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5947 All uses replaced.
5948 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5949 no longer needed here.
5950 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 5951 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
5952 * sysdep.c (struct save_signal): New member 'action', replacing
5953 old member 'handler'.
5954 (save_signal_handlers, restore_signal_handlers):
5955 Use sigaction instead of 'signal' to save and restore.
5956 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5957 New function. All users of 'signal' modified to use set_sighandler
5958 if they're writeonly, and to use sys_signal if they're read+write.
5959 (emacs_sigaction_init, forwarded_signal): New functions.
5960 (sys_signal): Remove. All uses replaced by calls to sigaction
5961 and emacs_sigaction_init, or by direct calls to 'signal'.
5962 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5963 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5964 all uses replaced by pthread_sigmask etc. calls.
5965 * syssignal.h: Include <signal.h>.
5966 (emacs_sigaction_init, forwarded_signal): New decls.
5967 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5968 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5969 (sigmask, sys_sigmask): Remove; no longer needed.
5970 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5971 (sigblock, sigunblock, sigfree):
5972 (sigsetmask) [!defined sigsetmask]:
5973 Remove. All uses replaced by pthread_sigmask.
5974 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5975 no longer need to be replaced, and its typical old uses
5976 are now done via emacs_sigaction_init and sigaction.
5977 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5978 (sys_sigdel): Remove; unused.
5979 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5980
0216c128
EZ
59812012-09-06 Eli Zaretskii <eliz@gnu.org>
5982
5983 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5984 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5985
c752cfa9
DA
59862012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5987
5988 Explicitly mark buffer_defaults and buffer_local_symbols.
5989 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5990 mark_local_symbols here.
5991 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5992 since special buffers aren't marked here any more.
5993 (allocate_buffer): Chain new buffer with all_buffers here...
5994 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5995 not here.
5996 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5997 (syms_of_buffer): Remove staticpro of the above.
5998 (init_buffer_once): Set names for buffer_defaults and
5999 buffer_local_symbols.
6000
a864ef14
PE
60012012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6002
6003 Use bool for booleans in font-related modules.
6004 * font.c (font_intern_prop, font_style_to_value)
6005 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6006 (generate_otf_features, font_check_otf_features, font_check_otf)
6007 (font_match_p, font_list_entities, font_at):
6008 * fontset.c (fontset_id_valid_p, reorder_font_vector
6009 (fontset_find_font, Fset_fontset_font)
6010 (face_suitable_for_char_p) [0]:
6011 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6012 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6013 (m17n_flt_initialized, ftfont_shape_by_flt):
6014 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6015 * nsfont.m (nsfont_draw):
6016 * w32font.c (w32font_draw):
6017 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6018 Use bool for booleans.
6019 * font.h: Adjust to above API changes.
6020 (struct font, struct font_driver, struct font_driver_list):
6021 Use bool for booleans.
6022 (struct font): Remove useless member encoding_type.
6023 All users removed.
6024 * fontset.c, xftfont.c: Omit unnecessary static decls.
6025
0699fc18
DA
60262012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6027
6028 * alloc.c (mark_object): Revert window marking code
6029 since it's unsafe for the Fset_window_configuration.
6030
20ef56db
PE
60312012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6032
2fe28299 6033 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
6034 Be more systematic about preserving errno whenever a signal
6035 handler returns, even if it's not in the main thread. Do this by
6036 renaming signal handlers to distinguish between signal delivery
6037 and signal handling. All uses changed.
6038 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6039 * data.c (deliver_arith_signal): Rename from arith_error.
6040 * dispnew.c (deliver_window_change_signal): Rename from
6041 window_change_signal.
6042 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6043 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6044 * keyboard.c (deliver_input_available_signal): Rename from
6045 input_available_signal.
6046 (deliver_user_signal): Rename from handle_user_signal.
6047 (deliver_interrupt_signal): Rename from interrupt_signal.
6048 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6049 (deliver_child_signal): Rename from sigchld_handler.
6050 * atimer.c (handle_alarm_signal):
6051 * data.c (handle_arith_signal):
6052 * dispnew.c (handle_window_change_signal):
6053 * emacs.c (handle_fatal_signal, handle_danger_signal):
6054 * keyboard.c (handle_input_available_signal):
6055 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6056 * process.c (handle_pipe_signal, handle_child_signal):
6057 New functions, with the actual signal-handling code taken from the
6058 original respective signal handlers, sans the sporadic attempts to
6059 preserve errno, since that's now done by handle_on_main_thread.
6060 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6061 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6062 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6063 Move to sysdep.c.
6064 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6065 Move initialization of main_thread to sysdep.c's init_signals.
6066 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6067 our usage, and simplifies the mainline code.
6068 (record_child_status_change): New static function, as a helper
6069 for handle_child_signal, and with most of the old child handler's
6070 contents.
6071 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6072 (handle_child_signal): Use the above.
6073 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6074 Moved here from emacs.c.
6075 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6076 code moved here from emacs.c's main function.
6077 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
6078 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6079 This lets callers save and restore errno properly.
20ef56db 6080
e3ccf108
DA
60812012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6082
6083 Remove redundant or unused things here and there.
6084 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6085 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6086 * editfns.c (Fcompare_buffer_substrings): Likewise.
6087 * frame.h (struct terminal, struct font_driver_list):
6088 Remove redundant declarations.
6089 * window.h (Qleft, Qright): Likewise.
6090
697e1e39
DA
60912012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6092
6093 Do not mark objects from deleted buffers, windows and frames.
6094 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6095 (mark_object): Likewise for windows and frames.
6096
c1ca42ca
DA
60972012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6098
6099 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6100 buffer_defaults and buffer_local_symbols as valid objects.
6101 Return special value to denote them.
6102
014d93be
PE
61032012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6104
f75d7a91
PE
6105 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6106 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6107 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6108 (file_name_absolute_p, Fsubstitute_in_file_name):
6109 (check_executable, check_writable, Ffile_accessible_directory_p)
6110 (Fset_file_selinux_context, Fdefault_file_modes)
6111 (Finsert_file_contents, choose_write_coding_system)
6112 (Fwrite_region, build_annotations, a_write, e_write)
6113 (Fdo_auto_save):
6114 * filelock.c (boot_time_initialized, get_boot_time)
6115 (get_boot_time_1, lock_file_1, within_one_second):
6116 * floatfns.c (in_float):
6117 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6118 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6119 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6120 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6121 * window.c (compare_window_configurations):
6122 Use bool for booleans.
6123 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6124 (Fdefault_file_modes): Now mode_t, not int, for modes.
6125 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6126 (internal_delete_file): Now returns void, not a (boolean) int,
6127 since nobody was looking at the return value.
6128 * lisp.h, window.h: Adjust to above API changes.
6129
014d93be
PE
6130 * xdisp.c (set_message): Simplify and reindent last change.
6131
776f29e1
JB
61322012-09-05 Juanma Barranquero <lekktu@gmail.com>
6133
6134 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6135
7f7e0167
LI
61362012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6137
6138 * eval.c (call_debugger): Make the function non-static so that we
6139 can call it from set_message.
6140
6141 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6142 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6143
cf29dd84
PE
61442012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6145
6146 Give more-useful info on a fatal error (Bug#12328).
6147 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6148 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6149 of doing the work ourselves.
6150 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6151 do most of the work.
6152 (fatal_error_backtrace): New function, taken from the guts
6153 of the old fatal_error_signal, but with a new option to output
6154 a backtrace.
6155 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6156 info about the signal than just its number.
6157 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6158 * sysdep.c: Include <execinfo.h>
6159 (emacs_backtrace): New function, taken partly from the previous
6160 code of the 'die' function.
6161 (emacs_abort): Call fatal_error_backtrace rather than abort.
6162
972debf2
SM
61632012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6164
6165 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6166 eager (load-time) macro-expansion.
6167 * lisp.mk (lisp): Add macroexp.
6168
1088b922
PE
61692012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6170
6171 Simplify redefinition of 'abort' (Bug#12316).
6172 Do not try to redefine the 'abort' function. Instead, redo
6173 the code so that it calls 'emacs_abort' rather than 'abort'.
6174 This removes the need for the NO_ABORT configure-time macro
6175 and makes it easier to change the abort code to do a backtrace.
6176 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6177 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6178 Remove; sysdep.c's emacs_abort now takes its place.
6179 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6180 'abort' changed to use 'emacs_abort'.
6181 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6182 (abort) [!defined abort]: Rename to ...
6183 (emacs_abort): ... new name.
6184 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6185 the place of the old 'abort' in emacs.c.
6186 * w32.c, w32fns.c (abort): Do not #undef.
6187 * w32.c (emacs_abort): Rename from w32_abort.
6188
30934d33
EZ
61892012-09-04 Eli Zaretskii <eliz@gnu.org>
6190
6191 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6192 offsets[j].dv, since the y axis of the screen coordinates points
6193 down, while the y axis of the font definition coordinates points
6194 up. This fixes display of Arabic diacritics such as KASRA and
6195 KASRATAN. (Bug#11860)
6196
af26b72c
PE
61972012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6198
6199 Be more systematic about _setjmp vs setjmp.
6200 * alloc.c (test_setjmp, mark_stack):
6201 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6202 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6203 (png_load, my_error_exit, jpeg_load):
6204 * process.c (send_process_trap, send_process):
6205 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6206 The underscored versions are up to 30x faster on some hosts.
6207 Formerly, the code used setjmp+longjmp sometimes and
6208 _setjmp+_longjmp at other times, with no particular reason to
6209 prefer setjmp+longjmp.
6210
26d4541d
PE
62112012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6212
d42f4f0f 6213 Fix minor problem found by static checking.
26d4541d 6214 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 6215
c5e28e39
MR
62162012-09-03 Martin Rudalics <rudalics@gmx.at>
6217
6218 * buffer.c (Fdelete_all_overlays): New function.
6219
3eab3ca9
CY
62202012-09-03 Chong Yidong <cyd@gnu.org>
6221
6222 * gtkutil.c: Add extern decl for Qxft.
6223
c04889f8
PE
62242012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6225
1882aa38
PE
6226 * emacs.c, eval.c: Use bool for boolean.
6227 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6228 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6229 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6230 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6231 (main, decode_env_path, Fdaemon_initialized):
6232 * eval.c (call_debugger, Finteractive_p, interactive_p):
6233 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6234 (maybe_call_debugger, Fbacktrace):
6235 * process.c (read_process_output, exec_sentinel):
6236 Use bool for booleans.
6237 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6238 All callers changed.
6239 * eval.c (interactive_p): Omit always-true boolean argument
6240 EXCLUDE_SUBRS_P. All callers changed.
6241 * dispextern.h, lisp.h: Reflect above API changes.
6242 * firstfile.c (dummy): Use the address of 'main', whose signature
6243 won't change, instead of the address of 'initialize', whose
6244 signature just changed from int to bool.
6245 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6246 * msdos.c (fatal_error_in_progress): ... from here.
6247 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6248 of incrementing it.
6249 (redisplay_internal, unwind_redisplay): Simply clear
6250 REDISPLAYING_P when unwinding, instead of saving its previous,
6251 always-false value and then restoring it.
6252
a411ac43
PE
6253 Clean up some extern decls.
6254 Mostly, this hoists extern decls out of .c files and into .h files.
6255 That way, we're more likely to catch errors if the interfaces change.
6256 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6257 declare xg_mark_data.
6258 * dispextern.h (x_frame_parm_handlers):
6259 * font.h (Qxft):
6260 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6261 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6262 (Qultra_bold, Qoblique, Qitalic):
6263 Move extern decl here from .c file.
6264 * alloc.c (xg_mark_data) [USE_GTK]:
6265 * doc.c (Qclosure):
6266 * eval.c (Qlexical_binding):
6267 * fns.c (time) [!HAVE_UNISTD_H]:
6268 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6269 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6270 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6271 * lread.c (Qinternal_interpreter_environment):
6272 * minibuf.c (Qbuffer):
6273 * process.c (QCfamily, QCfilter):
6274 * widget.c (free_frame_faces):
6275 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6276 * xfont.c (x_clear_errors):
6277 * xterm.c (x_frame_parm_handlers):
6278 Remove now-redundant extern decls.
6279 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6280 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6281 Now static.
6282 * xfaces.c: Remove unnecessary static decls.
6283 * xterm.c (updating_frame): Remove decl of nonexistent object.
6284
c04889f8
PE
6285 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6286 when building globals.h, as the objects that are not built on
6287 this host are not needed to compile C files on this host.
6288
8b339673
JD
62892012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6290
6291 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6292
6293 * frame.h: Add missing prototype for x_wm_set_size_hint.
6294
a08d4ba7
PE
62952012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6296
6297 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6298 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6299 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6300 (Fsubstitute_command_keys):
6301 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6302 (save_excursion_save, save_excursion_restore)
6303 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6304 (format_time_string, general_insert_function)
6305 (make_buffer_string, make_buffer_string_both)
6306 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6307 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6308 (copy_text, insert_1, insert_1_both, insert_from_string)
6309 (insert_from_string_before_markers, insert_from_string_1)
6310 (insert_from_buffer, insert_from_buffer_1, replace_range)
6311 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6312 (del_range_2, modify_region):
6313 * intervals.c (intervals_equal, balance_possible_root_interval)
6314 (adjust_intervals_for_insertion, merge_properties_sticky)
6315 (graft_intervals_into_buffer, lookup_char_property)
6316 (adjust_for_invis_intang, set_point_both)
6317 (get_property_and_range, compare_string_intervals)
6318 (set_intervals_multibyte_1, set_intervals_multibyte):
6319 * keyboard.c (decode_timer):
6320 Use bool for boolean.
6321 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6322 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6323
48c948de
CY
63242012-09-02 Chong Yidong <cyd@gnu.org>
6325
6326 * keymap.c (push_key_description): Print M-TAB as C-M-i
6327 (Bug#11758).
6328
6c49a40b
JB
63292012-09-02 Juanma Barranquero <lekktu@gmail.com>
6330
6331 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6332 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6333 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6334 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6335 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6336 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6337 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6338
4dfbd238
EZ
63392012-09-01 Eli Zaretskii <eliz@gnu.org>
6340
7e510e28
EZ
6341 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6342 more than one grapheme cluster passed to the shaper: compute the
6343 offset adjustment values separately for each cluster. (Bug#11860)
6344
4dfbd238
EZ
6345 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6346 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6347 about implicit conversions from integer to pointer.
6348
86571ae0
DC
63492012-09-01 Daniel Colascione <dancol@dancol.org>
6350
6351 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6352 system used too early.
6353
0e23ef9d
PE
63542012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6355
6356 Better seed support for (random).
6357 * emacs.c (main): Call init_random.
6358 * fns.c (Frandom): Set the seed from a string argument, if given.
6359 Remove long-obsolete Gentzel cruft.
6360 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6361 (init_random): New function.
6362
17a2cbbd
DC
63632012-09-01 Daniel Colascione <dancol@dancol.org>
6364
6365 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6366 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6367 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6368 x_wm_set_size_hint, x_query_colors, x_real_positions,
6369 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6370 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6371 all of which have been moved to common code.
6372
6373 * xfaces.c: Include TERM_HEADER instead of listing all possible
6374 window-system headers.
6375
6376 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6377 to match header.
6378
6379 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6380 directly accessing frame internals.
6381
f18cbb28 6382 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
6383 globals_of_w32font.
6384
6385 * process.c: Include TERM_HEADER instead of listing all possible
6386 window-system headers.
6387
3a880af4
SM
6388 * nsterm.h: Remove declarations now in frame.h.
6389 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
6390
6391 * menu.c: Include TERM_HEADER instead of listing all possible
6392 window-system headers.
6393
6394 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6395 window system.
6396
6397 * keyboard.c: Include TERM_HEADER instead of listing all possible
6398 window-system headers.
6399
6400 * image.c: Include TERM_HEADER instead of listing all possible
6401 window-system headers. Declare Vlibrary_cache when compiling for
6402 Windows.
6403
6404 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6405 window system declarations.
6406
6407 * frame.h: Move common functions here: set_frame_menubar,
6408 x_set_window_size, x_sync, x_get_focus_frame,
6409 x_set_mouse_position, x_set_mouse_pixel_position,
6410 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6411 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6412 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6413 x_activate_menubar, x_real_positions, x_bitmap_icon,
6414 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6415 and x_query_colors.
6416
6417 * frame.c: Include TERM_HEADER instead of listing all possible
6418 window-system headers.
6419
6420 * font.c: Include TERM_HEADER instead of listing all possible
6421 window-system headers.
6422
6423 * emacs.c: Include TERM_HEADER.
6424
f18cbb28
EZ
6425 * dispnew.c: Include TERM_HEADER instead of listing all possible
6426 window-system headers.
17a2cbbd 6427
f18cbb28 6428 * ccl.h: Include character.h.
17a2cbbd
DC
6429
6430 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6431 the current window system; include in list of objects to link into
6432 Emacs.
6433
c650a5de
DA
64342012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6435
6436 Remove mark_ttys function and fix tty_display_info initialization.
6437 * lisp.h (mark_ttys): Remove prototype.
6438 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6439 to mark_ttys because all possible values of 'top_frame' slot are
6440 the frames which are reachable from Vframe_list.
6441 * term.c (mark_ttys): Remove.
6442 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6443
4e0f6479
DA
64442012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6445
6446 Change struct frame bitfields from unsigned char to unsigned.
6447 * frame.h (struct frame): Change type of 'display_preempted',
6448 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6449 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6450 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6451 bitfields from unsigned char to unsigned.
6452
8b96a52c
DA
64532012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6454
6455 Remove unused member of struct x_output and struct w32_output.
6456 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6457 * w32term.h (struct w32_output): Likewise.
6458
b4444c8a
JD
64592012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6460
6461 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6462 does not become zero (Bug#12234).
6463
b98521db
PE
64642012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6465
6466 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6467 for GCC 4.7.1 x86-64.
6468
31d02438
GM
64692012-08-30 Glenn Morris <rgm@gnu.org>
6470
6471 * lread.c (init_lread): For out-of-tree builds, only add the
6472 source directory's site-lisp dir to the load-path if it exists,
6473 consistent with in-tree builds. (Bug#12302)
6474
7f8941d8
JD
64752012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6476
6477 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 6478 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
6479 (windowShouldClose:): Set window_closed.
6480 (dealloc): New member, free button_values.
fc0c31f8
JB
6481 (process_dialog:): Make member function. Remove window argument,
6482 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
6483 in button_values.
6484 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 6485 with tag. Remove return self, declare return value as void.
7f8941d8
JD
6486 (addString:row:): Remove return self, declare return value as void.
6487 (addSplit): Remove return self, declare return value as void.
6488 (clicked:): Remove return self, declare return value as void.
fc0c31f8 6489 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
6490 (initFromContents:isQuestion:): Adjust call to process_dialog.
6491 Code formatting change.
6492 (timeout_handler:): Set timer_fired to YES.
6493 (runDialogAt:): Set timer_fired to NO.
6494 Handle click on close button as quit.
6495
6496 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6497 Add window_closed and button_values. Add void as return value for
6498 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6499 Add process_dialog as new member.
6500
eada0861 65012012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 6502
eada0861
GM
6503 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6504 is not one of the heaps we manage. (Bug#12242)
6505
65062012-08-28 Glenn Morris <rgm@gnu.org>
6507
6508 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6509
457294dd
MR
65102012-08-28 Martin Rudalics <rudalics@gmx.at>
6511
6512 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
6513 auto-buffer-name window parameter. Install revision of reverted
6514 fix.
457294dd 6515
4f2daf31
DA
65162012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6517
6518 Do not allow to set major mode for a dead buffer.
6519 * buffer.c (Fset_buffer_major_mode): Signal an error
6520 if the buffer is dead.
6521 (Fother_buffer, other_buffer_safely): Remove redundant
6522 nested declaration.
6523
66322887
DA
65242012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6525
6526 Always use set_buffer_if_live to restore original buffer at unwind.
6527 * buffer.h (record_unwind_current_buffer): New function.
6528 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6529 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6530 * undo.c, window.c: Adjust users.
6531 * buffer.c (set_buffer_if_live): Fix comment.
6532
a3d794a1
DA
65332012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6534
6535 Fix usage of set_buffer_internal.
6536 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6537 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6538 * coding.c (decode_coding): Omit redundant test.
6539 * fileio.c (decide_coding_unwind): Likewise.
6540 * fns.c (secure_hash): Likewise.
6541 * insdel.c (modify_region): Likewise.
6542 * keyboard.c (command_loop_1): Likewise.
6543 * print.c (PRINTFINISH): Likewise.
6544 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6545
59ea14cd
PE
65462012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 * dispnew.c: Use bool for boolean.
6549 (frame_garbaged, display_completed, delayed_size_change)
6550 (fonts_changed_p, add_window_display_history)
6551 (add_frame_display_history, verify_row_hash)
6552 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6553 (row_equal_p, realloc_glyph_pool)
6554 (allocate_matrices_for_frame_redisplay)
6555 (showing_window_margins_p)
6556 (adjust_frame_glyphs_for_frame_redisplay)
6557 (build_frame_matrix_from_leaf_window, make_current)
6558 (mirrored_line_dance, mirror_line_dance, update_frame)
6559 (update_window_tree, update_single_window)
6560 (check_current_matrix_flags, update_window, update_text_area)
6561 (update_window_line, set_window_update_flags, scrolling_window)
6562 (update_frame_1, scrolling, buffer_posn_from_coords)
6563 (do_pending_window_change, change_frame_size)
6564 (change_frame_size_1, sit_for):
6565 Use bool for boolean.
6566 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6567 and remove last int (actually boolean) argument, which was always 0.
6568 All callers changed.
6569 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6570 * dispextern.h (struct composition_it): Use bool for boolean.
6571 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6572 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6573 * dired.c (file_name_completion):
6574 Use bool for boolean. (This was missed in an earlier change.)
6575
95072a94
MR
65762012-08-27 Martin Rudalics <rudalics@gmx.at>
6577
6578 * window.c (Fset_window_configuration): Revert first part of
6579 last change.
6580
0f19feff
JD
65812012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6582
6583 * nsterm.h (NSPanel): New class variable dialog_return.
6584
3a880af4
SM
6585 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6586 Initialize dialog_return.
0f19feff
JD
6587 (windowShouldClose:): Use stop instead of stopModalWithCode.
6588 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6589 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6590 event.
6591 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6592 modal loop returns.
6593
f10fe38f
PE
65942012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6595
de1339b0
PE
6596 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6597 * composite.c (find_composition, composition_gstring_p)
6598 (composition_reseat_it, find_automatic_composition):
6599 * data.c (let_shadows_buffer_binding_p)
6600 (let_shadows_global_binding_p, set_internal, make_blv)
6601 (Fmake_variable_buffer_local, Fmake_local_variable)
6602 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6603 (cons_to_signed, arith_driver):
6604 * dbusbind.c (xd_in_read_queued_messages):
6605 * dired.c (directory_files_internal, file_name_completion):
6606 Use bool for booleans.
6607 * dired.c (file_name_completion):
6608 * process.h (fd_callback):
6609 Omit int (actually boolean) argument. It wasn't being used.
6610 All uses changed.
6611 * composite.h, lisp.h: Reflect above API changes.
6612
f10fe38f
PE
6613 * cmds.c, coding.c: Use bool for booleans.
6614 * cmds.c (move_point, Fself_insert_command):
6615 * coding.h (struct composition status, struct coding_system):
6616 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6617 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6618 (emacs_mule_char, decode_coding_emacs_mule)
6619 (encode_coding_emacs_mule, detect_coding_iso_2022)
6620 (decode_coding_iso_2022, encode_invocation_designation)
6621 (encode_designation_at_bol, encode_coding_iso_2022)
6622 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6623 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6624 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6625 (encode_coding_raw_text, detect_coding_charset)
6626 (decode_coding_charset, encode_coding_charset, detect_eol)
6627 (detect_coding, get_translation_table, produce_chars)
6628 (consume_chars, reused_workbuf_in_use)
6629 (make_conversion_work_buffer, code_conversion_save)
6630 (decode_coding_object, encode_coding_object)
6631 (detect_coding_system, char_encodable_p)
6632 (Funencodable_char_position, code_convert_region)
6633 (code_convert_string, code_convert_string_norecord)
6634 (Fset_coding_system_priority):
6635 * fileio.c (Finsert_file_contents):
6636 Use bool for booleans.
6637 * coding.h, lisp.h: Reflect above API changes.
6638 * coding.c: Remove unnecessary static function decls.
6639 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6640 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6641 not a boolean 'int', since callers never look at the return value.
6642 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6643 * coding.h (decoding_buffer_size, encoding_buffer_size)
6644 (emacs_mule_string_char): Remove unused extern decls.
6645 (struct iso_2022_spec, struct coding_system):
6646 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6647 (struct emacs_mule_spec): Remove unused field 'full_support'.
6648 All initializations removed.
6649 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6650
5474c384
DA
66512012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6652
f10fe38f 6653 Fix spare memory change (Bug#12286).
5474c384
DA
6654 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6655 (valid_lisp_object_p): Likewise.
6656
c4b6914d
MR
66572012-08-27 Martin Rudalics <rudalics@gmx.at>
6658
6659 * window.c (Fset_window_configuration): Record any window's old
6660 buffer if it's replaced (see Bug#8789). If the new current
6661 buffer doesn't appear in the selected window, go to its old
6662 point (Bug#12208).
6663
35aaa1ea
DA
66642012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6665
6666 Special MEM_TYPE_SPARE to denote reserved memory.
6667 * alloc.c (enum mem_type): New memory type.
6668 (refill_memory_reserve): Use new type for spare memory.
6669 This prevents live_cons_p and live_string_p from incorrect
6670 detection of uninitialized objects from spare memory as live.
6671
6af64513
PE
66722012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6673
8b2e00a3
PE
6674 Spelling fixes.
6675 * Makefile.in (.PHONY): versioclean -> versionclean.
6676
b52d6985
PE
6677 Remove unused external symbols.
6678 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6679 * window.c (Qwindow_valid_p, decode_valid_window):
6680 Now static, not extern.
6681 * data.c (Qinterval): Remove; unused.
6682 (syms_of_data): Do not define 'interval'.
6683 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6684 * window.h (decode_valid_window):
6685 Remove decls.
6686
d5172d4f
PE
6687 * character.c, charset.c, chartab.c: Use bool for booleans.
6688 * character.c (lisp_string_width, string_count_byte8)
6689 (string_escape_byte8):
6690 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6691 (load_charset_map_from_file, map_charset_chars)
6692 (Fdefine_charset_internal, define_charset_internal)
6693 (Fdeclare_equiv_charset, find_charsets_in_text)
6694 (Ffind_charset_region, char_charset, Fiso_charset):
6695 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6696 (sub_char_table_set, sub_char_table_set_range)
6697 (char_table_set_range, optimize_sub_char_table)
6698 (map_sub_char_table):
6699 Use bool for boolean.
6700 * character.c (str_to_unibyte): Omit last boolean argument; it was
6701 always 0. All callers changed.
6702 * character.h, charset.h: Adjust to match previous changes.
6703 * character.h (char_printable_p): Remove decl of nonexistent function.
6704 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6705 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6706 are all boolean, so make them single-bit bitfields.
6707
6af64513
PE
6708 * lisp.h (ASET): Remove attempt to detect side effects.
6709 It was meant to be temporary and it often doesn't work,
6710 because when IDX has side effects the behavior of IDX==IDX
6711 is undefined. See Stefan Monnier in
6712 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6713
e1f29348
BR
67142012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6715
6716 * lisp.h (functionp): New function (extracted from Ffunctionp).
6717 (FUNCTIONP): Use it.
6718 * eval.c (Ffunctionp): Use it.
6719
17c05d74
PE
67202012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6721
0f46bc75
PE
6722 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6723 as that's faster and simpler than static storage. Don't bother
6724 with the g_main_context_query overhead if g_main_context_pending
6725 says no events are pending.
6726 (gfds, gfds_size): Remove these static vars.
6727 (xgselect_initialize): Remove; no longer needed.
6728 All uses and decls removed.
6729
ee4c0f69
PE
6730 * emacs.c (fatal_error_signal_hook): Remove.
6731 All uses removed. This leftover from old code was always 0.
6732
17c05d74
PE
6733 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6734 * casefiddle.c (casify_object, casify_region):
6735 * casetab.c (set_case_table):
6736 * category.c, category.h (word_boundary_p):
6737 * category.h (CHAR_HAS_CATEGORY):
6738 Use bool for booleans, instead of int.
6739
391ceac5
EZ
67402012-08-25 Eli Zaretskii <eliz@gnu.org>
6741
6742 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6743
2f221583
PE
67442012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6745
f4a681b0
PE
6746 On assertion failure, print backtrace if available.
6747 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6748 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6749 * Makefile.in (LIB_EXECINFO): New macro.
6750 (LIBES): Use it.
6751
2f221583
PE
6752 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6753 * bytecode.c (exec_byte_code):
6754 * callint.c (check_mark, Fcall_interactively):
6755 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6756 (getenv_internal, sync_process_alive, call_process_exited):
6757 * lisp.h (USE_SAFE_ALLOCA):
6758 Use bool for booleans, instead of int.
6759 * lisp.h, process.h: Adjust prototypes to match above changes.
6760 * callint.c (Fcall_interactively): Don't assume the mark's
6761 offset fits in 'int'.
6762
37ef52bb
PE
67632012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6764
6765 * buffer.c, buffer.h: Use bool for boolean.
6766 * buffer.c (reset_buffer_local_variables)
6767 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6768 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6769 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6770 (overlay_touches_p, overlay_strings, Foverlay_put)
6771 (report_overlay_modification, call_overlay_mod_hooks):
6772 (mmap_enlarge, mmap_set_vars):
6773 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6774 Use bool for booleans, instead of int.
6775 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6776 since the 1-or-0 return value is always ignored anyway.
6777 (mmap_initialized_p):
6778 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6779 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6780
2cc21167
PE
67812012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 * bidi.c: Use bool for boolean.
6784 This is a bit more readable, and makes the text segment of bidi.o
6785 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6786 Presumably it's faster too.
6787 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6788 Now bool.
6789 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6790 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6791 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6792 (bidi_explicit_dir_char, bidi_level_of_next_char)
6793 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6794 Use bool for booleans, instead of int.
6795 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6796 (bidi_unshelve_cache): Adjust decls to match code.
6797
7db4ddf4
MR
67982012-08-23 Martin Rudalics <rudalics@gmx.at>
6799
6800 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6801 argument.
6802
b1bb8011
PE
68032012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6804
6805 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6806 * atimer.h: Include <stdbool.h>.
6807
ff687885
DN
68082012-08-22 Dan Nicolaescu <dann@gnu.org>
6809
6810 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6811 compile time tests instead of run time tests on systems that do
6812 not use them.
6813 (FRAME_MAC_P): Remove leftover from deleted code.
6814 * frame.c (syms_of_frame): Remove leftover from deleted code.
6815
4ce7a138
JD
68162012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6817
6818 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6819
d733ec6d
PE
68202012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6821
6822 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6823 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 6824 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
6825 (fontset_add): Return void, for FONTSET_ADD.
6826
d0d2d26f
PE
68272012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6828
fce31d69
PE
6829 * alloc.c: Use bool for booleans.
6830 (gc_in_progress, abort_on_gc)
6831 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6832 (dont_register_blocks) [GC_MALLOC_CHECK]:
6833 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6834 (check_string_bytes, make_specified_string, memory_full)
6835 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6836 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6837 (mark_stack, valid_pointer_p, make_pure_string)
6838 (Fgarbage_collect, survives_gc_p, gc_sweep):
6839 Use bool for booleans, instead of int.
6840 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6841 Remove unused local.
6842 * alloc.c (PURE_POINTER_P):
6843 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6844 * editfns.c (Fformat):
6845 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6846 (Fdo_auto_save):
6847 * fns.c (sweep_weak_table):
6848 * lisp.h (suppress_checking, push_message, survives_gc_p)
6849 (make_pure_string, gc_in_progress, abort_on_gc):
6850 * lread.c (readchar, read1):
6851 * print.c (Fprin1_to_string):
6852 * xdisp.c (push_message):
6853 Use bool for booleans affected directly or indirectly by
6854 alloc.c's changes.
6855
d0d2d26f
PE
6856 Make recently-introduced setters macros.
6857 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6858 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6859 (set_fontset_default, set_fontset_fallback): Rename from their
6860 upper-case counterparts, and make them functions rather than macros.
6861 This is more consistent with the other recently-introduced setters.
6862 These don't need to be inline, since they're local.
6863
d18e2bb6
JD
68642012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6865
6866 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6867 the loop (Bug#12247).
6868
1b9d9d16
PE
68692012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6870
6871 * lisp.h (vcopy): Use memcpy rather than our own loop.
6872 This fixes a performance regression introduced by the recent
6873 addition of vcopy. This means 'vcopy' will need to be modified
6874 for a copying collector, but that's OK. Also, tighten the
6875 checking in the assertion.
6876
b2f09701
EZ
68772012-08-21 Eli Zaretskii <eliz@gnu.org>
6878
6879 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6880 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6881 non-base glyph for the width of the base character, according to
e1f29348
BR
6882 what x_draw_composite_glyph_string_foreground expects.
6883 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
6884 expectations, to produce correct width of the composed character.
6885 Reverse the sign of the DU offset produced by ScriptPlace.
6886
9b994fed
PE
68872012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6888
6889 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6890
086ca913
DA
68912012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6892
6893 Avoid direct writes to contents member of struct Lisp_Vector.
6894 * lisp.h (vcopy): New function to copy data into vector.
6895 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6896 * fns.c (Ffillarray): Use ASET.
6897 * keyboard.c (timer_check_2): Use AREF and ASET.
6898 (append_tool_bar_item, Frecent_keys): Use vcopy.
6899 * lread.c (read_vector): Use ASET.
6900 * msdos.c (Frecent_doskeys): Use vcopy.
6901 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6902 (Finternal_merge_in_global_face): Use ASET and vcopy.
6903 * xfont.c (xfont_list_pattern): Likewise.
6904
5481664a
MR
69052012-08-21 Martin Rudalics <rudalics@gmx.at>
6906
6907 * window.c (Fwindow_point): For the selected window always return
6908 the position of its buffer's point.
6909 (Fset_window_point): For the selected window always go in its
6910 buffer to the specified position.
6911
6d470bdd
DA
69122012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6913
6914 Setter macros for fontsets.
6915 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6916 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6917 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6918 Adjust users.
6919
24564fe1
GM
69202012-08-20 Glenn Morris <rgm@gnu.org>
6921
6922 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6923 Don't assume that `ln -f' works.
6924
0a05a035
EZ
69252012-08-20 Eli Zaretskii <eliz@gnu.org>
6926
6927 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6928 and later about non-assignments with no effect. See discussion at
6929 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6930 details.
6931
e46f2325
DA
69322012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6933
6934 Inline setter functions for Lisp_Objects slots of struct specbinding.
6935 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6936 Adjust users.
6937
734fbd86
MR
69382012-08-20 Martin Rudalics <rudalics@gmx.at>
6939
6940 * window.c (select_window): Always make selected window's buffer
6941 current.
6942
f1a95992
DA
69432012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6944
6945 Use AREF and ASET for docstrings of category tables.
6946 * category.h (CATEGORY_DOCSTRING): Use AREF.
6947 (SET_CATEGORY_DOCSTRING): Use ASET.
6948 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6949
e83064be
DA
69502012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6951
6952 Inline setter functions for hash table members.
6953 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6954 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6955 (set_hash_key_and_value, set_hash_index, set_hash_next)
6956 (set_hash_hash): New functions.
6957 * charset.c, fns.c: Adjust users.
6958
4ce60d2e
DA
69592012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6960
6961 Inline getter and setter functions for per-buffer values.
6962 * buffer.h (per_buffer_default, set_per_buffer_default)
6963 (per_buffer_value, set_per_buffer_value): New functions.
6964 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6965 * buffer.c, data.c: Adjust users.
6966
c06c9690
JB
69672012-08-20 Juanma Barranquero <lekktu@gmail.com>
6968
6969 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6970
32bd4250
PE
69712012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6972
bad03192 6973 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
6974 as gnulib does this if the system doesn't.
6975 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
6976 Remove declaration. MS-Windows declares it on stdlib.h which is
6977 included by conf_post.h.
b69a6d22
PE
6978 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6979 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6980 * vm-limit.c: Include <unistd.h>, for 'environ'.
6981
22d7feb2
PE
6982 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6983 (start_of_data): Remove decl; mem-limits.h provides it.
6984
32bd4250
PE
6985 * xdisp.c (handle_invisible_prop): Make it a bit faster
6986 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6987
450809af
CY
69882012-08-19 Chong Yidong <cyd@gnu.org>
6989
6990 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6991 ends (Bug#3874).
6992
9e677988
AS
69932012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6994
6b1319ce
AS
6995 * .gdbinit: Use call instead of set when calling a function in the
6996 inferior.
6997
9e677988
AS
6998 * data.c (set_internal): Don't use set_blv_found.
6999 (Fkill_local_variable): Likewise.
7000
d7191076
AA
70012012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7002
7003 * nsfont.m (ns_ascii_average_width): Ensure the string
7004 ascii_printable is initialized with a null-terminated character
7005 array. Otherwise, it can contain undesired extra characters.
7006
e757f1c6
PE
70072012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7008
7009 port new setting code to Sun C 5.8 2005/10/13
7010 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7011 Return void, not Lisp_Object. Otherwise, the compiler
7012 complains about (A?B:C) where B is void and C is Lisp_Object
7013 when compiling CHAR_TABLE_SET, due to the recent change to
7014 the API of sub_char_table_set_contents.
7015
a999ce26
CY
70162012-08-18 Chong Yidong <cyd@gnu.org>
7017
7018 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7019 for the string case (Bug#3874).
7020
3f22b86f
PE
70212012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7022
39eb03f1
PE
7023 * buffer.h (BSET): Remove (Bug#12215).
7024 Replace all uses with calls to new setter functions.
7025 (bset_bidi_paragraph_direction, bset_case_canon_table)
7026 (bset_case_eqv_table, bset_directory, bset_display_count)
7027 (bset_display_time, bset_downcase_table)
7028 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7029 (bset_last_selected_window, bset_local_var_alist)
7030 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7031 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7032 (bset_width_table):
7033 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7034 (bset_auto_fill_function, bset_auto_save_file_format)
7035 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7036 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7037 (bset_cache_long_line_scans, bset_case_fold_search)
7038 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7039 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7040 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7041 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7042 (bset_header_line_format, bset_indicate_buffer_boundaries)
7043 (bset_indicate_empty_lines, bset_invisibility_spec)
7044 (bset_left_fringe_width, bset_major_mode, bset_mark)
7045 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7046 (bset_name, bset_overwrite_mode, bset_pt_marker)
7047 (bset_right_fringe_width, bset_save_length)
7048 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7049 (bset_scroll_up_aggressively, bset_selective_display)
7050 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7051 (bset_word_wrap, bset_zv_marker):
7052 * category.c (bset_category_table):
7053 * syntax.c (bset_syntax_table):
7054 New setter functions.
7055
6a09a33b
PE
7056 * process.h (PSET): Remove (Bug#12215).
7057 Replace all uses with calls to new setter functions.
7058 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7059 (PROCESS_INLINE): New macro.
7060 (pset_childp): New setter function.
7061 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7062 * process.c (PROCESS_INLINE):
7063 Define to EXTERN_INLINE, so that the corresponding functions
7064 are compiled into code.
7065 (pset_buffer, pset_command, pset_decode_coding_system)
7066 (pset_decoding_buf, pset_encode_coding_system)
7067 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7068 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7069 (pset_type, pset_write_queue): New setter functions.
7070
e8c17b81
PE
7071 * window.h (WSET): Remove (Bug#12215).
7072 Replace all uses with calls to new setter functions.
7073 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7074 (WINDOW_INLINE): New macro.
7075 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7076 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7077 (wset_total_lines, wset_vertical_scroll_bar)
7078 (wset_window_end_pos, wset_window_end_valid)
7079 (wset_window_end_vpos): New setter functions.
7080 * window.c (WINDOW_INLINE):
7081 Define to EXTERN_INLINE, so that the corresponding functions
7082 are compiled into code.
7083 (wset_combination_limit, wset_dedicated, wset_display_table)
7084 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7085 (wset_new_normal, wset_new_total, wset_next_buffers)
7086 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7087 (wset_prev_buffers, wset_right_fringe_width)
7088 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7089 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7090 (wset_window_parameters):
7091 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7092 (wset_column_number_displayed, wset_region_showing):
7093 New setter functions.
7094
3f22b86f
PE
7095 * termhooks.h (TSET): Remove (Bug#12215).
7096 Replace all uses with calls to new setter functions.
7097 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7098 (TERMHOOKS_INLINE): New macro.
7099 (tset_charset_list, tset_selection_alist): New setter functions.
7100 * terminal.c (TERMHOOKS_INLINE):
7101 Define to EXTERN_INLINE, so that the corresponding functions
7102 are compiled into code.
7103 (tset_param_alist): New setter function.
7104
742af32f
PE
71052012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7106
15dbb4d6
PE
7107 * keyboard.h (KSET): Remove (Bug#12215).
7108 Replace all uses with calls to new setter functions.
7109 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7110 (KEYBOARD_INLINE): New macro.
7111 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7112 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7113 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7114 New setter functions.
7115 * keyboard.c (KEYBOARD_INLINE):
7116 Define to EXTERN_INLINE, so that the corresponding functions
7117 are compiled into code.
7118 (kset_echo_string, kset_kbd_queue)
7119 (kset_keyboard_translate_table, kset_last_prefix_arg)
7120 (kset_last_repeatable_command, kset_local_function_key_map)
7121 (kset_overriding_terminal_local_map, kset_real_last_command)
7122 (kset_system_key_syms): New setter functions.
7123
f00af5b1
PE
7124 * frame.h (FSET): Remove (Bug#12215).
7125 Replace all uses with calls to new setter functions.
7126 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7127 (FRAME_INLINE): New macro.
7128 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7129 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7130 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7131 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7132 (fset_param_alist, fset_root_window, fset_scroll_bars)
7133 (fset_selected_window, fset_title, fset_tool_bar_items)
7134 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7135 * frame.c (FRAME_INLINE):
7136 Define to EXTERN_INLINE, so that the corresponding functions
7137 are compiled into code.
7138 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7139
0c94c8d6
PE
7140 A few more naming-convention fixes for getters and setters.
7141 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7142 and rename from buffer_overlays_set_before.
7143 (set_buffer_overlays_after): Move here from buffer.h, and rename
7144 from buffer_overlays_set_after.
7145 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7146 All uses changed.
7147 (set_buffer_intervals): Rename from buffer_set_intervals.
7148 * intervals.c (set_interval_object): Move here from intervals.h,
7149 and rename from interval_set_object.
7150 (set_interval_left): Move here from intervals.h, and rename from
7151 interval_set_left.
7152 (set_interval_right): Move here from intervals.h, and rename from
7153 interval_set_right.
7154 (copy_interval_parent): Move here from intervals.h, and rename from
7155 interval_copy_parent.
7156 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7157 (set_interval_plist): Rename from interval_set_plist.
7158 Return void, not Lisp_Object, since no caller uses the result.
7159 * lisp.h (string_intervals): Rename from string_get_intervals.
7160 (set_string_intervals): Rename from string_set_intervals.
7161
34dabdb7
PE
7162 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7163 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 7164 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
7165 All uses changed. See the end of
7166 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7167
742af32f
PE
7168 * lisp.h (CSET): Remove (Bug#12215).
7169 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7170 (set_char_table_purpose): New functions,
7171 replacing CSET. All uses changed. For example, replace
7172 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 7173 "set_char_table_parent (char_table, parent);".
742af32f
PE
7174 The old version was confusing because it used the same name
7175 'parent' for two different things.
7176
a04e2c62
DA
71772012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7178
7179 Functions to get and set Lisp_Object fields of buffer-local variables.
7180 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7181 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7182 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7183 * data.c, eval.c, frame.c: Adjust users.
7184
383dcbf9
CY
71852012-08-17 Chong Yidong <cyd@gnu.org>
7186
7187 * xfaces.c (merge_face_vectors): If the target font specfies a
7188 font spec, make the font's attributes take precedence over
7189 directly-specified attributes.
7190 (merge_face_ref): Recognize :font.
7191
44386687
DA
71922012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7193
7194 Do not use memcpy for copying intervals.
7195 * intervals.c (reproduce_interval): New function.
7196 (reproduce_tree, reproduce_tree_obj): Use it.
7197 (reproduce_tree_obj): Remove prototype.
7198
927c7216
PE
71992012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7200
7201 * lisp.h (duration_to_sec_usec): Remove unused decl.
7202
93044f7b
AA
72032012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7204
7205 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7206 to an allocated instance of NSString, not to the class itself.
7207
9851e4a5
JB
72082012-08-17 Juanma Barranquero <lekktu@gmail.com>
7209
7210 * makefile.w32-in (C_CTYPE_H): New macro.
7211 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7212 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7213 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7214
620f13b0
PE
72152012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7216
7217 Use ASCII tests for character types.
7218 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7219 * xfns.c, xterm.c:
7220 Don't include <ctype.h>; was not needed.
7221 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7222 * sysdep.c, xfaces.c:
7223 Include <c-ctype.h> instead of <ctype.h>.
7224 * nsterm.m: Include <c-ctype.h>.
7225 * charset.c (read_hex):
7226 * doc.c (Fsnarf_documentation):
7227 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7228 (DRIVE_LETTER) [DOS_NT]:
7229 (Ffile_name_directory, Fexpand_file_name)
7230 (Fsubstitute_in_file_name):
7231 * font.c (font_parse_xlfd, font_parse_fcname):
7232 * frame.c (x_set_font_backend):
7233 * gtkutil.c (xg_get_font):
7234 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7235 * nsimage.m (hexchar):
7236 * nsterm.m (ns_xlfd_to_fontname):
7237 * sysdep.c (system_process_attributes):
7238 * xfaces.c (hash_string_case_insensitive):
7239 Use C-locale tests instead of locale-specific tests for character
7240 types, since we want the ASCII interpretation here, not the
7241 interpretation suitable for whatever happens to be the current locale.
7242
52162052
MR
72432012-08-16 Martin Rudalics <rudalics@gmx.at>
7244
7245 Consistently check windows for validity/liveness
7246 (Bug#11984, Bug#12025, Bug#12026).
7247 * lisp.h (CHECK_VALID_WINDOW): New macro.
7248 * window.c (decode_window): Rename to decode_live_window.
7249 (decode_valid_window, Fwindow_valid_p): New functions.
7250 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7251 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7252 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7253 (Fwindow_prev_sibling, Fwindow_combination_limit)
7254 (Fset_window_combination_limit, Fwindow_use_time)
7255 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7256 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7257 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7258 (Fwindow_hscroll, Fset_window_hscroll)
7259 (Fwindow_redisplay_end_trigger)
7260 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7261 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7262 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7263 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7264 (Fwindow_end, Fset_window_point, Fset_window_start)
7265 (Fpos_visible_in_window_p, Fwindow_line_height)
7266 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7267 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7268 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7269 (Fset_window_parameter, Fwindow_display_table)
7270 (Fset_window_display_table, Fdelete_other_windows_internal)
7271 (Fset_window_buffer, Fset_window_new_total)
7272 (Fset_window_new_normal, Fdelete_window_internal)
7273 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7274 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7275 (Fwindow_scroll_bars): Check whether argument window is a valid or
7276 live window. Update doc-strings.
7277 (syms_of_window): New symbol Qwindow_valid_p.
7278 * keyboard.c (Fposn_at_x_y): Check whether argument
7279 frame_or_window denotes a valid window.
7280
2751c80f
DA
72812012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7282
7283 Fix previous char table change.
7284 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7285 * chartab.c (optimize_sub_char_table): Likewise.
7286
032a42c8
CY
72872012-08-16 Chong Yidong <cyd@gnu.org>
7288
a2d19368
CY
7289 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7290
032a42c8
CY
7291 * xfont.c (xfont_open):
7292 * xftfont.c (xftfont_open): Set the font's max_width field.
7293
7294 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7295 min_width to space_width and average_width to the average over
7296 printable ASCII characters.
7297 (ns_char_width): Code cleanup.
7298 (ns_ascii_average_width): New utility function.
7299
7300 * font.h (struct font): Update comments.
7301
a098c930
DA
73022012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7303
032a42c8 7304 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
7305 * lisp.h (CSET): New macro.
7306 (char_table_set_extras, char_table_set_contents)
7307 (sub_char_table_set_contents): New function.
7308 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7309 * syntax.c: Adjust users.
7310
8be3a09c
SM
73112012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7312
7313 * eval.c (eval_sub): Bind lexical-binding.
7314 * lread.c (Qlexical_binding): Make non-static.
7315
ac4845a6
JD
73162012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7317
ddee6515
JD
7318 * nsmenu.m (popupSession): Remove.
7319 (pop_down_menu): Remove endModalSession.
7320 (timeout_handler:): New method.
7321 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7322 Call runModalForWindow. Check timer_fired when it returns.
7323 If not set, cancel timer and break out of loop.
7324 Otherwise loop again, with a new timeout.
7325
7326 * nsterm.m: Include fcntl.h if present.
7327 (fd_entry, t_readfds, inNsSelect): Remove.
7328 (select_writefds, select_valid, select_timeout, selfds)
7329 (select_mutex, apploopnr): Add.
7330 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7331 Otherwise call kbd_buffer_store_event.
7332 (ns_send_appdefined): Remove release of fd_entry.
7333 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7334 Increment and decrement apploopnr.
7335 (ns_select): If no file descriptors, just do a NSTimer.
7336 Otherwise copy read/write masks and start select thread (fd_handler).
7337 Start main loop and wait for application defined event.
7338 Inform select thread to stop selecting after main loop is exited.
7339 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 7340 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
7341 (fd_handler:): Loop forever, wait for info from the main thread
7342 to either start or stop selecting. When select returns, send
7343 and appdefined event.
7344 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7345 If not call kbd_buffer_store_event.
7346
7347 * nsterm.h (EmacsApp): fd_handler takes id argument.
7348 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7349
ac4845a6
JD
7350 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7351
eb424fe3
EZ
73522012-08-15 Eli Zaretskii <eliz@gnu.org>
7353
7354 * region-cache.c (move_cache_gap): Update gap_len using the actual
7355 growth of the boundaries array. Do not change cache_len.
7356 (Bug#12196)
7357
4e6a86c6
DA
73582012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7359
7360 Generalize and cleanup font subsystem checks.
7361 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
7362 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7363 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 7364
5bf192ca
DA
73652012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7366
7367 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7368
f2045622
CY
73692012-08-15 Chong Yidong <cyd@gnu.org>
7370
8be3a09c
SM
7371 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7372 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7373 extract the font descriptor instead of just the font name.
7374 In that case, return a font spec instead of a string.
f2045622
CY
7375 (x_last_font_name): Move to this file from xfns.c.
7376
7377 * xfns.c (Fx_select_font): The return value can also be a font
7378 spec. Move x_last_font_name management to gtkutil.c.
7379
7380 * xfaces.c: Make font weight and style symbols non-static.
7381
7f6feb56
SM
73822012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7383
7384 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7385 (bug#12117).
7386
fecbd8ff
SM
73872012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7388
7389 * alloc.c (Fgarbage_collect): Use plural form consistently.
7390
9b8d5165
EZ
73912012-08-14 Eli Zaretskii <eliz@gnu.org>
7392
7393 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7394 iteration through the command loop. Fixes a problem whereby mouse
7395 movements are ignored until the first mouse click.
7396
f5d9e83a
PE
73972012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 Use bool, not int, for Lisp booleans.
7400 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7401 makes Emacs a bit smaller and presumably a bit faster.
7402 * lisp.h: Include <stdbool.h>.
7403 (struct Lisp_Boolfwd, defvar_bool):
7404 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7405 * regex.c [!emacs]: Include <stdbool.h>.
7406 (false, true): Remove; <stdbool.h> does this for us now.
7407
55802e4a
CY
74082012-08-14 Chong Yidong <cyd@gnu.org>
7409
4abcdac8
CY
7410 * character.c (Fcharacterp): Doc fix (Bug#12076).
7411
7412 * data.c (Findirect_variable): Doc fix (Bug#11040).
7413
55802e4a
CY
7414 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7415
7416 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 7417 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 7418
8e99d072
BR
74192012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7420
7421 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7422 (bug#12022).
7423
08908aca
MR
74242012-08-14 Martin Rudalics <rudalics@gmx.at>
7425
7426 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7427 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7428 * minibuf.c (choose_minibuf_frame, read_minibuf):
7429 * w32fns.c (x_create_tip_frame):
7430 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7431 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7432
56120d6f
PE
74332012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7434
7435 * intervals.c (offset_intervals): Remove obsolete comment.
7436
67b77c0b
AS
74372012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7438
7439 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7440
f48b82fd
GR
74412012-08-14 Gergely Risko <gergely@risko.hu>
7442
7443 * coding.c (decode_coding): Record buffer modification before
7444 disabling undo_list (Bug#11773).
7445
fd318b54
DA
74462012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7447
7448 Revert and cleanup some recent overlay changes.
7449 * buffer.h (enum overlay_type): Remove.
7450 (buffer_get_overlays, buffer_set_overlays): Likewise.
7451 (buffer_set_overlays_before, buffer_set_overlays_after):
7452 New function. Adjust users.
7453 (unchain_both): Add eassert.
7454
41a62dd9
DA
74552012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7456
7457 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7458
5884c324
PE
74592012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7460
7461 * gtkutil.c (xg_mark_data): Don't assume C99.
7462
ca06f160
JD
74632012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7464
7465 * gtkutil.c (xg_frame_tb_info): New struct.
7466 (TB_INFO_KEY): New define.
7467 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7468 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7469 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7470 if not present.
7471 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 7472 is up to date. Otherwise store new data.
ca06f160
JD
7473 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7474
7864a3f7
DA
74752012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7476
7477 Use KSET for write access to Lisp_Object members of struct kboard.
7478 * keyboard.h (KSET): New macro.
7479 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7480 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7481 * xterm.c: Adjust users.
7482
4c31be61
DA
74832012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7484
7485 Use BSET for write access to Lisp_Object members of struct buffer.
7486 * buffer.h (BSET): New macro.
7487 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7488 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7489 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7490 * window.c, xdisp.c, xfns.c: Adjust users.
7491
14ae4239
BT
74922012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7493
7494 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7495
32bcadb4
JD
74962012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7497
3d29b2ce 7498 * nsterm.m (not_in_argv): New function.
fc0c31f8 7499 (application:openFile, application:openTempFile:):
3d29b2ce
JD
7500 (application:openFileWithoutUI:, application:openFiles:): Open file
7501 if not_in_argv returns non-zero (bug#12171).
7502
32bcadb4 7503 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
7504 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7505 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
7506 (xg_get_font_name): Use those functions/macros here.
7507 Reported by Frans Oilinki <moilinki@gmail.com>.
7508
9ff9402d 75092012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
7510
7511 * unexmacosx.c (copy_data_segment): Copy initialized data in
7512 statically linked libraries from input file rather than memory.
7513
db74a5fc
YM
7514 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7515 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7516 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7517
25e65510
GM
75182012-08-10 Glenn Morris <rgm@gnu.org>
7519
7520 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7521 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7522
7961135c
DA
75232012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7524
7525 Fix last change to allow compilation with low optimization levels.
7526 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7527 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7528
42b3a444
DA
75292012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7530
7531 Use common inline syntax in intervals.h.
7532 * intervals.h (INTERVALS_INLINE): New macro.
7533 Change all users from LISP_INLINE.
7534
9fb0c957
DA
75352012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7536
7537 Define Qnone once for all platforms.
7538 * frame.c (Qnone): Define here.
7539 (syms_of_frame): DEFSYM it.
7540 * lisp.h (Qnone): New declaration.
7541 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7542 * xfns.c: Remove duplication. Adjust users.
7543
65e8ee52
DA
75442012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7545
7546 Remove unused macros from intervals.h.
7547 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7548 * intervals.c: Adjust comment.
7549
9b855fd6
EZ
75502012-08-10 Eli Zaretskii <eliz@gnu.org>
7551
7552 * w32fns.c <w32_unicode_gui>: New static variable.
7553 (globals_of_w32fns): Initialize it according to os_subtype.
7554 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7555 testing os_subtype.
7556
39cb9e56 75572012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
7558 Eli Zaretskii <eliz@gnu.org>
7559
7560 Fix bug #10299 with Unicode characters sent by customized
7561 keyboards created by MSKLC.
7562 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7563 (w32_init_class): Use it to initialize the Emacs class with either
7564 ANSI or Unicode API calls.
7565 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7566 later.
7567 (w32_wnd_proc): If the character code sent by WM_CHAR or
7568 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7569 original message. Call DefWindowProcW on NT and later.
7570
9374581a
GM
75712012-08-10 Glenn Morris <rgm@gnu.org>
7572
4b94e8cf
GM
7573 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7574
9374581a
GM
7575 * lisp.h (DIRECTORY_SEP): Let configure set it.
7576
a2752828
DA
75772012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7578
7579 Use TSET for write access to Lisp_Object slots of struct terminal.
7580 * termhooks.h (TSET): New macro.
7581 * coding.c, terminal.c, xselect.c: Adjust users.
7582
cc92c454
SM
75832012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7584
7585 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7586 the failing expression, include them in the error message.
7587 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7588 * lisp.h (internal_condition_case_n): Update declaration.
7589
4cb3e6b3
DA
75902012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7591
7592 Inline functions to examine and change buffer overlays.
7593 * buffer.c (unchain_both): New function.
7594 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7595 (buffer_has_overlays): New function.
7596 (enum overlay_type): New enum.
7597 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7598 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7599
8707c1e5
DA
76002012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7601
7602 Inline functions to examine and change buffer intervals.
7603 * alloc.c (mark_interval_tree): Remove.
7604 (MARK_INTERVAL_TREE): Simplify.
7605 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7606 * intervals.c (buffer_balance_intervals): New function.
7607 (graft_intervals_into_buffer): Adjust indentation.
7608 (set_intervals_multibyte): Simplify.
7609 * buffer.h (BUF_INTERVALS): Remove.
7610 (buffer_get_intervals, buffer_set_intervals): New function.
7611 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7612 * intervals.c, textprop.c: Adjust users.
7613
ad8c997f
DA
76142012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7615
7616 Inline functions to examine and change string intervals.
7617 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7618 (string_get_intervals, string_set_intervals): New function.
7619 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7620 * lread.c, print.c, textprop.c: Adjust users.
7621
32ac3a6b
GM
76222012-08-08 Glenn Morris <rgm@gnu.org>
7623
7624 * lisp.mk (lisp): Remove language/persian.elc.
7625
77c7bcb1
DA
76262012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7627
7628 Cleanup intervals.
7629 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7630 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
7631 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7632 Adjust comment. Move under #if 0.
77c7bcb1
DA
7633 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7634 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7635
9c08a8d4
DA
76362012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7637
7638 Check total length of intervals with eassert.
7639 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7640 * intervals.c: Change all users to eassert.
7641
26d16b35
EZ
76422012-08-07 Eli Zaretskii <eliz@gnu.org>
7643
14ae4239
BT
7644 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7645 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
7646 INTERNAL_FIELD in Lisp_Cons.
7647
c644523b
DA
76482012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7649
7650 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7651 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7652 name since all xname users are fixed long time ago. Do not
7653 use INTERNAL_FIELD.
7654 (set_symbol_name, set_symbol_function, set_symbol_plist):
7655 (set_symbol_next, set_overlay_plist): New function.
7656 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7657 (struct Lisp_Overlay): Likewise.
7658 (CVAR, MVAR, SVAR): Remove.
7659 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7660 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7661 * xterm.c: Adjust users.
7662 * .gdbinit: Change to use name field of struct Lisp_Symbol
7663 where appropriate.
7664
6a3d20cc
DA
76652012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7666
7667 Basic functions to set Lisp_Object and pointer slots of intervals.
7668 * intervals.h (interval_set_parent, interval_set_object):
7669 (interval_set_left, interval_set_right, interval_set_plist):
7670 (interval_copy_parent): New function.
7671 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
7672 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7673 Adjust indentation.
6a3d20cc
DA
7674 (INTERVAL_SIZE): Remove. Adjust users.
7675 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7676
4d2b044c
DA
76772012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7678
7679 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7680 * process.h (PGET): Remove.
7681 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7682 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7683
d3d50620
DA
76842012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7685
7686 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7687 * window.h (WGET): Remove.
7688 (struct window): Do not use INTERNAL_FIELD.
7689 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7690 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7691 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7692 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7693 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7694 Adjust users.
7695
d10a51dc
CY
76962012-08-07 Chong Yidong <cyd@gnu.org>
7697
7698 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7699 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7700 (Fdelete_window_internal): Signal an error if the window is not on
7701 a live frame (Bug#12025).
7702
e69b0960
DA
77032012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7704
7705 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7706 * frame.h (FGET): Remove.
7707 (struct frame): Do not use INTERNAL_FIELD.
7708 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7709 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7710 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7711 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7712
25a20a3a
JB
77132012-08-06 Juanma Barranquero <lekktu@gmail.com>
7714
7715 * w32.c: Silence compiler warnings.
7716 (map_w32_filename): Remove unused variable `is_fat'.
7717 (chase_symlinks): Add parentheses around expression.
7718
1c6f11f4
GM
77192012-08-06 Glenn Morris <rgm@gnu.org>
7720
1db4583a
GM
7721 * sysdep.c: Respect BROKEN_GETWD.
7722
1c6f11f4
GM
7723 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7724 Let configure handle it.
7725 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7726
2b90362b
DA
77272012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7728
7729 Use GCALIGNMENT where appropriate.
7730 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7731 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7732 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7733
5f50daf2
EZ
77342012-08-06 Eli Zaretskii <eliz@gnu.org>
7735
14ae4239
BT
7736 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7737 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 7738
cbcc7007
SM
77392012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7740
7741 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7742 that should be sufficient for everyone.
7743
4d365fa4
JD
77442012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7745
7746 * keyboard.c (timer_check_2): Add break so timer_check returns next
7747 timeout.
7748
dd86bd82
DA
77492012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7750
7751 Fix Windows build errors introduced after converting to WGET and WSET.
7752 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7753 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7754
054e1668
JD
77552012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7756
7757 * nsterm.m (ns_frame_rehighlight): Use FSET.
7758
7759 * nsmenu.m (ns_update_menubar): Use FSET.
7760
21238f11
DA
77612012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7762
7763 Separate read and write access to Lisp_Object slots of Lisp_Process.
7764 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7765 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7766
077288cf
DA
77672012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7768
7769 Separate read and write access to Lisp_Object slots of struct window.
7770 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7771 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7772 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7773 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7774 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7775 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7776 Adjust users.
7777
71688bd7
DA
77782012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7779
7780 Fix Windows build errors introduced after converting to FGET and FSET.
7781 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7782 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7783 (w32_judge_scroll_bars): Change to use FSET.
7784 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7785
f99bac93
DA
77862012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7787
7788 Fix replacement typo.
7789 * window.c (replace_window): Set root_window instead of
7790 selected_window. This fixes a total window subsystem
7791 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7792
8c2a0f2d
GM
77932012-08-06 Glenn Morris <rgm@gnu.org>
7794
7795 * lisp.mk (lisp): Add language/persian.elc.
7796
edd74c35
DA
77972012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7798
7799 Separate read and write access to Lisp_Object slots of struct frame.
7800 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7801 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7802 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7803 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7804 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7805
8671676c
AS
78062012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7807
7808 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7809
663e2b3f
DA
78102012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7811
7812 Generalize common compile-time constants.
7813 * lisp.h (header_size, bool_header_size, word_size): Now here.
7814 (struct Lisp_Vector): Add comment.
7815 (struct Lisp_Bool_Vector): Move up to define handy constants.
7816 (VECSIZE, PSEUDOVECSIZE): Simplify.
7817 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7818 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7819 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7820 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7821 * xfont.c, xmenu.c: Use word_size where appropriate.
7822
d32e47af
LM
78232012-08-05 Lawrence Mitchell <wence@gmx.li>
7824
7825 * search.c (Freplace_match): Treat \? in the replacement text
7826 literally (Bug#8161).
7827
e5d9c0d1
CY
78282012-08-05 Chong Yidong <cyd@gnu.org>
7829
7830 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7831 * frame.c (Vdelete_frame_functions):
7832 * emacs.c (Vkill_emacs_hook): Doc fix.
7833
8da0576b
EZ
78342012-08-04 Eli Zaretskii <eliz@gnu.org>
7835
7836 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7837 --with-x-toolkit=no builds.
7838 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7839
02676e5d
CY
78402012-08-04 Chong Yidong <cyd@gnu.org>
7841
7842 * syntax.c (Fmodify_syntax_entry): Doc fix.
7843
97147da9
EZ
78442012-08-04 Eli Zaretskii <eliz@gnu.org>
7845
76151e2c
EZ
7846 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7847 * w32.c (init_environment): Change the default values of many
7848 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
7849 them into environment when they were not already defined.
7850 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 7851 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
7852 (check_windows_init_file): Now external, not static.
7853 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
7854 called when Vload_path is already set up.
7855
7856 * w32.h (check_windows_init_file): Add prototype.
7857
7858 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7859 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7860 compatibility with Posix platforms.
7861 (main): Move the call to check_windows_init_file to here from
7862 w32.c.
7863 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7864 any, in the DEFALT argument into the root of the Emacs build or
7865 installation tree, as appropriate.
7866
7867 * callproc.c (init_callproc_1): Call decode_env_path instead of
7868 doing its equivalent by hand.
7869 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7870 the code that sets Vexec_path run on MS-Windows.
7871
7872 * lread.c (init_lread): Add comments to #ifdef's.
7873
97147da9
EZ
7874 * msdos.c (dos_set_window_size, IT_update_begin)
7875 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7876 instead of direct references.
7877
185ee146
PE
78782012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7879
7880 Export DEFAULT_REHASH_* to GDB.
7881 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7882 Now constants, not macros.
7883
8834c57a
PE
78842012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7885
98c6f1e3
PE
7886 Remove unnecessary casts involving pointers.
7887 These casts are no longer needed now that we assume C89 or later,
7888 since they involve casting to or from void *.
7889 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7890 (make_pure_float, make_pure_vector):
7891 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7892 * macros.c (Fstart_kbd_macro):
7893 * menu.c (find_and_return_menu_selection):
7894 * minibuf.c (read_minibuf_noninteractive):
7895 * sysdep.c (closedir):
7896 * xdisp.c (x_produce_glyphs):
7897 * xfaces.c (compare_fonts_by_sort_order):
7898 * xfns.c (x_real_positions, select_visual):
7899 * xselect.c (x_stop_queuing_selection_requests)
7900 (x_get_window_property, x_get_window_property_as_lisp_data):
7901 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7902 Remove unnecessary pointer casts.
7903 * alloc.c (record_xmalloc): New function.
7904 * lisp.h (record_xmalloc): New decl.
7905 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7906 more like a function. This is because the pointer cast is not
7907 needed. All uses changed.
7908 * print.c (print_string, print_error_message): Avoid length recalc.
7909
8834c57a
PE
7910 Improve fix for macroexp crash with debugging (Bug#12118).
7911 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7912 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7913 not supposed to be invoked from the garbage collector.
7914 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7915 (gc_aset): New function, which is like ASET but can be
7916 used in the garbage collector.
7917 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7918 (set_hash_index): Use it instead of ASET.
7919
6dad7178
EZ
79202012-08-03 Eli Zaretskii <eliz@gnu.org>
7921
7922 Support symlinks on latest versions of MS-Windows.
7923 * w32.c: Include winioctl.h and aclapi.h.
7924 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7925 (revert_to_self): Forward declarations of static functions.
7926 <static BOOL g_b_init_get_security_info>:
7927 <g_b_init_create_symbolic_link>: New static flags.
7928 (globals_of_w32): Initialize them to zero.
7929 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7930 (map_w32_filename): Improve commentary. Simplify switch.
7931 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7932 headers (most versions of MinGW w32api don't).
7933 (get_security_info, create_symbolic_link)
7934 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7935 New functions.
7936 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7937 in the argument file name.
7938 (sys_access): Call unc_volume_file_attributes only if
7939 GetFileAttributes fails with network-related error codes.
7940 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7941 have the required privileges.
14ae4239 7942 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
7943 get_file_security_desc.
7944 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
7945 with addition of handling of symlinks and support for 'lstat'.
7946 If possible, get file's attributes and security information by
6dad7178
EZ
7947 handle, not by name. Produce S_IFLNK bit for symlinks, when
7948 called from 'lstat'.
7949 (stat, lstat): New functions, call 'stat_worker'.
7950 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7951 symlinks when the underlying filesystem supports them.
7952
f162bcc3
PE
79532012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7954
79ea6c20
PE
7955 Fix macroexp crash on Windows with debugging (Bug#12118).
7956 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7957 checking subscripts; problem introduced with the recent
7958 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7959 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7960 since it's used in non-static inline functions now.
7961
c0ce93fd
PE
7962 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7963 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 7964
f162bcc3
PE
7965 Use C99-style 'extern inline' if available.
7966 * buffer.h (BUFFER_INLINE):
7967 * category.h (CATEGORY_INLINE):
7968 * character.h (CHARACTER_INLINE):
7969 * charset.h (CHARSET_INLINE):
7970 * composite.h (COMPOSITE_INLINE):
7971 * dispextern.h (DISPEXTERN_INLINE):
7972 * lisp.h (LISP_INLINE):
7973 * systime.h (SYSTIME_INLINE):
7974 New macro, replacing 'static inline' in this header.
7975 * buffer.h, category.h, character.h, charset.h, composite.h:
7976 * dispextern.h, lisp.h, systime.h:
7977 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7978 * alloc.c (LISP_INLINE):
7979 * buffer.c (BUFFER_INLINE):
7980 * category.c (CATEGORY_INLINE):
7981 * character.c (CHARACTER_INLINE):
7982 * charset.c (CHARSET_INLINE):
7983 * composite.c (COMPOSITE_INLINE):
7984 * dispnew.c (DISPEXTERN_INLINE):
7985 * sysdep.c (SYSTIME_INLINE):
7986 Define to EXTERN_INLINE, so that the corresponding functions
7987 are compiled into code.
7988 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7989 (INLINE_HEADER_END): New macros.
7990 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7991 since it's used in non-static inline functions now.
a8333d03 7992 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 7993
837b365b
GM
79942012-08-02 Glenn Morris <rgm@gnu.org>
7995
d66b744d
GM
7996 * s/: Remove empty directory.
7997
837b365b
GM
7998 * s/ms-w32.h: Move to ../nt/inc.
7999 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8000 Update for new ms-w32.h location.
8001
13294f95
PE
80022012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8003
8004 Port to Solaris 8.
8005 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8006
90df0db3
GM
80072012-08-02 Glenn Morris <rgm@gnu.org>
8008
8009 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8010 hard-coding the path separator.
8011
4939150c
PE
80122012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8013
8014 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8015 This how ASET and AREF are supposed to work, and makes
8016 it easier to think about future improvements. See
8017 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8018 * charset.h (set_charset_attr): New function.
8019 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8020 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8021 (aref_addr): New function. All uses of &AREF(...) changed.
8022 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8023 (set_hash_index): New functions. All lvalue-style uses of
8024 HASH_KEY etc. changed.
8025 * keyboard.c (set_prop): New function. All lvalue-style uses
8026 of PROP changed.
8027
947b2afd
AA
80282012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8029
8030 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8031 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 8032 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
8033 * nsfns.m (ns_set_name_as_filename): Likewise.
8034 * nsmenu.m (ns_update_menubar): Likewise.
8035 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8036
4f5d0325
EZ
80372012-08-01 Eli Zaretskii <eliz@gnu.org>
8038
2008beae
EZ
8039 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8040 Adapt to latest changes in field names of the corresponding Lisp
288479f6 8041 objects.
2008beae 8042
4f5d0325
EZ
8043 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8044
fe3cc771
GM
80452012-08-01 Glenn Morris <rgm@gnu.org>
8046
8047 * s/msdos.h: Remove file.
8048 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8049 * Makefile.in (S_FILE): Remove.
8050 (config_h): Remove S_FILE.
8051
c90acc54
JB
80522012-08-01 Juanma Barranquero <lekktu@gmail.com>
8053
8054 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8055 Remove; moved to nt/config.nt.
8056
d8a05828
DA
80572012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8058
8059 Use INTERNAL_FIELD for conses and overlays.
8060 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8061 Remove obsolete comment.
8062 (MVAR): New macro.
8063 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8064 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8065
8271d590
DA
80662012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8067
8068 Use INTERNAL_FIELD for symbols.
8069 * lisp.h (SVAR): New macro. Adjust users.
8070 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8071 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8072
3193acd2
DA
80732012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8074
8075 Use INTERNAL_FIELD for processes.
8076 * process.h (PVAR): New macro. Adjust style.
8077 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8078 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8079
3a45383a
DA
80802012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8081
8082 Use INTERNAL_FIELD for windows.
8083 * window.h (WVAR): New macro.
8084 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8085 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8086 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8087 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8088 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8089 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8090
c1dbc63c
PE
80912012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8092
8093 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8094
5c0c0e8a
GM
80952012-08-01 Glenn Morris <rgm@gnu.org>
8096
8097 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8098 Move to configure.ac.
8099
552a99b4
JB
81002012-08-01 Juanma Barranquero <lekktu@gmail.com>
8101
8102 * makefile.w32-in (CONFIG_H): Update dependencies.
8103 (CONF_POST_H): New macro.
8104
8105 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8106
8d8e2dfe
GM
81072012-07-31 Glenn Morris <rgm@gnu.org>
8108
bc96620a
GM
8109 * Makefile.in (S_FILE): No longer set by configure.
8110
476b1b2d
GM
8111 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8112 is available.
8113 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8114
b2c7a106
GM
8115 * process.h (NULL_DEVICE):
8116 * emacs.c (SEPCHAR):
8117 * editfns.c (USER_FULL_NAME): Let configure set them.
8118
d53d062a
GM
8119 * s/README, s/template.h: Remove files.
8120
4515017f
GM
8121 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8122
8d8e2dfe
GM
8123 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8124 Move to configure.ac.
8125
5b20b3cc
EZ
81262012-07-31 Eli Zaretskii <eliz@gnu.org>
8127
1e0afd9a
EZ
8128 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8129 resulting renaming of 'struct frame' members.
8130
5b20b3cc
EZ
8131 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8132
8133 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8134 after introduction of FVAR.
8135
f1310128
JD
81362012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8137
79e721e0
JD
8138 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8139
8140 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8141 instead of compositeToPoint.
8142 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8143
8d7c7eed 8144 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 8145
e34f7f79
DA
81462012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8147
8148 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8149 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 8150 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
8151 (BVAR): Change to use INTERNAL_FIELD.
8152 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8153 (KVAR): Change to use INTERNAL_FIELD.
8154 * frame.h (FVAR): New macro.
8155 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
8156 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8157 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8158 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
8159 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8160
c09bfb2f
DA
81612012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8162
8163 Miscellaneous fixes for non-default X toolkits.
8164 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8165 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8166 Move under #ifdef USE_LUCID.
8167 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8168 definition and usage to avoid warnings.
8169
14c114ae
JD
81702012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8171
8172 * nsterm.m (openFiles): Fix previous checkin.
8173
3bd21e82
PE
81742012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8175
8176 * indent.c (compute_motion): Remove unused local.
8177
c1529ded
GM
81782012-07-31 Glenn Morris <rgm@gnu.org>
8179
400d5621
GM
8180 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8181
268e2432
GM
8182 * conf_post.h [USG5_4]:
8183 Move remaining contents of s/usg5-4-common.h here.
8184 * s/usg5-4-common.h: Remove file.
8185
7552f3ee
GM
8186 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8187 * s/irix6-5.h: Remove file.
8188
6a381852
GM
8189 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8190 * s/darwin.h: Remove file.
8191
c1529ded
GM
8192 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8193 * s/hpux10-20.h: Remove file, which is now empty.
8194
b429a4ee
GM
81952012-07-30 Glenn Morris <rgm@gnu.org>
8196
8197 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8198 * Makefile.in (config_h): Add conf_post.h.
8199 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8200
adff3182
JD
82012012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8202
8203 * nsterm.m (ns_do_open_file): New variable.
b9031d69 8204 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
8205 (openFile, openTempFile, openFileWithoutUI, openFiles):
8206 Open files only if ns_do_open_file.
adff3182 8207
c32af1e4
PE
82082012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8209
7393bcbb
PE
8210 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8211 This no-op macro hasn't been needed for many years.
8212 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8213
c32af1e4
PE
8214 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8215 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8216 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8217 gdb_make_enums_visible.
8218 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8219 (DIRECTORY_SEP): Now a constant, not a macro.
8220
302fc036
EZ
82212012-07-30 Eli Zaretskii <eliz@gnu.org>
8222
8223 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8224 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8225
8226 * w32term.c <w32_keyboard_codepage>: Renamed from
8227 keyboard_codepage and now external. All users changed.
8228
8229 * w32term.h: Add declaration of w32_keyboard_codepage.
8230
8231 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8232 the codepage to translate keys to Unicode. If this argument is
8233 -1, use the value returned by GetConsoleCP. All callers changed.
8234
88fb40b4
PE
82352012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8236
0aee6912
PE
8237 Update .PHONY listings in makefiles.
8238 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8239 bootstrap-clean, distclean, maintainer-clean, versioclean,
8240 extraclean, frc.
8241
88fb40b4
PE
8242 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8243 This is a bit clearer. Fix some commentary typos.
8244
0a763bd1
GM
82452012-07-30 Glenn Morris <rgm@gnu.org>
8246
32bac6d6
GM
8247 * s/netbsd.h: Let configure include signal.h if needed.
8248 Remove file, which is now empty.
8249
b65e7c46
GM
8250 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8251 Let configure set them.
8252 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8253 No more need to undefine.
0a763bd1 8254
169304bd
AS
82552012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8256
8257 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8258 non-single-byte char when adding meta modifier. (Bug#12090)
8259
6cd7a139
DA
82602012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8261
8262 Convert safe_call to use variable number of arguments.
8263 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8264 (safe_call2): Fix comment.
8265 * lisp.h (safe_call): Adjust prototype.
8266 * coding.c (encode_coding_object): Change to use safe_call2.
8267 * xfaces.c (merge_face_heights): Change to use safe_call1.
8268
d34d6ffc
GM
82692012-07-30 Glenn Morris <rgm@gnu.org>
8270
7b8a48e4 8271 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 8272 does that unconditionally. Remove file, which is now empty.
7b8a48e4 8273
d34d6ffc
GM
8274 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8275 Remove empty files.
8276
03a660a6
PE
82772012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8278
8279 Export to GDB most of lisp.h's remaining object-like macros.
8280 * lisp.h (min, max): Move earlier, because they're used earlier now.
8281 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8282 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8283 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8284 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8285 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8286 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8287 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8288 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8289 Now constants, for GDB. They need not be macros.
8290 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8291 Now constants, for GDB, as well as macros, for static initializers.
8292 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8293 Move to after the definition of struct Lisp_Char_Table,
8294 since the former now needs that type defined.
8295 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8296 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8297 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8298 New enums, for gdb_make_enums_visible.
8299 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 8300 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
8301 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8302 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8303 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8304 enum maxargs, enum MAX_ALLOCA.
8305 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8306 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8307 no longer needed, now that they are done in lisp.h.
8308
e499d0ee
DA
83092012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8310
8311 Cleanup string bytes checking.
8312 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8313 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8314 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8315 (check_sblock, compact_small_strings): Simplify.
8316
d5040d2d
PE
83172012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8318
8319 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8320 These macros are confusing and no longer need to be defined, as
8321 the enum values now suffice. All uses replaced with definiens.
8322 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8323
7f259ae6
JB
83242012-07-29 Juanma Barranquero <lekktu@gmail.com>
8325
8326 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8327 ($(BLD)/w32console.$(O)): Update dependencies.
8328
7e63e0c3
DA
83292012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8330
8331 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8332 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8333 time. Adjust users.
8334 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8335
ffd817eb
JD
83362012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8337
8338 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8339 setting sitelisp (Bug#12010).
8340
417a7a0e
EZ
83412012-07-29 Eli Zaretskii <eliz@gnu.org>
8342
14ae4239 8343 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
8344
8345 * w32heap.c (cache_system_info):
8346 * w32.c (sys_rename):
8347 * w32proc.c (find_child_console, sys_kill): All users changed.
8348
387d4d92
PE
83492012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8350
8351 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8352
55a6cca6
EZ
83532012-07-29 Eli Zaretskii <eliz@gnu.org>
8354
8355 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8356
dbcf001c
DA
83572012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8358
8359 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
8360 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8361 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 8362
e2688e4a
DA
83632012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8364
8365 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8366 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8367 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8368 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8369 (replace_range, replace_range_2, del_range_2): Change to eassert.
8370 * marker.c (byte_char_debug_check): Adjust style.
8371
b46a6a83
PE
83722012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8373
8374 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8375 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8376 long-ago-commented-out code that talks about "WIN32".
8377 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8378 All uses changed.
8379
e32a5799
PE
83802012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8381
8382 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8383 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8384 Simplify by using alignof.
8385 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8386 * lisp.h: Include <stdalign.h>.
8387 (GCALIGNMENT): New macro and constant.
8388 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8389 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8390 (stdalign): New macro, if not already defined.
8391
df81cd29
EZ
83922012-07-28 Eli Zaretskii <eliz@gnu.org>
8393
01bd1b0d
EZ
8394 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8395 * w32inevt.c: Include w32inevt.h.
8396 (w32_read_console_input): New inline function, calls either
8397 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8398 w32_console_unicode_input.
8399 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8400 (w32_kbd_patch_key, key_event): Use the codepage returned by
8401 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8402 (key_event): use uChar.UnicodeChar only if
8403 w32_console_unicode_input is non-zero.
8404
8405 * w32console.c: Include w32heap.h.
8406 <w32_console_unicode_input>: New global variable.
8407 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8408 family of Windows, zero otherwise.
8409
8410 * w32inevt.h: Declare w32_console_unicode_input.
8411
df81cd29
EZ
8412 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8413 --without-x. (Bug#11742)
8414
c20fdd9e
PE
84152012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8416
8417 Adjust GDB to reflect pvec_type changes (Bug#12036).
8418 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
8419 2012-07-04 changes to pseudovector representation.
8420 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 8421
32770973 84222012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
8423
8424 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8425 bus address.
8426 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8427
3438fe21
EZ
84282012-07-27 Eli Zaretskii <eliz@gnu.org>
8429
bcfbc9de
EZ
8430 * alloc.c (listn): Fix the order the arguments are consed onto the
8431 list.
8432
3438fe21
EZ
8433 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8434 enumeration constants, as PURE and HEAP are too general, and clash
8435 with other headers and sources, such as gmalloc.c and the
8436 MS-Windows system headers. All users changed.
8437
eeaea515
DA
84382012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8439
8440 Revert last save_excursion_save and save_excursion_restore changes.
8441 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8442 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8443
073c88c2
DA
84442012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8445
8446 Fix recently-introduced typos in Windows port.
8447 Reported by Martin Rudalics <rudalics@gmx.at>.
8448 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 8449 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 8450
4706125e
PE
84512012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8452
8453 Improve GDB symbol export (Bug#12036).
8454 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8455 arms of an 'if', not using conditional expressions; otherwise GDB
8456 complains about the types in the unevaluated arm when the argument
8457 is an integer literal.
8458 (xgetint): Simplify expression.
8459 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8460 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8461 Zaretskii in <http://bugs.gnu.org/12036#13>.
8462 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8463 needed now that we have gdb_make_enums_visible.
8464 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8465 (enum enum_USE_LSB_TAG):
8466 New enum types, packaging up enums that need to be exported to GDB.
8467
694b6c97
DA
84682012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8469
8470 Utility function to make a list from specified amount of objects.
8471 * lisp.h (enum constype): New datatype.
8472 (listn): New prototype.
8473 * alloc.c (listn): New function.
8474 (Fmemory_use_count, syms_of_alloc): Use it.
8475 * buffer.c (syms_of_buffer): Likewise.
8476 * callint.c (syms_of_callint): Likewise.
8477 * charset.c (define_charset_internal): Likewise.
8478 * coding.c (syms_of_coding): Likewise.
8479 * keymap.c (syms_of_keymap): Likewise.
8480 * search.c (syms_of_search): Likewise.
8481 * syntax.c (syms_of_syntax): Likewise.
8482 * w32.c (init_environment): Likewise.
8483 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8484 * xdisp.c (syms_of_xdisp): Likewise.
8485 * xfns.c (syms_of_xfns): Likewise.
8486
6195f384
DA
84872012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8488
8489 Fast save_excursion_save and save_excursion_restore.
8490 * lisp.h (struct Lisp_Excursion): New data type.
8491 (PVEC_EXCURSION): New pseudovector type.
8492 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8493 to deal with it. Adjust comments.
8494 (init_marker, attach_marker): New prototype.
8495 (unchain_marker): Adjust prototype.
8496 * marker.c (attach_marker): Change to global.
8497 (init_marker): New function.
8498 * alloc.c (Fmake_marker, build_marker): Use it.
8499 (build_marker): More easserts.
8500 (mark_object): Handle struct Lisp_Excursion.
8501 * editfns.c (save_excursion_save, save_excursion_restore):
8502 Reimplement to use struct Lisp_Excursion. Add comments.
8503
5eceb8fb
PE
85042012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8505
8506 Fix export of symbols to GDB (Bug#12036).
8507 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8508 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8509 emacs.c, as this is a more-suitable home. Had this been done earlier
8510 the fix for 12036 would have avoided some of the problems noted in
8511 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8512 would have been more obvious.
562157c8
PE
8513 * emacs.c: Do not include <verify.h>; no longer needed.
8514 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
8515 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8516 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8517 Remove; now done in lisp.h.
8518 * lisp.h (PUBLISH_TO_GDB): New macro.
8519 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8520 (DATA_SEG_BITS): Use it.
8521 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8522 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8523 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8524 not be usable in #if. This simplifies things.
8525
d6749401
JB
85262012-07-26 Juanma Barranquero <lekktu@gmail.com>
8527
8528 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8529
1781b9e9
PE
85302012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8531
d89518db 8532 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
8533 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8534 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8535 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8536 Adjust to changes in lisp.h and emacs.c, by using
8537 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8538 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8539 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8540 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8541 instead of gdb_valbits.
8542 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8543 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8544 instead of gdb_array_mark_flag.
8545 (xboolvector): Get size from $->size, not $->header.size.
8546 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8547 (xreload, hook-run, hookpost-run): Remove.
8548 * emacs.c: Include <verify.h>.
8549 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8550 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8551 Remove.
8552 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8553 (gdb_USE_LSB_TAG): New enum constants.
8554 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8555 Also define these as enum constants, so they're visible to GDB.
8556 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8557 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8558 as constants, so they're visible to GDB.
8559 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8560 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8561 Now enum constants, not macros, so they're visible to GDB.
8562 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8563 more convenient now. All uses changed.
8564 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8565 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8566
3628596a
DA
85672012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8568
8569 Explicitly free restriction data that are not needed anymore.
8570 * editfns.c (save_restriction_restore): Free restriction data.
8571
7abaf5cc
SM
85722012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8573
8574 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8575 add argument, tune behavior, and adjust all callers.
8576
71f88e00
PE
85772012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8578
8579 Use typedef for EMACS_INT, EMACS_UINT.
8580 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8581 than macros. This simplifies debugging in the usual case, since
8582 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8583 and it allows expressions involving EMACS_INT casts.
8584 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8585
57ec3034
JD
85862012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8587
8588 * nsterm.m (ns_read_socket): Return early if there is a modal
8589 window (Bug#12043).
8590
8137e7b3
MR
85912012-07-25 Martin Rudalics <rudalics@gmx.at>
8592
8593 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8594 that FOCUS-FRAME can be omitted.
8595
04e9897c
DA
85962012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8597
8598 Adjust buffer text indirection counters at the end of Fkill_buffer.
8599 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8600 buffer is definitely dead. This should really fix an issue reported
8601 by Christoph Scholtes again. (Bug#12007).
8602 (init_buffer_once): Initialize indirection counters of
8603 buffer_defaults and buffer_local_symbols (for sanity and safety).
8604
8a0484e1
EZ
86052012-07-24 Eli Zaretskii <eliz@gnu.org>
8606
8607 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8608 and continuation glyphs on tooltip frames, leave them at zero.
8609 Avoids continued lines in tooltips. (Bug#11832)
8610
fa691a83
DA
86112012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8612
8613 Simplify copy_overlay.
04e9897c 8614 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
8615 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8616
436bc8e0
EZ
86172012-07-23 Eli Zaretskii <eliz@gnu.org>
8618
8619 * print.c (print_object): Don't crash when a frame's name is nil
8620 or invalid. (Bug#12025)
8621
8622 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8623 it signals an error when a tooltip frame is being created.
8624
d7a7fda3
DA
86252012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8626
8627 Cleanup miscellaneous objects allocation and initialization.
8628 * alloc.c (allocate_misc): Change to static. Add argument to
8629 specify the subtype. Adjust comment and users.
8630 (build_overlay): New function.
8631 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8632 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8633 (allocate_misc): Remove prototype.
8634 (build_overlay): Add prototype.
8635
86362012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
8637
8638 Swap buffer text indirection counters in Fbuffer_swap_text.
8639 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8640 This avoids crash reported by Christoph Scholtes at
8641 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8642
9d7fa573
JD
86432012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8644
8645 * nsmenu.m (Popdown_data): New struct.
8646 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8647 free Popdown_data.
8648 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8649 (initWithContentRect): Make imgView and contentView non-static
8650 and autorelease them. Also autorelease img and matrix (Bug#12005).
8651 (dealloc): Remove (Bug#12005).
8652
0dd6d66d
DA
86532012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8654
8655 Adjust consing_since_gc when objects are explicitly freed.
8656 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8657 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8658 (free_cons, free_misc): Subtract object size from consing_since_gc.
8659
d36d71df
DA
86602012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8661
8662 Simplify and cleanup markers positioning code.
8663 * marker.c (attach_marker): More useful eassert.
8664 (live_buffer, set_marker_internal): New function.
8665 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8666 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8667
fb9ea40f
PE
86682012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8669
8670 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8671 as it's limited by the amount of memory, not by INT_MAX.
8672
2d5c5f7d
EZ
86732012-07-21 Eli Zaretskii <eliz@gnu.org>
8674
07fb592e
EZ
8675 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8676 in special-event-map. See the discussion at
8677 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8678 for the reasons.
8679
37a9eac8 8680 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
8681 info.dwItemData. Fixes crashes on 64-bit Windows.
8682 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 8683
c4328746
JD
86842012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8685
fc0c31f8 8686 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 8687 (conversationIdentifier): Return value is NSInteger.
784051c4 8688 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 8689
6e5d1c12
CY
86902012-07-21 Chong Yidong <cyd@gnu.org>
8691
8692 * window.c (decode_any_window): Signal an error if the window is
8693 on a dead frame (Bug#11984).
8694
9928463d
DA
86952012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8696
8697 Add indirection counting to speed up Fkill_buffer.
8698 * buffer.h (struct buffer): New member.
8699 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8700 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8701 base buffer indirection counter.
8702 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8703 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8704 through buffer list if indirection counter is 0.
8705
f8643a6b
DA
87062012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8707
8708 Extend the value returned by Fgarbage_collect with heap statistics.
8709 * alloc.c (Qheap): New symbol.
8710 (syms_of_alloc): DEFSYM it.
8711 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8712 (Fmemory_free): Remove.
8713 (syms_of_alloc): Don't defsubr it.
8714 * buffer.c (Fcompact_buffer): Remove.
8715 (syms_of_buffer): Don't defsubr it.
8716
dac616ff
DA
87172012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8718
8719 Make maybe_gc inline.
8720 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8721 * lisp.h (consing_since_gc, gc_relative_threshold)
8722 (memory_full_cons_threshold): Revert declaration.
8723 (maybe_gc): Remove prototype, define as inline.
8724 * alloc.c: Remove old commented-out code.
8725 (consing_since_gc, gc_relative_threshold)
8726 (memory_full_cons_threshold): Revert to global.
8727 (maybe_gc): Remove.
8728
d7ea76b4
DA
87292012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8730
8731 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8732 * lisp.h (build_unibyte_string): New function.
8733 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8734 * sysdep.c, w32fns.c, xfns.c: Use it.
8735 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8736 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8737 Adjust users accordingly.
8738 * font.h (font_open_by_name): Adjust prototype.
8739
765e61e3
DA
87402012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8741
8742 Cleanup calls to Fgarbage_collect.
8743 * lisp.h (maybe_gc): New prototype.
8744 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8745 Remove declarations.
8746 * alloc.c (maybe_gc): New function.
8747 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8748 Make them static.
8749 * bytecode.c (MAYBE_GC): Use maybe_gc.
8750 * eval.c (eval_sub, Ffuncall): Likewise.
8751 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8752 to avoid dependency from auto-save feature.
8753
52b852c7
PE
87542012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8755
8756 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8757 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8758 'for_each_per_buffer_object_at'.
8759 All uses changed. It's better to use upper-case for macros that
8760 cannot be implemented as functions, to give the reader a clue
8761 that they're special.
8762
5db81e33
SM
87632012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8764
8765 * alloc.c (Fgarbage_collect): Tweak docstring.
8766
5b835e1d
DA
87672012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 Tweak the value returned from Fgarbage_collect again.
8770 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8771 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8772 Adjust documentation.
8773 (total_vector_bytes): Rename to total_vector_slots, adjust
8774 accounting.
8775 (total_free_vector_bytes): Rename to total_free_vector_slots,
8776 adjust accounting.
8777 (Qstring_bytes, Qvector_slots): New symbols.
8778 (syms_of_alloc): DEFSYM them.
8779
9cd47b72
DA
87802012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8781
8782 Buffer compaction primitive which may be used from Lisp.
8783 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8784 (syms_of_buffer): Register Fcompact_buffer.
8785 * alloc.c (Fgarbage_collect): Use compact_buffer.
8786 * buffer.h (compact_buffer): New prototype.
8787 (struct buffer_text): New member.
8788
d17337e5
DA
87892012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8790
8791 New macro to iterate over all buffers, miscellaneous cleanups.
8792 * lisp.h (all_buffers): Remove declaration.
8793 * buffer.h (all_buffers): Add declaration, with comment.
8794 (for_each_buffer): New macro.
8795 * alloc.c (Fgarbage_collect, mark_object): Use it.
8796 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8797 (init_buffer): Likewise.
8798 * data.c (Fset_default): Likewise.
8799 * coding.c (code_conversion_restore): Remove redundant check
8800 for dead buffer.
8801 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8802
60cfd278
AS
88032012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8804
8805 Fix bug that created negative-length intervals.
8806 * intervals.c (merge_interval_right, merge_interval_left):
8807 Do not zero out this interval if it is absorbed by its children,
8808 as this interval's total length doesn't change in that case. See
8809 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8810
d06714cb
PE
88112012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8812
83713154
PE
8813 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8814 when invoking (make-bool-vector N t) and N is a positive
8815 multiple of 8 -- the last 8 bits were mistakenly cleared.
8816
d06714cb
PE
8817 Remove some struct layout assumptions in bool vectors.
8818 * alloc.c (bool_header_size): New constant.
8819 (header_size, word_size): Move earlier, as they're now used earlier.
8820 Use 'word_size' in a few more places, where it's appropriate.
8821 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8822 padding before the data member of a bool vector.
8823 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8824 than doing the check by hand with an abort ().
8825
464d5a5e
SM
88262012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8827
5fbc0409
SM
8828 * eval.c (Fdefvar): Don't check constants since we only set the var if
8829 it's not yet defined anyway (bug#11904).
8830
464d5a5e
SM
8831 * lisp.h (last_undo_boundary): Declare new var.
8832 * keyboard.c (command_loop_1): Set it.
8833 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8834 were auto-added by the command loop (bug#11774).
8835
8dc2e44a
AS
88362012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8837
8838 * w32font.c (Qsymbol): Remove local definition.
8839 (syms_of_w32font): Don't DEFSYM it.
8840
169925ec
DA
88412012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8842
8843 Fix sweep_vectors to handle large bool vectors correctly.
8844 * alloc.c (sweep_vectors): Account total_vector_bytes for
8845 bool vectors larger than VBLOCK_BYTES_MAX.
8846
5fbfb018
CY
88472012-07-18 Chong Yidong <cyd@gnu.org>
8848
8849 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8850 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8851
3ab6e069
DA
88522012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8853
8854 Return more descriptive data from Fgarbage_collect.
8855 Suggested by Stefan Monnier in
8856 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8857 * alloc.c (bounded_number): New function.
8858 (total_buffers, total_vectors): New variable.
8859 (total_string_size): Rename to total_string_bytes, adjust users.
8860 (total_vector_size): Rename to total_vector_bytes, adjust users.
8861 (sweep_vectors): Account total_vectors and total_vector_bytes.
8862 (Fgarbage_collect): New return value. Adjust documentation.
8863 (gc_sweep): Account total_buffers.
8864 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8865 (VECTOR_SIZE): Remove.
8866 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8867 (Qinterval, Qmisc): New symbols.
8868 (syms_of_data): Initialize them.
8869 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8870 (Qcons, Qbuffer): New declarations.
8871
6d02fe5b
PE
88722012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8873
8874 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8875 Round up, not down. Improve doc.
8876
b7ffe040
DA
88772012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8878
8879 Restore old code in allocate_string_data to avoid Faset breakage.
8880 Reported by Julien Danjou <julien@danjou.info> in
8881 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8882 * alloc.c (allocate_string_data): Restore old code with minor
8883 adjustments, fix comment to explain this subtle issue.
8884
4dc7c8d5
SM
88852012-07-17 Eli Zaretskii <eliz@gnu.org>
8886
8887 Remove FILE_SYSTEM_CASE.
8888 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8889
8890 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8891 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8892 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8893 call-process-region passes it through expand-file-name.
8894
8895 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8896
88972012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8898
8899 Fix crash when creating indirect buffer (Bug#11917)
8900 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8901 Don't handle unbound variables specially if non-zero.
8902 (Fbuffer_local_variables): Pass zero.
8903 (clone_per_buffer_values): Pass non-zero.
8904
89052012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8906
8907 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8908 to make the loop interruptible.
8909
89102012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8911
8912 * gnutls.c (emacs_gnutls_handshake): Only retry if
8913 GNUTLS_E_INTERRUPTED.
8914
cce7fefc
DA
89152012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8916
8917 Cleanup and convert miscellaneous checks to eassert.
8918 * alloc.c (mark_interval): Fix comment, partially rephrase
8919 old comment from intervals.h (see below).
8920 * intervals.c (find_interval, adjust_intervals_for_insertion)
8921 (delete_interval, adjust_intervals_for_deletion)
8922 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8923 Convert to eassert.
8924 (adjust_intervals_for_insertion, make_new_interval):
8925 Remove obsolete and unused code.
8926 * intervals.h (struct interval): Remove obsolete comment.
8927 * textprotp.c (erase_properties): Remove unused code.
8928 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8929 (Fremove_list_of_text_properties): Convert to eassert.
8930
9ea10cc3
CY
89312012-07-17 Chong Yidong <cyd@gnu.org>
8932
8933 * editfns.c (Finsert_char): Doc fix.
8934
3900d5de
DA
89352012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8936
8937 Fix previous change to make Fmemory_free always accurate.
8938 * alloc.c (make_interval): Update total_free_intervals.
8939 (make_float): Likewise for total_free_floats.
8940 (free_cons, Fcons): Likewise for total_free_conses.
8941 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8942 Likewise for total_free_vector_bytes.
8943 (Fmake_symbol): Likewise for total_free_symbols.
8944 (bytes_free): Remove.
8945
7098646f
DA
89462012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8947
8948 Simple free memory accounting feature.
8949 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8950 (sweep_vectors): Accumulate size of free vectors.
8951 (Fgarbage_collect): Setup bytes_free.
8952 (Fmemory_free): New function.
8953 (syms_of_alloc): Register it.
8954
22657b40
DA
89552012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8956
8957 Cleanup overlays checking.
8958 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8959 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8960 eassert and OVERLAYP.
8961 (sort_overlays): Change to use OVERLAYP.
8962
ddfc8813
RK
89632012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8964
8965 * editfns.c (Finsert_char): Make it interactive, and make the
8966 second arg optional. Copy interactive spec and docstring from
8967 ucs-insert.
8968
7c26cf3c
PE
89692012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8970
8971 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8972 Unlike the other wrapped functions, fabs has an unspecified
8973 effect on errno.
8974
5d127af9
JD
89752012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8976
8977 * nsterm.m (keyDown): Interpret flags without left/right bits
8978 as the left key (Bug#11670).
8979
6a0dd1d7
DA
89802012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8981
8982 Remove empty and useless init functions.
8983 * lisp.h (init_character_once, init_fns, init_image)
8984 (init_filelock, init_sound): Remove prototype.
8985 * character.c (init_character_once): Remove.
8986 * filelock.c (init_filelock): Likewise.
8987 * fns.c (init_fns): Likewise.
8988 * image.c (init_image): Likewise.
8989 * sound.c (init_sound): Likewise.
8990 * emacs.c (main): Adjust accordingly.
8991
7a6136fd
DA
89922012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8993
8994 * gtkutil.h: Tiny cleanups.
8995 (use_old_gtk_file_dialog): Remove useless declaration.
8996 (xg_uses_old_file_dialog): Add suggested const attribute.
8997
ce811ad9
EZ
89982012-07-15 Eli Zaretskii <eliz@gnu.org>
8999
9000 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9001 (bidi_paragraph_init): Use it to limit search forward for a strong
9002 directional character in abnormally large paragraphs full of
9003 neutral or weak characters. (Bug#11943)
9004
c9adfeaa
SF
90052012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9006
9007 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9008 the toolbar (Bug#9451).
9009 (xg_make_tool_item): Give the widget event box a transparent
9010 background.
9011
fff62aa9
DA
90122012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9013
9014 Cleanup basic allocation variables and functions.
9015 * alloc.c (ignore_warnings, init_intervals, init_float)
9016 (init_cons, init_symbol, init_marker): Remove.
9017 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9018 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9019 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9020 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9021 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9022 (staticidx, init_alloc_once, init_strings, free_ablock):
9023 Remove redundant initialization.
9024 * fns.c (init_weak_hash_tables): Remove.
9025 * lisp.h (init_weak_hash_tables): Remove prototype.
9026
9730daca
DA
90272012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9028
9029 Use zero_vector where appropriate.
9030 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9031 accordingly.
9032 * lisp.h (zero_vector): New declaration.
9033 * font.c (null_vector): Remove.
9034 (syms_of_font): Remove initialization and staticpro.
9035 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9036 * keymap.c (Faccessible_keymaps): Likewise.
9037
2e2d2a13
LL
90382012-07-15 Leo Liu <sdl.web@gmail.com>
9039
9040 * fringe.c: Fix typo in comments.
9041
cd276f6e
LL
90422012-07-14 Leo Liu <sdl.web@gmail.com>
9043
9044 * fringe.c: Add a new bitmap exclamation-mark.
9045
5a1131d9
EZ
90462012-07-14 Eli Zaretskii <eliz@gnu.org>
9047
9048 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9049
9050 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9051 (HAVE_MENUS): Don't define, defined by editing config.in with
9052 msdos/sed2v2.inp.
9053 (GMALLOC_INHIBIT_VALLOC): Don't define.
9054 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9055
22e983b7
JB
90562012-07-14 Juanma Barranquero <lekktu@gmail.com>
9057
9058 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9059
5b3f250f
GM
90602012-07-14 Glenn Morris <rgm@gnu.org>
9061
9062 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9063 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9064 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9065
33d63ff4
GM
90662012-07-13 Glenn Morris <rgm@gnu.org>
9067
5b633342
GM
9068 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9069
33d63ff4
GM
9070 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9071 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9072
b55b9f85
JD
90732012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9074
0dc8cf50
JD
9075 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9076 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9077 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9078 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9079 where appropriate.
9080 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9081 as boolean expression.
9082 (x_set_window_size): Remove unused variable toolbar.
9083 (ns_get_color_default, ns_mod_to_lisp): Remove.
9084 (ns_mouse_position): Remove unused variables xchar and ychar.
9085 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9086 (ns_set_vertical_scroll_bar): Remove unused variable count.
9087 (ns_delete_terminal): Remove unused variable i.
9088 (ns_term_init): Remove unused variables r, g and b.
9089 (mouseDown): Remove unused variable window.
9090 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9091 (initFrameFromEmacs): Remove unused variable vbextra.
9092 (mouseEntered): Remove unused variables p and dpyinfo.
9093 (mouseExited): Remove unused variables p and r.
9094 (ns_define_frame_cursor, ns_clear_frame_area)
9095 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9096 (menuDown): Assign [sender tag] to variable and cast the variable.
9097
9098 * nsterm.h (menuDown): Add id as type to argument sender.
9099 (ns_display_info_for_name): Add Lisp_Object argument.
9100 (ns_term_init): Add Lisp_Object argument.
9101 (ns_map_event_to_object): Add void argument.
9102 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9103 prototype with arguments and only declare if __OBJC__.
9104 (nxatoms_of_nsselect): Add void argument.
9105 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9106 (ns_alloc_autorelease_pool): Add void argument.
9107 (ns_release_autorelease_pool): Add void* argument.
9108 (ns_get_defaults_value): Add const char* argument.
9109
9110 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9111 (initFromContents): Use SSDATA where appropriate.
9112 (ns_update_menubar): Add braces to ambigous if-else.
9113 (initWithTitle): Put () around assignment in if statement.
9114 (ns_menu_show): Remove unused variables window and keymap.
9115 (update_frame_tool_bar): Remove unused variable selected_p.
9116 (initWithContentRect): Remove unused variable this_cmd_name.
9117
9118 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9119 appropriate.
9120 (setXBMColor): Remove unused variable len.
9121 (setPixmapData): Put () around assignment in loop statement.
9122
9123 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9124 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9125 where appropriate.
9126 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9127 around assignment in loop statement.
9128 (nsfont_open): Remove unused variable i.
9129 (nsfont_open): Remove unused variable len.
9130 (nsfont_draw): Remove unused variable cs.
9131
9132 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9133 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9134 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9135 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9136 (Fns_font_name, Fns_perform_service)
9137 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9138 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9139 (ns_set_name): Remove unused variable view.
9140 (x_set_menu_bar_lines): Remove unused variable olines.
9141 (x_set_tool_bar_lines): Remove unused variable root_window.
9142 (Fns_list_colors): Put () around assignment in while statement.
9143 (Fns_perform_service): Remove unused variable len.
9144 (Fns_display_usable_bounds): Remove unused variable top.
9145 (syms_of_nsfns): Remove unused variable i.
9146
b55b9f85
JD
9147 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9148 memcpy (Bug#11907).
9149
ed9265fc 91502012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
9151
9152 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9153 and free it with DestroyExceptionInfo (Bug#11558).
9154
ef099b57
JB
91552012-07-13 Juanma Barranquero <lekktu@gmail.com>
9156
9157 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9158 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9159 Set here, not in nt/config.nt.
9160
ea814a5d
EZ
91612012-07-13 Eli Zaretskii <eliz@gnu.org>
9162
9163 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9164 cursor overflow into the last glyph on display line when the right
9165 fringe is off. (Bug#11832)
9166
1a952767
PE
91672012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9168
9169 * xdisp.c (produce_special_glyphs): Now static.
9170 * dispextern.h (produce_special_glyphs): Remove decl.
9171
983188fd
GM
91722012-07-13 Glenn Morris <rgm@gnu.org>
9173
8d7c7eed 9174 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
9175 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9176
983188fd
GM
9177 * s/usg5-4-common.h (USG, USG5):
9178 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9179 * s/sol2-6.h (SOLARIS2):
9180 * s/irix6-5.h (IRIX6_5):
9181 * s/hpux10-20.h (USG, USG5, HPUX):
9182 * s/gnu-linux.h (USG, GNU_LINUX):
9183 * s/freebsd.h (BSD_SYSTEM):
9184 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9185 * s/cygwin.h (CYGWIN):
9186 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9187 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9188
d1e68667 91892012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
9190
9191 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 9192
6de0e799
GM
91932012-07-13 Glenn Morris <rgm@gnu.org>
9194
739ae010
GM
9195 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9196
dbee5793
GM
9197 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9198
6de0e799
GM
9199 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9200 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9201
b82da769
GM
92022012-07-12 Glenn Morris <rgm@gnu.org>
9203
4fae5a7a 9204 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
9205
9206 * process.c (init_process_emacs): Rename from init_process.
9207 The old name is also the name of a Mach system call.
9208 * lisp.h, emacs.c: Update for this name change.
9209 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9210 longer needed.
9211
5a979817
EZ
92122012-07-12 Eli Zaretskii <eliz@gnu.org>
9213
9214 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9215 memmove call that removes glyphs covered by the left truncation
9216 glyph. Improve commentary.
9217 (display_line): Fix display of continuation glyphs on GUI frames
9218 when the right fringe is turned off and variable-size fonts are
9219 used in the window. Move the code that appends a stretch glyph to
9220 produce_special_glyphs, so that it could be used for truncation
9221 and continuation glyphs alike.
9222 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9223 glyph of a suitably computed width, to align the special glyphs at
9224 the window margin. Code moved from display_line. (Bug#11832)
9225
3e91a053
GM
92262012-07-12 Glenn Morris <rgm@gnu.org>
9227
ba9e4b84
GM
9228 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9229
9230 * s/gnu-linux.h, s/hpux10-20.h:
9231 Do not unconditionally define HAVE_XRMSETDATABASE.
9232
3e91a053
GM
9233 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9234
b300b1f4
PE
92352012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9236
9237 Fix typos that broke OS X build.
9238 Reported by Randal L. Schwartz in
9239 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9240 * nsterm.m (ns_timeout): Add missing local decl.
9241 (ns_get_color): snprintf -> sprintf, to fix typo.
9242
6e777848
GM
92432012-07-12 Glenn Morris <rgm@gnu.org>
9244
3f922c37
GM
9245 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9246 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9247 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9248 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9249
0ab7b23a
GM
9250 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9251 Move PTY_OPEN to configure.
9252
6e777848
GM
9253 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9254 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9255 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9256
4a7edc24
DA
92572012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9258
9259 Use empty_unibyte_string where applicable.
9260 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9261 * lread.c (read1): Likewise.
9262 * xsettings.c (syms_of_xsettings): Likewise.
9263
308aab79
GM
92642012-07-12 Glenn Morris <rgm@gnu.org>
9265
42bd1719
GM
9266 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9267 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
9268 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9269 * s/hpux10-20.h (RUN_TIME_REMAP):
9270 * s/bsd-common.h (TABDLY): Move to configure.
9271
9272 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9273
9274 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9275
ea0bbd17 9276 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 9277 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
9278
9279 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 9280
308aab79
GM
9281 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9282 * s/template.h: Move NARROWPROTO to configure.
9283
ee1cf5cf
GM
92842012-07-11 Glenn Morris <rgm@gnu.org>
9285
30fe9bf4
GM
9286 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9287 unused since 2011-01-17 change to systty.h.
9288
ee1cf5cf
GM
9289 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9290 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9291 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9292
63e47e07
PE
92932012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9294
9295 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9296
c43fb4c3
GM
92972012-07-11 Glenn Morris <rgm@gnu.org>
9298
9299 * s/darwin.h, s/gnu-linux.h, s/template.h:
9300 Move INTERRUPT_INPUT to configure.
9301
e8df9267
DA
93022012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9303
9304 Minor adjustments to interning code.
9305 * lisp.h (intern, intern_c_string): Redefine as static inline
9306 wrappers for intern_1 and intern_c_string_1, respectively.
9307 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
9308 * lread.c (intern_1, intern_c_string_1, oblookup):
9309 Simplify Vobarray checking.
e8df9267
DA
9310 * font.c (font_intern_prop): Likewise. Adjust comment.
9311 * w32font.c (intern_font_name): Likewise.
9312
34348bd4
AS
93132012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9314
d96a1e0c
AS
9315 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9316
34348bd4
AS
9317 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9318 of Fcar/Fcdr if possible.
9319 * font.c (check_otf_features): Likewise.
9320 * fontset.c (Fnew_fontset): Likewise.
9321 * gnutls.c (Fgnutls_boot): Likewise.
9322 * minibuf.c (read_minibuf): Likewise.
9323 * msdos.c (IT_set_frame_parameters): Likewise.
9324 * xmenu.c (Fx_popup_dialog): Likewise.
9325 * w32menu.c (Fx_popup_dialog): Likewise.
9326
c8add24e
GM
93272012-07-11 Glenn Morris <rgm@gnu.org>
9328
4b575b3c
GM
9329 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9330 since nothing has defined it on these platforms.
9331
09f4e3b0
GM
9332 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9333 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9334
172bedef
GM
9335 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9336 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9337 Move CLASH_DETECTION to configure.
9338
249685df
GM
9339 * s/gnu.h: Remove file, which is now empty.
9340
c8add24e
GM
9341 * s/gnu.h, s/gnu-linux.h:
9342 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9343
b41253a3
JW
93442012-07-11 John Wiegley <johnw@newartisans.com>
9345
9346 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9347 function attribute, so we only use it if it exists in the
9348 compiler.
9349
d923b542
DA
93502012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9351
9352 Avoid call to strlen in fast_c_string_match_ignore_case.
9353 * search.c (fast_c_string_match_ignore_case): Change to use
9354 length argument. Adjust users accordingly.
9355 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9356
5ebbef1d
PE
93572012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9358
bb352260
PE
9359 Assume mkdir, rmdir.
9360 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9361 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9362
57054ddd
PE
9363 Assume rename.
9364 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9365
b747d3f7
PE
9366 Assume perror.
9367 * s/hpux10-20.h (HAVE_PERROR): Remove.
9368 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9369 Remove dummy definition, as this problem was obsolete long ago.
9370
5ebbef1d
PE
9371 Assume strerror.
9372 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9373
984e7f30
DA
93742012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9375
9376 Avoid calls to strlen in font processing functions.
9377 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
9378 (font_open_by_name): Change to use length argument.
9379 Adjust users accordingly.
d923b542
DA
9380 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9381 Adjust prototypes.
9382 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9383 Change to return ptrdiff_t.
984e7f30
DA
9384 (xfont_list_pattern, xfont_match): Use length returned by
9385 xfont_decode_coding_xlfd.
9386 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9387
20e94fdd
GM
93882012-07-11 Glenn Morris <rgm@gnu.org>
9389
9d596af3
GM
9390 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9391 Move DONT_REOPEN_PTY to configure.
9392
20e94fdd
GM
9393 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9394 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9395
e99a530f
PE
93962012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9397
22ffb973
PE
9398 Remove "#define unix" that is no longer needed (Bug#11905).
9399 * s/aix4-2.h (unix): Remove; no longer needed.
9400
e9a9ae03
PE
9401 EMACS_TIME simplification (Bug#11875).
9402 This replaces macros (which typically do not work in GDB)
9403 with functions, typedefs and enums, making the code easier to debug.
9404 The functional style also makes code easier to read and maintain.
9405 * systime.h: Include <sys/time.h> on all hosts, not just if
9406 WINDOWSNT, since 'struct timeval' is needed in general.
9407 (EMACS_TIME): Now a typedef, not a macro.
9408 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9409 not macros.
9410 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9411 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9412 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9413 (EMACS_TIME_LE): Now functions, not macros.
9414 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9415 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9416 which are not functions. All uses rewritten to use:
9417 (make_emacs_time): New function.
9418 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9419 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9420 not functions. All uses rewritten to use the following, respectively:
9421 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9422 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 9423 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
9424 * fileio.c (Fcopy_file):
9425 * xterm.c (XTflash): Get the current time closer to when it's used.
9426 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9427
ffacb126
PE
9428 * bytecode.c (targets): Suppress -Woverride-init warnings.
9429
e99a530f
PE
9430 Simplify by avoiding confusing use of strncpy etc.
9431 * doc.c (Fsnarf_documentation):
9432 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9433 * frame.c (Fmake_terminal_frame):
9434 * gtkutil.c (get_utf8_string):
9435 * lread.c (openp):
9436 * nsmenu.m (ns_update_menubar):
9437 * regex.c (regerror):
9438 Prefer memcpy to strncpy and strncat when either will do.
9439 * fileio.c (Fsubstitute_in_file_name):
9440 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9441 (menu_separator_name_p):
9442 * nsmenu.m (ns_update_menubar):
9443 Prefer memcmp to strncmp when either will do.
9444 * nsterm.m: Include <ftoastr.h>.
9445 (ns_get_color):
9446 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9447 Prefer snprintf to strncpy.
9448 * nsterm.m (ns_term_init):
9449 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9450 * nsterm.m (ns_term_init):
9451 Avoid the need for strncpy, by using build_string or
9452 make_unibyte_string directly. Use dtoastr, not snprintf.
9453 * process.c (Fmake_network_process): Diagnose service names that
9454 are too long, rather than silently truncating them or creating
9455 non-null-terminated names.
9456 (Fnetwork_interface_info): Likewise, for interface names.
9457 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9458 Prefer sprintf to strncat.
9459 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9460 Prefer vsnprintf to vsprintf + strncpy.
9461
c59592b3
GM
94622012-07-10 Glenn Morris <rgm@gnu.org>
9463
9464 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9465 Clarify fallback case.
9466
7d7bbefd
DA
94672012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9468
9469 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9470 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9471 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 9472 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
9473 where argument type is known to be a Lisp_Cons.
9474
3a4c8000
TT
94752012-07-10 Tom Tromey <tromey@redhat.com>
9476
9477 * bytecode.c (BYTE_CODE_THREADED): New macro.
9478 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9479 (enum byte_code_op): New type.
9480 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9481 (exec_byte_code): Use them. Use token threading when applicable.
9482
2a0213a6
DA
94832012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9484
9485 Optimize pure C strings initialization.
9486 * lisp.h (make_pure_string): Fix prototype.
9487 (build_pure_c_string): New function, defined as static inline. This
9488 provides a better opportunity to optimize away calls to strlen when
9489 the function is called with compile-time constant argument.
9490 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9491 argument, adjust users accordingly. Use build_pure_c_string where
9492 appropriate.
9493 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9494 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9495 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9496
cb1caeaf
DA
94972012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9498
9499 Avoid calls to strlen in miscellaneous functions.
9500 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9501 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9502 * lread.c (openp): Likewise.
9503
c293e30c
DA
95042012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9505
9506 Avoid calls to strlen in path processing functions.
9507 * fileio.c (file_name_as_directory): Add comment. Change to add
9508 srclen argument and return the length of result. Adjust users
9509 accordingly.
9510 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
9511 swap 1st and 2nd arguments to obey the common convention.
9512 Adjust users accordingly.
c293e30c
DA
9513 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9514
9e059e3f
GM
95152012-07-10 Glenn Morris <rgm@gnu.org>
9516
d02eb359
GM
9517 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9518 Move PENDING_OUTPUT_COUNT definition to configure.
9519
882cf227
GM
9520 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9521 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9522 * s/gnu.h (DATA_START): Move definitions to configure.
9523
af6e839f
GM
9524 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9525 We include usg5-4-common.h, which defines them both.
9526
40289a12
GM
9527 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9528 O_RDONLY already includes it).
9529
9e059e3f
GM
9530 Stop ns builds setting the EMACSLOADPATH environment variable.
9531 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9532 Now it does not set EMACSLOADPATH, just returns the load-path string.
9533 * nsterm.h: Update accordingly.
9534 * lread.c [HAVE_NS]: Include nsterm.h.
9535 (init_lread) [HAVE_NS]: Use ns_load_path.
9536 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9537
7c4e8ec0
GM
95382012-07-09 Glenn Morris <rgm@gnu.org>
9539
d4f600ff
GM
9540 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9541 since the included bsd-common.h does so.
9542
cbb31951
GM
9543 Stop ns builds setting the EMACSPATH environment variable.
9544 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9545 (ns_init_paths): Do not set EMACSPATH.
9546 * nsterm.h (ns_exec_path): Add it.
9547 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9548 Use ns_exec_path.
9549
7c4e8ec0
GM
9550 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9551
26bccfae
PE
95522012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9553
a0bee46f
PE
9554 * process.c (wait_reading_process_output): 'waitchannels' was unset
9555 when read_kbd || !NILP (wait_for_cell); fix this.
9556
5994c183
PE
9557 Add GCC-style 'const' attribute to functions that can use it.
9558 * character.h (char_resolve_modifier_mask):
9559 * keyboard.h (make_ctrl_char):
9560 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9561 (init_character_once, next_almost_prime, init_fns, init_image)
9562 (flush_pending_output, init_sound):
9563 * mem-limits.h (start_of_data):
9564 * menu.h (finish_menu_items):
9565 Add ATTRIBUTE_CONST.
9566 * emacs.c (DEFINE_DUMMY_FUNCTION):
9567 Declare the dummy function with ATTRIBUTE_CONST.
9568 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9569 Add decls with ATTRIBUTE_CONST.
9570
26bccfae
PE
9571 Minor improvements to make_formatted_string.
9572 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9573 where int is good enough, as vsprintf returns an int.
9574 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9575
a8290ec3
DA
95762012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9577
9578 Use make_formatted_string to avoid double length calculation.
9579 * lisp.h (make_formatted_string): New prototype.
9580 * alloc.c (make_formatted_string): New function.
9581 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 9582 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
9583 * editfns.c (Fcurrent_time_zone): Likewise.
9584 * filelock.c (get_boot_time): Likewise.
9585 * frame.c (make_terminal_frame, set_term_frame_name)
9586 (x_report_frame_params): Likewise.
9587 * image.c (gs_load): Likewise.
9588 * minibuf.c (get_minibuffer): Likewise.
9589 * msdos.c (dos_set_window_size): Likewise.
9590 * process.c (make_process): Likewise.
9591 * xdisp.c (ensure_echo_area_buffers): Likewise.
9592 * xsettings.c (apply_xft_settings): Likewise.
9593
d01ba2f1
GM
95942012-07-09 Glenn Morris <rgm@gnu.org>
9595
9596 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9597 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9598 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9599 * nsterm.h (ns_etc_directory): Add it.
9600 * callproc.c [HAVE_NS]: Include nsterm.h.
9601 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9602
f1f924b6
DA
96032012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9604
9605 Move marker debugging code under MARKER_DEBUG.
9606 * marker.c (MARKER_DEBUG): Move marker debugging code under
9607 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9608 for bootstrap with --enable-checking (~3x slowdown reported
9609 by Juanma Barranquero <lekktu@gmail.com>).
9610 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9611
ab531b66
PE
96122012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9613
9614 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9615 See <http://bugs.gnu.org/11825#29>.
9616
c4b3bc8a
EZ
96172012-07-08 Eli Zaretskii <eliz@gnu.org>
9618
9619 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9620 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
9621 (display_line): Add commentary about displaying truncation glyphs
9622 on GUI frames.
9623 (produce_special_glyphs): Move here from term.c.
9624
9625 * term.c (produce_special_glyphs): Move to xdisp.c.
9626
9627 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9628 section.
c4b3bc8a 9629
b676b881
AS
96302012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9631
f17c5273
AS
9632 * xdisp.c (display_line): Avoid warning about implicit declaration
9633 of FRAME_FONT.
9634
298819b9
AS
9635 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9636
b676b881
AS
9637 * lisp.h: Remove empty conditional.
9638
6045c4fd
PE
96392012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9640
b3350bf9
PE
9641 * lread.c (load_path_check): Now static.
9642
6045c4fd
PE
9643 Fix some minor --with-ns problems found by static checking.
9644 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9645 (x_set_font) [!HAVE_X_WINDOWS]:
9646 * image.c (xpm_load_image) [HAVE_NS]:
9647 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9648 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9649 Remove unused local.
9650 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9651 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9652 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9653 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9654 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9655 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9656 Fix pointer signedness problem.
9657 * xfaces.c (FRAME_X_FONT_TABLE):
9658 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9659
929e7845
GM
96602012-07-07 Glenn Morris <rgm@gnu.org>
9661
9662 * lread.c (load_path_check): New function, split from init_lread.
9663 (init_lread): Reorganize. Motivation:
9664 If EMACSLOADPATH is set, check/warn about that rather than the
9665 defaults, which we are not going to use. Hence we can remove
9666 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9667 Don't warn if site-lisp directories are missing.
9668 If not installed, start from a blank load-path, since
9669 PATH_LOADSEARCH refers to the eventual installation directories.
9670
58dd0aa4
EZ
96712012-07-07 Eli Zaretskii <eliz@gnu.org>
9672
9673 Support truncation and continuation glyphs on GUI frames, when
9674 fringes are disabled. (Bug#11832)
9675 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
9676 continuation glyphs even if on GUI frames.
9677 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
9678 or both, are absent.
9679 (start_display, move_it_in_display_line_to): Handle the case of a
9680 GUI frame without a fringe to display continuation or truncation
9681 glyphs.
9682 (insert_left_trunc_glyphs): Support GUI frames: make sure
9683 truncation glyphs overwrite enough glyphs from the current line to
9684 have sufficient space in pixels.
9685 (display_line): Support truncation and continuation glyphs on GUI
9686 frames. If some spare pixels are left on the line after inserting
9687 the truncation glyphs, fill that space with a stretch glyph of a
9688 suitably computed width.
9689
9690 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9691 produce_glyphs, to support GUI sessions.
9692
31571fd7
PE
96932012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9694
5a16b9bc
PE
9695 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9696
f3047c75
PE
9697 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9698
31571fd7
PE
9699 Do not require float-time's arg to fit in time_t (Bug#11825).
9700 This works better on hosts where time_t is unsigned, and where
9701 float-time is applied to the (negative) difference between two times.
9702 * editfns.c (decode_time_components): Last arg is now double *,
9703 not int *, and means to store all the result as a double, without
9704 worrying about whether the seconds part fits in time_t.
9705 All callers changed.
9706 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9707 All callers changed.
9708 (Ffloat_time): Do not fail merely because the specified time falls
9709 outside of time_t range.
9710
4516fbef
GM
97112012-07-07 Glenn Morris <rgm@gnu.org>
9712
9713 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9714 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9715 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9716
07adc2c6
JB
97172012-07-07 Juanma Barranquero <lekktu@gmail.com>
9718
9719 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9720 Update dependencies.
9721
9722 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9723
fd573f31
PE
97242012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9725
fee5959d
PE
9726 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9727 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9728 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9729 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9730 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9731 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9732
fd573f31
PE
9733 * xfont.c (compare_font_names): Redo to omit the need for casts.
9734
ddadbc0e
AS
97352012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9736
fca8d6b6
AS
9737 * xfns.c (Fx_change_window_property): Doc fix.
9738 * w32fns.c (Fx_change_window_property): Doc fix.
9739
ddadbc0e
AS
9740 * w32fns.c (Fx_window_property): Accept the same arguments as the
9741 X Windows version. Doc fix.
9742 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9743
ed9265fc 97442012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
9745 Eli Zaretskii <eliz@gnu.org>
9746
9747 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9748 Windows-specific code from nt/config.nt moved here.
9749 Obsolete settings removed.
9750
216ee680
PE
97512012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9752
9753 * process.c: Avoid unnecessary calls to gettime.
9754 (wait_reading_process_output): Don't get the time of day
9755 when gobbling data immediately and not waiting, as there's no need
9756 for it in that case. This removes a FIXME.
9757
bdd091e4
JD
97582012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9759
9760 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9761 is defined (Bug#11768).
9762
9d44f8ce
DA
97632012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9764
9765 Fix marker debugging code.
9766 * marker.c (byte_char_debug_check): Do not perform the check
9767 if buffer is not multibyte.
090bd7cb
JB
9768 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9769 Call byte_char_debug_check with correct arguments.
9d44f8ce 9770
90fc4786
DA
97712012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9772
9773 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
9774 * marker.c (byte_char_debug_check, count_markers):
9775 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
9776 (byte_debug_flag): Remove.
9777 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9778 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9779
7b7ae965
DA
97802012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9781
4e57b342
DA
9782 Avoid code repetition in marker-related functions.
9783 * marker.c (attach_marker): New function.
9784 (Fset_marker, set_marker_restricted, set_marker_both)
9785 (set_marker_restricted_both): Use it.
9786 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9787 Consistently rename charno to charpos.
9788 (marker_position): Add eassert.
9789 (marker_byte_position): Convert to eassert.
9790
97912012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9792
9793 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 9794 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 9795 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 9796
657924ff
DA
97972012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9798
9799 Introduce fast path for the widely used marker operation.
9800 * alloc.c (build_marker): New function.
9801 * lisp.h (build_marker): New prototype.
9802 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9803 * composite.c (autocmp_chars): Likewise.
9804 * editfns.c (buildmark): Remove.
9805 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9806 (save_restriction_save): Use build_marker.
9807 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9808 * window.c (save_window_save): Likewise.
9809
041a49a6
DA
98102012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9811
9812 Do not use Fdelete_overlay in delete_all_overlays
9813 to avoid redundant calls to unchain_overlay.
9814 * buffer.c (drop_overlay): New function.
9815 (delete_all_overlays, Fdelete_overlay): Use it.
9816 * minibuf.c (get_minibuffer): Fix comment.
9817
7dca65a4
PE
98182012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9819
9820 Port to OpenBSD 5.1 amd64.
9821 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9822 This is needed for OpenBSD, and should be harmless on all BSD systems.
9823 Also, include <sys/sysctl.h>, as it should be available on all
9824 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9825 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9826 use p_pid member, not kp_proc.pid.
9827
8eb876e2
GM
98282012-07-06 Glenn Morris <rgm@gnu.org>
9829
9830 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9831
38182d90
PE
98322012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9833
9834 More xmalloc and related cleanup.
9835 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9836 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9837 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9838 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9839 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9840 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9841 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9842 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9843 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9844 * xterm.c:
9845 Omit needless casts involving void * pointers and allocation.
9846 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9847 as the former is more robust if P's type is changed.
9848 Prefer xzalloc to xmalloc + memset 0.
9849 Simplify malloc-or-realloc to realloc.
9850 Don't worry about xmalloc returning a null pointer.
9851 Prefer xstrdup to xmalloc + strcpy.
9852 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9853 growing it.
9854 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9855 alloca of a constant.
9856
6dd5a677
EZ
98572012-07-05 Eli Zaretskii <eliz@gnu.org>
9858
9859 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9860 hscroll is larger than the line width. Fixes long and futile
9861 looping inside extend_face_to_end_of_line (on a TTY) producing
9862 glyphs that are not needed and thrown away.
9863
6b312f0f
DA
98642012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9865
9866 * marker.c (set_marker_restricted_both): Simplify by using
9867 clip_to_bounds.
9868
f520ef9b
PE
98692012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9870
9871 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9872
383b7c95
JD
98732012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9874
9875 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9876 not defined (Bug#11768).
9877 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9878 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9879 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9880 followed by gtk_box_set_homogeneous (Bug#11768).
9881 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
9882 (update_theme_scrollbar_width, xg_create_scroll_bar):
9883 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
9884 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9885 (is_box_type): New function (Bug#11768).
9886 (xg_tool_item_stale_p): Call is_box_type.
5293d758 9887 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
9888 with default display (Bug#11768).
9889
d6e7bf45
EZ
98902012-07-05 Eli Zaretskii <eliz@gnu.org>
9891
9892 * xdisp.c (window_hscroll_limited): New function.
9893 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9894 coordinates when window's hscroll is set to insanely large
9895 values. (Bug#11857)
9896
431391ec
JB
98972012-07-05 Juanma Barranquero <lekktu@gmail.com>
9898
9899 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9900 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9901
23f86fce
DA
99022012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9903
9904 Cleanup xmalloc.
9905 * lisp.h (xzalloc): New prototype. Omit needless casts.
9906 * alloc.c (xzalloc): New function. Omit needless casts.
9907 * charset.c: Omit needless casts. Convert all calls to
9908 xmalloc with following memset to xzalloc.
9909 * dispnew.c: Likewise.
9910 * fringe.c: Likewise.
9911 * image.c: Likewise.
9912 * sound.c: Likewise.
9913 * term.c: Likewise.
9914 * w32fns.c: Likewise.
9915 * w32font.c: Likewise.
9916 * w32term.c: Likewise.
9917 * xfaces.c: Likewise.
9918 * xfns.c: Likewise.
9919 * xterm.c: Likewise.
9920 * atimer.c: Omit needless casts.
9921 * buffer.c: Likewise.
9922 * callproc.c: Likewise.
9923 * ccl.c: Likewise.
9924 * coding.c: Likewise.
9925 * composite.c: Likewise.
9926 * doc.c: Likewise.
9927 * doprnt.c: Likewise.
9928 * editfns.c: Likewise.
9929 * emacs.c: Likewise.
9930 * eval.c: Likewise.
9931 * filelock.c: Likewise.
9932 * fns.c: Likewise.
9933 * gtkutil.c: Likewise.
9934 * keyboard.c: Likewise.
9935 * lisp.h: Likewise.
9936 * lread.c: Likewise.
9937 * minibuf.c: Likewise.
9938 * msdos.c: Likewise.
9939 * print.c: Likewise.
9940 * process.c: Likewise.
9941 * region-cache.c: Likewise.
9942 * search.c: Likewise.
9943 * sysdep.c: Likewise.
9944 * termcap.c: Likewise.
9945 * terminal.c: Likewise.
9946 * tparam.c: Likewise.
9947 * w16select.c: Likewise.
9948 * w32.c: Likewise.
9949 * w32reg.c: Likewise.
9950 * w32select.c: Likewise.
9951 * w32uniscribe.c: Likewise.
9952 * widget.c: Likewise.
9953 * xdisp.c: Likewise.
9954 * xmenu.c: Likewise.
9955 * xrdb.c: Likewise.
9956 * xselect.c: Likewise.
9957
0497dc44
PE
99582012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9959
9960 * fileio.c (time_error_value): Check the right error number.
9961 Problem reported by Troels Nielsen in
9962 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9963
356e7178
PE
99642012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9965
4e71fd89
PE
9966 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9967 This should be fixed in a better way; see Eli Zaretskii in
9968 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9969 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9970
f0941253
PE
9971 * fileio.c (time_error_value): Rename from special_mtime.
9972 The old name's problems were noted by Eli Zaretskii in
9973 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9974
065c9eb4
PE
9975 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9976 This variable's comment says Emacs needs at least one GDB-visible
9977 symbol of type enum pvec_type, to work around GDB problems.
9978 The symbol's value doesn't matter.
9979
356e7178
PE
9980 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9981 that causes compilation to fail on pre-C99 compilers.
9982
ed9265fc 99832012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
9984
9985 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9986 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9987
3884d954
DA
99882012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9989
d209e2fb 9990 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
9991 headers for buffer_defaults and buffer_local_symbols.
9992 Reported by Juanma Barranquero <lekktu@gmail.com>.
9993
ee28be33
SM
99942012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9995
9996 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9997 * lisp.h (enum pvec_type): Use fewer bits.
9998 (PSEUDOVECTOR_SIZE_BITS): New constant.
9999 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10000 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10001 change in pvec_type.
10002 (PSEUDOVECTOR_TYPEP): New macro.
10003 (TYPED_PSEUDOVECTORP): Use it.
10004 * fns.c (internal_equal): Adapt code to extract pvectype.
10005 * emacs.c (gdb_pvec_type): Update type.
10006 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10007 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10008 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10009 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10010 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10011 abusing vector->header.next.nbytes.
10012 (live_vector_p): Use PVEC_TYPE.
10013 (mark_object): Adapt code to extract pvectype. Use switch.
10014
c7f2cd7f
PE
100152012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10016
10017 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10018 Tighten new eassert a bit.
10019
8ce70ed2
DA
100202012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10021
10022 Fix compilation with --enable-gcc-warnings and -O1
10023 optimization level.
10024 * doprnt.c (doprnt): Change type of tem to int, initialize
10025 to avoid compiler warning. Add eassert.
10026 * search.c (simple_search): Initialize match_byte to avoid
10027 compiler warning. Add eassert.
10028
dea7f1e5
PE
100292012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10030
24a212eb
PE
10031 Avoid weird behavior with large horizontal scrolls.
10032 Without this change, for example, large hscroll values would
10033 mess up Emacs's display on Fedora 15 x86, presumably due to
10034 overflows in int calculations in the display code.
10035 Also, if buffers had long lines, Emacs would freeze.
10036 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10037 (set_window_hscroll): New function, containing the old guts of
10038 Fset_window_hscroll. Return the clipped value.
10039 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10040 This avoids the need to check against PTRDIFF_MAX.
10041
dea7f1e5
PE
10042 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10043
76046526
DA
100442012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10045
10046 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10047
39adff0d
PE
100482012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10049
63807d47
PE
10050 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10051 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10052 since GCC 4.4.6 issues a bogus warning for them.
10053
39adff0d
PE
10054 Fix bugs in file timestamp newness comparisons.
10055 * fileio.c (Ffile_newer_than_file_p):
10056 * lread.c (Fload): Use full timestamp resolution of files,
10057 not just the 1-second resolution, so that files that are only
10058 slightly newer still count as newer.
10059 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10060 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10061
dbeed9a6
PE
100622012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10063
10064 * fileio.c: Improve handling of file time marker. (Bug#11852)
10065 (special_mtime): New function.
10066 (Finsert_file_contents, Fverify_visited_file_modtime):
10067 Use it to set special mtime values consistently.
10068
636334d6
AS
100692012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10070
10071 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10072 marker for non-existing file. (Bug#11852)
10073
e2017fe2
GM
100742012-07-03 Glenn Morris <rgm@gnu.org>
10075
10076 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10077 and did not make it into globals.h).
10078
404dbd37
TT
100792012-07-03 Tom Tromey <tromey@redhat.com>
10080
10081 * window.c (Fset_window_margins, Fset_window_fringes)
10082 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10083 * textprop.c (Fprevious_property_change): No longer static.
10084 * syntax.c (Fsyntax_table_p): No longer static.
10085 * process.c (Fget_process, Fprocess_datagram_address): No longer
10086 static.
10087 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10088 * keyboard.c (Fcommand_execute): No longer static.
10089 Remove EXFUN.
10090 * insdel.c (Fcombine_after_change_execute): No longer static.
10091 * image.c (Finit_image_library): No longer static.
10092 * fileio.c (Fmake_symbolic_link): No longer static.
10093 * eval.c (Ffetch_bytecode): No longer static.
10094 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
10095 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10096 No longer static.
404dbd37
TT
10097 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10098 static.
10099 * dired.c (Ffile_attributes): No longer static.
10100 * composite.c (Fcomposition_get_gstring): No longer static.
10101 * callproc.c (Fgetenv_internal): No longer static.
10102
10103 * ccl.h: Remove EXFUNs.
10104 * buffer.h: Remove EXFUNs.
10105 * dispextern.h: Remove EXFUNs.
10106 * intervals.h: Remove EXFUNs.
10107 * fontset.h: Remove EXFUN.
10108 * font.h: Remove EXFUNs.
10109 * dosfns.c (system_process_attributes): Remove EXFUN.
10110 * keymap.h: Remove EXFUNs.
10111 * lisp.h: Remove EXFUNs.
10112 * w32term.h: Remove EXFUNs.
10113 * window.h: Remove EXFUNs.
10114 * xsettings.h: Remove EXFUN.
10115 * xterm.h: Remove EXFUN.
10116
8e4fd1e1
GM
101172012-07-03 Glenn Morris <rgm@gnu.org>
10118
10119 * lisp.h (Frandom): Make it visible to C.
10120 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10121 buffer for invisible buffers. (Bug#1229)
10122
ca95b3eb
DA
101232012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10124
10125 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10126 values which aren't power of 2.
14ae4239 10127 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 10128 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
10129 accordingly.
10130
7555c33f
SM
101312012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10132
10133 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10134
10135 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10136
d12e8f5a
DA
101372012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10138
10139 * alloc.c (allocate_vector_block): Remove redundant
10140 calls to mallopt if DOUG_LEA_MALLOC is defined.
10141 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10142 avoid calls to mallopt if zero_vector is returned.
10143
296094c3
DA
101442012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10145
10146 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10147 is enabled, avoid dereferencing NULL current_sblock if
10148 running undumped.
10149
36429c89
DA
101502012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10151
10152 Cleanup basic buffer management.
10153 * buffer.h (struct buffer): Change layout to use generic vector
10154 marking code. Fix some comments. Change type of 'clip_changed'
10155 to bitfield. Remove unused #ifndef old.
10156 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10157 (GET_OVERLAYS_AT): Fix indentation.
10158 (for_each_per_buffer_object_at): New macro.
10159 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10160 (Fbuffer_local_variables): Use it.
10161 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10162 * alloc.c (allocate_buffer): Adjust to match new layout of
10163 struct buffer. Fix comment.
10164 (mark_overlay): New function.
10165 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10166 Lisp area of struct buffer.
10167 (mark_object): Use it. Adjust marking of misc objects
10168 and related comments.
10169
3b3e4cac
PE
101702012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10171
10172 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10173 wrapper that is not needed because the wrapped code is a no-op (zero
10174 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10175 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10176
cf5c0175
DA
101772012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10178
10179 * alloc.c (mark_buffer): Simplify. Remove prototype.
10180 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 10181 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
10182 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10183 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 10184
ca26824c
GM
101852012-06-30 Glenn Morris <rgm@gnu.org>
10186
2e4c5312
GM
10187 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10188
ca26824c
GM
10189 * epaths.in (PATH_SITELOADSEARCH): New.
10190 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10191 This is rather than relying on --enable-locallisppath elements
10192 having "site-lisp" in their names. (Bug#10208#25, 11658)
10193
0d23c240
EZ
101942012-06-30 Eli Zaretskii <eliz@gnu.org>
10195
c9240d7a
EZ
10196 * w32proc.c (sys_select): Accept and ignore one more argument.
10197
10198 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10199
0d23c240 10200 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 10201 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
10202
10203 * sysdep.c: Don't include dos.h and dosfns.h.
10204
10205 * process.c (sys_select):
10206 * msdos.c (sys_select): Accept one more argument and ignore it.
10207
10208 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10209 adapt data types and code to that.
10210
10211 * dosfns.c:
10212 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10213 which clashes with the gnulib function of the same name.
10214
af5a5a98
AS
102152012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10216
c5e4379c
AS
10217 * font.c (font_style_to_value, font_style_symbolic)
10218 (font_prop_validate_style): Add type checks for values in
10219 font_style_table.
10220
af5a5a98
AS
10221 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10222 argument.
10223 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10224 uses.
10225
8d38f461
EZ
102262012-06-29 Eli Zaretskii <eliz@gnu.org>
10227
2e5a6631
EZ
10228 * xdisp.c (try_window_id): Undo last change.
10229
8d38f461
EZ
10230 * w32.c (getwd): Adjust commentary about startup_dir.
10231 (init_environment): Always call sys_access, even in non-MSVC
10232 builds. Don't chdir to the directory of the Emacs executable.
10233 This undoes code from 1997 which was justified by the need to
10234 "avoid conflicts when removing and renaming directories". But its
10235 downside was that every relative file name was being interpreted
10236 relative to the directory of the Emacs executable, which can never
10237 be TRT. In particular, it broke sys_access when called with
10238 relative file names.
10239 (sys_access): Map GetLastError to errno.
10240
2af3565e
DA
102412012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10242
10243 * window.h (struct window): Change type of 'fringes_outside_margins'
10244 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 10245 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
10246 Adjust comment.
10247 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10248 to ptrdiff_t.
10249
c8d3a25c 102502012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 10251
c8d3a25c
GM
10252 * gnutls.c (emacs_gnutls_handshake):
10253 Add QUIT to make the loop interruptible.
57570cd3 10254
c8d3a25c 102552012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 10256
c8d3a25c
GM
10257 * charset.c (init_charset): Make lack of etc/charsets fatal.
10258
3e984ee8
DA
102592012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10260
10261 * editfns.c (region_limit): Fix type mismatch.
10262
ef884f23
DA
102632012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10264
10265 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10266 undefined. Convert from xassert to eassert.
10267 * nsmenu.m: Convert from xassert to eassert.
10268 * nsterm.m: Likewise.
10269
7d7e0027
SM
102702012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10271
10272 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10273
aa754e6a
PE
102742012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10275
10276 Avoid integer overflow on scroll-left and scroll-right.
10277 * window.c (HSCROLL_MAX): New macro.
10278 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10279 overflow when requested scroll falls outside ptrdiff_t range.
10280
80b00b08
DA
102812012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10282
10283 * window.h (struct window): Change type of 'hscroll',
10284 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10285 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10286 Adjust users accordingly.
10287 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10288 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10289 from EMACS_INT to ptrdiff_t.
10290 (make_window): Omit redundant initialization.
10291
62b2bcf6
JB
102922012-06-28 Juanma Barranquero <lekktu@gmail.com>
10293
10294 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10295
45942c7d
DA
102962012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10297
10298 * window.h (struct window): Change type of 'use_time' and
10299 'sequence_number' from Lisp_Object to int.
10300 * frame.c (make_frame): Adjust users accordingly.
10301 * print.c (print_object): Likewise.
10302 * window.c (select_window, Fwindow_use_time, make_parent_window)
10303 (make_window): Likewise.
10304
e509cfa6
DA
103052012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10306
10307 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10308 enabled with --enable-checking=[all,glyphs] configure option.
10309 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10310 adjust comments accordingly.
10311 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10312 undefined, adjust comments accordingly.
10313 * image.c: Likewise.
10314 * scroll.c: Likewise.
10315 * w32fns.c: Likewise.
10316 * w32term.c: Likewise.
10317 * xdisp.c: Likewise.
10318 * xfaces.c: Likewise.
10319 * xfns.c: Likewise.
10320 * xterm.c: Likewise.
10321
a54e2c05
DA
103222012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10323
10324 Generalize run-time debugging checks.
10325 * dispextern.h (XASSERTS): Remove.
10326 * fontset.c (xassert): Remove.
10327 Convert from xassert to eassert.
10328 * alloc.c: Convert from xassert to eassert.
10329 * bidi.c: Likewise.
10330 * dispnew.c: Likewise.
10331 * fns.c: Likewise.
10332 * fringe.c: Likewise.
10333 * ftfont.c: Likewise.
10334 * gtkutil.c: Likewise.
10335 * image.c: Likewise.
10336 * keyboard.c: Likewise.
10337 * menu.c: Likewise.
10338 * process.c: Likewise.
10339 * scroll.c: Likewise.
10340 * sound.c: Likewise.
10341 * term.c: Likewise.
10342 * w32console.c: Likewise.
10343 * w32fns.c: Likewise.
10344 * w32term.c: Likewise.
10345 * window.c: Likewise.
10346 * xdisp.c: Likewise.
10347 * xfaces.c: Likewise.
10348 * xfns.c: Likewise.
10349 * xselect.c: Likewise.
10350 * xterm.c: Likewise.
10351
1ec4b7b2
SM
103522012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10353
10354 * fns.c (maybe_resize_hash_table): Output message when growing the
10355 purify-hashtable.
10356
2014308a
DA
103572012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10358
10359 * alloc.c (allocate_string_data): Remove dead code.
10360 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10361 avoid GCC warning about unused macro.
10362
246155eb
DA
103632012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10364
10365 * alloc.c (allocate_string): Omit intervals initialization.
10366 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10367 as in make_pure_string and make_pure_c_string.
10368
43184b7b
DA
103692012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10370
d209e2fb 10371 * alloc.c (allocate_string): Fix last change.
43184b7b 10372
3fe6dd74
DA
103732012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10374
d209e2fb 10375 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
10376 to memset, add explicit initialization where appropriate.
10377
1ba6038a
GM
103782012-06-27 Glenn Morris <rgm@gnu.org>
10379
10380 * lisp.mk (lisp): Remove paths.elc.
10381
c89926a5
CY
103822012-06-27 Chong Yidong <cyd@gnu.org>
10383
10384 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10385
ed6b3510
JW
103862012-06-26 John Wiegley <johnw@newartisans.com>
10387
1ec4b7b2 10388 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
10389 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10390
ed6b3510
JW
10391 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10392 when building with Clang.
10393
8edd4a2b
SM
103942012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10395
10396 * eval.c (Fapply): Allow calling it with a single argument.
10397
f6f62d1b
EZ
103982012-06-26 Eli Zaretskii <eliz@gnu.org>
10399
10400 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10401 _stricmp and _strnicmp.
10402 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10403
62efea5e
DA
104042012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10405
10406 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10407 allocated window.
10408 (allocate_process): Likewise for new process.
8edd4a2b 10409 (allocate_terminal): Change to use offsetof.
62efea5e
DA
10410 (allocate_frame): Likewise.
10411 * frame.c (make_frame): Omit redundant initialization.
10412 * window.c (make_parent_window): Use memset.
10413 (make_window): Omit redundant initialization.
10414 * process.c (make_process): Omit redundant initialization.
10415 * terminal.c (create_terminal): Likewise.
10416
42997f4d
DA
104172012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10418
10419 * term.c (delete_tty): Remove redundant call to memset.
10420
1130ecfc
DA
104212012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10422
10423 * alloc.c: Remove build_string.
10424 * lisp.h: Define build_string as static inline. This provides
10425 a better opportunity to optimize away calls to strlen when the
10426 function is called with compile-time constant argument.
10427 * image.c (imagemagick_error): Convert to build_string.
10428 * w32proc.c (sys_spawnve): Likewise.
10429 * xterm.c (x_term_init): Likewise.
10430
cf38a720
PE
104312012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10432
99027bdd
PE
10433 Use sprintf return value instead of invoking strlen on result.
10434 In the old days this wasn't portable, since some sprintf
10435 implementations returned char *. But they died out years ago and
10436 Emacs already assumes sprintf returns int.
10437 Similarly for float_to_string.
10438 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10439 * ccl.c (ccl_driver):
10440 * character.c (string_escape_byte8):
10441 * data.c (Fnumber_to_string):
10442 * doprnt.c (doprnt):
10443 * print.c (print_object):
10444 * xdisp.c (message_dolog):
10445 * xfns.c (syms_of_xfns):
10446 Use sprintf or float_to_string result to avoid need to call strlen.
10447 * data.c (Fnumber_to_string):
10448 Use make_unibyte_string, since the string must be ASCII.
10449 * lisp.h, print.c (float_to_string): Now returns int length.
10450 * term.c (produce_glyphless_glyph):
10451 Use sprintf result rather than recomputing it.
10452
cf38a720
PE
10453 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10454 * Makefile.in (ALL_CFLAGS):
10455 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10456 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10457
3511c784
DA
104582012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10459
0a08eb21 10460 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
10461 strcasecmp if available.
10462 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10463
fb7da12e
AS
104642012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10465
10466 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10467 Avoid comma operator.
10468 * menu.c (push_submenu_start, push_submenu_end)
10469 (push_left_right_boundary, push_menu_pane): Likewise.
10470 * msdos.c (dos_rawgetc): Likewise.
10471
afa2ffd8
DA
104722012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10473
10474 * xfns.c (xic_create_fontsetname): Remove redundant calls
10475 to memset.
10476
b3b4476b
PE
104772012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10478
4495ff38
PE
10479 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10480 sprintf already null-terminates its output.
10481
b3b4476b
PE
10482 * xfns.c (x_window): Remove redundant cast.
10483
b00876c9
DA
104842012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10485
10486 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10487 `const char *' to `char *' to avoid compiler warning.
10488
d188e26b
PE
104892012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10490
885d1d74
PE
10491 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10492 instead of truncating it to 63 (admittedly a generous limit).
10493
d188e26b
PE
10494 * process.c: Fix spelling and caps in comments.
10495
e2f560b1
DN
104962012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10497
e86db54b 10498 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
10499 * sysdep.c (setpgrp): Remove definition, not used in this file.
10500
7583a3a1
JB
105012012-06-24 Juanma Barranquero <lekktu@gmail.com>
10502
10503 * makefile.w32-in: Update dependencies.
10504
696056c2
EZ
105052012-06-24 Eli Zaretskii <eliz@gnu.org>
10506
10507 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10508 (SYSTIME_H): Add nt/inc/sys/time.h.
10509
10510 * systime.h [WINDOWSNT]: Include sys/time.h.
10511
10512 * s/ms-w32.h (struct timespec): Definition moved from
10513 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10514
845ca893
PE
105152012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10516
10517 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10518 * buffer.h (buffer_slot_type_mismatch):
10519 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10520 * eval.c (unwind_to_catch):
10521 * image.c (my_png_error, my_error_exit):
10522 * keyboard.c (quit_throw_to_read_char, user_error)
10523 (Fexit_recursive_edit, Fabort_recursive_edit):
10524 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10525 (wrong_type_argument, buffer_overflow, __executable_start)
10526 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10527 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10528 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10529 (fatal):
10530 (child_setup) [!DOS_NT]:
10531 * lread.c (end_of_file_error, invalid_syntax):
10532 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10533 * puresize.h (pure_write_error):
10534 * search.c (matcher_overflow):
10535 * sound.c (sound_perror, alsa_sound_perror):
10536 * sysdep.c, syssignal.h (croak):
10537 * term.c (maybe_fatal, vfatal):
10538 * textprop.c (text_read_only):
10539 * undo.c (user_error):
10540 * unexmacosx.c (unexec_error):
10541 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10542 Use _Noreturn rather than NO_RETURN.
10543 No need for separate decl merely because of _Noreturn.
10544 * sound.c (sound_warning, parse_sound):
10545 Remove unnecessary forward decls.
10546
f1dd8073
PE
105472012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10548
10549 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10550 * lisp.h (WAIT_READING_MAX): New macro.
10551 * dispnew.c (Fsleep_for, sit_for):
10552 * keyboard.c (kbd_buffer_get_event):
10553 * process.c (Faccept_process_output):
10554 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10555 This improves on the previous patch, which introduced a bug
10556 when time_t is unsigned and as wide as intmax_t.
10557 See <http://bugs.gnu.org/9000#51>.
10558
b82c1755
EZ
105592012-06-23 Eli Zaretskii <eliz@gnu.org>
10560
10561 * dispnew.c (sit_for, Fsleep_for):
10562 * keyboard.c (kbd_buffer_get_event):
10563 * process.c (Faccept_process_output): Avoid compiler warnings when
10564 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10565
ca300656
JB
105662012-06-23 Juanma Barranquero <lekktu@gmail.com>
10567
049ec95b
JB
10568 * makefile.w32-in: Update dependencies.
10569
ca300656
JB
10570 * w32.c (ltime): Add return type and declare static.
10571 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10572
db7b8d06
PE
105732012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10574
10575 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10576 Privately reported by Herbert J. Skuhra.
10577 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10578 All uses changed.
10579 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10580 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10581
0bd8297f
EZ
105822012-06-23 Eli Zaretskii <eliz@gnu.org>
10583
96512555
EZ
10584 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10585 last argument of make_unibyte_string.
10586
0bd8297f
EZ
10587 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10588 language ID in the event parameters.
10589
10590 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10591 event.code, not the obscure "character set ID".
10592
63def6b6
CY
105932012-06-23 Chong Yidong <cyd@gnu.org>
10594
10595 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10596
e8a02204
EZ
105972012-06-23 Eli Zaretskii <eliz@gnu.org>
10598
388cdec0
EZ
10599 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10600 * w32.c (fdutimens): New function.
10601
10602 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10603
10604 * s/ms-w32.h (pselect): Redirect to sys_select.
10605
10606 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10607
e8a02204
EZ
10608 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10609 in the logic of incrementing and decrementing the value of
10610 use_relocatable_buffers.
10611
d054f3fb
PE
106122012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10613
10614 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10615 Privately reported by Herbert J. Skuhra.
10616 [__FreeBSD__]: Remove "*/" typo after "#include".
10617 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10618 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10619 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10620 Don't assume EMACS_TIME and struct timeval are the same type.
10621
d35af63c
PE
106222012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10623
10624 Support higher-resolution time stamps (Bug#9000).
10625 The time stamps are only nanosecond-resolution at the C level,
10626 since that's the best that any real-world system supports now.
10627 But they are picosecond-resolution at the Lisp level, as that's
10628 easy, and leaves room for future OS improvements.
10629
10630 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10631 (LIBES): Use it.
10632
10633 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10634 Don't get current time unless it's needed.
10635
10636 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10637 now provides it if it's absent.
10638 (start_atimer): Port to higher-res time stamps.
10639 Check for time stamp overflow. Don't get current time more
10640 often than is needed.
10641
10642 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10643 Include systime.h, not time.h.
10644 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10645
10646 * dired.c: Include stat-time.h.
10647 (Ffile-attributes): File times now have higher resolution.
10648
10649 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10650 (struct image): Timestamp now has higher resolution.
10651
10652 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10653 has at least microseconds now. All uses removed.
10654 (update_frame, update_single_window, update_window, update_frame_1)
10655 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 10656 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
10657
10658 * editfns.c (time_overflow): Now extern.
10659 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10660 (float-time, Fformat_time_string, Fcurrent_time_string)
10661 (Fcurrent_time_zone): Accept and generate higher-resolution
10662 time stamps.
10663 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10664 (decode_time_components, lisp_seconds_argument): New functions.
10665 (make_time): Now static.
10666 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10667 Report an error if the time is invalid, rather than having the caller
10668 do that.
10669
10670 * fileio.c: Include <stat-time.h>
10671 (Fcopy_file): Copy higher-resolution time stamps.
10672 Prefer to set the time stamp via a file descriptor if that works.
10673 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10674 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10675 (Fvisited_file_modtime, Fset_visited_file_modtime):
10676 Support higher-resolution time stamps.
10677
10678 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10679
10680 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10681
10682 * image.c (prepare_image_for_display, clear_image_cache)
10683 (lookup_image): Port to higer-resolution time stamps.
10684
10685 * keyboard.c (start_polling, bind_polling_period):
10686 Check for time stamp overflow.
10687 (read_char, kbd_buffer_get_event, timer_start_idle)
10688 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10689 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10690 Port to higher-resolution time stamps. Do not assume time_t is signed.
10691 (decode_timer): New function. Timers are now vectors of length 9,
10692 not 8, to accommodate the picosecond component.
10693 (timer_check_2): Use it.
10694
10695 * nsterm.m (select_timeout, timeval_subtract): Remove.
10696 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10697 as they're a bit more accurate and handle overflow better.
10698 (ns_select): Change prototype to be compatible with pselect.
10699 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10700 * nsterm.h (ns_select): Adjust prototype.
10701
10702 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10703 us-resolution time stamps.
10704 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10705
10706 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10707
10708 * lisp.h (time_overflow): New decl.
10709 (wait_reading_process_output): First arg is now intmax_t, not int,
10710 to accommodate larger waits.
10711
10712 * process.h (struct Lisp_Process.read_output_delay):
10713 Now counts nanoseconds, not microseconds.
10714 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10715 EMACS_HAS_USECS.
10716 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10717 (wait_reading_process_output):
10718 Port to ns-resolution time stamps.
10719 (Faccept_process_output, wait_reading_process_output):
10720 Check for time stamp overflow. Do not assume time_t is signed.
10721 (select_wrapper): Remove; we now use pselect.
10722 (Fprocess_attributes): Now generates ns-resolution time stamps.
10723
10724 * sysdep.c: Include utimens.h. Don't include utime.h
10725 or worry about struct utimbuf; gnulib does that for us now.
10726 (gettimeofday): Remove; gnulib provides a substitute.
10727 (make_timeval): New function.
10728 (set_file_times): Now sets ns-resolution time stamps.
10729 New arg FD; all uses changed.
10730 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10731 (system_process_attributes):
10732 Now returns ns-resolution time stamp. All uses changed.
10733 Check for time stamp overflow.
10734
10735 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10736 provides a substitute now.
10737
10738 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10739 since it guarantees struct timespec.
10740 (EMACS_TIME): Now struct timespec, so that we can support
10741 ns-resolution time stamps.
10742 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10743 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10744 (EMACS_USECS): Remove.
10745 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10746 so multiply the arg by 1000 before storing it.
10747 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10748 New macros.
10749 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10750 Port to ns-resolution time stamps.
10751 (EMACS_TIME_NEG_P): Remove; replaced by....
10752 (EMACS_TIME_SIGN): New macro.
10753 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10754 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10755 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10756 (make_timeval, make_lisp_time, decode_time_components): New decls.
10757 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10758 that it mishandled time_t overflow. You can't compare by subtracting!
10759 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10760 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10761
10762 * term.c: Include <sys/time.h>.
10763 (timeval_to_Time): New function, for proper overflow wraparound.
10764 (term_mouse_position, term_mouse_click): Use it.
10765
10766 * undo.c (record_first_change): Support higher-resolution time stamps
10767 in the undo buffer.
10768 (Fprimitive_undo): Use them when restoring time stamps.
10769
10770 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10771 (w32_get_internal_run_time):
10772 Port to higher-resolution Emacs time stamps.
10773 (ltime): Now accepts single 64-bit integer, as that's more convenient
10774 for callers.
10775
10776 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10777
10778 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10779 for compatibility with pselect. Support ns-resolution time stamps.
10780
10781 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10782
10783 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10784 Check for time stamp overflow, and support ns-resolution time stamps.
10785
10786 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10787 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10788 (timeval_subtract): Remove; no longer needed.
10789 (XTflash, XTring_bell, x_wait_for_event):
10790 Port to ns-resolution time stamps. Don't assume time_t is signed.
10791
b6a92dfe
CY
107922012-06-22 Chong Yidong <cyd@gnu.org>
10793
10794 * xdisp.c (x_consider_frame_title): Revert last change.
10795
d251c37c
EZ
107962012-06-22 Eli Zaretskii <eliz@gnu.org>
10797
10798 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10799 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10800 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10801 staticidx goes up to 1597 out of 1600 = 0x640.)
10802
f10deafb
PE
108032012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10804
10805 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10806 Otherwise, the umask might be mistakenly 0 while handling input signals.
10807
ec6de1e2
SM
108082012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10809
10810 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10811
28be1ada
DA
108122012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10813
10814 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10815 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10816 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10817 access to `contents' member of Lisp_Vector objects with AREF and ASET
10818 where appropriate.
10819
c6bf3022
CY
108202012-06-19 Chong Yidong <cyd@gnu.org>
10821
10822 * frame.c (delete_frame): When selecting a frame on a different
10823 text terminal, do not alter the terminal's top-frame.
10824
10825 * xdisp.c (format_mode_line_unwind_data): Record the target
10826 frame's selected window and its terminal's top-frame.
10827 (unwind_format_mode_line): Restore them.
10828 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10829 Callers changed.
10830 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10831 since tty frames can be explicitly named.
10832 (prepare_menu_bars): Likewise.
10833
10834 * term.c (Ftty_top_frame): New function.
10835
defd4196
PE
108362012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10837
10838 Port byte-code-meter to modern targets.
10839 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10840 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 10841 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
10842 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10843 (METER_1, METER_2): Simplify.
10844
1053a871
SM
108452012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10846
10847 * data.c (Fdefalias): Return `symbol' (bug#11686).
10848
b7e8d081
MR
108492012-06-18 Martin Rudalics <rudalics@gmx.at>
10850
10851 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
10852 gets killed during executing of this function (Bug#11665).
10853 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
10854 (Vkill_buffer_query_functions): In doc-string say that functions
10855 run by this hook should not change the current buffer.
10856
7ea2b339
PE
108572012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10858
10859 Fix recently-introduced process.c problems found by static checking.
10860 * process.c (write_queue_push, write_queue_pop, send_process):
10861 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10862 (write_queue_pop): Fix pointer signedness problem.
10863 (send_process): Remove unused local.
10864
96a313a1
CY
108652012-06-17 Chong Yidong <cyd@gnu.org>
10866
10867 * xdisp.c (redisplay_internal): No need to redisplay terminal
10868 frames that are not on top.
10869
20ca2e94
TN
108702012-06-17 Troels Nielsen <bn.troels@gmail.com>
10871
10872 * process.c (make_process): Initialize write_queue.
10873 (write_queue_push, write_queue_pop): New functions.
10874 (send_process): Use them to maintain correct ordering of process
10875 writes (Bug#10815).
10876
9a900ca9
PE
108772012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10878
310fbfa8
PE
10879 * lisp.h (eassert): Assume C89 or later.
10880 This removes the need for CHECK.
10881 (CHECK): Remove. Its comments about always evaluating its
10882 argument were confusing, as 'eassert' typically does not evaluate
10883 its argument.
10884
27bb1ca4
PE
10885 * coding.c (produce_chars): Use ptrdiff_t, not int.
10886
9a900ca9
PE
10887 * xterm.c (x_draw_underwave): Check for integer overflow.
10888 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10889
41b7f8bc 108902012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
10891
10892 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10893 referenced (Bug#11583).
10894
9b0e3eba
AA
108952012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10896
10897 Implement wave-style variant of underlining.
10898 * dispextern.h (face_underline_type): New enum.
10899 (face): Add field for underline type.
10900 * nsterm.m (ns_draw_underwave): New function.
10901 (ns_draw_text_decoration): Use it.
10902 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10903 New functions.
10904 (x_draw_glyph_string): Use them.
10905 * xfaces.c (Qline, Qwave): New Lisp objects.
10906 (check_lface_attrs, merge_face_ref)
1053a871
SM
10907 (Finternal_set_lisp_face_attribute, realize_x_face):
10908 Handle wave-style underline face attributes.
9b0e3eba
AA
10909 * xterm.c (x_draw_underwave): New function.
10910 (x_draw_glyph_string): Use it.
10911
0fb52f11
JB
109122012-06-16 Juanma Barranquero <lekktu@gmail.com>
10913
10914 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10915 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10916 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10917 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10918 ($(BLD)/w32select.$(O)): Update dependencies.
10919
e5560ff7
AS
109202012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10921
10922 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10923 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10924 * character.c (_fetch_multibyte_char_p): Remove.
10925 * alloc.c: Include "character.h" before "buffer.h".
10926 * bidi.c: Likewise.
10927 * buffer.c: Likewise.
10928 * bytecode.c: Likewise.
10929 * callint.c: Likewise.
10930 * callproc.c: Likewise.
10931 * casefiddle.c: Likewise.
10932 * casetab.c: Likewise.
10933 * category.c: Likewise.
10934 * cmds.c: Likewise.
10935 * coding.c: Likewise.
10936 * composite.c: Likewise.
10937 * dired.c: Likewise.
10938 * dispnew.c: Likewise.
10939 * doc.c: Likewise.
10940 * dosfns.c: Likewise.
10941 * editfns.c: Likewise.
10942 * emacs.c: Likewise.
10943 * fileio.c: Likewise.
10944 * filelock.c: Likewise.
10945 * font.c: Likewise.
10946 * fontset.c: Likewise.
10947 * fringe.c: Likewise.
10948 * indent.c: Likewise.
10949 * insdel.c: Likewise.
10950 * intervals.c: Likewise.
10951 * keyboard.c: Likewise.
10952 * keymap.c: Likewise.
10953 * lread.c: Likewise.
10954 * macros.c: Likewise.
10955 * marker.c: Likewise.
10956 * minibuf.c: Likewise.
10957 * nsfns.m: Likewise.
10958 * nsmenu.m: Likewise.
10959 * print.c: Likewise.
10960 * process.c: Likewise.
10961 * regex.c: Likewise.
10962 * region-cache.c: Likewise.
10963 * search.c: Likewise.
10964 * syntax.c: Likewise.
10965 * term.c: Likewise.
10966 * textprop.c: Likewise.
10967 * undo.c: Likewise.
10968 * unexsol.c: Likewise.
10969 * w16select.c: Likewise.
10970 * w32fns.c: Likewise.
10971 * w32menu.c: Likewise.
10972 * window.c: Likewise.
10973 * xdisp.c: Likewise.
10974 * xfns.c: Likewise.
10975 * xmenu.c: Likewise.
10976 * xml.c: Likewise.
10977 * xselect.c: Likewise.
10978
2f07e6af
EZ
109792012-06-16 Eli Zaretskii <eliz@gnu.org>
10980
1053a871
SM
10981 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10982 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 10983 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
10984 row.
10985 (handle_face_prop): Use chunk-relative overlay string index when
10986 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
10987 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10988 the rightmost. (Bug#11720)
2f07e6af 10989
29b83cec
AS
109902012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10991
10992 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10993 (CATEGORY_MEMBER): Enforce 1/0 value.
10994 * category.c (_temp_category_set): Remove.
10995
4c5501e9
EZ
109962012-06-16 Eli Zaretskii <eliz@gnu.org>
10997
10998 * window.c (Fdelete_other_windows_internal)
10999 (Fdelete_window_internal): Don't access frame's mouse highlight
11000 info of the initial frame. (Bug#11677)
11001
2b570124
PE
110022012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11003
e93864f9
PE
11004 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11005 Assume USE_2_TAGS_FOR_INTS.
11006 (xreload): Adjust $tagmask width to match recent lisp.h change.
11007
2b570124
PE
11008 Simplify lisp.h in minor ways that should not affect code.
11009 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11010 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11011 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11012 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11013 (INTTYPEBITS): New macro, for clarity.
11014 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
11015 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11016 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
11017 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11018 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11019
81755f69
JB
110202012-06-13 Juanma Barranquero <lekktu@gmail.com>
11021
11022 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11023
16192a57
GM
110242012-06-13 Glenn Morris <rgm@gnu.org>
11025
11026 * s/bsd-common.h (BSD4_3):
11027 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11028
646b5f55
AS
110292012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11030
11031 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11032 instead of union.
11033 (XLI, XIL): Define.
1053a871
SM
11034 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11035 Use them.
11036 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 11037 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 11038 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
11039 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11040 * frame.c (delete_frame): Remove outdated comment.
11041 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11042 USE_LISP_UNION_TYPE.
11043 (Fw32_unregister_hot_key): Likewise.
11044 (Fw32_toggle_lock_key): Likewise.
11045 * w32menu.c (add_menu_item): Likewise.
11046 (w32_menu_display_help): Use XIL instead of checking
11047 USE_LISP_UNION_TYPE.
11048 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11049 (init_heap): Likewise.
11050 * w32term.c (w32_read_socket): Update comment.
11051
1d3823c9
GM
110522012-06-13 Glenn Morris <rgm@gnu.org>
11053
c62ff706
GM
11054 * s/usg5-4-common.h, src/s/unixware.h:
11055 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11056
1d3823c9
GM
11057 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11058
bfe3e0a2
PE
110592012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11060
11061 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11062 * alloc.c (make_number) [!defined make_number]:
11063 Remove, as lisp.h always defines this now.
11064 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11065 (roundup_size): Verify that it is a power of 2.
11066 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11067 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11068 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11069 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11070 USE_LSB_TAG now is always defined to be either 0 or 1.
11071 All uses changed.
11072 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11073 code works fine either way, and efficiency is not a concern here,
11074 as the union type is for debugging, not for production.
11075 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11076 Use an inline function on all platforms when using the union type,
11077 since this is simpler and 'static inline' can be used portably
11078 within Emacs now.
11079 (LISP_INITIALLY_ZERO): New macro.
11080 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11081 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11082
45fa9c0f
GM
110832012-06-12 Glenn Morris <rgm@gnu.org>
11084
b4492cba
GM
11085 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11086
11087 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 11088
45fa9c0f
GM
11089 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11090 Move BROKEN_SIGIO to configure.
11091
11092 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11093 Move NO_TERMIO to configure.
11094
0e25d334
CY
110952012-06-12 Chong Yidong <cyd@gnu.org>
11096
11097 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11098 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11099 MagickExportImagePixels is undefined.
11100
43682bb6
PE
111012012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11102
11103 * image.c (imagemagick_load_image): Remove unused label.
11104
a9be7d2b
GM
111052012-06-11 Glenn Morris <rgm@gnu.org>
11106
11107 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11108 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11109 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11110 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11111
3017f87f
SM
111122012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11113
11114 * alloc.c (make_byte_code): New function.
11115 (Fmake_byte_code): Use it. Don't purify here.
11116 * lread.c (read1): Use it as well to avoid extra allocation.
11117
1b9b4cf4
CY
111182012-06-11 Chong Yidong <cyd@gnu.org>
11119
11120 * image.c (imagemagick_load_image): Implement transparency.
11121
95988fcf
AS
111222012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11123
11124 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11125 account for preceding backslashes. (Bug#11663)
11126
cd4eb164
CY
111272012-06-09 Chong Yidong <cyd@gnu.org>
11128
11129 * term.c: Support italics in capable terminals (Bug#9652).
11130 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11131 (turn_on_face): Output using TS_enter_italic_mode if available.
11132 Don't handle unused blinking and alt-charset cases.
11133 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11134 and tty_alt_charset_p cases.
11135 (tty_capable_p, init_tty): Support italics.
11136
11137 * termchar.h (struct tty_display_info): Add field for italics.
11138 Remove unused blink field.
11139
11140 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11141 Handle slant.
11142
11143 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11144 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11145 tty_alt_charset_p. Add tty_italic_p.
11146
ff88beb8
MA
111472012-06-09 Michael Albinus <michael.albinus@gmx.de>
11148
11149 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11150 dbus_type_is_basic if available.
11151 (xd_extract_signed, xd_extract_unsigned): Rename from
11152 extract_signed and extract_unsigned, respectively. Adapt callers.
11153
44286096
CY
111542012-06-09 Chong Yidong <cyd@gnu.org>
11155
1682701f
CY
11156 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11157
44286096
CY
11158 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11159 case (Bug#9752).
11160
d86feb17
PE
111612012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11162
11163 * xdisp.c (vmessage): Treat frame message as multibyte.
11164 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11165 would generate the diagnostic "Making \302\247 buffer-local while
11166 let-bound!".
11167
d5c20fe8
EZ
111682012-06-08 Eli Zaretskii <eliz@gnu.org>
11169
11170 * dispnew.c (showing_window_margins_p): Undo last change, which
11171 was done due to an inadvertent commit.
11172 (adjust_frame_glyphs_for_frame_redisplay): Do call
11173 showing_window_margins_p.
11174
513749ee
SM
111752012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11176
11177 * eval.c (Fmake_var_non_special): New primitive.
11178 (syms_of_eval): Defsubr it.
11179 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11180
d4a8f5c1
JB
111812012-06-08 Juanma Barranquero <lekktu@gmail.com>
11182
11183 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11184 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11185
8bbbc977
EZ
111862012-06-08 Eli Zaretskii <eliz@gnu.org>
11187
11188 * alloc.c (allocate_vectorlike): Fix last change.
11189
f3372c87
DA
111902012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11191
11192 Block-based vector allocation of small vectors.
11193 * lisp.h (struct vectorlike_header): New field `nbytes',
11194 adjust comment accordingly.
11195 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 11196 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
11197 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11198 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11199 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11200 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11201 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11202 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11203 (roundup_size): New constant.
11204 (struct vector_block): New data type.
11205 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 11206 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
11207 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11208 (sweep_vectors): New functions.
11209 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 11210 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
11211 or equal to VBLOCK_BYTES_MAX.
11212 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11213 (init_alloc_once): Add call to init_vectors.
11214
4f18a4ed
SM
112152012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11216
11217 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11218
86f158bc
PE
112192012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11220
11221 * doprnt.c (doprnt): Truncate multibyte char correctly.
11222 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11223 would mishandle a string argument "Xc" if X was a multibyte
11224 character of length 2: it would truncate after X's first byte
11225 rather than including all of X.
11226
c5cfcbe0
CY
112272012-06-06 Chong Yidong <cyd@gnu.org>
11228
11229 * buffer.c (word_wrap): Doc fix.
11230
c05cf390
PE
112312012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11232
11233 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11234
0c3461de
GM
112352012-06-03 Glenn Morris <rgm@gnu.org>
11236
11237 * xdisp.c (tool-bar-style): Doc fix.
11238
c71232db
UM
112392012-06-03 Ulrich Müller <ulm@gentoo.org>
11240
11241 * Makefile.in (PAXCTL): Define.
11242 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11243 binary via PaX flags if the paxctl utility is available.
11244 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11245 Restore PaX flags to their default. (Bug#11398)
11246
383f7350
CY
112472012-06-03 Chong Yidong <cyd@gnu.org>
11248
11249 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11250 buffer (Bug#11226).
11251
5f2c76c6
CY
112522012-06-03 Chong Yidong <cyd@gnu.org>
11253
11254 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11255 (note_mode_line_or_margin_highlight): If there is no help echo,
11256 use mode-line-default-help-echo. Handle the case where the mouse
11257 position is past the end of the mode line string.
11258
11259 * buffer.c (buffer_local_value_1): New function, split from
11260 Fbuffer_local_value; can return Qunbound.
11261 (Fbuffer_local_value): Use it.
11262 (Vmode_line_format): Docstring tweaks.
11263
773d47f6
PE
112642012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 * sysdep.c (system_process_attributes): Improve comment.
11267
f2d6a3df
SM
112682012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11269
11270 * keyboard.c: Export real-this-command to Elisp.
11271 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11272 and DEFVAR it. Update all users.
11273
63810350
PE
112742012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11275
7bd5c1f4
PE
11276 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11277
63810350
PE
11278 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11279 Convert pctcpu and pctmem to Lisp float properly.
11280 Let the compiler fold better, as 100.0/0x8000 is exact.
11281
a2821611
AS
112822012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11283
11284 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11285 cons_block.
11286
5fceba1d
PE
112872012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11288
11289 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11290
c98ff5dd
DA
112912012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11292
11293 For a 'struct window', replace some Lisp_Object fields to
11294 bitfields where appropriate, remove unused fields.
11295 * window.h (struct window): Remove unused 'last_mark_x' and
11296 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 11297 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
11298 Change type of 'force_start', 'optional_new_start',
11299 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 11300 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 11301
ca34e0be
PE
113022012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 Pacify gcc -Wdouble-precision when using Xaw.
11305 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11306 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11307 Use 'float' consistently, rather than 'float' in most places
11308 and 'double' in a couple of places.
11309
efc00ab1 113102012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
11311
11312 * xdisp.c (handle_stop): Detect whether we have overlay strings
11313 loaded by testing it->current.overlay_string_index to be
11314 non-negative, instead of checking whether n_overlay_strings is
11315 positive. (Bug#11587)
11316
efc00ab1 113172012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
11318
11319 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11320
11321 * doc.c (Fsubstitute_command_keys): Doc fix.
11322
efc00ab1 113232012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
11324
11325 * search.c (search_buffer): Remove calls to
11326 r_alloc_inhibit_buffer_relocation, as it is now called by
11327 maybe_unify_char, which was the cause of relocation of buffer text
11328 in bug#11519.
11329
efc00ab1 113302012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
11331
11332 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11333 for the duration of call to load_charset, to avoid problems with
11334 callers of maybe_unify_char that access buffer text through C
11335 pointers.
11336
11337 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11338 decrement the inhibition flag, instead of just setting or
11339 resetting it.
11340
ba93a187
PE
113412012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11342
11343 Remove obsolete '#define static' cruft.
11344 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11345 This #undef was "temporary" in 2000; it is no longer needed
11346 now that '#define static' has gone away.
11347 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11348 (gray_bitmap_bits): Remove; no longer needed.
11349 All uses replaced with definiens.
11350 * xterm.c: Include "bitmaps/gray.xbm".
11351
9e4bf381
PE
113522012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11353
11354 Clean up __executable_start, monstartup when --enable-profiling.
11355 The following changes affect the code only when profiling.
11356 * dispnew.c (__executable_start): Rename from safe_bcopy.
11357 Define only on platforms that need it.
11358 * emacs.c: Include <sys/gmon.h> when profiling.
11359 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11360 (__executable_start): Remove decl, since lisp.h does it now.
11361 (safe_bcopy): Remove decl; no longer has that name.
11362 (main): Coalesce #if into single bit of code, for simplicity.
11363 Cast pointers to uintptr_t, since standard libraries want integers
11364 and not pointers.
11365 * lisp.h (__executable_start): New decl.
11366
32d72c2f
GM
113672012-05-31 Glenn Morris <rgm@gnu.org>
11368
11369 * image.c (Fimagemagick_types): Doc fix.
11370
baac5bc7
JM
113712012-05-30 Jim Meyering <meyering@redhat.com>
11372
11373 * callproc.c (Fcall_process_region): Include directory component
11374 in mkstemp error message (Bug#11586).
11375
72cb32cf
PE
113762012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11377
11378 * alloc.c, lisp.h (make_pure_vector): Now static.
11379
61b108cc
SM
113802012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11381
11382 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11383 Move to byte-run.el.
11384 (Fautoload): Do the hash-doc more carefully.
11385 * data.c (Fdefalias): Purify definition, except for keymaps.
11386 (Qdefun): Move from eval.c.
11387 * lisp.h (Qdefun): Remove.
11388 * lread.c (read1): Tiny simplification.
11389
471fe23d
TN
113902012-05-29 Troels Nielsen <bn.troels@gmail.com>
11391
934f3f58 11392 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
11393 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11394 Bug#9642, but explicitly check that the buffer the overlay would
11395 be moved to is live and rearrange lines to make sure that errors
11396 will not put the overlay in an inconsistent state.
11397 (Fdelete_overlay): Cosmetics.
11398
85d0efd1
EZ
113992012-05-28 Eli Zaretskii <eliz@gnu.org>
11400
11401 * w32term.c (my_bring_window_to_top): New function.
11402 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
11403 could be different from the original one.
11404 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
11405 (Bug#11513)
11406
11407 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11408 by calling BringWindowToTop.
11409
11410 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11411 (WM_EMACS_END): Increase by one.
11412
da92a98c
PE
114132012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11414
11415 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11416 This avoids undefined behavior that might cause the eassert
11417 to not catch an out-of-range value.
11418
74d1f848
JB
114192012-05-28 Juanma Barranquero <lekktu@gmail.com>
11420
11421 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11422 Update dependencies.
11423
9e1a06fc
EZ
114242012-05-27 Eli Zaretskii <eliz@gnu.org>
11425
11426 * bidi.c (bidi_mirror_char): Fix last change.
11427
f3dd7312
AS
114282012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11429
11430 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11431 when referring to sectname field in printf format.
11432
81899c91
PE
114332012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11434
57b81a9f
PE
11435 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11436 Only r_alloc_inhibit_buffer_relocation needed to be added;
11437 the others were already declared.
11438
81899c91
PE
11439 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11440 before checking whether it's out of range. Put the check inside
11441 eassert. See
11442 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11443
33017faf 114442012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
11445
11446 * callproc.c (Fcall_process): Restore a line that was accidentally
11447 commented out in the 2011-02-13 change (bug#11547).
11448
33017faf 114492012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
11450
11451 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11452 defined on ralloc.c.
11453
11454 * buffer.c [REL_ALLOC]: Remove prototypes of
11455 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11456 they are now on lisp.h.
11457
11458 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11459
11460 * search.c (search_buffer): Use it to inhibit relocation of buffer
11461 text while re_search_2 is doing its job, because re_search_2 is
11462 passed C pointers to buffer text. (Bug#11519)
11463
23415acf
EZ
11464 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11465 Update value to 24.
11466
44e27368
EZ
11467 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11468 state after an additional call to move_it_in_display_line_to, keep
11469 the values of it->max_ascent and it->max_descent found for the
11470 entire line.
11471 (pos_visible_p): Revert the comparison against bottom_y to what it
11472 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11473 (Bug#11464)
11474
c1892f11
PE
114752012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11476
11477 Fix coding-related core dumps with gcc -ftrapv.
11478 The code was computing A - B, where A and B are pointers, and B is
11479 random garbage. This can lead to core dumps on platforms that
11480 have special pointer registers, and it also leads to core dumps on
11481 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11482 A - B only when B is initialized properly.
11483 * coding.c (coding_set_source, coding_set_destination): Return void.
11484 (coding_change_source, coding_change_destinations): New functions,
11485 with the old behaviors of coding_set_source and coding_set_destination.
11486 All callers that need an offset changed to use these new functions.
11487
eb7afdad
GM
114882012-05-26 Glenn Morris <rgm@gnu.org>
11489
11490 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11491
f12fdf02
EZ
114922012-05-26 Eli Zaretskii <eliz@gnu.org>
11493
53a63be6 11494 Extend mouse support on W32 text-mode console.
61b108cc
SM
11495 * xdisp.c (draw_row_with_mouse_face):
11496 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 11497
eb3f6f01 11498 * w32console.c: Include window.h.
61b108cc
SM
11499 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11500 New functions.
eb3f6f01
EZ
11501 (initialize_w32_display): Initialize mouse-highlight data.
11502
53a63be6
EZ
11503 * w32inevt.c: Include termchar.h and window.h.
11504 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11505 moves, call note_mouse_highlight. If help_echo changed, call
11506 gen_help_event to produce help-echo message in the echo area.
11507 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11508 highlight info.
11509
4cfd81f6
PE
115102012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11511
11512 * lread.c (read1): Simplify slightly to avoid an overflow warning
11513 with GCC 4.7.0 on x86-64.
11514
4446092a
EZ
115152012-05-26 Eli Zaretskii <eliz@gnu.org>
11516
11517 * bidi.c (bidi_mirror_char): Revert last change: an int is
11518 definitely wide enough here.
11519
42b2a986 115202012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 11521
42b2a986 11522 Fix integer width and related bugs (Bug#9874).
eb106a49 11523 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
11524 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11525 (string_bytes, check_sblock, allocate_string_data):
11526 (compact_small_strings, Fmake_bool_vector, make_string)
11527 (make_unibyte_string, make_multibyte_string)
11528 (make_string_from_bytes, make_specified_string)
11529 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11530 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11531 (mark_vectorlike):
11532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11533 (allocate_pseudovector):
11534 Use int, not EMACS_INT, where int is wide enough.
11535 (inhibit_garbage_collection, Fgarbage_collect):
11536 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11537 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11538 int might not be wide enough.
11539 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11540 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11541 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11542 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11543 (bidi_level_of_next_char, bidi_move_to_visually_next):
11544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11545 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11546 (Fkill_buffer, Fset_buffer_major_mode)
11547 (advance_to_char_boundary, Fbuffer_swap_text)
11548 (Fset_buffer_multibyte, overlays_at, overlays_in)
11549 (overlay_touches_p, struct sortvec, record_overlay_string)
11550 (overlay_strings, recenter_overlay_lists)
11551 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11552 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11553 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11554 (Foverlay_recenter, last_overlay_modification_hooks_used)
11555 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
11557 (validate_region): Omit unnecessary test for b <= e,
11558 since that's guaranteed by the previous test.
d311d28c
PE
11559 (adjust_overlays_for_delete): Avoid pos + length overflow.
11560 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11561 (report_overlay_modification):
11562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11563 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11564 Omit pointer cast, which isn't needed anyway, and doesn't work
11565 after the EMACS_INT -> ptrdiff_t change.
02481186 11566 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
11567 * buffer.h: Adjust decls to match defn changes elsewhere.
11568 (struct buffer_text, struct buffer):
11569 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11570 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
11571 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11572 not int, to avoid needless 32-bit limit on 64-bit hosts.
11573 (exec_byte_code): Use tighter memory-full test, one that checks
11574 for alloca overflow. Don't compute the address of the object just
11575 before an array, as that's not portable. Use EMACS_INT, not
11576 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
11577 * callint.c (Fcall_interactively):
11578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11579 * callproc.c (call_process_kill, Fcall_process):
11580 Don't assume pid_t fits into an Emacs fixnum.
11581 (call_process_cleanup, Fcall_process, child_setup):
11582 Don't assume pid_t fits into int.
11583 (call_process_cleanup, Fcall_process, delete_temp_file)
11584 (Fcall_process_region):
11585 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11586 (Fcall_process): Simplify handling of volatile integers.
11587 Use int, not EMACS_INT, where int will do.
11588 * casefiddle.c (casify_object, casify_region, operate_on_word)
11589 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11591 (casify_object): Avoid integer overflow when overallocating buffer.
11592 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 11593 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
11594 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11595 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11596 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11597 integers are now checked earlier. All uses replaced with XINT.
11598 (ccl_driver):
11599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11600 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
11601 (ccl_driver, Fregister_code_conversion_map):
11602 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
11603 (resolve_symbol_ccl_program): Check that vector header is in range.
11604 Always copy the vector, so that we can check its contents reliably
11605 now rather than having to recheck each instruction as it's being
11606 executed. Check that vector words fit in 'int'.
11607 (ccl_get_compiled_code, Fregister_ccl_program)
11608 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11609 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11610 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11611 contents are in range.
11612 (Fccl_execute_on_string): Check that status is in range.
11613 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11614 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11615 Accept and return EMACS_INT, not int, because callers can pass values
11616 out of 'int' range.
11617 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11618 (multibyte_chars_in_text, parse_str_as_multibyte)
11619 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11620 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11621 (string_escape_byte8, Fget_byte):
11622 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 11623 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
11624 avoid mishandling large integers.
11625 * character.h: Adjust decls to match defn changes elsewhere.
11626 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11627 (Ffind_charset_region):
11628 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11629 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11630 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 11631 Don't assume fixnum fits in int.
d311d28c
PE
11632 (load_charset_map_from_vector, Fmap_charset_chars):
11633 Remove now-unnecessary CHECK_NATNUMs.
11634 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
11635 Don't rely on undefined behavior with signed left shift overflow.
11636 Don't assume unsigned int fits into fixnum, or that fixnum fits
11637 into unsigned int. Don't require max_code to be a valid fixnum;
11638 that's not true for gb10830 4-byte on a 32-bit host. Allow
11639 invalid_code to be a cons, for the same reason. Require code_offset
11640 to be a character. Avoid int overflow if max_char is close
11641 to INT_MAX.
11642 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11643 this is intended anyway and avoids some undefined behavior.
11644 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11645 INDEX_TO_CODE_POINT, as that's what it expects.
11646 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
11647 * charset.h (DECODE_CHAR): Return int, not unsigned;
11648 this is what was intended anyway, and it avoids undefined behavior.
11649 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11650 integer-overflow issues.
11651 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11652 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11653 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
11654 * chartab.c (Fmake_char_table, Fset_char_table_range)
11655 (uniprop_get_decoder, uniprop_get_encoder):
11656 Don't assume fixnum fits in int.
11657 * cmds.c (move_point): New function, that does the gist of
11658 Fforward_char and Fbackward_char, but does so while checking
11659 for integer overflow more accurately.
c96e5d6a 11660 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
11661 (Fforward_line, Fend_of_line, internal_self_insert)
11662 (internal_self_insert):
11663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11664 Fix a FIXME, by checking for integer overflow when calculating
11665 target_clm and actual_clm.
11666 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 11667 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
11668 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11669 (coding_alloc_by_making_gap, alloc_destination)
11670 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11671 (encode_coding_utf_16, detect_coding_emacs_mule)
11672 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11673 (detect_coding_iso_2022, decode_coding_iso_2022)
11674 (encode_invocation_designation, encode_designation_at_bol)
11675 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11676 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11677 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11678 (encode_coding_ccl, encode_coding_raw_text)
11679 (detect_coding_charset, decode_coding_charset)
11680 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11681 (produce_composition, produce_charset, produce_annotation)
11682 (decode_coding, handle_composition_annotation)
11683 (handle_charset_annotation, consume_chars, decode_coding_gap)
11684 (decode_coding_object, encode_coding_object, detect_coding_system)
11685 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11686 (code_convert_region, code_convert_string)
8f50130c
PE
11687 (Fdefine_coding_system_internal)
11688 (coding_set_source, coding_set_destination):
d311d28c
PE
11689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11690 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11691 (Fdefine_coding_system_internal):
11692 Don't assume fixnums fit in int.
11693 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 11694 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
11695 (Funencodable_char_position, Fcheck_coding_systems_region)
11696 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 11697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 11698 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 11699 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 11700 Don't access memory outside of the args array.
d311d28c 11701 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
11702 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11703 result of ENCODE_CHAR.
d311d28c
PE
11704 * coding.h: Adjust decls to match defn changes elsewhere.
11705 (struct coding_system):
11706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11707 * composite.c (get_composition_id, find_composition)
11708 (run_composition_function, update_compositions)
11709 (compose_text, composition_gstring_put_cache)
11710 (composition_gstring_p, composition_gstring_width)
11711 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11712 (composition_compute_stop_pos, composition_reseat_it)
11713 (composition_update_it, struct position_record)
11714 (find_automatic_composition, composition_adjust_point)
11715 (Fcomposition_get_gstring, Ffind_composition_internal):
11716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11717 (update_compositions):
11718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11719 * composite.h: Adjust decls to match defn changes elsewhere.
11720 (struct composition):
11721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11722 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11723 Do not attempt to compute the address of the object just before a
11724 buffer; this is not portable.
11725 (Faref, Faset):
11726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11727 (Faset): Use int, not EMACS_INT, where int is wide enough.
11728 (Fstring_to_number): Don't assume fixnums fit in int.
11729 (Frem): Don't assume arg is nonnegative.
11730 * dbusbind.c (xd_append_arg): Check for integers out of range.
11731 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 11732 (extract_signed, extract_unsigned): New functions.
243e0530
PE
11733 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11734 (xd_get_connection_references): Return ptrdiff_t, not int.
11735 All uses changed.
11736 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11737 (xd_read_message_1):
11738 Use int, not unsigned, where the dbus API uses int.
11739 (Fdbus_message_internal): Don't overflow mtype.
11740 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
11741 * dired.c (directory_files_internal, file_name_completion, scmp)
11742 (file_name_completion_stat):
11743 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11744 (file_name_completion): Don't overflow matchcount.
11745 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11746 * dispextern.h: Adjust decls to match defn changes elsewhere.
11747 (struct text_pos, struct glyph, struct bidi_saved_info)
11748 (struct bidi_string_data, struct bidi_it, struct composition_it)
11749 (struct it):
11750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11751 (struct display_pos, struct composition_it, struct it):
11752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11753 * dispnew.c (increment_matrix_positions)
11754 (increment_row_positions, mode_line_string)
11755 (marginal_area_string):
11756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 11757 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
11758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11759 (duration_to_sec_usec): New function, to check for overflow better.
11760 (Fsleep_for, sit_for): Use it.
11761 * doc.c (get_doc_string, store_function_docstring):
11762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11763 (get_doc_string, Fsnarf_documentation):
11764 Use int, not EMACS_INT, where int is wide enough.
11765 (get_doc_string):
11766 Use SAFE_ALLOCA, not alloca.
11767 Check for overflow when converting EMACS_INT to off_t.
11768 * doprnt.c (doprnt):
11769 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11770 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11771 Don't assume uid_t fits into fixnum.
11772 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11773 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11774 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11775 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11776 (general_insert_function)
11777 (Finsert_char, make_buffer_string, make_buffer_string_both)
11778 (update_buffer_properties, Fbuffer_substring)
11779 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11780 (Fsubst_char_in_region, check_translation)
11781 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11782 (transpose_markers, Ftranspose_regions):
11783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11784 (clip_to_bounds): Move to lisp.h as an inline function).
11785 (Fconstrain_to_field): Don't assume integers are nonnegative.
11786 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11787 (Fsubst_char_in_region, Fsave_restriction):
11788 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11789 (Femacs_pid): Don't assume pid_t fits into fixnum.
11790 (lo_time): Use int, not EMACS_INT, when int suffices.
11791 (lisp_time_argument): Check for usec out of range.
11792 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
11793 (Fuser_login_name, Fuser_full_name): Signal an error
11794 if a uid argument is out of range, rather than relying on
11795 undefined behavior.
c8d5c857
PE
11796 (Fformat_time_string): Remove now-unnecessary check.
11797 lisp_time_argument checks for out-of-range usec now.
243e0530 11798 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
11799 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11800 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11801 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11802 (init_cmdargs, Fdump_emacs):
11803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11804 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11805 the bottom (typically) 32 bits of the fixnum.
11806 * eval.c (specpdl_size, call_debugger):
11807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11808 (when_entered_debugger, Fbacktrace_debug):
11809 Don't assume fixnum can fit in int.
11810 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11811 the object just before a buffer; this is not portable.
11812 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11813 (grow_specpdl, unbind_to):
11814 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11815 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11816 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 11817 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
11818 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11819 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11820 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11821 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11822 (a_write, e_write):
11823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11824 (Fcopy_file, non_regular_nbytes, read_non_regular)
11825 (Finsert_file_contents):
11826 Use int, not EMACS_INT, where int is wide enough.
11827 (READ_BUF_SIZE): Verify that it fits in int.
11828 (Finsert_file_contents): Check that counts are in proper range,
11829 rather than assuming fixnums fit into ptrdiff_t etc.
11830 Don't assume fixnums fit into int.
125b3835 11831 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
11832 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11833 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
11834 (string_char_to_byte, string_byte_to_char)
11835 (string_make_multibyte, string_to_multibyte)
11836 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11837 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11838 (substring_both, Fdelete, internal_equal, Ffillarray)
11839 (Fclear_string, mapcar1)
11840 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11841 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11842 (larger_vector, make_hash_table, maybe_resize_hash_table)
11843 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11844 (Fmaphash, secure_hash):
11845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11846 (concat): Check for string index and length overflow.
11847 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11848 (Frequire):
11849 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11850 (larger_vector): New API (vec, incr_min, size_max) replaces old
11851 one (vec, new_size, init). This catches size overflow.
11852 INIT was removed because it was always Qnil.
11853 All callers changed.
11854 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11855 the upper bound on a hash table index size.
11856 (make_hash_table, maybe_resize_hash_table): Use it.
11857 (secure_hash): Computer start_byte and end_byte only after
11858 they're known to be in ptrdiff_t range.
11859 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11860 (Ffont_get_glyphs, Ffont_at):
11861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11862 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11863 (Flist_fonts, Fopen_font):
11864 Don't assume fixnum can fit in int.
11865 (check_gstring): Don't assume index can fit in int.
11866 (font_match_p): Check that fixnum is a character, not a nonnegative
11867 fixnum, since the later code needs to stuff it into an int.
11868 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11869 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11870 conversion overflow issues.
11871 (Fopen_font): Check for integer out of range.
11872 (Ffont_get_glyphs): Don't assume index can fit in int.
11873 * font.h: Adjust decls to match defn changes elsewhere.
11874 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11875 integer overflow.
11876 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11877 printmax_t, where ptrdiff_t is wide enough.
11878 (Finternal_char_font):
11879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11880 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11881 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11882 (Fset_frame_position, x_set_frame_parameters)
11883 (x_set_line_spacing, x_set_border_width)
11884 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11885 Check that fixnums are in proper range for system types.
11886 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11888 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11889 Use SAFE_ALLOCA_LISP, not alloca.
11890 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11891 intptr_t is wide enough.
11892 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11893 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11894 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11895 Check for fixnum out of range.
11896 * ftfont.c (ftfont_list): Don't assume index fits in int.
11897 Check that fixnums are in proper range for system types.
11898 (ftfont_shape_by_flt):
11899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
11900 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11902 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11903 Check that fixnums are in proper range for system types.
11904 * gnutls.h: Adjust decls to match defn changes elsewhere.
11905 * gtkutil.c (xg_dialog_run):
11906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11907 (update_frame_tool_bar):
11908 Check that fixnums are in proper range for system types.
11909 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 11910 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
11911 * indent.c (last_known_column, last_known_column_point):
11912 (current_column_bol_cache):
11913 (skip_invisible, current_column, check_display_width):
11914 (check_display_width, scan_for_column, current_column_1)
11915 (Findent_to, Fcurrent_indentation, position_indentation)
11916 (indented_beyond_p, Fmove_to_column, compute_motion):
11917 (Fcompute_motion, Fvertical_motion):
11918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11919 (last_known_column_modified): Use EMACS_INT, not int.
11920 (check_display_width):
11921 (Fcompute_motion):
11922 Check that fixnums and floats are in proper range for system types.
11923 (compute_motion): Don't assume index or fixnum fits in int.
11924 (compute_motion, Fcompute_motion):
11925 Use int, not EMACS_INT, when it is wide enough.
11926 (vmotion): Omit local var start_hpos that is always 0; that way
11927 we don't need to worry about overflow in expressions involving it.
11928 * indent.h: Adjust decls to match defn changes elsewhere.
11929 (struct position):
11930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11931 Use int, not EMACS_INT, where int is wide enough.
11932 Remove unused members ovstring_chars_done and tab_offset;
11933 all uses removed.
11934 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11935 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11936 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11937 (make_gap, copy_text, insert, insert_and_inherit)
11938 (insert_before_markers, insert_before_markers_and_inherit)
11939 (insert_1, count_combining_before, count_combining_after)
11940 (insert_1_both, insert_from_string)
11941 (insert_from_string_before_markers, insert_from_string_1)
11942 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11943 (adjust_after_replace, adjust_after_insert, replace_range)
11944 (replace_range_2, del_range, del_range_1, del_range_byte)
11945 (del_range_both, del_range_2, modify_region)
11946 (prepare_to_modify_buffer, signal_before_change)
11947 (signal_after_change, Fcombine_after_change_execute):
11948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11949 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11950 (balance_an_interval, split_interval_right, split_interval_left)
11951 (find_interval, next_interval, update_interval)
11952 (adjust_intervals_for_insertion, delete_node, delete_interval)
11953 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11954 (static_offset_intervals, offset_intervals)
11955 (merge_interval_right, merge_interval_left, make_new_interval)
11956 (graft_intervals_into_buffer, temp_set_point_both)
11957 (temp_set_point, set_point, adjust_for_invis_intang)
11958 (set_point_both, move_if_not_intangible, get_property_and_range)
11959 (get_local_map, copy_intervals, copy_intervals_to_string)
11960 (compare_string_intervals, set_intervals_multibyte_1):
11961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11962 * intervals.h: Adjust decls to match defn changes elsewhere.
11963 (struct interval):
11964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11965 * keyboard.c (this_command_key_count, this_single_command_key_start)
11966 (before_command_key_count, before_command_echo_length, echo_now)
11967 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11968 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11969 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11970 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11971 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11972 (last_non_minibuf_size, last_point_position, echo_truncate)
11973 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11974 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11975 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11976 (stuff_buffered_input):
11977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11978 (last_auto_save, command_loop_1, read_char):
11979 Use EMACS_INT, not int, to avoid integer overflow.
11980 (record_char): Avoid overflow in total_keys computation.
11981 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11982 * keyboard.h: Adjust decls to match defn changes elsewhere.
11983 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11984 (Fkey_description, Fdescribe_vector, Flookup_key):
11985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11986 (click_position): New function, to check that positions are in range.
11987 (Fcurrent_active_maps):
11988 (describe_command):
11989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11990 (Faccessible_keymaps, Fkey_description):
11991 (preferred_sequence_p):
11992 Don't assume fixnum can fit into int.
11993 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11994 Check for integer overflow in size calculations.
11995 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11996 avoid mishandling large integers.
11997 * lisp.h: Adjust decls to match defn changes elsewhere.
11998 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11999 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12000 (struct Lisp_Marker):
12001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12002 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
12003 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12004 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12005 All callers changed.
12006 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12007 Assume the arg has valid form, since it always does.
12008 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12009 unsigned integer system type.
12010 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12011 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12013 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12014 (duration_to_sec_usec): New decl.
12015 * lread.c (read_from_string_index, read_from_string_index_byte)
12016 (read_from_string_limit, readchar, unreadchar, openp)
12017 (read_internal_start, read1, oblookup):
12018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12019 (Fload, readevalloop, Feval_buffer, Feval_region):
12020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12021 (openp): Check for out-of-range argument to 'access'.
12022 (read1): Use int, not EMACS_INT, where int is wide enough.
12023 Don't assume fixnum fits into int.
6efdadfd 12024 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
12025 (read_filtered_event): Use duration_to_sec_usec
12026 to do proper overflow checking on durations.
d311d28c
PE
12027 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12028 in size calculation.
12029 (Fexecute_kbd_macro):
12030 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12031 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12032 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12033 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12034 (set_marker_both, set_marker_restricted_both, marker_position)
12035 (marker_byte_position, Fbuffer_has_markers_at):
12036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12037 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 12038 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
12039 It now merely ensures that the menu is large enough, without
12040 necessarily growing it, as this avoids some integer overflow issues.
12041 All callers changed.
12042 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12044 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12045 Use SAFE_ALLOCA_LISP, not alloca.
12046 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12047 to EMACS_INT. Check that fixnums are in proper range for system types.
12048 * minibuf.c (minibuf_prompt_width, string_to_object)
12049 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12050 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12052 (get_minibuffer, read_minibuf_unwind):
12053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12054 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12055 this simplifies overflow checking. All callers changed.
12056 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12057 (Ftest_completion):
12058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12059 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12060 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12061 Check that fixnums are in proper range for system types.
12062 (Fx_create_frame, Fx_show_tip):
12063 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12064 * nsfont.m (ns_findfonts, nsfont_list_family):
12065 Don't assume fixnum fits in long.
12066 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12067 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12068 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12069 wide enough.
17fdb222 12070 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
12071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12072 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12073 (PRINTDECLARE, PRINTPREPARE):
12074 (strout, print_string):
12075 (print, print_preprocess, print_check_string_charset_prop)
12076 (print_object):
12077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12078 (PRINTDECLARE):
12079 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12080 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12081 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 12082 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 12083 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
12084 (print_error_message): Use SAFE_ALLOCA, not alloca.
12085 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
12086 (print_depth, new_backquote_output, print_number_index):
12087 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
12088 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12089 (Fset_process_window_size, Fformat_network_address)
12090 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 12091 (sigchld_handler):
d311d28c 12092 Check that fixnums are in proper range for system types.
d44287d4 12093 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
12094 Check for process-ids out of pid_t range rather than relying on
12095 undefined behavior.
e4d81efc 12096 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
12097 (Fformat_network_address, read_process_output, send_process)
12098 (Fprocess_send_region, status_notify):
12099 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12100 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12101 (wait_reading_process_output, read_process_output, exec_sentinel):
12102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12103 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12104 (Faccept_process_output): Use duration_to_sec_usec to do proper
12105 overflow checking on durations.
dde14581
PE
12106 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12107 Don't assume pid_t fits in int.
02481186
PE
12108 * process.h (struct Lisp_Process): Members tick and update_tick
12109 are now of type EMACS_INT, not int.
b62b53e8
PE
12110 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12111 configured --with-wide-int.
d311d28c
PE
12112 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12113 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12114 * search.c (looking_at_1, string_match_1):
12115 (fast_string_match, fast_c_string_match_ignore_case)
12116 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12117 (scan_newline, find_before_next_newline, search_command)
12118 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12119 (set_search_regs, wordify):
12120 (Freplace_match):
12121 (Fmatch_data):
12122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12123 (string_match_1, search_buffer, set_search_regs):
12124 (Fmatch_data):
12125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12126 (wordify): Check for overflow in size calculation.
12127 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12128 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12129 Check that fixnums are in proper range for system types.
12130 * sound.c (struct sound_device)
12131 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12133 (Fplay_sound_internal):
12134 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 12135 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
12136 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12137 (Fparse_partial_sexp):
12138 Don't assume fixnums can fit in int.
12139 (struct lisp_parse_state, find_start_pos, find_start_value)
12140 (find_start_value_byte, find_start_begv)
12141 (update_syntax_table, char_quoted, dec_bytepos)
12142 (find_defun_start, prev_char_comend_first, back_comment):
12143 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12144 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12146 (Finternal_describe_syntax_value): Check that match_lisp is a
12147 character, not an integer, since the code stuffs it into int.
12148 (scan_words, scan_sexps_forward):
12149 Check that fixnums are in proper range for system types.
12150 (Fforward_word):
12151 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12152 (scan_sexps_forward):
12153 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12154 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12155 * syntax.h: Adjust decls to match defn changes elsewhere.
12156 (struct gl_state_s):
12157 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
12158 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12159 MOST_POSITIVE_FIXNUM.
d311d28c
PE
12160 * sysdep.c (wait_for_termination_1, wait_for_termination)
12161 (interruptible_wait_for_termination, mkdir):
12162 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12163 (emacs_read, emacs_write):
12164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
12165 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12166 and double all fit in int.
d311d28c
PE
12167 * term.c (set_tty_color_mode):
12168 Check that fixnums are in proper range for system types.
12169 * termhooks.h (struct input_event):
12170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12171 * textprop.c (validate_interval_range, interval_of)
12172 (Fadd_text_properties, set_text_properties_1)
12173 (Fremove_text_properties, Fremove_list_of_text_properties)
12174 (Ftext_property_any, Ftext_property_not_all)
12175 (copy_text_properties, text_property_list, extend_property_ranges)
12176 (verify_interval_modification):
12177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12178 (Fnext_single_char_property_change)
12179 (Fprevious_single_char_property_change):
12180 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
12181 (copy_text_properties):
12182 Check for integer overflow in index calculation.
d311d28c
PE
12183 * undo.c (last_boundary_position, record_point, record_insert)
12184 (record_delete, record_marker_adjustment, record_change)
12185 (record_property_change):
12186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12187 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12189 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12190 (Fx_hide_tip, Fx_file_dialog):
12191 * w32menu.c (set_frame_menubar):
12192 Use ptrdiff_t, not int, for consistency with rest of code.
12193 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12194 (select_window, Fdelete_other_windows_internal)
12195 (window_scroll_pixel_based, window_scroll_line_based)
12196 (Frecenter, Fset_window_configuration):
12197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12198 (Fset_window_hscroll, run_window_configuration_change_hook)
12199 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 12200 (Fscroll_other_window, Frecenter):
d311d28c
PE
12201 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12202 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12203 Don't assume fixnum fits in int.
12204 (Fset_window_scroll_bars):
12205 Check that fixnums are in proper range for system types.
12206 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12207 (string_pos, c_string_pos, number_of_chars, init_iterator)
12208 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12209 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12210 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
12211 (face_before_or_after_it_pos, handle_invisible_prop)
12212 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
12213 (display_prop_intangible_p, string_buffer_position_lim)
12214 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12215 (get_overlay_strings_1, get_overlay_strings)
12216 (iterate_out_of_display_property, forward_to_next_line_start)
12217 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12218 (get_next_display_element, set_iterator_to_next)
12219 (get_visually_first_element, compute_stop_pos_backwards)
12220 (handle_stop_backwards, next_element_from_buffer)
12221 (move_it_in_display_line_to, move_it_in_display_line)
12222 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12223 (add_to_log, message_dolog, message_log_check_duplicate)
12224 (message2, message2_nolog, message3, message3_nolog
12225 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12226 (current_message_1, truncate_echo_area, truncate_message_1)
12227 (set_message, set_message_1, store_mode_line_noprop)
12228 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12229 (text_outside_line_unchanged_p, check_point_in_composition)
12230 (reconsider_clip_changes)
12231 (redisplay_internal, set_cursor_from_row, try_scrolling)
12232 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12233 (redisplay_window, find_last_unchanged_at_beg_row)
12234 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12235 (trailing_whitespace_p, find_row_edges, display_line)
12236 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12237 (display_mode_element, store_mode_line_string)
12238 (pint2str, pint2hrstr, decode_mode_spec)
12239 (display_count_lines, display_string, draw_glyphs)
12240 (x_produce_glyphs, x_insert_glyphs)
12241 (rows_from_pos_range, mouse_face_from_buffer_pos)
12242 (fast_find_string_pos, mouse_face_from_string_pos)
12243 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12245 (safe_call, init_from_display_pos, handle_fontified_prop)
12246 (handle_single_display_spec, load_overlay_strings)
12247 (with_echo_area_buffer, setup_echo_area_for_printing)
12248 (display_echo_area, echo_area_display)
12249 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12250 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
12251 (redisplay_window, dump_glyph_row, display_mode_line)
12252 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 12253 (handle_display_spec, display_prop_string_p):
d311d28c
PE
12254 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12255 (handle_single_display_spec, build_desired_tool_bar_string)
12256 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12257 (get_specified_cursor_type):
12258 Check that fixnums are in proper range for system types.
12259 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12260 (Flookup_image_map):
12261 Don't assume fixnums fit in int.
12262 (compare_overlay_entries):
12263 Avoid mishandling comparisons due to subtraction overflow.
12264 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12265 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12266 (handle_tool_bar_click):
12267 Use int, not unsigned, since we prefer signed and the signedness
12268 doesn't matter here.
12269 (get_next_display_element, next_element_from_display_vector):
12270 Use int, not EMACS_INT, when int is wide enough.
12271 (start_hourglass): Use duration_to_sec_usec to do proper
12272 overflow checking on durations.
12273 * xfaces.c (Fbitmap_spec_p):
12274 Check that fixnums are in proper range for system types.
12275 (compare_fonts_by_sort_order):
12276 Avoid mishandling comparisons due to subtraction overflow.
12277 (Fx_family_fonts, realize_basic_faces):
12278 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12279 (Fx_family_fonts):
12280 Don't assume fixnum fits in int.
12281 Use SAFE_ALLOCA_LISP, not alloca.
12282 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12283 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12284 (face_at_buffer_position, face_for_overlay_string)
12285 (face_at_string_position):
12286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12287 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12288 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12289 (Fx_show_tip):
12290 Check that fixnums are in proper range for system types.
12291 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12292 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12293 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12294 (Fx_change_window_property): Don't assume fixnums fit in int.
12295 * xfont.c (xfont_chars_supported):
12296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12297 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12298 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12299 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12300 * xml.c (parse_region):
12301 * xrdb.c (magic_file_p):
12302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12303 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12304 (x_get_local_selection, x_reply_selection_request)
12305 (x_handle_selection_request, wait_for_property_change):
12306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12307 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12308 short is wide enough.
12309 (x_send_client_event): Don't assume fixnum fits in int.
12310 * xterm.c (x_x_to_emacs_modifiers):
12311 Don't assume EMACS_INT overflows nicely into int.
12312 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12313 may come from Lisp.
12314 (handle_one_xevent): NATNUMP can eval its arg twice.
12315 (x_connection_closed):
12316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12317 * xterm.h: Adjust decls to match defn changes elsewhere.
12318 (struct scroll_bar): Use struct vectorlike_header
12319 rather than rolling our own approximation.
12320 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12321
c6574eb5
GM
123222012-05-25 Glenn Morris <rgm@gnu.org>
12323
12324 * lisp.mk (lisp): Update for more files being compiled now.
12325
e8d32c7e
SM
123262012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12327
48def666
SM
12328 * lread.c: Remove `read_pure' which makes no difference.
12329 (read_pure): Remove var.
12330 (unreadpure): Remove function.
12331 (readevalloop): Don't call read_list with -1 flag.
12332 (read1, read_vector): Don't test read_pure any more.
12333 (read_list): Simplify.
12334
e8d32c7e
SM
12335 * fileio.c, character.h: Minor style tweaks.
12336
4b2addb7
DA
123372012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12338
12339 * window.h (clip_changed): Remove useless declaration.
12340
584461b2
JB
123412012-05-22 Juanma Barranquero <lekktu@gmail.com>
12342
12343 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12344 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12345
34374650
PE
123462012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12347
12348 Remove src/m/*.
12349 This directory predates autoconf and is no longer needed nowadays.
12350 Move its few remaining bits of functionality to where they're needed.
12351 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12352 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12353 * m/template.h: Remove.
12354 * Makefile.in (M_FILE): Remove. All uses removed.
12355 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12356 * lisp.h (USE_LSB_TAG):
12357 * mem-limits.h (EXCEEDS_LISP_PTR):
12358 Use VAL_MAX, not VALBITS, in #if.
12359 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12360 (EMACS_UINT): Define unconditionally now.
12361 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12362 (BITS_PER_EMACS_INT): New constants, replacing
12363 what used to be in config.h, but not useful in #if.
12364 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12365 define them any more.
12366 (VAL_MAX): New macro.
12367 (VALMASK): Use it.
12368 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12369 BITS_PER_EMACS_INT, in #if.
12370 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12371 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12372 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12373 * s/ms-w32.h (DATA_START):
12374 Move here from removed file m/intel386.h.
12375 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12376 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12377
261cb4bb
PE
123782012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12379
12380 Assume C89 or later.
12381 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12382 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12383 (xrealloc):
12384 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12385 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12386 * textprop.c, tparam.c (NULL): Remove.
12387 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12388 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12389 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12390 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12391 * xterm.c (input_signal_count): Assume volatile works.
12392
ff23cd9f
KB
123932012-05-21 Ken Brown <kbrown@cornell.edu>
12394
12395 * xgselect.c (xg_select): Fix first argument in call to 'select'
12396 (bug#11508).
12397
1b170bc6
KB
123982012-05-20 Ken Brown <kbrown@cornell.edu>
12399
12400 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 12401 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 12402
b2f4d39f
KB
124032012-05-19 Ken Brown <kbrown@cornell.edu>
12404
12405 * xfns.c (x_in_use): Remove `static' qualifier.
12406 * xterm.h (x_in_use): Declare.
12407 * xgselect.c: Include xterm.h.
12408 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12409 and `display_arg' (bug#9754).
12410
003fdae2
PE
124112012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12412
9232a6d9
PE
12413 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12414
003fdae2
PE
12415 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12416 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12417
784b56e2
EZ
124182012-05-18 Eli Zaretskii <eliz@gnu.org>
12419
12420 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12421
12422 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 12423 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
12424
12425 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12426 reference to image_cache->refcount.
12427 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12428
a0a79cde
JL
124292012-05-17 Juri Linkov <juri@jurta.org>
12430
12431 * search.c (Fword_search_regexp, Fword_search_backward)
12432 (Fword_search_forward, Fword_search_backward_lax)
12433 (Fword_search_forward_lax): Move functions to isearch.el
12434 (bug#10145, bug#11381).
12435
b0572523
PE
124362012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12437
12438 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12439
9660f5fc
SM
124402012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12441
12442 * lread.c (init_obarray): Declare Qt and Qnil as special.
12443
4374de83
GM
124442012-05-14 Glenn Morris <rgm@gnu.org>
12445
12446 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 12447 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 12448
dc44c39a
PE
124492012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12450
078c97cb
PE
12451 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12452
dc44c39a
PE
12453 * unexaix.c: Port to more-recent AIX compilers.
12454 (report_error, report_error_1, make_hdr, copy_sym)
12455 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12456 Make arguments const char *, not char *, to avoid violations of C
12457 standard and to fix some AIX warnings reported by Gilles Pion.
12458
e18afed7 124592012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
12460
12461 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12462 already have overlays loaded.
12463 (handle_single_display_spec): Before returning without displaying
12464 fringe bitmap, synchronize the bidi iterator with the main display
12465 iterator, by calling iterate_out_of_display_property.
12466 (iterate_out_of_display_property): Detect buffer iteration by
12467 testing that it->string is a Lisp string.
12468 (get_next_display_element): When the current object is exhausted,
12469 and there's something on it->stack, call set_iterator_to_next to
12470 proceed with what's on the stack, instead of returning zero.
12471 (set_iterator_to_next): If called at the end of a Lisp string,
12472 proceed to consider_string_end without incrementing string
12473 position. Don't increment display vector index past the end of
12474 the display vector. (Bug#11417)
c8fb9dc6
EZ
12475 (pos_visible_p): Don't report a position visible when move_it_to
12476 stopped at the last line of window, which happens to be scanned
12477 backwards by the bidi iteration. (Bug#11464)
ac268e67 12478
e18afed7 124792012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
12480
12481 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12482 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
12483 are on a TTY, and thus unable to display on the fringes.
12484 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
12485 so we need to signal to the caller that this is a "replacing"
12486 display spec. This fixes display when the spec is invalid or we
12487 are on a TTY.
12488
e18afed7 124892012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
12490
12491 * unexaix.c (make_hdr): Fix typo in prototype.
12492 This bug broke the build on AIX. Problem reported by Gilles Pion.
12493
9d0a235a
MA
124942012-05-14 Michael Albinus <michael.albinus@gmx.de>
12495
12496 * keyboard.c (kbd_buffer_get_event): Read special events also in
12497 batch mode. (Bug#11415)
12498
9e6b06ed
GM
124992012-05-12 Glenn Morris <rgm@gnu.org>
12500
12501 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12502
c1a1d7a3
EZ
125032012-05-12 Eli Zaretskii <eliz@gnu.org>
12504
12505 * lisp.mk (lisp): Add newcomment.elc.
12506
3fe7cdc8
GM
125072012-05-12 Glenn Morris <rgm@gnu.org>
12508
12509 * Makefile.in (MKDIR_P): New, set by configure.
12510 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12511
53f7d2c0
PE
125122012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12513
12514 Remove unused function hourglass_started.
12515 * dispextern.h (hourglass_started):
12516 * w32fns.c (hourglass_started):
12517 * xdisp.c (hourglass_started): Remove.
12518
75aafb17
JB
125192012-05-10 Juanma Barranquero <lekktu@gmail.com>
12520
12521 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12522 Update dependencies.
12523
12959e8e
PE
125242012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12525
97107e2e
PE
12526 * xgselect.c (xg_select): Put maxfds+1 into a var.
12527 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12528
12959e8e
PE
12529 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12530
836d29b3
DA
125312012-05-10 Dave Abrahams <dave@boostpro.com>
12532
12533 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12534 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12535
5cb67954
MA
125362012-05-09 Michael Albinus <michael.albinus@gmx.de>
12537
12538 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 12539 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
12540 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12541 Initialize xd_registered_buses.
12542
3478ec45
PE
125432012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12544
b263a6b0
PE
12545 Untag more efficiently if USE_LSB_TAG.
12546 This is based on a proposal by YAMAMOTO Mitsuharu in
12547 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12548 For an admittedly artificial (nth 8000 longlist) benchmark on
12549 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12550 Emacs's overall text size by 1%.
12551 * lisp.h (XUNTAG): New macro.
12552 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12553 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12554 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12555 * eval.c (Fautoload):
12556 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12557 * frame.h (XFRAME): Use XUNTAG.
12558
3478ec45
PE
12559 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12560 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12561 Remove unportable assumptions about print widths of types like
12562 dbus_uint32_t.
12563 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12564 intptr_t when converting between pointer and integer, to avoid GCC
12565 warnings about wrong width.
12566
666b903b 125672012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
12568
12569 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12570 stack for each reader_thread, instead of defaulting to 8MB
12571 determined by the linker. This avoids failures in creating
12572 subprocesses on Windows 7, see the discussion in this thread:
12573 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12574
b120cc17
JC
125752012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12576
12577 Fix up display of the *Minibuf-0* buffer in the mini window.
12578 * keyboard.c (read_char): Don't clear the echo area if there's no
12579 message to clear.
12580 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 12581 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 12582
9a4b36f8
MA
125832012-05-07 Michael Albinus <michael.albinus@gmx.de>
12584
12585 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12586 batch mode.
12587
e5f9458f
CY
125882012-05-06 Chong Yidong <cyd@gnu.org>
12589
12590 * lisp.mk (lisp): Update.
12591
eceeb5fc 125922012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
12593
12594 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12595
71873e2b
SM
125962012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12597
12598 * data.c (PUT_ERROR): New macro.
12599 (syms_of_data): Use it. Add new error type `user-error'.
12600 * undo.c (user_error): New function.
12601 (Fprimitive_undo): Use it.
12602 * print.c (print_error_message): Adjust print style for `user-error'.
12603 * keyboard.c (user_error): New function.
12604 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12605
ab0fa4e4
PE
126062012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12607
12608 Do not limit current-time-string to years 1000..9999.
12609 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12610 (Fcurrent_time_string): Support any year that is supported by the
12611 underlying localtime representation. Don't use asctime, as it
12612 has undefined behavior for years outside the range -999..9999.
12613
7ed806a7
PE
126142012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12615
12616 Fix race conditions involving setenv, gmtime, localtime, asctime.
12617 Without this fix, interrupts could mess up code that uses these
12618 nonreentrant functions, since setting TZ invalidates existing
12619 tm_zone or tzname values, and since most of these functions return
12620 pointers to static storage.
12621 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12622 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12623 Grow the critical sections to include not just invoking
12624 localtime/gmtime, but also accessing these functions' results
12625 including their tm_zone values if any, and any related TZ setting.
12626 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
12627 so that the struct tm is saved in the critical section.
12628 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
12629 motivated by the fact that memory allocation needs to be outside
12630 the critical section.
12631
0c16dfed
DA
126322012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12633
12634 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12635 with RESET_INTERVAL.
12636
12637 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12638 Remove duplicated buffer name initialization.
12639
3f83ace8
JM
126402012-05-02 Jim Meyering <jim@meyering.net>
12641
12642 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12643
c7b8541e
JM
12644 * xfns.c (x_window): Use xstrdup (Bug#11375).
12645
90207a15 126462012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
12647
12648 * xdisp.c (pos_visible_p): If already at a newline from the
12649 display string before the 'while' loop, don't walk back the glyphs
12650 from it3.glyph_row. Solves assertion violation when the display
12651 string begins with a newline (egg.el). (Bug#11367)
12652
b593d6a9
AH
126532012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12654
12655 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12656 Move to simple.el.
12657
4737362e
GM
126582012-05-01 Glenn Morris <rgm@gnu.org>
12659
99cf43f9
GM
12660 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12661 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12662 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12663 All were removed before 23.1.
12664
9311dcff
GM
12665 * dispnew.c: Remove HAVE_LIBNCURSES test;
12666 it is always true on relevant platforms.
12667
4d5c6349
GM
12668 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12669 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12670
4737362e
GM
12671 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12672
74dd3a6b
AS
126732012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12674
12675 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12676 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12677 Remove.
12678
13c379ee
PE
126792012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12680
12681 Do not avoid creating empty evaporating overlays (Bug#9642).
12682 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12683 That is, do not delete an evaporating overlay if it becomes
12684 empty after its bounds are adjusted to fit within its buffer.
12685 This fix caused other problems, and I'm reverting it until we get
12686 to the bottom of them.
12687
a8e7d6d7 126882012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
12689
12690 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12691
a8e7d6d7 126922012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
12693
12694 * xdisp.c (pos_visible_p): If the window start position is beyond
12695 ZV, start the display from buffer beginning. Prevents assertion
12696 violation in init_iterator when the minibuffer window is scrolled
12697 via the scroll bar.
12698
12699 * window.c (window_scroll_pixel_based): Likewise.
12700
a8e7d6d7 127012012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
12702
12703 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12704
a8e7d6d7 127052012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
12706
12707 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12708 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12709
a8e7d6d7 127102012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 12711
b593d6a9
AH
12712 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12713 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 12714
1c6900d9
EZ
127152012-04-26 Eli Zaretskii <eliz@gnu.org>
12716
4c3fa1d9
EZ
12717 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12718 display element, check also the underlying string or buffer
12719 character. (Bug#11341)
12720
1c6900d9
EZ
12721 * w32menu.c: Include w32heap.h.
12722 (add_menu_item): If the call to AppendMenuW (via
12723 unicode_append_menu) fails, disable Unicode menus only if we are
12724 running on Windows 9X/Me.
12725
42bf8205
AS
127262012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12727
12728 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12729 (xgetint): Add missing shift for LSB tags.
12730
b1bac16e
MR
127312012-04-24 Martin Rudalics <rudalics@gmx.at>
12732
12733 * keyboard.c (read_char): Don't wipe echo area for select window
12734 events: These might get delayed via `mouse-autoselect-window'
12735 (Bug#11304).
12736
d69621cc
JB
127372012-04-24 Juanma Barranquero <lekktu@gmail.com>
12738
12739 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12740 manipulation of :loaded-from data.
12741
02fd101b
JB
127422012-04-23 Juanma Barranquero <lekktu@gmail.com>
12743
12744 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12745 now a cons (bug#11311).
12746
888bec30
PE
127472012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12748
89a438bd
PE
12749 Do not create empty overlays with the evaporate property (Bug#9642).
12750 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12751 if it becomes empty after its bounds are adjusted to fit within
12752 its buffer. Without this fix, in a nonempty buffer (let ((o
12753 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12754 yields an empty overlay that has the evaporate property, which is
12755 not supposed to happen.
12756
1068fe4d
PE
12757 Fix minor GTK3 problems found by static checking.
12758 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12759 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12760 (struct _EmacsFixedClass, emacs_fixed_get_type):
12761 Move decls here from emacsgtkfixed.h, since they needn't be public.
12762 (emacs_fixed_get_type): Now static.
12763 (emacs_fixed_class_init): Omit unused local.
12764 (emacs_fixed_child_type): Remove; unused.
12765 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12766 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12767 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12768 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12769 (EMACS_FIXED_GET_CLASS): Remove; unused.
12770 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12771
888bec30
PE
12772 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12773 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12774
de85e130
PE
127752012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12776
d0baac98 12777 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 12778 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
12779 (__malloc_size_t, __malloc_ptrdiff_t):
12780 Remove. All uses removed, replaced by the definiens if needed,
12781 since we can assume C89 or better now.
12782 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12783 (protect_malloc_state, align, get_contiguous_space)
12784 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12785 (malloc_atfork_handler_child, malloc_enable_thread)
12786 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12787 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12788 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12789 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12790 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12791 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12792 Define using prototypes, not old style.
12793 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12794 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12795 (align): Don't assume that signed integer overflow wraps around.
12796 Omit unused local var.
12797 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12798 (_free_internal_nolock, memalign, mallochook, reallochook):
12799 Omit no-longer-needed casts.
12800 (valloc): Use getpagesize, not __getpagesize.
12801 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12802 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12803
de85e130
PE
12804 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12805
dcbf5805
MA
128062012-04-22 Michael Albinus <michael.albinus@gmx.de>
12807
12808 Move functions from C to Lisp. Make non-blocking method calls
12809 the default. Implement further D-Bus standard interfaces.
12810
12811 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12812 (QCdbus_request_name_allow_replacement)
12813 (QCdbus_request_name_replace_existing)
12814 (QCdbus_request_name_do_not_queue)
12815 (QCdbus_request_name_reply_primary_owner)
12816 (QCdbus_request_name_reply_in_queue)
12817 (QCdbus_request_name_reply_exists)
12818 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12819 (QCdbus_registered_serial, QCdbus_registered_method)
12820 (QCdbus_registered_signal): New Lisp objects.
12821 (XD_DEBUG_MESSAGE): Use sizeof.
12822 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12823 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12824 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12825 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12826 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12827 (xd_signature, xd_append_arg): Allow float for integer types.
12828 (xd_get_connection_references): New function.
b593d6a9
AH
12829 (xd_get_connection_address): Rename from xd_initialize.
12830 Return cached address.
dcbf5805
MA
12831 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12832 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12833 level.
12834 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 12835 Return number of refcounts.
dcbf5805
MA
12836 (Fdbus_get_unique_name): Make stronger parameter check.
12837 (Fdbus_message_internal): New defun.
12838 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12839 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12840 (Fdbus_send_signal, Fdbus_register_service)
12841 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12842 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12843 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12844 (Vdbus_compiled_version, Vdbus_runtime_version)
12845 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12846 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12847 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
12848 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12849 Adapt docstring.
dcbf5805 12850
52828e02
PE
128512012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12852
da05bc4c
PE
12853 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12854 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12855 Do not assume ptrdiff_t is the same width as 'int'.
12856
52828e02
PE
12857 * alloc.c: Handle unusual debugging option combinations.
12858 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12859 since the two debugging options are incompatible.
12860 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12861 is defined.
12862 (mem_init, mem_insert, mem_insert_fixup):
12863 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12864 (NEED_MEM_INSERT): Remove; no longer needed.
12865
f01769f9
LL
128662012-04-22 Leo Liu <sdl.web@gmail.com>
12867
12868 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12869
5790543d
PE
128702012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12871
12872 * sysdep.c [__FreeBSD__]: Minor cleanups.
12873 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12874 Use Emacs indenting style more consistently. Avoid some casts.
12875 Use 'double' consistently rather than mixing 'float' and 'double'.
12876
b91b7e4d
EW
128772012-04-21 Eduard Wiebe <usenet@pusto.de>
12878
b593d6a9
AH
12879 * sysdep.c (list_system_processes, system_process_attributes):
12880 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 12881
6114eb15
AS
128822012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12883
12884 * lisp.mk (lisp): Update.
12885
2f38dff7
PE
128862012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12887
12888 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12889 It is never used otherwise.
12890
4ae29f89
SM
128912012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12892
12893 * print.c (print_preprocess): Only check print_depth if print-circle
12894 is nil.
12895 (print_object): Check for cycles even when print-circle is nil and
12896 print-gensym is t, but only check print_depth if print-circle is nil.
12897
f30d612a
CY
128982012-04-20 Chong Yidong <cyd@gnu.org>
12899
12900 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12901 set the status to "failed" and ensure that sentinel is run.
12902
c07a4c0b 129032012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
12904
12905 * process.c (Fset_process_inherit_coding_system_flag)
12906 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 12907 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 12908
c07a4c0b 129092012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
12910
12911 * xdisp.c (string_buffer_position_lim): Limit starting position to
12912 BEGV.
12913 (set_cursor_from_row): If called for a mode-line or header-line
12914 row, return zero immediately.
12915 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
12916 farther than the first row after the header line, if any.
12917 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
12918 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12919
c07a4c0b 129202012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12921
4ae29f89
SM
12922 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12923 (bug#11238).
ad3a2b41 12924
c07a4c0b 129252012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 129262012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
12927
12928 configure: new option --enable-gcc-warnings (Bug#11207)
12929 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12930 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12931 (ALL_CFLAGS): Use new macros rather than old.
12932 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12933 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12934 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12935 -Wunused-result, -Wunused-variable. This should go away once
12936 the Emacs and Gnulib regex code is merged.
12937 (xmalloc, xrealloc): Now static.
12938
aba027e8
PE
129392012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12940
12941 * dired.c (Fsystem_groups): Remove unused local.
12942
e5a36063
GM
129432012-04-17 Glenn Morris <rgm@gnu.org>
12944
12945 * dired.c (Fsystem_users): Doc fix.
12946
316411f0
DA
129472012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12948
12949 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12950 (syms_of_dired): Add them.
12951
9426aba4
PE
129522012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12953
b62a57be
PE
12954 Fix minor alloc.c problems found by static checking.
12955 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12956 New extern decls, to avoid calling undeclared functions.
12957 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12958 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12959 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12960 (NEED_MEM_INSERT): New macro.
12961 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 12962 Remove one incorrect comment and fix another.
b62a57be 12963
3539f31f
PE
12964 Fix minor ralloc.c problems found by static checking.
12965 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12966 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12967 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12968 (r_alloc_sbrk): Now static.
12969
a041960a
PE
12970 Improve ralloc.c interface checking.
12971 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12972 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12973 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12974 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12975 [REL_ALLOC]: ... to here, to check interface.
12976 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12977 Remove decls. This fixes an "It stinks!".
12978
9426aba4
PE
12979 * alloc.c (which_symbols): Fix alignment issue / type clash.
12980
d55c12ed
AS
129812012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12982
12983 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12984 (struct Lisp_Misc_Any): Likewise.
12985 (struct Lisp_Free): Likewise.
12986 * alloc.c (union aligned_Lisp_Symbol): Define.
12987 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12988 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12989 (union aligned_Lisp_Misc): Define.
12990 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12991 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 12992 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 12993
b948ce8b
PE
129942012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12995
12996 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12997 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12998 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12999 * s/netbsd.h, s/sol2-6.h:
13000 Remove definition of GC_MARK_STACK, since the default now works.
13001 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13002 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13003 no longer the default.
13004 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13005
35dc09a1 130062012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13007
35dc09a1
GM
13008 * lread.c (lisp_file_lexically_bound_p):
13009 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 13010
35dc09a1
GM
130112012-04-14 Eli Zaretskii <eliz@gnu.org>
13012
13013 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13014 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13015
130162012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13017
13018 * nsterm.m (constrainFrameRect): Always constrain when there is only
13019 one screen (Bug#10962).
13020
bcd86815
KB
130212012-04-13 Ken Brown <kbrown@cornell.edu>
13022
13023 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13024
c25df26e
RT
130252012-04-13 Reuben Thomas <rrt@sc3d.org>
13026
13027 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13028
0fc59f1e
DC
130292012-04-11 Daniel Colascione <dancol@dancol.org>
13030
13031 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13032 against is gone. It's better to use vfork now so that when Cygwin
13033 gains a new, working vfork, we use it automatically (bug#10398).
13034
de8c03dc
SM
130352012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13036
13037 * window.c (save_window_save): Obey window-point-insertion-type.
13038
2f097256
GM
130392012-04-11 Glenn Morris <rgm@gnu.org>
13040
13041 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13042
453b951e
SM
130432012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13044
13045 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13046
75f1671a 130472012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
13048
13049 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13050 (force_quit_count): New var.
13051 (handle_interrupt): Use it.
13052
2a8ce227
JB
130532012-04-10 Juanma Barranquero <lekktu@gmail.com>
13054
13055 * w32.c (w32_delayed_load): Record the full path of the library
13056 being loaded (bug#10424).
13057
935396c0
GM
130582012-04-09 Glenn Morris <rgm@gnu.org>
13059
05920a43
GM
13060 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13061 not just in the obarray, before snarfing them. (Bug#11036)
13062
935396c0
GM
13063 * Makefile.in ($(leimdir)/leim-list.el):
13064 Pass EMACS rather than BUILT_EMACS.
13065
a18ecafa
TZ
130662012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13067
13068 * process.c (make_process):
13069 * process.h: Add integer `gnutls_handshakes_tried' member to
13070 process struct.
13071
6bbef4e5
JC
13072 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13073 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
13074
13075 * gnutls.c (gnutls_log_function2i): Convenience log function.
13076 (emacs_gnutls_read): Use new log functions,
13077 `gnutls_handshakes_tried' process member, and
13078 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13079 attempts per process (connection).
13080
b4d3bc10
CY
130812012-04-09 Chong Yidong <cyd@gnu.org>
13082
13083 * eval.c (Fuser_variable_p, user_variable_p_eh)
13084 (lisp_indirect_variable): Functions deleted.
13085 (Fdefvar): Caller changed.
13086
13087 * callint.c (Finteractive, Fcall_interactively):
13088 * minibuf.c (Fread_variable): Callers changed.
13089
70f4d973
EZ
130902012-04-09 Eli Zaretskii <eliz@gnu.org>
13091
13092 * xdisp.c (set_cursor_from_row): If the display string appears in
13093 the buffer at position that is closer to point than the position
13094 after the display string, display the cursor on the first glyph of
13095 the display string. Fixes cursor display when a 'display' text
13096 property immediately follows invisible text. (Bug#11094)
13097
cb3c2e3e
PE
130982012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13099
13100 composite.c: use 'double' consistently
13101 * composite.c (get_composition_id): Use 'double' consistently
13102 instead of converting 'float' to 'double' and vice versa; this is
13103 easier to understand and avoids a GCC warning.
13104
fd06db5d
GM
131052012-04-09 Glenn Morris <rgm@gnu.org>
13106
50fe702a
GM
13107 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13108 preparation for dumping it with emacs. (Bug#4789)
13109 (leimdir): New variable.
13110 ($(leimdir)/leim-list.el): New rule.
13111 (emacs$(EXEEXT)): Depend on leim-list.el.
13112
fd06db5d
GM
13113 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13114 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13115 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13116
55c131ee
AS
131172012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13118
13119 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13120 proper alignment.
13121
9209588f
JB
131222012-04-07 Juanma Barranquero <lekktu@gmail.com>
13123
13124 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13125 Remove unused local variable.
13126
e3fb2efb
PE
131272012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13128
13129 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13130 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13131 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13132 objects, as mark_maybe_pointer will catch them otherwise.
13133 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13134 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13135
b5385551
PE
131362012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13137
13138 Fix typo that broke non-Windows builds.
13139 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13140
9078ead6
EZ
131412012-04-07 Eli Zaretskii <eliz@gnu.org>
13142
13143 Support building on MS-Windows with libxml2.
13144
13145 * makefile.w32-in (OBJ2): Add xml.$(O).
13146 (GLOBAL_SOURCES): Add xml.c.
13147 ($(BLD)/xml.$(O)): New dependency list.
13148
13149 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13150 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13151 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13152 [!WINDOWSNT]: New macros.
13153 (init_libxml2_functions, libxml2_loaded_p): New functions.
13154 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13155 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13156 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13157 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13158 linked in).
6bbef4e5
JC
13159 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13160 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
13161 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13162
13163 * emacs.c: Don't include libxml/parser.h.
13164 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13165 xmlCleanupParser directly.
13166
13167 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13168
3811fdf3
EZ
131692012-04-07 Eli Zaretskii <eliz@gnu.org>
13170
13171 * indent.c (Fvertical_motion): If there is a display string at
13172 point, use it.vpos to compute how many lines to backtrack after
13173 move_it_to point. (Bug#11133)
13174
2f8e16b2
EZ
131752012-04-06 Eli Zaretskii <eliz@gnu.org>
13176
13177 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13178 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13179 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13180 macros related to unification of CJK characters. For the details,
13181 see the discussion following the message here:
13182 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13183
3d439cd1
CY
131842012-04-04 Chong Yidong <cyd@gnu.org>
13185
13186 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13187
8bc53d00
EZ
131882012-04-01 Eli Zaretskii <eliz@gnu.org>
13189
13190 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13191 instead of alloca. (Bug#11138)
13192
3b0512a3
AS
131932012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13194
13195 * w32menu.c (is_simple_dialog): Properly check lisp types.
13196 (Bug#11141)
13197
8427ddd2
EZ
131982012-03-31 Eli Zaretskii <eliz@gnu.org>
13199
979022ef
EZ
13200 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13201 position we get to after a call to move_it_to fails the
13202 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13203 only if we wind up in a string from display property. (Bug#11063)
13204
a6b1c7cc
EZ
13205 * window.c (Fdelete_other_windows_internal): Invalidate the row
13206 and column information about mouse highlight, so that redisplay
13207 restores it after reallocating the glyph matrices. (Bug#7464)
13208
8427ddd2
EZ
13209 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13210 string comes from a `display' text property, use the buffer
13211 position of that property as if we actually saw that position in
13212 the row's glyphs.
697ba24b
EZ
13213 (move_it_by_lines): Remove the assertion that
13214 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13215 violated when there's a before-string at the beginning of a line.
13216 (Bug#11063)
8427ddd2 13217
65a0a738
EZ
132182012-03-30 Eli Zaretskii <eliz@gnu.org>
13219
13220 * xdisp.c (append_space_for_newline): If the default face was
13221 remapped, use the remapped face for the appended newline.
13222 (extend_face_to_end_of_line): Use the remapped default face for
13223 extending the face to the end of the line.
13224 (display_line): Call extend_face_to_end_of_line when the default
13225 face was remapped. (Bug#11068)
13226
581355cc
EZ
132272012-03-29 Eli Zaretskii <eliz@gnu.org>
13228
13229 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13230
e8fc049f
SM
132312012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13232
13233 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13234
4fb9a543
GM
132352012-03-27 Glenn Morris <rgm@gnu.org>
13236
13237 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13238 Doc fixes.
13239
679910f1
KH
132402012-03-26 Kenichi Handa <handa@m17n.org>
13241
13242 * dispextern.h (struct glyph): Fix previous change. Change the
13243 bit length of glyphless.ch to 25 (Bug#11082).
13244
90d49b7f
CY
132452012-03-26 Chong Yidong <cyd@gnu.org>
13246
13247 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13248 (command_loop_1): Use it; inhibit selection update for
13249 handle-select-window too (Bug#8996).
13250
f514f6f0
FP
132512012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13252
e8fc049f 13253 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 13254
bf43fa51
KH
132552012-03-25 Kenichi Handa <handa@m17n.org>
13256
13257 * dispextern.h (struct glyph): Change the bit length of
13258 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13259
8a0c01dd
EZ
132602012-03-24 Eli Zaretskii <eliz@gnu.org>
13261
13262 * s/ms-w32.h (tzname): Include time.h before redirecting to
13263 _tzname. Fixes the MSVC build. (Bug#9960)
13264
7d1c3a76
AS
132652012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13266
8ed79523
AS
13267 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13268 characters.
13269
7d1c3a76
AS
13270 * xterm.c (XTread_socket): Only modify handling_signal if
13271 !SYNC_INPUT. (Bug#11080)
13272
e99a9b8b
EZ
132732012-03-23 Eli Zaretskii <eliz@gnu.org>
13274
13275 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13276 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13277 when fetching a multibyte character consumes more bytes than
13278 CHAR_BYTES returns, due to unification of CJK characters in
13279 string_char. (Bug#11073)
13280
5063c0e1
TN
132812012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13282
13283 * process.c (wait_reading_process_output): Handle pty disconnect
13284 by refraining from sending oneself a SIGCHLD (bug#10933).
13285
9f851fbd
CY
132862012-03-22 Chong Yidong <cyd@gnu.org>
13287
13288 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13289
5063c0e1 13290 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
13291 Mark string as coming from a prefix property.
13292 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13293 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13294
fb5b8aca
CY
132952012-03-21 Chong Yidong <cyd@gnu.org>
13296
13297 * xfaces.c (Vface_remapping_alist): Doc fix.
13298
62356a1b
EZ
132992012-03-20 Eli Zaretskii <eliz@gnu.org>
13300
13301 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
13302 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13303 Doc fixes.
62356a1b 13304
025de85b
CY
133052012-03-20 Chong Yidong <cyd@gnu.org>
13306
13307 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13308 to reflect default non-nil value of redisplay-dont-pause.
13309
4827f94e
KH
133102012-03-19 Kenichi Handa <handa@m17n.org>
13311
13312 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13313 it fit in a valid range (Bug#11003).
13314
e50a24a2
EZ
133152012-03-18 Eli Zaretskii <eliz@gnu.org>
13316
13317 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13318 that is not from display property, accept the row as a "cursor
13319 row" if one of the string's character has a non-nil `cursor'
13320 property. Fixes cursor positioning when there are newlines in
13321 overlay strings, e.g. in icomplete.el. (Bug#11035)
13322
9af5ed87
PE
133232012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13324
13325 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13326
d1f55f16
CY
133272012-03-12 Chong Yidong <cyd@gnu.org>
13328
13329 * eval.c (inhibit_lisp_code): Rename from
13330 inhibit_window_configuration_change_hook; move from window.c.
13331
13332 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13333 * window.c (run_window_configuration_change_hook)
13334 (syms_of_window): Callers changed.
13335
66c5eebd
CY
133362012-03-11 Chong Yidong <cyd@gnu.org>
13337
413df973
CY
13338 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13339
66c5eebd
CY
13340 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13341
1de11f56
CY
133422012-03-10 Chong Yidong <cyd@gnu.org>
13343
13344 * frame.c (other_visible_frames): Don't assume the selected frame
13345 is visible (Bug#10955).
13346
cae07000
SM
133472012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13348
13349 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13350
89c94350
JD
133512012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13352
13353 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13354 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13355 zero (Bug#10954).
13356
999dd333
GM
133572012-03-03 Glenn Morris <rgm@gnu.org>
13358
01a6dcc8 13359 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 13360
de0100f2
EZ
133612012-03-02 Eli Zaretskii <eliz@gnu.org>
13362
13363 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13364 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
13365 (redisplay_window, next_element_from_string): Fix typos in
13366 comments.
3e441275
EZ
13367 (redisplay_window): Pass to move_it_vertically the margin in
13368 pixels, not in screen lines.
de0100f2 13369
96a72ee9
GM
133702012-03-02 Glenn Morris <rgm@gnu.org>
13371
13372 * buffer.c (buffer-list-update-hook): Doc fix.
13373
312508d7
EZ
133742012-02-29 Eli Zaretskii <eliz@gnu.org>
13375
13376 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13377 push_it before setting up the iterator for the first overlay
13378 string, even if we have an empty string loaded.
13379 (next_overlay_string): If there's an empty string on the iterator
13380 stack, pop the stack. (Bug#10903)
13381
27f3c637
PE
133822012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13383
13384 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13385 Suggested by Stefan Monnier in
13386 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13387 * alloc.c (widen_to_Lisp_Object): New static function.
13388 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13389 and widening them to Lisp_Objects. This would work even if
13390 USE_LSB_TAG is defined and wide integers are used, which might
13391 happen in a future version of Emacs.
13392
3c9dfce6
CY
133932012-02-25 Chong Yidong <cyd@gnu.org>
13394
fa74b241
CY
13395 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13396 Doc fix.
13397
3c9dfce6
CY
13398 * xselect.c (Fx_selection_exists_p): Doc fix.
13399 (x_clipboard_manager_save_all): Print an informative message
13400 before saving to clipboard manager.
13401
9486df08
CY
134022012-02-24 Chong Yidong <cyd@gnu.org>
13403
13404 * keyboard.c (process_special_events): Handle all X selection
13405 requests in kbd_buffer, not just the next one (Bug#8869).
13406
f01d3321
CY
134072012-02-23 Chong Yidong <cyd@gnu.org>
13408
13409 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13410 call when setting menu-bar-lines and tool-bar-lines parameters.
13411 (unwind_create_frame_1): New helper function.
13412
13413 * window.c (inhibit_window_configuration_change_hook): New var.
13414 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 13415 (syms_of_window): Initialize it.
f01d3321 13416
86b847b6
CY
134172012-02-22 Chong Yidong <cyd@gnu.org>
13418
13419 * xterm.c (x_draw_image_relief): Add missing type check for
13420 Vtool_bar_button_margin (Bug#10743).
13421
a59225b1
CY
134222012-02-21 Chong Yidong <cyd@gnu.org>
13423
13424 * fileio.c (Vfile_name_handler_alist): Doc fix.
13425
13426 * buffer.c (Fget_file_buffer): Protect against invalid file
13427 handler return value.
13428
310f5bd4
PE
134292012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13430
cb3a28cc
PE
13431 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13432 when computing $valmask.
13433
310f5bd4
PE
13434 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13435 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13436 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13437 It's useless in that case, and it can cause problems on hosts
13438 that allocate halves of EMACS_INT values separately.
13439 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13440 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13441 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13442 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13443 it avoids undefined behavior on hosts where shifting right by more
13444 than the word width has undefined behavior.
13445
2375c96a
CY
134462012-02-19 Chong Yidong <cyd@gnu.org>
13447
13448 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13449 (Funhandled_file_name_directory, Ffile_name_as_directory)
13450 (Fdirectory_file_name, Fexpand_file_name)
13451 (Fsubstitute_in_file_name): Protect against invalid file handler
13452 return values (Bug#10845).
13453
3eb49e71
EZ
134542012-02-18 Eli Zaretskii <eliz@gnu.org>
13455
13456 * .gdbinit (pitx): Fix incorrect references to fields of the
13457 iterator stack.
13458
7b926f3f
CY
134592012-02-17 Chong Yidong <cyd@gnu.org>
13460
13461 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13462
11273115
PE
134632012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13464
13465 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13466 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13467
c3a70e2b
CY
134682012-02-15 Chong Yidong <cyd@gnu.org>
13469
13470 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13471 marked as special. Also, starting docstrings with * is obsolete.
13472
0ca43699
AS
134732012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13474
13475 * gnutls.c (emacs_gnutls_write): Fix last change.
13476
2e8f3c56
LI
134772012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13478
13479 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13480 send_process.
13481
af70074f
SM
134822012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13483
13484 * keymap.c (Fsingle_key_description): Handle char ranges.
13485
95986d52
CY
134862012-02-12 Chong Yidong <cyd@gnu.org>
13487
afd83bd1
CY
13488 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13489 as that creates a dangerous corner case.
13490
95986d52
CY
13491 * window.c (Fdelete_window_internal): Invalidate the mouse
13492 highlight (Bug#9904).
13493
bd7da63e
GM
134942012-02-12 Glenn Morris <rgm@gnu.org>
13495
13496 * xselect.c (Fx_own_selection_internal)
13497 (Fx_get_selection_internal, Fx_disown_selection_internal)
13498 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13499 * nsselect.m (Fx_own_selection_internal)
13500 (Fx_disown_selection_internal, Fx_selection_exists_p)
13501 (Fx_selection_owner_p, Fx_get_selection_internal):
13502 Sync docs and argument specs with the xselect.c versions.
13503
77abcbc2
LI
135042012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13505
13506 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13507
90b671e2
EZ
135082012-02-11 Eli Zaretskii <eliz@gnu.org>
13509
1c0ca0b7
EZ
13510 * w32select.c (Fx_selection_exists_p): Sync doc string and
13511 argument list with xselect.c. (Bug#10783)
13512
13513 * w16select.c (Fx_selection_exists_p): Sync doc string and
13514 argument list with xselect.c. (Bug#10783)
90b671e2 13515
49241268
GM
135162012-02-10 Glenn Morris <rgm@gnu.org>
13517
13518 * fns.c (Fsecure_hash): Doc fix.
13519
f998bbe7 135202012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
13521
13522 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13523
0992bd9c
CY
135242012-02-07 Chong Yidong <cyd@gnu.org>
13525
13526 * buffer.c (Fbuffer_local_variables)
13527 (buffer_lisp_local_variables): Handle unbound vars correctly;
13528 don't let Qunbound leak into Lisp.
13529
af008560
GM
135302012-02-07 Glenn Morris <rgm@gnu.org>
13531
dd605cc4
GM
13532 * image.c (Fimagemagick_types): Doc fix.
13533
af008560
GM
13534 * image.c (imagemagick-render-type): Change it from a lisp object
13535 to an integer. Move the doc here from the lisp manual.
13536 Treat all values not equal to 0 the same.
13537
1449fa1d
CY
135382012-02-06 Chong Yidong <cyd@gnu.org>
13539
13540 * doc.c (store_function_docstring): Avoid applying docstring of
13541 alias to base function (Bug#2603).
13542
3723ec07
AS
135432012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13544
13545 * .gdbinit (pp1, pv1): Remove redundant defines.
13546 (pr): Use pp.
13547
79c1cc1e
CY
135482012-02-04 Chong Yidong <cyd@gnu.org>
13549
13550 * nsterm.m: Declare a global (Bug#10694).
13551
d7f29f8e
EZ
135522012-02-04 Eli Zaretskii <eliz@gnu.org>
13553
cae07000
SM
13554 * w32.c (get_emacs_configuration_options):
13555 Include --enable-checking, if specified, in the return value.
d7f29f8e 13556
3b95a6f9
MR
135572012-02-04 Martin Rudalics <rudalics@gmx.at>
13558
13559 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13560 after rounding frame sizes. (Bug#9723)
13561
d6fa96a6
EZ
135622012-02-04 Eli Zaretskii <eliz@gnu.org>
13563
13564 * keyboard.c (adjust_point_for_property): Don't position point
13565 before BEGV. (Bug#10696)
13566
df0b2940
PE
135672012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13568
13569 Handle overflow when computing char display width (Bug#9496).
13570 * character.c (char_width): Return EMACS_INT, not int.
13571 (char_width, c_string_width): Check for overflow when
13572 computing the width; this is possible now that individual
13573 characters can have unbounded width. Problem introduced
13574 by merge from Emacs 23 on 2012-01-19.
13575
6bee44d6
MA
135762012-02-02 Michael Albinus <michael.albinus@gmx.de>
13577
13578 * dbusbind.c (Fdbus_register_method): Mention the return value
13579 :ignore in the docstring.
13580
44f92739
GM
135812012-02-02 Glenn Morris <rgm@gnu.org>
13582
1b9f60cc
GM
13583 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13584
44f92739
GM
13585 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13586 Unconditionally set to t. (Bug#10673)
13587 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13588 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13589 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13590
c5d3843c
KH
135912012-02-02 Kenichi Handa <handa@m17n.org>
13592
13593 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13594 0, do not call append_composite_glyph.
13595
159462d4 135962012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
13597
13598 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13599 NULL (Bug#6988).
13600 (x_produce_glyphs): If the component of a composition is a null
13601 string, set it->pixel_width to 1 to avoid zero-width glyph.
13602
78cef877
EZ
136032012-02-01 Eli Zaretskii <eliz@gnu.org>
13604
13605 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13606 first 2 arguments are identical. This makes inserting large
13607 output from a subprocess an order of magnitude faster on
13608 MS-Windows, where all sbrk'ed memory is always contiguous.
13609
97897668
GM
136102012-01-31 Glenn Morris <rgm@gnu.org>
13611
13612 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 13613 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
13614 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13615
31fd3586
GM
136162012-01-29 Glenn Morris <rgm@gnu.org>
13617
13618 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13619
0e24a8b2
CY
136202012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13621
13622 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13623
cc0adcb0
CY
136242012-01-28 Chong Yidong <cyd@gnu.org>
13625
13626 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13627
acc28cb9
CY
136282012-01-26 Chong Yidong <cyd@gnu.org>
13629
9c69cfb7
CY
13630 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13631
acc28cb9
CY
13632 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13633 repeat counts (Bug#10507).
13634
48da7392
GM
136352012-01-26 Glenn Morris <rgm@gnu.org>
13636
13637 * lread.c (syms_of_lread): Doc fix.
13638
14af5f7f
CY
136392012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13640
13641 * coding.c (encode_designation_at_bol): Change return value to
13642 EMACS_INT.
13643
0b21c100
CY
136442012-01-25 Chong Yidong <cyd@gnu.org>
13645
13646 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13647
3c2907f7
CY
136482012-01-21 Chong Yidong <cyd@gnu.org>
13649
13650 * floatfns.c (Fcopysign): Make the second argument non-optional,
13651 since nil is not allowed anyway.
13652
959ad23f
AS
136532012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13654
13655 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13656 (send_process): Likewise.
13657
34a02f46
MR
136582012-01-19 Martin Rudalics <rudalics@gmx.at>
13659
13660 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
13661 (Vwindow_persistent_parameters): Do not use Qstate.
13662 Rewrite doc-strings.
34a02f46 13663
1259009a 136642012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
13665
13666 * character.c (char_width): New function.
70d4fdf6
GM
13667 (Fchar_width, c_string_width, lisp_string_width):
13668 Use char_width (Bug#9496).
25ed9e61 13669
6a6ee00d
MR
136702012-01-16 Martin Rudalics <rudalics@gmx.at>
13671
13672 * window.c (Vwindow_persistent_parameters): New variable.
13673 (Fset_window_configuration, save_window_save): Handle persistent
13674 window parameters.
13675
c85efaf7
EZ
136762012-01-14 Eli Zaretskii <eliz@gnu.org>
13677
13678 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13679 thrashing the stack of the thread. (Bug#9087)
13680
5944709e
PE
136812012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13682
13683 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13684
e71f5d99
EZ
136852012-01-11 Eli Zaretskii <eliz@gnu.org>
13686
13687 * xdisp.c (rows_from_pos_range): Handle the case where the
13688 highlight ends on a newline. (Bug#10464)
13689 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13690 he end column for display of highlight that ends on a newline
13691 before a R2L line.
13692
ce316182
GM
136932012-01-11 Glenn Morris <rgm@gnu.org>
13694
13695 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13696 from load-path also when installation-directory is nil. (Bug#10208)
13697
5b43da69
GM
136982012-01-10 Glenn Morris <rgm@gnu.org>
13699
74cc8ff9
GM
13700 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13701
7d8d6e4e
GM
13702 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13703 Update template values to be closer to their typical values these days.
5b43da69 13704
a0db8d43
EZ
137052012-01-09 Eli Zaretskii <eliz@gnu.org>
13706
13707 * xdisp.c (rows_from_pos_range): Accept additional argument
13708 DISP_STRING, and accept any glyph in a row whose object is that
13709 string as eligible for mouse highlight. Fixes mouse highlight of
13710 display strings from overlays. (Bug#10464)
13711
9a0115ab 137122012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 13713
b9110d6a 13714 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
13715 * fileio.c (auto_saving_dir_umask): New static var.
13716 (Fmake_directory_internal): Use it.
13717 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13718 creating the directory. The old code temporarily assigns
13719 too-generous permissions to the directory.
13720 (do_auto_save_eh): Clear it.
b9110d6a 13721 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
13722 that the var is always cleared.
13723
6c1bd3f3
EZ
137242012-01-07 Eli Zaretskii <eliz@gnu.org>
13725
13726 * search.c (scan_buffer): Pass character positions to
13727 know_region_cache, not byte positions. (Bug#6540)
13728
069d2b50
L
137292012-01-07 LynX <_LynX@bk.ru> (tiny change)
13730
13731 * w32.c (sys_rename): Report EXDEV when rename of a directory
13732 fails because the target is on another logical disk. (Bug#10284)
13733
75bf0d33
DB
137342012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13735
13736 * xterm.c (x_embed_request_focus): New function.
13737
13738 * xterm.h: Add prototype.
13739
13740 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13741
1c6e5a32
GM
137422012-01-05 Glenn Morris <rgm@gnu.org>
13743
13744 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13745
651e947e
EZ
137462012-01-01 Eli Zaretskii <eliz@gnu.org>
13747
13748 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13749 Load gnutls_transport_set_lowat only if GnuTLS version is below
13750 2.11.1.
13751 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13752 GnuTLS versions below 2.11.1.
13753
3778cdd8
AL
137542011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13755
13756 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13757 to the doc string advising against its use for altering the way
13758 windows are scrolled.
13759
0e5317f7
KH
137602011-12-28 Kenichi Handa <handa@m17n.org>
13761
13762 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13763 coding-system ASCII compatible only when it does not produce BOM
13764 on encoding (Bug#10383).
13765
93d5ca1f
JD
137662011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13767
13768 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13769 can scroll.
13770 (create_and_show_popup_menu): Always use menu_position_func for
13771 Gtk3 (Bug#10361).
13772
ca22b785
AS
137732011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13774
13775 * callint.c (Fcall_interactively): Don't truncate prompt string.
13776
d048e1e6
EZ
137772011-12-23 Eli Zaretskii <eliz@gnu.org>
13778
13779 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13780 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 13781 resumed from there (after widening). (Bug#10360)
d048e1e6 13782
5ccaba1f
JD
137832011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13784
13785 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13786
204ee57f
JD
137872011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13788
b81d40f0
JB
13789 * nsterm.m (x_free_frame_resources):
13790 Release f->output_data.ns->miniimage.
204ee57f
JD
13791 (ns_index_color): Fix indentation. Do not retain
13792 color_table->colors[i].
13793
13794 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13795 before returning.
13796
13797 * nsfns.m (x_set_background_color): Assign return value from
13798 ns_index_color to face-background instead of NSColor*.
13799 (ns_implicitly_set_icon_type): Fix indentation.
13800 Change assignment in for loop to comparison.
13801
13802 * emacs.c (ns_pool): New variable.
13803 (main): Assign ns_pool.
13804 (Fkill_emacs): Call ns_release_autorelease_pool.
13805
13806 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13807 autorelease fdesc, release fdAttrs and tdict.
13808 (ns_get_covering_families): Release charset.
13809 (ns_findfonts): Release NSFontDescriptor created with new.
13810 (ns_uni_to_glyphs): Fix indentation.
13811 (setString): Release attrStr before assigning new value.
13812
c803b2b7
JD
138132011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13814
678f4426
JD
13815 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13816 and NS_IMPL_COCOA.
13817 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13818 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13819
cd394be1 138202011-12-18 David Reitter <reitter@cmu.edu>
678f4426 13821
5fecd5fc
JD
13822 * nsterm.m (ns_term_init): Subscribe for notifications
13823 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13824 to method trackingNotification in EmacsMenu.
13825
13826 * nsmenu.m (trackingMenu): New variable.
3771cb17 13827 (trackingNotification): New method (from Aquamacs).
5fecd5fc 13828 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 13829 from Aquamacs (Bug#7030).
678f4426
JD
13830
138312011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 13832
c803b2b7
JD
13833 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13834 (symbol_to_nsstring): Fix indentation.
13835 (ns_symbol_to_pb): New function.
cae07000
SM
13836 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13837 (Fns_rotate_cut_buffers_internal): Remove.
13838 (Fns_store_selection_internal): Rename from
c803b2b7
JD
13839 Fns_store_cut_buffer_internal.
13840 (ns_get_foreign_selection, Fx_own_selection_internal)
13841 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
13842 (Fns_get_selection_internal, Fns_store_selection_internal):
13843 Use ns_symbol_to_pb and check if return value is nil.
13844 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13845 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
13846 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13847 renamed to Sns_store_selection_internal.
13848 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13849 and remove this function.
13850 (ns_handle_selection_clear): Remove, never used.
13851 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13852 here.
13853
e1b01a3a
KB
138542011-12-17 Ken Brown <kbrown@cornell.edu>
13855
13856 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13857 GID is unknown (Bug#10257).
13858
2adb6e85
PE
138592011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13860
13861 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13862 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13863 which caused a build failure on GNU/Linux IA-64. This problem was
13864 introduced by my 2011-10-07 patch.
13865
d1d7b339
JL
138662011-12-15 Juri Linkov <juri@jurta.org>
13867
13868 * image.c (imagemagick_error): New function. (Bug#10112)
13869 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13870 Use `imagemagick_error' where ImageMagick functions return
13871 `MagickFalse'.
13872 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13873 proper order.
13874
100d5755
KH
138752011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13876
13877 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13878 fill background (Bug#8992).
13879
454592a6
MR
138802011-12-13 Martin Rudalics <rudalics@gmx.at>
13881
13882 * window.c (Vwindow_combination_resize)
13883 (Vwindow_combination_limit): Use t instead of non-nil in
13884 doc-strings.
61d4b438
MR
13885 (Vrecenter_redisplay): Add first sentence of doc-string on
13886 separate line.
53524d93 13887 (Frecenter): Fix doc-string typo.
454592a6 13888
3633e3aa
KH
138892011-12-11 Kenichi Handa <handa@m17n.org>
13890
13891 * coding.c (Funencodable_char_position): Pay attention to the
13892 buffer text relocation (Bug#9389).
13893
7b9d523a 138942011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 13895
7b9d523a
JD
13896 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13897 gtk_init (Bug#10100).
13898
b73189c6
EZ
138992011-12-10 Eli Zaretskii <eliz@gnu.org>
13900
13901 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13902 IT->string is nil. (Bug#10263)
13903
f7dfe5d6
JD
139042011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13905
83faebb4
JD
13906 * nsterm.h (x_free_frame_resources): Declare.
13907
f7dfe5d6
JD
13908 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13909 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13910
13911 * nsterm.h (ns_get_defaults_value): Declare.
13912
13913 * nsterm.m (ns_default): Call ns_get_defaults_value.
13914
7cd4e72c
EZ
139152011-12-09 Eli Zaretskii <eliz@gnu.org>
13916
13917 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13918 (Bug#10170)
13919
b34d7317
YM
139202011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13921
13922 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13923 that where the value of an _OBJC_* symbol points to is in the .bss
13924 section (Bug#10240).
13925
76470ad1
KH
139262011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13927
13928 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 13929 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 13930
745fff94
KH
139312011-12-08 Kenichi Handa <handa@m17n.org>
13932
13933 * ftfont.c (get_adstyle_property): Fix previous change
13934 (Bug#10233).
13935
6e44397c
JB
139362011-12-07 Juanma Barranquero <lekktu@gmail.com>
13937
13938 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13939 dirs from the default value of EMACSLOADPATH (bug#10208).
13940
7efa6272
GM
139412011-12-07 Glenn Morris <rgm@gnu.org>
13942
13943 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13944 installation and source directories as well. (Bug#10208)
13945
f6fc4d87
CY
139462011-12-06 Chong Yidong <cyd@gnu.org>
13947
13948 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13949
2bf26180
GM
139502011-12-06 Glenn Morris <rgm@gnu.org>
13951
13952 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13953 as an error, not just -1. (Bug#10217)
13954
3a6ad4f0
CY
139552011-12-05 Chong Yidong <cyd@gnu.org>
13956
13957 * keyboard.c (process_special_events): New function.
13958 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13959
75a3b399
PE
139602011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13961
13962 * coding.c (encode_designation_at_bol): Don't use uninitialized
13963 local variable (Bug#9318).
13964
c3c9e25e
KH
139652011-12-05 Kenichi Handa <handa@m17n.org>
13966
13967 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13968 return Qnil (Bug#8046, Bug#10193).
13969
5eb05ea3
KH
139702011-12-05 Kenichi Handa <handa@m17n.org>
13971
13972 * coding.c (encode_designation_at_bol): New args charbuf_end and
13973 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
13974 (coding_set_source): Return how many bytes coding->source was
13975 relocated.
13976 (coding_set_destination): Return how many bytes
13977 coding->destination was relocated.
13978 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 13979 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
13980
139812011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13982
13983 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13984 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13985 macro (Bug#9318).
13986
139872011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13988
13989 The following changes are to fix Bug#9318.
13990
a79703f5 13991 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
13992 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13993 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 13994 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 13995
7dbda6df
JB
139962011-12-05 Juanma Barranquero <lekktu@gmail.com>
13997
13998 * lisp.h (process_quit_flag): Fix external declaration.
13999
6d5eb5b0
SM
140002011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14001
14002 Don't macro-inline non-performance-critical code.
14003 * eval.c (process_quit_flag): New function.
14004 * lisp.h (QUIT): Use it.
14005
a0c3fad0
JD
140062011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14007
14008 * nsfns.m (get_geometry_from_preferences): New function.
14009 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14010
6c07aac2
AS
140112011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14012
14013 * emacs.c (Qkill_emacs): Define.
14014 (syms_of_emacs): Initialize it.
14015 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14016 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
14017 (quit_throw_to_read_char): Add parameter `from_signal'.
14018 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
14019 * lisp.h (QUIT): Call Fkill_emacs if requested.
14020
c052ead4
JD
140212011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14022
14023 * widget.c (update_wm_hints): Return if wmshell is null.
14024 (widget_update_wm_size_hints): New function.
14025
14026 * widget.h (widget_update_wm_size_hints): Declare.
14027
14028 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14029 widget_update_wm_size_hints (Bug#10104).
14030
9e49252b
EZ
140312011-12-03 Eli Zaretskii <eliz@gnu.org>
14032
14033 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14034 before a newline, prepare the bidi iterator for consuming the
14035 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 14036 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 14037
02b16839
JL
140382011-12-02 Juri Linkov <juri@jurta.org>
14039
14040 * search.c (Fword_search_regexp): New Lisp function created from
14041 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14042 (Fword_search_backward, Fword_search_forward)
14043 (Fword_search_backward_lax, Fword_search_forward_lax):
14044 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14045 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14046
0068070e
SM
140472011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14048
14049 * fileio.c (Finsert_file_contents): Move after-change-function call
14050 to before the "handled:" label, since all "goto handled" appear in
14051 cases where the *-change-functions have already been properly called
14052 (bug#10117).
14053
3360a3fc
AS
140542011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14055
14056 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14057 waiting for input. (Bug#10169)
14058
73d6c093
EZ
140592011-11-30 Eli Zaretskii <eliz@gnu.org>
14060
14061 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14062 verifies glyph row's hash code--we have just reallocated the
14063 glyphs, so their contents can be complete garbage. (Bug#10164)
14064
febe6bea
JB
140652011-11-30 Juanma Barranquero <lekktu@gmail.com>
14066
14067 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14068
801a4313
EZ
140692011-11-30 Eli Zaretskii <eliz@gnu.org>
14070
14071 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14072 attributes are tested _before_ calling verify_row_hash, to protect
14073 against GCC re-ordering of the tests. (Bug#10164)
14074
2b56b87e
JD
140752011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14076
14077 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14078
14079 * xterm.c (handle_one_xevent): Only set async_visible and friends
14080 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 14081 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
14082 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14083
dbf31225
PE
140842011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14085
14086 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14087 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14088 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14089 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14090 All uses changed to use GCPRO1 etc.
14091 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14092 Revert to old implementation (i.e., before 2011-03-11).
14093
1305621b
YM
140942011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14095
14096 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14097 of scroll runs so as to avoid assigning disabled bogus rows and
14098 unnecessary graphics copy operations.
14099
8c9afb46
EZ
141002011-11-27 Eli Zaretskii <eliz@gnu.org>
14101
14102 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14103 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14104 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14105 (malloc, free, realloc, calloc): Redirect to e_* only when
14106 compiling Emacs.
14107
14108 * lisp.h (GCTYPEBITS): Move before first use.
14109 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14110 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14111 this macro definition.
14112
14113 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14114 _MSC_VER.
14115
54e9e3bf
JD
141162011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14117
6d5eb5b0
SM
14118 * gtkutil.c (xg_create_frame_widgets):
14119 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
14120 present with Gtk+ 2.0.
14121
83aca1cb
PE
141222011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14123
14124 * fileio.c (Finsert_file_contents): Undo previous change; see
14125 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14126
5b76caa4
PE
141272011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14128
14129 Rename locals to avoid shadowing.
14130 * fileio.c (Finsert_file_contents):
14131 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14132 * process.c (wait_reading_process_output):
14133 Rename inner 'proc' to 'p' to avoid shadowing.
14134 Indent for consistency with usual Emacs style.
14135
8c535114
EZ
141362011-11-25 Eli Zaretskii <eliz@gnu.org>
14137
14138 * xdisp.c (redisplay_window): If cursor row is not fully visible
14139 after recentering, and scroll-conservatively is set to a large
14140 number, scroll window by a few more lines to make the cursor fully
14141 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
14142 (start_display): Don't move to the next line if the display should
14143 start at a newline that is part of a display vector or an overlay
14144 string. (Bug#10119)
8c535114 14145
fa4fdb5c
JL
141462011-11-24 Juri Linkov <juri@jurta.org>
14147
14148 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14149 after the `MagickPingImage' call. (Bug#10112)
14150
90ec88df
CY
141512011-11-23 Chong Yidong <cyd@gnu.org>
14152
14153 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14154
56e2e794
MR
141552011-11-23 Martin Rudalics <rudalics@gmx.at>
14156
14157 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14158 making another buffer current. (Bug#10114)
14159
b6e64c41
GM
141602011-11-23 Glenn Morris <rgm@gnu.org>
14161
14162 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14163
6b21de18
CY
141642011-11-23 Chong Yidong <cyd@gnu.org>
14165
14166 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14167 using it (Bug#5984).
14168
b12cd789
EZ
141692011-11-22 Eli Zaretskii <eliz@gnu.org>
14170
14171 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14172 and header-lines, as they don't have one computed for them.
14173 (Bug#10098)
14174
14175 * .gdbinit (prow): Make displayed values more self-explaining.
14176 Add row's hash code.
14177
261b6fd4
LMI
141782011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14179
14180 * process.c (wait_reading_process_output): Fix asynchrounous
14181 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 14182 (wait_reading_process_output): Add comment and URL.
261b6fd4 14183
e7cfd277
JD
141842011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14185
14186 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14187
a9b9b7f5
CY
141882011-11-21 Chong Yidong <cyd@gnu.org>
14189
14190 * window.c (Fnext_window, Fprevious_window): Doc fix.
14191
b0d15b4f
SM
141922011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14193
14194 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14195
fe7a3057
JB
141962011-11-20 Juanma Barranquero <lekktu@gmail.com>
14197
14198 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14199
d2999b1a
MR
142002011-11-20 Martin Rudalics <rudalics@gmx.at>
14201
14202 * window.c (Fset_window_combination_limit): Rename argument
14203 STATUS to LIMIT.
14204 (Vwindow_combination_limit): Remove "status" from doc-string.
14205
d5ff9cd0
AS
142062011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14207
14208 * m/ibms390.h: Remove.
14209 * m/ibms390x.h: Don't include "ibms390.h".
14210
a5bb9bd3
SM
142112011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14212
14213 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14214 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14215
cd1181db
JB
142162011-11-20 Juanma Barranquero <lekktu@gmail.com>
14217
14218 * casetab.c (Fset_case_table):
14219 * charset.c (Fcharset_after): Fix typos.
14220
615a3b8d 142212011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 14222
17e845af
PE
14223 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14224 Otherwise, valgrind does not work on some platforms.
14225 Problem reported by Andreas Schwab in
6a0bf43d
PE
14226 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14227 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14228 is set, removing the need for VIRT_ADDRESS_VARIES.
14229 (PURE_P): Use a more-efficient implementation that needs just one
14230 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14231 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14232 to 4 (xorl, subq, cmpq, setbe).
14233 * alloc.c (pure): Always extern now, since that's the
14234 VIRT_ADDR_VARIES behavior.
14235 (PURE_POINTER_P): Use a single comparison, not two, for
14236 consistency with the new puresize.h.
14237 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14238 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14239 Remove VIRT_ADDR_VARIES no longer needed.
14240
f8fe6f96
EZ
142412011-11-19 Eli Zaretskii <eliz@gnu.org>
14242
14243 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14244 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14245 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14246 behave as if the cursor position were at the window margin.
14247
14248 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14249 and the cursor position is out of bounds, behave as if the cursor
14250 position were at the window margin. (Bug#10075)
14251
df05a53c
CY
142522011-11-18 Chong Yidong <cyd@gnu.org>
14253
14254 * window.c (Fwindow_combination_limit): Make first argument
14255 non-optional, since it is meaningless for live windows like the
14256 selected window.
61ccba97 14257
2071918e
DA
142582011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14259
14260 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14261
b50a28de
SM
142622011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14263
14264 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14265 (graft_intervals_into_buffer): Simplify.
14266
015137db
EZ
142672011-11-18 Eli Zaretskii <eliz@gnu.org>
14268
14269 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14270 hash values of the two rows.
14271 (copy_row_except_pointers): Preserve the used[] arrays and the
14272 hash values of the two rows. (Bug#10035)
68c95424 14273 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
14274
14275 * xdisp.c (row_hash): New function, body extracted from
14276 compute_line_metrics.
14277 (compute_line_metrics): Call row_hash, instead of computing the
14278 hash code inline.
14279
14280 * dispnew.c (verify_row_hash): Call row_hash for computing the
14281 hash code of a row, instead of duplicating code from xdisp.c.
14282
14283 * dispextern.h (row_hash): Add prototype.
14284
a2addb04
TH
142852011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14286
14287 * frame.c (delete_frame): Don't delete the terminal when the last
14288 X frame is closed if emacs is built with GTK toolkit.
14289
df85d315
JB
142902011-11-17 Juanma Barranquero <lekktu@gmail.com>
14291
14292 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14293
a0c2d0ae
MR
142942011-11-17 Martin Rudalics <rudalics@gmx.at>
14295
14296 * window.c (Vwindow_splits): Rename to
14297 Vwindow_combination_resize. Suggested by Juri Linkov.
14298 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14299 of Vwindow_splits.
14300
58179cce
JB
143012011-11-16 Juanma Barranquero <lekktu@gmail.com>
14302
7877f373
JB
14303 * nsfns.m (Fns_font_name):
14304 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 14305
b6f67890
MR
143062011-11-16 Martin Rudalics <rudalics@gmx.at>
14307
14308 * window.h (window): Rename slot "nest" to "combination_limit".
14309 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14310 (Fset_window_nest): Rename to Fset_window_combination_limit.
14311 (Vwindow_nest): Rename to Vwindow_combination_limit.
14312 (recombine_windows, make_parent_window, make_window)
14313 (Fsplit_window_internal, saved_window)
14314 (Fset_window_configuration, save_window_save): Rename all
14315 occurrences of window_nest to window_combination_limit.
14316
c7015153
JB
143172011-11-15 Juanma Barranquero <lekktu@gmail.com>
14318
14319 * image.c (imagemagick_load_image): Fix typo.
14320
322ad6ec
EZ
143212011-11-14 Eli Zaretskii <eliz@gnu.org>
14322
14323 * xdisp.c (display_line): Move the call to
14324 highlight_trailing_whitespace before the call to
14325 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
14326 faces of all the glyphs to compute ROW's hash value.
14327 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 14328
f067b8ec
JB
143292011-11-14 Juanma Barranquero <lekktu@gmail.com>
14330
14331 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14332 just return (bug#10044).
14333
1e5b2111
EZ
143342011-11-12 Eli Zaretskii <eliz@gnu.org>
14335
7ef3cbd5
EZ
14336 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14337 with user-defined heap size. Bump the default size of the temacs
14338 heap to 27MB, to avoid memory warning when running temacs.
14339 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14340
1e5b2111
EZ
14341 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14342 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
14343 (verify_row_hash) [XASSERTS]: New function.
14344 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14345 that the hash value of glyph rows is correct.
1e5b2111 14346
89d61221
MR
143472011-11-12 Martin Rudalics <rudalics@gmx.at>
14348
14349 * window.h (window): Remove splits slot.
14350 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14351 (Fdelete_other_windows_internal, make_parent_window)
14352 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14353 (Fset_window_configuration, save_window_save): Don't deal with
14354 split status of windows.
14355 (saved_window): Remove splits slot.
14356 (Vwindow_splits): Rewrite doc-string.
14357
97f18cc8
JD
143582011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14359
14360 * xfns.c (unwind_create_frame):
14361 * nsfns.m (unwind_create_frame):
14362 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14363 Vframe_list (Bug#9999).
14364
22a648b4
DA
143652011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14366
0b381c7e 14367 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 14368
659afede
KH
143692011-11-11 Kenichi Handa <handa@m17n.org>
14370
14371 * callproc.c (Fcall_process): Set the member dst_multibyte of
14372 process_coding.
14373
9ac0394b
KH
143742011-11-11 Johan Bockgård <bojohan@gnu.org>
14375
14376 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14377 avoid a crash (bug#9496).
14378
2fbdc249
CY
143792011-11-09 Chong Yidong <cyd@gnu.org>
14380
14381 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14382 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14383
ac6b1f81
PE
143842011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14385
14386 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14387
09db192c
PE
143882011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14389
14390 Avoid some portability problems by eschewing 'extern inline' functions.
14391 The trivial performance wins aren't worth the portability hassles; see
14392 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14393 et seq.
14394 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14395 (window_box_width, window_box_left, window_box_left_offset)
14396 (window_box_right, window_box_right_offset): Undo previous change,
14397 by removing the "extern"s.
14398 * intervals.c (adjust_intervals_for_insertion)
14399 (adjust_intervals_for_deletion): Undo previous change,
14400 making these static again.
14401 (offset_intervals, temp_set_point_both, temp_set_point)
14402 (copy_intervals_to_string): No longer inline.
14403 * xdisp.c (window_text_bottom_y, window_box_width)
14404 (window_box_height, window_box_left_offset)
14405 (window_box_right_offset, window_box_left, window_box_right)
14406 (window_box): No longer inline.
14407
105216ed
CY
144082011-11-08 Chong Yidong <cyd@gnu.org>
14409
14410 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
14411 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14412 Signal an error if not a live window.
105216ed
CY
14413 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14414 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14415
ae9e237f
JB
144162011-11-07 Juanma Barranquero <lekktu@gmail.com>
14417
14418 * lisp.h (syms_of_abbrev): Remove declaration.
14419 Reported by CHENG Gao <chenggao@royau.me>.
14420
c7aa8333
EZ
144212011-11-07 Eli Zaretskii <eliz@gnu.org>
14422
14423 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14424 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14425 of temacs in GUI mode.
14426
be7f5545
MR
144272011-11-07 Martin Rudalics <rudalics@gmx.at>
14428
14429 * window.h: Declare delete_all_child_windows instead of
14430 delete_all_subwindows.
14431 * window.c (Fwindow_nest, Fset_window_nest)
14432 (Fset_window_new_total, Fset_window_new_normal)
14433 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14434 (delete_all_subwindows): Rename to delete_all_child_windows.
14435 (Fdelete_other_windows_internal, Fset_window_configuration):
14436 Call delete_all_child_windows instead of delete_all_subwindows.
14437 * frame.c (delete_frame): Call delete_all_child_windows instead
14438 of delete_all_subwindows.
14439
ca78dc43
PE
144402011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14441
14442 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14443 This is also needed for porting to any host where GC_MARK_STACK is
14444 not GC_MAKE_GCPROS_NOOPS.
14445 (which_symbols): Use it.
14446
a0241d01
KH
144472011-11-07 Kenichi Handa <handa@m17n.org>
14448
14449 * coding.c (coding_set_destination): Check coding->src_pos only
14450 when coding->src_object is a buffer (bug#9910).
14451
14452 * process.c (send_process): Set the member src_multibyte of coding
14453 to 0 (bug#9911) when sending a unibyte text.
14454
14455 * callproc.c (Fcall_process): Set the member src_multibyte of
14456 process_coding to 0 (bug#9912).
14457
a64bfdfa 144582011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
14459
14460 * xmenu.c (cleanup_widget_value_tree): New function.
14461 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14462 calling free_menubar_widget_value_tree directly (Bug#9830).
14463
cb41b32a
PE
144642011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14465
14466 Fix some portability problems with 'inline'.
14467 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14468 (window_box_width, window_box_left, window_box_left_offset)
14469 (window_box_right, window_box_right_offset): Declare extern.
14470 Otherwise, these inline functions do not conform to C99 and
14471 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14472 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14473 * intervals.c (adjust_intervals_for_insertion)
14474 (adjust_intervals_for_deletion): Now extern, because otherwise the
14475 extern inline functions 'offset_intervals' couldn't refer to it.
14476 (static_offset_intervals): Remove.
14477 (offset_intervals): Rewrite using the old contents of
14478 static_offset_intervals. The old version didn't conform to C99
14479 because an extern inline function contained a reference to an
14480 identifier with static linkage.
14481
b7041366
AS
144822011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14483
14484 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14485 GC.
14486
88a37c4d
EZ
144872011-11-06 Eli Zaretskii <eliz@gnu.org>
14488
14489 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14490 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14491 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14492 return Qleft_to_right.
14493
49745b39
CY
144942011-11-06 Chong Yidong <cyd@gnu.org>
14495
14496 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14497 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14498 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14499 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14500 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14501 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14502 (Fwindow_vscroll): Doc fix.
14503 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14504 argument, since it makes no sense to pass a live window and for
14505 consistency with window-child.
14506
1f05cd82
CS
145072011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14508
14509 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14510 support MSVC.
14511
22610910
JR
145122011-11-05 Jason Rumney <jasonr@gnu.org>
14513
14514 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14515 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14516 fonts (Bug#6029).
14517 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14518 bitwise arithmetic preventing use of unicode-sip and non-truetype
14519 opentype fonts.
14520
a06776b2
EZ
145212011-11-05 Eli Zaretskii <eliz@gnu.org>
14522
3ad924ba
EZ
14523 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14524 "emacs"-only part.
14525
a06776b2
EZ
14526 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14527 initialization code to keep similarity to xfns.c after changes
14528 from 2011-11-05.
14529
c9e7db78
JD
145302011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14531
a97f8f3f
JD
14532 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14533 (unwind_create_frame): New function (Bug#9943).
14534 (Fx_create_frame): Restructure code to be more similar to the one in
14535 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14536 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14537 Move terminal->reference_count++ just before making the frame official
14538 (Bug#9943).
14539
14540 * nsterm.m (x_free_frame_resources): New function.
14541 (x_destroy_window): Move code to x_free_frame_resources.
14542
c9e7db78 14543 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
14544 (Fx_create_frame, x_create_tip_frame):
14545 Move terminal->reference_count++ just before making the frame
75f1671a 14546 official. Move initialization of image_cache_refcount and
c9e7db78
JD
14547 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14548
a6fc3b5c
EZ
145492011-11-05 Eli Zaretskii <eliz@gnu.org>
14550
14551 Support MSVC build with newer versions of Visual Studio.
14552 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14553 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14554 nt/gmake.defs.
14555
14556 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14557 which are not supported by MSVC.
14558 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14559 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14560 bitfields.
14561 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14562 types in bitfields.
14563 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14564
14565 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14566
58179cce 145672011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
14568
14569 Support MSVC build with newer versions of Visual Studio.
14570 * w32.c: Don't include w32api.h for MSVC.
14571 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14572
14573 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14574 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14575 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14576 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14577 e_* cousins.
14578 (alloca) [_MSC_VER]: Define to _alloca.
14579
14580 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14581
14582 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14583
a58c13ed
EZ
145842011-11-04 Eli Zaretskii <eliz@gnu.org>
14585
14586 * xdisp.c (note_mouse_highlight): If either of
14587 previous/next-single-property-change returns nil, treat that as
14588 the beginning or the end of the buffer. (Bug#9955)
14589
fe0b6370
JD
145902011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14591
a58c13ed 14592 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
14593 label is not null (Bug#9951).
14594 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14595 may be NULL.
14596
89bd5ee1
EZ
145972011-11-04 Eli Zaretskii <eliz@gnu.org>
14598
14599 * window.c (Fwindow_body_size): Mention in the doc string that the
14600 return value is in frame's canonical units. (Bug#9949)
14601
84c3edb9
EZ
146022011-11-03 Eli Zaretskii <eliz@gnu.org>
14603
4e2fb5c7
EZ
14604 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14605
84c3edb9 14606 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 14607 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 14608 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 14609
bc17a887
EZ
146102011-11-01 Eli Zaretskii <eliz@gnu.org>
14611
14612 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14613 Don't stop backward scan on the continuation glyph, even though
14614 its CHARPOS is positive.
6d5eb5b0
SM
14615 (mouse_face_from_buffer_pos, note_mouse_highlight):
14616 Rename cover_string to disp_string.
bc17a887 14617
4ee88440
MR
146182011-11-01 Martin Rudalics <rudalics@gmx.at>
14619
14620 * window.c (temp_output_buffer_show): Don't use
14621 Vtemp_buffer_show_specifiers.
14622 (Vtemp_buffer_show_specifiers): Remove unused variable.
14623
c2ff3c02
EZ
146242011-10-30 Eli Zaretskii <eliz@gnu.org>
14625
14626 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14627 past the beginning of the current glyph matrix.
14628
58179cce 146292011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
14630
14631 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14632 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14633 HAVE_GTK3 (Bug#9869).
b77a6a7f 14634
3b574623
JD
14635 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14636 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14637
b77a6a7f
JD
14638 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14639
14640 * xterm.c: Declare x_handle_net_wm_state to return int.
14641 (handle_one_xevent): Check if we are iconified but don't have
14642 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14643 (get_current_wm_state): Return non-zero if not hidden,
14644 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14645 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14646 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14647 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14648
196e41e4
PE
146492011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14650
14651 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14652 so that this new function doesn't get optimized away by a
14653 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14654
021f2e1a
AS
146552011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14656
14657 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14658
8b058d44
EZ
146592011-10-29 Eli Zaretskii <eliz@gnu.org>
14660
14661 Fix the `xbytecode' command.
14662 * .gdbinit (xprintbytestr): New command.
b50a28de 14663 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
14664 (xbytecode): Print the byte-code string as well.
14665
4452fb80
EZ
146662011-10-29 Kim Storm <storm@cua.dk>
14667
8b058d44
EZ
14668 * alloc.c (which_symbols): New function.
14669
21b72067
AS
146702011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14671
14672 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14673 line. (Bug#9903)
14674
83ed7b5c
GM
146752011-10-29 Glenn Morris <rgm@gnu.org>
14676
14677 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14678 Not clear what it was for, and it causes various bugs. (Bug#9839)
14679
5a7a728b
EZ
146802011-10-28 Eli Zaretskii <eliz@gnu.org>
14681
14682 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14683 possible random value that matches one of those tested as
14684 condition to clear the mouse face.
14685
d3d0842f
CY
146862011-10-28 Chong Yidong <cyd@gnu.org>
14687
14688 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14689
31b39d13
DN
146902011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14691
14692 * window.c (make_window): Initialize phys_cursor_on_p.
14693
9aba6043
SM
146942011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14695
14696 * lisp.h (struct Lisp_Symbol): Update comments.
14697
c20992f4
JB
146982011-10-28 Juanma Barranquero <lekktu@gmail.com>
14699
14700 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14701
db4f02f2
EZ
147022011-10-28 Eli Zaretskii <eliz@gnu.org>
14703
14704 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14705 <oslsachem@gmail.com> for helping to debug this.
14706
14707 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14708 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14709 (g_b_init_get_glyph_outline_w): New static variables.
14710 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14711 (GetGlyphOutlineW_Proc): New typedefs.
14712 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
14713 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14714 New functions.
14715 (w32font_open_internal, compute_metrics):
14716 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
14717 instead of calling the "wide" APIs directly.
14718
14719 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14720
14721 * w32.h (syms_of_w32font): Add prototype.
14722
87e68db4
JB
147232011-10-27 Juanma Barranquero <lekktu@gmail.com>
14724
14725 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14726 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14727 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14728 (Fmove_to_window_line): Doc fix.
14729
435c1d67
CY
147302011-10-27 Chong Yidong <cyd@gnu.org>
14731
14732 * process.c (make_process): Set gnutls_state to NULL.
14733
14734 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14735 non-NULL, regardless of GNUTLS_INITSTAGE.
14736 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14737 an error. Set process slots as soon as we allocate them.
14738
14739 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14740
9c6c6f49
CY
147412011-10-27 Chong Yidong <cyd@gnu.org>
14742
9aba6043
SM
14743 * gnutls.c (emacs_gnutls_deinit): New function.
14744 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
14745 (Fgnutls_deinit, Fgnutls_boot): Use it.
14746
14747 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14748 (deactivate_process): Call emacs_gnutls_deinit.
14749
657d08d3
JB
147502011-10-27 Juanma Barranquero <lekktu@gmail.com>
14751
14752 * image.c (x_create_x_image_and_pixmap):
14753 * w32.c (sys_rename, w32_delayed_load):
14754 * w32font.c (fill_in_logfont):
14755 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14756
5430d399
JB
147572011-10-26 Juanma Barranquero <lekktu@gmail.com>
14758
14759 * w32fns.c (w32_default_color_map): New function,
14760 extracted from Fw32_default_color_map.
a7ef684b 14761 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 14762
fe0055fa
PE
147632011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14764
14765 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14766
e6346438
SM
147672011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14768
14769 * keyboard.c (test_undefined): New function (bug#9751).
14770 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14771
e112cc37
ET
147722011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14773
14774 * sysdep.c (init_sys_modes): Fix the check for the controlling
14775 terminal (Bug#6649).
14776
7b5d6677
EZ
147772011-10-20 Eli Zaretskii <eliz@gnu.org>
14778
14779 * dispextern.h (struct bidi_it): New member next_en_type.
14780
14781 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14782 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14783 current character, check also for next_en_type being WEAK_EN.
14784 (bidi_resolve_weak): Don't enter the expensive loop if the current
14785 position is before next_en_pos. Record the bidi type of the first
14786 non-ET, non-BN character we find, in addition to its position.
14787 (bidi_level_of_next_char): Invalidate next_en_type when
14788 next_en_pos is over-stepped.
14789
7da0b018
PE
147902011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14791
14792 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14793 * editfns.c: Rewrite current-time-zone so that it invokes
14794 the equivalent of (format-time-string "%Z") to get the time zone name.
14795 This fixes a bug when the time zone name contains characters that
14796 need converting from the system time locale to Emacs internal format.
14797 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14798 that patch fixed format-time-string to do the conversion, but
14799 I forgot to fix current-time-zone.
14800 (format_time_string): New function, containing most of
14801 what Fformat_time_string used to contain.
14802 (Fformat_time_string): Rewrite in terms of format_time_string.
14803 This doesn't change this function's behavior.
14804 (current-time-zone): Rewrite to use format_time_string.
14805 This fixes the bug reported by Michael Schierl in
14806 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14807 Jason Rumney's 2007-06-07 change worked around this bug, but
14808 didn't fix it.
14809 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14810
8547b010
EZ
148112011-10-19 Eli Zaretskii <eliz@gnu.org>
14812
14813 * xdisp.c (start_display): If the character at POS is displayed
14814 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
14815 (try_window_reusing_current_matrix): If a line ends in a display
14816 vector or the next line starts in a display vector, continue
14817 redrawing the window even though the character position of
14818 start_row was reached.
8547b010
EZ
14819 (Bug#9771, part 2)
14820
4e948d15
CY
148212011-10-18 Chong Yidong <cyd@gnu.org>
14822
14823 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14824 with nobreak-char-display too.
14825
4787455f
EZ
148262011-10-18 Eli Zaretskii <eliz@gnu.org>
14827
14828 Fix part 3 of bug#9771.
14829 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14830 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14831 non-neutral characters if the current character is a paragraph
14832 separator (a.k.a. Newline). This avoids running the same
14833 expensive loop twice, once when we consume the preceding newline
14834 and the other time when the line actually needs to be displayed.
14835 Avoid the loop when we see neutrals on the base embedding level
14836 following a character whose directionality is the same as the
14837 paragraph's. This avoids running the expensive loop when a line
14838 ends in a long sequence of neutrals, like control characters.
14839 Add assertion against STRONG_AL type. Slightly rearrange code
14840 that determines the type of a neutral given the first non-neutral
14841 that follows it.
14842 (bidi_level_of_next_char): Set next_en_pos to zero when
14843 invalidating its info.
14844
2c91f553
EZ
148452011-10-17 Eli Zaretskii <eliz@gnu.org>
14846
14847 * xdisp.c (push_display_prop): Determine whether to record string
14848 or buffer position by IT->string, not by IT->method. Allow
14849 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
14850 (move_it_vertically_backward): Don't look for character position
14851 immediately after the newline when in a continuation line.
14852 (Bug#9771, part 1)
2c91f553 14853
c7b08b0d
MR
148542011-10-15 Martin Rudalics <rudalics@gmx.at>
14855
14856 * window.c (coordinates_in_window): Rewrite and delabelize
14857 vertical border check. (Bug#5357) (Bug#9618)
14858
6b02f655
SM
148592011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14860
14861 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14862 errors in XSetWindowBorder (bug#9310).
14863
81d40c92
DA
148642011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14865
14866 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14867 avoid crash when xmalloc overrun checking is enabled.
14868
d4172c3b
EZ
148692011-10-13 Eli Zaretskii <eliz@gnu.org>
14870
14871 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14872 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14873 cursor motion with <left> and <right> arrow keys.
14874
14875 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14876 some callers set that themselves.
14877
b00eea75
EZ
148782011-10-12 Eli Zaretskii <eliz@gnu.org>
14879
14880 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14881 display string and the previous row comes from the same string and
14882 is empty. (Bug#9739) (Bug#9738)
14883
8fe012c4
SM
148842011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14885
14886 * doc.c (get_doc_string): Encode file name (bug#9735).
14887
0074aef2
EZ
148882011-10-12 Eli Zaretskii <eliz@gnu.org>
14889
79beb178
EZ
14890 * bidi.c (bidi_level_of_next_char):
14891 * xdisp.c (get_visually_first_element): Remove old incorrect
14892 comments regarding the Unicode Line Separator character.
14893
0074aef2
EZ
14894 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14895
6e4b3fbe
DA
148962011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14897
14898 * alloc.c (Fgc_status): Do not access beyond zombies array
14899 boundary if nzombies > MAX_ZOMBIES.
14900 * alloc.c (dump_zombies): Add missing format specifier.
14901
0324f3af
PE
149022011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14903
b5525cac
PE
14904 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14905 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14906
0324f3af
PE
14907 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14908 Some packages use them to denote characters with modifiers.
14909
e9b5f888
AS
149102011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14911
14912 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14913 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14914 matching a pp-number. Rename parameter var to var1.
14915
127827c0
SM
149162011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14917
14918 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14919
c8fd3bd0
GM
149202011-10-08 Glenn Morris <rgm@gnu.org>
14921
14922 * callint.c (Fcall_interactively): Give a more explicit error for the
14923 'c' case with a non-character input. (Bug#8479)
14924
352ec8ff
EZ
149252011-10-08 Eli Zaretskii <eliz@gnu.org>
14926
03669ccb
EZ
14927 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14928 lines.
7061c986
EZ
14929 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14930 lines that are hscrolled on the left.
03669ccb 14931
352ec8ff
EZ
14932 * dispnew.c (buffer_posn_from_coords): Account for a possible
14933 presence of header-line. (Bug#4426)
14934
a66cfb1c
SM
149352011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14936
6b02f655
SM
14937 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14938 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 14939
7c5ee88e
PE
149402011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14941
14942 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14943 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14944 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14945 this makes Emacs dump core during garbage collection on rare
14946 occasions. sizeof is obviously inferior to offsetof here, so
14947 stick with offsetof.
14948 (GC_POINTER_ALIGNMENT): New macro.
14949 (mark_memory): Omit 3rd (offset) arg; caller changed.
14950 Don't assume EMACS_INT alignment is the same as pointer alignment.
14951
df1bbe5b
SM
149522011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14953
14954 * keyboard.c (read_key_sequence_remapped): New var.
14955 (read_key_sequence): Compute remapping in the right buffer.
14956 (command_loop_1): Use read_key_sequence's remapping directly.
14957
51553db6
SM
149582011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14959
32c1fffd
SM
14960 * dired.c (file_name_completion): Don't expand file name.
14961 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14962 before checking file name handler.
14963
51553db6
SM
14964 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14965 they've been requested explicitly (bug#9591).
14966
b6bd1599 149672011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
14968
14969 * keymap.c (Fsingle_key_description): Use make_specified_string
14970 instead of build_string to build string from push_key_description.
14971 (Bug#5193)
14972
f701dc2a
PE
149732011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14974
4222c55d
PE
14975 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14976 This fixes a Y2038 bug on 64-bit hosts.
14977 * buffer.c (reset_buffer):
14978 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14979 (Fclear_buffer_auto_save_failure):
14980 Use 0, not -1, to represent an unset failure time, since time_t
14981 might not be signed.
14982
f701dc2a
PE
14983 Remove dependency on glibc malloc internals.
14984 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14985 Move back here from lisp.h, but with their new implementations.
14986 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14987 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14988 * charset.c (charset_table_init): New static var.
14989 (syms_of_charset): Use it instead of xmalloc. This removes a
14990 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14991 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14992 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14993 Move back to alloc.c.
14994 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14995 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14996
9ceebf39
JD
149972011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14998
14999 * nsterm.m (windowDidResize): Call x_set_window_size only when
15000 ns_in_resize is true. Otherwise set pixelwidth/height and
15001 call change_frame_size (Bug#9628).
15002
cb993c58
PE
150032011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15004
3930c88b
PE
15005 Port --enable-checking=all to Fedora 14 x86-64.
15006 * charset.c (syms_of_charset): Also account for glibc malloc's
15007 internal overhead when calculating the initial malloc maximum.
15008
cb993c58
PE
15009 Port --enable-checking=all to Fedora 14 x86.
15010 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15011 Move to lisp.h.
15012 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15013 (overrun_check_realloc, overrun_check_free):
15014 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15015 That way, xmalloc returns a properly-aligned pointer even if
15016 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15017 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15018 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15019 into account when calculating the initial malloc maximum.
15020 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15021 Move here from alloc.c, so that charset.c can use it too.
15022 Properly align; the old code wasn't right for common 32-bit hosts
15023 when configured with --enable-checking=all.
15024 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15025 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15026
31bed486
EZ
150272011-09-29 Eli Zaretskii <eliz@gnu.org>
15028
04c70788 15029 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
15030 use EDOM.
15031
fbcaa2f3
EZ
150322011-09-28 Eli Zaretskii <eliz@gnu.org>
15033
15034 * xdisp.c (compute_display_string_end): If there's no display
15035 string at CHARPOS, return -1.
15036
15037 * bidi.c (bidi_fetch_char): When compute_display_string_end
15038 returns a negative value, treat the character as a normal
15039 character not covered by a display string. (Bug#9624)
15040
a239d4e9
JB
150412011-09-28 Juanma Barranquero <lekktu@gmail.com>
15042
15043 * lread.c (Fread_from_string): Fix typo in docstring.
15044
88652fd5
EZ
150452011-09-27 Eli Zaretskii <eliz@gnu.org>
15046
15047 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15048 newline, reseat the iterator instead of bidi-iterating there one
15049 character at a time. (Bug#9610)
32c1fffd
SM
15050 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15051 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 15052
ed497dd4
AS
150532011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15054
15055 * lread.c (readevalloop): Use correct code for NBSP.
15056 (read1): Likewise. (Bug#9608)
15057
b2bf61aa
MA
150582011-09-25 Michael Albinus <michael.albinus@gmx.de>
15059
15060 * dbusbind.c (Fdbus_register_signal): When service is not
15061 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15062
32bbb17c
GM
150632011-09-25 Glenn Morris <rgm@gnu.org>
15064
15065 * buffer.c (truncate-lines): Doc fix.
15066
94e0933e
CY
150672011-09-24 Chong Yidong <cyd@stupidchicken.com>
15068
15069 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15070 (Fset_window_next_buffers): Doc fix.
15071
cddde921
GM
150722011-09-24 Glenn Morris <rgm@gnu.org>
15073
15074 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15075
1260aef1
PE
150762011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15077
25b4bfa0
PE
15078 Fix minor problems found by static checking.
15079 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
15080 * indent.c (Fvertical_motion): Fix == vs = typo.
15081
e3cbd34b
EZ
150822011-09-24 Eli Zaretskii <eliz@gnu.org>
15083
a66cfb1c
SM
15084 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15085 Default value is now t. Doc fix.
6bf7006f 15086
e3cbd34b 15087 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 15088 logic when moving up, not only when moving down. Fix the
e3cbd34b 15089 confusing name and values of the it_overshoot_expected variable;
32c1fffd 15090 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
15091
15092 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15093 CHARPOS is covered by a display string which includes newlines.
15094 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15095 is covered by a display string with embedded newlines.
15096
a3de0cbd
MA
150972011-09-24 Michael Albinus <michael.albinus@gmx.de>
15098
15099 * dbusbind.c (Fdbus_register_signal): Add match rule to
15100 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
15101 (Fdbus_register_method, Vdbus_registered_objects_table):
15102 Fix docstring.
a3de0cbd 15103
b260039d
JM
151042011-09-24 Jim Meyering <meyering@redhat.com>
15105
32c1fffd 15106 do not ignore write error for any output size
b260039d
JM
15107 The previous change was incomplete.
15108 While it makes emacs --batch detect the vast majority of stdout
15109 write failures, errors were still ignored whenever the output size is
15110 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15111 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15112 && echo FAIL: ignored write error
15113 FAIL: ignored write error
15114 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15115 && echo FAIL: ignored write error
15116 FAIL: ignored write error
15117 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15118
8eca8a7c
AS
151192011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15120
15121 * emacs.c (Fkill_emacs): In noninteractive mode exit
15122 non-successfully if a write error occurred on stdout. (Bug#9574)
15123
3341db62
EZ
151242011-09-21 Eli Zaretskii <eliz@gnu.org>
15125
15126 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15127 the xassert test.
15128
15129 * dispextern.h (struct it): Update the comment documenting what
15130 can it->OBJECT be.
15131
8c203dbf
EZ
151322011-09-20 Eli Zaretskii <eliz@gnu.org>
15133
15134 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15135 a display string, extend search for cursor position to end of row.
15136 (find_row_edges): If the row ends in a newline from a display
15137 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15138 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
15139 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15140 non-empty line. Fixes confusing cursor motion with arrow keys at
15141 the beginning of a line that starts with whitespace.
8c203dbf 15142
a4824228
LMI
151432011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15144
15145 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15146 (bug#9493).
15147
33ed493b
CY
151482011-09-18 Chong Yidong <cyd@stupidchicken.com>
15149
15150 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15151 boolean (Bug#9154).
15152
56cd55c8
EZ
151532011-09-18 Eli Zaretskii <eliz@gnu.org>
15154
15155 * xdisp.c (display_line): Record maximum and minimum buffer
15156 positions even if no glyphs were produced (e.g., by a zero-width
15157 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15158 buffer positions that will be removed from the glyph row because
15159 they don't fit.
c02dcedf
EZ
15160 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15161 column is beyond frame width: don't subtract 1 "pixel" when
15162 computing width of the stretch.
3e62b7e0
EZ
15163 (reseat_at_next_visible_line_start): Undo the change made on
15164 2011-09-17 that saved paragraph information and restored it after
15165 the call to `reseat'. (Bug#9545)
56cd55c8 15166
5ed99d36 151672011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
15168
15169 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15170 and turn window cursor on if cleared (Bug#9415).
15171
5ed99d36 151722011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
15173
15174 * search.c (boyer_moore): Take unibyte characters from pattern
15175 literally. (Bug#9458)
15176
9bade7b2
EZ
151772011-09-18 Eli Zaretskii <eliz@gnu.org>
15178
15179 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15180
e5e9d610
PE
151812011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15182
87e4427a
PE
15183 Fix minor problem found by static checking.
15184 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15185 initialized, to pacify gcc -Wuninitialized.
15186
e5e9d610
PE
15187 * fileio.c: Report proper errno when syscall falls.
15188 (Finsert_file_contents): Save and restore errno,
15189 so that report_file_error outputs the correct diagnostic.
15190 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15191
a1674f0b
EZ
151922011-09-18 Eli Zaretskii <eliz@gnu.org>
15193
15194 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15195
fbfb6dd4
EZ
151962011-09-17 Eli Zaretskii <eliz@gnu.org>
15197
15198 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15199 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15200
bb187662
EZ
152012011-09-17 Eli Zaretskii <eliz@gnu.org>
15202
1137e8b8 15203 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 15204 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
15205
15206 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15207 (bidi_find_paragraph_start): Search back for paragraph beginning
15208 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15209 (bidi_move_to_visually_next): Only trigger paragraph-related
15210 computations when the last character is a newline or at EOB, not
15211 just any NEUTRAL_B. (Bug#9470)
15212
bb187662
EZ
15213 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15214 truncated lines if point is covered by a display string. (Bug#9524)
15215
2e621251
PE
152162011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15217
15218 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15219 (cons_to_x_long): New function.
15220 (lisp_data_to_selection_data): Use it. Correct the test for
15221 short-versus-long data; it was negated. Break out of vector
15222 loop, for efficiency, when a long datum is discovered.
15223
91a15bc6
SM
152242011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15225
15226 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15227
b41c3a35
EZ
152282011-09-16 Eli Zaretskii <eliz@gnu.org>
15229
15230 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15231 GCC PR/17406) by declaring this function with external scope.
15232
7812ba2d
PE
152332011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15234
15235 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15236 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15237
cf7edc2a
AS
152382011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15239
15240 * editfns.c (Fformat): Correctly handle text properties on "%%".
15241
bd01620e
EZ
152422011-09-15 Eli Zaretskii <eliz@gnu.org>
15243
15244 * xterm.c (x_draw_composite_glyph_string_foreground):
15245 * w32term.c (x_draw_composite_glyph_string_foreground):
15246 * term.c (encode_terminal_code):
15247 * composite.c (composition_update_it, get_composition_id):
15248 * xdisp.c (get_next_display_element)
15249 (fill_composite_glyph_string): Add comments about special meaning
15250 of TAB characters in a composition.
15251
a02719a3
PE
152522011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15253
15254 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
15255 This occurs when processing a multibyte format.
15256 Problem reported by Wolfgang Jenker.
a02719a3 15257
72589a3c
JB
152582011-09-15 Johan Bockgård <bojohan@gnu.org>
15259
15260 * xdisp.c (try_cursor_movement): Only check for exact match if
15261 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15262
1c14176c
PE
152632011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15264
15265 Remove unused external symbols.
15266 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15267 * xdisp.c (calc_pixel_width_or_height): Now static.
15268 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15269 * indent.c (check_display_width):
15270 * w32term.c: Fix comment to match code.
15271 * xterm.c, xterm.h (x_catching_errors): Remove.
15272
d2eea5b5
PE
152732011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15274
15275 * xselect.c: Use signed conversions more consistently (Bug#9498).
15276 (selection_data_to_lisp_data): Assume incoming selection data are
15277 signed integers, not unsigned. This is to be consistent with
15278 outgoing selection data, which was modified to use signed integers
15279 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15280 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15281 expects long, not unsigned long.
15282
46888499
EZ
152832011-09-14 Eli Zaretskii <eliz@gnu.org>
15284
15285 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15286 computation of loop end. Reported by Johan Bockgård
15287 <bojohan@gnu.org>.
15288
ef8ef9fb
CY
152892011-09-13 Chong Yidong <cyd@stupidchicken.com>
15290
15291 * frame.c (Fother_visible_frames_p): Function deleted.
15292
fa819fed
EZ
152932011-09-12 Eli Zaretskii <eliz@gnu.org>
15294
15295 * indent.c (compute_motion): Process display vector front to back
15296 rather than the other way around. (Bug#2496)
15297
2ba8e008
SM
152982011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15299
15300 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15301
20f53c69
CY
153022011-09-11 Chong Yidong <cyd@stupidchicken.com>
15303
15304 * minibuf.c (Fread_from_minibuffer): Doc fix.
15305
d562d7a4
EZ
153062011-09-11 Eli Zaretskii <eliz@gnu.org>
15307
15308 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15309 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15310
1c4d7f3d
LMI
153112011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15312
15313 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15314 value for non-existent files.
15315
b885bf36
EZ
153162011-09-11 Eli Zaretskii <eliz@gnu.org>
15317
15318 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15319 set its "size" to -1. This will set the modtime_size field of
15320 the corresponding buffer to -1, which is what
15321 verify-visited-file-modtime expects for files that do not exist.
15322 (Bug#9139)
15323
6612f0bf
PE
153242011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15325
15326 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15327 here ...
15328 * lisp.h: ... from here. push_key_description is no longer
15329 defined in keyboard.c, so its declaration should not be in
15330 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15331 logically belongs with push_key_description.
15332
dfb3f755
PE
153332011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15334
15335 * buffer.h: Include <sys/types.h> instead of <time.h>.
15336 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15337 Problem reported by Herbert J. Skuhra.
15338
3134906c
LMI
153392011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15340
15341 * xml.c (parse_region): Make the parsing work for
15342 non-comment-starting XML files again (bug#9144).
15343
8d903f4e
AS
153442011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15345
15346 * image.c (gif_load): Fix calculation of bottom and right corner.
15347 (Bug#9468)
15348
80ad64f4
EZ
153492011-09-10 Eli Zaretskii <eliz@gnu.org>
15350
15351 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15352 redisplay in small windows.
15353
208a048d
EZ
153542011-09-09 Eli Zaretskii <eliz@gnu.org>
15355
15356 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15357
9b1c252e
MR
153582011-09-08 Martin Rudalics <rudalics@gmx.at>
15359
15360 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15361 Operate on live windows only.
15362
2949f33b
JB
153632011-09-08 Juanma Barranquero <lekktu@gmail.com>
15364
15365 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15366
e08dcafd
EZ
153672011-09-07 Eli Zaretskii <eliz@gnu.org>
15368
15369 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15370 only under bidi iteration.
15371
115b96bd
JD
153722011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15373
15374 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15375
c8199d0f
PE
153762011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15377
15378 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15379 Without this fix, the command to link temacs failed due to an
15380 undefined symbol __builtin_isnan. This is because
15381 /usr/include/iso/math_c99.h #defines isnan(x) to
15382 __builtin_isnan(x), but the bundled gcc, which identifies itself
15383 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15384 a __builtin_isnan.
15385 * floatfns.c (isnan): #undef, and then #define to a clone of
15386 what's in data.c.
15387 (Fisnan): Always define, since it's always available now.
15388 (syms_of_floatfns): Always define isnan at the Lisp level.
15389
e39b275c 153902011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
15391
15392 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15393
b2db44d9 153942011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 15395
f4af5137 15396 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
15397 The previous code assumed that file offsets (off_t values) fit in
15398 EMACS_INT variables, which is not true on typical 32-bit hosts.
15399 The code messed up by falsely reporting buffer overflow in cases
15400 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15401 when "big" contains more than 2**29 bytes, even though this
15402 inserts just one byte and does not overflow the buffer.
15403 (Finsert_file_contents): Store file offsets as off_t
15404 values, not as EMACS_INT values. Check for overflow when
15405 converting between EMACS_INT and off_t. When checking for
15406 buffer overflow or for overlap, take the offsets into account.
15407 Don't use EMACS_INT for small values where int suffices.
15408 When checking for overlap, fix a typo: ZV was used where
15409 ZV_BYTE was intended.
15410 (Fwrite_region): Don't assume off_t fits into 'long'.
15411 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15412
ecfc0a49
MA
154132011-09-05 Michael Albinus <michael.albinus@gmx.de>
15414
15415 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15416
6511acf2 154172011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 15418
0999621a 15419 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
15420
15421 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 15422 (esprintf, exprintf, evxprintf): New functions.
62f19c19 15423 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 15424 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
15425 (modify_event_symbol): Do not assume that the length of
15426 name_alist_or_stem is safe to alloca and fits in int.
15427 (Fexecute_extended_command): Likewise for function name and binding.
15428 (Frecursion_depth): Wrap around reliably on integer overflow.
15429 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15430 since some callers pass EMACS_INT values.
15431 (Fsingle_key_description): Don't crash if symbol name contains more
15432 than MAX_ALLOCA bytes.
15433 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15434 (get_minibuffer): Arg is now EMACS_INT, not int.
15435 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 15436 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
15437 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15438
2be7d702
PE
15439 * dbusbind.c (signature_cat): New function.
15440 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
15441 Do not overrun buffer; instead, report string overflow.
15442
9d1df220
PE
15443 * dispnew.c (add_window_display_history): Don't overrun buffer.
15444 Truncate instead; this is OK since it's just a log.
15445
33ef5c64
PE
15446 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15447 even if the time zone offset is outlandishly large.
15448 Don't mishandle offset == INT_MIN.
15449
66c6fdd5
PE
15450 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15451 when creating daemon; the previous buffer-overflow check was incorrect.
15452
d749b01b
PE
15453 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15454 which has the guts of the old verror function.
15455
b5cd1905
PE
15456 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15457 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15458
6e1a67fb
PE
15459 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15460 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 15461 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 15462 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
15463 length of string rather than counting it via multiple sprintfs;
15464 that's simpler and more reliable.
c21721cc
PE
15465 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15466 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15467 sprintf, in case result does not fit in int.
15468
c57b67fc
PE
15469 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15470 (fontset_from_font): Print it.
15471
8a401434
PE
15472 * frame.c (tty_frame_count): Now printmax_t, not int.
15473 (make_terminal_frame, set_term_frame_name): Print it.
15474 (x_report_frame_params): In X, window IDs are unsigned long,
15475 not signed long, so print them as unsigned.
15476 (validate_x_resource_name): Check for implausibly long names,
15477 and don't assume name length fits in 'int'.
15478 (x_get_resource_string): Don't blindly alloca invocation name;
15479 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15480 not fit in int.
15481
6e1a67fb
PE
15482 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15483 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
15484 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15485
0df02bf3
PE
15486 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15487 Use esprintf, not sprintf, in case result does not fit in int.
15488
48e30793
PE
15489 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15490 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15491 it as a large positive number.
15492 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15493 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15494
a66ff6d8
PE
15495 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15496 in case result does not fit in int.
15497
aca216ff
PE
15498 * print.c (float_to_string): Detect width overflow more reliably.
15499 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15500 buffer overrun. Don't assume list length fits in 'int'. Treat
15501 print length of 0 as 0, not as infinity; to be consistent with other
15502 uses of print length in this function. Don't overflow print length
15503 index. Don't assume hash table size fits in 'long', or that
15504 vectorlike size fits in 'unsigned long'.
15505
31c286f7
PE
15506 * process.c (make_process): Use printmax_t, not int, to format
15507 process-name gensyms.
15508
55e5faa1
PE
15509 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15510
80f2e268
PE
15511 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15512 to avoid potential buffer overrun.
15513
670741ab
PE
15514 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15515 if X resource line is longer than 512 bytes.
15516
b7163a50
PE
15517 * xfns.c (x_window): Make sprintf buffer a bit bigger
15518 to avoid potential buffer overrun.
15519
ae58ff1f
PE
15520 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15521
c43c8a6a
PE
15522 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15523
3f8236f4
PE
155242011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15525
53e9fe90 15526 Integer overflow fixes for scrolling, etc.
6511acf2
PE
15527 Without these, Emacs silently mishandles large integers sometimes.
15528 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
15529 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15530
6511acf2
PE
15531 * xdisp.c (try_window_id): Check Emacs fixnum range before
15532 converting to 'int'.
806add1d 15533
6511acf2 15534 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
15535 Check that an Emacs fixnum is in range before assigning it to 'int'.
15536 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15537 values converted from Emacs fixnums.
15538 (Frecenter): Don't wrap around a line count if it is out of 'int'
15539 range; instead, treat it as an extreme value.
15540 (Fset_window_configuration, compare_window_configurations):
15541 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15542
6511acf2
PE
15543 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15544 that can exceed INT_MAX. Check that EMACS_INT value is in range
15545 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
15546 (match_limit): Don't assume that a fixnum can fit in 'int'.
15547
6511acf2 15548 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
15549 exceed INT_MAX.
15550
6511acf2 15551 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
15552 (Fvertical_motion): Don't wrap around LINES values that don't fit
15553 in 'int'. Instead, treat them as extreme values. This is good
15554 enough for windows, which can't have more than INT_MAX lines anyway.
15555
fcb901a7
LMI
155562011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15557
0f2f6b6d
LMI
15558 * Require libxml/parser.h to avoid compilation warning.
15559
fcb901a7
LMI
15560 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15561
15562 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15563 since this reportedly can destroy thread storage.
15564
6e20a0d4
CY
155652011-08-30 Chong Yidong <cyd@stupidchicken.com>
15566
15567 * syntax.c (find_defun_start): Update all cache variables if
15568 exiting early (Bug#9401).
15569
148ae00e
EZ
155702011-08-30 Eli Zaretskii <eliz@gnu.org>
15571
f6cfbd8f
EZ
15572 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15573
148ae00e
EZ
15574 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15575 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15576 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15577
15578 * term.c (tty_append_glyph): New function.
15579 (produce_stretch_glyph): Static function and its prototype deleted.
15580
a66cfb1c
SM
15581 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15582 Add prototypes.
148ae00e 15583
c4a07a4c
PE
155842011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15585
15586 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15587 when checking :margin (Bug#9390).
15588 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 15589 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
15590 so that the name doesn't mislead. All uses changed.
15591
6bc8cd65
JB
155922011-08-28 Johan Bockgård <bojohan@gnu.org>
15593
15594 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15595 set_tty_hooks.
15596
dca4927e
EZ
155972011-08-27 Eli Zaretskii <eliz@gnu.org>
15598
15599 * xdisp.c (move_it_to): Don't bail out early when reaching
15600 position beyond to_charpos, if we are scanning backwards.
15601 (move_it_vertically_backward): When DY == 0, make sure we get to
15602 the first character in the line after the newline.
15603
f2cad773
PE
156042011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15605
15606 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15607 (ccl_driver): Do not generate an out-of-range pointer.
15608 (Fccl_execute_on_string): Remove unnecessary check for
15609 integer overflow, noted by Stefan Monnier in
15610 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15611 Remove a FIXME that didn't need fixing.
15612 Simplify the newly-introduced buffer reallocation code.
15613
0cae2cdb
JB
156142011-08-27 Juanma Barranquero <lekktu@gmail.com>
15615
15616 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15617
5fc295a4 156182011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 15619
70c60eb2 15620 Integer and memory overflow issues (Bug#9196).
726e0ab1 15621
d31850da
PE
15622 * doc.c (get_doc_string): Rework so that
15623 get_doc_string_buffer_size is the actual buffer size, rather than
15624 being 1 less than the actual buffer size; this makes xpalloc more
15625 convenient.
15626
a69fbedb
PE
15627 * image.c (x_allocate_bitmap_record, cache_image):
15628 * xselect.c (Fx_register_dnd_atom):
15629 Simplify previous changes by using xpalloc.
15630
fe5c5d37
PE
15631 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15632 since either will do and ptrdiff_t is convenient with xpalloc.
15633
0065d054
PE
15634 * charset.c (charset_table_size)
15635 (struct charset_sort_data.priority): Now ptrdiff_t.
15636 (charset_compare): Don't overflow if priorities differ greatly.
15637 (Fsort_charsets): Don't assume list length fits in int.
15638 Check for size-calculation overflow when allocating sort data.
15639 (syms_of_charset): Allocate an initial charset table that is
15640 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15641
15642 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15643
15644 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15645 The actual value is always <= INT_MAX, and leaving it unsigned made
15646 overflow checking harder.
15647
15648 * dispextern.h (struct glyph_matrix.rows_allocated)
15649 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15650 with xpalloc. The values are still always <= INT_MAX.
15651
15652 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15653
15654 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15655 (SAFE_NALLOCA): New macro.
15656
15657 * region-cache.c (struct boundary.pos, find_cache_boundary)
15658 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15659 (set_cache_region, invalidate_region_cache)
15660 (revalidate_region_cache, know_region_cache, region_cache_forward)
15661 (region_cache_backward, pp_cache):
15662 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15663 so that ptrdiff_t * can be passed to xpalloc.
15664 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15665 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15666 (pp_cache): Don't assume cache_len fits in int.
15667 * region-cache.h: Adjust extern decls to match.
15668
15669 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15670 EMACS_INT, since either will do, for xpalloc.
15671
15672 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15673 (xnmalloc, xnrealloc, xpalloc): New functions.
15674
726e0ab1
PE
15675 * bidi.c (bidi_shelve_header_size): New constant.
15676 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15677 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15678
51f30bc5 15679 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
15680 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15681 (overlay_strings):
15682 Don't update size of array until after memory allocation succeeds,
15683 because xmalloc/xrealloc may not return.
0065d054
PE
15684 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15685 now that we have proper integer overflow checking.
15686 (record_overlay_string, overlay_strings): Catch overflows when
15687 calculating size of overlay_str_buf.
726e0ab1 15688
0065d054
PE
15689 * callproc.c (Fcall_process): Check for size overflow when
15690 calculating size of args2.
15691 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15692 Normally we prefer signed values, but sticking with ptrdiff_t would
15693 require adding more-complicated checks.
726e0ab1
PE
15694
15695 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15696 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15697 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 15698 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
15699
15700 * character.c (Fstring): Check for size-calculation overflow.
15701
15702 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15703 unnecessary integer overflow. Check for size overflow.
15704 (encode_coding_object): Don't update size until xmalloc succeeds.
15705
15706 * composite.c (get_composition_id): Check for overflow in glyph
15707 length calculations.
15708
15709 Integer and memory overflow fixes for display code.
15710 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15711 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15712 (scrolling_window): Check for overflow in size calculations.
15713 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15714 Don't assume glyph table len fits in int.
15715 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15716 (row_table_size): Now ptrdiff_t, not int.
15717 (scrolling_window): Avoid overflow in size calculations.
15718 Don't update size until allocation succeeds.
15719 * fns.c (concat): Check for overflow in size calculations.
15720 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15721 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15722 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15723
15724 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15725 (get_doc_string): Check for size calculation overflow.
15726 Don't update size until allocation succeeds.
15727 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15728 EMACS_INT, where ptrdiff_t will do.
15729 (Fsubstitute_command_keys): Check for string overflow.
15730
15731 * editfns.c (set_time_zone_rule): Don't assume environment length
15732 fits in int.
15733 (message_length): Now ptrdiff_t, not int.
15734 (Fmessage_box): Don't update size until allocation succeeds.
15735 Don't assume message length fits in int.
15736 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15737
0065d054
PE
15738 * emacs.c (main): Do not reallocate argv, since there is a null at
15739 the end that can be overwritten, and this way there's no need to
15740 worry about size-calculation overflow.
15741 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
15742
15743 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15744 alloc succeeds.
15745 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15746
15747 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15748 (x_set_scroll_bar_width, x_figure_window_size):
15749 Check for integer overflow.
15750 (x_set_alpha): Do not assume XINT fits in int.
15751
15752 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15753 This is for the members text_lines, text_cols, total_lines, total_cols,
15754 where the system imposes an 'int' limit.
15755
15756 * fringe.c (Fdefine_fringe_bitmap):
15757 Don't update size until alloc works.
15758
15759 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15760 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15761
15762 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15763 Check for size-calculation overflow.
15764 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15765 do, as we prefer signed integers.
15766 (id_to_widget.max_size, id_to_widget.used)
15767 (xg_store_widget_in_map, xg_remove_widget_from_map)
15768 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15769 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15770 Use and return ptrdiff_t, not int.
15771 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15772 * gtkutil.h: Change prototypes to match the above.
15773
15774 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15775 are duplicate now that they've been promoted to lisp.h.
15776 (x_allocate_bitmap_record, x_alloc_image_color)
15777 (make_image_cache, cache_image, xpm_load):
15778 Don't update size until alloc is done.
15779 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15780 (x_detect_edges):
3256efce 15781 Check for size calculation overflow.
726e0ab1
PE
15782 (ct_colors_allocated_max): New constant.
15783 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15784 overflow.
3256efce 15785
726e0ab1
PE
15786 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15787 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15788 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15789 Use ptrdiff_t, not int, to count maps.
15790 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
15791 calculations. Don't update size until allocation succeeds.
15792 Redo calculations to avoid overflow.
726e0ab1
PE
15793 * keyboard.h: Change prototypes to match the above.
15794
15795 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15796 to count maps.
15797 (current_minor_maps): Check for size calculation overflow.
15798 * keymap.h: Change prototypes to match the above.
15799
15800 * lread.c (read1, init_obarray): Don't update size until alloc done.
15801
15802 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15803 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15804
726e0ab1
PE
15805 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15806 Now ptrdiff_t, not int.
15807 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15808 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15809
15810 * process.c (Fnetwork_interface_list): Check for overflow
15811 in size calculation.
15812
15813 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15814
15815 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15816 overflow. Don't bother calling xmalloc when xrealloc will do.
15817
15818 * search.c (Freplace_match): Check for size calculation overflow.
15819 (Fset_match_data): Don't assume list lengths fit in 'int'.
15820
15821 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15822 for command line length. Do not attempt to address one before the
15823 beginning of an array, as that's not portable.
15824
15825 * term.c (max_frame_lines): Remove; unused.
15826 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15827 not int.
15828 (encode_terminal_code, calculate_costs): Check for size
15829 calculation overflow.
15830 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15831 table lengths and related sizes. Don't update size until alloc
15832 done. Redo calculations to avoid overflow.
15833 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15834
15835 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15836 subtracting pointers.
15837 (gobble_line): Check for overflow more carefully. Don't update size
15838 until alloc done.
15839
15840 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15841 Don't update size until alloc done.
15842 Redo size calculations to avoid overflow.
15843 Check for size calculation overflow.
0065d054 15844 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
15845
15846 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15847 Use ptrdiff_t, not int, for sizes.
15848 (store_mode_line_noprop_char): Don't update size until alloc done.
15849
0065d054
PE
15850 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15851 Use ptrdiff_t, not int, for sizes.
15852 (Finternal_make_lisp_face, cache_face):
15853 Check for size calculation overflow.
15854 (cache_face): Treat size calculation overflows as if they were
15855 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
15856
15857 * xfns.c (x_encode_text, x_set_name_internal)
15858 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15859 sizes, since they can exceed INT_MAX in size. Check for size
15860 calculation overflow.
15861
0065d054
PE
15862 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15863 (xg_select): Check for size calculation overflow.
726e0ab1
PE
15864 Don't update size until alloc done.
15865
0065d054 15866 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 15867 as sprintf is limited to int lengths.
1d526e2f 15868
252c5ee1
PE
15869 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15870 (X_LONG_MIN): New macros.
864d7ce7
PE
15871 Use them to make the following changes clearer.
15872 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15873 This change doesn't affect the value now, but it may help remind
15874 future maintainers not to raise the value too much later.
15875 (SELECTION_QUANTUM): Remove, replacing with ...
15876 (selection_quantum): ... new function, which avoids overflow.
15877 All uses changed.
15878 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15879 assumption that selection length fits in 'int'.
15880 (x_reply_selection_request, x_handle_selection_request)
15881 (x_get_window_property, receive_incremental_selection)
15882 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15883 (lisp_data_to_selection_data, clean_local_selection_data):
15884 Use ptrdiff_t, not int, to record length of selection.
15885 (x_reply_selection_request, x_get_window_property)
15886 (receive_incremental_selection, x_property_data_to_lisp):
15887 Redo calculations to avoid overflow.
15888 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 15889 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
15890 something.
15891 (x_get_window_property, receive_incremental_selection)
15892 (lisp_data_to_selection_data, x_property_data_to_lisp):
15893 Check for size-calculation overflow.
15894 (x_get_window_property, receive_incremental_selection)
15895 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15896 Don't store size until memory allocation succeeds.
15897 (x_get_window_property): Plug memory leak on memory exhaustion.
15898 Don't double-block input; malloc is safe here. Don't assume 2**34
15899 - 4 fits in unsigned long. Add an xassert to check
15900 XGetWindowProperty overflow. Be more careful about overflow
15901 calculations, and distinguish size from memory overflow better.
15902 (receive_incremental_selection): When tracing, don't assume
15903 unsigned int is less than INT_MAX.
15904 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15905 harmful) conversions of unsigned short to int.
15906 (lisp_data_to_selection_data): Don't assume that integers
15907 in the range -65535 through -1 fit in an X unsigned short.
15908 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15909 result parameters unless successful. Rely on cons_to_unsigned
15910 to report problems with elements; the old code wasn't right anyway.
15911 (x_check_property_data): Check for int overflow; we cannot use
15912 a wider type due to X limits.
15913 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15914
726e0ab1 15915 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 15916
0065d054
PE
15917 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15918 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
15919 (x_color_cells): Don't store size until memory allocation succeeds.
15920 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 15921 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
15922 (x_term_init): Don't assume length fits in int (sprintf is limited
15923 to int size).
bc18e09d 15924
ebfa62c0
PE
15925 Use ptrdiff_t for composition IDs.
15926 * character.c (lisp_string_width):
15927 * composite.c (composition_table_size, n_compositions)
15928 (get_composition_id, composition_gstring_from_id):
15929 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15930 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15931 * window.c (Frecenter):
15932 Use ptrdiff_t, not int, for composition IDs.
15933 * composite.c (get_composition_id): Check for integer overflow.
15934 * composite.h: Adjust prototypes to match the above changes.
15935
d3411f89
PE
15936 Use ptrdiff_t for hash table indexes.
15937 * category.c (hash_get_category_set):
15938 * ccl.c (ccl_driver):
15939 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15940 * coding.c (coding_system_charset_list, detect_coding_system):
15941 * coding.h (struct coding_system.id):
15942 * composite.c (get_composition_id, gstring_lookup_cache):
15943 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15944 * image.c (xpm_get_color_table_h):
15945 * lisp.h (hash_lookup, hash_put):
15946 * minibuf.c (Ftest_completion):
15947 Use ptrdiff_t for hash table indexes, not int (which is too
15948 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15949 32-bit --with-wide-int hosts).
15950
e097a6fa
PE
15951 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15952 Add a FIXME comment about memory leaks.
15953 (syms_of_charset): Don't assume xmalloc returns.
15954
5637687f
PE
15955 Don't assume that stated character widths fit in int.
15956 * character.c (Fchar_width, c_string_width, lisp_string_width):
15957 * character.h (CHAR_WIDTH):
15958 * indent.c (MULTIBYTE_BYTES_WIDTH):
15959 Use sanitize_char_width to avoid undefined and/or bad behavior
15960 with outlandish widths.
a66cfb1c 15961 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
15962 now that we have two such functions. All uses changed.
15963 (sanitize_char_width): New inline function.
15964
a2271ba2
PE
15965 Don't assume that tab-width fits in int.
15966 * character.h (sanitize_width): New inline function.
15967 (SANE_TAB_WIDTH): New macro.
15968 (ASCII_CHAR_WIDTH): Use it.
15969 * indent.c (sane_tab_width): Remove. All uses replaced by
15970 SANE_TAB_WIDTH (current_buffer).
15971 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15972
18c52557
PE
15973 * fileio.c: Integer overflow issues with file modes.
15974 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15975
caeeedc1
PE
15976 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15977 Remove unreachable code.
15978 (read_hex, load_charset_map_from_file): Check for integer overflow.
15979
6df6ae42 15980 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
15981 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15982 (x_send_scroll_bar_event): Likewise. Check that the size does not
15983 exceed limits imposed by XClientMessageEvent, as well as the usual
15984 ptrdiff_t and size_t limits.
15985
b13995db
PE
15986 * keyboard.c: Overflow, signedness and related fixes.
15987 (make_lispy_movement): Use same integer type in forward decl
15988 that is used in the definition.
15989 (read_key_sequence, keyremap_step):
15990 Change bufsize argument back to int, undoing my 2011-03-30 change.
15991 We prefer signed types, and int is wide enough here.
15992 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15993 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15994 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15995 length, not size_t. Use ptrdiff_t for index, not int.
15996 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15997 possibility of integer overflow.
15998
13464394
PE
15999 Overflow, signedness and related fixes for images.
16000
16001 * dispextern.h (struct it.stack[0].u.image.image_id)
16002 (struct_it.image_id, struct image.id, struct image_cache.size)
16003 (struct image_cache.used, struct image_cache.ref_count):
16004 * gtkutil.c (update_frame_tool_bar):
16005 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16006 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16007 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16008 * nsmenu.m (update_frame_tool_bar):
16009 * xdisp.c (calc_pixel_width_or_height):
16010 * xfns.c (image_cache_refcount):
16011 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16012 on typical 64-bit hosts.
16013
16014 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16015 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16016 Omit unnecessary casts to int.
16017 (parse_image_spec): Check that integers fall into 'int' range
16018 when the callers expect that.
16019 (image_ascent): Redo ascent calculation to avoid int overflow.
16020 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16021 (lookup_image): Remove unnecessary tests.
16022 (xbm_image_p): Locals are now of int, not EMACS_INT,
16023 since parse_image_check makes sure they fit into int.
16024 (png_load, gif_load, svg_load_image):
16025 Prefer int to unsigned where either will do.
16026 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
16027 old tiff_error_handler and tiff_warning_handler.
16028 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
16029 stack buffer overflows. It uses only the features of vsnprintf
16030 that are common to both POSIX and native Microsoft.
16031 (tiff_error_handler, tiff_warning_handler): Use it.
16032 (tiff_load, gif_load, imagemagick_load_image):
16033 Don't assume :index value fits in 'int'.
16034 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16035 (imagemagick_load_image): Check that crop parameters fit into
16036 the integer types that MagickCropImage accepts. Don't assume
16037 Vimagemagick_render_type has a nonnegative value. Don't assume
16038 size_t fits in 'long'.
16039 (gs_load): Use printmax_t to print the widest integers possible.
16040 Check for integer overflow when computing image height and width.
16041
c11821d4
EZ
160422011-08-26 Eli Zaretskii <eliz@gnu.org>
16043
16044 * xdisp.c (redisplay_window): Don't force window start if point
16045 will be invisible in the resulting window. (Bug#9324)
16046
0c95fcf7
EZ
160472011-08-25 Eli Zaretskii <eliz@gnu.org>
16048
16049 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16050 the display spec is of the form `(space ...)'.
16051 (handle_display_spec): Return the value returned by
16052 handle_single_display_spec, not just 1 or zero.
16053 (handle_single_display_spec): If the display spec is of the form
16054 `(space ...)', and specifies display in the text area, return 2
16055 rather than 1.
fee65a97 16056 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
16057 accurately, and prefer exact match for point under bidi.
16058 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
16059
16060 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16061 into disp_prop; all users changed.
16062
16063 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16064 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16065 for the text covered by the display property.
16066
e4ed06f1
CY
160672011-08-25 Chong Yidong <cyd@stupidchicken.com>
16068
16069 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16070 Change return value to nil.
16071 (Frecord_buffer): Delete unused function.
16072
f67cdd7f
EZ
160732011-08-24 Eli Zaretskii <eliz@gnu.org>
16074
5980d4c6
EZ
16075 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16076 buffers, return left-to-right.
8610fe8b
EZ
16077 (set_cursor_from_row): Consider candidate row a win if its glyph
16078 represents a newline and point is on that newline. Fixes cursor
16079 positioning on the newline at EOL of R2L text within L2R
16080 paragraph, and vice versa.
16081 (try_cursor_movement): Check continued rows, in addition to
16082 continuation rows. Fixes unwarranted scroll when point enters a
16083 continued line of R2L text within an L2R paragraph, or vice versa.
16084 (cursor_row_p): Consider the case of point being equal to
16085 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16086 from the end of a short line to the beginning of a continued line
16087 of R2L text within L2R paragraph.
16088 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16089 composed characters.
5980d4c6 16090
f67cdd7f
EZ
16091 * bidi.c (bidi_check_type): Use xassert.
16092 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16093 members.
16094
bca633fb
EZ
160952011-08-23 Eli Zaretskii <eliz@gnu.org>
16096
16097 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16098 a character.
16099
4a5885a7
CY
161002011-08-23 Chong Yidong <cyd@stupidchicken.com>
16101
16102 * nsfont.m (ns_otf_to_script): Fix typo.
16103
0902a04e
KH
161042011-08-22 Kenichi Handa <handa@m17n.org>
16105
16106 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16107 extra slot even if the purpose is char-code-property-table.
16108
1a2e6670
EZ
161092011-08-23 Eli Zaretskii <eliz@gnu.org>
16110
8ddde651
EZ
16111 * xdisp.c (redisplay_window): When computing centering_position,
16112 account for the height of the header line. (Bug#8874)
16113
425cc014
EZ
16114 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16115 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16116 candidate is selected by the mouse, and that candidate has a
16117 composed character under the mouse.
16118
1a2e6670
EZ
16119 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16120 coordinates reported by pos-visible-in-window-p for a composed
16121 character in column zero.
16122
8b76d6f8
SM
161232011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16124
16125 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16126
dac347dd
EZ
161272011-08-22 Eli Zaretskii <eliz@gnu.org>
16128
16129 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16130 consider it a hit if to_charpos is anywhere in the range of the
16131 composed buffer positions.
16132
e013fb34
CY
161332011-08-22 Chong Yidong <cyd@stupidchicken.com>
16134
16135 * image.c (gif_load): Don't assume that each subimage has the same
16136 dimensions as the base image. Handle disposal method that is
16137 "undefined" by the gif spec (Bug#9335).
16138
bd1ba3e8
CY
161392011-08-20 Chong Yidong <cyd@stupidchicken.com>
16140
16141 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 16142 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 16143
54a1215b
EZ
161442011-08-19 Eli Zaretskii <eliz@gnu.org>
16145
823564e5
EZ
16146 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16147 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16148 from an Org mode buffer to a Speedbar frame.
16149
54a1215b
EZ
16150 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16151 a composition, take its buffer position from IT->cmp_it.charpos.
16152 Fixes cursor positioning at the beginning of a line that begins
16153 with a composed character.
16154
9778ebcc
EZ
161552011-08-18 Eli Zaretskii <eliz@gnu.org>
16156
0be6ee06
EZ
16157 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16158 character bidirectional type, use STRONG_L instead. Fixes crashes
16159 in a buffer produced by `describe-categories'.
16160
9778ebcc
EZ
16161 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16162 members before the level stack, so they would be saved and
16163 restored when copying iterator state. Fixes incorrect reordering
16164 around TABs covered by display properties.
16165
156bffbe
AS
161662011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16167
6b02f655 16168 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 16169
72ad093b
CY
161702011-08-17 Chong Yidong <cyd@stupidchicken.com>
16171
16172 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
16173 (internal_condition_case_2, internal_condition_case_n):
16174 Remove unnecessary aborts (Bug#9081).
72ad093b 16175
35774242
EZ
161762011-08-17 Eli Zaretskii <eliz@gnu.org>
16177
16178 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16179 has no `load' handler, try opening the file locally. (Bug#9311)
16180
db76dd85
KB
161812011-08-16 Ken Brown <kbrown@cornell.edu>
16182
16183 * gmalloc.c: Expand comment.
16184
b215eee5
EZ
161852011-08-16 Eli Zaretskii <eliz@gnu.org>
16186
16187 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16188 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16189
a4579d33
KB
161902011-08-16 Ken Brown <kbrown@cornell.edu>
16191
16192 Fix memory allocation problems in Cygwin build (Bug#9273).
16193
16194 * unexcw.c ( __malloc_initialized): Declare external variable.
16195 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16196
8b76d6f8
SM
16197 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16198 New variables.
a4579d33
KB
16199 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16200 dumped emacs.
16201 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16202 in the static heap.
16203 [CYGWIN] (special_realloc): New function.
16204 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16205 requests to realloc storage in the static heap.
16206
3ebec551
PE
162072011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16208
16209 * bidi.c (bidi_initialize): Remove unused local.
16210
9fd8be00
EZ
162112011-08-15 Eli Zaretskii <eliz@gnu.org>
16212
6b02f655
SM
16213 * bidimirror.h:
16214 * biditype.h: Remove file.
16215 * makefile.w32-in ($(BLD)/bidi.$(O)):
16216 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
16217
16218 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16219
16220 * chartab.c: Improve commentary for the uniprop_table API.
16221
32413314
EZ
16222 * bidi.c (bidi_paragraph_init): Support zero value of
16223 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
16224 (bidi_initialize): Use uniprop_table instead of including
16225 biditype.h and bidimirror.h.
32413314 16226
9fd8be00
EZ
16227 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16228 coordinates of the iterator when restoring from ppos_it.
16229 (Bug#9296)
16230
5cf2b69b
KH
162312011-08-14 Kenichi Handa <handa@m17n.org>
16232
16233 * process.c (create_process): Call setup_process_coding_systems
72ad093b 16234 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 16235
daf17d00
EZ
162362011-08-14 Eli Zaretskii <eliz@gnu.org>
16237
16238 * xdisp.c (move_it_in_display_line_to): Don't invoke
16239 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16240 ppos_it. Fixes vertical cursor motion when line beginning is
16241 covered by an image. (Bug#9296)
16242
08e3161a
JD
162432011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16244
16245 * nsterm.h (ns_run_ascript): Declare.
16246 (NSAPP_DATA2_RUNASSCRIPT): Define.
16247
16248 * nsfns.m (as_script, as_result, as_status): New static variables.
16249 (ns_run_ascript): New function.
5e617bc2 16250 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
16251 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16252 the event loop. Get status from as_status (Bug#7276).
16253
16254 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16255 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16256 the event loop (Bug#7276).
16257
a3720aa2
AS
162582011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16259
16260 * gnutls.c (QCgnutls_bootprop_priority)
16261 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16262 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16263 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16264 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16265 (QCgnutls_bootprop_verify_hostname_error)
16266 (QCgnutls_bootprop_callbacks_verify): Rename from
16267 Qgnutls_bootprop_..., all uses changed.
16268
16269 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16270 uses changed.
16271
0a0d27fb
PE
162722011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16273
19d5c50c
PE
16274 * xfaces.c (Qframe_set_background_mode): Now static.
16275 * dispextern.h (Qframe_set_background_mode): Remove decl.
16276
0a0d27fb
PE
16277 * process.c (Fnetwork_interface_info): Declare local only if needed.
16278
377538cb
JD
162792011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16280
16281 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16282 (Fnetwork_interface_list): Allocate in increments of bytes instead
16283 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16284 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16285 sockaddr.
16286 (struct ifflag_def): notrailers is smart on OSX.
16287 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16288 Get hardware address with getifaddrs if available.
16289
08fff70c
EZ
162902011-08-12 Eli Zaretskii <eliz@gnu.org>
16291
16292 * xdisp.c (iterate_out_of_display_property): xassert that
16293 IT->position is set to within IT->object's boundaries. Break from
16294 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
16295 when IT->position is set up wrongly due to some bug.
16296 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
16297 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16298 entry. Force push_it to save on the stack the current
16299 buffer/string position, to be restored by pop_it. Fix flags in
16300 the iterator structure wrt the object coming from a display
16301 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16302 properties. (Bug#9284)
16303
7be1c708 163042011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 16305
7be1c708
CY
16306 * fontset.c (fontset_get_font_group): Add proper type checks.
16307 (Bug#9172)
aac0c6e3 16308
7be1c708 163092011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 16310
7be1c708
CY
16311 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16312 and LC_VERSION_MIN_MACOSX.
16313 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16314 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 16315
97bb72a6
EZ
163162011-08-08 Eli Zaretskii <eliz@gnu.org>
16317
16318 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
16319 no-display-properties-and-no-overlays under bidi display.
16320 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 16321 properties and overlays.
97bb72a6 16322
d5617611
CY
163232011-08-08 Chong Yidong <cyd@stupidchicken.com>
16324
37e11a63
CY
16325 * editfns.c (Fset_time_zone_rule): Document relationship with the
16326 setenv function.
16327
d5617611
CY
16328 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16329 the font entity extracted from the cache (Bug#8109).
16330
58872834
CY
163312011-08-07 Chong Yidong <cyd@stupidchicken.com>
16332
16333 * composite.c (autocmp_chars): Don't reset point. That is done by
16334 restore_point_unwind (Bug#5984).
16335
75bfc667
JL
163362011-08-07 Juri Linkov <juri@jurta.org>
16337
16338 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16339 to show the arg `TIME' instead of `TIMEVAL'.
16340
d1410150
EZ
163412011-08-06 Eli Zaretskii <eliz@gnu.org>
16342
16343 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16344 display property strides EOL and includes a newline, as in
16345 longlines-mode. (Bug#9254)
75b771e4
EZ
16346 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16347 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
16348
16349 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16350 is non-zero, even if the data buffer is NULL. Fixes a crash in
16351 vertical-motion with longlines-mode. (Bug#9254)
16352
35928349
EZ
163532011-08-05 Eli Zaretskii <eliz@gnu.org>
16354
ec7cc85b
EZ
16355 * bidi.c <bidi_cache_total_alloc>: Now static.
16356 (bidi_initialize): Initialize bidi_cache_total_alloc.
16357
8b76d6f8 16358 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
16359 cache. (Bug#9221)
16360
16361 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16362 amount allocated this far in `bidi_cache_total_alloc'.
16363 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16364 non-zero, only free the data buffer without restoring the cache
16365 contents. All callers changed.
16366
16367 * dispextern.h (bidi_unshelve_cache): Update prototype.
16368
16369 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16370 (move_it_in_display_line, move_it_to)
16371 (move_it_vertically_backward, move_it_by_lines): Replace the call
16372 to xfree to an equivalent call to bidi_unshelve_cache.
16373 (move_it_in_display_line_to): Fix logic of returning
412b6358 16374 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 16375
e2e2423b
EZ
163762011-08-05 Eli Zaretskii <eliz@gnu.org>
16377
16378 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16379 came from a string character with a `cursor' property. (Bug#9229)
16380
ae9e757a
JD
163812011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16382
16383 * Makefile.in (LIB_PTHREAD): New variable.
16384 (LIBES): Add LIB_PTHREAD (Bug#9216).
16385
16386 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16387 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16388
213bd7f2
AS
163892011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16390
6b02f655 16391 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 16392
99aaf75f
JD
163932011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16394
16395 * xterm.c (x_find_topmost_parent): New function.
16396 (x_set_frame_alpha): Find topmost parent window with
16397 x_find_topmost_parent and set the property there also (bug#9181).
16398 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16399
c74e9d86
PE
164002011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16401
16402 * callproc.c (Fcall_process): Avoid vfork clobbering
16403 the local vars buffer, coding_systems, current_dir.
16404
640c8776
SM
164052011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16406
16407 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16408
f26d0e4c
PE
164092011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16410
8a10d76c
PE
16411 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16412 so that it is not optimized away.
16413
f26d0e4c
PE
16414 * xdisp.c (compute_display_string_pos): Remove unused local.
16415
55439c61
EZ
164162011-08-02 Eli Zaretskii <eliz@gnu.org>
16417
16418 Fix slow cursor motion and scrolling in large buffers with
16419 selective display, like Org Mode buffers. (Bug#9218)
16420
16421 * dispextern.h (struct bidi_it): New member disp_prop_p.
16422
16423 * xdisp.c: Remove one-slot cache of display string positions.
16424 (compute_display_string_pos): Accept an additional argument
5e617bc2 16425 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
16426 for a display string or property. If found, set DISP_PROP_P
16427 non-zero.
16428
16429 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
16430 DISP_PROP_P, and pass it to compute_display_string_pos.
16431 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
16432 non-zero. All callers of bidi_fetch_char changed.
16433
fb33fa43
SM
164342011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16435
16436 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16437
b099e063
DM
164382010-12-03 Don March <don@ohspite.net>
16439
16440 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16441 last character M-[char] is translated to ESC [char] (bug#7541).
16442
5cc7f7af
KH
164432011-08-02 Kenichi Handa <handa@m17n.org>
16444
d0fffa3f 16445 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
16446
16447 * chartab.c (uniprop_table): Make it non-static.
16448
525d5e6e
EZ
164492011-08-01 Eli Zaretskii <eliz@gnu.org>
16450
16451 * xdisp.c (forward_to_next_line_start): Accept additional argument
16452 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16453 on the newline.
16454 (reseat_at_next_visible_line_start): Use the bidi iterator state
16455 returned by forward_to_next_line_start to restore the state of
16456 it->bidi_it after backing up to previous newline. (Bug#9212)
16457
31011111
AS
164582011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16459
16460 * regex.c (re_comp): Protoize.
16461 (re_exec): Fix return type.
16462 (regexec): Fix type of `ret'. (Bug#9203)
16463
476371c4
PE
164642011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16465
e5d76069
PE
16466 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16467 This is needed if max-image-size is a floating-point number.
16468
9a79b20c
AS
164692011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16470
16471 * print.c (print_object): Print empty symbol as ##.
16472
16473 * lread.c (read1): Read ## as empty symbol.
16474
d8c2fa78
AA
164752011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16476
16477 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16478 setting frame foreground color (Bug#9175).
16479 (x_set_background_color): Likewise.
16480
ffe57a7a
AA
16481 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16482 contents (Bug#9176).
16483 (EmacsTooltip -init): Remove bezels and add shadows to
16484 tooltip windows.
16485
bf3492a5
AA
16486 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16487 or scroll bar (Bug#8470).
16488
d55e9c53
AA
16489 * nsfont.m (nsfont_open): Remove assignment to voffset and
16490 unnecessary vars hshink, expand, hd, full_height, min_height.
16491 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16492
16493 * nsterm.h (nsfont_info): Remove voffset field.
16494
d8c2fa78 164952011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
16496
16497 Implement strike-through and overline on NextStep (Bug#8863).
16498
16499 * nsfont.m (nsfont_open): Use underline position provided by font,
16500 instead of hard-coded value of 2.
16501 (nsfont_draw): Call ns_draw_text_decoration instead.
16502
16503 * nsterm.h: Add declaration for ns_draw_text_decoration.
16504
16505 * nsterm.m (ns_draw_text_decoration): New function for drawing
16506 underline, overline, and strike-through.
16507 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16508 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 16509 accommodate underlining, etc.
4843aac3 16510
4cc60b9b
EZ
165112011-07-28 Eli Zaretskii <eliz@gnu.org>
16512
bc7ece87
EZ
16513 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16514 default.
4cc60b9b 16515
476371c4
PE
165162011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16517
66606eea
PE
16518 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16519 Without this fix, if a signal arrives just after memory fills up,
16520 'malloc' might be invoked reentrantly.
16521
476371c4
PE
16522 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16523 In other words, assume that every image size is allowed, on non-X
16524 hosts. This assumption is probably wrong, but it lets Emacs compile.
16525
f3fcc40d
AS
165262011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16527
16528 * regex.c (re_iswctype): Convert return values to boolean.
16529
350c992f
EZ
165302011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16531
16532 * xdisp.c (compute_display_string_pos): Don't use cached display
16533 string position if the buffer had its restriction changed.
16534 (Bug#9184)
16535
5266b4bb
PE
165362011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16537
16538 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16539
2573a837 165402011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 16541
41f55ccd 16542 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 16543
39e378da
PE
16544 * bidi.c: Integer size and overflow fixes.
16545 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16546 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16547 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16548 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16549 (bidi_find_other_level_edge):
16550 Use ptrdiff_t instead of EMACS_INT where either will do.
16551 This works better on 32-bit hosts configured --with-wide-int.
16552 (bidi_cache_ensure_space): Check for size-calculation overflow.
16553 Use % rather than repeated addition, for better worst-case speed.
16554 Don't set bidi_cache_size until after xrealloc returns, because it
16555 might not return.
16556 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
16557 (bidi_cache_ensure_space): Also check that the bidi cache size
16558 does not exceed that of the largest Lisp string or buffer. See Eli
16559 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 16560
5e927815
PE
16561 * alloc.c (__malloc_size_t): Remove.
16562 All uses replaced by size_t. See Andreas Schwab's note
16563 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16564
ca4aa935
PE
16565 * image.c: Improve checking for integer overflow.
16566 (check_image_size): Assume that f is nonnull, since
16567 it is always nonnull in practice. This is one less thing to
16568 worry about when checking for integer overflow later.
16569 (x_check_image_size): New function, which checks for integer
16570 overflow issues inside X.
16571 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16572 This removes the need for a memory_full check.
16573 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16574 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16575 (xbm_read_bitmap_data): Change locals back to 'int', since
16576 their values must fit in 'int'.
16577 (xpm_load_image, png_load, tiff_load):
16578 Invoke x_create_x_image_and_pixmap earlier,
16579 to avoid much needless work if the image is too large.
16580 (tiff_load): Treat overly large images as if
16581 x_create_x_image_and_pixmap failed, not as malloc failures.
16582 (gs_load): Use x_check_image_size.
16583
5f8f9cc2
PE
16584 * gtkutil.c: Omit integer casts.
16585 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16586 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16587
5adf60bc
PE
16588 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16589
c8907a93
PE
16590 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16591 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16592 would wrongly return t on a 64-bit host.
16593
e3c25c68
PE
16594 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16595 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16596 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16597 and therefore cause GCC to emit a bogus diagnostic in some cases.
16598
3f791afe
PE
16599 * image.c: Integer signedness and overflow and related fixes.
16600 This is not an exhaustive set of fixes, but it's time to
16601 record what I've got.
16602 (lookup_pixel_color, check_image_size): Remove redundant decls.
16603 (check_image_size): Don't assume that arbitrary EMACS_INT values
16604 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16605 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16606 (tiff_load, imagemagick_load_image):
16607 Check for overflow in size calculations.
16608 (x_create_x_image_and_pixmap): Remove unnecessary test for
16609 xmalloc returning NULL; that can't happen.
16610 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16611 (xpm_color_bucket): Use better integer hashing function.
16612 (xpm_cache_color): Don't possibly over-allocate memory.
16613 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16614 (gif_memory_source):
16615 Use ptrdiff_t, not int or size_t, to record sizes.
16616 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16617 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16618 either works, as we prefer signed integers.
16619 (tiff_read_from_memory, tiff_write_from_memory):
16620 Return tsize_t, not size_t, since that's what the TIFF API wants.
16621 (tiff_read_from_memory): Don't fail simply because the read would
16622 go past EOF; instead, return a short read.
16623 (tiff_load): Omit no-longer-needed casts.
16624 (Fimagemagick_types): Don't assume size fits into 'int'.
16625
3cc5a532
PE
16626 Improve hashing quality when configured --with-wide-int.
16627 * fns.c (hash_string): New function, taken from sxhash_string.
16628 Do not discard information about ASCII character case; this
16629 discarding is no longer needed.
16630 (sxhash-string): Use it. Change sig to match it. Caller changed.
16631 * lisp.h: Declare it.
16632 * lread.c (hash_string): Remove, since we now use fns.c's version.
16633 The fns.c version returns a wider integer if --with-wide-int is
16634 specified, so this should help the quality of the hashing a bit.
16635
b312a492
PE
16636 * emacs.c: Integer overflow minor fix.
16637 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16638 Define only if GNU_LINUX.
16639 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16640
dfd153ae
PE
16641 * dispnew.c: Integer signedness and overflow fixes.
16642 Remove unnecessary forward decls, that were a maintenance hassle.
16643 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16644 All uses changed.
16645 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16646 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16647 (prepare_desired_row, line_draw_cost):
16648 Use int, not unsigned, where either works.
16649 (save_current_matrix, restore_current_matrix):
16650 Use ptrdiff_t, not size_t, where either works.
16651 (init_display): Check for overflow more accurately, and without
16652 relying on undefined behavior.
16653
a81d11a3
PE
16654 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16655 Remove, replacing with the new symbols in lisp.h. All uses changed.
16656 * fileio.c (make_temp_name):
16657 * filelock.c (lock_file_1, lock_file):
16658 * xdisp.c (message_dolog):
16659 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16660 Use pMd etc. instead.
16661 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16662 replacing the pWIDE etc. symbols removed from editfns.c.
16663
3300e6fd
PE
16664 * keyboard.h (num_input_events): Now uintmax_t.
16665 This is (very slightly) less likely to mess up due to wraparound.
16666 All uses changed.
16667
fd05c7e9
PE
16668 * buffer.c: Integer signedness fixes.
16669 (alloc_buffer_text, enlarge_buffer_text):
16670 Use ptrdiff_t rather than size_t when either will do, as we prefer
16671 signed integers.
16672
903fe15d
PE
16673 * alloc.c: Integer signedness and overflow fixes.
16674 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16675 (__malloc_size_t): Default to size_t, not to int.
16676 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16677 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16678 Prefer ptrdiff_t to size_t when either would do, as we prefer
16679 signed integers.
16680 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16681 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16682 Now const. Initialize with values that are in range even if char
16683 is signed.
16684 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16685 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16686 These functions do the right thing with sizes > 2**32.
16687 (check_depth): Now ptrdiff_t, not int.
16688 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16689 Adjust to new way of storing sizes. Check for size overflow bugs
16690 in rest of code.
16691 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16692 slightly wrong anyway, as it missed one instance of
16693 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16694 (refill_memory_reserve): Omit needless cast to size_t.
16695 (mark_object_loop_halt): Mark as externally visible.
16696
ac82cc6a
PE
16697 * xselect.c: Integer signedness and overflow fixes.
16698 (Fx_register_dnd_atom, x_handle_dnd_message):
16699 Use ptrdiff_t, not size_t, since we prefer signed.
16700 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16701 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16702 x_dnd_atoms_size and x_dnd_atoms_length.
16703
c2d1e36d
PE
16704 * doprnt.c: Prefer signed to unsigned when either works.
16705 * eval.c (verror):
16706 * doprnt.c (doprnt):
16707 * lisp.h (doprnt):
16708 * xdisp.c (vmessage):
16709 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16710 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16711 prefer signed arithmetic to avoid comparison confusion.
16712 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16713 but is a bit tricky.
16714
0e926e56
PE
16715 Assume freestanding C89 headers, string.h, stdlib.h.
16716 * data.c, doprnt.c, floatfns.c, print.c:
16717 Include float.h unconditionally.
16718 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16719 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16720 * regex.c: Likewise for stddef.h, string.h.
16721 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16722 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16723 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16724 (STDC_HEADERS): Remove obsolete defines.
16725 * sysdep.c: Include limits.h unconditionally.
16726
9cfdb3ec
PE
16727 Assume support for memcmp, memcpy, memmove, memset.
16728 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16729 * regex.c (memcmp, memcpy):
16730 Remove; we assume C89 now.
16731
16732 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16733 (__malloc_safe_bcopy): Remove; no longer needed.
16734
cf950e6b 16735 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
16736 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16737 well either way, and we prefer signed to unsigned.
16738
dbf38e02
LMI
167392011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16740
16741 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16742 closes the connection while we're reading (bug#9182).
16743
d6f0886c 167442011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 16745
d6f0886c
JD
16746 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16747 are specified (Bug#9168).
24e0f6b1 16748
2eb1f9e6
PE
167492011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16750
16751 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16752 Found by GCC static checking and --with-wide-int on a 32-bit host.
16753
22381272 167542011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
16755
16756 * xdisp.c (compute_display_string_pos): Fix logic of caching
16757 previous display string position. Initialize cached_prev_pos to
16758 -1. Fixes slow-down at the beginning of a buffer.
16759
f25e39b4
EZ
167602011-07-24 Eli Zaretskii <eliz@gnu.org>
16761
16762 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16763 for attrs[LFACE_FONTSET_INDEX].
16764
04c4b52e
PE
167652011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16766
16767 * xml.c (parse_region): Remove unused local
16768 that was recently introduced.
16769
c1734fbd
EZ
167702011-07-23 Eli Zaretskii <eliz@gnu.org>
16771
be18c5a5
EZ
16772 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16773 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16774
c1734fbd
EZ
16775 * xdisp.c (move_it_in_display_line_to): Record the best matching
16776 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
16777 exit if none of the characters scanned was an exact match.
16778 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
16779 when exact match is impossible due to invisible text, and the
16780 lines are truncated.
16781
a258d627
JD
167822011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16783
16784 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16785 for OSX >= 10.7.
16786
b6d5a689
EZ
167872011-07-22 Eli Zaretskii <eliz@gnu.org>
16788
0f74f785
EZ
16789 Fix a significant slow-down of cursor motion with C-n, C-p,
16790 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16791 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 16792 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
16793 (next_element_from_buffer): Call compute_stop_pos_backwards to
16794 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
16795 base_level_stop.
16796 (reseat): Don't look for prev_stop, as that could mean a very long
16797 run.
16798 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16799 <cached_disp_overlay_modiff>: Cache for last found display string
16800 position.
551918c1 16801 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
16802 about the same buffer in the same area of character positions, and
16803 the buffer wasn't changed since the time the display string
16804 position was cached.
551918c1 16805
b2d0c91a
EZ
168062011-07-22 Eli Zaretskii <eliz@gnu.org>
16807
16808 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16809 is an integer, which is important for empty lines. (Bug#9149)
16810
043604ee
CY
168112011-07-22 Chong Yidong <cyd@stupidchicken.com>
16812
16813 * frame.c (Fmodify_frame_parameters): In tty case, update the
16814 default face if necessary (Bug#4238).
16815
da4adb04
CY
168162011-07-21 Chong Yidong <cyd@stupidchicken.com>
16817
16818 * editfns.c (Fstring_to_char): No need to explain what a character
16819 is in the docstring (Bug#6576).
16820
9abd0532
LMI
168212011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16822
16823 * xml.c (parse_region): Make sure we always return a tree.
16824
36881d16
HK
168252011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16826
16827 * xml.c (parse_region): If a document contains only comments,
16828 return that, too.
16829
1e98674d
LMI
168302011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16831
16832 * xml.c (make_dom): Return comments, too.
16833
590bd467
PE
168342011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16835
16836 Port to OpenBSD.
16837 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16838 and the surrounding thread.
16839 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16840 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16841 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16842 timer goes off.
16843 * s/openbsd.h (BROKEN_SIGIO): Define.
16844 * unexelf.c (unexec) [__OpenBSD__]:
16845 Don't update the .mdebug section of the Alpha COFF symbol table.
16846
f41628b2
LMI
168472011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16848
16849 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16850 (bug#8460).
16851
b59b67c5
PE
168522011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16853
15e3a074
PE
16854 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16855 This fixes some race conditions on the permissions of any newly
16856 created file.
16857
41bed37d
PE
16858 * alloc.c (valid_pointer_p): Use pipe, not open.
16859 This fixes some permissions issues when debugging.
16860
b59b67c5
PE
16861 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16862 If fchown fails to set both uid and gid, try to set just gid,
16863 as that is sometimes allowed. Adjust the file's mode to eliminate
16864 setuid or setgid bits that are inappropriate if fchown fails.
16865
925a6be7
SM
168662011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16867
16868 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16869 to compare Lisp_Objects.
16870 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16871 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16872 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16873
52968808
AS
168742011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16875
0a6a104b
AS
16876 * lread.c (read_integer): Unread even EOF character.
16877 (read1): Likewise. Properly record start position of symbol.
16878
52968808
AS
16879 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16880 symbol character follows.
16881
9e381cdd
PE
168822011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16883
16884 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16885 This works around a problem with the previous change to Fcopy_file.
16886 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16887 and without this change, GCC might complain about discarding
16888 fchown's return value.
16889
b5641435
JB
168902011-07-16 Juanma Barranquero <lekktu@gmail.com>
16891
16892 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16893
a8031457
PE
168942011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16895
16896 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16897
dd889327
LMI
168982011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16899
750c33f7
LMI
16900 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16901 it's used from the C level.
16902
dd889327
LMI
16903 * process.c: Use the same condition for POLL_FOR_INPUT in both
16904 keyboard.c and process.c (bug#1858).
16905
87e86684
LM
169062011-07-09 Lawrence Mitchell <wence@gmx.li>
16907
16908 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16909 (Fgnutls_boot): Use it.
16910
64348f40
AS
169112011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16912
16913 * doc.c (Fsubstitute_command_keys): Revert last change.
16914
1d698799
LMI
169152011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16916
f863868c
LMI
16917 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16918 quotes the next character, and doesn't affect other longer
16919 sequences (bug#8935).
16920
1d698799
LMI
16921 * lread.c (syms_of_lread): Clarify that is isn't only
16922 `eval-buffer' and `eval-defun' that's affected by
16923 `lexical-binding' (bug#8460).
16924
aa4b6df6
EZ
169252011-07-15 Eli Zaretskii <eliz@gnu.org>
16926
16927 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 16928 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 16929
5d856da6
PE
169302011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16931
ad6042bb
PE
16932 Fix minor problems found by static checking.
16933 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16934 (elsz): Now a signed constant, not a size_t var. We prefer signed
16935 types to unsigned, to avoid integer comparison confusion. Without
16936 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16937 "cannot optimize loop, the loop counter may overflow", a symptom
16938 of the confusion.
f00bbb22 16939 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
16940 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16941
6468f31c
LMI
169422011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16943
49080b10
LMI
16944 * search.c (Fre_search_backward): Mention `case-fold-search' in
16945 all the re_search_* functions (bug#8138).
16946
6468f31c
LMI
16947 * keyboard.c (Fopen_dribble_file): Document when the file is
16948 closed (bug#8056).
16949
c965adc5
EZ
169502011-07-14 Eli Zaretskii <eliz@gnu.org>
16951
df9733bf
EZ
16952 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16953 bidi_cache_idx.
16954
0bb23927
EZ
16955 Support bidi reordering of display and overlay strings.
16956 * xdisp.c (compute_display_string_pos)
16957 (compute_display_string_end): Accept additional argument STRING.
16958 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16959 (reseat_to_string): Initialize bidi_it->string.s and
16960 bidi_it->string.schars.
16961 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
16962 NULL (avoids a crash in bidi_paragraph_init).
16963 Initialize itb.string.lstring.
0bb23927
EZ
16964 (init_iterator): Call bidi_init_it only of a valid
16965 buffer position was specified. Initialize paragraph_embedding to
16966 L2R.
16967 (reseat_to_string): Initialize the bidi iterator.
16968 (display_string): If we need to ignore text properties of
16969 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16970 original value of -1 will not work with bidi.)
16971 (compute_display_string_pos): First arg is now struct
16972 `text_pos *'; all callers changed. Support display properties on
16973 Lisp strings.
16974 (compute_display_string_end): Support display properties on Lisp
16975 strings.
16976 (init_iterator, reseat_1, reseat_to_string): Initialize the
16977 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16978 when iterating on a string not from display properties).
640c8776
SM
16979 (compute_display_string_pos, compute_display_string_end):
16980 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
16981 arrow keys.
16982 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
16983 base_level_stop; instead, set base_level_stop to BEGV.
16984 Fixes crashes in vertical-motion.
0bb23927
EZ
16985 (next_element_from_buffer): Improve commentary for when
16986 the iterator is before prev_stop.
16987 (init_iterator): Initialize bidi_p from the default value of
16988 bidi-display-reordering, not from buffer-local value. Use the
16989 buffer-local value only if initializing for buffer iteration.
16990 (handle_invisible_prop): Support invisible properties on strings
16991 that are being bidi-reordered.
16992 (set_iterator_to_next): Support bidi reordering of C strings and
16993 Lisp strings.
16994 (next_element_from_string): Support bidi reordering of Lisp
16995 strings.
16996 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
16997 (display_string): Support display of R2L glyph rows.
16998 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
16999 (init_iterator): Don't initialize it->bidi_p for strings
17000 here.
17001 (reseat_to_string): Initialize it->bidi_p for strings here.
17002 (next_element_from_string, next_element_from_c_string)
17003 (next_element_from_buffer): Add xassert's for correspondence
17004 between IT's object being iterated and it->bidi_it.string
17005 structure.
17006 (face_before_or_after_it_pos): Support bidi iteration.
17007 (next_element_from_c_string): Handle the case of the first string
17008 character that is not the first one in the visual order.
17009 (get_visually_first_element): New function, refactored from common
17010 parts of next_element_from_buffer, next_element_from_string, and
17011 next_element_from_c_string.
17012 (tool_bar_lines_needed, redisplay_tool_bar)
17013 (display_menu_bar): Force left-to-right direction. Add a FIXME
17014 comment for making that be controlled by a user option.
17015 (push_it, pop_it): Save and restore the state of the
17016 bidi iterator. Save and restore the bidi_p flag.
17017 (pop_it): Iterate out of display property for string iteration as
17018 well.
17019 (iterate_out_of_display_property): Support iteration over strings.
17020 (handle_single_display_spec): Set up it->bidi_it for iteration
17021 over a display string, and call bidi_init_it.
17022 (handle_single_display_spec, next_overlay_string)
17023 (get_overlay_strings_1, push_display_prop): Set up the bidi
17024 iterator for displaying display or overlay strings.
17025 (forward_to_next_line_start): Don't use the shortcut if
17026 bidi-iterating.
17027 (back_to_previous_visible_line_start): If handle_display_prop
17028 pushed the iterator stack, restore the internal state of the bidi
17029 iterator by calling bidi_pop_it same number of times.
17030 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17031 and we are bidi-iterating, don't decrement the iterator position;
17032 instead, set the first_elt flag in the bidi iterator, to produce
17033 the same effect.
17034 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17035 (push_display_prop): xassert that we are iterating a buffer.
17036 (push_it, pop_it): Save and restore paragraph_embedding member.
17037 (handle_single_display_spec, next_overlay_string)
17038 (get_overlay_strings_1, reseat_1, reseat_to_string)
17039 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17040 correctly. Don't assume unibyte strings are not bidi-reordered.
17041 (compute_display_string_pos)
17042 (compute_display_string_end): Fix handling the case of C string.
17043 (push_it, pop_it): Save and restore from_disp_prop_p.
17044 (handle_single_display_spec, push_display_prop): Set the
17045 from_disp_prop_p flag.
17046 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17047 (pop_it): Call iterate_out_of_display_property only if we are
17048 popping after iteration over a string that came from a display
17049 property. Fix a typo in popping stretch info. Add an assertion
17050 for verifying that the iterator position is in sync with the bidi
17051 iterator.
17052 (handle_single_display_spec, get_overlay_strings_1)
17053 (push_display_prop): Fix initialization of paragraph direction for
17054 string when that of the parent object is not yet determined.
17055 (reseat_1): Call bidi_init_it to resync the bidi
17056 iterator with IT's position. (Bug#7616)
17057 (find_row_edges): If ROW->start.pos gives position
17058 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17059 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17060 Reset the from_disp_prop_p flag.
17061 (SAVE_IT, RESTORE_IT): New macros.
17062 (pos_visible_p, face_before_or_after_it_pos)
17063 (back_to_previous_visible_line_start)
17064 (move_it_in_display_line_to, move_it_in_display_line)
17065 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17066 (try_scrolling, redisplay_window, display_line): Use them when
17067 saving a temporary copy of the iterator and restoring it back.
17068 (back_to_previous_visible_line_start, reseat_1)
17069 (init_iterator): Empty the bidi cache "stack".
17070 (move_it_in_display_line_to): If iterator ended up at
17071 EOL, but we never saw any buffer positions smaller than
17072 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17073 motion in bidi-reordered lines.
17074 (move_it_in_display_line_to): Record prev_method and prev_pos
17075 immediately before the call to set_iterator_to_next. Fixes cursor
17076 motion in bidi-reordered lines with stretch glyphs and strings
17077 displayed in margins. (Bug#8133) (Bug#8867)
17078 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17079 TO_CHARPOS.
640c8776
SM
17080 (pos_visible_p): Support positions in bidi-reordered lines.
17081 Save and restore bidi cache.
0bb23927
EZ
17082
17083 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17084 (bidi_paragraph_info): Delete unused struct.
17085 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17086 (bidi_cache_start): New variable.
17087 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17088 to zero.
17089 (bidi_cache_fetch_state, bidi_cache_search)
17090 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17091 (bidi_cache_find, bidi_peek_at_next_level)
17092 (bidi_level_of_next_char, bidi_find_other_level_edge)
17093 (bidi_move_to_visually_next): Compare cache index with
17094 bidi_cache_start rather than with zero.
17095 (bidi_fetch_char): Accept new argument STRING; all callers
17096 changed. Support iteration over a string. Support strings with
17097 display properties. Support unibyte strings. Fix the type of
17098 `len' according to what STRING_CHAR_AND_LENGTH expects.
17099 (bidi_paragraph_init, bidi_resolve_explicit_1)
17100 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
17101 (bidi_level_of_next_char, bidi_move_to_visually_next):
17102 Support iteration over a string.
0bb23927
EZ
17103 (bidi_set_sor_type, bidi_resolve_explicit_1)
17104 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17105 can now be zero (for strings); special values 0 and -1 were
17106 changed to -1 and -2, respectively.
17107 (bidi_char_at_pos): New function.
17108 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17109 Call it instead of FETCH_MULTIBYTE_CHAR.
17110 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17111 initialized to valid values.
17112 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17113 values.
17114 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17115 the test for valid cached positions. Fix the logic for looking up
17116 the sentinel state in the cache. GCPRO the Lisp string we are
17117 iterating.
17118 (bidi_push_it, bidi_pop_it): New functions.
17119 (bidi_initialize): Initialize the bidi cache start stack pointer.
17120 (bidi_cache_ensure_space): New function, refactored from part of
17121 bidi_cache_iterator_state. Don't assume the required size is just
17122 one BIDI_CACHE_CHUNK away.
17123 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17124 (bidi_count_bytes, bidi_char_at_pos): New functions.
17125 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17126 always valid if bidi_cache_idx is valid.
17127 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17128 is valid if it's going to be used.
17129 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17130 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
17131 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17132 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
17133 (bidi_find_other_level_edge, bidi_cache_start_stack):
17134 All variables related to cache indices are now EMACS_INT.
c965adc5 17135
0bb23927
EZ
17136 * dispextern.h (struct bidi_string_data): New structure.
17137 (struct bidi_it): New member `string'. Make flag members be 1-bit
17138 fields, and put them last in the struct.
640c8776
SM
17139 (compute_display_string_pos, compute_display_string_end):
17140 Update prototypes.
0bb23927
EZ
17141 (bidi_push_it, bidi_pop_it): Add prototypes.
17142 (struct iterator_stack_entry): New members bidi_p,
17143 paragraph_embedding, and from_disp_prop_p.
17144 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
17145 (bidi_shelve_cache, bidi_unshelve_cache):
17146 Declare prototypes.
0bb23927
EZ
17147
17148 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17149 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17150 and vector-like objects.
17151
17152 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17153 cache around display iteration.
17154
17155 * window.c (Fwindow_end, window_scroll_pixel_based)
17156 (displayed_window_lines, Frecenter): Save and restore the bidi
17157 cache around display iteration.
17158
3bbd2265
LMI
171592011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17160
17161 * editfns.c (Fdelete_region): Clarify the use of the named
17162 parameters (bug#6788).
17163
adc47434
MR
171642011-07-14 Martin Rudalics <rudalics@gmx.at>
17165
17166 * indent.c (Fvertical_motion): Set and restore w->pointm when
17167 saving and restoring the window's buffer (Bug#9006).
17168
837c31f8
LMI
171692011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17170
17171 * editfns.c (Fstring_to_char): Clarify just what is returned
17172 (bug#6576). Text by Eli Zaretskii.
17173
ac389d0c
JB
171742011-07-13 Juanma Barranquero <lekktu@gmail.com>
17175
17176 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17177
0be0ce47
EZ
171782011-07-13 Eli Zaretskii <eliz@gnu.org>
17179
17180 * buffer.c (mmap_find): Fix a typo.
17181
cd18e7e3
JB
171822011-07-13 Johan Bockgård <bojohan@gnu.org>
17183
17184 Fix execution of x selection hooks.
17185 * xselect.c (Qx_lost_selection_functions)
17186 (Qx_sent_selection_functions): New vars.
17187 (syms_of_xselect): DEFSYM them.
17188 (x_handle_selection_request): Pass Qx_sent_selection_functions
17189 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17190 (x_handle_selection_clear,x_clear_frame_selections):
17191 Pass Qx_lost_selection_functions rather than
17192 Vx_lost_selection_functions to Frun_hook_with_args.
17193
47ea7f44
PE
171942011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17195
ac389d0c 17196 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
17197 The old code sometimes used this field without initializing it.
17198
47ea7f44
PE
17199 * alloc.c (gc_sweep): Don't read past end of array.
17200 In theory, the old code could also have corrupted Emacs internals,
17201 though it'd be very unlikely.
17202
bc985c87
AS
172032011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17204
17205 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 17206 argument. (Bug#4026)
bc985c87 17207
0cf34688
LMI
172082011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17209
b3dadd76
LMI
17210 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17211 key" (bug#4257).
17212
0cf34688
LMI
17213 * window.c (Fset_window_start): Doc fix (bug#4199).
17214 (Fset_window_hscroll): Ditto.
17215
270768cd
PE
172162011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17217
077e3dda 17218 Fix minor new problems caught by GCC 4.6.1.
270768cd 17219 * term.c (init_tty): Remove unused local.
490011a6 17220 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 17221 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 17222 not used otherwise.
270768cd 17223
b1f58454
CY
172242011-07-12 Chong Yidong <cyd@stupidchicken.com>
17225
17226 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17227
22b9578d
LMI
172282011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17229
6e70ab07
LMI
17230 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17231 are the mini-buffer and the echo area (bug#3320).
17232
22b9578d
LMI
17233 * term.c (init_tty): Remove support for supdup, c10 and perq
17234 terminals, which are no longer supported (bug#1482).
17235
8974cc9f
JB
172362011-07-10 Johan Bockgård <bojohan@gnu.org>
17237
17238 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17239
a560d974
JD
172402011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17241
17242 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17243 for non-popups (Bug#3642).
17244
1dae0f0a
AS
172452011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17246
268c2c36 17247 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 17248 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
17249 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17250 * cm.c (losecursor): Likewise.
1dae0f0a
AS
17251 * data.c (fmod): Likewise.
17252 * dispnew.c (swap_glyphs_in_rows): Likewise.
17253 * emacs.c (memory_warning_signal): Likewise.
17254 * floatfns.c (float_error): Likewise.
17255 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17256 (otf_open, font_otf_capability, generate_otf_features)
17257 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17258 Likewise.
17259 * image.c (pbm_read_file): Likewise.
17260 * indent.c (string_display_width): Likewise.
17261 * intervals.c (check_for_interval, search_for_interval)
17262 (inc_interval_count, count_intervals, root_interval)
17263 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17264 * lread.c (defalias): Likewise.
268c2c36 17265 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
17266 * regex.c (set_image_of_range_1, set_image_of_range)
17267 (regex_grow_registers): Likewise.
17268 * sysdep.c (strerror): Likewise.
17269 * termcap.c (valid_filename_p, tprint, main): Likewise.
17270 * tparam.c (main): Likewise.
17271 * unexhp9k800.c (run_time_remap, save_data_space)
17272 (update_file_ptrs, read_header, write_header, calculate_checksum)
17273 (copy_file, copy_rest, display_header): Likewise.
17274 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17275 Likewise.
17276 * xdisp.c (check_it): Likewise.
17277 * xfaces.c (register_color, unregister_color, unregister_colors):
17278 Likewise.
17279 * xfns.c (print_fontset_result): Likewise.
17280 * xrdb.c (member, fatal, main): Likewise.
17281
99033785
PE
172822011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17283
17284 Fix minor problems found by static checking (Bug#9031).
17285 * chartab.c (char_table_set_range, map_sub_char_table):
17286 Remove unused locals.
17287 (uniprop_table): Now static.
17288 * composite.c (_work_char): Remove unused static var.
17289
9cb2ac56
JB
172902011-07-09 Juanma Barranquero <lekktu@gmail.com>
17291
17292 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17293
f25661f0
JD
172942011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17295
17296 * gtkutil.c (qttip_cb): Remove code without function.
17297
8278c4fe
EZ
172982011-07-09 Eli Zaretskii <eliz@gnu.org>
17299
17300 * w32.c (pthread_sigmask): New stub.
17301
1692ae2d 173022011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 17303
8a6ebd58 17304 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
17305 sigprocmask is portable only for single-threaded applications, and
17306 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
17307 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17308 (LIBES): Use it.
17309 * callproc.c (Fcall_process):
17310 * process.c (create_process):
17311 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17312 Use pthread_sigmask, not sigprocmask.
123403e4 17313
1b854618
JD
173142011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17315
17316 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17317 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17318 wrong (Bug#8591).
17319
3fe4b549
JD
173202011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17321
0ce7e563
JD
17322 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17323 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17324 (xg_hide_tooltip): Fix comment.
17325
3fe4b549
JD
17326 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17327 in registerServicesMenuSendTypes.
17328 (validRequestorForSendType): Don't check ns_return_types.
17329
17330 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17331 ns_return_type.
17332
5df75e47
JR
173332011-07-08 Jason Rumney <jasonr@gnu.org>
17334
22610910
JR
17335 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17336 SH_SHOW for hidden windows (Bug#5482).
17337
5df75e47
JR
17338 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17339 frame struct members of non-existent frames (Bug#6284).
17340
699c10bd
JD
173412011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17342
4393663b
JD
17343 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17344 variable firstTime not needed on OSX >= 10.6.
17345 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17346 >= 10.5. Use setKnobProportion, setDoubleValue.
17347
17348 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17349 (MAC_OS_X_VERSION_10_5): Define if not defined.
17350 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17351 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17352 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17353
17354 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 17355 cString and lossyCString on OSX >= 10.4.
4393663b 17356
58179cce 17357 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
17358 sizeToFit on OSX >= 10.2.
17359
17360 * nsimage.m (allocInitFromFile): Don't use deprecated method
17361 bestRepresentationForDevice on OSX >= 10.6.
17362
17363 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17364 to avoid warning.
17365
17366 * emacs.c: Declare unexec_init_emacs_zone.
17367
a63e0781
JD
17368 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17369
699c10bd
JD
17370 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17371
17372 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17373 on svcsMenu (Bug#8842).
17374
17375 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17376 ns_return_types.
17377 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17378
17379 * nsterm.m (QUTF8_STRING): Declare.
17380 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17381 (validRequestorForSendType): Return type is (id).
17382 Change indexOfObjectIdenticalTo to indexOfObject.
17383 Check if we have local selection before returning self (Bug#8842).
17384 (writeSelectionToPasteboard): Put local selection into paste board
17385 if we have a local selection (Bug#8842).
17386 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17387
17388 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17389 (ns_get_local_selection): Declare.
17390
54e10184
LMI
173912011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17392
9888ff71
LMI
17393 * keymap.c (describe_map_tree): Don't insert a double newline at
17394 the end of the buffer (bug#1169) and return whether we inserted
17395 something.
17396
54e10184
LMI
17397 * callint.c (Fcall_interactively): Change "reading args" to
17398 "providing args" to try to clarify what it does (bug#1010).
17399
15fa4783
KH
174002011-07-07 Kenichi Handa <handa@m17n.org>
17401
17402 * composite.c (composition_compute_stop_pos): Ignore a static
17403 composition starting before CHARPOS (Bug#8915).
17404
17405 * xdisp.c (handle_composition_prop): Likewise.
17406
a8815b00
EZ
174072011-07-07 Eli Zaretskii <eliz@gnu.org>
17408
17409 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17410 (Bug#9015)
17411
ef7b981d 174122011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
17413
17414 * character.h (unicode_category_t): New enum type.
17415
17416 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17417 (Qchar_code_property_table): New variable.
17418 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17419 (UNIPROP_COMPRESSED_FORM_P): New macros.
17420 (char_table_ascii): Uncompress the compressed values.
17421 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17422 Uncompress the compressed values.
ac389d0c 17423 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
17424 (char_table_ref_and_range): Uncompress the compressed values.
17425 (sub_char_table_set): New arg is_uniprop. Callers changed.
17426 Uncompress the compressed values.
17427 (sub_char_table_set_range): Args changed. Callers changed.
17428 (char_table_set_range): Adjuted for the above change.
17429 (map_sub_char_table): Delete args default_val and parent. Add arg
17430 top. Give decoded values to a Lisp function.
640c8776 17431 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
17432 values to a Lisp function. Gcpro more variables.
17433 (uniprop_table_uncompress)
17434 (uniprop_decode_value_run_length): New functions.
17435 (uniprop_decoder, uniprop_decoder_count): New variables.
17436 (uniprop_get_decoder, uniprop_encode_value_character)
17437 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17438 New functions.
17439 (uniprop_encoder, uniprop_encoder_count): New variables.
17440 (uniprop_get_encoder, uniprop_table)
17441 (Funicode_property_table_internal, Fget_unicode_property_internal)
17442 (Fput_unicode_property_internal): New functions.
17443 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17444 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 17445 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
17446 char-code-property-alist.
17447
640c8776 17448 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
17449 Vunicode_category_table.
17450
640c8776 17451 * font.c (font_range): Adjust for the change of
c805dec0
KH
17452 Vunicode_category_table.
17453
76b397fb
DN
174542011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17455
17456 * m/iris4d.h: Remove file, move contents ...
17457 * s/irix6-5.h: ... here.
17458
22b4128e
PE
174592011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17460
17461 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
17462 * alloc.c (mark_buffer):
17463 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17464 (clone_per_buffer_values): Don't assume that
22b4128e
PE
17465 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17466 This isn't true in general, and it's particularly not true
17467 if Emacs is configured with --with-wide-int.
17468 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17469 New macros, used in the buffer.c change.
17470
869795d6
JD
174712011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17472
17473 * xsettings.c: Use both GConf and GSettings if both are available.
17474 (store_config_changed_event): Add comment.
17475 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17476 (store_tool_bar_style_changed): New functions.
5e617bc2 17477 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
17478 (struct xsettings): Move font inside HAVE_XFT.
17479 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 17480 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 17481 Move inside HAVE_XFT.
640c8776 17482 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
17483 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17484 also.
17485 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 17486 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 17487 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
17488 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17489 (parse_settings): Move check for font inside HAVE_XFT.
17490 (read_settings, apply_xft_settings): Add comment.
17491 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17492 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17493 call store_font_name_changed.
17494 (xft_settings_event): Add comment.
17495 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17496 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17497 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17498 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17499 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
17500 (xsettings_get_system_font, xsettings_get_system_normal_font):
17501 Add comment.
869795d6 17502
d8ed26bd
PE
175032011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17504
17505 Random fixes. E.g., (random) never returned negative values.
17506 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17507 subseconds part to the entropy, as that's a bit more random.
17508 Prefer signed to unsigned, since the signedness doesn't matter and
17509 in general we prefer signed. When given a limit, use a
17510 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17511 latter isn't right if USE_2_TAGS_FOR_INTS.
17512 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17513 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17514
cabf1cac
SM
175152011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17516
17517 * textprop.c (text_property_stickiness):
17518 Obey Vtext_property_default_nonsticky.
17519 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17520 * w32fns.c (syms_of_w32fns):
17521 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17522
6e9b2be9
PE
175232011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17524
17525 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17526 This is more efficient than Ffile_directory_p and avoids a minor race.
17527
90186c68
LMI
175282011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17529
7c301272
LMI
17530 * buffer.c (Foverlay_put): Say what the return value is
17531 (bug#7835).
17532
c4f2d8d4
LMI
17533 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17534 is a directory before asking whether to use the file name
17535 (bug#7564).
ad637907
LMI
17536 (barf_or_query_if_file_exists): Make the "File is a directory"
17537 error be more correct.
c4f2d8d4 17538
90186c68
LMI
17539 * fns.c (Frequire): Remove the mention of the .gz files, since
17540 that's installation-specific, but keep the mention of
17541 `get-load-suffixes'.
17542
da64016e
PE
175432011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17544
17545 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17546 Report string overflow if the output is too long.
17547
7d47b580
JB
175482011-07-04 Juanma Barranquero <lekktu@gmail.com>
17549
a555cb87
JB
17550 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17551 (syms_of_gnutls): Remove duplicate DEFSYM for
17552 Qgnutls_bootprop_verify_hostname_error, an error for
17553 Qgnutls_bootprop_verify_error (which is no longer used).
17554
7d47b580
JB
17555 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17556 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17557 Also (re)move comments that are misplaced or no longer relevant.
17558
1e49bfab
LMI
175592011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17560
17561 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17562
1485f4c0
CY
175632011-07-03 Chong Yidong <cyd@stupidchicken.com>
17564
17565 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17566 and background color parameters if they have been changed.
17567
a9ab721e
LMI
175682011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17569
17570 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17571
cf7cff57
PE
175722011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17573
2e13213d
PE
17574 * xsettings.c (SYSTEM_FONT): Define only when used.
17575 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17576
cf7cff57
PE
17577 * keymap.c (access_keymap_1): Now static.
17578
7a8e04f7
CY
175792011-07-02 Chong Yidong <cyd@stupidchicken.com>
17580
17581 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17582 leave any prefix arg for the up event (Bug#1586).
17583
61352f62
LMI
175842011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17585
69bb1ef7
LMI
17586 * lread.c (syms_of_lread): Mention single symbols defined by
17587 `defvar' or `defconst' (bug#7154).
17588
61352f62 17589 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 17590 (Frequire): Mention get-load-suffixes.
61352f62 17591
28545e04
MR
175922011-07-02 Martin Rudalics <rudalics@gmx.at>
17593
17594 * window.h (window): Remove clone_number slot.
17595 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17596 Remove.
17597 (make_parent_window, make_window, saved_window)
17598 (Fset_window_configuration, save_window_save): Don't deal with
17599 clone numbers.
17600 * buffer.c (Qclone_number): Remove declaration.
17601 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17602
3349e122
SM
176032011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17604
17605 Add multiple inheritance to keymaps.
17606 * keymap.c (Fmake_composed_keymap): New function.
17607 (Fset_keymap_parent): Simplify.
17608 (fix_submap_inheritance): Remove.
17609 (access_keymap_1): New function extracted from access_keymap to handle
17610 embedded parents and handle lists of maps.
17611 (access_keymap): Use it.
17612 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17613 (Fcopy_keymap): Handle embedded parents.
17614 (Fcommand_remapping, define_as_prefix): Simplify.
17615 (Fkey_binding): Simplify.
17616 (syms_of_keymap): Move minibuffer-local-completion-map,
17617 minibuffer-local-filename-completion-map,
17618 minibuffer-local-must-match-map, and
17619 minibuffer-local-filename-must-match-map to Elisp.
17620 (syms_of_keymap): Defsubr make-composed-keymap.
17621 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17622 (parse_menu_item): Trivial simplification.
17623
3279eb87
GM
176242011-07-01 Glenn Morris <rgm@gnu.org>
17625
17626 * Makefile.in (SETTINGS_LIBS): Fix typo.
17627
39cb9e56 176282011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
17629
17630 * coding.c (Fencode_coding_string): Record the last coding system
17631 used, as the function doc string says (bug#8738).
17632
0949d2b6
JD
176332011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17634
17635 * xsettings.c (store_monospaced_changed): Take new font as arg and
17636 check for change against current_mono_font.
17637 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17638 (emacs_settings_constructor, emacs_settings_get_property)
17639 (emacs_settings_set_property, emacs_settings_class_init)
17640 (emacs_settings_init, gsettings_obj): Remove.
17641 (something_changedCB): New function for HAVE_GSETTINGS.
17642 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17643 with value as argument.
17644 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17645 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 17646 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
17647 "changed".
17648
17649 * xgselect.c: Add defined (HAVE_GSETTINGS).
17650 (xgselect_initialize): Ditto.
17651
17652 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17653 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17654 xg_select.
17655
bbc6b304
PE
176562011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17657
17658 * eval.c (struct backtrace): Simplify and port the data structure.
17659 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17660 signed bit field, as this assumption is not portable and it makes
17661 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17662 "char debug_on_exit : 1" as this is not portable either; instead,
17663 use the portable "unsigned int debug_on_exit : 1". Remove unused
17664 member evalargs. Remove obsolete comments about cc bombing out.
17665
9851bfc5
JD
176662011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17667
51bb811f 17668 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
17669 Let HAVE_GSETTINGS override HAVE_GCONF.
17670 (store_monospaced_changed): New function.
17671 (EMACS_SETTINGS): A new type derived from GObject to handle
17672 GSettings notifications.
17673 (emacs_settings_constructor, emacs_settings_get_property)
17674 (emacs_settings_set_property, emacs_settings_class_init):
17675 New functions.
17676 (gsettings_client, gsettings_obj): New variables.
17677 (GSETTINGS_SCHEMA): New define.
17678 (something_changedCB): Call store_monospaced_changed.
17679 (init_gsettings): New function.
17680 (xsettings_initialize): Call init_gsettings.
17681 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17682 to NULL.
17683
640c8776 17684 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
17685 GCONF_CFLAGS/LIBS.
17686
5386012d
MR
176872011-06-29 Martin Rudalics <rudalics@gmx.at>
17688
17689 * window.c (resize_root_window, grow_mini_window)
17690 (shrink_mini_window): Rename Qresize_root_window to
17691 Qwindow_resize_root_window and Qresize_root_window_vertically to
17692 Qwindow_resize_root_window_vertically.
17693
f13e0b08
PE
176942011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17695
17696 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17697
94515237
JB
176982011-06-27 Juanma Barranquero <lekktu@gmail.com>
17699
17700 * makefile.w32-in: Redesign dependencies so they reflect more
17701 clearly which files are directly included by each source file,
17702 and not through other includes.
17703
e43b6e43
MR
177042011-06-27 Martin Rudalics <rudalics@gmx.at>
17705
17706 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17707 (sort_overlays, overlay_strings): When an overlay's clone number
17708 matches the window's clone number process the overlay even if
17709 the overlay's window property doesn't match the current window.
17710
d68443dc
MR
17711 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17712 (Fwindow_hchild): Rename to Fwindow_left_child.
17713 (Fwindow_next): Rename to Fwindow_next_sibling.
17714 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
17715 (resize_window_check): Rename to window_resize_check.
17716 (resize_window_apply): Rename to window_resize_apply.
17717 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17718 (Fdelete_other_windows_internal, resize_frame_windows)
17719 (Fsplit_window_internal, Fdelete_window_internal)
17720 (grow_mini_window, shrink_mini_window)
17721 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 17722
c7e73be5
JD
177232011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17724
17725 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17726 (emacs_fixed_set_min_size): Remove.
17727 (emacs_fixed_new): Take frame as argument.
17728
17729 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17730 (_EmacsFixedPrivate): Remove minwidth/height.
17731 Add struct frame *f.
17732 (emacs_fixed_init): Initialize priv->f.
17733 (get_parent_class, emacs_fixed_set_min_size): Remove.
17734 (emacs_fixed_new): Set priv->f to argument.
17735 (emacs_fixed_get_preferred_width)
17736 (emacs_fixed_get_preferred_height): Use min_width/height from
17737 frames size_hint to set minimum and natural (Bug#8919).
17738 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17739 and use min_width/height from frames size_hint to set
17740 min_width/height (Bug#8919).
17741
17742 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
17743 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17744 Fix indentation.
c7e73be5 17745
cf99dcf8
EZ
177462011-06-26 Eli Zaretskii <eliz@gnu.org>
17747
17748 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17749 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17750 called at ZV.
17751
029529ac
CY
177522011-06-26 Chong Yidong <cyd@stupidchicken.com>
17753
17754 * process.c (wait_reading_process_output): Bypass select if
17755 waiting for a cell while ignoring keyboard input, and input is
17756 pending. Suggested by Jan Djärv (Bug#8869).
17757
7a7ef429
PE
177582011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17759
17760 Use gnulib's dup2 module instead of rolling our own.
17761 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17762
11fdef7d 177632011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
17764
17765 * dispnew.c (scrolling_window): Before scrolling, turn off a
17766 mouse-highlight in the window being scrolled.
17767
cd3520a4
JB
177682011-06-24 Juanma Barranquero <lekktu@gmail.com>
17769
17770 Move DEFSYM to lisp.h and use everywhere.
17771
17772 * character.h (DEFSYM): Move declaration...
17773 * lisp.h (DEFSYM): ...here.
17774
17775 * gnutls.c:
17776 * minibuf.c:
17777 * w32menu.c:
17778 * w32proc.c:
17779 * w32select.c: Don't include character.h.
17780
17781 * alloc.c (syms_of_alloc):
17782 * buffer.c (syms_of_buffer):
17783 * bytecode.c (syms_of_bytecode):
17784 * callint.c (syms_of_callint):
17785 * casefiddle.c (syms_of_casefiddle):
17786 * casetab.c (init_casetab_once):
17787 * category.c (init_category_once, syms_of_category):
17788 * ccl.c (syms_of_ccl):
17789 * cmds.c (syms_of_cmds):
17790 * composite.c (syms_of_composite):
17791 * dbusbind.c (syms_of_dbusbind):
17792 * dired.c (syms_of_dired):
17793 * dispnew.c (syms_of_display):
17794 * doc.c (syms_of_doc):
17795 * editfns.c (syms_of_editfns):
17796 * emacs.c (syms_of_emacs):
17797 * eval.c (syms_of_eval):
17798 * fileio.c (syms_of_fileio):
17799 * fns.c (syms_of_fns):
17800 * frame.c (syms_of_frame):
17801 * fringe.c (syms_of_fringe):
17802 * insdel.c (syms_of_insdel):
17803 * keymap.c (syms_of_keymap):
17804 * lread.c (init_obarray, syms_of_lread):
17805 * macros.c (syms_of_macros):
17806 * msdos.c (syms_of_msdos):
17807 * print.c (syms_of_print):
17808 * process.c (syms_of_process):
17809 * search.c (syms_of_search):
17810 * sound.c (syms_of_sound):
17811 * syntax.c (init_syntax_once, syms_of_syntax):
17812 * terminal.c (syms_of_terminal):
17813 * textprop.c (syms_of_textprop):
17814 * undo.c (syms_of_undo):
17815 * w32.c (globals_of_w32):
17816 * window.c (syms_of_window):
17817 * xdisp.c (syms_of_xdisp):
17818 * xfaces.c (syms_of_xfaces):
17819 * xfns.c (syms_of_xfns):
17820 * xmenu.c (syms_of_xmenu):
17821 * xsettings.c (syms_of_xsettings):
17822 * xterm.c (syms_of_xterm): Use DEFSYM.
17823
4228cf16
TZ
178242011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17825
cd3520a4 17826 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 17827
7fcccf1e
PE
178282011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17829
7efb4e0e
PE
17830 Integer and buffer overflow fixes (Bug#8873).
17831
ff5844ad
PE
17832 * print.c (printchar, strout): Check for string overflow.
17833 (PRINTPREPARE, printchar, strout):
17834 Don't set size unless allocation succeeds.
17835
90532f02
PE
17836 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17837 for sizes. Check for string overflow more accurately.
17838 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17839
6d84508d
PE
17840 * macros.c: Integer and buffer overflow fixes.
17841 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17842 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17843 Use ptrdiff_t, not int, for sizes.
17844 Don't increment bufsize until after realloc succeeds.
17845 Check for size-calculation overflow.
17846 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17847
437b2cb4
PE
17848 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17849
8b9ac8b4
PE
17850 * lread.c: Integer overflow fixes.
17851 (read_integer): Radix is now EMACS_INT, not int,
17852 to improve quality of diagnostics for out-of-range radices.
17853 Calculate buffer size correctly for out-of-range radices.
17854 (read1): Check for integer overflow in radices, and in
17855 read-circle numbers.
82cb60d3
PE
17856 (read_escape): Avoid int overflow.
17857 (Fload, openp, read_buffer_size, read1)
17858 (substitute_object_recurse, read_vector, read_list, map_obarray):
17859 Use ptrdiff_t, not int, for sizes.
17860 (read1): Use EMACS_INT, not int, for sizes.
20270765 17861 Check for size overflow.
8b9ac8b4 17862
7fcccf1e
PE
17863 * image.c (cache_image): Check for size arithmetic overflow.
17864
bfbbd7e7
PE
17865 * lread.c: Integer overflow issues.
17866 (saved_doc_string_size, saved_doc_string_length)
17867 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17868 Now ptrdiff_t, not int.
17869 (read1): Don't assume doc string length fits in int. Check for
17870 out-of-range doc string lengths.
17871 (read_list): Don't assume file position fits in int.
39019e54 17872 (read_escape): Check for hex character overflow.
bfbbd7e7 17873
4e323265
LL
178742011-06-22 Leo Liu <sdl.web@gmail.com>
17875
17876 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17877 Move to minibuffer.el.
17878
85fece3e
PE
178792011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17880
20b84ce9 17881 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
17882 The following patches are for when GLYPH_DEBUG && !XASSERT.
17883 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17884 * dispnew.c (flush_stdout):
17885 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17886 Mark as externally visible.
17887 * dispnew.c (check_window_matrix_pointers): Now static.
17888 * dispnew.c (window_to_frame_vpos):
17889 * xfns.c (unwind_create_frame):
17890 * xterm.c (x_check_font): Remove unused local.
17891 * scroll.c (CHECK_BOUNDS):
17892 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17893 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17894 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17895 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17896 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17897 Now static.
17898 (debug_method_add): Use va_list and vsprintf rather than relying
17899 on undefined behavior with wrong number of arguments.
17900 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17901 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17902 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17903 since we're not interested in debugging glyphs with old libraries.
17904 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17905 GCC 4.6.0's static checking.
17906
0766b489
PE
179072011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17908
31fd4b32
PE
17909 Integer overflow and signedness fixes (Bug#8873).
17910 A few related buffer overrun fixes, too.
17911
b79e8648
PE
17912 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17913
0766b489
PE
17914 * dispextern.h (struct face.stipple):
17915 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17916 (x_bitmap_mask, x_allocate_bitmap_record)
17917 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17918 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17919 (x_create_bitmap_from_xpm_data):
17920 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17921 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17922 (.bitmaps_last):
17923 * xfaces.c (load_pixmap):
17924 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17925 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17926 (.bitmaps_last, struct x_output.icon_bitmap):
17927 Use ptrdiff_t, not int, for bitmap indexes.
17928 (x_allocate_bitmap_record): Check for size overflow.
17929 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17930
b081724f
PE
17931 Use ptrdiff_t, not int, for overlay counts.
17932 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17933 * editfns.c (overlays_around, get_pos_property):
17934 * textprop.c (get_char_property_and_overlay):
17935 * xdisp.c (next_overlay_change, note_mouse_highlight):
17936 * xfaces.c (face_at_buffer_position):
21514da7
PE
17937 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17938 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17939 (Fnext_overlay_change, Fprevious_overlay_change)
17940 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 17941 Use ptrdiff_t, not int, for sizes.
21514da7 17942 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 17943
3de73e5e
PE
17944 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17945
2606c57b
PE
17946 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17947 (x_session_initialize): Do not assume string length fits in int.
17948
aaafe47a
PE
17949 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17950 This is unlikely, but can occur if DPI is outlandish.
17951
2674ddc8 17952 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
17953 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17954
28154962
PE
17955 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17956 * xrdb.c (magic_file_p, search_magic_path):
17957 Omit last arg SUFFIX; it was always 0. All callers changed.
17958 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17959
7de51af5
PE
17960 * xfont.c (xfont_match): Avoid need for strlen.
17961
25ed6cc3
PE
17962 * xfns.c: Don't assume strlen fits in int.
17963 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17964
4eab31dd
PE
17965 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17966 not unsigned long, as we prefer signed integers. All callers changed.
17967 Detect integer overflow in repeat count.
17968 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 17969 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 17970
171e2a58
PE
17971 * termcap.c: Don't assume sizes fit in int and never overflow.
17972 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17973 (gobble_line): Check for size-calculation overflow.
17974
ad39faca 17975 * minibuf.c (Fread_buffer):
6e5bb2dc 17976 * lread.c (intern, intern_c_string):
74ca2eb3
PE
17977 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17978 Don't assume string length fits in int.
17979
52c61c22 17980 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
17981 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17982
b5b8c9e5
PE
17983 * font.c: Don't assume string length fits in int.
17984 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17985 Use ptrdiff_t, not int.
ccd6111c
PE
17986 (font_intern_prop): Don't assume string length fits in int.
17987 Don't assume integer property fits in fixnum.
17988 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 17989
882f0d81 17990 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 17991 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
17992 Reformulate so as not to need the command string.
17993 Invoke gzip -cd rather than gunzip, as it's more portable.
17994 (lock_info_type, lock_file_1, lock_file):
17995 Don't assume pid_t and time_t fit in unsigned long.
17996 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17997 (current_lock_owner): Prefer signed type for sizes.
17998 Use memcpy, not strncpy, where memcpy is what is really wanted.
17999 Don't assume (via atoi) that time_t and pid_t fit in int.
18000 Check for time_t and/or pid_t out of range, e.g., via a network share.
18001 Don't alloca where an auto var works fine.
18002
93f4cf88
PE
18003 * fileio.c: Fix some integer overflow issues.
18004 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18005 Don't assume string length fits in int.
18006 (directory_file_name): Don't assume string length fits in long.
18007 (make_temp_name): Don't assume pid fits in int, or that its print
18008 length is less than 20.
18009
f3e92b69
PE
18010 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18011
1bfdaf10
PE
18012 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18013
35016e9a
PE
18014 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18015
3d1e65a1
PE
18016 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18017 We prefer signed integers, even for size calculations.
18018
0b963a93
PE
18019 * emacs.c: Don't assume string length fits in 'int'.
18020 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18021 (main): Don't invoke strlen when not needed.
18022
573f4b54
PE
18023 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18024 (XD_DEBUG_MESSAGE): Don't waste a byte.
18025
989f33ba
PE
18026 * callproc.c (getenv_internal_1, getenv_internal)
18027 (Fgetenv_internal):
965d34eb
PE
18028 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18029
e4d29b33
PE
18030 * lread.c (invalid_syntax): Omit length argument.
18031 All uses changed. This doesn't fix a bug, but it simplifies the
18032 code away from its former Hollerith-constant appearance, and it's
18033 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 18034 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 18035
eb49b136
PE
18036 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18037 This didn't break anything, but it didn't help either.
18038 It's confusing to put a bogus integer in a place where the actual
18039 value does not matter.
9f62aeb1 18040 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 18041 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 18042
15375a22
PE
18043 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18044 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18045 implementation.
b61cc01c
PE
18046 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18047 We prefer signed types, and the value cannot exceed the EMACS_INT
18048 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
18049 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18050 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18051 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 18052
53b2623d
PE
18053 * indent.c (sane_tab_width): New function.
18054 (current_column, scan_for_column, Findent_to, position_indentation)
18055 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 18056 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 18057
51cab52b 18058 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 18059
f2ed8a70
PE
18060 * lisp.h (lint_assume): New macro.
18061 * composite.c (composition_gstring_put_cache):
18062 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18063
abe80cc6
PE
18064 * editfns.c, insdel.c:
18065 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 18066
b02c740e
PE
18067 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18068
ebc96716
PE
18069 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18070
b4e50fa0 18071 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 18072 Use much-faster test for byte-length change.
311d5d7c 18073 Don't assume string byte-length fits in 'int'.
a4cf38e4 18074 Check that character arg fits in 'int'.
85461888 18075 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 18076
c0c1ee9f
PE
18077 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18078
a498d7f4
PE
18079 * fns.c (concat): Catch string overflow earlier.
18080 Do not rely on integer wraparound.
18081
51cab52b
PE
18082 * dispextern.h (struct it.overlay_strings_charpos)
18083 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
18084 * xdisp.c (forward_to_next_line_start)
18085 (back_to_previous_visible_line_start)
18086 (reseat_at_next_visible_line_start, next_element_from_buffer):
18087 Don't arbitrarily truncate the value of 'selective' to int.
18088
76031fad
PE
18089 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18090
5eb55db9
PE
18091 * composite.c: Don't truncate sizes to 'int'.
18092 (composition_gstring_p, composition_reseat_it)
18093 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
18094 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18095 not EMACS_UINT, for indexes.
5eb55db9 18096
0703a717
PE
18097 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18098
d6202519
PE
18099 * buffer.c: Include <verify.h>.
18100 (struct sortvec.priority, struct sortstr.priority):
8961a454 18101 Now EMACS_INT, not int.
c20998a7 18102 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
18103 (struct sortstr.size, record_overlay_string)
18104 (struct sortstrlist.size, struct sortlist.used):
18105 Don't truncate size to int.
18106 (record_overlay_string): Check for size-calculation overflow.
d6202519 18107 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 18108
d5a19415
JM
181092011-06-22 Jim Meyering <meyering@redhat.com>
18110
029529ac 18111 Don't leak an XBM-image-sized buffer
d5a19415
JM
18112 * image.c (xbm_load): Free the image buffer after using it.
18113
a9041e6c
PE
181142011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18115
18116 Port to Sun C.
18117 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18118 that Sun C diagnosed.
18119 * fns.c (secure_hash): Fix pointer signedness issue.
18120 * intervals.c (static_offset_intervals): New function.
18121 (offset_intervals): Use it.
18122
7f3f739f
LL
181232011-06-21 Leo Liu <sdl.web@gmail.com>
18124
18125 * deps.mk (fns.o):
18126 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18127 sha512.h.
18128
18129 * fns.c (secure_hash): Rename from crypto_hash_function and change
18130 the first arg to accept symbols.
5b66d427 18131 (Fsecure_hash): New primitive.
7f3f739f
LL
18132 (syms_of_fns): New symbols.
18133
76147d94
DD
181342011-06-20 Deniz Dogan <deniz@dogan.se>
18135
18136 * process.c (Fset_process_buffer): Clarify return value in
18137 docstring.
18138
7d7d0045
CY
181392011-06-18 Chong Yidong <cyd@stupidchicken.com>
18140
18141 * dispnew.c (add_window_display_history): Use BVAR.
18142
18143 * xdisp.c (debug_method_add): Use BVAR.
18144 (check_window_end, dump_glyph_matrix, dump_glyph)
18145 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18146
18147 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18148 Likewise.
18149
18150 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18151 check till after the cache is created in init_frame_faces.
18152
ff2bc410
SM
181532011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18154
18155 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18156
28177add
PE
181572011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18158
dd3482fe
PE
18159 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18160 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18161 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18162
393d71f3 18163 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
18164 * fileio.c (Finsert_file_contents):
18165 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18166 Remove the old (too-loose) buffer overflow checks.
18167 They weren't needed, since make_gap checks for buffer overflow.
18168 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18169 The old code merely checked for Emacs fixnum overflow, and relied
18170 on undefined (wraparound) behavior. The new code avoids undefined
18171 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18172
2e6813b0 18173 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
18174 Tune. Don't use wider integers than needed. Don't use alloca.
18175 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 18176
599a9e4f
PE
18177 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18178
99561444
PE
18179 * insdel.c, lisp.h (buffer_overflow): New function.
18180 (insert_from_buffer_1, replace_range, replace_range_2):
18181 * insdel.c (make_gap_larger):
18182 * editfns.c (Finsert_char):
18183 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18184
28177add
PE
18185 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18186
e69dafad
PE
181872011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18188
4baa020d 18189 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 18190
b1c46f02
PE
18191 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18192 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18193
e69dafad
PE
18194 * fileio.c: Don't assume EMACS_INT fits in off_t.
18195 (emacs_lseek): New static function.
18196 (Finsert_file_contents, Fwrite_region): Use it.
18197 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18198
566684ea
PE
18199 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18200
e6966cd6
PE
18201 * fns.c: Don't overflow int when computing a list length.
18202 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18203 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18204 truncation on 64-bit hosts. Check for QUIT every
18205 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18206 faster and is responsive enough.
18207 (Flength): Report an error instead of overflowing an integer.
18208 (Fsafe_length): Return a float if the value is not representable
18209 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 18210 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 18211 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 18212
dd0b0efb
PE
18213 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18214 (header_size, word_size): New constants.
18215 (allocate_vectorlike): Don't check size overflow here.
18216 (allocate_vector): Check it here instead, since this is the only
18217 caller of allocate_vectorlike that could cause overflow.
18218 Check that the new vector's length is representable as a fixnum.
18219
86fe5cfe
PE
18220 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18221 The previous code was bogus. For example, next_almost_prime (32)
18222 returned 39, which is undesirable as it is a multiple of 3; and
18223 next_almost_prime (24) returned 25, which is a multiple of 5 so
18224 why was the code bothering to check for multiples of 7?
18225
80e88859
PE
18226 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18227
4a2f0ad6
PE
18228 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18229
f66c7cf8
PE
18230 Variadic C functions now count arguments with ptrdiff_t.
18231 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18232 Back then I didn't know that the Emacs coding style prefers signed int.
18233 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
18234 were being counted with int, which may truncate counts on 64-bit
18235 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
18236 * lisp.h (struct Lisp_Subr.function.aMANY)
18237 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18238 Arg counts are now ptrdiff_t, not size_t.
18239 All variadic functions and their callers changed accordingly.
18240 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18241 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18242 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18243 * callint.c (Fcall_interactively): Check arg count for overflow,
18244 to avoid potential buffer overrun. Use signed char, not 'int',
18245 for 'varies' array, so that we needn't bother to check its size
18246 calculation for overflow.
18247 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18248 * eval.c (apply_lambda):
18249 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18250 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18251 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18252
a1759b76
PE
18253 * callint.c (Fcall_interactively): Don't use index var as event count.
18254
d96be9fc
PE
18255 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18256 * mem-limits.h (SIZE): Remove; no longer used.
18257
a690a978 18258 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 18259
578c21e6
PE
18260 Remove unnecessary casts.
18261 * xterm.c (x_term_init):
18262 * xfns.c (x_set_border_pixel):
18263 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18264 These aren't needed now that we assume ANSI C.
18265
96f53c6c
PE
18266 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18267 It's more likely to cause problems (due to unsigned overflow)
18268 than to cure them.
18269
83c77d31
PE
18270 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18271
ee2079f1
PE
18272 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18273
6da65536
PE
18274 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18275
7147c4a4
PE
18276 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18277
193e32d9
PE
18278 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18279
e5533da6
PE
18280 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18281
9910e595
PE
18282 GLYPH_CODE_FACE returns EMACS_INT, not int.
18283 * dispextern.h (merge_faces):
18284 * xfaces.c (merge_faces):
01103c44
PE
18285 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18286 Don't assume EMACS_INT fits in int.
9910e595 18287
2638320e
PE
18288 * character.h (CHAR_VALID_P): Remove unused parameter.
18289 * fontset.c, lisp.h, xdisp.c: All uses changed.
18290
045eb8d9
PE
18291 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18292
c1f134b5
PE
18293 * fns.c (concat): Minor tuning based on overflow analysis.
18294 This doesn't fix any bugs. Use int to hold character, instead
18295 of constantly refetching from Emacs object. Use XFASTINT, not
18296 XINT, for value known to be a character. Don't bother comparing
18297 a single byte to 0400, as it's always less.
18298
395fcb93 18299 * floatfns.c (Fexpt):
327eeec8
PE
18300 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18301
abbd3d23
PE
18302 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18303 for characters.
18304
684a03ef
PE
18305 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18306
0fed43f3
PE
18307 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18308 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18309 incorrectly succeed when S was a string, because 4294967386 was
18310 truncated before it was used.
18311
8fd02eb7
PE
18312 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18313 Otherwise, an out-of-range integer could cause undefined behavior
18314 on a 64-bit host.
18315
f8c86b69
PE
18316 * composite.c: Use int, not EMACS_INT, for characters.
18317 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18318 EMACS_INT, for values that are known to be in character range.
18319 This doesn't fix any bugs but is the usual style inside Emacs and
18320 may generate better code on 32-bit machines.
18321
34206dd2
PE
18322 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18323 This is for reasons similar to the recent CHAR_STRING fix.
18324 * charset.c (Fencode_char): Check that character arg is actually
18325 a character. Pass an int to ENCODE_CHAR.
18326 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18327 wider than 'int', as a compile-time check to prevent future regressions
18328 in this area.
18329
c5958d4c 18330 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
18331
18332 Make sure a 64-bit char is never passed to CHAR_STRING.
18333 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18334 by silently ignoring the top 32 bits, allowing some values
18335 that were far too large to be valid characters.
18336 * character.h: Include <verify.h>.
18337 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18338 arguments are no wider than unsigned, as a compile-time check
18339 to prevent future regressions in this area.
18340 * data.c (Faset):
01103c44 18341 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
18342 (Fsubst_char_in_region):
18343 * fns.c (concat):
18344 * xdisp.c (decode_mode_spec_coding):
18345 Adjust to CHAR_STRING's new requirement.
18346 * editfns.c (Finsert_char, Fsubst_char_in_region):
18347 * fns.c (concat): Check that character args are actually
18348 characters. Without this test, these functions did the wrong
18349 thing with wildly out-of-range values on 64-bit hosts.
18350
d37ca623
PE
18351 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18352 These casts should not be needed on 32-bit hosts, either.
18353 * keyboard.c (read_char):
18354 * lread.c (Fload): Remove casts to unsigned.
18355
ea204efb
PE
18356 * lisp.h (UNSIGNED_CMP): New macro.
18357 This fixes comparison bugs on 64-bit hosts.
18358 (ASCII_CHAR_P): Use it.
18359 * casefiddle.c (casify_object):
01103c44 18360 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
18361 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18362 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18363 * dispextern.h (FACE_FROM_ID):
18364 * keyboard.c (read_char): Use UNSIGNED_CMP.
18365
41cb286c
PE
18366 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18367 not to EMACS_INT, to avoid GCC warning.
18368
4a1b9832
PE
18369 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18370
55daad71
PE
18371 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18372 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18373 isn't needed on 32-bit machines.
8f95c75c 18374
01103c44
PE
18375 * buffer.c (Fgenerate_new_buffer_name):
18376 Use EMACS_INT for count, not int.
0ceccced 18377 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
18378
18379 * data.c (Qcompiled_function): Now static.
18380
c6f072e7
PE
18381 * window.c (window_body_lines): Now static.
18382
20ce5912
PE
18383 * image.c (gif_load): Rename local to avoid shadowing.
18384
9c4c5f81
PE
18385 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18386 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18387 * alloc.c (make_save_value): Integer argument is now of type
18388 ptrdiff_t, not int.
18389 (mark_object): Use ptrdiff_t, not int.
18390 * lisp.h (pD): New macro.
18391 * print.c (print_object): Use it.
18392
c0c5c8ae
PE
18393 * alloc.c: Use EMACS_INT, not int, to count objects.
18394 (total_conses, total_markers, total_symbols, total_vector_size)
18395 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
18396 (total_free_floats, total_floats, total_free_intervals)
18397 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
18398 Now EMACS_INT, not int. All uses changed.
18399 (Fgarbage_collect): Compute overall total using a double, so that
18400 integer overflow is less likely to be a problem. Check for overflow
18401 when converting back to an integer.
5a25e253
PE
18402 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18403 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18404 These were 'int' variables that could overflow on 64-bit hosts;
18405 they were never used, so remove them instead of repairing them.
211a0b2a 18406 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
18407 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18408 Previously, this ceilinged at INT_MAX, but that doesn't work on
18409 64-bit machines.
e46bb31a 18410 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 18411
c78baabf 18412 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 18413 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
18414 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18415 when a (possibly-narrower) signed value would do just as well.
18416 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 18417
c9d624c6
PE
18418 * alloc.c: Catch some string size overflows that we were missing.
18419 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18420 for convenience in STRING_BYTES_MAX.
18421 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18422 The definition here is exact; the one in lisp.h was approximate.
18423 (allocate_string_data): Check for string overflow. This catches
18424 some instances we weren't catching before. Also, it catches
18425 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18426 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18427 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 18428
c9d624c6
PE
18429 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18430 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 18431 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 18432
353032ce
PE
18433 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18434
2bccce07
PE
18435 * alloc.c (Fmake_string): Check for out-of-range init.
18436
0ac30604
SM
184372011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18438
18439 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18440
c195f2de
JD
184412011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18442
18443 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18444 xg_get_default_scrollbar_width.
18445
18446 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18447 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18448 (style_changed_cb): Call update_theme_scrollbar_width and call
18449 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18450 all frames (Bug#8505).
18451 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18452 Call gtk_window_set_resizable if HAVE_GTK3.
18453 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18454 and height if HAVE_GTK3 (Bug#8505).
18455 (scroll_bar_width_for_theme): New variable.
18456 (update_theme_scrollbar_width): New function.
18457 (xg_get_default_scrollbar_width): Move code to
18458 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18459 (xg_initialize): Call update_theme_scrollbar_width.
18460
18461 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18462
18463 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18464
e10ac9f1
MR
184652011-06-12 Martin Rudalics <rudalics@gmx.at>
18466
18467 * frame.c (make_frame): Call other_buffer_safely instead of
18468 other_buffer.
18469
18470 * window.c (temp_output_buffer_show): Call display_buffer with
18471 second argument Vtemp_buffer_show_specifiers and reset latter
18472 immediately after the call.
18473 (Vtemp_buffer_show_specifiers): New variable.
18474 (auto_window_vscroll_p, next_screen_context_lines)
18475 (Vscroll_preserve_screen_position): Remove leading asterisks from
18476 doc-strings.
18477
2d3c217e 184782011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 18479
7b7f97e8 18480 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
18481 * buffer.c (Qclone_number): Remove for now, as it's unused.
18482 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18483 (record_buffer): Remove unused local.
18484 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18485 (set_frame_buffer_list): Remove; unused.
18486 * frame.h (other_visible_frames): Remove decl.
18487 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18488 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18489 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18490 if HAVE_GPM.
18491 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18492 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18493 Define only if HAVE_GPM.
18494 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18495 (update_hints_inhibit): Remove; never set. All uses removed.
18496 * widgetprv.h (emacsFrameClassRec): Remove decl.
18497 * window.c (delete_deletable_window): Now returns void, since it
18498 wasn't returning anything.
18499 (compare_window_configurations): Remove unused locals.
18500 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18501 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
18502 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18503 the same widths as pointers. This follows up on the 2011-05-06 patch.
18504 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18505 * xterm.h: Likewise.
18506 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18507
1384b89e
JB
185082011-06-12 Juanma Barranquero <lekktu@gmail.com>
18509
18510 * makefile.w32-in: Update dependencies.
18511 (LISP_H): Add lib/intprops.h.
18512
1100a63c
CY
185132011-06-11 Chong Yidong <cyd@stupidchicken.com>
18514
18515 * image.c (gif_load): Add animation frame delay to the metadata.
18516 (syms_of_image): Use DEFSYM. New symbol `delay'.
18517
6198ccd0
MR
185182011-06-11 Martin Rudalics <rudalics@gmx.at>
18519
18520 * window.c (delete_deletable_window): Re-add.
18521 (Fset_window_configuration): Rewrite to handle dead buffers and
18522 consequently deletable windows.
18523 (window_tree, Fwindow_tree): Remove. Supply functionality in
18524 window.el.
18525 (compare_window_configurations): Simplify code.
18526
b6e3633c
AS
185272011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18528
1ab0dee5
AS
18529 * image.c (imagemagick_load_image): Fix type mismatch.
18530 (Fimagemagick_types): Likewise.
18531
b6e3633c
AS
18532 * window.h (replace_buffer_in_windows): Declare.
18533
9397e56f
MR
185342011-06-11 Martin Rudalics <rudalics@gmx.at>
18535
18536 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18537 Qclone_number. Remove external declaration of Qdelete_window.
18538 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18539 code.
640c8776
SM
18540 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18541 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
18542 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18543 buffer list implementation.
18544 (other_buffer_safely): New function.
18545 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18546 calls to replace_buffer_in_windows and
18547 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18548 if allowed.
18549 (record_buffer): Inhibit quitting and rewrite using quittable
18550 functions. Run Qbuffer_list_update_hook if allowed.
18551 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
18552 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18553 Move switch-to-buffer to window.el.
9397e56f
MR
18554 (bury-buffer): Move to window.el.
18555 (Vbuffer_list_update_hook): New variable.
18556
18557 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18558 section.
18559
18560 * window.h (resize_frame_windows): Move up in code.
18561 (Fwindow_frame): Remove EXFUN.
18562 (replace_buffer_in_all_windows): Remove prototype.
18563 (replace_buffer_in_windows_safely): Add prototype.
18564
18565 * window.c: Declare Qdelete_window static again. Move down
18566 declaration of select_count.
18567 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18568 (Fother_window): Move to window.el.
18569 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18570 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18571 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18572 window.el.
18573 (replace_buffer_in_windows): Implement by calling
18574 Qreplace_buffer_in_windows.
18575 (replace_buffer_in_all_windows): Remove with some functionality
18576 moved into replace_buffer_in_windows_safely.
18577 (replace_buffer_in_windows_safely): New function.
18578 (select_window_norecord, select_frame_norecord): Move in front
18579 of run_window_configuration_change_hook. Remove now obsolete
18580 declarations.
640c8776
SM
18581 (Fset_window_buffer): Rewrite doc-string.
18582 Call Qrecord_window_buffer.
9397e56f
MR
18583 (keys_of_window): Move binding for other-window to window.el.
18584
b50691aa
CY
185852011-06-11 Chong Yidong <cyd@stupidchicken.com>
18586
18587 * dispextern.h (struct image): Replace data member, whose int_val
18588 and ptr_val fields were not used by anything, with a single
18589 lisp_val object.
18590
18591 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18592 (gif_clear_image, gif_load, imagemagick_load_image)
18593 (gs_clear_image, gs_load): Callers changed.
18594
3f754b86
PE
185952011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18596
cca69397
PE
18597 * buffer.h: Include <time.h>, for time_t.
18598 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18599
109e28d0
PE
18600 Fix minor problems found by static checking.
18601
60737f02
PE
18602 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18603
4b66faf3
PE
18604 Make identifiers static if they are not used in other modules.
18605 * data.c (Qcompiled_function, Qframe, Qvector):
18606 * image.c (QimageMagick, Qsvg):
18607 * minibuf.c (Qmetadata):
18608 * window.c (resize_window_check, resize_root_window): Now static.
18609 * window.h (resize_window_check, resize_root_window): Remove decls.
18610
109e28d0
PE
18611 * window.c (window_deletion_count, delete_deletable_window):
18612 Remove; unused.
46a4ce9e
PE
18613 (window_body_lines): Now static.
18614 (Fdelete_other_windows_internal): Mark vars as initialized.
18615 Make sure 'resize_failed' is initialized.
18616 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18617 (resize_window_apply): Remove unused local.
18618 * window.h (delete_deletable_window): Remove decl.
18619
109e28d0 18620 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
18621 (imagemagick_load_image): Fix pointer signedness problem by changing
18622 last arg from unsigned char * to char *. All uses changed.
18623 Also, fix a local for similar reasons.
18624 Remove unused locals. Remove locals to avoid shadowing.
18625 (fn_rsvg_handle_free): Remove; unused.
18626 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 18627 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 18628
3f754b86
PE
18629 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18630
2547adb1
CY
186312011-06-10 Chong Yidong <cyd@stupidchicken.com>
18632
18633 * image.c (gif_load): Fix omitted cast error introduced by
18634 2011-06-06 change.
18635
2c8e37d4
MR
186362011-06-10 Martin Rudalics <rudalics@gmx.at>
18637
18638 * window.h (resize_proportionally, orig_total_lines)
18639 (orig_top_line): Remove from window structure.
18640 (set_window_height, set_window_width, change_window_heights)
18641 (Fdelete_window): Remove prototypes.
18642 (resize_frame_windows): Remove duplicate declaration.
18643
440a42e3
EZ
186442011-06-10 Eli Zaretskii <eliz@gnu.org>
18645
18646 * window.h (resize_frame_windows, resize_window_check)
18647 (delete_deletable_window, resize_root_window)
18648 (resize_frame_windows): Declare prototypes.
18649
18650 * window.c (resize_window_apply): Make definition be "static" to
18651 match the prototype.
18652
562dd5e9
MR
186532011-06-10 Martin Rudalics <rudalics@gmx.at>
18654
18655 * window.c: Remove declarations of Qwindow_size_fixed,
18656 window_min_size_1, window_min_size_2, window_min_size,
18657 size_window, window_fixed_size_p, enlarge_window, delete_window.
18658 Remove static from declaration of Qdelete_window, it's
18659 temporarily needed by Fbury_buffer.
18660 (replace_window): Don't assign orig_top_line and
18661 orig_total_lines.
18662 (Fdelete_window, delete_window): Remove. Window deletion is
18663 handled by window.el.
640c8776
SM
18664 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18665 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
18666 (Fdelete_other_windows): Remove. Deleting other windows is
18667 handled by window.el.
18668 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18669 handled in window.el.
18670 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18671 Window minimum sizes are handled in window.el.
18672 (shrink_windows, size_window, set_window_height)
18673 (set_window_width, change_window_heights, window_height)
18674 (window_width, CURBEG, CURSIZE, enlarge_window)
18675 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18676 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18677 handled in window.el.
18678 (make_dummy_parent): Rename to make_parent_window and give it a
18679 second argument horflag.
18680 (make_window): Don't set resize_proportionally any more.
18681 (Fsplit_window): Remove. Windows are split in window.el.
18682 (save_restore_action, save_restore_orig_size)
18683 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18684 Resize mini windows in window.el.
18685 (grow_mini_window, shrink_mini_window): Implement by calling
18686 Qresize_root_window_vertically, resize_window_check and
18687 resize_window_apply.
640c8776
SM
18688 (saved_window, Fset_window_configuration, save_window_save):
18689 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
18690 resize_proportionally.
18691 (window_min_height, window_min_width): Move to window.el.
18692 (keys_of_window): Move bindings for delete-other-windows,
18693 split-window, delete-window and enlarge-window to window.el.
18694
18695 * buffer.c: Temporarily extern Qdelete_window.
18696 (Fbury_buffer): Temporarily call Qdelete_window instead of
18697 Fdelete_window (Fbury_buffer will move to window.el soon).
18698
18699 * frame.c (set_menu_bar_lines_1): Remove code handling
18700 orig_top_line and orig_total_lines.
18701
18702 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18703 set_window_height but set heights directly.
18704 (change_frame_size_1): Use resize_frame_windows.
18705
18706 * xdisp.c (init_xdisp): Don't use set_window_height but set
18707 heights directly.
18708
640c8776
SM
18709 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18710 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
18711 run_window_configuration_change_hook.
18712
18713 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18714 instead of change_window_heights and run
18715 run_window_configuration_change_hook.
18716
1a13852e
MR
187172011-06-09 Martin Rudalics <rudalics@gmx.at>
18718
18719 * window.c (replace_window): Rename second argument REPLACEMENT to
18720 NEW. New third argument SETFLAG. Rewrite.
18721 (delete_window, make_dummy_parent): Call replace_window with
18722 third argument 1.
18723 (window_list_1): Move down in code.
18724 (run_window_configuration_change_hook): Move set_buffer part
18725 before select_frame_norecord part in order to unwind correctly.
18726 Rename count1 to count.
18727 (recombine_windows, delete_deletable_window, resize_root_window)
18728 (Fdelete_other_windows_internal)
18729 (Frun_window_configuration_change_hook, make_parent_window)
18730 (resize_window_check, resize_window_apply, Fresize_window_apply)
18731 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
18732 (Fdelete_window_internal, Fresize_mini_window_internal):
18733 New functions.
1a13852e
MR
18734 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18735
f3d1777e
MR
187362011-06-08 Martin Rudalics <rudalics@gmx.at>
18737
496e208e
MR
18738 * window.h (window): Add some new members to window structure -
18739 normal_lines, normal_cols, new_total, new_normal, clone_number,
18740 splits, nest, prev_buffers, next_buffers.
18741 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 18742 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 18743
f3d1777e
MR
18744 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18745 Remove.
496e208e
MR
18746 (make_dummy_parent): Set new members of windows structure.
18747 (make_window): Move down in code. Handle new members of window
18748 structure.
18749 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18750 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18751 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18752 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
18753 (Fset_window_next_buffers, Fset_window_clone_number):
18754 New functions.
496e208e
MR
18755 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18756 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18757 Doc-string fixes.
18758 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18759 Argument WINDOW can be now internal window too.
18760 (Fwindow_use_time): Move up in code.
18761 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18762 Rewrite doc-string.
18763 (Fset_window_configuration, saved_window)
18764 (Fcurrent_window_configuration, save_window_save): Handle new
18765 members of window structure.
b9e809c2
MR
18766 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18767 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18768 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18769 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18770 Qget_mru_window, Qresize_root_window,
18771 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18772 Qauto_buffer_name; staticpro them.
f3d1777e 18773
abde8f8c
MR
187742011-06-07 Martin Rudalics <rudalics@gmx.at>
18775
18776 * window.c (Fwindow_total_size, Fwindow_left_column)
18777 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18778 (Fwindow_list_1): New functions.
18779 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
18780 (Fwindow_width, Fscroll_left, Fscroll_right):
18781 Use window_body_cols instead of window_box_text_cols.
18782 (delete_window, Fset_window_configuration):
18783 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
18784 (delete_all_subwindows): Take a window as argument and not a
18785 structure. Rewrite.
190b47e6
MR
18786 (window_loop): Remove handling of GET_LRU_WINDOW and
18787 GET_LARGEST_WINDOW.
18788 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
18789
18790 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
18791 window_box_text_cols. delete_all_subwindows now takes a
18792 Lisp_Object as argument.
abde8f8c 18793
640c8776
SM
18794 * indent.c (compute_motion, Fcompute_motion):
18795 Use window_body_cols instead of window_box_text_cols.
abde8f8c 18796
fa8a67e6
MR
18797 * frame.c (delete_frame): Call delete_all_subwindows with root
18798 window as argument.
18799
a54e3482
DC
188002011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18801
18802 * fns.c (Fputhash): Document return value.
18803
60002bf5
CY
188042011-06-06 Chong Yidong <cyd@stupidchicken.com>
18805
18806 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18807
0c671da6 188082011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 18809
b862a52a 18810 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 18811
be44ca6c
PE
18812 Check for overflow when converting integer to cons and back.
18813 * charset.c (Fdefine_charset_internal, Fdecode_char):
18814 Use cons_to_unsigned to catch overflow.
18815 (Fencode_char): Use INTEGER_TO_CONS.
18816 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18817 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18818 * data.c (long_to_cons, cons_to_long): Remove.
18819 (cons_to_unsigned, cons_to_signed): New functions.
18820 These signal an error for invalid or out-of-range values.
18821 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18822 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18823 * font.c (Ffont_variation_glyphs):
18824 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18825 * lisp.h: Include <intprops.h>.
18826 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18827 (cons_to_signed, cons_to_unsigned): New decls.
18828 (long_to_cons, cons_to_long): Remove decls.
18829 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18830 (Fprimitive_undo): Use CONS_TO_INTEGER.
18831 * xfns.c (Fx_window_property): Likewise.
18832 * xselect.c: Include <limits.h>.
18833 (x_own_selection, selection_data_to_lisp_data):
18834 Use INTEGER_TO_CONS.
18835 (x_handle_selection_request, x_handle_selection_clear)
18836 (x_get_foreign_selection, Fx_disown_selection_internal)
18837 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18838 (lisp_data_to_selection_data): Use cons_to_unsigned.
18839 (x_fill_property_data): Use cons_to_signed.
18840 Report values out of range.
18841
d1f3d2af
PE
18842 Check for buffer and string overflow more precisely.
18843 * buffer.h (BUF_BYTES_MAX): New macro.
18844 * lisp.h (STRING_BYTES_MAX): New macro.
18845 * alloc.c (Fmake_string):
18846 * character.c (string_escape_byte8):
18847 * coding.c (coding_alloc_by_realloc):
18848 * doprnt.c (doprnt):
18849 * editfns.c (Fformat):
18850 * eval.c (verror):
18851 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18852 since they may not be the same number.
18853 * editfns.c (Finsert_char):
18854 * fileio.c (Finsert_file_contents):
18855 Likewise for BUF_BYTES_MAX.
18856
dd52fcea
PE
18857 * image.c: Use ptrdiff_t, not int, for sizes.
18858 (slurp_file): Switch from int to ptrdiff_t.
18859 All uses changed.
18860 (slurp_file): Check that file size fits in both size_t (for
18861 malloc) and ptrdiff_t (for sanity and safety).
18862
7f9bbdbb
PE
18863 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18864 if b->modtime has its maximal value.
18865
dfe18f82
PE
18866 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18867
84acfcf0
PE
18868 Don't assume time_t can fit into int.
18869 * buffer.h (struct buffer.modtime): Now time_t, not int.
18870 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18871 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18872
ccd9a01a
PE
18873 Minor fixes for signed vs unsigned integers.
18874 * character.h (MAYBE_UNIFY_CHAR):
18875 * charset.c (maybe_unify_char):
18876 * keyboard.c (read_char, reorder_modifiers):
18877 XINT -> XFASTINT, since the integer must be nonnegative.
18878 * ftfont.c (ftfont_spec_pattern):
18879 * keymap.c (access_keymap, silly_event_symbol_error):
18880 XUINT -> XFASTINT, since the integer must be nonnegative.
18881 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18882 since it makes no difference and we prefer signed.
18883 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18884 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18885 nonnegative.
18886
d6d100dd
SM
188872011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18888
18889 * window.h (Fwindow_frame): Declare.
18890
2b6148e4
PE
188912011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18892
18893 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18894 (SPARE_MEMORY): Always define.
18895 (LARGE_REQUEST): Remove.
18896 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18897
f230ecc9
MR
188982011-06-06 Martin Rudalics <rudalics@gmx.at>
18899
727e958e
MR
18900 * lisp.h: Move EXFUNS for Fframe_root_window,
18901 Fframe_first_window and Fset_frame_selected_window to window.h.
18902
18903 * window.h: Move EXFUNS for Fframe_root_window,
18904 Fframe_first_window and Fset_frame_selected_window here from
18905 lisp.h.
18906
18907 * frame.c (Fwindow_frame, Fframe_first_window)
18908 (Fframe_root_window, Fframe_selected_window)
18909 (Fset_frame_selected_window): Move to window.c.
18910 (Factive_minibuffer_window): Move to minibuf.c.
18911 (Fother_visible_frames_p): New function.
18912
18913 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18914
f230ecc9
MR
18915 * window.c (decode_window, decode_any_window): Move up in code.
18916 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18917 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
18918 (Fwindow_buffer): Move up and rewrite doc-string.
18919 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18920 (Fwindow_prev): New functions.
727e958e
MR
18921 (Fwindow_frame): Move here from frame.c. Accept any window as
18922 argument.
18923 (Fframe_root_window, Fframe_first_window)
18924 (Fframe_selected_window): Move here from frame.c. Accept frame
18925 or arbitrary window as argument. Update doc-strings.
18926 (Fminibuffer_window): Move up in code.
18927 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
18928 (Fset_frame_selected_window): Move here from frame.c.
18929 Marginal rewrite.
727e958e
MR
18930 (Fselected_window, select_window, Fselect_window): Move up in
18931 code. Minor doc-string fixes.
f230ecc9 18932
4d09bcf6
PE
189332011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18934
18935 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18936 Do not assume that spare memory exists; that assumption is valid
18937 only if SYSTEM_MALLOC.
18938 (LARGE_REQUEST): New macro, so that the issue of large requests
18939 is separated from the issue of spare memory.
18940
810928a2
AS
189412011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18942
172418ad
AS
18943 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18944 format. (Bug#8806)
18945
43f862f7
AS
18946 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18947
810928a2
AS
18948 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18949 before statements.
18950
a059fe24
JD
189512011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18952
18953 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18954
18955 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18956
18957 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18958 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18959
989bf368
JB
189602011-06-05 Juanma Barranquero <lekktu@gmail.com>
18961
18962 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18963
4b80f674
CY
189642011-06-04 Chong Yidong <cyd@stupidchicken.com>
18965
18966 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18967 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
18968 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18969 New error handlers.
4b80f674
CY
18970 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18971 Obey Vx_select_enable_clipboard_manager. Catch errors in
18972 x_clipboard_manager_save (Bug#8779).
18973 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 18974 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 18975
99a33b77 189762011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
18977
18978 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18979
99a33b77 189802011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
18981
18982 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18983 in the current matrix if keep_current_p is non-zero.
18984
8264569d
EZ
189852011-06-04 Eli Zaretskii <eliz@gnu.org>
18986
18987 * bidi.c (bidi_level_of_next_char): Fix last change.
18988
57f97249
EZ
189892011-06-03 Eli Zaretskii <eliz@gnu.org>
18990
fec2107c 18991 Support bidi reordering of text covered by display properties.
57f97249 18992
fec2107c
EZ
18993 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18994 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18995 (bidi_cache_search, bidi_cache_iterator_state)
18996 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
18997 (bidi_level_of_next_char, bidi_move_to_visually_next):
18998 Support character positions inside a run of characters covered by a
fec2107c
EZ
18999 display string.
19000 (bidi_paragraph_init, bidi_resolve_explicit_1)
19001 (bidi_level_of_next_char): Call bidi_fetch_char and
19002 bidi_fetch_char_advance instead of FETCH_CHAR and
19003 FETCH_CHAR_ADVANCE.
19004 (bidi_init_it): Initialize new members.
19005 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19006 definitions.
19007 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19008 instead of using explicit *_CHAR codes.
d6d100dd
SM
19009 (bidi_resolve_explicit, bidi_resolve_weak):
19010 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
19011 bidirectional text is supported only in multibyte buffers.
19012 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19013 it to initialize the frame_window_p member of struct bidi_it.
19014 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19015 (bidi_resolve_explicit, bidi_resolve_weak)
19016 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19017 bidi_it->nchars is non-positive.
19018 (bidi_level_of_next_char): Don't try to lookup the cache for the
19019 next/previous character if nothing is cached there yet, or if we
19020 were just reseat()'ed to a new position.
c40e2fb2 19021
0e14fe90
EZ
19022 * xdisp.c (set_cursor_from_row): Set start and stop points
19023 according to the row's direction when priming the loop that looks
19024 for the glyph on which to display cursor.
19025 (single_display_spec_intangible_p): Function deleted.
19026 (display_prop_intangible_p): Reimplement to call
19027 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
19028 Accept 3 additional arguments needed by handle_display_spec.
19029 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
19030 values: lists, `(when COND...)' forms, etc.
19031 (single_display_spec_string_p): Support property values that are
19032 lists with the argument STRING its top-level element.
19033 (display_prop_string_p): Fix the condition for processing a
19034 property that is a list to be consistent with handle_display_spec.
fec2107c 19035 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
19036 last portion of handle_display_prop.
19037 (compute_display_string_pos): Accept additional argument
19038 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19039 value of a `display' property is a "replacing spec".
19040 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19041 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19042 the display property, but just return a value indicating whether
19043 the display property will replace the characters it covers.
19044 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19045 frame_window_p members of struct bidi_it.
d6d100dd
SM
19046 (compute_display_string_pos, compute_display_string_end):
19047 New functions.
fec2107c
EZ
19048 (push_it): Accept second argument POSITION, where pop_it should
19049 jump to continue iteration.
19050 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 19051
fec2107c
EZ
19052 * keyboard.c (adjust_point_for_property): Adjust the call to
19053 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
19054
19055 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
19056 (bidi_init_it): Update prototypes.
19057 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
19058 (compute_display_string_pos, compute_display_string_end):
19059 Declare prototypes.
fec2107c
EZ
19060 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19061 EMACS_INT.
fc6f18ce 19062
40087514 190632011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 19064
57f53182
PE
19065 Malloc failure behavior now depends on size of allocation.
19066 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19067 * lisp.h: Change signatures accordingly.
19068 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19069 All callers changed. (Bug#8762)
19070
19071 * gnutls.c: Use Emacs's memory allocators.
19072 Without this change, the gnutls library would invoke malloc etc.
19073 directly, which causes problems on non-SYNC_INPUT hosts, and which
19074 runs afoul of improving memory_full behavior. (Bug#8761)
19075 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19076 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19077 xfree instead of the default malloc, realloc, free.
19078 (Fgnutls_boot): No need to check for memory allocation failure,
19079 since xmalloc does that for us.
19080
ac32cd99 19081 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
19082 * category.c (hash_get_category_set):
19083 * ccl.c (ccl_driver):
19084 * charset.c (Fdefine_charset_internal):
19085 * charset.h (struct charset.hash_index):
19086 * composite.c (get_composition_id, gstring_lookup_cache)
19087 (composition_gstring_put_cache):
19088 * composite.h (struct composition.hash_index):
19089 * dispextern.h (struct image.hash):
19090 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19091 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19092 (hashfn_equal, hashfn_user_defined, make_hash_table)
19093 (maybe_resize_hash_table, hash_lookup, hash_put)
19094 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19095 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19096 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19097 * image.c (make_image, search_image_cache, lookup_image)
19098 (xpm_put_color_table_h):
19099 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 19100 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 19101 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 19102 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
19103 * alloc.c (allocate_vectorlike):
19104 Check for overflow in vector size calculations.
19105 * ccl.c (ccl_driver):
19106 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
19107 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19108 need to be updated by these changes.
40087514
PE
19109 * fns.c (make_hash_table, maybe_resize_hash_table):
19110 Check for integer overflow with large hash tables.
0de4bb68
PE
19111 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19112 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19113 (SXHASH_REDUCE): New macro.
19114 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19115 Use it instead of discarding useful hash info with large hash values.
19116 (sxhash_float): New function.
19117 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19118 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
19119 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19120 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
19121 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19122 Adjust signatures to match updated version of code.
19123 (consing_since_gc): Now EMACS_INT, since a single hash table can
19124 use more than INT_MAX bytes.
19125
698d32e2
DN
191262011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19127
19128 Make it possible to build with GCC-4.6+ -O2 -flto.
19129
19130 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19131
fd6fa53f
SM
191322011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19133
19134 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19135 Call minibuffer-inactive-mode.
19136
864db017
JB
191372011-05-31 Juanma Barranquero <lekktu@gmail.com>
19138
19139 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19140 Update dependencies.
19141
2ad0baf4
DN
191422011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19143
19144 * data.c (init_data): Remove code for UTS, this system is not
19145 supported anymore.
19146
4fcc2638
DN
191472011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19148
19149 Don't force ./temacs to start in terminal mode.
19150
19151 * frame.c (make_initial_frame): Initialize faces in all cases, not
19152 only when CANNOT_DUMP is defined.
19153 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19154
c56e0fd5
DN
191552011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19156
19157 * dispnew.c (add_window_display_history): Use const for the string
19158 pointer. Remove declaration, not needed.
19159
333d54da 191602011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 19161
55d4c1b2 19162 Use 'inline', not 'INLINE'.
333d54da 19163 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
19164 * alloc.c, fontset.c (INLINE): Remove.
19165 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19166 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19167 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19168 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19169 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19170
738db178
DN
191712011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19172
19173 Make it possible to run ./temacs.
19174
19175 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19176 syms_of_callproc does the same thing. Remove test for
19177 "initialized", do it in the caller.
19178 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19179
620c53a6
SM
191802011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19181
19182 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19183 (read_minibuf): Use get_minibuffer.
19184 (syms_of_minibuf): Use DEFSYM.
19185 (Qmetadata): New var.
19186 * data.c (Qbuffer): Don't make it static.
19187 (syms_of_data): Use DEFSYM.
19188
e003a292
PE
191892011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19190
19191 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19192 (CCL_CODE_MIN): New macro.
19193
ed008a6d
PE
191942011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19195
3687c2ef
PE
19196 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19197
ed008a6d
PE
19198 * eval.c (Qdebug): Now static.
19199 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19200 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19201 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19202
d66c4c7c
CY
192032011-05-29 Chong Yidong <cyd@stupidchicken.com>
19204
19205 * image.c: Various fixes to ImageMagick code comments.
19206 (Fimagemagick_types): Doc fix.
19207
5fbc2025
PE
192082011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19209
0196f88a
PE
19210 Minor fixes prompted by GCC 4.6.0 warnings.
19211
19212 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19213
5fbc2025
PE
19214 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19215 (x_clipboard_manager_save_all): Move extern decl to ...
19216 * xterm.h: ... here, so that it can be checked for consistency.
19217
1dd3c2d9
CY
192182011-05-29 Chong Yidong <cyd@stupidchicken.com>
19219
19220 * xselect.c (x_clipboard_manager_save_frame)
19221 (x_clipboard_manager_save_all): New functions.
19222 (Fx_clipboard_manager_save): Lisp function deleted.
19223
19224 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19225 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19226
19227 * xterm.h: Update prototype.
19228
5ba6571d
WX
192292011-05-28 William Xu <william.xwl@gmail.com>
19230
19231 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19232 exiting (Bug#8239).
19233
3eaff834
JM
192342011-05-28 Jim Meyering <meyering@redhat.com>
19235
e1900994 19236 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
19237 * fns.c (to_uchar): Define.
19238 (crypto_hash_function): Use it to convert some newly-signed
19239 variables to unsigned, to avoid sign-extension bugs. For example,
19240 without this change, (md5 "truc") would evaluate to
19241 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19242 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 19243 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 19244
0f6990a7
PE
192452011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19246
19247 Integer overflow fixes.
c8a9ca5a 19248
08686060
PE
19249 * dbusbind.c: Serial number integer overflow fixes.
19250 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
19251 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19252 to hold a serial number that is too large for a fixnum.
19253 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19254 Check for serial numbers out of range. Decode any serial number
59568bf0 19255 that was so large that it became a float. (Bug#8722)
08686060 19256
2d1fc3c7
PE
19257 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19258 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19259 Use XFASTINT rather than XUINT when numbers are nonnegative.
19260 (xd_append_arg, Fdbus_method_return_internal):
19261 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19262 arguments, check that Lisp number is nonnegative, rather than
59568bf0 19263 silently wrapping negative numbers around. (Bug#8722)
30217ff0 19264 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 19265 (Bug#8722)
2d1fc3c7 19266
c8a9ca5a
PE
19267 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19268
519e1d69
PE
19269 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19270
6df6ae42 19271 ccl: Add integer overflow checks.
30569699
PE
19272 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19273 (IN_INT_RANGE): New macros.
19274 (ccl_driver): Use them to check for integer overflow when
19275 decoding a CCL program. Many of the new checks are whether XINT (x)
19276 fits in int; it doesn't always, on 64-bit hosts. The new version
19277 doesn't catch all possible integer overflows, but it's an
847044ea 19278 improvement. (Bug#8719)
30569699 19279
c11285dc
PE
19280 * alloc.c (make_event_array): Use XINT, not XUINT.
19281 There's no need for unsigned here.
19282
fdccd48e
PE
19283 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19284 This follows up to the 2011-05-06 change that substituted uintptr_t
19285 for EMACS_INT. This case wasn't caught back then.
19286
37910ab2
PE
19287 Rework Fformat to avoid integer overflow issues.
19288 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19289 now (part of C89). Include <verify.h>.
19290 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19291 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19292 (Fformat): Avoid the prepass trying to compute sizes; it was only
19293 approximate and thus did not catch overflow reliably. Instead, walk
19294 through the format just once, formatting and computing sizes as we go,
19295 checking for integer overflow at every step, and allocating a larger
19296 buffer as needed. Keep track separately whether the format is
19297 multibyte. Keep only the most-recently calculated precision, rather
19298 than them all. Record whether each argument has been converted to
19299 string. Use EMACS_INT, not int, for byte and char and arg counts.
19300 Support field widths and precisions larger than INT_MAX. Avoid
19301 sprintf's undefined behavior with conversion specifications such as %#d
19302 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19303 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19304 formatting out-of-range floating point numbers with int
9173deec 19305 formats. (Bug#8668)
37910ab2 19306
2e6578fb
PE
19307 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19308
0ae6bdee
PE
19309 * data.c: Avoid integer truncation in expressions involving floats.
19310 * data.c: Include <intprops.h>.
19311 (arith_driver): When there's an integer overflow in an expression
19312 involving floating point, convert the integers to floating point
19313 so that the resulting value does not suffer from catastrophic
19314 integer truncation. For example, on a 64-bit host (* 4
19315 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19316 Do not rely on undefined behavior after integer overflow.
19317
de883a70
PE
19318 merge count_size_as_multibyte, parse_str_to_multibyte
19319 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 19320 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
19321 Check for integer overflow.
19322 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19323 since it's now a duplicate of the other. This is more of
19324 a character than a buffer op, so better that it's in character.c.
19325 * fns.c, print.c: Adjust to above changes.
19326
2ff916cb
PE
193272011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19328
19329 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19330
f1b54466
PE
193312011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19332
fb1ac845
PE
19333 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19334 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19335 (x_clipboard_manager_save): Now static.
19336 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19337
f1b54466
PE
19338 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19339 (crypto_hash_function): Now static.
19340 Fix pointer signedness problems. Avoid unnecessary initializations.
19341
a9f737ee
CY
193422011-05-27 Chong Yidong <cyd@stupidchicken.com>
19343
19344 * termhooks.h (Vselection_alist): Make it terminal-local.
19345
19346 * terminal.c (create_terminal): Initialize it.
19347
19348 * xselect.c: Support for clipboard managers.
19349 (Vselection_alist): Move to termhooks.h as terminal-local var.
19350 (LOCAL_SELECTION): New macro.
19351 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19352 (symbol_to_x_atom): Remove gratuitous arg.
19353 (x_handle_selection_request, lisp_data_to_selection_data)
19354 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
19355 (x_own_selection, x_get_local_selection, x_convert_selection):
19356 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
19357 (some_frame_on_display): Delete unused function.
19358 (Fx_own_selection_internal, Fx_get_selection_internal)
19359 (Fx_disown_selection_internal, Fx_selection_owner_p)
19360 (Fx_selection_exists_p): New optional frame arg.
19361 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19362 (x_handle_selection_clear): Don't treat other terminals with the
19363 same keyboard specially. Use the terminal-local Vselection_alist.
19364 (x_clear_frame_selections): Use Frun_hook_with_args.
19365
19366 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19367
19368 * xterm.h: Add support for those atoms.
19369
e067f0c1
CY
193702011-05-26 Chong Yidong <cyd@stupidchicken.com>
19371
19372 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19373 (converted_selections, conversion_fail_tag): New global variables.
19374 (x_selection_request_lisp_error): Free the above.
19375 (x_get_local_selection): Remove unnecessary code.
19376 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
19377 of converted selections stored in converted_selections.
19378 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
19379 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19380 (x_convert_selection): New function.
19381 (x_handle_selection_event): Simplify.
19382 (x_get_foreign_selection): Don't ignore incoming requests while
19383 waiting for an answer; this will fail when we implement
19384 SAVE_TARGETS, and seems unnecessary anyway.
19385 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19386 (Vx_sent_selection_functions): Doc fix.
19387
0f4aebc0
LL
193882011-05-26 Leo Liu <sdl.web@gmail.com>
19389
19390 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19391
e61124cd
YM
193922011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19393
19394 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19395
19396 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19397 for fringe update if it has periodic bitmap.
ac389d0c 19398 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
19399 and fringe_bitmap_periodic_p.
19400
19401 * fringe.c (get_fringe_bitmap_data): New function.
19402 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19403 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19404 row. Mark glyph row for fringe update if periodicity changed.
19405
19406 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19407 for fringe update unless it has periodic bitmap.
19408
f16d9837
KH
194092011-05-25 Kenichi Handa <handa@m17n.org>
19410
19411 * xdisp.c (get_next_display_element): Set correct it->face_id for
19412 a static composition.
19413
e1b90ef6
LL
194142011-05-24 Leo Liu <sdl.web@gmail.com>
19415
19416 * deps.mk (fns.o):
19417 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19418
19419 * fns.c (crypto_hash_function, Fsha1): New function.
19420 (Fmd5): Use crypto_hash_function.
19421 (syms_of_fns): Add Ssha1.
19422
7400048f
PE
194232011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19424
19425 * gnutls.c: Remove unused macros.
19426 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19427 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19428 Remove macros that are defined and never used.
19429 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19430
abb71cf4
CY
194312011-05-22 Chong Yidong <cyd@stupidchicken.com>
19432
19433 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19434 (Fx_get_selection_internal): Minor cleanup.
19435 (Fx_own_selection_internal): Rename arguments for consistency with
19436 select.el.
19437
6307db39
PE
194382011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19439
19440 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19441
f3d4e0a4
CY
194422011-05-22 Chong Yidong <cyd@stupidchicken.com>
19443
19444 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19445
4d8ade89
YM
194462011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19447
19448 * dispnew.c (scrolling_window): Don't exclude the case that the
19449 last enabled row in the desired matrix touches the bottom boundary.
19450
32078c8d
GM
194512011-05-21 Glenn Morris <rgm@gnu.org>
19452
19453 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
19454 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19455 and add some more files.
32078c8d 19456
7285dc67
EZ
194572011-05-20 Eli Zaretskii <eliz@gnu.org>
19458
19459 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19460 report_file_error introduced by the change from 2011-05-07.
19461
89d1bd22
PE
194622011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19463
19464 * systime.h (Time): Define only if emacs is defined.
19465 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19466 where the include path doesn't have X11/X.h by default. See
19467 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19468
cd394be1 194692011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
19470
19471 * composite.c (find_automatic_composition): Fix previous change.
19472
b9704ad9
GM
194732011-05-20 Glenn Morris <rgm@gnu.org>
19474
19475 * lisp.mk: New file, split from Makefile.in.
19476 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19477 (shortlisp): Remove.
19478 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19479
4a720484
GM
194802011-05-19 Glenn Morris <rgm@gnu.org>
19481
19482 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19483 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19484 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19485 (lisp): Set the order to that of loadup.el.
19486 (shortlisp): Make it a copy of $lisp.
19487 (SOME_MACHINE_LISP): Remove.
19488 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19489 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19490
a28d4396
KH
194912011-05-18 Kenichi Handa <handa@m17n.org>
19492
19493 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19494 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19495 (find_automatic_composition): Mostly rewrite for efficiency.
19496
a2b1fa8e
JB
194972011-05-18 Juanma Barranquero <lekktu@gmail.com>
19498
19499 * makefile.w32-in: Update dependencies.
19500
8e1f5610
CS
195012011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19502
19503 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 19504 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 19505
7025ee00 195062011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 19507
cdfa6eab
PE
19508 Fix some integer overflow issues, such as string length overflow.
19509
06d6db33
PE
19510 * insdel.c (count_size_as_multibyte): Check for string overflow.
19511
2b4560a8
PE
19512 * character.c (lisp_string_width): Check for string overflow.
19513 Use EMACS_INT, not int, for string indexes and lengths; in
19514 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19515 the resulting string length overflows an EMACS_INT; instead,
19516 report a string overflow if no precision given. When checking for
19517 precision exhaustion, use a check that cannot possibly have
19518 integer overflow. (Bug#8675)
19519 * character.h (lisp_string_width): Adjust to new signature.
19520
cb93f9be
PE
19521 * alloc.c (string_overflow): New function.
19522 (Fmake_string): Use it. This doesn't change behavior, but saves
19523 a few bytes and will simplify future changes.
19524 * character.c (string_escape_byte8): Likewise.
19525 * lisp.h (string_overflow): New decl.
19526
1a1f3366
PE
19527 Fixups, following up to the user-interface timestamp change.
19528 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19529 for UI timestamps, instead of unsigned long.
9fbd6841
PE
19530 * msdos.c (mouse_get_pos): Likewise.
19531 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
19532 * w32gui.h (Time): Define by including "systime.h" rather than by
19533 declaring it ourselves. (Bug#8664)
19534
d4e3e4d3
PE
19535 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19536 * image.c (clear_image_cache): Likewise.
19537
f6a24d19
PE
19538 * term.c (term_mouse_position): Don't assume time_t wraparound.
19539
08dc5ae6
PE
19540 Be more systematic about user-interface timestamps.
19541 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
19542 and sometimes 'EMACS_UINT', to represent these timestamps.
19543 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
19544 This makes the code easier to follow, and makes it easier to catch
19545 integer overflow bugs such as Bug#8664.
19546 * frame.c (Fmouse_position, Fmouse_pixel_position):
19547 Use Time, not unsigned long, for user-interface timestamps.
19548 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19549 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19550 * keyboard.h (last_event_timestamp): Likewise.
19551 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19552 * menu.h (xmenu_show): Likewise.
19553 * term.c (term_mouse_position): Likewise.
19554 * termhooks.h (struct input_event.timestamp): Likewise.
19555 (struct terminal.mouse_position_hook): Likewise.
19556 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19557 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19558 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19559 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19560 what it was before.
19561 * menu.h, termhooks.h: Include "systime.h", for Time.
19562
8e55734a
PE
19563 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19564 Don't assume that the difference between two unsigned long values
19565 can fit into an integer. At this point, we know button_down_time
19566 <= event->timestamp, so the difference must be nonnegative, so
19567 there's no need to cast the result if double-click-time is
19568 nonnegative, as it should be; check that it's nonnegative, just in
19569 case. This bug is triggered when events are more than 2**31 ms
86db42d2 19570 apart (about 25 days). (Bug#8664)
8e55734a 19571
841f1b75 19572 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 19573 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 19574
3e26f69c
PE
19575 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19576 that always fit in int. Use a sentinel instead of a counter, to
19577 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
19578 * frame.h (struct frame): Use int for menu_bar_items_used
19579 instead of EMACS_INT, since it always fits in int.
3e26f69c 19580
5cc152c0
PE
19581 * menu.c (grow_menu_items): Check for int overflow.
19582
d89eb65e
PE
19583 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19584
5235bd3e
PE
19585 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19586 Before, the code was not consistent. These values cannot exceed
19587 2**31 - 1 so there's no need to make them unsigned.
19588 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19589 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19590 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19591 as modifiers.
19592 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19593
bc827e23
PE
19594 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19595 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19596 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19597 presumably because the widths might not match.
19598
78eb494e
PE
19599 * window.c (size_window): Avoid needless test at loop start.
19600
04f2d78b
CB
196012011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19602
19603 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19604
d2fc7e3d 196052011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
19606
19607 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19608
d2fc7e3d 196092011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
19610
19611 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19612 `width' to `bar_area_x' and `bar_area_width', respectively.
19613 (x_scroll_run): Take account of fringe background extension.
19614
04f2d78b
CB
19615 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19616 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
19617 `bar_area_width', respectively.
19618 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19619 background extension.
19620
79b70037
GM
196212011-05-10 Jim Meyering <meyering@redhat.com>
19622
19623 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19624
2f142cc5
JB
196252011-05-10 Juanma Barranquero <lekktu@gmail.com>
19626
19627 * image.c (Finit_image_library): Return t for built-in image types,
19628 like pbm and xbm. (Bug#8640)
19629
57679c86
AS
196302011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19631
19632 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19633
888c9e86
EZ
196342011-05-07 Eli Zaretskii <eliz@gnu.org>
19635
b0512a1d
EZ
19636 * w32console.c (Fset_screen_color): Doc fix.
19637 (Fget_screen_color): New function.
19638 (syms_of_ntterm): Defsubr it.
19639
7285dc67
EZ
19640 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19641 unlink the temporary file if Fcall_process didn't create it in the
19642 first place.
19643 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19644 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
19645 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19646 cue to call_process_cleanup not to close that handle.
19647
4d3fcc8e
BK
196482011-05-07 Ben Key <bkey76@gmail.com>
19649
19650 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19651 one of two shell specific rules, either bootstrap-temacs-CMD or
19652 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19653 to the previous implementation of the bootstrap-temacs rule.
19654 The bootstrap-temacs-CMD rule is similar to the previous
19655 implementation of the bootstrap-temacs rule except that it
19656 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19657 variable.
19658
19659 These changes, along with some changes to nt/configure.bat,
19660 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19661 earlier fix to add support for --cflags and --ldflags options
19662 that include quotes so that it works whether make uses cmd or
19663 sh as the shell.
19664
b4289b64
MA
196652011-05-06 Michael Albinus <michael.albinus@gmx.de>
19666
19667 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19668 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19669 is a constant.
19670 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19671 a string. Handle both cases.
19672 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19673 (Fdbus_register_method): Use Qinvalid_function.
19674
af4c0e28
JB
196752011-05-06 Juanma Barranquero <lekktu@gmail.com>
19676
19677 * makefile.w32-in: Update dependencies.
19678 (LISP_H): Add inttypes.h and stdin.h.
19679 (PROCESS_H): Add unistd.h.
19680
c51453d9
EZ
196812011-05-06 Eli Zaretskii <eliz@gnu.org>
19682
19683 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19684 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19685
8ff0ac3c 196862011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 19687
4c4b566b
PE
19688 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19689
aab2b9b5
PE
19690 * term.c (vfatal): Remove stray call to va_end.
19691 It's not needed and the C Standard doesn't allow it here anyway.
19692
c378da0b
PE
19693 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19694 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19695
288b08c7
PE
19696 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19697 bytes.
19698
e3601888
PE
19699 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19700
db6c0e74
PE
19701 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19702
dd5963ea
PE
19703 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19704
88c9450f
PE
19705 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19706
2f9442b8
PE
19707 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19708
c032b5f8
PE
19709 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19710 * charset.c (Fdefine_charset_internal): Don't initialize
19711 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 19712 32-bit int (Bug#8600).
a108c10b
PE
19713
19714 * lread.c (read_integer): Be more consistent with string-to-number.
19715 Use string_to_number to do the actual conversion; this avoids
19716 rounding errors and fixes some other screwups. Without this fix,
19717 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19718 (digit_to_number): Move earlier, for benefit of read_integer.
19719 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 19720 not a digit in any supported base. (Bug#8602)
a108c10b 19721
ad5f9eea
PE
19722 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19723
aec1708a
PE
19724 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19725 to match comment at start of function. This also removes a
19726 GCC warning about overflow in a 32+64-bit port.
19727
47be4ab5
PE
19728 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19729
371cac43
PE
19730 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19731 Reported by Stefan Monnier in
19732 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
19733 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19734 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 19735
d01a7826
PE
19736 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19737 (EMACS_UINTPTR): Likewise, with uintptr_t.
19738
7fd47d5c
PE
19739 * lisp.h: Prefer 64-bit EMACS_INT if available.
19740 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19741 on 32-bit hosts that have 64-bit int, so that they can access
19742 large files.
122b0c86
PE
19743 However, temporarily disable this change unless the temporary
19744 symbol WIDE_EMACS_INT is defined.
7fd47d5c 19745
8727937b
PE
19746 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19747
8ac068ac
PE
19748 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19749 This removes an assumption that EMACS_INT and long are the same
19750 width as pointers. The assumption is true for Emacs porting targets
19751 now, but we want to make other targets possible.
19752 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19753 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19754 In the rest of the code, change types of integers that hold casted
19755 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19756 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19757 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19758 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19759 No need to cast type when ORing.
19760 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19761 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19762 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19763 assume EMACS_INT is the same width as char *.
19764 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19765 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19766 Remove no-longer-needed casts.
19767 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19768 (xg_tool_bar_help_callback, xg_make_tool_item):
19769 Use EMACS_INTPTR to hold an integer
19770 that will be cast to void *; this can avoid a GCC warning
19771 if EMACS_INT is not the same width as void *.
19772 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19773 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19774 (current_message_1, set_message_1):
19775 Use a local to convert to proper width without a cast.
19776 * xmenu.c (dialog_selection_callback): Likewise.
19777
ede49d71
PE
19778 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19779 Also, don't assume VALBITS / RAND_BITS is less than 5,
19780 and don't rely on undefined behavior when shifting a 1 left into
19781 the sign bit.
19782 * lisp.h (get_random): Change signature to match.
19783
2f30ecd0
PE
19784 * lread.c (hash_string): Use size_t, not int, for hash computation.
19785 Normally we prefer signed values; but hashing is special, because
19786 it's better to use unsigned division on hash table sizes so that
19787 the remainder is nonnegative. Also, size_t is the natural width
19788 for hashing into memory. The previous code used 'int', which doesn't
19789 retain enough info to hash well into very large tables.
19790 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19791
2a866e7b
PE
19792 * dbusbind.c: Don't possibly lose pointer info when converting.
19793 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19794 Use XPNTR rather than XHASH, so that the high-order bits of
19795 the pointer aren't lost when converting through void *.
19796
51639eac
PE
19797 * eval.c (Fautoload): Don't double-shift a pointer.
19798
92394119
PE
19799 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19800
dbdb9a7c
JB
198012011-05-06 Juanma Barranquero <lekktu@gmail.com>
19802
19803 * gnutls.c (DEF_GNUTLS_FN):
19804 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19805
db7a0b4f
AS
198062011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19807
19808 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19809 marker. (Bug#8610)
19810
cd394be1 198112011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
19812
19813 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19814 New version that can reserve upto 2GB of heap space.
19815
f7ff1b0f 198162011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
19817
19818 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19819
639c109b
TZ
198202011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19821
19822 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19823 `gnutls_certificate_set_x509_key_file'.
19824
d2127135
JB
198252011-05-05 Juanma Barranquero <lekktu@gmail.com>
19826
19827 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19828 Update dependencies.
19829
e968f4f3
JB
198302011-05-04 Juanma Barranquero <lekktu@gmail.com>
19831
19832 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19833 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19834 Remove unused parameter `fildes'.
19835 * process.c (read_process_output, send_process): Don't pass it.
19836
84d358f0
JB
198372011-05-04 Juanma Barranquero <lekktu@gmail.com>
19838
19839 Fix previous change: the library cache is defined in w32.c.
19840 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19841 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19842
0898ca10
JB
198432011-05-04 Juanma Barranquero <lekktu@gmail.com>
19844
19845 Implement dynamic loading of GnuTLS on Windows.
19846
19847 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19848 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19849 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19850 Declare.
19851
19852 * gnutls.c (Qgnutls_dll): Define.
19853 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19854 (gnutls_*): Declare function pointers.
19855 (init_gnutls_functions): New function to initialize function pointers.
19856 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19857 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19858 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19859 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19860 (emacs_gnutls_write, emacs_gnutls_read)
19861 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19862 (Fgnutls_available_p): New function.
19863 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19864 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19865 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19866
19867 * image.c: Include w32.h.
19868 (Vimage_type_cache): Delete.
19869 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19870 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19871 (w32_delayed_load): Move to w32.c.
19872
19873 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19874
19875 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19876 (w32_delayed_load): Move from image.c. When loading a library, record
19877 its filename in the :loaded-from property of the library id.
19878 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19879 Initialize and staticpro them.
19880 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19881
19882 * process.c: Include lisp.h before w32.h, not after.
19883 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19884 instead of gnutls_record_check_pending.
19885
19886 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19887
ff4de4aa
TZ
198882011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19889
19890 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19891 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19892 as passed in.
19893
abe95abb
JD
198942011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19895
19896 * xterm.c (x_set_frame_alpha): Do not set property on anything
19897 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19898
e16e55d4
JB
198992011-05-02 Juanma Barranquero <lekktu@gmail.com>
19900
19901 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19902
bafcf6a5
JB
199032011-05-02 Juanma Barranquero <lekktu@gmail.com>
19904
19905 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19906 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19907 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19908 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19909 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19910 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19911 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19912 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19913 (Qgnutls_bootprop_callbacks_verify): Make static.
19914
e7a6747f
AS
199152011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19916
19ed11ba
AS
19917 * callproc.c: Indentation fixup.
19918
e7a6747f 19919 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
19920 (wait_for_termination, interruptible_wait_for_termination):
19921 Move after wait_for_termination_1.
e7a6747f 19922
1ef14cb4
LMI
199232011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19924
19925 * sysdep.c (interruptible_wait_for_termination): New function
19926 which is like wait_for_termination, but allows keyboard
19927 interruptions.
19928
19929 * callproc.c (Fcall_process): Add (:file "file") as an option for
19930 the STDOUT buffer.
19931 (Fcall_process_region): Ditto.
19932
330d880c
EZ
199332011-04-30 Eli Zaretskii <eliz@gnu.org>
19934
8db90b73
EZ
19935 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19936 rather than `XVECTOR (FOO)->size'.
19937
330d880c
EZ
19938 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19939 inttypes.h, as a gnulib replacement is used if it not available in
19940 system headers.
19941
15cbd324
EZ
199422011-04-21 Eli Zaretskii <eliz@gnu.org>
19943
19944 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19945 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19946 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19947
19948 * coding.c (coding_alloc_by_realloc): Error out if destination
19949 will grow beyond MOST_POSITIVE_FIXNUM.
19950 (decode_coding_emacs_mule): Abort if there isn't enough place in
19951 charbuf for the composition carryover bytes. Reserve an extra
19952 space for up to 2 characters produced in a loop.
19953 (decode_coding_iso_2022): Abort if there isn't enough place in
19954 charbuf for the composition carryover bytes.
19955
199562011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 19957
ae940cca
EZ
19958 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19959 aborting when %lld or %lll format is passed.
19960 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19961 %llo or %llx format is passed. (Bug#8545)
19962
03ab8921
EZ
19963 * window.c (window_scroll_line_based): Use a marker instead of
19964 simple variables to record original value of point. (Bug#7952)
19965
afda1437
EZ
19966 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19967 produced by %s or %c overflows available buffer space. (Bug#8545)
19968
f76dee0c
PE
199692011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19970
19971 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 19972 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 19973
fdc5744d
JB
199742011-04-28 Juanma Barranquero <lekktu@gmail.com>
19975
19976 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19977
638f053a
JB
199782011-04-28 Juanma Barranquero <lekktu@gmail.com>
19979
19980 * keyboard.c (Qdelayed_warnings_hook): Define.
19981 (command_loop_1): Run `delayed-warnings-hook'
19982 if Vdelayed_warnings_list is non-nil.
19983 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19984 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19985
d178f871
EZ
199862011-04-28 Eli Zaretskii <eliz@gnu.org>
19987
19988 * doprnt.c (doprnt): Don't return value smaller than the buffer
19989 size if the message was truncated. (Bug#8545).
19990
b124fd93
JB
199912011-04-28 Juanma Barranquero <lekktu@gmail.com>
19992
19993 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19994 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19995
e810457d
PE
199962011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19997
19998 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19999
ea51cceb
JB
200002011-04-27 Juanma Barranquero <lekktu@gmail.com>
20001
20002 * makefile.w32-in: Update dependencies.
20003
94dcfacf
EZ
200042011-04-27 Eli Zaretskii <eliz@gnu.org>
20005
20006 Improve `doprnt' and its usage. (Bug#8545)
20007 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20008 `format_end'. Remove support for %l as a conversion specifier.
20009 Don't use xrealloc. Improve diagnostics when the %l size modifier
20010 is used. Update the commentary.
20011
20012 * eval.c (verror): Simplify calculation of size_t.
20013
20014 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20015 messages.
20016
f61f41d7
PE
200172011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20018
20019 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20020 change.
20021
96fb4434
PE
200222011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20023
20024 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20025 This makes this file independent of the recent pseudovector change.
20026
671875da 200272011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 20028
69e9b5a3
PE
20029 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20030
b5f869a7 20031 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 20032 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 20033 Remove unused local.
c8926152 20034 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 20035
841a1577 20036 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
20037 GCC 4.6.0 optimizes based on type-based alias analysis.
20038 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
20039 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20040 != &v->size, and therefore "v->size = 1; b->size = 2; return
20041 v->size;" must therefore return 1. This assumption is incorrect
20042 for Emacs, since it type-puns struct Lisp_Vector * with many other
20043 types. To fix this problem, this patch adds a new type struct
f904488f 20044 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
20045 and pseudovectors, and helps optimizing compilers not get fooled
20046 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20047 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
20048 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20049 the size member.
eab3844f
PE
20050 (XSETPVECTYPE): Rewrite in terms of new macro.
20051 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20052 This is a bit clearer, and further avoids the possibility of
20053 undesirable aliasing.
20054 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 20055 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
20056 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20057 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
20058 (ASIZE): Now uses header.size rather than size.
20059 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
20060 to avoid the hassle of writing XVECTOR (foo)->header.size.
20061 (struct vectorlike_header): New type.
eab3844f
PE
20062 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20063 object, to help avoid aliasing.
20064 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20065 (SUBRP): Likewise, since Lisp_Subr is a special case.
20066 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20067 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20068 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 20069 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
20070 changed to be "header.size" and "header.next".
20071 * buffer.h (struct buffer): Likewise.
20072 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20073 * frame.h (struct frame): Likewise.
20074 * process.h (struct Lisp_Process): Likewise.
20075 * termhooks.h (struct terminal): Likewise.
20076 * window.c (struct save_window_data, struct saved_window): Likewise.
20077 * window.h (struct window): Likewise.
20078 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20079 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20080 * buffer.c (init_buffer_once): Likewise.
20081 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20082 special case.
20083 * process.c (Fformat_network_address): Use local var for size,
20084 for brevity.
20085
0df1eac5
PE
20086 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20087
847ab9d1 20088 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
20089 * data.c (atof): Remove decl; no longer used or needed.
20090 (digit_to_number): Move to lread.c.
20091 (Fstring_to_number): Use new string_to_number function, to be
20092 consistent with how the Lisp reader treats infinities and NaNs.
20093 Do not assume that floating-point numbers represent EMACS_INT
20094 without losing information; this is not true on most 64-bit hosts.
20095 Avoid double-rounding errors, by insisting on integers when
20096 parsing non-base-10 numbers, as the documentation specifies.
20097 * lisp.h (string_to_number): New decl, replacing ...
20098 (isfloat_string): Remove.
bc0a5c13 20099 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 20100 (read1): Do not accept +. and -. as integers; this
452f4150
PE
20101 appears to have been a coding error. Similarly, do not accept
20102 strings like +-1e0 as floating point numbers. Do not report
20103 overflow for integer overflows unless the base is not 10 which
20104 means we have no simple and reliable way to continue.
20105 Break out the floating-point parsing into a new
20106 function string_to_number, so that Fstring_to_number parses
20107 floating point numbers consistently with the Lisp reader.
04f2d78b 20108 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
20109 (E_CHAR, EXP_INT): Remove, replacing with ...
20110 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20111 (string_to_number): New function, replacing isfloat_string.
20112 This function checks for valid syntax and produces the resulting
20113 Lisp float number too. Rework it so that string-to-number
bc0a5c13 20114 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
20115 so that overflow for non-base-10 numbers is reported only when
20116 there's no portable and simple way to convert to floating point.
452f4150 20117
67769ffc
PE
20118 * textprop.c (set_text_properties_1): Rewrite for clarity,
20119 and to avoid GCC warning about integer overflow.
20120
c20db43f
PE
20121 * intervals.h (struct interval): Use EMACS_INT for members
20122 where EMACS_UINT might cause problems. See
20123 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20124 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20125 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20126 All uses changed.
37aa2f85
PE
20127 (offset_intervals): Tell GCC not to worry about length overflow
20128 when negating a negative length.
c20db43f 20129
2538aa2f
PE
20130 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20131 (overrun_check_free): Likewise.
20132
f2d3008d
PE
20133 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20134 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20135 word size.
20136
ec8df744
PE
20137 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20138 (gnutls_make_error): Rename local to avoid shadowing.
20139 (gnutls_emacs_global_deinit): ifdef out; not used.
20140 (Fgnutls_boot): Use const for pointer to readonly storage.
20141 Comment out unused local. Fix pointer signedness problems.
20142
640ee02d
PE
20143 * lread.c (openp): Don't stuff size_t into an 'int'.
20144 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20145 about possible signed overflow.
20146
6048fb2a
PE
20147 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20148 (GDK_KEY_g): Don't define if already defined.
20149 (xg_prepare_tooltip): Avoid pointer signedness problem.
20150 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20151
fa3c87e1
PE
20152 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20153 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20154
2172544b
PE
20155 * xfns.c (Fx_window_property): Simplify a bit,
20156 to make a bit faster and to avoid GCC 4.6.0 warning.
20157 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20158
9b821a21
PE
20159 * fns.c (internal_equal): Don't assume size_t fits in int.
20160
3c616cfa
PE
20161 * alloc.c (compact_small_strings): Tighten assertion a little.
20162
c2982e87
PE
20163 Replace pEd with more-general pI, and fix some printf arg casts.
20164 * lisp.h (pI): New macro, generalizing old pEd macro to other
20165 conversion specifiers. For example, use "...%"pI"d..." rather
20166 than "...%"pEd"...".
20167 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 20168 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
20169 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20170 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20171 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20172 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20173 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20174 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20175 64-bit hosts.
20176 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20177 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20178 * print.c (safe_debug_print, print_object): Likewise.
20179 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20180 to int.
6f04d126
PE
20181 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20182 avoiding the 0 flag, which is not portable.
c2982e87
PE
20183 * process.c (Fmake_network_process): Use pI to avoid cast.
20184 * region-cache.c (pp_cache): Likewise.
20185 * xdisp.c (decode_mode_spec): Likewise.
20186 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20187 behavior on 64-bit hosts with printf arg.
6f04d126 20188 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
20189 (x_stop_queuing_selection_requests): Likewise.
20190 (x_get_window_property): Don't truncate byte count to an 'int'
20191 when tracing.
0b432f21 20192
5e073ec7
PE
20193 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20194 here, since it parses constructs like leading '-' and spaces,
20195 which are not wanted; and it overflows with large numbers.
20196 Instead, simply match F[0-9]+, which is what is wanted anyway.
20197
36372bf9
PE
20198 * alloc.c: Remove unportable assumptions about struct layout.
20199 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20200 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20201 (allocate_vectorlike, make_pure_vector): Use the new macros,
20202 plus offsetof, to remove unportable assumptions about struct layout.
20203 These assumptions hold on all porting targets that I know of, but
20204 they are not guaranteed, they're easy to remove, and removing them
20205 makes further changes easier.
20206
0b432f21
PE
20207 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20208 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
20209 (string_overrun_cookie): Now const. Use initializers that
20210 don't formally overflow signed char, to avoid warnings.
000098c1
PE
20211 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20212 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
20213 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20214 multiple of sizeof (EMACS_INT); it need not be, if
20215 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 20216 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 20217
895009e1
JB
202182011-04-26 Juanma Barranquero <lekktu@gmail.com>
20219
20220 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20221
6a7a1b0b
TZ
202222011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20223
20224 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 20225 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
20226 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20227
841a1577 202282011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
20229
20230 * lisp.h (Qdebug): List symbol.
895009e1 20231 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
20232 * keyboard.c (debug-on-event): New variable.
20233 (handle_user_signal): Break into debugger when debug-on-event
20234 matches the current signal symbol.
20235
f2d3ba6f
DN
202362011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20237
20238 * alloc.c (check_sblock, check_string_bytes)
20239 (check_string_free_list): Convert to standard C.
20240
42ce4c63
TZ
202412011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20242
20243 * w32.c (emacs_gnutls_push): Fix typo.
20244
825cd63c
EZ
202452011-04-25 Eli Zaretskii <eliz@gnu.org>
20246
fb11d64d
EZ
20247 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20248 "cast to pointer from integer of different size".
20249
825cd63c
EZ
20250 Improve doprnt and its use in verror. (Bug#8545)
20251 * doprnt.c (doprnt): Document the set of format control sequences
20252 supported by the function. Use SAFE_ALLOCA instead of always
20253 using `alloca'.
20254
20255 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20256 is one byte too soon. Don't use xrealloc; instead xfree and
20257 xmalloc anew.
20258
e061a11b
TZ
202592011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20260
20261 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20262 callbacks stage.
20263
20264 * gnutls.c: Renamed global_initialized to
20265 gnutls_global_initialized. Added internals for the
20266 :verify-hostname-error, :verify-error, and :verify-flags
20267 parameters of `gnutls-boot' and documented those parameters in the
20268 docstring. Start callback support.
9173deec
JB
20269 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20270 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20271 on error. Return error code.
e061a11b
TZ
20272 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20273 (emacs_gnutls_read): Likewise.
20274 (Fgnutls_boot): Return handshake error code.
20275 (emacs_gnutls_handle_error): New function.
20276 (wsaerror_to_errno): Likewise.
20277
20278 * w32.h (emacs_gnutls_pull): Add prototype.
20279 (emacs_gnutls_push): Likewise.
20280
20281 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20282 (emacs_gnutls_push): Likewise.
20283
202842011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20285
20286 * process.c (wait_reading_process_output): Check if GnuTLS
20287 buffered some data internally if no FDs are set for TLS
20288 connections.
20289
20290 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20291 (LIBS): Link to USER_LIBS.
20292 ($(BLD)/gnutls.$(0)): New target.
20293
fa6996bc
EZ
202942011-04-24 Eli Zaretskii <eliz@gnu.org>
20295
eb35682e
EZ
20296 * xdisp.c (handle_single_display_spec): Rename the
20297 display_replaced_before_p argument into display_replaced_p, to
20298 make it consistent with the commentary. Fix typos in the
20299 commentary.
20300
e2ad650c
EZ
20301 * textprop.c (syms_of_textprop): Remove dead code.
20302 (copy_text_properties): Delete obsolete commentary about an
20303 interface that was deleted long ago. Fix typos in the description
20304 of arguments.
20305
1b2de274
EZ
20306 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20307 to changes in oldXMenu/XMenu.h from 2011-04-16.
20308 <menu_help_message, prev_menu_help_message>: Constify.
20309 (IT_menu_make_room): menu->help_text is now `const char **';
20310 adjust.
20311
20312 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20313 to changes in oldXMenu/XMenu.h from 2011-04-16.
20314 (struct XMenu): Declare `help_text' `const char **'.
20315
20316 * xfaces.c <Qunspecified>: Make extern again.
20317
20318 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 20319 required by POSIX.
1b2de274 20320
762b15be
EZ
20321 * doc.c (get_doc_string): Improve the format passed to `error'.
20322
20323 * doprnt.c (doprnt): Improve commentary.
20324
20325 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20326
20327 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20328 them with etags.
20329
f1052e5d
EZ
20330 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20331 changes in globals.h immediately force recompilation.
762b15be
EZ
20332 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20333 $(CURDIR)/s/ms-w32.h.
20334 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 20335
fa6996bc
EZ
20336 * character.c (Fchar_direction): Function deleted.
20337 (syms_of_character): Don't defsubr it.
20338 <char-direction-table>: Deleted.
20339
e6c3da20
EZ
203402011-04-23 Eli Zaretskii <eliz@gnu.org>
20341
20342 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20343 * doprnt.c: Include limits.h.
20344 (SIZE_MAX): New macro.
04f2d78b
CB
20345 (doprnt): Return a size_t value. 2nd arg is now size_t.
20346 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
20347 Improve overflow protection. Support `l' modifier for integer
20348 conversions. Support %l conversion. Don't assume an EMACS_INT
20349 argument for integer conversions and for %c.
20350
20351 * lisp.h (doprnt): Restore prototype.
20352
20353 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20354 $(SRC)/character.h.
20355
20356 * Makefile.in (base_obj): Add back doprnt.o.
20357
20358 * deps.mk (doprnt.o): Add back prerequisites.
20359 (callint.o): Depend on character.h.
20360
20361 * eval.c (internal_lisp_condition_case): Include the handler
20362 representation in the error message.
20363 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20364 when breaking from the loop.
20365
20366 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20367
20368 * callint.c (Fcall_interactively): When displaying error message
20369 about invalid control letter, pass the character's codepoint, not
20370 a pointer to its multibyte form. Improve display of the character
20371 in octal and display also its hex code.
20372
20373 * character.c (char_string): Use %x to display the (unsigned)
20374 codepoint of an invalid character, to avoid displaying a bogus
20375 negative value.
20376
20377 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20378 `error', not SYMBOL_NAME itself.
20379
20380 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20381 character arguments to `error'.
20382
20383 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20384 to `error' in error message about FINAL_CHAR argument. Make sure
20385 FINAL_CHAR is a character, and use %c when it is passed as
20386 argument to `error'.
20387
4ffd0d6b 203882011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
20389
20390 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20391
20392 * w32.c: Include <time.h>.
20393 (sys_localtime): New function.
20394
4ffd0d6b 203952011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
20396
20397 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20398
4ffd0d6b 20399 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 20400
4ffd0d6b 204012011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 20402
4ffd0d6b
GM
20403 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20404 zombies (Bug#8467).
aac0c6e3 20405
04c56954
EZ
204062011-04-19 Eli Zaretskii <eliz@gnu.org>
20407
20408 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20409 gl_state.e_property when gl_state.object is Qt.
20410
20411 * insdel.c (make_gap_larger): Remove limitation of buffer size
20412 to <= INT_MAX.
20413
16a43933
CY
204142011-04-18 Chong Yidong <cyd@stupidchicken.com>
20415
20416 * xdisp.c (lookup_glyphless_char_display)
20417 (produce_glyphless_glyph): Handle cons cell entry in
20418 glyphless-char-display.
20419 (Vglyphless_char_display): Document it.
20420
20421 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20422 glyphless-char-display.
20423
4581706e
CY
204242011-04-17 Chong Yidong <cyd@stupidchicken.com>
20425
20426 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20427
20428 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20429
20430 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20431 definition for no-X builds.
20432
4887c6e2 204332011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 20434
fd35b6f9
PE
20435 Static checks with GCC 4.6.0 and non-default toolkits.
20436
5c1ccb01
PE
20437 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20438
006c5daa
PE
20439 * process.c (keyboard_bit_set): Define only if SIGIO.
20440 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20441 (send_process): Repair possible setjmp clobbering.
20442
efc736d3
PE
20443 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20444
4e2fe2e6
PE
20445 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20446
f97334a2
PE
20447 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20448
4e75f29d
PE
20449 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20450 Define only if needed.
20451
90efadd1
PE
20452 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20453 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 20454 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 20455
3c647824
PE
20456 * dispextern.h (struct redisplay_interface): Rename param
20457 to avoid shadowing.
e264f262 20458 * termhooks.h (struct terminal): Likewise.
761383f4 20459 * xterm.c (xembed_send_message): Likewise.
3c647824 20460
b58c5c4a
PE
20461 * insdel.c (make_gap_smaller): Define only if
20462 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20463
cad59032
PE
20464 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20465 it.
20466
c339dc2e
PE
20467 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20468 so that we aren't warned about unused symbols.
20469
91a3e27b
PE
20470 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20471
399c71d3 20472 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 20473
8ffc96f5
PE
20474 * xfns.c (x_real_positions): Mark locals as initialized.
20475
eef9bc79
PE
20476 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20477
098db9dd
PE
20478 * xterm.c: Fix problems found by static analysis with other toolkits.
20479 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
20480 (x_dispatch_event): Declare static if USE_GTK, and
20481 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 20482 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 20483 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
20484 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20485 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 20486
eb18f6cc
PE
20487 * xmenu.c (menu_help_callback): Pointer type fixes.
20488 Use const pointers when pointing at readonly data. Avoid pointer
20489 signedness clashes.
20490 (FALSE): Remove unused macro.
20491 (update_frame_menubar): Remove unused decl.
20492
1fe72bf8
PE
20493 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20494
60d9e1db
PE
20495 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20496 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20497 (single_menu_item): Rename local to avoid shadowing.
20498
39261c26
PE
20499 * keyboard.c (make_lispy_event): Remove unused local var.
20500
018c5e19
PE
20501 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20502 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20503
63d2b86e
PE
20504 * bitmaps: Change bitmaps from unsigned char back to the X11
20505 compatible char. Avoid the old compiler warnings about
20506 out-of-range initializers by using, for example, '\xab' rather
20507 than 0xab.
20508
aefd87e1
PE
20509 * xgselect.c (xgselect_initialize): Check vs interface
20510 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20511
bf501fb9
PE
20512 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20513
e9829fdf
PE
20514 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20515 to read-only memory.
20516
1086c095
PE
20517 * fns.c (vector): Remove; this old hack is no longer needed.
20518
2baccd04 20519 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 20520 Remove unused var.
dde42981 20521 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 20522
72391843 20523 * xrdb.c (x_load_resources): Omit unused local.
3565b346 20524
436c16df 20525 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 20526 (x_window): Rename locals to avoid shadowing.
dc5ddd85 20527 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 20528
92bb796d 20529 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 20530 (x_term_init): Remove local to avoid shadowing.
92bb796d 20531
764430a3 20532 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
20533
20534 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20535 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20536
d1dfb56c
EZ
205372011-04-16 Eli Zaretskii <eliz@gnu.org>
20538
c4354cb4
EZ
20539 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20540
d1dfb56c
EZ
20541 Fix regex.c, syntax.c and friends for buffers > 2GB.
20542 * syntax.h (struct gl_state_s): Declare character position members
20543 EMACS_INT.
20544
20545 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20546
04f2d78b
CB
20547 * textprop.c (verify_interval_modification, interval_of):
20548 Declare arguments EMACS_INT.
d1dfb56c
EZ
20549
20550 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20551 EMACS_INT.
20552
20553 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20554
20555 * indent.c (Fvertical_motion): Local variable it_start is now
20556 EMACS_INT.
20557
20558 * regex.c (re_match, re_match_2, re_match_2_internal)
20559 (bcmp_translate, regcomp, regexec, print_double_string)
20560 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20561 (re_compile_pattern, re_exec): Declare arguments and local
20562 variables `size_t' and `ssize_t' and return values `regoff_t', as
20563 appropriate.
20564 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20565 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20566 <compile_stack_type>: `size' and `avail' are now `size_t'.
20567
20568 * regex.h <regoff_t>: Use ssize_t, not int.
20569 (re_search, re_search_2, re_match, re_match_2): Arguments that
20570 specify buffer/string position and length are now ssize_t and
20571 size_t. Return type is regoff_t.
20572
613052cd
BK
205732011-04-16 Ben Key <bkey76@gmail.com>
20574
20575 * nsfont.m: Fixed bugs in ns_get_family and
20576 ns_descriptor_to_entity that were caused by using free to
20577 deallocate memory blocks that were allocated by xmalloc (via
20578 xstrdup). This caused Emacs to crash when compiled with
20579 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20580 --enable-checking=xmallocoverrun). xfree is now used to
20581 deallocate these memory blocks.
20582
4170f62f 205832011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 20584
71b41406
PE
20585 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20586
9587a89d
PE
20587 emacs_write: Accept and return EMACS_INT for sizes.
20588 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20589 et seq.
20590 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20591 Accept and return EMACS_INT.
20592 (emacs_gnutls_write): Return the number of bytes written on
20593 partial writes.
20594 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
20595 (emacs_read, emacs_write): Remove check for negative size, as the
20596 Emacs source code has been audited now.
9587a89d
PE
20597 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20598 (emacs_read, emacs_write): Use it.
273a5f82
PE
20599 * process.c (send_process): Adjust to the new signatures of
20600 emacs_write and emacs_gnutls_write. Do not attempt to store
20601 a byte offset into an 'int'; it might overflow.
9587a89d 20602 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 20603
3e047f51
PE
20604 * sound.c: Don't assume sizes fit in 'int'.
20605 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 20606 Return EMACS_INT, not int.
3e047f51 20607 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
20608 Accept EMACS_INT, not int.
20609 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
20610 record read return values.
20611
cc39a9db
BK
206122011-04-15 Ben Key <bkey76@gmail.com>
20613
c9d0ec6d
JB
20614 * keyboard.c (Qundefined): Don't declare static since it is used
20615 in nsfns.m.
20616 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20617 static since they are used in nsfont.m.
cc39a9db 20618
6c60eb9f
SM
206192011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20620
20621 * process.c (Qprocessp): Don't declare static.
20622 * lisp.h (Qprocessp): Declare again.
20623
7990b61a
JB
206242011-04-15 Juanma Barranquero <lekktu@gmail.com>
20625
20626 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20627
5d4cb038
PE
206282011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20629
8bd7b830 20630 Improve C-level modularity by making more things 'static'.
cd64ea1d 20631
e3b27b31
PE
20632 Don't publish debugger-only interfaces to other modules.
20633 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20634 (verify_bytepos, count_markers): Move decls to the only modules
20635 that need them.
20636 * region-cache.h (pp_cache): Likewise.
20637 * window.h (check_all_windows): Likewise.
20638 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20639
5d4cb038
PE
20640 * sysdep.c (croak): Now static, if
20641 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20642 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
20643
20644 * alloc.c (refill_memory_reserve): Now static if
20645 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20646 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 20647
e87b6180
PE
20648 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20649 Define only if USE_LUCID.
20650
ac64929e
PE
20651 * xrdb.c (x_customization_string, x_rm_string): Now static.
20652
6f37259d
PE
20653 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20654 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20655
1683e3ab
PE
20656 * xdisp.c (draw_row_with_mouse_face): Now static.
20657 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20658
de9c2632
PE
20659 * window.h (check_all_windows): Mark externally visible.
20660
2b96acb7
PE
20661 * window.c (window_deletion_count): Now static.
20662
20663 * undo.c: Make symbols static if they're not exported.
20664 (last_undo_buffer, last_boundary_position, pending_boundary):
20665 Now static.
20666
50436f33
PE
20667 * textprop.c (interval_insert_behind_hooks): Now static.
20668 (interval_insert_in_front_hooks): Likewise.
20669
64520e5c
PE
20670 * term.c: Make symbols static if they're not exported.
20671 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20672 (max_frame_lines, tty_set_terminal_modes):
20673 (tty_reset_terminal_modes, tty_turn_off_highlight):
20674 (get_tty_terminal): Now static.
20675 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20676 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 20677 HAVE_WINDOW_SYSTEM.
64520e5c
PE
20678 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20679 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20680
1fa53021
PE
20681 * sysdep.c: Make symbols static if they're not exported.
20682 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20683 Now static.
20684 (sigprocmask_set, full_mask): Remove; unused.
20685 (wait_debugging): Mark as visible.
20686 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20687 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20688
d4b43b22
PE
20689 * syntax.c (syntax_temp): Define only if !__GNUC__.
20690
b7c513d0
PE
20691 * sound.c (current_sound_device, current_sound): Now static.
20692
989b29ad
PE
20693 * search.c (searchbufs, searchbuf_head): Now static.
20694
13a55a78
PE
20695 * scroll.c (scroll_cost): Remove; unused.
20696 * dispextern.h (scroll_cost): Remove decl.
20697
de68a1fc
PE
20698 * region-cache.h (pp_cache): Mark as externally visible.
20699
40ccffa6
PE
20700 * process.c: Make symbols static if they're not exported.
20701 (process_tick, update_tick, create_process, chan_process):
20702 (Vprocess_alist, proc_buffered_char, datagram_access):
20703 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20704 (deactivate_process): Mark defn as static, as well as decl.
20705 * lisp.h (create_process): Remove decl.
20706 * process.h (chan_process, Vprocess_alist): Remove decls.
20707
ad64fc97
PE
20708 * print.c: Make symbols static if they're not exported.
20709 (print_depth, new_backquote_output, being_printed, print_buffer):
20710 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20711 (print_interval, print_number_index, initial_stderr_stream):
20712 Now static.
20713 * lisp.h (Fprinc): Remove decl.
20714 (debug_output_compilation_hack): Mark as externally visible.
20715
adddb265
PE
20716 * sysdep.c (croak): Move decl from here to syssignal.h.
20717 * syssignal.h (croak): Put it here, so the API can be checked when
20718 'croak' is called from dissociate_if_controlling_tty.
20719
1717ede2
PE
20720 * minibuf.c: Make symbols static if they're not exported.
20721 (minibuf_save_list, choose_minibuf_frame): Now static.
20722 * lisp.h (choose_minibuf_frame): Remove decl.
20723
fa5fb2bc
PE
20724 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20725
1e3890d1
PE
20726 * lread.c: Make symbols static if they're not exported.
20727 (read_objects, initial_obarray, oblookup_last_bucket_number):
20728 Now static.
20729 (make_symbol): Remove; unused.
20730 * lisp.h (initial_obarray, make_symbol): Remove decls.
20731
8a1414fa
PE
20732 * keyboard.c: Make symbols static if they're not exported.
20733 (single_kboard, recent_keys_index, total_keys, recent_keys):
20734 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20735 (this_single_command_key_start, echoing, last_auto_save):
20736 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20737 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20738 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20739 (Vlispy_mouse_stem, double_click_count):
20740 Now static.
20741 (force_auto_save_soon): Define only if SIGDANGER.
20742 (ignore_mouse_drag_p): Now static if
20743 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20744 (print_help): Remove; unused.
20745 (stop_character, last_timer_event): Mark as externally visible.
20746 * keyboard.h (ignore_mouse_drag_p): Declare only if
20747 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20748 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20749 * lisp.h (echoing): Remove decl.
20750 (force_auto_save_soon): Declare only if SIGDANGER.
20751 * xdisp.c (redisplay_window): Simplify code, to make it more
20752 obvious that ignore_mouse_drag_p is not accessed if !defined
20753 USE_GTK && !defined HAVE_NS.
20754
93ea6e8f
PE
20755 * intervals.c: Make symbols static if they're not exported.
20756 (merge_properties_sticky, merge_interval_right, delete_interval):
20757 Now static.
20758 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20759
77382fcc
PE
20760 * insdel.c: Make symbols static if they're not exported.
20761 However, leave prepare_to_modify_buffer alone. It's never
20762 called from outside this function, but that appears to be a bug.
20763 (combine_after_change_list, combine_after_change_buffer):
4889fc82 20764 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
20765 (adjust_after_replace_noundo): Remove; unused.
20766 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 20767 (signal_before_change): Remove decls.
77382fcc 20768
9306c32e
PE
20769 * indent.c (val_compute_motion, val_vmotion): Now static.
20770
cd44d2eb
PE
20771 * image.c: Make symbols static if they're not exported.
20772 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20773 if USE_GTK.
20774 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20775 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20776
ad9a7a06
PE
20777 * fringe.c (standard_bitmaps): Now static.
20778 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20779
81626931
PE
20780 * frame.c: Make symbols static if they're not exported.
20781 (x_report_frame_params, make_terminal_frame): Now static.
20782 (get_frame_param): Now static, unless HAVE_NS.
20783 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20784 (x_get_resource_string): Remove; not used.
20785 * frame.h (make_terminal_frame, x_report_frame_params):
20786 (x_get_resource_string); Remove decls.
20787 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20788 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20789
239f9db9
PE
20790 * font.c, fontset.c: Make symbols static if they're not exported.
20791 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20792 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20793 * font.c (font_close_object): Now static.
20794 * font.h (font_close_object): Remove.
20795 * fontset.c (FONTSET_OBJLIST): Remove.
20796 (free_realized_fontset) #if-0 the body, which does nothing.
20797 (face_suitable_for_char_p): #if-0, as it's never called.
20798 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
20799 * xfaces.c (face_at_string_position):
20800 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
20801 since 0 is always ASCII.
20802
dfcf3579
PE
20803 * fns.c (weak_hash_tables): Now static.
20804
5045092b
PE
20805 * fileio.c: Make symbols static if they're not exported.
20806 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20807 (Vwrite_region_annotation_buffers): Now static.
20808
57a96f5c
PE
20809 * eval.c: Make symbols static if they're not exported.
20810 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20811 * lisp.h (backtrace_list): Remove decl.
20812
35f08c38
PE
20813 * emacs.c: Make symbols static if they're not exported.
20814 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20815 (fatal_error_code, fatal_error_signal_hook, standard_args):
20816 Now static.
20817 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20818 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20819 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20820 * lisp.h (fatal_error_signal_hook): Remove decl.
20821 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20822
f44bd759
PE
20823 * editfns.c: Move a (normally-unused) function to its only use.
20824 * editfns.c, lisp.h (get_operating_system_release): Remove.
20825 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20826 worth the hassle of breaking this out.
20827
b532497d
PE
20828 * xterm.c: Make symbols static if they're not exported.
20829 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20830 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20831 (x_destroy_window, x_delete_display):
20832 Now static.
20833 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20834 (x_mouse_leave): Remove; unused.
20835 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20836 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20837 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20838 Remove decls.
20839 (x_mouse_leave): Declare only if WINDOWSNT.
20840 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20841 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20842 USE_X_TOOLKIT.
20843
1675728f
PE
20844 * ftxfont.c: Make symbols static if they're not exported.
20845 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20846 HAVE_FREETYPE.
20847 * font.h (ftxfont_driver): Likewise.
20848
e4cebfca
PE
20849 * xfns.c: Make symbols static if they're not exported.
20850 (x_last_font_name, x_display_info_for_name):
20851 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20852 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20853 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20854 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20855 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20856 (last_show_tip_args): Now static.
20857 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20858 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20859 (x_screen_planes): Remove; unused.
20860 * dispextern.h (x_screen_planes): Remove decl.
20861
5bf46f05
PE
20862 * dispnew.c: Make symbols static if they're not exported.
20863 * dispextern.h (redraw_garbaged_frames, scrolling):
20864 (increment_row_positions): Remove.
20865 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20866 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20867 Now static.
20868 (redraw_garbaged_frames): Remove; unused.
20869
435f4c28
PE
20870 * xfaces.c: Make symbols static if they're not exported.
20871 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20872 Remove decls.
20873 * xterm.h (defined_color): Remove decls.
20874 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20875 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20876 (menu_face_changed_default, defined_color, free_realized_face):
20877 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20878 (ascii_face_of_lisp_face): Remove; unused.
20879
8524aef3
PE
20880 * xdisp.c: Make symbols static if they're not exported.
20881 * dispextern.h (scratch_glyph_row, window_box_edges):
20882 (glyph_to_pixel_coords, set_cursor_from_row):
20883 (get_next_display_element, set_iterator_to_next):
20884 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20885 (show_mouse_face): Remove decls
20886 * frame.h (message_buf_print): Likewise.
20887 * lisp.h (pop_message, set_message, check_point_in_composition):
20888 Likewise.
20889 * xterm.h (set_vertical_scroll_bar): Likewise.
20890 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20891 (message_buf_print, scratch_glyph_row, displayed_buffer):
20892 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20893 (get_next_display_element, show_mouse_face, window_box_edges):
20894 (frame_to_window_pixel_xy, check_point_in_composition):
20895 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20896 (glyph_to_pixel_coords): Remove; unused.
20897
16390cd2
PE
20898 * dired.c (file_name_completion): Now static.
20899
20900 * dbusbind.c (xd_in_read_queued_messages): Now static.
20901
a25f4dfa
PE
20902 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20903 * data.c (circular_list_error): Remove.
20904
14a9c8df
PE
20905 * commands.h (last_point_position, last_point_position_buffer):
20906 (last_point_position_window): Remove decls.
20907 * keyboard.c: Make these variables static.
20908
04f2d78b
CB
20909 * coding.h (coding, code_convert_region, encode_coding_gap):
20910 Remove decls.
74ab6df5
PE
20911 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20912 (iso_code_class, detect_coding, code_convert_region): Now static.
20913 (encode_coding_gap): Remove; unused.
20914
38dfbee1
PE
20915 * chartab.c (chartab_chars, chartab_bits): Now static.
20916
a2cb4e63
PE
20917 * charset.h (charset_iso_8859_1): Remove decl.
20918 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20919 Now static.
20920
127198fd
PE
20921 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20922 * ccl.c (Vccl_program_table): Now static.
20923 (check_ccl_update): Remove; unused.
20924
d85b608f
PE
20925 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20926 * category.h: ... from here.
20927 * category.c (check_category_table, set_category_set): Now static.
20928
31cd66f3
PE
20929 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20930 * lisp.h: Remove these decls.
20931
c358e587
PE
20932 * buffer.c (buffer_count): Remove unused var.
20933
e78aecca
PE
20934 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20935 so that it's not optimized away.
20936 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20937 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20938 exported only to the debugger.
20939
e192d7d3 20940 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 20941 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 20942
92470028
PE
20943 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20944 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20945 was inaccessible from Lisp.
20946 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20947 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20948
244ed907
PE
20949 alloc.c: Import and export fewer symbols, and remove unused items.
20950 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20951 is defined.
20952 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20953 it's not optimized away by whole-program optimization.
20954 (message_enable_multibyte, free_misc): Remove.
20955 (catchlist, handlerlist, mark_backtrace):
20956 Declare only if BYTE_MARK_STACK.
20957 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20958 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20959 (message_enable_multibyte): Remove decl.
20960 (free_misc, interval_free_list, float_block, float_block_index):
20961 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20962 (cons_free_list, last_marked_index):
20963 Now static.
20964 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20965 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20966 (mark_backtrace): Define only if BYTE_MARK_STACK.
20967 * xdisp.c (message_enable_multibyte): Now static.
20968
61c2b50e 20969 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
20970 This makes it easier for human readers (and static analyzers)
20971 to see whether these variables are used from other modules.
20972 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20973 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20974 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20975 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20976 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20977 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20978 * xmenu.c, xselect.c:
20979 Declare Q* vars static if they are not used in other modules.
20980 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20981 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20982 Remove decls of unexported vars.
20983 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20984
95c82688
PE
20985 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20986
16a97296
PE
20987 Make Emacs functions such as Fatom 'static' by default.
20988 This makes it easier for human readers (and static analyzers)
20989 to see whether these functions can be called from other modules.
20990 DEFUN now defines a static function. To make the function external
20991 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
20992 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20993 (Finit_image_library):
16a97296
PE
20994 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20995 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20996 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20997 Remove decls, since these functions are now static.
20998 (Funintern, Fget_internal_run_time): New decls, since these functions
20999 were already external.
95c82688 21000
16a97296
PE
21001 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21002 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21003 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21004 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21005 * keyboard.c, keymap.c, lread.c:
21006 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21007 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21008 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21009 Mark functions with DEFUE instead of DEFUN,
21010 if they are used in other modules.
21011 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21012 decls for now-static functions.
21013 * buffer.h (Fdelete_overlay): Remove decl.
21014 * callproc.c (Fgetenv_internal): Mark as internal.
21015 * composite.c (Fremove_list_of_text_properties): Remove decl.
21016 (Fcomposition_get_gstring): New forward static decl.
21017 * composite.h (Fcomposite_get_gstring): Remove decl.
21018 * dired.c (Ffile_attributes): New forward static decl.
21019 * doc.c (Fdocumntation_property): New forward static decl.
21020 * eval.c (Ffetch_bytecode): New forward static decl.
21021 (Funintern): Remove extern decl; now in .h file where it belongs.
21022 * fileio.c (Fmake_symbolic_link): New forward static decl.
21023 * image.c (Finit_image_library): New forward static decl.
21024 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21025 * intervals.h (Fprevious_property_change):
21026 (Fremove_list_of_text_properties): Remove decls.
21027 * keyboard.c (Fthis_command_keys): Remove decl.
21028 (Fcommand_execute): New forward static decl.
21029 * keymap.c (Flookup_key): New forward static decl.
21030 (Fcopy_keymap): Now static.
21031 * keymap.h (Flookup_key): Remove decl.
21032 * process.c (Fget_process): New forward static decl.
21033 (Fprocess_datagram_address): Mark as internal.
21034 * syntax.c (Fsyntax_table_p): New forward static decl.
21035 (skip_chars): Remove duplicate decl.
21036 * textprop.c (Fprevious_property_change): New forward static decl.
21037 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21038 Now internal.
21039 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21040 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21041
785bbd42
PE
21042 * editfns.c (Fformat): Remove unreachable code.
21043
8b913b57
AS
210442011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21045
21046 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21047 change. (Bug#8496)
21048
a6744a35
EZ
210492011-04-13 Eli Zaretskii <eliz@gnu.org>
21050
21051 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21052 when at ZV. (Bug#8487)
21053
e7974947
AS
210542011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21055
baad03f0
AS
21056 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21057 (Bug#8437)
21058 * keyboard.c (parse_tool_bar_item): Likewise.
21059 * sound.c (sound_cleanup, alsa_close): Likewise.
21060 * termcap.c (tgetent): Likewise.
21061 * xfns.c (x_default_font_parameter): Likewise.
21062 * xsettings.c (read_and_apply_settings): Likewise.
21063
e7974947
AS
21064 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21065 (overrun_check_free): Protoize.
21066
28272684
PE
210672011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21068
21069 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21070 since callers should never pass a negative size.
21071 Change the signature to match that of plain 'read' and 'write'; see
21072 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21073 * lisp.h: Update prototypes of emacs_write and emacs_read.
21074
11997c76
EZ
210752011-04-11 Eli Zaretskii <eliz@gnu.org>
21076
21077 * xdisp.c (redisplay_window): Don't try to determine the character
21078 position of the scroll margin if the window start point w->startp
e896f03c 21079 is outside the buffer's accessible region. (Bug#8468)
11997c76 21080
8a2cbd72
EZ
210812011-04-10 Eli Zaretskii <eliz@gnu.org>
21082
21083 Fix write-region and its subroutines for buffers > 2GB.
21084 * fileio.c (a_write, e_write): Modify declaration of arguments and
21085 local variables to support buffers larger than 2GB.
21086 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21087
21088 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21089 argument, local variables, and return value.
21090
21091 * lisp.h: Update prototypes of emacs_write and emacs_read.
21092
21093 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21094
4073e537 210952011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 21096
1ebfdcb6
PE
21097 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21098
b2ded58d
PE
21099 Fix more problems found by GCC 4.6.0's static checks.
21100
7d66342c
PE
21101 * xdisp.c (vmessage): Use a better test for character truncation.
21102
bbf47d44
PE
21103 * charset.c (load_charset_map): <, not <=, for optimization,
21104 and to avoid potential problems with integer overflow.
9248994d 21105 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 21106 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 21107 * editfns.c (Fformat): Likewise.
1e69125e 21108 * syntax.c (skip_chars): Likewise.
3befa583 21109
e3019616
PE
21110 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21111 This also lets GCC 4.6.0 generate slightly better loop code.
21112
becfa255
PE
21113 * callint.c (Fcall_interactively): <, not <=, for optimization.
21114 (Fcall_interactively): Count the number of arguments produced,
21115 not the number of arguments given. This is simpler and lets GCC
21116 4.6.0 generate slightly better code.
21117
dae0cd48
PE
21118 * ftfont.c: Distingish more carefully between FcChar8 and char.
21119 The previous code passed unsigned char * to a functions like
21120 strlen and xstrcasecmp that expect char *, which does not
21121 conform to the C standard.
21122 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21123 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21124 char * when the C standard requires it.
21125
76032d70
PE
21126 * keyboard.c (read_char): Remove unused var.
21127
eb3f1cc8
PE
21128 * eval.c: Port to Windows vsnprintf (Bug#8435).
21129 Include <limits.h>.
21130 (SIZE_MAX): Define if the headers do not.
21131 (verror): Do not give up if vsnprintf returns a negative count.
21132 Instead, grow the buffer. This ports to Windows vsnprintf, which
21133 does not conform to C99. Problem reported by Eli Zaretskii.
21134 Also, simplify the allocation scheme, by avoiding the need for
21135 calling realloc, and removing the ALLOCATED variable.
21136
70476b54
PE
21137 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21138
12020a9e
PE
21139 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21140 But keep the doprint source code for now, as we might revamp it
21141 and use it again (Bug#8435).
ea6c7ae6
PE
21142 * lisp.h (doprnt): Remove.
21143 * Makefile.in (base_obj): Remove doprnt.o.
21144 * deps.mk (doprnt.o): Remove.
21145
5fdb398c
PE
21146 error: Print 32- and 64-bit integers portably (Bug#8435).
21147 Without this change, on typical 64-bit hosts error ("...%d...", N)
21148 was used to print both 32- and 64-bit integers N, which relied on
21149 undefined behavior.
61bdb816 21150 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
21151 * lisp.h (error, verror): Mark as printf-like functions.
21152 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21153 Report overflow in size calculations when allocating printf buffer.
21154 Do not truncate output string at its first null byte.
21155 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21156 Truncate the output at a character boundary, since vsnprintf does not
21157 do that.
21158 * charset.c (check_iso_charset_parameter): Convert internal
21159 character to string before calling 'error', since %c now has the
21160 printf meaning.
21161 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21162 overflow when computing char to be passed to 'error'. Do not
21163 pass Lisp_Object to 'error'; pass the integer instead.
21164 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21165 formatted with plain %d.
21166
b189fa66
PE
21167 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21168
bff87ef0
PE
21169 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21170
7e2cac20
PE
21171 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21172
ce4d90b5
PE
21173 * xterm.c (x_catch_errors): Remove duplicate declaration.
21174
266c9547
PE
21175 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21176
79c49ad2
PE
21177 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21178
368f4090
JM
211792011-04-10 Jim Meyering <meyering@redhat.com>
21180
21181 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21182 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21183 return ssize_t not "int", and use size_t as the buffer length.
21184 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21185 * gnutls.h: Update declarations.
21186 * process.c (read_process_output): Use ssize_t, to match.
21187 (send_process): Likewise.
21188
a32d4040
CY
211892011-04-09 Chong Yidong <cyd@stupidchicken.com>
21190
21191 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21192
8546720e 211932011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 21194
04f2d78b
CB
21195 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21196 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 21197
8546720e
GM
21198 * xterm.c (handle_one_xevent):
21199 * xmenu.c (create_and_show_popup_menu):
21200 * xselect.c (x_decline_selection_request)
21201 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 21202
0a2f5c1a 212032011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
21204
21205 Fix some uses of `int' instead of EMACS_INT.
21206 * search.c (string_match_1, fast_string_match)
21207 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21208 (scan_buffer, find_next_newline_no_quit)
21209 (find_before_next_newline, search_command, Freplace_match)
21210 (Fmatch_data): Make some `int' variables be EMACS_INT.
21211
21212 * xdisp.c (display_count_lines): 3rd argument and return value now
21213 EMACS_INT. All callers changed.
21214 (pint2hrstr): Last argument is now EMACS_INT.
21215
21216 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21217 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21218 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21219 (decode_coding_utf_16, decode_coding_emacs_mule)
21220 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21221 (decode_coding_ccl, decode_coding_charset)
21222 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21223 (decode_coding_iso_2022, decode_coding_emacs_mule)
21224 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21225 <char_offset, last_offset>: Declare EMACS_INT.
21226 (encode_coding_utf_8, encode_coding_utf_16)
21227 (encode_coding_emacs_mule, encode_invocation_designation)
21228 (encode_designation_at_bol, encode_coding_iso_2022)
21229 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21230 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21231 Declare EMACS_INT.
21232 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21233 (encode_invocation_designation): Last argument P_NCHARS is now
21234 EMACS_INT.
21235 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21236 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21237
21238 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21239 All users changed.
21240
21241 * ccl.c (Fccl_execute_on_string): Declare some variables
21242 EMACS_INT.
21243
8546720e 212442011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
21245
21246 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21247
4e19a977
CS
212482011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21249
21250 * process.c (Fformat_network_address): Doc fix.
21251
87302331
R
212522011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21253
ee7683eb 21254 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 21255
cbb59342
CY
212562011-04-08 Chong Yidong <cyd@stupidchicken.com>
21257
21258 * keyboard.c (read_char): Call Lisp function help-form-show,
21259 instead of using internal_with_output_to_temp_buffer.
21260 (Qhelp_form_show): New var.
e0d38eeb 21261 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
21262
21263 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21264
21265 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21266
e67a13ab
CY
212672011-04-06 Chong Yidong <cyd@stupidchicken.com>
21268
04f2d78b
CB
21269 * process.c (Flist_processes): Remove to Lisp.
21270 (list_processes_1): Delete.
e67a13ab 21271
973f782d
EZ
212722011-04-06 Eli Zaretskii <eliz@gnu.org>
21273
7c106b1e
EZ
21274 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21275
973f782d
EZ
21276 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21277
41cf7d1a 212782011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 21279
ca23cc88
PE
21280 Fix more problems found by GCC 4.6.0's static checks.
21281
f390e2d5
PE
21282 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21283
42eea0d0
PE
21284 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21285
b69769da 21286 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 21287
f9541e84
PE
21288 * xdisp.c (vmessage): Mark as a printf-like function.
21289
13841b55
PE
21290 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21291
c136c10f
PE
21292 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21293
5e2d4a30
PE
21294 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21295 printf-like functions.
21296 (tiff_load): Add casts to remove these marks before passing them
21297 to system-supplied API.
21298
583f48b9
PE
21299 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21300
b25d760e
PE
21301 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21302 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
21303 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21304 directly, rather than having caller test rule sign. This avoids
21305 some unnecessary tests.
21306 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21307 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21308 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 21309
bc7b6697 21310 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 21311 (xfont_open): Avoid unnecessary tests.
bc7b6697 21312
27ccc379
PE
21313 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21314
dcd5c89a
PE
21315 * composite.h, composite.c (composition_gstring_put_cache):
21316 Use EMACS_INT, not int, for length.
21317
b13a45c6
PE
21318 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21319 breaking out part of COMPOSITION_DECODE_RULE.
21320 (COMPOSITION_DECODE_RULE): Use it.
21321 * composite.c (get_composition_id): Remove unused local vars,
21322 by using the new macro.
21323
1e792e4d
PE
21324 * textprop.c (set_text_properties_1): Change while to do-while,
21325 since the condition is always true at first.
21326
dc6c6455 21327 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
21328 (interval_deletion_adjustment): Return unsigned value.
21329 All uses changed.
dc6c6455 21330
aba7731a
PE
21331 * process.c (list_processes_1, create_pty, read_process_output):
21332 (exec_sentinel): Remove vars that were set but not used.
afd4052b 21333 (create_pty): Remove unnecessary "volatile"s.
bc57d757 21334 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 21335 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 21336 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 21337
fdfc4bf3
PE
21338 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21339
fca8fe46 21340 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 21341 (update_syntax_table): Use unsigned instead of int.
fca8fe46 21342
06a0259a 21343 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 21344 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 21345 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 21346
e7b9e80f
PE
21347 * print.c (print_error_message): Avoid int overflow.
21348
56201685
PE
21349 * font.c (font_list_entities): Redo for clarity,
21350 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21351
78834453 21352 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 21353 (font_score): Avoid potential overflow in diff calculation.
78834453 21354
0bc0b309 21355 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 21356 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 21357
e610eaca
PE
21358 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21359
b895abce
PE
21360 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21361 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21362 can always succeed if overflow has undefined behavior.
21363
1f1d9321 21364 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 21365 (wordify): Omit three unnecessary tests.
1f1d9321 21366
c59478bc
PE
21367 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21368 All callers changed. This avoids the need for an unused var.
21369
79b73827
PE
21370 * casefiddle.c (casify_region): Remove var that is set but not used.
21371
a4db5dfe
PE
21372 * dired.c (file_name_completion): Remove var that is set but not used.
21373
43aae36e
PE
21374 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21375
2a47c44d 21376 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 21377 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 21378
a37c69bf
PE
21379 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21380 Check for integer overflow on size calculations.
21381
328ab8e7
PE
21382 * buffer.c (Fprevious_overlay_change): Remove var that is set
21383 but not used.
21384
e5a2a5cb
PE
21385 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21386 Remove vars that are set but not used.
8d84a6eb 21387 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 21388 (timer_check_2): Mark vars as initialized.
e5a2a5cb 21389
a60e5f68
PE
21390 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21391
f661cb61 21392 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 21393 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 21394
f0397f5a
PE
21395 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21396 that are set but not used.
21397
8664db06 21398 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 21399 if XCreateBitmapFromData fails (Bug#8410).
8664db06 21400
6abdaa4a
PE
21401 * xselect.c (x_get_local_selection, x_handle_property_notify):
21402 Remove vars that are set but not used.
21403
0ce7538d 21404 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 21405 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 21406
9ae848fc
PE
21407 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21408 Remove var that is set but not used.
0b918413
PE
21409 (scroll_bar_windows_size): Now size_t, not int.
21410 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21411 Check for overflow.
9ae848fc 21412
a5a62657
PE
21413 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21414 (map_tty_color) [!defined MSDOS]: Likewise.
21415
5c5cdd39
PE
21416 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21417
66ebf983
PE
21418 * coding.c: Remove vars that are set but not used.
21419 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21420 All callers changed.
21421 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21422 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21423 (decode_coding_charset): Remove vars that are set but not used.
21424
1be4d761
PE
21425 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21426 that is set but not used.
21427
47553fa8
PE
21428 * print.c (print_object): Remove var that is set but not used.
21429
1f7196bf 21430 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
21431 The gnulib version avoids calling malloc in the usual case,
21432 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21433 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21434 * filelock.c (current_lock_owner): Likewise.
21435 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21436 * sysdep.c: Include allocator.h, careadlinkat.h.
21437 (emacs_no_realloc_allocator): New static constant.
21438 (emacs_readlink): New function.
fdb61804
PE
21439 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21440 ../lib/careadlinkat.h.
d1fdcab7 21441
f84c17c7
SM
214422011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21443
21444 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21445 first non-nil return value).
21446
ef3862ad
JD
214472011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21448
21449 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21450 if not defined (Bug#8403).
21451
376a7006
JB
214522011-04-02 Juanma Barranquero <lekktu@gmail.com>
21453
21454 * xdisp.c (display_count_lines): Remove parameter `start',
21455 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21456 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21457 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21458 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21459 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21460 and thereabouts. All callers changed.
21461 (get_per_char_metric): Remove parameter `f', unused since
21462 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21463
6ca3801d
JM
214642011-04-02 Jim Meyering <meyering@redhat.com>
21465
21466 do not dereference NULL upon failed strdup
21467 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21468 (ns_get_family): Likewise.
21469
d8e2b5ba
JB
214702011-04-02 Juanma Barranquero <lekktu@gmail.com>
21471
21472 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21473
8c74fcbd
JD
214742011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21475
21476 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21477 later (Bug#8403).
21478
7200d79c
SM
214792011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21480
03408648 21481 Add lexical binding.
7200d79c 21482
03408648
SM
21483 * window.c (Ftemp_output_buffer_show): New fun.
21484 (Fsave_window_excursion):
21485 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21486
21487 * lread.c (lisp_file_lexically_bound_p): New function.
21488 (Fload): Bind Qlexical_binding.
21489 (readevalloop): Remove `evalfun' arg.
21490 Bind Qinternal_interpreter_environment.
21491 (Feval_buffer): Bind Qlexical_binding.
21492 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21493 Mark as dynamic.
21494 (syms_of_lread): Declare `lexical-binding'.
21495
21496 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21497
21498 * keyboard.c (eval_dyn): New fun.
21499 (menu_item_eval_property): Use it.
ca105506
SM
21500
21501 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 21502
03408648
SM
21503 * fns.c (concat, mapcar1): Accept byte-code-functions.
21504
21505 * eval.c (Fsetq): Handle lexical vars.
21506 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21507 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21508 (FletX, Flet): Obey lexical binding.
21509 (Fcommandp): Handle closures.
21510 (Feval): New `lexical' arg.
21511 (eval_sub): New function extracted from Feval. Use it almost
21512 everywhere where Feval was used. Look up vars in lexical env.
21513 Handle closures.
21514 (Ffunctionp): Move from subr.el.
21515 (Ffuncall): Handle closures.
21516 (apply_lambda): Remove `eval_flags'.
21517 (funcall_lambda): Handle closures and new byte-code-functions.
21518 (Fspecial_variable_p): New function.
21519 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21520 but without exporting it to Lisp.
23aba0ea 21521
23aba0ea 21522 * doc.c (Fdocumentation, store_function_docstring):
03408648 21523 * data.c (Finteractive_form): Handle closures.
23aba0ea 21524
03408648
SM
21525 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21526 interactive spec.
ba83908c 21527
04f2d78b
CB
21528 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21529 New byte-codes.
03408648
SM
21530 (exec_byte_code): New function extracted from Fbyte_code to handle new
21531 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 21532
03408648 21533 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 21534
03408648 21535 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 21536
e2abce01
JB
215372011-03-31 Juanma Barranquero <lekktu@gmail.com>
21538
21539 * xdisp.c (redisplay_internal): Fix prototype.
21540
63696a73 215412011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 21542
63696a73 21543 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
21544 (try_scrolling): Use it when setting scroll_limit.
21545 Limit scrolling to 100 screen lines.
63696a73
EZ
21546 (redisplay_window): Even when falling back on "recentering",
21547 position point in the window according to scroll-conservatively,
21548 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21549
21550 (try_scrolling): When point is above the window, allow searching
21551 as far as scroll_max, or one screenful, to compute vertical
21552 distance from PT to the scroll margin position. This prevents
21553 try_scrolling from unnecessarily failing when
21554 scroll-conservatively is set to a value slightly larger than the
21555 window height. Clean up the case of PT below the margin at bottom
21556 of window: scroll_max can no longer be INT_MAX. When aggressive
21557 scrolling is in use, don't let point enter the opposite scroll
21558 margin as result of the scroll.
21559 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
21560 threshold of 100 lines for never-recentering scrolling.
21561
e4cc2dfc
JB
215622011-03-31 Juanma Barranquero <lekktu@gmail.com>
21563
21564 * dispextern.h (move_it_by_lines):
21565 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21566 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21567 (message_log_check_duplicate): Remove parameters `prev_bol' and
21568 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21569 (redisplay_internal): Remove parameter `preserve_echo_area',
21570 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21571
21572 * indent.c (Fvertical_motion):
21573 * window.c (window_scroll_pixel_based, Frecenter):
21574 Don't pass `need_y_p' to `move_it_by_lines'.
21575
1c470562
SM
215762011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21577
44f230aa
SM
21578 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21579 steal a few bits to be more compact.
21580 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21581 Remove unneeded casts.
21582
1c470562
SM
21583 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21584
888adce9
ZK
215852011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21586
21587 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21588 binding" message (bug#7967).
21589
f838ed7b
PE
215902011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21591
77861b95
PE
21592 Fix more problems found by GCC 4.6.0's static checks.
21593
de6dbc14
PE
21594 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21595 Remove unused local var.
21596
f838ed7b
PE
21597 * editfns.c (Fmessage_box): Remove unused local var.
21598
792c7b2b
PE
21599 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21600 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21601 Omit unused local vars.
c499e557 21602 * window.c (shrink_windows): Omit unused local var.
b01a1c29 21603 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
21604 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21605 Omit unused local var.
21606
ba0165e1
PE
21607 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21608 Don't assume string length fits in int.
32ad8845 21609 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 21610 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 21611
3c59b4c9
PE
21612 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21613 instead of alloca (Bug#8344).
21614
a3eed478 21615 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 21616 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 21617
eb4d412d
PE
21618 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21619
1658b401
PE
21620 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21621 concerns.
21622
21623 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21624
21625 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 21626
9a2c6e05
PE
21627 * keyboard.c (syms_of_keyboard): Use the same style as later
21628 in this function when indexing through an array. This also
21629 works around GCC bug 48267.
21630
03d0a109
PE
21631 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21632
44f730c8
PE
21633 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21634
fe75f926
PE
21635 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21636 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21637
ffa8c828
PE
21638 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21639 This avoids undefined behavior on integer overflow, and is a bit
21640 more convenient anyway since it is compared to a size_t variable.
21641
c5101a77
PE
21642 Variadic C functions now count arguments with size_t, not int.
21643 This avoids an unnecessary limitation on 64-bit machines, which
21644 caused (substring ...) to crash on large vectors (Bug#8344).
21645 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21646 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 21647 All variadic functions and their callers changed accordingly.
c5101a77
PE
21648 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21649 * data.c (arith_driver, float_arith_driver): Likewise.
21650 * editfns.c (general_insert_function): Likewise.
21651 * eval.c (struct backtrace.nargs, interactive_p)
21652 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21653 (funcall_lambda, mark_backtrace): Likewise.
21654 * fns.c (concat): Likewise.
21655 * frame.c (x_set_frame_parameters): Likewise.
21656 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21657 0 if not found, not -1. All callers changed.
21658
dd3f25f7
PE
21659 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21660 (stack_copy_size): Now size_t, not int.
21661 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21662
461c2ab9
JB
216632011-03-28 Juanma Barranquero <lekktu@gmail.com>
21664
21665 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21666 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21667 All callers changed.
21668
21669 * lisp.h (multibyte_char_to_unibyte):
21670 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21671 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21672 * character.h (CHAR_TO_BYTE8):
21673 * cmds.c (internal_self_insert):
21674 * editfns.c (general_insert_function):
21675 * keymap.c (push_key_description):
21676 * search.c (Freplace_match):
21677 * xdisp.c (message_dolog, set_message_1): All callers changed.
21678
f6d62986
SM
216792011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21680
21681 * keyboard.c (safe_run_hook_funcall): New function.
21682 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21683 don't set the hook to nil, but remove the offending function instead.
21684 (Qcommand_hook_internal): Remove, unused.
21685 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21686 Vcommand_hook_internal.
21687
21688 * eval.c (enum run_hooks_condition): Remove.
21689 (funcall_nil, funcall_not): New functions.
21690 (run_hook_with_args): Call each function through a `funcall' argument.
21691 Remove `cond' argument, now redundant.
21692 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21693 (Frun_hook_with_args_until_failure): Adjust accordingly.
21694 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21695
1db5b1ad
JB
216962011-03-28 Juanma Barranquero <lekktu@gmail.com>
21697
21698 * dispextern.h (string_buffer_position): Remove declaration.
21699
21700 * print.c (strout): Remove parameter `multibyte', unused since
21701 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21702
21703 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21704 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21705 All callers changed.
21706
21707 * w32.c (_wsa_errlist): Use braces for struct initializers.
21708
21709 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21710 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21711 All callers changed.
21712 (string_buffer_position): Likewise. Also, make static (it's never
21713 used outside xdisp.c).
21714 (cursor_row_p): Remove parameter `w', unused since
21715 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21716 (decode_mode_spec): Remove parameter `precision', introduced during
21717 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21718 All callers changed.
21719
5ffb62aa
JD
217202011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21721
21722 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21723
461c2ab9 217242011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
21725
21726 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21727 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21728 (ns_update_auto_hide_menu_bar): New functions.
21729 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21730 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21731 ns_constrain_all_frames.
21732 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21733 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21734
5c380ffb
JD
217352011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21736
21737 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21738
9af30bdf
GM
217392011-03-27 Glenn Morris <rgm@gnu.org>
21740
21741 * syssignal.h: Replace RETSIGTYPE with void.
21742 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21743 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21744 Replace SIGTYPE with void everywhere.
21745 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21746 * s/template.h (SIGTYPE): Remove commented out definition.
21747
e2abce01
JB
217482011-03-26 Eli Zaretskii <eliz@gnu.org>
21749
21750 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21751 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21752
f868cd8a
JB
217532011-03-26 Juanma Barranquero <lekktu@gmail.com>
21754
59eb0929
JB
21755 * w32.c (read_unc_volume): Use parameter `henum', instead of
21756 global variable `wget_enum_handle'.
21757
21758 * keymap.c (describe_vector): Remove parameters `indices' and
21759 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21760 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21761
f868cd8a
JB
21762 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21763
21764 * keyboard.c (timer_check): Remove parameter `do_it_now',
21765 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21766 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21767 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21768
21769 * keyboard.c (read_char):
21770 * w32menu.c (w32_menu_display_help):
21771 * xmenu.c (show_help_event, menu_help_callback):
21772 Adjust calls to `show_help_echo'.
21773
21774 * gtkutil.c (xg_maybe_add_timer):
21775 * keyboard.c (readable_events):
21776 * process.c (wait_reading_process_output):
21777 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21778
21779 * insdel.c (adjust_markers_gap_motion):
21780 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21781 (gap_left, gap_right): Don't call it.
21782
2ecf6fdb
CY
217832011-03-25 Chong Yidong <cyd@stupidchicken.com>
21784
21785 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21786 incurred during fontification.
21787
6b1f9ba4
JB
217882011-03-25 Juanma Barranquero <lekktu@gmail.com>
21789
21790 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21791 (DEFVAR_PER_BUFFER): Don't pass it.
21792
21793 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21794 (scrolling_window): Don't pass it.
21795
0f4a96b5
JB
217962011-03-25 Juanma Barranquero <lekktu@gmail.com>
21797
21798 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21799
21800 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21801 and `suffix'.
21802 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21803 of variables specific to SELinux and computation of `encoded_absname'.
21804
21805 * image.c (XPutPixel): Remove unused variable `height'.
21806
21807 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21808
21809 * unexw32.c (get_section_info): Remove unused variable `section'.
21810
21811 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21812 (system_process_attributes): Remove unused variable `sess'.
21813 (sys_read): Remove unused variable `err'.
21814
21815 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21816 (w32_wnd_proc): Remove unused variable `isdead'.
21817 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21818 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21819 (x_create_tip_frame): Remove unused variable `tem'.
21820
21821 * w32inevt.c (w32_console_read_socket):
21822 Remove unused variable `no_events'.
21823
21824 * w32term.c (x_draw_composite_glyph_string_foreground):
21825 Remove unused variable `width'.
21826
1149507c
JB
218272011-03-24 Juanma Barranquero <lekktu@gmail.com>
21828
21829 * w32term.c (x_set_glyph_string_clipping):
21830 Don't pass uninitialized region to CombineRgn.
21831
9c88f339
JB
218322011-03-23 Juanma Barranquero <lekktu@gmail.com>
21833
21834 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21835 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21836 (Fx_close_connection): Remove unused variable `i'.
21837
21838 * w32font.c (w32font_draw): Return number of glyphs.
21839 (w32font_open_internal): Remove unused variable `i'.
21840 (w32font_driver): Add missing initializer.
21841
21842 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21843 (fill_in_menu): Remove unused variable `items_added'.
21844
21845 * w32term.c (last_mouse_press_frame): Remove static global variable.
21846 (w32_clip_to_row): Remove unused variable `f'.
21847 (x_delete_terminal): Remove unused variable `i'.
21848
21849 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21850 (NOTHING): Remove unused static global variable.
21851 (uniscribe_check_otf): Remove unused variable `table'.
21852 (uniscribe_font_driver): Add missing initializers.
21853
dee091a3
JD
218542011-03-23 Julien Danjou <julien@danjou.info>
21855
21856 * term.c (Fsuspend_tty, Fresume_tty):
21857 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21858 * window.c (temp_output_buffer_show):
21859 * insdel.c (signal_before_change):
21860 * frame.c (Fhandle_switch_frame):
21861 * fileio.c (Fdo_auto_save):
21862 * emacs.c (Fkill_emacs):
21863 * editfns.c (save_excursion_restore):
21864 * cmds.c (internal_self_insert):
21865 * callint.c (Fcall_interactively):
21866 * buffer.c (Fkill_all_local_variables):
21867 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21868 Use Frun_hooks.
0f4a96b5 21869 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 21870 unconditionally since it does the check itself.
dee091a3 21871
2c520ab5 218722011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 21873
c9c49752
PE
21874 Fix more problems found by GCC 4.5.2's static checks.
21875
8abc3f12
PE
21876 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21877 the first time through the loop, since we know p0 < p1 then.
21878 This also avoids a gcc -Wstrict-overflow warning.
21879
a2d26660
PE
21880 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21881 leading to a memory leak, possible in functions like
21882 load_charset_map_from_file that can allocate an unbounded number
b12ef411 21883 of objects (Bug#8318).
a2d26660 21884
916c72e9
PE
21885 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21886 that could (at least in theory) be that large.
21887
19ab8a18
PE
21888 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21889 This is less likely to overflow, and avoids undefined behavior if
21890 overflow does occur. All callers changed. Use strtoul to scan
21891 for the unsigned long integer.
b7cbbd6f
PE
21892 (pint2hrstr): Simplify and tune code slightly.
21893 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 21894
f0641eff
PE
21895 * scroll.c (do_scrolling): Work around GCC bug 48228.
21896 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21897
7f650bb9
PE
21898 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21899 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
21900 (validate_x_resource_name): Simplify count usage.
21901 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 21902
37dd57d1
PE
21903 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21904 fail (Bug#8306).
81e56e61 21905
699979fc 21906 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 21907
401bf9b4
PE
21908 * process.c (Fmake_network_process): Use socklen_t, not int,
21909 where POSIX says socklen_t is required in portable programs.
21910 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 21911 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
21912 (Fmake_network_process, server_accept_connection):
21913 (wait_reading_process_output, read_process_output):
21914 Likewise.
21915
b93aacde
PE
21916 * process.c: Rename or move locals to avoid shadowing.
21917 (list_processes_1, Fmake_network_process):
21918 (read_process_output_error_handler, exec_sentinel_error_handler):
21919 Rename or move locals.
4dc343ee 21920 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 21921 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 21922 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 21923 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 21924 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 21925
af8a867c 21926 Make tparam.h and terminfo.c consistent.
44f230aa
SM
21927 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21928 Include tparam.h instead, since it declares them.
af8a867c
PE
21929 * cm.h (PC): Remove extern decl; tparam.h now does this.
21930 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21931 * terminfo.c: Include tparam.h, to check interfaces.
21932 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21933 (tparam): Adjust signature to match interface in tparam.h;
21934 this removes some undefined behavior. Check that outstring and len
21935 are zero, which they always are with Emacs.
21936 * tparam.h (PC, BC, UP): New extern decls.
21937
0248044d 21938 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 21939 (xftfont_open): Rename locals to avoid shadowing.
0248044d 21940
8ff096c1 21941 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
21942 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21943 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 21944 (ftfont_list): Remove unused local.
49eaafba
PE
21945 (get_adstyle_property, ftfont_pattern_entity):
21946 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21947 Rename locals to avoid shadowing.
8ff096c1 21948
e2be39f6
PE
21949 * xfont.c (xfont_list_family): Mark var as initialized.
21950
c9735e30
PE
21951 * xml.c (make_dom): Now static.
21952
8f5201ae
PE
21953 * composite.c (composition_compute_stop_pos): Rename local to
21954 avoid shadowing.
b246f932
PE
21955 (composition_reseat_it): Remove unused locals.
21956 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 21957 (composition_update_it): Mark var as initialized.
11b61122
PE
21958 (find_automatic_composition): Mark vars as initialized,
21959 with a FIXME (Bug#8290).
8f5201ae 21960
760fbc2c
PE
21961 character.h: Rename locals to avoid shadowing.
21962 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21963 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21964 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21965 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21966 to avoid shadowing.
21967
ff08eb85
PE
21968 * textprop.c (property_change_between_p): Remove; unused.
21969
fc7bf025
PE
21970 * intervals.c (interval_start_pos): Now static.
21971
235d7abc
PE
21972 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21973
44f230aa
SM
21974 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21975 Rename locals to avoid shadowing.
3e7d6594 21976
50060332
PE
21977 * sound.c (wav_play, au_play, Fplay_sound_internal):
21978 Fix pointer signedness.
d01f234b 21979 (alsa_choose_format): Remove unused local var.
c83b8872
PE
21980 (wav_play): Initialize a variable to 0, to prevent undefined
21981 behavior (Bug#8278).
50060332 21982
c4fc4e30
PE
21983 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21984
918436ed
PE
21985 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21986
c939f91b
PE
21987 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21988 clobbering (Bug#8298).
b9c7f648
PE
21989 * sysdep.c (sys_subshell): Likewise.
21990 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 21991
6bd8c144
PE
21992 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21993 This should get cleaned up, so that child_setup has the
21994 same signature on all platforms.
21995
7710357c 21996 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 21997 (relocate_fd): Rename locals to avoid shadowing.
7710357c 21998
c59da222
CY
219992011-03-22 Chong Yidong <cyd@stupidchicken.com>
22000
22001 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22002 not to be necessary, and produces flickering.
22003
66b87493
GM
220042011-03-20 Glenn Morris <rgm@gnu.org>
22005
22006 * config.in: Remove file.
22007
45b6f6d5
JB
220082011-03-20 Juanma Barranquero <lekktu@gmail.com>
22009
22010 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22011 are now in src/globals.h.
22012 (syms_of_minibuf): Remove spurious & from previous change.
22013
cd394be1 220142011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
22015
22016 * minibuf.c (completing-read-function): New variable.
22017 (completing-read-default): Rename from completing-read.
22018 (completing-read): Call completing-read-function.
22019
b14e3e21
CY
220202011-03-19 Juanma Barranquero <lekktu@gmail.com>
22021
22022 * xfaces.c (Fx_load_color_file):
22023 Read color file from absolute filename (bug#8250).
22024
f2b726e6
JB
220252011-03-19 Juanma Barranquero <lekktu@gmail.com>
22026
22027 * makefile.w32-in: Update dependencies.
22028
09f6ff02
EZ
220292011-03-17 Eli Zaretskii <eliz@gnu.org>
22030
22031 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22032
29a6015a
PE
220332011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22034
a3a6c54e
PE
22035 Fix more problems found by GCC 4.5.2's static checks.
22036
b766f867
PE
22037 * process.c (make_serial_process_unwind, send_process_trap):
22038 (sigchld_handler): Now static.
22039
be02381c
PE
22040 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22041 That way, the code declares only the vars that it needs.
22042 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22043 * s/cygwin.h (PTY_ITERATION): Likewise.
22044 * s/darwin.h (PTY_ITERATION): Likewise.
22045 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22046
57048744
PE
22047 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22048 * process.c (allocate_pty): Don't declare stb unless it's needed.
22049
7914961c 22050 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
22051 (CONSTANTLIM): Remove; unused.
22052 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22053 Define only if needed.
7914961c 22054
b3967b18
PE
22055 * unexelf.c (unexec): Name an expression,
22056 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
22057 Use a different way to cause a compilation error if anyone uses
22058 n rather than nn, a way that does not involve shadowing.
73366a00 22059 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 22060
29a6015a
PE
22061 * deps.mk (unexalpha.o): Remove; unused.
22062
43cfc33e 22063 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 22064 * unexec.h: New file.
ce701a33
PE
22065 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22066 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22067 Depend on unexec.h.
22068 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22069 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22070 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 22071 Change as necessary to match prototype in unexec.h.
ce701a33 22072
01f44d5a
PE
22073 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22074 shadowing.
4f63c6bb 22075 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 22076
a6670b0b
PE
22077 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22078 Rename locals to avoid shadowing.
22079
cef2010d 22080 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 22081 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 22082
d4d7173a
PE
22083 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22084
f08b802a
PE
22085 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22086 warning when compiling print.c.
22087
3ddb0639
PE
22088 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22089 instead of using an uninitialized var.
5ad03b97 22090 (font_sort_entities): Mark var as initialized.
3ddb0639 22091
170a2692
PE
22092 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22093
e663c700
PE
22094 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22095 pointers to constants.
89bc529a 22096 (font_parse_fcname): Remove unused vars.
7b81e2d0 22097 (font_delete_unmatched): Now static.
ea838e10 22098 (font_get_spec): Remove; unused.
13a547c6
PE
22099 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22100 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22101 Rename or move locals to avoid shadowing.
e663c700 22102
2a80c887 22103 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 22104 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 22105
1384fa33 22106 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 22107 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 22108
8b2c52e9
PE
22109 * alloc.c (mark_backtrace): Move decl from here ...
22110 * lisp.h: ... to here, so that it can be checked.
22111
475545b5 22112 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 22113 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
22114 (lisp_indirect_variable): Name an expression,
22115 to avoid gcc -Wbad-function-cast warning.
1faed8ae 22116 (Fdefvar): Rename locals to avoid shadowing.
475545b5 22117
b1349114 22118 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 22119 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 22120 Use const pointer when appropriate.
b1349114 22121
a2928364
PE
22122 * lisp.h (get_system_name, get_operating_system_release):
22123 Move decls here, to check interfaces.
22124 * process.c (get_operating_system_release): Move decl to lisp.h.
22125 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
22126 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22127 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22128 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
22129 (Fformat_time_string, Fencode_time, Finsert_char):
22130 (Ftranslate_region_internal, Fformat):
22131 Rename or remove local vars to avoid shadowing.
9710023e 22132 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 22133
a415e694
PE
22134 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22135 avoid shadowing.
22136
8ef4622d
PE
22137 * lisp.h (eassert): Check that the argument compiles, even if
22138 ENABLE_CHECKING is not defined.
22139
946f9a5b
PE
22140 * data.c (Findirect_variable): Name an expression, to avoid
22141 gcc -Wbad-function-cast warning.
112396d6 22142 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 22143 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
22144 (Fmake_variable_buffer_local, Fmake_local_variable):
22145 Mark variables as initialized.
52746918 22146 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 22147
e5aab7e7 22148 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
22149 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22150 Rename locals to avoid shadowing.
dff45157
PE
22151 (mark_stack): Move local variables into the #ifdef region where
22152 they're used.
7bc26fdb
PE
22153 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22154 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22155 needed otherwise.
22156 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22157 (GC_STRING_CHARS): Remove; not used.
d40d4be1 22158 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 22159
e5aab7e7
PE
22160 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22161 avoids undefined behavior in theory.
22162
4da60324
PE
22163 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22164
88043301
PE
22165 Use functions, not macros, for up- and down-casing (Bug#8254).
22166 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22167 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22168 to use the following functions instead of these macros.
22169 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22170 EMACS_INT, since callers assume the returned value fits in int.
22171 (upcase1): Likewise, for UPCASE_TABLE.
22172 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 22173 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 22174 the race-condition problem in the old DOWNCASE.
88043301 22175
19ed5445
PE
22176 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22177 Rename locals to avoid shadowing.
22178 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
22179 (regex_compile, re_search_2, re_match_2_internal):
22180 Remove unused local vars.
952db0d7
PE
22181 (FREE_VAR): Rewrite so as not to use empty "else",
22182 which gcc can warn about.
da053e48 22183 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
22184 (RETALLOC_IF): Define only if needed.
22185 (WORDCHAR_P): Likewise. This one is never needed, but is used
22186 only in a comment talking about a compiler bug, so put inside
22187 the #if 0 of that comment.
22188 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22189 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22190 Remove; unused.
19ed5445 22191
1f3561e4 22192 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
22193 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22194 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 22195
ded6f8f7
PE
22196 * search.c (simple_search): Remove unused var.
22197
dbd37a95
PE
22198 * dired.c (compile_pattern): Move decl from here ...
22199 * lisp.h: ... to here, so that it can be checked.
22200 (struct re_registers): New forward decl.
22201
7e47afad
PE
22202 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22203
85f24f61
PE
22204 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22205 All uses changed.
22206 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22207 Rename locals to avoid shadowing.
5671df8f 22208 (Fvertical_motion): Mark locals as initialized.
85f24f61 22209
181aa2be 22210 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 22211 (casify_region): Mark local as initialized.
181aa2be 22212
930d429c
PE
22213 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22214
7082eac6
PE
22215 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22216 New macros, so that the caller can use some names other than
22217 gcpro1, gcpro2, etc.
22218 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22219 of the new macros.
22220 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22221 argument, for consistency with GCPRO2_VAR, etc: it is now the
22222 prefix of the variable, not the variable itself. All uses
22223 changed.
38b2c076
PE
22224 * dired.c (directory_files_internal, file_name_completion):
22225 Rename locals to avoid shadowing.
22226
15206ed9
PE
22227 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22228 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22229 dired.c's scmp function, had undefined behavior.
22230 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22231 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22232 * buffer.h: ... to here, because these macros use current_buffer,
22233 and the new implementation with inline functions needs to have
22234 current_buffer in scope now, rather than later when the macros
22235 are used.
22236 (downcase, upcase1): New static inline functions.
22237 (DOWNCASE, UPCASE1): Reimplement using these functions.
22238 This avoids undefined behavior in expressions like
22239 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22240 from race conditions in accessing the global variables
22241 case_temp1 and case_temp2.
22242 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22243 * lisp.h (case_temp1, case_temp2): Remove their decls.
22244 * character.h (ASCII_CHAR_P): Move from here ...
22245 * lisp.h: ... to here, so that the inline functions mentioned
22246 above can use them.
22247
4a6bea26
PE
22248 * dired.c (directory_files_internal_unwind): Now static.
22249
f14b7e14
PE
22250 * fileio.c (file_name_as_directory, directory_file_name):
22251 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22252 Now static.
2893f146
PE
22253 (file_name_as_directory): Use const pointers when appropriate.
22254 (Fexpand_file_name): Likewise. In particular, newdir might
22255 point at constant storage, so make it a const pointer.
fd4ead52 22256 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
22257 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22258 signedness issues.
f839df0c
PE
22259 (Fset_file_times, Finsert_file_contents, auto_save_error):
22260 Rename locals to avoid shadowing.
f14b7e14 22261
5716756e 22262 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
22263 (Ftry_completion, Fall_completions): Rename or remove locals
22264 to avoid shadowing.
5716756e 22265
b4c3046a
PE
22266 * marker.c (bytepos_to_charpos): Remove; unused.
22267
b45db522
PE
22268 * lisp.h (verify_bytepos, count_markers): New decls,
22269 so that gcc does not warn that these functions aren't declared.
22270
85876d07
PE
22271 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22272 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 22273 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 22274 (copy_text): Remove unused local var.
85876d07 22275
03d78a21 22276 * filelock.c (within_one_second): Now static.
b3dd38ab 22277 (lock_file_1): Rename local to avoid shadowing.
03d78a21 22278
5df8f01b
PE
22279 * buffer.c (fix_overlays_before): Mark locals as initialized.
22280 (fix_start_end_in_overlays): Likewise. This function should be
22281 simplified by using pointers-to-pointers, but that's a different
22282 matter.
b1d876f1 22283 (switch_to_buffer_1): Now static.
8f54f30a
PE
22284 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22285 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 22286
a70072c9 22287 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 22288 Fix pointer signedness issue.
edced198
PE
22289 (sys_subshell): Mark local as volatile if checking for lint,
22290 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 22291 (MAXPATHLEN): Define only if needed.
a70072c9 22292
a0977c44
PE
22293 * process.c (serial_open, serial_configure): Move decls from here ...
22294 * systty.h: ... to here, so that they can be checked.
22295
a884fdcc
PE
22296 * fns.c (get_random, seed_random): Move extern decls from here ...
22297 * lisp.h: ... to here, so that they can be checked.
22298
604efe86 22299 * sysdep.c (reset_io): Now static.
b8950c94 22300 (wait_for_termination_signal): Remove; unused.
604efe86 22301
38fc62d9
PE
22302 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22303 (copy_keymap_item, append_key, push_text_char_description):
22304 Now static.
1004a21a 22305 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 22306 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
22307 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22308 (describe_map_tree):
22309 Rename locals to avoid shadowing.
38fc62d9 22310
2f2650da
PE
22311 * keyboard.c: Declare functions static if they are not used elsewhere.
22312 (echo_char, echo_dash, cmd_error, top_level_2):
22313 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
22314 (read_char, kbd_buffer_get_event, make_lispy_position):
22315 (make_lispy_event, make_lispy_movement, apply_modifiers):
22316 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22317 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22318 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 22319 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 22320 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 22321
a053e86c 22322 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
22323 (mark_kboards): Move decl here ...
22324 * alloc.c (mark_kboards): ... from here.
a053e86c 22325
4752793e
PE
22326 * lisp.h (force_auto_save_soon): New decl.
22327
74f10ca7 22328 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
22329 (DEFINE_DUMMY_FUNCTION): New macro.
22330 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22331 Use it.
c03cd23f
PE
22332 (main): Add casts to avoid warnings
22333 if GCC considers string literals to be constants.
74f10ca7 22334
022e70d4
PE
22335 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22336
59d6fe83
PE
22337 * dbusbind.c: Pointer signedness fixes.
22338 (xd_signature, xd_append_arg, xd_initialize):
22339 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22340 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22341 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22342 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22343
78320123
PE
22344 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22345 if GCC considers string literals to be constants.
49cebcca 22346 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 22347
35ac2a97
SM
223482011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22349
fb103ca9
SM
22350 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22351 (print_preprocess, print_object): New macro to fix last change.
22352
35ac2a97
SM
22353 * print.c (print_preprocess): Don't forget font objects.
22354
62973b41
JB
223552011-03-16 Juanma Barranquero <lekktu@gmail.com>
22356
22357 * emacs.c (USAGE3): Doc fixes.
22358
0e48bb22
AS
223592011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22360
22361 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22362 structure.
22363
7684e57b
JB
223642011-03-14 Juanma Barranquero <lekktu@gmail.com>
22365
22366 * lisp.h (VWindow_system, Qfile_name_history):
22367 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22368 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22369 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22370
22371 * w32select.c: Don't #include "keyboard.h".
c96bbc66 22372 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
22373
22374 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22375 * w32console.c (detect_input_pending, read_input_pending)
22376 (encode_terminal_code):
22377 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22378 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22379 (w32_system_caret_y, Qfile_name_history):
22380 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22381 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22382 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22383 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22384 * w32proc.c (Qlocal, report_file_error):
22385 * w32term.c (Vwindow_system, updating_frame):
22386 * w32uniscribe.c (initialized, uniscribe_font_driver):
22387 Remove unneeded extern declarations.
22388
2aa46d6c
CY
223892011-03-14 Chong Yidong <cyd@stupidchicken.com>
22390
c96bbc66 22391 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 22392
cffc6f3b
CY
223932011-03-13 Chong Yidong <cyd@stupidchicken.com>
22394
22395 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22396 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22397 These macros can no longer be used for assignment.
22398
44f230aa
SM
22399 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22400 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
22401 (record_buffer_markers, fetch_buffer_markers): New functions for
22402 recording and fetching special buffer markers.
22403 (set_buffer_internal_1, set_buffer_temp): Use them.
22404
22405 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22406
22407 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22408
22409 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22410 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22411
22412 * xdisp.c (hscroll_window_tree):
22413 (reconsider_clip_changes): Use PT instead of BUF_PT.
22414
d251f04b
EZ
224152011-03-13 Eli Zaretskii <eliz@gnu.org>
22416
22417 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22418 $(EMACS_ROOT)/lib/intprops.h.
22419
f0c77cd1
PE
224202011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22421
3eca4629
PE
22422 Fix more problems found by GCC 4.5.2's static checks.
22423
7c86ee98
PE
22424 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22425 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
22426 (xg_free_frame_widgets): Make it clear that a local variable is
22427 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
22428 (gdk_window_get_screen): Make it clear that this macro is needed
22429 only if USE_GTK_TOOLTIP.
1e5524e7
PE
22430 (int_gtk_range_get_value): New function, which avoids a diagnostic
22431 from gcc -Wbad-function-cast.
22432 (xg_set_toolkit_scroll_bar_thumb): Use it.
22433 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22434 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
22435 (get_utf8_string, xg_get_file_with_chooser):
22436 Rename locals to avoid shadowing.
22437 (create_dialog): Move locals to avoid shadowing.
7c86ee98 22438
41729b81
PE
22439 * xgselect.c (xg_select): Remove unused var.
22440
f0c77cd1
PE
22441 * image.c (four_corners_best): Mark locals as initialized.
22442 (gif_load): Initialize transparent_p to zero (Bug#8238).
22443 Mark another local as initialized.
ec6cf4c6 22444 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 22445
ce0ad53d 22446 * image.c (clear_image_cache): Now static.
d5d5a617 22447 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 22448 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
22449 (x_edge_detection): Remove unnecessary cast that
22450 gcc -Wbad-function-cast diagnoses.
2037898d 22451 (gif_load): Fix pointer signedness.
6ae141d6
PE
22452 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22453 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 22454
33383987 224552011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 22456
d32df629
PE
22457 Improve quality of tests for time stamp overflow.
22458 For example, without this patch (encode-time 0 0 0 1 1
22459 1152921504606846976) returns the obviously-bogus value (-948597
22460 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22461 reports time overflow. See
22462 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
22463 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22464 * editfns.c: Include limits.h and intprops.h.
22465 (TIME_T_MIN, TIME_T_MAX): New macros.
22466 (time_overflow): Move earlier, to before first use.
22467 (hi_time, lo_time): New functions, for an accurate test for
22468 out-of-range times.
22469 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22470 (Fget_internal_run_time): Don't assume time_t fits in int.
22471 (make_time): Use list2 instead of Fcons twice.
22472 (Fdecode_time): More accurate test for out-of-range times.
22473 (check_tm_member): New function.
22474 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
22475 (lisp_time_argument): Don't rely on undefined left-shift and
22476 right-shift behavior when checking for time stamp overflow.
8be6f318 22477
fe31d94c
PE
22478 * editfns.c (time_overflow): New function, refactoring common code.
22479 (Fformat_time_string, Fdecode_time, Fencode_time):
22480 (Fcurrent_time_string): Use it.
22481
8be6f318
PE
22482 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22483 * dired.c (make_time): Move to ...
22484 * editfns.c (make_time): ... here.
22485 * systime.h: Note the move.
22486
09d9db2c 224872011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 22488
126bc0dc
YM
22489 * fringe.c (update_window_fringes): Remove unused variables.
22490
c47cbdfd
YM
22491 * unexmacosx.c (copy_data_segment): Also copy __got section.
22492 (Bug#8223)
22493
7ac80be9
EZ
224942011-03-12 Eli Zaretskii <eliz@gnu.org>
22495
c96bbc66 22496 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
22497 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22498 Constify `char *' arguments and their references according to
22499 prototypes in tparam.h.
22500
ecb0f94d 22501 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 22502
7ac80be9
EZ
22503 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22504 Adapt all references accordingly.
22505
22506 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22507
ef1fd07e
TT
225082011-03-11 Tom Tromey <tromey@redhat.com>
22509
22510 * buffer.c (syms_of_buffer): Remove obsolete comment.
22511
7ef4b50c
EZ
225122011-03-11 Eli Zaretskii <eliz@gnu.org>
22513
22514 * termhooks.h (encode_terminal_code): Declare prototype.
22515
22516 * msdos.c (encode_terminal_code): Don't declare prototype.
22517
22518 * term.c (encode_terminal_code): Now external again, used by
22519 w32console.c and msdos.c.
22520
44f230aa
SM
22521 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22522 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 22523
4b1ec863 225242011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 22525
1714f52b 22526 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 22527
4b1ec863
PE
22528 * fringe.c (update_window_fringes): Mark locals as initialized
22529 (Bug#8227).
22530 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 22531
524c7aa6
PE
22532 * alloc.c (mark_fringe_data): Move decl from here ...
22533 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22534 to check its interface.
22535 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22536
a5c0af81 22537 * fontset.c (free_realized_fontset): Now static.
7519b8cd 22538 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 22539 (fontset_font): Mark local as initialized.
a9a06e0b 22540 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 22541
b4716021
PE
22542 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22543
811e9bac 22544 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 22545 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
22546 (x_own_selection, Fx_disown_selection_internal): Rename locals
22547 to avoid shadowing.
22548 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 22549
7e3ab302
PE
22550 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22551 so that the caller can use some name other than gcpro1.
22552 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
22553 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22554 (Fx_backspace_delete_keys_p):
22555 Use them to avoid shadowing, and rename vars to avoid shadowing.
22556 (x_decode_color, x_set_name, x_window): Now static.
6b437900 22557 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 22558 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
22559 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22560 Remove unused locals.
7e3ab302
PE
22561 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22562 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22563 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22564 macros.
f78faa98 22565
e2b13473
PE
22566 * xterm.h (x_mouse_leave): New decl.
22567
77f23912
PE
22568 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22569 Remove unused functions.
cdf4ba58
PE
22570 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22571 (x_calc_absolute_position): Now static.
7411c686 22572 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 22573 Don't declare local "event" unless it's used.
ed7bf3a5
PE
22574 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22575 unless they are used.
38d0b34a
PE
22576 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22577 (x_fatal_error_signal): Remove; not used.
a6067996
PE
22578 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22579 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22580 (x_error_catcher, x_connection_closed, x_error_handler):
22581 (x_error_quitter, xembed_send_message, x_iconify_frame):
22582 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 22583 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 22584 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 22585
44f230aa
SM
22586 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22587 Rename or move locals to avoid shadowing.
6b463e58 22588 (tty_defined_color, merge_face_heights): Now static.
5967d051 22589 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
22590 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22591 does not deduce is never used uninitialized.
73719eba
PE
22592 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22593 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 22594
426994c3 22595 * terminal.c (store_terminal_param): Now static.
5489860b 22596
032f1620 22597 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 22598 (set_frame_menubar): Remove unused local.
d4323972 22599 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
22600 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22601 since they might point to immutable storage.
281585b0
PE
22602 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22603 since it's unused otherwise.
032f1620 22604
367c19e5 22605 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 22606 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
22607 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22608 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 22609 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
22610 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22611 does not deduce are never used uninitialized.
70739cbe 22612
07b48fa9
PE
22613 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22614
8868a238 22615 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
22616 * window.c (window_loop, size_window):
22617 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 22618
7e5cf297 22619 * window.c (display_buffer): Now static.
d6550a9f
PE
22620 (size_window): Mark variables that gcc -Wuninitialized
22621 does not deduce are never used uninitialized.
a586633d
PE
22622 * window.h (check_all_windows): New decl, to forestall
22623 gcc -Wmissing-prototypes diagnostic.
5b555da1 22624 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 22625
f6095868
PE
22626 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22627 shadowing.
22628 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
22629 Include <limits.h>.
22630 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22631 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
22632 (load_charset_map): Mark variables that gcc -Wuninitialized
22633 does not deduce are never used uninitialized.
53df7c11 22634 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 22635
f38b440c
PE
22636 * coding.c (coding_set_source, coding_set_destination):
22637 Use "else { /* comment */ }" rather than "else /* comment */;"
22638 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
22639 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22640 a block, when the outer 'i' will do.
22641 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22642 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22643 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22644 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22645 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22646 Rename locals to avoid shadowing.
22647 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
22648 * coding.c (emacs_mule_char, encode_invocation_designation):
22649 Now static, since they're not used elsewhere.
413bb2db 22650 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 22651 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
22652 (decode_coding_emacs_mule): Mark variables that gcc
22653 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
22654 (detect_coding_iso_2022): Initialize a local variable that might
22655 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 22656 this initialization is needed. (Bug#8211)
5f58e762
PE
22657 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22658 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22659 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22660 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22661 Remove unused macros.
f38b440c 22662
232b38b9 22663 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 22664 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 22665 * character.c (string_count_byte8): Likewise.
232b38b9 22666
fb90da1b
PE
22667 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22668 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22669
fb93dbc2
PE
22670 * chartab.c (copy_sub_char_table): Now static, since it's not used
22671 elsewhere.
5c156ace
PE
22672 (sub_char_table_ref_and_range, char_table_ref_and_range):
22673 Rename locals to avoid shadowing.
bbcd0949 22674 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 22675
7d3b3862 22676 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 22677 (BIDI_BOB): Remove unused macro.
7d3b3862 22678
6be7d3da
PE
22679 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22680 deduce are never used uninitialized.
c2ed9c8b 22681 * term.c (encode_terminal_code): Likewise.
6be7d3da 22682
75f8807f 22683 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 22684
50938595
PE
22685 * tparam.h: New file.
22686 * term.c, tparam.h: Include it.
22687 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22688 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22689 Move these decls to tparam.h, and make them agree with what
22690 is actually in tparam.c. The previous trick of using incompatible
22691 decls in different modules does not conform to the C standard.
22692 All callers of tparam changed to use tparam's actual API.
22693 * tparam.c (tparam1, tparam, tgoto):
22694 Use const pointers where appropriate.
22695
fbceeba2
PE
22696 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22697 * cm.h (struct cm): Likewise.
22698 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22699 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22700 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22701 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22702 (turn_on_face, init_tty): Likewise.
22703 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 22704
7f3f1250
PE
22705 * term.c (term_mouse_position): Rename local to avoid shadowing.
22706
e6ca6543
PE
22707 * alloc.c (mark_ttys): Move decl from here ...
22708 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22709
c40f8d15
AS
227102011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22711
22712 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22713
cfe0661d
JB
227142011-03-09 Juanma Barranquero <lekktu@gmail.com>
22715
22716 * search.c (compile_pattern_1): Remove argument regp, unused since
22717 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22718 (compile_pattern): Don't pass it.
22719
0afb4571
J
227202011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22721
22722 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22723 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22724 for ! HAVE_GTK3.
22725 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22726
22727 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22728
22729 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22730 gdk_window_get_screen, gdk_window_get_geometry,
22731 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22732 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22733 (xg_get_pixbuf_from_pixmap): New function.
22734 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22735 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22736 Call xg_get_pixbuf_from_pixmap instead of
22737 gdk_pixbuf_get_from_drawable.
22738 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22739 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22740 (xg_check_special_colors): Use GtkStyleContext and its functions
22741 for HAVE_GTK3.
22742 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22743 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22744 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
22745 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22746 Call gtk_widget_get_preferred_size.
0afb4571
J
22747 (xg_frame_resized): gdk_window_get_geometry only takes 5
22748 parameters.
44f230aa
SM
22749 (xg_win_to_widget, xg_event_is_for_menubar):
22750 Call gdk_x11_window_lookup_for_display.
0afb4571
J
22751 (xg_set_widget_bg): New function.
22752 (delete_cb): New function.
895009e1 22753 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 22754 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
22755 (xg_set_background_color): Call xg_set_widget_bg.
22756 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22757 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22758 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22759 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22760 if ! HAVE_GTK3.
22761 (update_frame_tool_bar): Call gtk_widget_hide.
22762 (xg_initialize): Use GDK_KEY_g.
22763
22764 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22765 if ! HAVE_GTK3
22766 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22767
22768 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22769 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22770 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22771
1c2cc4ef
JB
227722011-03-08 Juanma Barranquero <lekktu@gmail.com>
22773
22774 * w32xfns.c (select_palette): Check success of RealizePalette against
22775 GDI_ERROR, not zero.
22776
33383987 22777See ChangeLog.11 for earlier changes.
aac0c6e3
MR
22778
22779;; Local Variables:
22780;; coding: utf-8
aac0c6e3
MR
22781;; End:
22782
ab422c4d 22783 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
22784
22785 This file is part of GNU Emacs.
22786
22787 GNU Emacs is free software: you can redistribute it and/or modify
22788 it under the terms of the GNU General Public License as published by
22789 the Free Software Foundation, either version 3 of the License, or
22790 (at your option) any later version.
22791
22792 GNU Emacs is distributed in the hope that it will be useful,
22793 but WITHOUT ANY WARRANTY; without even the implied warranty of
22794 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22795 GNU General Public License for more details.
22796
22797 You should have received a copy of the GNU General Public License
22798 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.