Merge from emacs-24; up to 2012-12-25T15:07:59Z!dmantipov@yandex.ru
[bpt/emacs.git] / src / ChangeLog
1 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
2
3 print.c, process.c: Use bool for booleans.
4 * lisp.h (wait_reading_process_output):
5 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
6 (strout, debug_output_compilation_hack, float_to_string, print)
7 (print_object):
8 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
9 (decode_status, status_message, create_process, create_pty)
10 (Fmake_network_process, Fnetwork_interface_info)
11 (wait_reading_process_output, read_process_output)
12 (write_queue_push, write_queue_pop, process_send_signal)
13 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
14 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
15 Use bool for booleans.
16 * process.c (Fnetwork_interface_list): Remove unused local.
17 (connect_counter): Now EMACS_INT, not int.
18
19 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
20
21 * bidi.c (bidi_fetch_char): Swap first and second arguments
22 to match other functions accepting character and byte positions.
23 Adjust comment.
24 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
25 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
26 when you need just to move to the previous buffer position.
27 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
28
29 2013-03-07 Eli Zaretskii <eliz@gnu.org>
30
31 * .gdbinit (prowlims): Display the enabled_p flag of the row.
32
33 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
34
35 Avoid character to byte conversions in motion subroutines.
36 * indent.h (compute_motion, vmotion): Add byte position argument.
37 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
38 Add eassert.
39 (Fcompute_motion): Break long line. Adjust call to compute_motion.
40 Use list5 for return value.
41 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
42 Adjust comments, style and calls to compute_motion.
43 (Fvertical_motion): Adjust call to vmotion.
44 * window.c (Fdelete_other_windows_internal): Record window start
45 byte position and adjust call to vmotion.
46 (window_scroll_line_based): Likewise with call to compute_motion.
47 Use SET_PT_BOTH.
48 (Frecenter): Adjust calls to vmotion.
49
50 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
51
52 * lisp.h (list2i, list3i): New functions.
53 (list4i): Move from window.c and make LISP_INLINE.
54 * editfns.c (make_lisp_time):
55 * fns.c (Flocale_info):
56 * keyboard.c (parse_modifiers):
57 * xterm.c (x_ewmh_activate_frame): Use list2i.
58 * instel.c (signal_after_change):
59 * nsfns.m (Fx_server_version, Fxw_color_values):
60 * w32fns.c (Fxw_color_values, Fx_server_version):
61 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
62 * fileio.c (Fvisited_file_modtime):
63 * nsfns.m (Fns_display_usable_bounds):
64 * w32.c (ltime): Use list4i.
65
66 2013-03-06 Eli Zaretskii <eliz@gnu.org>
67
68 * search.c (find_newline_no_quit): Rename from find_next_newline.
69 Add commentary.
70
71 * lisp.h (find_newline_no_quit): Rename prototype.
72
73 * xdisp.c (back_to_previous_line_start)
74 (forward_to_next_line_start, get_visually_first_element)
75 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
76 * indent.c (vmotion): Callers of find_newline_no_quit changed.
77 * bidi.c (bidi_find_paragraph_start): Callers of
78 find_newline_no_quit changed.
79
80 * msdos.c: Change encoding to cp850. (Bug#13879)
81 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
82
83 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
84
85 Coding system support cleanup and minor refactoring.
86 * coding.h (enum coding_result_code): Remove
87 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
88 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
89 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
90 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
91 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
92 (decode_coding_region, encode_coding_region, decode_coding_string):
93 Remove unused compatibility macros.
94 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
95 (record_conversion_result): Adjust user.
96 (syms_of_coding): Likewise.
97 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
98 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
99 (decode_coding_object): Simplify since xrealloc never returns NULL.
100 Add eassert.
101
102 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
103
104 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
105 * sysdep.c (list_system_processes)
106 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
107 Make it a stub in this case; otherwise the build might fail,
108 and this code hasn't been tested on such hosts anyway.
109 Problem reported by Nelson H. F. Beebe in
110 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
111 and analyzed by Jérémie Courrèges-Anglas in
112 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
113
114 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
115
116 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
117 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
118 (get_visually_first_element, move_it_vertically_backward): Ajust users.
119 * bidi.c (bidi_find_paragraph_start): Likewise.
120 * indent.c (vmotion): Likewise.
121
122 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
123
124 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
125 * filelock.c: Include <c-ctype.h>.
126 (MAX_LFINFO): New top-level constant.
127 (lock_info_type): Remove members pid, boot_time. Add members at,
128 dot, colon. Change user member to be the entire buffer, not a
129 pointer. This allows us to handle the case where a foreign
130 pid or boot time exceeds the local range. All uses changed.
131 (LINKS_MIGHT_NOT_WORK): New constant.
132 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
133 (defined_WINDOWSNT): Remove.
134 (MAKE_LOCK_NAME, file_in_lock_file_name):
135 Always use .#FILE (not .#-FILE) for the file lock,
136 even if it is a regular file.
137 (rename_lock_file): New function.
138 (create_lock_file): Use it.
139 (create_lock_file, read_lock_data):
140 Prefer a symbolic link for the lock file, falling back on a
141 regular file if symlinks don't work. Do not try to create
142 symlinks on MS-Windows, due to security hassles. Stick with
143 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
144 link, rename, unlink, mkstemp) when creating locks, as a GNUish
145 host may be using a Windowsish file system, and cannot use
146 MS-Windows-only system calls. Fall back on mktemp if mkstemp
147 doesn't work. Don't fail merely because of a symlink-contents
148 length limit in the current file system; fall back on regular
149 files. Increase the symlink contents length limit to 8 KiB, this
150 should be big enough for any real use and doesn't crunch the
151 stack.
152 (create_lock_file, lock_file_1, read_lock_data):
153 Simplify allocation of lock file buffers now that they fit in 8 KiB.
154 (lock_file_1): Return error number, not bool. All callers changed.
155 (ELOOP): New macro, if not already defined.
156 (read_lock_data): Return size of lock file contents, not Lisp object.
157 All callers changed. Handle a race condition if some other process
158 replaces a regular-file lock with a symlink lock or vice versa,
159 while we're trying to read the lock.
160 (current_lock_owner): Parse contents more carefully, to help avoid
161 confusing a regular-file lock with some other application's use
162 of the file. Check for lock file contents being too long, or
163 not parsing correctly.
164 (current_lock_owner, lock_file):
165 Allow foreign pid and boot times that exceed the local range.
166 (current_lock_owner, lock_if_free, lock_file):
167 Simplify allocation of lock file contents.
168 * w32.c (sys_rename_replace): New function, containing most of
169 the contents of the old sys_rename.
170 (sys_rename): Use it.
171 (fchmod): New dummy function.
172 * w32.h (sys_rename_replace, fchmod): New decls.
173
174 2013-03-05 Eli Zaretskii <eliz@gnu.org>
175
176 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
177 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
178 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
179 <dmantipov@yandex.ru>.
180
181 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
182
183 * composite.c (get_composition_id, fill_gstring_header):
184 Use make_uninit_vector where appropriate.
185 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
186 * xselect.c (clean_local_selection_data): Likewise.
187
188 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
189
190 Fix misuse of ImageMagick that caused core dump (Bug#13846).
191 * image.c (imagemagick_load_image): Calculate height and width
192 after flattening the image, not before.
193
194 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
195
196 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
197 * ftfont.c (ftfont_shape_by_flt): Likewise.
198 * w32uniscribe.c (uniscribe_shape): Likewise.
199
200 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
201
202 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
203 The old approach, which fell back on DIR/.#FILE.0 through
204 DIR/.#FILE.9, had race conditions that could not be easily fixed.
205 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
206 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
207 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
208 because the locking mechanism was never reliable in that case).
209 This patch fixes this and other bugs discovered by a code
210 inspection that was prompted by
211 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
212 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
213 to avoid interoperability problems between the MS-Windows and
214 non-MS-Windows implementations. MS-Windows and non-MS-Windows
215 instances of Emacs now ignore each others' locks.
216 * filelock.c (defined_WINDOWSNT): New constant.
217 (MAKE_LOCK_NAME, fill_in_lock_file_name):
218 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
219 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
220 regular files on MS-Windows hosts.
221 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
222 Use SAFE_ALLOCA to avoid problems with long file names.
223 (MAX_LFINFO): Now a local constant, not a global macro.
224 (IS_LOCK_FILE): Remove.
225 (lock_file_1): Don't inspect errno if symlink call succeeds;
226 that's not portable.
227 (lock_file): Document that this function can return if lock
228 creation fails.
229 (lock_file): Don't access freed storage.
230
231 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
232
233 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
234
235 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
236
237 * textprop.c: Use bool for booleans.
238 (validate_interval_range, Fadd_text_properties)
239 (Fremove_text_properties): Prefer bool to int when either works.
240
241 2013-03-02 Eli Zaretskii <eliz@gnu.org>
242
243 * textprop.c (Fadd_text_properties, Fremove_text_properties): If
244 the interval tree changes as a side effect of calling
245 modify_region, re-do processing starting from the call to
246 validate_interval_range. (Bug#13743)
247
248 2013-02-28 Eli Zaretskii <eliz@gnu.org>
249
250 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
251 (Bug#13546).
252
253 2013-02-27 Eli Zaretskii <eliz@gnu.org>
254
255 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
256 _SH_DENYRW flag, instead of emacs_open, to deny any other process
257 access to the lock file until it is written and closed.
258 (Bug#13807)
259
260 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
261
262 * callint.c (Qcall_interactively):
263 * macros.c (Qexecute_kbd_macro):
264 Now static.
265
266 2013-02-26 Bastien Guerry <bzg@gnu.org>
267
268 * window.c (Frecenter): Tiny docstring enhancement.
269
270 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
271
272 Minor textprop integer cleanup.
273 * intervals.h, textprop.c (add_text_properties_from_list):
274 Return void, not int, since nobody uses the return value.
275 * textprop.c (validate_plist, add_properties, remove_properties)
276 (Fadd_text_properties):
277 Don't assume list length fits in int.
278 (interval_has_all_properties, interval_has_some_properties)
279 (interval_has_some_properties_list, add_properties, remove_properties)
280 (Fadd_text_properties, Fremove_text_properties)
281 (Fremove_list_of_text_properties, text_property_stickiness):
282 Use bool for booleans.
283 (Fadd_text_properties, Fremove_text_properties):
284 (Fremove_list_of_text_properties):
285 Reindent do-while as per GNU style.
286
287 2013-02-25 Eli Zaretskii <eliz@gnu.org>
288
289 Implement CLASH_DETECTION for MS-Windows.
290
291 * filelock.c [WINDOWSNT]: Include w32.h.
292 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
293 function of that name. Up-case the macro arguments.
294 (IS_LOCK_FILE): New macro.
295 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
296 (create_lock_file): New function, with body extracted from
297 lock_file_1.
298 [WINDOWSNT]: Implement lock files by writing a regular file with
299 the lock information as its contents.
300 (read_lock_data): New function, on Posix platforms just calls
301 emacs_readlinkat.
302 [WINDOWSNT]: Read the lock info from the file.
303 (current_lock_owner): Call read_lock_data instead of calling
304 emacs_readlinkat directly.
305 (lock_file) [WINDOWSNT]: Run the file name through
306 dostounix_filename.
307
308 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
309 just check if the process by that PID exists.
310
311 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
312 also present, as doing so will fail to error out if the file
313 already exists.
314
315 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
316
317 * textprop.c (Fadd_text_properties, Fremove_text_properties)
318 (Fremove_list_of_text_properties): Skip all of the intervals in
319 the region between START and END that already have resp. don't
320 have the requested properties, not just the first one. Add
321 assertions that the loop afterwards always modifies the
322 properties. (Bug#13743)
323
324 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
325
326 * callint.c (Fcall_interactively): Use the right lexical environment
327 for `interactive' specs (bug#13811).
328 * eval.c (Feval): Accept a lexical environment.
329
330 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
331
332 Simplify data_start configuration (Bug#13783).
333 This is a followon simplification to the fix for Bug#13650.
334 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
335 (START_FILES): Remove. All uses removed.
336 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
337 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
338 (buildobj.h): Use it.
339 ($(ALLOBJS)): Depend on globals.h.
340 (temacs$(EXEEXT)): Use $(ALLOBJS).
341 * autodeps.mk (ALLOBJS): Move to Makefile.in.
342 * deps.mk (vm-limit.o):
343 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
344 Do not depend on mem-limits.h.
345 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
346 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
347 [__GNUC__ && !ORDINARY_LINK]: Remove.
348 * mem-limits.h, pre-crt0.c: Remove.
349 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
350 * unexcoff.c (etext): New decl.
351 (make_hdr): Use DATA_START instead of start_of_data.
352 * vm-limit.c: Move most of mem-limits.h's contents here.
353 (data_start): New decl. It's OK if this is approximate,
354 so simplify-away some unnecessary exactness.
355 (POINTER): Remove; all uses removed.
356 (data_space_start): Now char *, to avoid casts.
357 (exceeds_lisp_ptr): New function, replacing the old
358 EXCEEDS_LISP_PTR macro. All uses changed.
359 (check_memory_limits): Simplify and remove casts.
360 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
361 (memory_warnings): Use data_start instead of start_of_data.
362
363 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
364
365 * xdisp.c (set_message): Only check for debug-on-message if STRING
366 is a string. (Bug#13797)
367
368 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
369
370 Fix regression introduced by July 10 filelock.c patch.
371 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
372 2012-07-10 patch to this file. Reported by Eli Zaretskii in
373 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
374 and diagnosed by Andreas Schwab in
375 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
376
377 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
378
379 Assume C89 or better.
380 * ralloc.c (SIZE, POINTER, NIL):
381 * vm-limit.c (POINTER):
382 Remove, replacing all uses with C89 equivalents. These old
383 symbols were present only for porting to pre-C89 platforms.
384
385 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
386
387 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
388 This avoids warning messages reported as part of Bug#13546.
389
390 2013-02-21 Ken Brown <kbrown@cornell.edu>
391
392 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
393
394 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
395
396 * sheap.c (report_sheap_usage): Prefer message1_nolog.
397
398 * keyboard.c (Qcommand_execute): New var.
399 (command_loop_1, read_char): Use it.
400 (Fcommand_execute): Remove, replace by an Elisp implementation.
401 (syms_of_keyboard): Adjust accordingly.
402
403 2013-02-19 Daniel Colascione <dancol@dancol.org>
404
405 * sheap.c (report_sheap_usage): Use message, not message1, so
406 that we don't try to create a buffer while we're in the middle
407 of dumping Emacs. Explain why.
408
409 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
410
411 * search.c (find_newline): Return byte position in bytepos.
412 Adjust comment.
413 (find_next_newline_no_quit, find_before_next_newline):
414 Add bytepos argument.
415 * lisp.h (find_newline, find_next_newline_no_quit)
416 (find_before_next_newline): Adjust prototypes.
417 * bidi.c (bidi_find_paragraph_start):
418 * editfns.c (Fconstrain_to_field, Fline_end_position):
419 * indent.c (compute_motion, vmotion):
420 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
421 (get_visually_first_element, move_it_vertically_backward):
422 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
423
424 2013-02-19 Eli Zaretskii <eliz@gnu.org>
425
426 * w32proc.c (new_child): Avoid leaking handles if the subprocess
427 resources were not orderly released.
428
429 2013-02-17 Eli Zaretskii <eliz@gnu.org>
430
431 * xdisp.c (x_draw_vertical_border): For a window that is neither
432 the leftmost nor the rightmost, redraw both the left and the right
433 vertical borders. (Bug#13723)
434
435 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
436
437 * xml.c (init_libxml2_functions):
438 * sound.c (sound_warning):
439 * sheap.c (report_sheap_usage):
440 * process.c (wait_reading_process_output):
441 * msdos.c (XMenuActivate):
442 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
443 * keyboard.c (top_level_1):
444 * editfns.c (Fmessage, Fmessage_box):
445 * callint.c (Fcall_interactively):
446 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
447
448 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
449
450 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
451 * frame.c (syms_of_frame): ... to here.
452
453 2013-02-16 Eli Zaretskii <eliz@gnu.org>
454
455 * w32.c (sys_chown): Remove unused function.
456
457 * w32term.c <input_signal_count>: Declare 'volatile'
458 unconditionally. (Bug#9066)
459
460 * w32.c (set_errno): Reset h_errno and don't set it to any other
461 value. Set errno instead.
462 (check_errno): Reset h_errno.
463 (sys_socket, socket_to_fd, sys_bind, sys_connect)
464 (sys_gethostname, sys_getservbyname, sys_getpeername)
465 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
466 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
467 h_errno.
468 (sys_gethostbyname): Set h_errno only errors detected.
469
470 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
471
472 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
473
474 2013-02-15 Eli Zaretskii <eliz@gnu.org>
475
476 * keyboard.c (read_char): Fix calculation of auto-save time out
477 when auto-save-timeout is less than 4. (Bug#13720)
478
479 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
480 time. Improve diagnostics in DebPrint. (Bug#13546)
481
482 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
483 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
484 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
485 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
486 make sure errno is set to an appropriate value. (Bug#13546)
487 (socket_to_fd): Add assertion against indexing fd_info[] with a
488 value that is out of bounds.
489 (sys_accept): If fd is negative, do not set up the child_process
490 structure for reading.
491
492 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
493
494 * composite.c (fill_gstring_header): Remove useless prototype.
495 Break long line.
496 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
497 * print.c (PRINTDECLARE, print_object):
498 * search.c (compile_pattern, fast_looking_at, search_buffer):
499 (simple_search, boyer_moore, Freplace_match):
500 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
501 (get_overlay_arrow_glyph_row, display_mode_element):
502 (decode_mode_spec_coding, message3):
503 * xfaces.c (face_at_string_position): Use bool for booleans.
504 Adjust comments.
505
506 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
507
508 Fix AIX port (Bug#13650).
509 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
510 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
511 was #undeffed earlier, so it cannot be used as a macro here.
512 Use the constant and not the macro.
513
514 2013-02-15 Eli Zaretskii <eliz@gnu.org>
515
516 * w32proc.c (new_child): If no vacant slots are found in
517 child_procs[], make another pass looking for slots whose process
518 has exited or died. (Bug#13546)
519
520 * w32.c (sys_pipe): When failing due to file descriptors above
521 MAXDESC, set errno to EMFILE.
522 (_sys_read_ahead): Update cp->status when failing to read serial
523 communications input, so that the status doesn't stay at
524 STATUS_READ_IN_PROGRESS. (Bug#13546)
525
526 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
527
528 * gtkutil.c (tb_size_cb): New function.
529 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
530
531 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
532
533 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
534 an event.
535
536 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
537
538 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
539
540 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
541
542 * font.c (font_range): Add pos_byte argument. Adjust comment
543 and break long line.
544 * font.h (font_range): Adjust prototype.
545 * composite.c (autocmp_chars): Pass byte position to font_range.
546 Break long line. Remove useless prototype and format comment.
547
548 2013-02-13 Glenn Morris <rgm@gnu.org>
549
550 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
551
552 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
553
554 Improve AIX port some more (Bug#13650).
555 With this, it should be as good as it was in 23.3, though it's
556 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
557 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
558 * unexaix.c (start_of_text): Remove.
559 (_data, _text): Declare as char[], not int, as AIX manual suggests.
560 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
561 (orig_load_scnptr, orig_data_scnptr):
562 Now off_t, not long, since they are file offsets.
563 (make_hdr): Use _data, not start_of_data ().
564 This is the key part of the fix.
565 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
566 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
567
568 * pre-crt0.c (data_start): Initialize to 1.
569 This ports to compilers that optimize the external declaration
570 'int x = 0;' as if it were 'int x;' to shrink the executable.
571
572 Improve AIX port (Bug#13650).
573 This doesn't fix the bug, but it makes progress: Emacs builds now.
574 * unexaix.c: Include inttypes.h, stdarg.h.
575 (report_error, report_error_1): Mark as _Noreturn.
576 (report_error): Don't report the wrong errno.
577 (report_error_1): Now varargs. All callers changed.
578 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
579 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
580 (write_ptr): Use %p to print address rather than %lx and a cast
581 to unsigned long. Grow buffer a bit, to be safer.
582
583 2013-02-13 Eli Zaretskii <eliz@gnu.org>
584
585 * bidi.c (bidi_resolve_neutral): After finding the next
586 non-neutral character, accept NEUTRAL_ON type as well, because
587 directional control characters, such as LRE and RLE, have their
588 type converted to that by bidi_resolve_weak. This avoids aborts
589 when LRE/RLE follows a run of neutrals.
590 (bidi_move_to_visually_next): Assert that return value of
591 bidi_peek_at_next_level is non-negative. Negative values will
592 cause an infloop.
593
594 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
595
596 Minor getenv-related fixes.
597 * callproc.c (Fcall_process_region) [!DOS_NT]:
598 Avoid unnecessary duplicate call to getenv.
599 * callproc.c (init_callproc):
600 * dispnew.c (init_display):
601 * sysdep.c (sys_subshell):
602 Omit unnecessary cast of getenv or egetenv.
603
604 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
605
606 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
607 Update dependencies.
608
609 2013-02-12 Eli Zaretskii <eliz@gnu.org>
610
611 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
612 marker's position.
613 (display_line): Set w->region_showing to the value of
614 it->region_beg_charpos, not to -1. This fixes redisplay
615 optimization when cursor is moved up after M->. (Bug#13623)
616 (Bug#13626)
617 (try_scrolling): Scroll text up more if point is too close to ZV
618 and inside the scroll margin. This makes sure point is moved
619 outside the scroll margin in these cases.
620
621 * window.h (struct window): region_showing can no longer be
622 negative.
623
624 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
625
626 Tune by using memchr and memrchr.
627 * doc.c (Fsnarf_documentation):
628 * fileio.c (Fsubstitute_in_file_name):
629 * search.c (find_newline, scan_newline):
630 * xdisp.c (pos_visible_p, display_count_lines):
631 Use memchr and memrchr rather than scanning byte-by-byte.
632 * search.c (find_newline): Rename from scan_buffer.
633 Omit first arg TARGET, as it's always '\n'. All callers changed.
634
635 Clean up read_key_sequence a tiny bit more.
636 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
637 (read_key_sequence): Remove unused locals.
638
639 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
640
641 Clean up read_key_sequence a bit; reread active keymaps after first event.
642 * keyboard.c (read_char, read_char_x_menu_prompt)
643 (read_char_minibuf_menu_prompt):
644 Replace nmaps+maps with a single `map' arg.
645 (follow_key): Operate on a single map.
646 (active_maps): New function.
647 (test_undefined): Also return true for nil bindings.
648 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
649 a single (composed) keymap. Remember `first_event' to choose the right
650 set of active keymaps. Recompute the set of keymaps after receiving
651 the first event. Remove GOBBLE_FIRST_EVENT.
652 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
653 * keyboard.h (read_char): Update declaration.
654 * lread.c (read_filtered_event): Adjust call to read_char.
655
656 2013-02-11 Eli Zaretskii <eliz@gnu.org>
657
658 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
659 Don't use the limitation on backwards movement when lines are truncated
660 in the window. (Bug#13675)
661
662 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
663
664 * marker.c (set_marker_internal): If desired position is passed
665 as a marker, avoid call to buf_charpos_to_bytepos.
666 * window.c (Fset_window_point): Omit redundant type checking.
667 (Fset_window_start): Likewise. Format comment.
668 (window_scroll_pixel_based): Use set_marker_restricted_both
669 with character and byte positions obtained from an iterator.
670 (Fset_window_configuration): Use set_marker_restricted_both.
671 * xdisp.c (message_dolog): Likewise.
672
673 2013-02-10 Eli Zaretskii <eliz@gnu.org>
674
675 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
676 When text lines are longer than window's screen lines, don't move back
677 too far. This speeds up some redisplay operations. (Bug#13675)
678
679 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
680
681 * syntax.c (scan_sexps_forward): Fix byte position calculation
682 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
683
684 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
685
686 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
687 that was not needed.
688
689 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
690
691 Minor hashing refactoring.
692 * fns.c (SXHASH_REDUCE): Move to lisp.h.
693 (sxhash_float): Return EMACS_UINT, for consistency with the other
694 hash functions.
695 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
696 non-static inline function and therefore can't use static vars.
697 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
698 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
699 with the other hash functions.
700
701 2013-02-09 Eli Zaretskii <eliz@gnu.org>
702
703 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
704 XXXXXX part of the temporary file pattern is not downcased even
705 when w32-downcase-file-names is non-nil. (Bug#13661)
706
707 * xdisp.c (decode_mode_spec): Remove handling of %t.
708
709 * msdos.c (careadlinkatcwd): Remove.
710
711 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
712
713 * lread.c (skip_dyn_bytes): New function (bug#12598).
714 (read1): Use it. Use getc instead of READCHAR to read bytes.
715 (load_each_byte): Remove. Update users.
716
717 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
718
719 * search.c (scan_buffer): Calculate end byte position just once.
720 (scan_newline): Do not recalculate start_byte.
721 (search_command): Use eassert.
722 * syntax.c (struct lisp_parse_state): New member location_byte.
723 (scan_sexps_forward): Record from_byte and avoid redundant
724 character to byte position calculation ...
725 (Fparse_partial_sexp): ... here. Break too long line.
726
727 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
728
729 * lisp.h (make_uninit_vector): New function.
730 * alloc.c (Fvector, Fmake_byte_code):
731 * ccl.c (Fregister_ccl_program):
732 * charset.c (Fdefine_charset_internal, define_charset_internal):
733 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
734 * composite.c (syms_of_composite):
735 * font.c (Fquery_font, Ffont_info, syms_of_font):
736 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
737 * ftfont.c (ftfont_shape_by_flt):
738 * indent.c (recompute_width_table):
739 * nsselect.m (clean_local_selection_data):
740 * syntax.c (init_syntax_once):
741 * w32unsubscribe.c (uniscribe_shape):
742 * window.c (Fcurrent_window_configuration):
743 * xfaces.c (Fx_family_fonts):
744 * xselect.c (selection_data_to_lisp_data): Use it.
745
746 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
747
748 * coding.c (Fdefine_coding_system_internal): Use AREF where
749 argument is known to be a vector.
750 * fns.c (Flocale_info): Likewise for ASET.
751 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
752 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
753
754 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
755
756 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
757 height.
758
759 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
760 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
761 updateCollectionBehaviour.
762
763 * nsterm.m (NEW_STYLE_FS): Remove.
764 (ns_last_use_native_fullscreen): New variable.
765 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
766 (x_set_window_size): Do not take title bar and tool bar into account
767 if isFullscreen returns YES.
768 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
769 (check_native_fs): New function.
770 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
771 (ns_term_init): Remove NEW_STYLE_FS.
772 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
773 and tool bar if isFullscreen returns NO.
774 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
775 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
776 with HAVE_NATIVE_FS.
777 (window:willUseFullScreenPresentationOptions:): New method.
778 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
779 Hide toolbar if not enabled (Bug#13444).
780 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
781 Restore tool bar if enabled, hide it otherwise (Bug#13444).
782 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
783 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
784 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
785 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
786 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
787 (syms_of_nsterm): Add ns-use-native-fullscreen.
788
789 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
790
791 * fileio.c (Qchoose_write_coding_system): Now static.
792
793 2013-02-04 Eli Zaretskii <eliz@gnu.org>
794
795 * xdisp.c (window_buffer_changed): region_showing can be negative,
796 which still means region is being displayed.
797 (redisplay_internal): Resurrect code that forced redisplay of the
798 whole window when showing region and the mark has changed.
799 Record the new mark position to allow redisplay optimizations.
800 (display_line): If it->region_beg_charpos is non-zero, set the
801 window's region_showing member to -1. (Bug#13623) (Bug#13626)
802
803 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
804 not bitfield of 1 bit.
805
806 2013-02-03 Daniel Colascione <dancol@dancol.org>
807
808 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
809 daemon mode works on cygw32 when Emacs is installed and not just
810 during development.
811
812 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
813
814 Avoid file time stamp bug on MS-Windows (Bug#13149).
815 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
816 as FAT32 doesn't update time stamps when truncating them.
817 Also, check that a file time stamp is not a multiple of 100 ns;
818 this should catch all instances of the problem on MS-Windows,
819 as its native file system resolution is 100 ns or worse, and
820 checking for a non-multiple of 100 ns should impose only a small
821 overhead on systems with ns resolution.
822
823 2013-02-02 Eli Zaretskii <eliz@gnu.org>
824
825 Avoid encoding file names on MS-Windows when they need to be run
826 through dostounix_filename.
827 * w32.c (normalize_filename): Accept an additional argument
828 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
829 downcase it even if w32-downcase-file-names is non-nil.
830 (dostounix_filename): Accept an additional argument MULTIBYTE and
831 pass it to normalize_filename.
832 (emacs_root_dir): Adjust.
833
834 * msdos.h (dostounix_filename): Adjust prototype.
835
836 * w32.h (dostounix_filename): Adjust prototype.
837
838 * msdos.c (dostounix_filename): Accept an additional argument and
839 ignore it.
840 (init_environment): Adjust callers of dostounix_filename.
841
842 * fileio.c (Ffile_name_directory, file_name_as_directory)
843 (directory_file_name, Fexpand_file_name)
844 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
845 dostounix_filename.
846 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
847 non-nil.
848 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
849 variables, as egetenv is case-insensitive for DOS_NT.
850
851 * dired.c (file_name_completion): Don't call Fdirectory_file_name
852 with an encoded file name.
853
854 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
855 Adjust calls to dostounix_filename.
856
857 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
858
859 * unexw32.c (unexec): Adjust call to dostounix_filename.
860
861 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
862
863 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
864 dostounix_filename.
865
866 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
867 dostounix_filename.
868
869 * callproc.c (Fcall_process): Make sure program name in PATH and
870 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
871 is passed to exec/spawnve, which fails unless the file-name
872 encoding is UTF-8.
873
874 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
875 even if w32-quote-process-args is nil.
876
877 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
878
879 Fix timestamp bug when write-region appends nothing (Bug#13149).
880 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
881 the file's time stamp doesn't change if Emacs happens to write nothing
882 to the file, and on a buggy file system this could cause Emacs to
883 incorrectly infer that the file system doesn't have the bug.
884 Avoid this problem by inhibiting the inference in this case.
885
886 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
887
888 * window.h (struct window): Convert base_line_number, base_line_pos
889 and column_number_displayed members from Lisp_Object to ptrdiff_t.
890 Convert region_showing member from Lisp_Object to bitfield.
891 Remove sequence_number member. Adjust comments.
892 * window.c (sequence_number): Remove.
893 (make_window): Initialize column_number_displayed.
894 * print.c (print_object): Follow the printed representation of
895 frames and print window pointer to distinguish between windows.
896 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
897 * xdisp.c (wset_base_line_number, wset_base_line_pos)
898 (wset_column_number_displayed, wset_region_showing): Remove.
899 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
900 (try_scrolling, try_cursor_movement, redisplay_window)
901 (try_window_reusing_current_matrix, try_window_id, display_line)
902 (display_mode_lines, decode_mode_spec): Adjust users.
903 * .gdbinit (pwinx): Do not print sequence_number.
904
905 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
906
907 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
908 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
909 * dired.c: Include <fcntl.h>.
910 (open_directory): New function, which uses open and fdopendir
911 rather than opendir. DOS_NT platforms still use opendir, though.
912 (directory_files_internal, file_name_completion): Use it.
913 (file_attributes): New function, with most of the old Ffile_attributes.
914 (directory_files_internal, Ffile_attributes): Use it.
915 (file_attributes, file_name_completion_stat): First arg is now fd,
916 not dir name. All uses changed. Use fstatat rather than lstat +
917 stat.
918 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
919 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
920 (emacs_readlinkat): New function, with much of the old
921 Ffile_symlink_p, but with an fd argument for speed.
922 It uses readlinkat rather than careadlinkatcwd, so that it
923 need not assume the working directory.
924 (Ffile_symlink_p): Use it.
925 * filelock.c (current_lock_owner): Use emacs_readlinkat
926 rather than emacs_readlink.
927 * lisp.h (emacs_readlinkat): New decl.
928 (READLINK_BUFSIZE, emacs_readlink): Remove.
929 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
930 (emacs_norealloc_allocator, emacs_readlink): Remove.
931 This stuff is moved to fileio.c.
932 * w32.c (fstatat, readlinkat): New functions.
933 (careadlinkat): Don't check that fd == AT_FDCWD.
934 (careadlinkatcwd): Remove; no longer needed.
935
936 2013-01-31 Glenn Morris <rgm@gnu.org>
937
938 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
939 (Fwrite_region): Update for new choose_write_coding_system args.
940 Move the last piece of choose_write_coding_system here. (Bug#13522)
941 (syms_of_fileio): Add choose-write-coding-system.
942
943 2013-01-30 Eli Zaretskii <eliz@gnu.org>
944
945 * w32.c (sys_open): Zero out the flags for the new file descriptor.
946 (sys_close): Zero out the flags for the file descriptor before
947 closing it. (Bug#13546)
948
949 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
950 (logon_network_drive, stat_worker, symlink, chase_symlinks):
951 Use CharNextExA and CharPrevExA to iterate over file names encoded in
952 DBCS. (Bug#13553)
953
954 * w32.c (w32_get_long_filename, init_environment, readlink):
955 Support file names encoded in DBCS codepages.
956 (readlink): Use the current file-name-coding-system, not the ANSI
957 codepage, to decode and handle targets of symlinks.
958
959 2013-01-28 Eli Zaretskii <eliz@gnu.org>
960
961 * w32.c (opendir): Now accepts a 'const char *'.
962
963 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
964
965 Remove obsolete redisplay code. See the discussion at
966 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
967 * dispnew.c (preemption_period, preemption_next_check): Remove.
968 (Vredisplay_preemption_period): Likewise.
969 (update_frame, update_single_window, update_window, update_frame_1):
970 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
971 used, following the 2012-06-22 change.
972
973 2013-01-25 Eli Zaretskii <eliz@gnu.org>
974
975 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
976
977 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
978
979 * font.c (num_fonts): Remove the leftover from old
980 debugging code. Adjust comment style here and there.
981 * insdel.c (insert_1): Remove.
982 * lisp.h (insert_1): Remove prototype.
983 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
984
985 2013-01-25 Eli Zaretskii <eliz@gnu.org>
986
987 * w32.c (max_filename_mbslen): New function.
988 (normalize_filename, readdir): Use it to detect locales where ANSI
989 encoding of file names uses a double-byte character set (DBCS).
990 If a DBCS encoding is used, advance by characters using
991 CharNextExA, instead of incrementing a 'char *' pointer.
992 Use _mbslwr instead of _strlwr. (Bug#13515)
993
994 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
995 request of memory reservation to 1.7GB. (Bug#13065)
996
997 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
998
999 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1000 at check_extra_latin label. (Bug#13505)
1001
1002 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1003
1004 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1005 Avoid redundant calls to strlen.
1006
1007 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1008
1009 Drop async_visible and async_iconified fields of struct frame.
1010 This is possible because async input is gone; for details, see
1011 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1012 * frame.h (struct frame): Remove async_visible and async_iconified
1013 members, convert garbaged to unsigned bitfield. Adjust comments.
1014 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1015 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1016 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1017 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1018 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1019 * w32term.c: Ditto.
1020 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1021 properly. Likewise for obscured.
1022 * xterm.c: Ditto.
1023 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1024 properly.
1025 * nsterm.m: Ditto.
1026 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1027
1028 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1029
1030 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1031 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1032
1033 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1034
1035 * xdisp.c (message2, message2_nolog): Remove functions.
1036 (message3, message3_nolog): Extract nbytes and multibyteness directly
1037 from the string. Change all callers.
1038 (message3_nolog): Don't set message_enable_multibyte since set_message
1039 will reset it anyway.
1040 (message1, message1_nolog): Use message3.
1041 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1042 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1043 (set_message): Drop all but the second arg, which has to be a string.
1044 (set_message_1): Simplify now that we know that a1 is NULL and the
1045 second arg is a string.
1046 * frame.h (struct frame): Remove `message_buf' field.
1047 Use glyphs_initialized_p instead.
1048 (FRAME_MESSAGE_BUF): Remove macro.
1049 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1050 * lisp.h (message2, message2_nolog): Remove declarations.
1051 (message3, message3_nolog): Update declarations.
1052 * keyboard.c (read_char_minibuf_menu_text)
1053 (read_char_minibuf_menu_width): Remove vars.
1054 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1055 to correctly handle multibyte strings.
1056 * frame.c (delete_frame): Don't free message_buf any more.
1057 * editfns.c (message_text, message_length): Remove vars.
1058 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1059 * fileio.c (auto_save_error): Use message3 instead of message2.
1060 * dispnew.c (adjust_frame_message_buffer): Remove function.
1061
1062 2013-01-23 Eli Zaretskii <eliz@gnu.org>
1063
1064 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1065 real estate used for the tool bar and the menu bar.
1066
1067 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1068
1069 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1070 hidden buffer is prepared to modification (Bug#13164).
1071
1072 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1073
1074 * window.h (struct window): Change window_end_valid member from
1075 Lisp_Object to a bitfield. Adjust comments.
1076 (wset_window_end_valid): Remove.
1077 * window.c (adjust_window_count): Clear window_end_valid.
1078 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1079 (Fwindow_line_height, set_window_buffer, Frecenter)
1080 (Fsplit_window_internal, Fdelete_other_windows_internal)
1081 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1082 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1083 * xdisp.c (check_window_end, reconsider_clip_changes)
1084 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1085 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1086 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1087
1088 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1089
1090 * xdisp.c (mark_window_display_accurate): Simplify the loop
1091 assuming that the only one of vchild, hchild or buffer window
1092 slots is non-nil. Call mark_window_display_accurate_1 for
1093 the leaf windows only.
1094 (mark_window_display_accurate_1): Always assume leaf window.
1095 Adjust comment.
1096
1097 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1098
1099 * emacs.c (Qkill_emacs_hook): Now static.
1100
1101 * fileio.c (Finsert_file_contents): Simplify.
1102 Remove unnecessary assignments and tests.
1103
1104 2013-01-21 Eli Zaretskii <eliz@gnu.org>
1105
1106 * w32.c (acl_set_file): Don't test for errors unless
1107 set_file_security returns FALSE. Avoids spurious errors when
1108 saving files.
1109
1110 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1111
1112 * fileio.c (Finsert_file_contents): Revert code introduced at
1113 2013-01-18 in favor of the simpler and generally better fix.
1114 Save stack space by removing 'buffer' and reusing 'read_buf'
1115 where appropriate.
1116
1117 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1118
1119 * lisp.h (eabs): Define unconditionally (Bug#13419).
1120 The old "#if !defined (eabs)" was an unnecessary revenant of back
1121 when this macro was called "abs". Document 'eabs' better.
1122
1123 2013-01-19 Glenn Morris <rgm@gnu.org>
1124
1125 * fns.c (Frandom): Doc fix.
1126
1127 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1128
1129 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1130 segfault when there are lots of overlays.
1131
1132 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
1133 when there are lots of overlays.
1134 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
1135 for the details and a way to reproduce.
1136
1137 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1138
1139 * fileio.c: Use O_APPEND to append.
1140 This corresponds better to the natural interpretation of "append",
1141 and avoids the need to open the output file twice, or to invoke
1142 lseek when APPEND is neither nil nor a number.
1143 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1144 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1145 file possibly twice, and lseeking to its end; this avoids the
1146 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1147 at the same time: the combination is never needed and apparently
1148 it doesn't work with DOS_NT.
1149
1150 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1151 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1152
1153 Allow floating-point file offsets.
1154 Problem reported by Vitalie Spinu in
1155 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1156 * fileio.c (emacs_lseek): Remove.
1157 (file_offset): New function.
1158 (Finsert_file_contents, Fwrite_region): Use it.
1159
1160 2013-01-19 Chong Yidong <cyd@gnu.org>
1161
1162 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1163 aborting on Fsignal (Bug#13289).
1164
1165 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1166
1167 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1168 set_file_security as failure due to insufficient privileges.
1169 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1170 (fstat): Return owner and group like 'stat' and 'lstat' do.
1171
1172 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1173
1174 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1175 The bug was observed on Ubuntu operating inside a virtual machine,
1176 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1177 The workaround introduces a race condition on non-buggy hosts,
1178 but it's an unlikely race and anyway there's a nearly identical
1179 nearby race that can't be fixed.
1180 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1181 New static vars.
1182 (Fwrite_region): Test for file system time stamp bug.
1183 (init_fileio): New function.
1184 * lisp.h (init_fileio): Declare it.
1185 * emacs.c (main): Call it.
1186
1187 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1188 and make it more consistent with other stat-failure diagnostics.
1189
1190 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1191
1192 Fix crash when inserting data from non-regular files.
1193 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1194 for the error description produced by valgrind.
1195 * fileio.c (read_non_regular): Rename to read_contents.
1196 Free Lisp_Save_Value object used to pass parameters.
1197 (read_non_regular_quit): Rename to read_contents_quit.
1198 (Finsert_file_contents): Redesign internal file reading loop to adjust
1199 gap and end positions after each read and so help make_gap to work
1200 properly. Do not signal an I/O error too early and so do not leave
1201 not yet decoded characters in a buffer, which was the reason of
1202 redisplay crash. Use list2 to build return value. Adjust comments.
1203
1204 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1205
1206 Close a race when statting and reading files (Bug#13149).
1207 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1208 This avoids a race if the file is renamed between stat and open.
1209 This race is not the problem originally noted in Bug#13149;
1210 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1211
1212 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1213
1214 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1215 objects, related functions and macros.
1216 (make_save_value): Adjust prototype.
1217 (make_save_pointer): New prototype.
1218 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1219 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1220 * alloc.c (format_save_value): Rename to make_save_value.
1221 (make_save_pointer): New function.
1222 (record_xmalloc): Use make_save_pointer.
1223 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1224 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1225 Change users of make_save_value to make_save_pointer.
1226 Likewise for format_save_value and make_save_value.
1227
1228 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1229
1230 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1231 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1232 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1233 debugging stubs.
1234
1235 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1236
1237 * alloc.c (free_save_value): Now static.
1238
1239 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1240
1241 * keymap.c (map_keymap_internal): Use format_save_value.
1242 (map_keymap_char_table_item): Adjust accordingly.
1243 * fileio.c (non_regular_fd, non_regular_inserted)
1244 (non_regular_nbytes): Remove.
1245 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1246 Use format_save_value to pass parameters to read_non_regular.
1247 (read_non_regular): Use XSAVE_ macros to extract parameters.
1248 Adjust comment.
1249 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1250 format_save_value.
1251 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1252
1253 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1254
1255 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1256 extraction from any Lisp_Save_Value slot. Add type checking.
1257 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1258 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1259 * xselect.c: All users changed.
1260
1261 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1262
1263 Some convenient bits to deal with Lisp_Save_Values.
1264 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1265 (allocate_misc): Remove prototype.
1266 (format_save_value): New prototype.
1267 * alloc.c (allocate_misc): Revert back to static.
1268 (format_save_value): New function to build Lisp_Save_Value
1269 object with the specified internal structure.
1270 (make_save_value): Reimplement using format_save_value.
1271 * editfns.c (save_excursion_save): Use format_save_value.
1272 (save_excursion_restore): Use XSAVE_OBJECT.
1273
1274 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1275
1276 Avoid needless casts with XSAVE_POINTER.
1277 * alloc.c (mark_object) [GC_MARK_STACK]:
1278 * dired.c (directory_files_internal_unwind):
1279 * fileio.c (do_auto_save_unwind):
1280 * gtkutil.c (pop_down_dialog):
1281 * keymap.c (map_keymap_char_table_item):
1282 * lread.c (load_unwind):
1283 * nsmenu.m (pop_down_menu):
1284 * print.c (print_object) [GC_MARK_STACK]:
1285 * xfns.c (clean_up_file_dialog):
1286 * xmenu.c (cleanup_widget_value_tree):
1287 Omit casts between XSAVE_POINTER and a pointer type.
1288
1289 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1290
1291 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1292 * eval.c (eval_sub): Protect `form' from being GCed before its
1293 car and cdr becomes protected with the backtrace entry.
1294
1295 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1296
1297 Make Lisp_Save_Value more versatile storage for up to four objects.
1298 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1299 (struct Lisp_Save_Value): New layout. Adjust comments.
1300 (XSAVE_POINTER): New macro.
1301 (XSAVE_INTEGER): Likewise.
1302 (allocate_misc): Add prototype.
1303 (free_misc): Likewise.
1304 * alloc.c (allocate_misc): Now global.
1305 (free_misc): Likewise. Adjust comment.
1306 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1307 (free_save_value): Likewise.
1308 (mark_object): Likewise.
1309 * editfns.c (save_excursion_save): Pack everything within
1310 Lisp_Save_Value and so avoid xmalloc.
1311 (save_excursion_restore): Adjust to match new layout. Use free_misc
1312 because we do not allocate extra memory any more. Add eassert.
1313 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1314 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1315 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1316 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1317 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1318
1319 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1320
1321 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1322 (nsfont_draw): Remove disabling of LCD smoothing.
1323 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1324 Bug#11484 with LCD smoothing on.
1325
1326 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
1327
1328 Fix SIGDANGER handlers, for AIX (Bug#13408).
1329 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1330 Move handlers here from emacs.c; they were out of place.
1331
1332 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1333
1334 * xterm.c (syms_of_xterm): Adjust documentation for
1335 scroll-bar-adjust-thumb-portion.
1336
1337 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
1338
1339 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1340 determine whether scroll bar thumb size should be adjusted or
1341 not. Use variable for MOTIF.
1342
1343 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1344 GTK.
1345
1346 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1347
1348 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1349 event is generated.
1350 (doCommandBySelector:): Set processingCompose to NO.
1351
1352 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1353 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1354 (nsfont_list_family): Add block/unblock_input calls.
1355 (nsfont_open): Move block_input earlier. Add unblock_input before early
1356 return.
1357 (nsfont_draw): Add block/unblock_input calls.
1358
1359 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1360
1361 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1362 for old_charpos and old_bytepos.
1363
1364 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1365
1366 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1367 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1368 Clear tzvalbuf_in_environ if this workaround is in effect.
1369 Problem and fix reported by Kazuhiro Ito.
1370
1371 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1372
1373 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1374 Fix ambiguous doc string cross-reference(s).
1375
1376 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1377 doc string cross-reference(s).
1378
1379 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1380 string cross-reference(s).
1381
1382 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1383
1384 Avoid unnecessary byte position calculation for the gap movement.
1385 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1386 anyway, all of them should use move_gap_both instead.
1387 * lisp.h (move_gap): Remove prototype.
1388 * insdel.c (move_gap): Remove.
1389 (move_gap_both): Add eassert.
1390 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1391 * xml.c (parse_region): Likewise.
1392
1393 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1394
1395 emacsclient -t should not suspend Emacs server (Bug#13387)
1396 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1397 New functions.
1398 * term.c (init_tty): Use them instead of rolling our own code.
1399 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1400 switches from 'signal' to 'pthread_sigmask', which is safer in
1401 multithreaded applications.
1402 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1403 which has already arranged for that.
1404 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1405 This is the main part of the bug fix.
1406
1407 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
1408
1409 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1410 x_last_font_name (Bug#13403).
1411
1412 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1413
1414 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1415 the type of per-buffer values where appropriate.
1416 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1417 predicate, which is how it's really used now. Adjust comment.
1418 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1419 * buffer.c (buffer_slot_type_mismatch): Remove.
1420 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1421 predicate. Adjust comment.
1422 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1423 fill-column, left-margin, tab-width, buffer-saved-size,
1424 left-margin-width, right-margin-width, left-fringe-width,
1425 right-fringe-width, scroll-bar-width and buffer-display-count.
1426 Use Qstringp for default-directory, buffer-file-name,
1427 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1428 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1429 line-spacing.
1430 * data.c (store_symval_forwarding): Adjust to call the predicate.
1431
1432 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
1433
1434 * w32.c (get_name_and_id, acl_set_file):
1435 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1436
1437 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1438
1439 * lisp.h (make_gap_1): New prototype.
1440 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1441 gap size values.
1442 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1443 naming convention.
1444 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
1445 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
1446 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1447 (make_gap_1): New function to adjust the gap of any buffer.
1448 * coding.c (coding_alloc_by_making_gap): Use it.
1449 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1450 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1451
1452 2013-01-08 Juri Linkov <juri@jurta.org>
1453
1454 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1455 of (supports :underline (:style wave)). (Bug#13000)
1456
1457 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1458
1459 * undo.c (Fprimitive_undo): Move to simple.el.
1460 (syms_of_undo): Remove declarations for Sprimitive_undo.
1461
1462 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1463
1464 * keyboard.c (echo_add_key): Rename from echo_add_char.
1465
1466 2013-01-06 Chong Yidong <cyd@gnu.org>
1467
1468 * keyboard.c (echo_add_char): New function, factored out from
1469 echo_char. Don't add a space if the previous echo string was
1470 empty (Bug#13255).
1471 (echo_char): Use it.
1472 (read_key_sequence): When echoing mock input, ensure that the
1473 trailing dash is properly added.
1474
1475 2013-01-05 Eli Zaretskii <eliz@gnu.org>
1476
1477 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1478 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
1479 digits for buffer positions, before misalignment starts.
1480 Display "0" for integer "object" field.
1481 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1482 Display the newline glyph more unambiguously.
1483
1484 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1485
1486 * nsterm.m (ns_draw_underwave):
1487 * w32term.c (w32_draw_underwave):
1488 * xterm.c (x_draw_underwave): Make underwave look more triangular
1489 and also degrade gracefully for small fonts. (Bug#13000)
1490
1491 * nsterm.m (ns_draw_text_decoration):
1492 * w32term.c (x_draw_glyph_string):
1493 * xterm.c (x_draw_glyph_string): Don't use previous underline
1494 thickness and position if previous underline type is underwave.
1495
1496 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1497
1498 * fileio.c (Ffile_acl): Undocument return format.
1499
1500 2013-01-02 Glenn Morris <rgm@gnu.org>
1501
1502 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1503
1504 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1505
1506 Simplify via eabs.
1507 * dired.c (file_name_completion):
1508 * doc.c (get_doc_string):
1509 * floatfns.c (round2):
1510 * font.c (font_score, font_delete_unmatched):
1511 * fringe.c (compute_fringe_widths):
1512 * lread.c (read_list):
1513 * minibuf.c (Ftry_completion):
1514 * term.c (tty_ins_del_lines):
1515 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1516 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1517
1518 2012-12-31 Eli Zaretskii <eliz@gnu.org>
1519
1520 * w32.c (unsetenv): Set up the string passed to _putenv
1521 correctly.
1522 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
1523 for the bug this caused.
1524
1525 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1526
1527 * coding.c (Qmac): Now static.
1528
1529 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1530
1531 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1532 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1533 handlebox_widget. Set toolbar_in_hbox to false/true, set
1534 toolbar_is_packed to true.
1535 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1536 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1537 Show all on TOOLBAR_TOP_WIDGET.
1538 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1539 by TOOLBAR_TOP_WIDGET.
1540 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1541 Check toolbar_is_packed.
1542 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1543 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1544 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1545 false.
1546 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1547 (xg_update_menubar): Update title only if
1548 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1549 (xg_update_submenu): Skip tearoff only if
1550 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1551 (xg_initialize): Initialize xg_detached_menus only if
1552 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1553
1554 * xterm.h (struct x_output): Surround handlebox_widget with
1555 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1556 toolbar_in_hbox is bool.
1557
1558 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
1559
1560 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1561 (LIBS_GNUSTEP): Define.
1562 (LIBES): Add $(LIBS_GNUSTEP).
1563 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1564
1565 2012-12-30 Eli Zaretskii <eliz@gnu.org>
1566
1567 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1568 continuation glyph on a TTY with an indication of an empty line.
1569 (Bug#13277)
1570
1571 2012-12-29 Eli Zaretskii <eliz@gnu.org>
1572
1573 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1574 file's SELinux context or ACLs successfully set, nil otherwise.
1575 (Bug#13298)
1576 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
1577
1578 * w32proc.c (reader_thread): Avoid passing NULL handles to
1579 SetEvent and WaitForSingleObject.
1580
1581 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1582
1583 Port EXTERNALLY_VISIBLE to Clang 3.2.
1584 * conf_post.h (__has_attribute): New macro.
1585 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1586
1587 2012-12-27 Glenn Morris <rgm@gnu.org>
1588
1589 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1590 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1591
1592 2012-12-27 Eli Zaretskii <eliz@gnu.org>
1593
1594 * fileio.c (file_name_as_directory, directory_file_name):
1595 Accept an additional argument MULTIBYTE to indicate whether the input C
1596 came from a multibyte or a unibyte Lisp string; all callers
1597 adjusted. Don't assume the input string is always multibyte.
1598 (Bug#13262)
1599 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1600 don't ENCODE_FILE them, and return a unibyte string if the input
1601 was unibyte.
1602 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1603 don't assume the input strings will always be multibyte. If the
1604 input strings are multibyte, decode strings obtained from C
1605 library functions.
1606
1607 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1608
1609 * lisp.h (toplevel): Add two notices to the comment about
1610 defining a new Lisp data type.
1611 * print.c (print_object): If Lisp_Save_Value object's pointer
1612 is the address of a memory area containing Lisp_Objects, try
1613 to print them.
1614 * alloc.c (valid_lisp_object_p): Adjust comment.
1615
1616 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1617
1618 * keyboard.c (record_asynch_buffer_change): Initialize an event
1619 only if it's really needed.
1620 * frame.h (enum output_method): Remove output_mac member since
1621 it's a leftover from the deleted code.
1622 * frame.c (Fframep): Adjust user here ...
1623 * terminal.c (Fterminal_live_p): ... and here.
1624 * coding.c (Qmac): Now here because it's only used to denote
1625 end-of-line encoding type.
1626 (syms_of_coding): DEFSYM it.
1627 * frame.h (Qmac): Remove duplicated declaration.
1628
1629 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1630
1631 * window.c (select_window_1): Now static, since it's used only here.
1632
1633 2012-12-25 Eli Zaretskii <eliz@gnu.org>
1634
1635 * window.c (window_body_cols): Subtract display margins from the
1636 window body width on TTYs as well. See
1637 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1638 for the original report.
1639
1640 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1641
1642 * xdisp.c (redisplay_window): Remove inner local variable
1643 because the outer shadowed one has the same meaning.
1644 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1645 set but never used.
1646 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1647 (xg_create_tool_bar): Adjust users.
1648
1649 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1650
1651 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1652 * buffer.c (Fget_buffer_create): Use it to set compact field of
1653 struct buffer_text to avoid accessing an uninitialized value
1654 when compact_buffer is called for the first time.
1655 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
1656 (Fset_buffer_modified_p): Use buffer_window_count to check
1657 whether the buffer is displayed in some window.
1658 * xdisp.c (message_dolog): Likewise.
1659
1660 2012-12-23 Eli Zaretskii <eliz@gnu.org>
1661
1662 * w32.c (acl_set_file): If setting the file security descriptor
1663 fails, and the new DACL is identical to the existing one, silently
1664 return success. This fixes problems for users backing up their
1665 own files without having the necessary privileges for setting
1666 security descriptors.
1667
1668 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1669 values.
1670 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1671 after WaitForSingleObject returns normally. This expedites reader
1672 thread shutdown when delete_child triggers it.
1673 (reap_subprocess): More accurate commentary for why we call
1674 delete_child only when cp->fd is negative.
1675
1676 * w32.c (sys_close): Do not call delete_child on a subprocess
1677 whose handle is not yet closed. Instead, set its file descriptor
1678 to a negative value, so that reap_subprocess will call
1679 delete_child on that subprocess when its SIGCHLD arrives.
1680 This avoids closing handles used for communications between sys_select
1681 and reader_thread, which doesn't give sys_select a chance to
1682 notice that the process exited and invoke the SIGCHLD handler for
1683 it.
1684
1685 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1686
1687 * nsfns.m (Fns_do_applescript): Run event loop until script has
1688 been executed (Bug#12969).
1689 (ns_run_ascript): Chech as_script for nil, set to nil after
1690 executing script.
1691
1692 2012-12-22 Martin Rudalics <rudalics@gmx.at>
1693
1694 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1695
1696 2012-12-22 Eli Zaretskii <eliz@gnu.org>
1697
1698 * w32term.c (w32fullscreen_hook): New function.
1699 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1700
1701 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1702
1703 * fileio.c (Finsert_file_contents): Doc fix.
1704
1705 * w32proc.c (new_child, delete_child, find_child_pid): For a
1706 subprocess, consider its slot being in use as long as its process
1707 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1708 slot when a new process is started immediately after killing
1709 another one, without waiting enough time for the first process to
1710 be reaped and resources allocated for it be orderly freed.
1711 (Bug#13086)
1712 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1713
1714 2012-12-21 Chong Yidong <cyd@gnu.org>
1715
1716 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1717
1718 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1719
1720 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1721
1722 * w32.c (get_name_and_id): Always pass NULL as the first argument
1723 of lookup_account_sid. Avoids crashes with UNC file names that
1724 refer to DFS domains, not to specific machine names. (Bug#12621)
1725 Remove now unused argument FNAME; all callers changed.
1726 (get_file_owner_and_group): Remove now unused argument FNAME; all
1727 callers changed.
1728
1729 2012-12-21 Chong Yidong <cyd@gnu.org>
1730
1731 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1732 error for invalid chars, don't check for a nil return value.
1733
1734 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1735
1736 Avoid calls to CHAR_TO_BYTE if byte position is known.
1737 * editfns.c (make_buffer_string_both): Use move_gap_both.
1738 (Fbuffer_string): Use make_buffer_string_both.
1739 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1740 Adjust comment.
1741 (buf_bytepos_to_charpos): Likewise.
1742 (charpos_to_bytepos): Remove.
1743 * fileio.c (Finsert_file_contents): Use move_gap_both.
1744 * search.c (Freplace_match): Likewise.
1745 * process.c (process_send_region): Likewise. Use convenient
1746 names for byte positions.
1747 * lisp.h (charpos_to_bytepos): Remove prototype.
1748 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1749 * insdel.c (move_gap): Likewise.
1750
1751 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 * xdisp.c (redisplay_internal): Remove now-unused local.
1754
1755 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1756
1757 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1758 (redisplay_internal): Don't bother selecting the frame to get the
1759 proper value of frame-local variables (bug#13225).
1760
1761 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1762
1763 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1764 Rename 4th argument since it may be buffer or string. Adjust comment.
1765 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1766
1767 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1768
1769 * coding.c (Fdetect_coding_region): Do not check start and end with
1770 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1771 (code_convert_region): Likewise.
1772
1773 2012-12-18 Eli Zaretskii <eliz@gnu.org>
1774
1775 * w32.c (acl_get_file, acl_set_file): Run the file name through
1776 map_w32_filename, and resolve any symlinks in the file name, like
1777 Posix platforms do.
1778 (acl_set_file): Call revert_to_self, if any privileges were
1779 enabled.
1780
1781 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
1782
1783 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1784 ($(BLD)/w32.$(O)): Update dependencies.
1785
1786 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1787
1788 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1789 propagate redisplay's scrolling (if any) to the right window.
1790 (redisplay_internal): Use ensure_selected_frame.
1791 (display_mode_lines): Complete last fix.
1792 * window.c (select_window_1): New func, extracted from select_window.
1793 (select_window): Use it.
1794 * window.h (select_window_1): Declare.
1795
1796 2012-12-17 Eli Zaretskii <eliz@gnu.org>
1797
1798 Emulate Posix ACL APIs on MS-Windows.
1799 * w32.c: Include sddl.h and sys/acl.h.
1800 (SDDL_REVISION_1): Define if not already defined.
1801 (g_b_init_get_security_descriptor_dacl)
1802 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1803 (g_b_init_is_valid_security_descriptor)
1804 (g_b_init_set_file_security): New static flags.
1805 (globals_of_w32): Initialize them to zero.
1806 (SetFileSecurity_Name): New string constant.
1807 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1808 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1809 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1810 (IsValidSecurityDescriptor_Proc): New typedefs.
1811 (get_file_security, get_security_descriptor_owner)
1812 (get_security_descriptor_group): Set errno to ENOTSUP.
1813 (set_file_security, get_security_descriptor_dacl)
1814 (is_valid_security_descriptor, convert_sd_to_sddl)
1815 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1816 (acl_free, acl_get_file, acl_set_file): New functions.
1817
1818 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1819
1820 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1821
1822 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1823 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1824 for some of that bug's symptoms can now cause Emacs to abort.
1825 Remove the workaround.
1826 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1827 The bug that caused SIGCHLD to get lost has been fixed, and the
1828 workaround for it can now cause Emacs to abort.
1829
1830 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1831
1832 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1833 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1834 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1835
1836 2012-12-16 Romain Francoise <romain@orebokech.com>
1837
1838 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1839 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1840 and copy ACL entries of file in addition to SELinux context if set.
1841 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1842
1843 * Makefile.in (LIBACL_LIBS): New macro.
1844 (LIBES): Use it.
1845
1846 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 * fileio.c (internal_delete_file): Use bool for boolean.
1849
1850 2012-12-15 Eli Zaretskii <eliz@gnu.org>
1851
1852 Fix bug #13079 on MS-Windows with temp files not being deleted.
1853 * w32.h (_child_process): New members input_file and
1854 pending_deletion.
1855 (register_child): First argument is now pid_t.
1856 (record_infile, record_pending_deletion): New prototypes.
1857
1858 * w32proc.c (new_child): Initialize input_file and
1859 pending_deletion members of the child.
1860 (delete_child): Delete the child's temporary input file, if any,
1861 that is pending deletion.
1862 (register_child): First argument is now pid_t.
1863 (record_infile, record_pending_deletion): New functions.
1864 (reap_subprocess): Fix a typo in DebPrint string.
1865 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1866
1867 * fileio.c (internal_delete_file): Return an int again: non-zero
1868 if delete-file succeeds, zero otherwise.
1869
1870 * lisp.h (internal_delete_file): Adjust prototype.
1871
1872 * callproc.c (Fcall_process): Don't overwrite infile with result
1873 of DECODE_FILE.
1874 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1875 asynchronous subprocess, record the name of the input file name,
1876 if any.
1877 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1878 delete the file, record it as pending deletion when the subprocess
1879 exits.
1880
1881 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1882
1883 * editfns.c [HAVE_PWD_H]: Include grp.h.
1884
1885 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1886
1887 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1888
1889 Fix permissions bugs with setgid directories etc. (Bug#13125)
1890 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1891 to mark it as a placeholder. The old value was often wrong.
1892 The only user of this attribute has been changed to use
1893 file-ownership-preserved-p instead, with its new group arg.
1894 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1895
1896 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1897
1898 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1899 Keep selected_window and selected_frame in sync.
1900
1901 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1902
1903 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1904 try to get accurate owner and group information from NT file
1905 security APIs. This is to make most callers of 'stat' and
1906 'lstat', which don't need that information, much faster.
1907
1908 * dired.c (Ffile_attributes) [WINDOWSNT]:
1909 Set w32_stat_get_owner_group to a non-zero value, to request accurate
1910 owner and group information from 'lstat'.
1911
1912 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1913
1914 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1915 as that confuses set-auto-coding, so insist on the head-read
1916 returning the full 1024 bytes. Let lseek compute the tail offset;
1917 less work for us. Do not ignore I/O errors when reading the tail.
1918
1919 * xdisp.c: Minor style fixes.
1920 (init_iterator): Hoist assignment out of if-expression.
1921 (markpos_of_region): Callers now test for sign, not for -1.
1922
1923 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1924
1925 Minor redisplay optimization when the region length is zero.
1926 * xdisp.c (markpos_of_region): New function.
1927 (init_iterator): Do not highlight the region of zero length.
1928 (redisplay_window): Check whether the region is of non-zero length.
1929 (try_cursor_movement): Allow if the region length is zero.
1930 (try_window_reusing_current_matrix, try_window_id): Likewise.
1931
1932 2012-12-13 Eli Zaretskii <eliz@gnu.org>
1933
1934 * search.c (search_buffer): Check the inverse translations of each
1935 character in pattern when the buffer being searched is unibyte.
1936 (Bug#13084)
1937
1938 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1939
1940 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1941 files, fixing a regression from 24.2.
1942 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
1943
1944 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1947 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1948 Remove unnecessary S_ISLNK test, as (contra the comments) this
1949 function can't copy symlinks. Improve quality of error message
1950 when attempting to copy files that are neither regular files nor
1951 directories.
1952
1953 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1954
1955 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1956 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1957 * window.c (Frecenter):
1958 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1959 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1960
1961 2012-12-12 Daniel Colascione <dancol@dancol.org>
1962
1963 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
1964 the dumped Emacs is not a sparse file, greatly improving Cygwin
1965 "make bootstrap" performance.
1966
1967 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
1968
1969 * inotify.c (inotify_callback): Generate an Emacs event for every
1970 incoming inotify event.
1971
1972 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1973
1974 * xdisp.c (handle_face_prop): Fix logic of computing
1975 it->start_of_box_run_p.
1976 (append_space_for_newline): If the glyph row is R2L, reset the
1977 iterator's end_of_box_run_p flag before prepending the space glyph.
1978 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1979 iterator's start_of_box_run_p flag before prepending the stretch.
1980 (append_glyph, produce_image_glyph, append_composite_glyph)
1981 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1982 left_box_line_p and right_box_line_p flags of the glyph for R2L
1983 glyph rows. (Bug#13011)
1984
1985 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1986
1987 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1988 if changed buffer is not shown in a window.
1989 * insdel.c (prepare_to_modify_buffer): Likewise.
1990 * window.c (replace_buffer_in_windows_safely): Do nothing
1991 if buffer is not shown in a window.
1992 (Fforce_window_update): Likewise if string or buffer argument
1993 is passed.
1994
1995 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1996
1997 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1998 encoded_file_name, which is what it is.
1999
2000 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2001
2002 Consistently use marker_position and marker_byte_position.
2003 * fringe.c (Ffringe_bitmaps_at_pos):
2004 * indent.c (Fvertical_motion):
2005 * insdel.c (prepare_to_modify_buffer):
2006 * keyboard.c (make_lispy_position):
2007 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2008 (window_scroll_pixel_based, displayed_window_lines)
2009 (Fset_window_configuration):
2010 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2011 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2012 Replace direct access to marker fields with calls
2013 to marker_position and/or marker_byte_position.
2014
2015 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
2016
2017 * makefile.w32-in (SIG2STR_H): New macro.
2018 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2019 ($(BLD)/w32notify.$(O)): Update dependencies.
2020
2021 2012-12-10 Daniel Colascione <dancol@dancol.org>
2022
2023 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2024 Windows file notification functionality unless WINDOWSNT.
2025
2026 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2027 declarations.
2028
2029 * w32fns.c (cache_system_info): Initialize the global hinst
2030 variable here so various initialization calls DTRT.
2031
2032 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2033 (hinst): Remove unneeded extern declaration.
2034 (_start): Remove initialization of above variables; remove
2035 initialization of hinst, as cache_system_info now does that.
2036
2037 * emacs.c (main): Call cache_system_info early in startup; we
2038 previously weren't calling it in Cygwin builds.
2039
2040 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2041 Teach the autoconf build system how to compile a Windows resource file
2042 and link it to Emacs.
2043
2044 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2045
2046 Per-buffer window counters.
2047 * buffer.h (struct buffer): New member window_count.
2048 (buffer_window_count): New function.
2049 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2050 Initialize window_count.
2051 (Fkill_buffer): Verify window_count for the buffer being killed.
2052 (modify_overlay): Do not force redisplay if buffer is not shown
2053 in any window.
2054 (init_buffer_once): Initialize window_count for buffer_defaults
2055 and buffer_local_symbols.
2056 * window.h (buffer_shared): Remove declaration.
2057 (wset_buffer): Convert from inline ...
2058 * window.c (wset_buffer): ... to an ordinary function.
2059 (adjust_window_count): New function.
2060 (make_parent_window): Use it.
2061 * xdisp.c (buffer_shared): Remove.
2062 (redisplay_internal, redisplay_window): Adjust users.
2063 (buffer_shared_and_changed): Use per-buffer window counter.
2064
2065 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2066
2067 Support for filesystem notifications on MS-Windows.
2068 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2069 and this is a TTY frame, signal the caller that keyboard input is
2070 available.
2071
2072 * w32xfns.c (drain_message_queue): Now returns an int: an
2073 indication whether any WM_EMACS_FILENOTIFY messages were found in
2074 the queue.
2075
2076 * w32inevt.c (handle_file_notifications): New function.
2077 (w32_console_read_socket): Call it to process file notifications.
2078
2079 * w32console.c (initialize_w32_display): Record the main thread ID
2080 in dwMainThreadId.
2081
2082 * deps.mk (inotify.o): New dependency list.
2083
2084 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2085
2086 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2087 (WM_EMACS_END): Bump value by 1.
2088 (notification_buffer_in_use, file_notifications)
2089 (notifications_size, notifications_desc): Declare.
2090 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2091 Add prototypes.
2092
2093 * w32term.c (lispy_file_action, queue_notifications): New functions.
2094 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2095 <Qrenamed_to>: New symbols.
2096 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2097
2098 * w32notify.c: New file, implements file event notifications for
2099 MS-Windows.
2100
2101 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2102 by posting it to the w32_read_socket queue.
2103
2104 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2105
2106 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2107 (GLOBAL_SOURCES): Add w32notify.c
2108 ($(BLD)/w32notify.$(O)): New set of dependencies.
2109
2110 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2111
2112 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2113 Handle FILE_NOTIFY_EVENT.
2114 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2115 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2116 w32notify-handle-event by default.
2117
2118 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2119 syms_of_w32notify.
2120
2121 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2122
2123 Support for filesystem notifications on GNU/Linux via inotify.
2124 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
2125
2126 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2127
2128 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2129 (syms_of_keyboard): DEFSYM it.
2130 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2131 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2132 Qfile_inotify events.
2133 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2134 special-event-map to inotify-handle-event.
2135
2136 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2137
2138 * Makefile.in (base_obj): Add inotify.o.
2139
2140 * inotify.c: New file.
2141
2142 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
2143
2144 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2145
2146 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
2147
2148 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2149 DWORD_PTR, for compatibility with 64-bit builds.
2150
2151 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
2152 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2153 (system_process_attributes): Use SIZE_T rather than DWORD, for
2154 compatibility with 64-bit builds.
2155
2156 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
2157
2158 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2159
2160 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2161
2162 * indent.c (Fvertical_motion): If a display string will be
2163 displayed on the left or the right margin, don't consider it as a
2164 factor in cursor positioning. (Bug#13108)
2165
2166 2012-12-10 Martin Rudalics <rudalics@gmx.at>
2167
2168 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2169
2170 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2171
2172 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2173 for string length.
2174
2175 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2176
2177 * w32.c (unsetenv): Return 0 if the input string is too long.
2178
2179 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2180
2181 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2182 * alloc.c (xputenv): New function.
2183 * dbusbind.c (Fdbus_init_bus):
2184 * emacs.c (main):
2185 * xterm.c (x_term_init):
2186 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2187 * editfns.c (initial_tz): Move static var decl up.
2188 (tzvalbuf_in_environ): New static var.
2189 (init_editfns): Initialize these two static vars.
2190 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2191 Save old TZ value on stack, if it's small.
2192 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2193 instead, use xputenv+unsetenv to set and restore TZ.
2194 (environbuf): Remove static var. All uses removed.
2195 (Fset_time_zone_rule): Do not save TZ and environ;
2196 no longer needed here.
2197 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2198 Move to inside set_time_zone_rule; they don't need file scope any more.
2199 (set_time_zone_rule): Maintain the TZ=value string separately.
2200 (syms_of_editfns): Don't initialize initial_tz;
2201 init_editfns now does it.
2202 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2203 * lisp.h (xputenv): New decl.
2204
2205 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2206
2207 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2208
2209 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2210
2211 * w32.c (unsetenv, sys_putenv): New functions.
2212
2213 2012-12-08 Chong Yidong <cyd@gnu.org>
2214
2215 * editfns.c (Finsert_char): Make the error message more
2216 informative (Bug#12992).
2217
2218 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2219
2220 Simplify get_lim_data.
2221 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2222 Remove USG and vlimit methods; no longer used these days.
2223 Add #error catchall just in case.
2224
2225 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2226 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2227 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2228 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2229 (deleted_pid_list, Fdelete_process, create_process)
2230 (record_child_status_change, handle_child_signal, deliver_child_signal)
2231 (init_process_emacs, syms_of_process):
2232 Assume SIGCHLD is defined.
2233 (parse_signal): Remove. All uses removed.
2234 (abbr_to_signal): New static function.
2235 (Fsignal_process): Use it to convert signal names to ints.
2236 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2237 kill (getpgrp (), ...).
2238 (emacs_sigaction_init): Assume SIGCHLD is defined.
2239 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2240 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2241 * syssignal.h (EMACS_KILLPG): Remove.
2242 All uses replaced by 'kill' with a negative pid.
2243 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2244 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2245
2246 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2247
2248 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2249 This will cause a production Emacs to dump core instead of
2250 infinite-looping.
2251
2252 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2253
2254 * frame.c (make_frame): Do not set window's buffer to t.
2255 * window.c (Fsplit_window_internal): Likewise. Previously it was
2256 used to indicate that the window is being set up. Now we use
2257 set_window_buffer for all new windows, so the condition in ...
2258 (Fset_window_buffer): ... is always true and can be removed.
2259
2260 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2261
2262 Convenient macro to check whether the buffer is hidden.
2263 * buffer.h (BUFFER_HIDDEN_P): New macro.
2264 * frame.c (make_frame): Use it. Adjust comment.
2265 * buffer.c (candidate_buffer): New function.
2266 (Fother_buffer, other_buffer_safely): Use it.
2267
2268 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2269
2270 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2271 if the child process is still running. Instead, exit the wait
2272 loop and return zero. (Bug#13086)
2273
2274 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2275
2276 * frame.h (x_char_width, x_char_height): Remove prototypes.
2277 * w32term.h (x_char_width, x_char_height): Likewise.
2278 * xfns.c (x_char_width, x_char_height): Remove.
2279 * w32fns.c (x_char_width, x_char_height): Likewise.
2280 * nsfns.c (x_char_width, x_char_height): Likewise.
2281 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2282 all window frames.
2283 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2284 * keyboard.c (command_loop_1): Remove prototype.
2285 (command_loop_2, top_level_1): Add static to match prototype.
2286
2287 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2288
2289 Fix a recently-introduced delete-process race condition.
2290 * callproc.c, process.h (record_kill_process):
2291 New function, containing part of the old call_process_kill.
2292 (call_process_kill): Use it.
2293 This does not change call_process_kill's behavior.
2294 * process.c (Fdelete_process): Use record_kill_process to fix a
2295 race condition that could cause Emacs to lose track of a child.
2296
2297 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2298
2299 Avoid code duplication between prev_frame and next_frame.
2300 * frame.c (candidate_frame): New function. Add comment.
2301 (prev_frame, next_frame): Use it. Adjust comment.
2302
2303 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2304
2305 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2306 fails, signal an error instead of continuing with an empty
2307 string. (Bug#13079)
2308 Encode expanded temp file pattern before passing it to mkstemp or
2309 mktemp.
2310
2311 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2312 Encode the file name before passing it to dostounix_filename, in
2313 case it will downcase it (under w32-downcase-file-names).
2314 (Bug#12933)
2315
2316 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 Minor call-process cleanups.
2319 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2320 at the same time as other platforms, to simplify analysis.
2321 No need for fd0_volatile since we have synch_process_fd.
2322 Avoid needless emacs_close; arg is always negative.
2323
2324 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2325
2326 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2327 processes.
2328
2329 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2330
2331 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2332 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2333 and mouse_face_hidden members to a bitfields.
2334 * frame.h (struct frame): Remove set-but-not-used space_width member.
2335 (FRAME_SPACE_WIDTH): Remove.
2336 * nsterm.m, w32term.c, xterm.c: Adjust users.
2337 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2338 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2339 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2340 members to a bitfields.
2341
2342 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2343
2344 Don't let call-process be a zombie factory (Bug#12980).
2345 Fixing this bug required some cleanup of the signal-handling code.
2346 As a side effect, this change also fixes a longstanding rare race
2347 condition whereby Emacs could mistakenly kill unrelated processes,
2348 and it fixes a bug where a second C-g does not kill a recalcitrant
2349 synchronous process in GNU/Linux and similar platforms.
2350 The patch should also fix the last vestiges of Bug#9488,
2351 a bug which has mostly been fixed on the trunk by other changes.
2352 * callproc.c, process.h (synch_process_alive, synch_process_death)
2353 (synch_process_termsig, sync_process_retcode):
2354 Remove. All uses removed, to simplify analysis and so that
2355 less consing is done inside critical sections.
2356 * callproc.c (call_process_exited): Remove. All uses replaced
2357 with !synch_process_pid.
2358 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2359 These take the role of what used to be in unwind-protect arg.
2360 All uses changed.
2361 (block_child_signal, unblock_child_signal):
2362 New functions, to avoid races that could kill innocent-victim processes.
2363 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2364 (call_process_kill): Record killed processes as deleted, so that
2365 zombies do not clutter up the system. Do this inside a critical
2366 section, to avoid a race that would allow the clutter.
2367 (call_process_cleanup): Fix code so that the second C-g works again
2368 on common platforms such as GNU/Linux.
2369 (Fcall_process): Create the child process in a critical section,
2370 to fix a race condition. If creating an asynchronous process,
2371 record it as deleted so that zombies do not clutter up the system.
2372 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2373 light of these changes. Omit unnecessary call to emacs_close
2374 before failure, as the unwind-protect code does that.
2375 * callproc.c (call_process_cleanup):
2376 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2377 * process.c (record_deleted_pid): New function, containing
2378 code refactored out of Fdelete_process.
2379 (Fdelete_process): Use it.
2380 (process_status_retrieved): Remove. All callers changed to use
2381 child_status_change.
2382 (record_child_status_change): Remove, folding its contents into ...
2383 (handle_child_signal): ... this signal handler. Now, this
2384 function is purely a handler for SIGCHLD, and is not called after
2385 a synchronous waitpid returns; the synchronous code is moved to
2386 wait_for_termination. There is no need to worry about reaping
2387 more than one child now.
2388 * sysdep.c (get_child_status, child_status_changed): New functions.
2389 (wait_for_termination): Now takes int * status and bool
2390 interruptible arguments, too. Do not record child status change;
2391 that's now the caller's responsibility. All callers changed.
2392 Reimplement in terms of get_child_status.
2393 (wait_for_termination_1, interruptible_wait_for_termination):
2394 Remove. All callers changed to use wait_for_termination.
2395 * syswait.h: Include <stdbool.h>, for bool.
2396 (record_child_status_change, interruptible_wait_for_termination):
2397 Remove decls.
2398 (record_deleted_pid, child_status_changed): New decls.
2399 (wait_for_termination): Adjust to API changes noted above.
2400
2401 * bytecode.c, lisp.h (Qbytecode): Remove.
2402 No longer needed after 2012-11-20 interactive-p changes.
2403
2404 2012-12-03 Eli Zaretskii <eliz@gnu.org>
2405
2406 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2407 the scroll margin, move point outside the margin. (Bug#13055)
2408
2409 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2410
2411 * gtkutil.c (my_log_handler): New function.
2412 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2413
2414 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2415
2416 * lisp.h (modify_region): Rename to...
2417 (modify_region_1): ...new prototype.
2418 * textprop.c (modify_region): Now static. Adjust users.
2419 * insdel.c (modify_region): Rename to...
2420 (modify_region_1): ...new function to work with current buffer.
2421 Adjust comment and users. Use true and false for booleans.
2422
2423 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2424
2425 * alloc.c (free_save_value): New function.
2426 (safe_alloca_unwind): Use it.
2427 * lisp.h (free_save_value): New prototype.
2428 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2429 Add comment.
2430 (save_excursion_restore): Adjust to match saved data structure.
2431 Use free_save_value to offload some work from GC. Drop obsolete
2432 #if 0 code.
2433
2434 2012-12-03 Chong Yidong <cyd@gnu.org>
2435
2436 * fileio.c (Vauto_save_list_file_name): Doc fix.
2437
2438 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
2439
2440 * w32fns.c: Remove prototype of atof.
2441 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
2442 builds.
2443 (file_dialog_callback): Make it UINT_PTR.
2444
2445 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2446 with 64-bit builds.
2447
2448 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2449 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2450 defined.
2451
2452 2012-12-03 Glenn Morris <rgm@gnu.org>
2453
2454 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
2455
2456 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2457
2458 Fix xpalloc confusion after memory is exhausted.
2459 * alloc.c (xpalloc): Comment fix.
2460 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2461 and signals an error, do not clear charset_table_size, as
2462 charset_table is still valid.
2463 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2464
2465 Use execve to avoid need to munge environ (Bug#13054).
2466 * callproc.c (Fcall_process):
2467 * process.c (create_process):
2468 Don't save and restore environ; no longer needed.
2469 * callproc.c (child_setup):
2470 Use execve, not execvp, to preserve environ.
2471
2472 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2475
2476 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2477
2478 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2479 display for sliced images (Bug#10500).
2480
2481 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2482
2483 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
2484
2485 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2486 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2487
2488 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2489
2490 * xdisp.c (window_outdated): Remove eassert since it hits
2491 some suspicious corner cases (see Bug#13007 and Bug#13012).
2492 (mode_line_update_needed): New function.
2493 (redisplay_internal, redisplay_window): Use it.
2494 (ensure_selected_frame): New function.
2495 (redisplay_internal, unwind_redisplay): Use it.
2496 (redisplay_internal): Move comment about buffer_shared...
2497 (buffer_shared_and_changed): ...near to its real use.
2498
2499 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2500
2501 * callproc.c (Fcall_process): Don't misreport vfork failure.
2502
2503 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2504
2505 * callproc.c (Fcall_process): Fix vfork portability problems.
2506 Do not assume that fd[0], count, filefd, and save_environ survive
2507 vfork. Fix bug whereby wrong errno value could be reported for
2508 pipe failure. Some minor cleanups, too, as follows. Move buf and
2509 bufsize to the context where they're needed. Change new_argv to
2510 be of type char **, as this is more convenient and avoids casts.
2511 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2512 Now local constants, not macros.
2513
2514 2012-11-18 Kenichi Handa <handa@gnu.org>
2515
2516 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2517 for the variable "f".
2518
2519 2012-11-13 Kenichi Handa <handa@gnu.org>
2520
2521 * font.c (font_unparse_xlfd): Exclude special characters from the
2522 generating XLFD name.
2523
2524 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2527 * dired.c (stat_uname, stat_gname):
2528 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2529
2530 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2531 * dired.c (directory_files_internal, file_name_completion):
2532 Assume EAGAIN and EINTR are defined.
2533
2534 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2535 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2536 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2537 * lread.c (readbyte_from_file): Assume EINTR is defined.
2538 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2539 Assume EIO and EAGAIN are defined.
2540 * unexcoff.c (write_segment): Assume EFAULT is defined.
2541
2542 2012-11-27 Eli Zaretskii <eliz@gnu.org>
2543
2544 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2545 (Bug#11964)
2546
2547 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2548 highlighting on the frame was cleared. Prevents assertion
2549 violations when repeatedly clicking on the "Top" link of the
2550 "bread-crumbs" in Info buffers.
2551
2552 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2553
2554 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2555
2556 2012-11-24 Ken Brown <kbrown@cornell.edu>
2557
2558 * keyboard.c (HAVE_MOUSE):
2559 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2560 were always defined.
2561
2562 2012-11-24 Eli Zaretskii <eliz@gnu.org>
2563
2564 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2565 between bpos_covered and bpos_max. This fixes cursor display when
2566 several display strings follow each other.
2567
2568 * .gdbinit (pgx): If the glyph's object is a string, display the
2569 pointer to string data, rather than the value of the string object
2570 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2571
2572 * indent.c (Fvertical_motion): If the starting position is covered
2573 by a display string, return to one position before that, to avoid
2574 overshooting it inside move_it_to. (Bug#12930)
2575
2576 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2577
2578 * frame.h (struct frame): Remove display_preempted member
2579 since all users are dead long ago.
2580 * nsterm.h (struct x_output): Use the only dummy member.
2581 * w32menu.c (pending_menu_activation): Remove since not
2582 really used.
2583 (set_frame_menubar): Adjust user.
2584 * w32term.h (struct x_output): Drop outdated #if 0 code.
2585 (struct w32_output): Use bitfields for explicit_parent,
2586 asked_for_visible and menubar_active members.
2587 Drop unused pending_menu_activation member.
2588 * xterm.h (struct x_output): Drop outdated #if 0 code.
2589 Use bitfields for explicit_parent, asked_for_visible,
2590 has_been_visible and net_wm_state_hidden_seen members.
2591
2592 2012-11-23 Eli Zaretskii <eliz@gnu.org>
2593
2594 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2595 of a literal "/". (Bug#12955)
2596 (gl-stamp): Invoke fc.exe directly, not through cmd.
2597
2598 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2599
2600 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2601 * dired.c: Assume HAVE_DIRENT_H.
2602 (NAMLEN): Remove, replacing with ...
2603 (dirent_namelen): New function. All uses changed. Use the GNU macro
2604 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2605 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2606 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2607 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2608 $(NT_INC)/dirent.h.
2609 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2610 * ndir.h: Rename to ../nt/inc/dirent.h.
2611 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2612 Do not include <dirent.h>; no longer needed.
2613 * w32.c: Include <dirent.h> rather than "ndir.h".
2614
2615 2012-11-23 Chong Yidong <cyd@gnu.org>
2616
2617 * xftfont.c (xftfont_open): Remove duplicate assignment.
2618
2619 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2620
2621 * alloc.c (Fgarbage_collect): Unblock input after clearing
2622 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2623 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2624 * msdos.c (IT_frame_up_to_date): Use it here...
2625 * w32term.c (w32_frame_up_to_date): ...here...
2626 * xterm.c (XTframe_up_to_date): ...and here...
2627 * nsterm.m (ns_frame_up_to_date): ...but not here.
2628 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2629 Adjust users.
2630 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2631 Do not check whether GC is in progress.
2632
2633 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2634
2635 * xdisp.c (window_buffer_changed): New function.
2636 (update_menu_bar, update_tool_bar): Use it to
2637 simplify large 'if' statements.
2638 (redisplay_internal): Generalize commonly used
2639 'tail' and 'frame' local variables.
2640
2641 2012-11-22 Eli Zaretskii <eliz@gnu.org>
2642
2643 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2644 with Windows system header.
2645
2646 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2647
2648 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2649 * alloc.c: Assume unistd.h exists.
2650 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2651 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2652 (getwd) [USG]: Remove; no longer needed.
2653 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2654 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2655 * w32.h (getcwd): Remove decl.
2656
2657 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2658
2659 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2660 Make it set selected_window as well.
2661 (update_tool_bar): Use it.
2662
2663 2012-11-21 Ken Brown <kbrown@cornell.edu>
2664
2665 * emacs.c (main): Set the G_SLICE environment variable for all
2666 Cygwin builds, not just GTK builds. See
2667 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2668
2669 2012-11-21 Eli Zaretskii <eliz@gnu.org>
2670
2671 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2672 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2673 Define for the MSVC compiler.
2674
2675 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2676
2677 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2678 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2679 dostounix_filename. Prevents crashes down the road, because
2680 dostounix_filename assumes it gets a unibyte string.
2681 Reported by Michel de Ruiter <michel@sentient.nl>, see
2682 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2683
2684 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2685
2686 Conflate Qnil and Qunbound for `symbol-function'.
2687 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2688 * lread.c (init_obarray): Set `function' fields to Qnil.
2689 * eval.c (Fcommandp): Ignore Qunbound.
2690 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2691 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2692 Test NILP rather than Qunbound.
2693 (Ffmakunbound): Set to Qnil.
2694 (Fsymbol_function): Never signal an error.
2695 (Finteractive_form): Ignore Qunbound.
2696
2697 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2698
2699 * eval.c (interactive_p): Remove no-longer-used decl.
2700
2701 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2702
2703 * xdisp.c (buffer_shared): Adjust comment.
2704 (buffer_shared_and_changed): New function.
2705 (prepare_menu_bars, redisplay_internal): Use it to
2706 decide whether all windows or frames should be updated.
2707 (window_outdated): New function.
2708 (text_outside_line_unchanged_p, redisplay_window): Use it.
2709 (redisplay_internal): Likewise. Fix indentation.
2710
2711 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2712
2713 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2714 (syms_of_eval): Remove corresponding defsubr.
2715 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2716
2717 2012-11-19 Daniel Colascione <dancol@dancol.org>
2718
2719 * w32fns.c (Fx_file_dialog):
2720 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2721 cygwin_convert_file_name*.
2722
2723 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2724 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2725
2726 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2727
2728 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2729
2730 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2731
2732 * w32select.c: Include w32common.h before w32term.h, so that
2733 windows.h gets included before w32term.h uses some of its
2734 features, see below.
2735
2736 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2737 New typedefs.
2738 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2739 New prototypes.
2740 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2741
2742 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
2743
2744 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2745 (ns_select): Return at once if events are held (Bug#12834).
2746
2747 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
2748
2749 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2750 Needed following 2012-10-20 change. (Bug#12902)
2751
2752 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
2753
2754 * w32proc.c (waitpid): Remove unused label get_result.
2755
2756 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
2757
2758 * makefile.w32-in (SYSWAIT_H): New macro.
2759 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2760 ($(BLD)/sysdep.$(O)): Update dependencies.
2761
2762 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2763
2764 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2765 * callproc.c (relocate_fd): Assume F_DUPFD.
2766 * emacs.c, term.c (O_RDWR): Remove.
2767 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2768 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2769 * nsterm.m: Assume <fcntl.h> exists.
2770 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2771 (create_pty, Fmake_network_process, server_accept_connection)
2772 (wait_reading_process_output, init_process_emacs):
2773 Assume O_NONBLOCK.
2774 (wait_reading_process_output): Put in a special case for WINDOWSNT
2775 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2776 It's not clear this is needed, but it's a more-conservative change.
2777 (create_process): Assume FD_CLOEXEC.
2778 (create_process, create_pty): Assume O_NOCTTY.
2779 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2780 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2781 Omit if not DOS_NT, since F_GETFL is not defined there.
2782 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2783 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2784 (O_NOCTTY): Remove.
2785 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2786 lack it, since gnulib guarantees this.
2787 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2788
2789 2012-11-17 Eli Zaretskii <eliz@gnu.org>
2790
2791 * w32.c (faccessat): Pretend that directories have the execute bit
2792 set. Emacs expects that, e.g., in files.el:cd-absolute.
2793
2794 * w32proc.c (create_child): Don't clip the PID of the child
2795 process to fit into an Emacs integer, as this is no longer a
2796 restriction.
2797 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2798 reaping only the process specified by PID argument, if that is
2799 positive. Use PID instead of dead_child to know which process to
2800 reap. Wait for the child to die only if WNOHANG is not in
2801 OPTIONS.
2802 (sys_select): Don't set dead_child.
2803
2804 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2805 as it is no longer needed.
2806
2807 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2808 no longer needed.
2809 (record_child_status_change): Remove the setting of
2810 record_at_most_one_child for the !WNOHANG case.
2811
2812 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2813
2814 Fix problems in ns port found by static checking.
2815 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2816 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2817 not to process group.
2818 (ns_select): Use emacs_write, not write, as that's more robust
2819 in the presence of signals.
2820 (fd_handler:): Check for read errors.
2821
2822 2012-11-16 Glenn Morris <rgm@gnu.org>
2823
2824 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2825
2826 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
2827
2828 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2829
2830 2012-11-16 Eli Zaretskii <eliz@gnu.org>
2831
2832 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2833 use the same value of thread handle.
2834 (start_timer_thread): If the timer thread exited (due to error),
2835 clean up by closing the two handles it used. Duplicate the caller
2836 thread's handle here, so it gets duplicated only once, when
2837 launching the timer thread. Set priority of the timer thread, not
2838 the caller thread.
2839 (getitimer): Don't duplicate the caller thread's handle here.
2840 (Bug#12832)
2841
2842 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
2843
2844 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2845 called (Bug#12834).
2846
2847 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2848
2849 Remove no-longer-used pty_max_bytes variable.
2850 * process.c (pty_max_bytes): Remove; unused.
2851 (send_process): Do not set it.
2852
2853 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
2854
2855 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2856 Update dependencies.
2857
2858 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2859
2860 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2861 This follows up on the 2012-09-29 patch that removed indirection
2862 for the 'function' field. Reported by Sergey Vinokurov in
2863 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2864
2865 2012-11-14 Eli Zaretskii <eliz@gnu.org>
2866
2867 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2868 different name, as the MS runtime does not have such a function,
2869 and probably never will.) All callers changed. Ignore DIRFD
2870 value if PATH is an absolute file name, to match Posix spec
2871 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2872 symlinks.
2873
2874 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2875
2876 * xdisp.c (echo_area_display, redisplay_internal):
2877 Omit redundant check whether frame_garbaged is set.
2878
2879 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2880
2881 Use faccessat, not access, when checking file permissions (Bug#12632).
2882 This fixes a bug that has been present in Emacs since its creation.
2883 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2884 which must set some sort of record. (Torek's bug report was against
2885 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2886 same common flaw.) See Torek's Usenet posting
2887 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2888 Posted: Fri Apr 8 14:18:56 1983.
2889 * Makefile.in (LIB_EACCESS): New macro.
2890 (LIBES): Use it.
2891 * callproc.c (init_callproc):
2892 * charset.c (init_charset):
2893 * fileio.c (check_existing, check_executable, check_writable)
2894 (Ffile_readable_p):
2895 * lread.c (openp, load_path_check):
2896 * process.c (allocate_pty):
2897 * xrdb.c (file_p):
2898 Use effective UID when checking permissions, not real UID.
2899 * callproc.c (init_callproc):
2900 * charset.c (init_charset):
2901 * lread.c (load_path_check, init_lread):
2902 Test whether directories are accessible, not merely whether they exist.
2903 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2904 * fileio.c (check_existing, check_executable, check_writable)
2905 (Ffile_readable_p):
2906 Use symbolic names instead of integers for the flags, as they're
2907 portable now.
2908 (check_writable): New arg AMODE. All uses changed.
2909 Set errno on failure.
2910 (Ffile_readable_p): Use faccessat, not stat + open + close.
2911 (Ffile_writable_p): No need to call check_existing + check_writable.
2912 Just call check_writable and then look at errno. This saves a syscall.
2913 dir should never be nil; replace an unnecessary runtime check
2914 with an eassert. When checking the parent directory of a nonexistent
2915 file, check that the directory is searchable as well as writable, as
2916 we can't create files in unsearchable directories.
2917 (file_directory_p): New function, which uses 'stat' on most platforms
2918 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2919 (Ffile_directory_p, Fset_file_times): Use it.
2920 (file_accessible_directory_p): New function, which uses a single
2921 syscall for efficiency.
2922 (Ffile_accessible_directory_p): Use it.
2923 * xrdb.c (file_p): Use file_directory_p.
2924 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2925 * lread.c (openp): When opening a file, use fstat rather than
2926 stat, as that avoids a permissions race. When not opening a file,
2927 use file_directory_p rather than stat.
2928 (dir_warning): First arg is now a usage string, not a format.
2929 Use errno. All uses changed.
2930 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2931 that merely introduced a race.
2932 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2933 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2934 and similarly for the other O_* flags.
2935 * w32.c (sys_faccessat): Rename from sys_access and switch to
2936 faccessat's API. All uses changed.
2937 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2938 (magic_db): Rename from magic_file_p.
2939 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2940 char *, so that we don't have to test for file existence
2941 separately from opening the file for reading. This removes a race
2942 fixes a permission-checking problem, and simplifies the code.
2943 All uses changed.
2944 (file_p): Remove; no longer needed.
2945
2946 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2947
2948 Omit glyphs initialization at startup.
2949 * dispnew.c (glyphs_initialized_initially_p): Remove.
2950 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2951 (Fredraw_frame): Move actual code from here...
2952 (redraw_frame): ...to here. Add eassert. Adjust comment.
2953 (Fredraw_display): Use redraw_frame.
2954 * xdisp.c (clear_garbaged_frames): Likewise.
2955
2956 2012-11-13 Eli Zaretskii <eliz@gnu.org>
2957
2958 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2959 passed to pint2str and pint2hrstr to be at most the size of the
2960 frame's decode_mode_spec_buffer. This avoids crashes with very
2961 large values of FIELD_WIDTH argument to decode_mode_spec.
2962 (Bug#12867)
2963
2964 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2965
2966 Fix a race with verify-visited-file-modtime (Bug#12863).
2967 Since at least 1991 Emacs has ignored an mtime difference of no
2968 more than one second, but my guess is that this was to work around
2969 file system bugs that were fixed long ago. Since the race is
2970 causing problems now, let's remove that code.
2971 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2972 whose time stamp is off by no more than a second. Insist that the
2973 file time stamps match exactly.
2974
2975 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2976
2977 * frame.h (struct frame): Convert external_tool_bar member to
2978 1-bit unsigned bitfield.
2979 * termhooks.h (struct terminal): Remove mouse_moved member since
2980 all users are long dead. Adjust comment on mouse_position_hook.
2981
2982 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2983
2984 Simplify by using FOR_EACH_FRAME here and there.
2985 * frame.c (next_frame, prev_frame, other_visible_frames)
2986 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2987 * w32term.c (x_window_to_scroll_bar): Likewise.
2988 * window.c (window_list): Likewise.
2989 * xdisp.c (x_consider_frame_title): Likewise.
2990 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2991 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2992 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2993 * xmenu.c (menubar_id_to_frame): Likewise.
2994 * xselect.c (frame_for_x_selection): Likewise.
2995 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2996 (x_window_to_menu_bar): Likewise.
2997 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2998
2999 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3000
3001 * data.c (Qdefalias_fset_function): Now static.
3002
3003 Another tweak to vectorlike_header change.
3004 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3005 Remove, and replace all uses with ...
3006 (next_in_free_list, set_next_in_free_list):
3007 New functions, which respect C's aliasing rules better.
3008
3009 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3010
3011 * window.c (list4i): Rename from 'quad'. All uses changed.
3012 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3013
3014 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
3015
3016 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3017 warning about mixing declarations and code in ISO C90.
3018
3019 2012-11-10 Martin Rudalics <rudalics@gmx.at>
3020
3021 * window.c (Fsplit_window_internal): Set combination limit of
3022 new parent window to t iff Vwindow_combination_limit is t;
3023 fixing a regression introduced with the change from 2012-09-22.
3024 (Fset_window_combination_limit): Fix doc-string.
3025
3026 2012-11-10 Eli Zaretskii <eliz@gnu.org>
3027
3028 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3029 amount when the scroll margins are too large. When scrolling
3030 backwards in the buffer, give up if cannot reach point or the
3031 scroll margin within a reasonable number of screen lines.
3032 Fixes point position in window under scroll-up/down-aggressively when
3033 point is positioned many lines beyond the window top/bottom.
3034 (Bug#12811)
3035
3036 * ralloc.c (relinquish): If real_morecore fails to return memory
3037 to the system, don't crash; instead, leave the last heap
3038 unchanged and return. (Bug#12774)
3039
3040 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3041
3042 * lisp.h (AUTOLOADP): New macro.
3043 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3044 * data.c (Ffset): Remove special ad-advice-info handling.
3045 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3046 (Fsubr_arity): CSE.
3047 (Finteractive_form): Simplify.
3048 (Fquo): Don't insist on having at least 2 arguments.
3049 (Qdefalias_fset_function): New var.
3050
3051 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3052
3053 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3054
3055 * nsfont.m (Qcondensed, Qexpanded): New variables.
3056 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3057 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3058
3059 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3060
3061 Fix recently introduced crash on MS-Windows (Bug#12839).
3062 * w32term.h (struct scroll_bar): Use convenient header.
3063 (SCROLL_BAR_VEC_SIZE): Remove.
3064 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3065
3066 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3067
3068 Tweak last vectorlike_header change.
3069 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3070 vectorlike object on the free list. This is introduced to avoid
3071 some (but not all) pointer casting and aliasing problems, see
3072 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3073 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3074 objects.
3075 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3076
3077 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3078
3079 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3080 been removed, so remove them here also.
3081
3082 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3083
3084 * doc.c (Fdocumentation): Handle new property
3085 dynamic-docstring-function to replace the old ad-advice-info.
3086
3087 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3088
3089 * fns.c (Qeql, hashtest_eq): Now static.
3090
3091 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3092
3093 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3094 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3095 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3096 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3097
3098 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3099
3100 Use same hash function for hashfn_profiler as for hash_string etc.
3101 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3102 * lisp.h (sxhash_combine): New inline function, with the contents
3103 of the old SXHASH_COMBINE.
3104 * profiler.c (hashfn_profiler): Use it, instead of having a
3105 special hash function containing a comparison that always yields 1.
3106
3107 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3108
3109 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3110 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3111 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3112 Remove unused vars.
3113
3114 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3115
3116 * image.c (xpm_make_color_table_h): Fix compiler error because
3117 make_hash_table changed.
3118
3119 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
3120
3121 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3122
3123 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3124
3125 Use ad-hoc comparison function for the profiler's hash-tables.
3126 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3127 (make_log): Use them.
3128 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3129 call Fequal any more.
3130 (Ffunction_equal): New function.
3131 (cmpfn_profiler, hashfn_profiler): New functions.
3132 (syms_of_profiler): Initialize them.
3133 * lisp.h (struct hash_table_test): New struct.
3134 (struct Lisp_Hash_Table): Use it.
3135 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3136 * fns.c (make_hash_table): Take a struct to describe the test.
3137 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3138 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3139 (hash_lookup, hash_remove_from_table): Move assertion checking of
3140 hashfn result here. Check hash-equality before calling cmpfn.
3141 (Fmake_hash_table): Adjust call to make_hash_table.
3142 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3143 (syms_of_fns): Initialize them.
3144 * emacs.c (main): Move syms_of_fns earlier.
3145 * xterm.c (syms_of_xterm):
3146 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3147 * print.c (print_object): Adjust to new hash-table struct.
3148 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3149
3150 2012-11-08 Eli Zaretskii <eliz@gnu.org>
3151
3152 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3153 value of w32-scroll-lock-modifier is neither nil nor one of the
3154 known key modifiers. (Bug#12806)
3155
3156 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3157
3158 Shrink struct vectorlike_header to the only size field.
3159 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3160 Adjust comment.
3161 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3162 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3163 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3164 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3165 information from the vector header. Adjust comment.
3166 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3167 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3168 layout.
3169 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3170 (struct vectorlike_header): Remove next member. Adjust comment.
3171 (struct Lisp_Subr): Add convenient header. Adjust comment.
3172 (allocate_pseudovector): Adjust prototype.
3173 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3174 (sweep_string, lisp_malloc): Remove useless prototypes.
3175 (enum mem_type): Adjust comment.
3176 (NEXT_IN_FREE_LIST): New macro.
3177 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3178 (Fmake_bool_vector): Likewise.
3179 (struct large_vector): New type to represent allocation unit for
3180 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3181 (large_vectors): Change type to struct large_vector.
3182 (allocate_vector_from_block): Simplify.
3183 (PSEUDOVECTOR_NBYTES): Replace with...
3184 (vector_nbytes): ...new function. Adjust users.
3185 (sweep_vectors): Adjust processing of large vectors.
3186 (allocate_vectorlike): Likewise.
3187 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3188 Add easserts. Adjust XSETPVECTYPESIZE usage.
3189 (allocate_buffer): Use BUFFER_PVEC_INIT.
3190 (live_vector_p): Adjust to match large vector.
3191 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3192 * buffer.h (struct buffer): Add next member.
3193 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3194 New macros.
3195 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3196 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3197 (copy_hash_table): Adjust to match vector header change.
3198 * lread.c (defsubr): Use XSETPVECTYPE.
3199 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3200 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3201 (xvecsize): New command.
3202
3203 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3204
3205 * keyboard.c (event_to_kboard): Do not dereference
3206 frame_or_window field of SELECTION_REQUEST_EVENT
3207 and SELECTION_CLEAR_EVENT events (Bug#12814).
3208 * xterm.h (struct selection_input_event): Adjust comment.
3209
3210 2012-11-07 Eli Zaretskii <eliz@gnu.org>
3211
3212 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3213 such as Scroll Lock, if the respective keys are treated as
3214 function keys, not as modifiers. This avoids destroying non-ASCII
3215 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
3216
3217 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3218
3219 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3220
3221 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3222
3223 Restore some duplicate definitions (Bug#12814).
3224 This undoes part of the 2012-11-03 changes. Some people build
3225 with plain -g rather than with -g3, and they need the duplicate
3226 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3227 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3228 Define as macros, as well as as enums or as constants.
3229
3230 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3231
3232 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3233 to keypad keys (Bug#12816).
3234
3235 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3236
3237 Minor adjustments of recently-changed frame functions.
3238 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3239 known to be a frame (we're in the FRAMEP branch).
3240 * lisp.h (Qframep): Remove decl. frame.h declares this.
3241 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3242 since they're meant for Lisp fixnum values.
3243
3244 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3245
3246 * window.c (Fwindow_combination_limit): Revert to the only
3247 required argument and adjust docstring as suggested in
3248 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3249 by Martin Rudalics <rudalics@gmx.at>.
3250
3251 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3252
3253 Widely used frame validity and checking functions.
3254 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3255 * frame.c (decode_live_frame, decode_any_frame): New functions.
3256 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3257 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3258 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3259 (Fframe_pointer_visible_p): Use decode_any_frame.
3260 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3261 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3262 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3263 (Fframe_focus): Likewise. Allow zero number of arguments.
3264 Adjust docstring.
3265 (frame_buffer_list, frame_buffer_predicate): Remove.
3266 * lisp.h (frame_buffer_predicate): Remove prototype.
3267 * buffer.c (Fother_buffer): Use decode_any_frame.
3268 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3269 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3270 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3271 (Fclose_font, Ffont_info): Use decode_live_frame.
3272 * fontset.c (check_fontset_name): Likewise.
3273 * terminal.c (Fframe_terminal): Likewise.
3274 * w32fns.c (check_x_frame): Likewise.
3275 * window.c (Fminibuffer_window, Fwindow_at)
3276 (Fcurrent_window_configuration): Likewise.
3277 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3278 Likewise. Allow zero number of arguments. Adjust docstring.
3279 * dispnew.c (Fredraw_frame): Likewise.
3280 * xfaces.c (frame_or_selected_frame): Remove.
3281 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3282 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3283 (Fframe_face_alist): Use decode_live_frame.
3284 * xfns.c (check_x_frame): Likewise.
3285
3286 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3287
3288 * window.c (quad): New function.
3289 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3290 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3291 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3292 (Fwindow_line_height): Use it.
3293 (Fwindow_fringes): Use list3.
3294 (Fwindow_scroll_bars): Use list4.
3295 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3296 (Fwindow_combination_limit): Allow zero number of arguments.
3297
3298 2012-11-05 Eli Zaretskii <eliz@gnu.org>
3299
3300 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3301
3302 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3303 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3304 file descriptor 2 for standard error. (Bug#12805)
3305
3306 2012-11-05 Chong Yidong <cyd@gnu.org>
3307
3308 * process.c (wait_reading_process_output): Revert previous change.
3309
3310 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3311
3312 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3313 This removes code that has been obsolete since around 1990.
3314 * callproc.c (Fcall_process):
3315 * emacs.c (main):
3316 * process.c (create_process):
3317 * term.c (dissociate_if_controlling_tty):
3318 Assume setsid exists.
3319 * callproc.c (child_setup): Assume setpgid exists and behaves as
3320 per POSIX.1-1988 or later.
3321 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3322 * emacs.c (shut_down_emacs):
3323 * sysdep.c (sys_suspend, init_foreground_group):
3324 Assume getpgrp behaves as per POSIX.1-1998 or later.
3325 * msdos.c (setpgrp): Remove.
3326 (tcgetpgrp, setpgid, setsid): New functions.
3327 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3328 * term.c (no_controlling_tty): Remove; unused.
3329 * w32proc.c (setpgrp): Remove.
3330 (setsid, tcgetpgrp): New functions.
3331
3332 Simplify by assuming __fpending.
3333 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3334 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3335 Do not assume that __fpending's result fits in int.
3336
3337 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3338
3339 Remove EMACS_OUTQSIZE+sleep hack.
3340 * dispnew.c (update_frame_1): Remove hack for terminals slower
3341 than 2400 bps, which throttled Emacs by having it sleep.
3342 This code hasn't worked since at least 2007, when the multi-tty stuff
3343 was added, and anyway those old terminals are long dead.
3344 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3345 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3346
3347 Fix data-loss with --version (Bug#9574).
3348 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3349 as we can't assume that emacs_strerror is initialized, and strerror
3350 is good enough here.
3351 (main): Invoke atexit earlier, to catch earlier instances of
3352 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3353
3354 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3355
3356 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3357 (keyDown): Remap keypad keys to X11 virtual key codes.
3358
3359 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3360
3361 Fix data-loss with --batch (Bug#9574).
3362 * emacs.c: Include <close-stream.h>.
3363 (close_output_streams): New function.
3364 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3365 and handles errors appropriately.
3366 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3367 does that now.
3368
3369 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3370 The symptom is a diagnostic "GLib-WARNING **: In call to
3371 g_spawn_sync(), exit status of a child process was requested but
3372 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3373 waitpid(), so exit status can't be returned." The diagnostic
3374 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3375 The real bug is a race condition between Emacs and glib: Emacs
3376 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3377 so that glib can't find it. Work around the bug by invoking
3378 waitpid only on subprocesses that Emacs itself creates.
3379 * process.c (create_process, record_child_status_change):
3380 Don't use special value -1 in pid field, as the caller now must
3381 know the pid rather than having the callee infer it.
3382 The inference was sometimes incorrect anyway, due to another race.
3383 (create_process): Set new 'alive' member if child is created.
3384 (process_status_retrieved): New function.
3385 (record_child_status_change): Use it.
3386 Accept negative 1st argument, which means to wait for the
3387 processes that Emacs already knows about. Move special-case code
3388 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3389 processes that have already been waited for, by testing and
3390 clearing new 'alive' member.
3391 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3392 now does this internally.
3393 (handle_child_signal): Let record_child_status_change do all
3394 the work, since we do not want to reap all exited child processes,
3395 only the child processes that Emacs itself created.
3396 * process.h (Lisp_Process): New boolean member 'alive'.
3397
3398 Omit duplicate definitions no longer needed with gcc -g3.
3399 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3400 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3401 Define only as macros. There's no longer any need to also define
3402 these symbols as enums or as constants, since we now assume
3403 gcc -g3 when debugging.
3404
3405 2012-11-03 Eli Zaretskii <eliz@gnu.org>
3406
3407 * lisp.mk: Adjust comments to the fact that term/internal is now
3408 loaded from loadup.el.
3409
3410 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3411 (msdos_fatal_signal): New function.
3412 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3413 its argument list.
3414
3415 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3416 for GCC versions before 4.
3417 (emacs_raise): Define to call msdos_fatal_signal.
3418
3419 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3420 iterator when starting in the middle of a display or overlay
3421 string. (Bug#12745)
3422
3423 2012-11-03 Chong Yidong <cyd@gnu.org>
3424
3425 * process.c (wait_reading_process_output): Clean up the last
3426 change.
3427
3428 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3429
3430 * process.c (wait_reading_process_output): Avoid a race condition
3431 with SIGIO delivery (Bug#11536).
3432
3433 2012-11-03 Chong Yidong <cyd@gnu.org>
3434
3435 * buffer.c (cursor_type): Untabify docstring.
3436
3437 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3438
3439 * frame.h (struct frame): Drop can_have_scroll_bars member
3440 which is meaningless for a long time. Adjust comments.
3441 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3442 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3443
3444 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3445
3446 * window.c (decode_next_window_args): Update window arg after
3447 calling decode_live_window and so fix crash reported at
3448 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3449 by Juanma Barranquero <lekktu@gmail.com>.
3450 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3451 * font.c (Ffont_at): Likewise.
3452
3453 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3454
3455 * widget.c (resize_cb): New function.
3456 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3457 (EmacsFrameResize): Check if all is up to date before changing frame
3458 size.
3459
3460 2012-11-02 Eli Zaretskii <eliz@gnu.org>
3461
3462 Implement backtrace output for fatal errors on MS-Windows.
3463 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3464 (BACKTRACE_LIMIT_MAX): New macro.
3465 (w32_backtrace): New function.
3466 (emacs_abort): Use w32_backtrace when the user chooses not to
3467 attach a debugger. Update the text of the abort dialog.
3468
3469 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3470
3471 Window-related stuff cleanup here and there.
3472 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3473 Use decode_any_window.
3474 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3475 * xdisp.c (Fformat_mode_line): Likewise.
3476 * font.c (Ffont_at): Use decode_live_window.
3477 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3478 * window.c (decode_next_window_args): Likewise.
3479 (decode_any_window): Remove static.
3480 * window.h (decode_any_window): Add prototype.
3481 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3482 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3483 respectively.
3484
3485 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3486
3487 Remove pad from struct input_event.
3488 * termhooks.h (struct input_event): Remove padding field.
3489 Adjust comment.
3490 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3491 member is never cons for a long time. Adjust comment.
3492 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3493 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3494 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3495 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3496
3497 2012-11-01 Eli Zaretskii <eliz@gnu.org>
3498
3499 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3500
3501 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3502
3503 Fix crash when using Emacs as commit editor for git (Bug#12697).
3504 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3505 and it is configured in conf_post.h.
3506 (Fcall_process): Don't invoke both setsid and setpgid; the former
3507 is enough, if it exists.
3508 * callproc.c (Fcall_process, child_setup):
3509 * process.c (create_process): Use setpgid.
3510 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3511 for the real thing.
3512 * dispnew.c (init_display): Initialize the foreground group
3513 if we are running a tty display.
3514 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3515 * lisp.h (init_foreground_group): New decl.
3516 * sysdep.c (inherited_pgroup): New static var.
3517 (init_foreground_group, tcsetpgrp_without_stopping)
3518 (narrow_foreground_group, widen_foreground_group): New functions.
3519 (init_sys_modes): Narrow foreground group.
3520 (reset_sys_modes): Widen foreground group.
3521
3522 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
3523
3524 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3525
3526 2012-10-31 Martin Rudalics <rudalics@gmx.at>
3527
3528 * minibuf.c (read_minibuf): Restore current buffer since
3529 choose_minibuf_frame calling Fset_frame_selected_window may
3530 change it (Bug#12766).
3531
3532 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3533
3534 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3535
3536 2012-10-30 Kenichi Handa <handa@gnu.org>
3537
3538 * font.c (Ffont_at): If WINDOW is specified and it is not
3539 displaying the current buffer, signal an error.
3540
3541 2012-10-29 Daniel Colascione <dancol@dancol.org>
3542
3543 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3544 In preparation for fixing bug#12739, move these functions from
3545 here...
3546
3547 * coding.h, coding.c: ... to here, and compile them only when
3548 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3549 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
3550
3551 2012-10-28 Eli Zaretskii <eliz@gnu.org>
3552
3553 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3554 (timer_loop, getitimer, setitimer): Use it instead of
3555 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3556 'clock'.
3557 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3558 literal 10000.
3559
3560 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3561
3562 * nsterm.m (NO_APPDEFINED_DATA): New define.
3563 (last_appdefined_event_data): New variable
3564 (last_appdefined_event): Remove.
3565 (ns_select): Initialize t from last_appdefined_event_data instead
3566 of [last_appdefined_event data1].
3567 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3568 remove last_appdefined_event (Bug#12698).
3569
3570 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3571
3572 * frame.c (x_set_font): Catch internal error.
3573
3574 2012-10-27 Eli Zaretskii <eliz@gnu.org>
3575
3576 Avoid overflow in w32 implementation of interval timers.
3577 When possible, for ITIMER_PROF count only times the main thread
3578 actually executes.
3579 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
3580 'volatile ULONGLONG' types. All the other data which was
3581 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
3582 (GetThreadTimes_Proc): New typedef.
3583 (w32_get_timer_time): New function, returns a suitable time value
3584 for the timer.
3585 (timer_loop): Enter critical section when accessing ULONGLONG
3586 values of the itimer_data struct, as these accesses are no longer
3587 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3588 Remove unused variable.
3589 (init_timers): Initialize s_pfn_Get_Thread_Times.
3590 (start_timer_thread): Don't assign itimer->caller_thread here.
3591 (getitimer): Assign itimer->caller_thread here.
3592 (setitimer): Always call getitimer to get the value of ticks_now.
3593 (sys_spawnve): Avoid compiler warning about format mismatch.
3594
3595 2012-10-26 Eli Zaretskii <eliz@gnu.org>
3596
3597 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3598 mouse movement events if the menu bar is active. This avoids
3599 producing a busy "hour-glass" cursor by Windows if the mouse
3600 pointer is positioned over a tooltip shown for some menu item.
3601
3602 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3603
3604 Don't assume process IDs fit in int.
3605 * emacs.c (shut_down_emacs) [!DOS_NT]:
3606 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3607 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3608 Use pid_t, not int, to store process IDs, as 'int'
3609 is not wide enough on a few platforms (e.g., AIX and IRIX).
3610
3611 2012-10-23 Kenichi Handa <handa@gnu.org>
3612
3613 The following change is to make face-font-rescale-alist work
3614 correctly for non-ASCII fonts.
3615
3616 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3617 (font_open_for_lface): Handle Vface_font_rescale_alist.
3618
3619 2012-10-23 Chong Yidong <cyd@gnu.org>
3620
3621 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3622
3623 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3624
3625 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3626 for screen font.
3627 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3628
3629 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3630 event (Bug#12681).
3631
3632 2012-10-21 Glenn Morris <rgm@gnu.org>
3633
3634 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3635
3636 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3637
3638 Port to OpenBSD 5.1.
3639 * frame.c (Fmouse_position, Fmouse_pixel_position):
3640 * xdisp.c (produce_stretch_glyph):
3641 Declare local vars only when they're needed.
3642 This is clearer and avoids a warning on OpenBSD about unused vars.
3643 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3644 This is safer, and avoids OpenBSD warnings about unused vars.
3645 * keyboard.c (record_menu_key): Remove unnecessary decl.
3646 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3647 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3648 as our definition clashes with OpenBSD's.
3649 * xfaces.c (load_face_colors, check_lface_attrs)
3650 (get_lface_attributes_no_remap, get_lface_attributes)
3651 (lface_fully_specified_p, x_supports_face_attributes_p)
3652 (tty_supports_face_attributes_p, face_fontset, realize_face)
3653 (realize_x_face, realize_tty_face):
3654 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3655 merely Lisp_Object *. This is more informative and avoids
3656 a warning on OpenBSD about accessing beyond an object's size.
3657
3658 2012-10-20 Chong Yidong <cyd@gnu.org>
3659
3660 * lread.c (Fload): Doc fix (Bug#12592).
3661
3662 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3663
3664 * font.c (Ffont_at): Fix previous change.
3665
3666 2012-10-19 Eli Zaretskii <eliz@gnu.org>
3667
3668 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3669 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3670 for the reasons.
3671
3672 * alloc.c (NSTATICS): Decrease to 0x800.
3673
3674 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3675
3676 * fns.c (Fnreverse): Include the problem element when signaling an
3677 error (bug#12677).
3678
3679 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3680
3681 * nsterm.m (ns_select): Check writefds before call to
3682 FD_ISSET (Bug#12668).
3683
3684 2012-10-18 Daniel Colascione <dancol@dancol.org>
3685
3686 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3687 (staticpro): If we run out of staticpro slots, die with an
3688 informative error instead of just calling emacs_abort.
3689
3690 2012-10-18 Martin Rudalics <rudalics@gmx.at>
3691
3692 Fix two flaws reported by Dmitry Antipov.
3693 * window.c (Ftemp_output_buffer_show): Remove.
3694 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3695 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3696
3697 2012-10-17 Eli Zaretskii <eliz@gnu.org>
3698
3699 * makefile.w32-in ($(BLD)/w32.$(O)):
3700 ($(BLD)/vm-limit.$(O)):
3701 ($(BLD)/term.$(O)):
3702 ($(BLD)/unexw32.$(O)):
3703 ($(BLD)/fileio.$(O)):
3704 ($(BLD)/dispnew.$(O)): Update dependencies.
3705
3706 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3707 Add prototypes.
3708
3709 * w32proc.c: Include ctype.h.
3710
3711 * w32.h (init_environment, check_windows_init_file)
3712 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3713 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3714 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3715 (sys_link): Add prototypes.
3716
3717 * w32.c: Include w32select.h.
3718 (sys_access, e_malloc, sys_select): Add prototypes.
3719 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3720
3721 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3722
3723 * unexw32.c: Include lisp.h and w32.h.
3724
3725 * term.c [WINDOWSNT]: Include w32term.h.
3726
3727 * process.c [WINDOWSNT]: Add prototype of sys_select.
3728
3729 * fileio.c [WINDOWSNT]: Include w32.h.
3730
3731 * dispnew.c [WINDOWSNT]: Include w32.h.
3732
3733 * cygw32.c (Fcygwin_convert_path_to_windows)
3734 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3735 Lisp_Object values. (Bug#12661)
3736
3737 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3738 to Lisp_Object. (Bug#12661)
3739
3740 2012-10-17 Kenichi Handa <handa@gnu.org>
3741
3742 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3743 invalidate.
3744
3745 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3746
3747 * buffer.c (Fkill_buffer): When unchaining the marker,
3748 reset its buffer pointer to NULL (Bug#12652).
3749
3750 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3751
3752 Do not verify indirection counters of killed buffers (Bug#12579).
3753 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3754 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3755
3756 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3757
3758 * alloc.c (Fmake_byte_code): Fix typo in comment.
3759 * print.c (print_interval): Define as static to match prototype.
3760 * indent.c (disptab_matches_widthtab, recompute_width_table):
3761 Convert to eassert.
3762
3763 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3764
3765 * editfns.c (get_system_name): Remove.
3766 * lisp.h (get_system_name): Remove prototype.
3767 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3768 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3769
3770 2012-10-15 Daniel Colascione <dancol@dancol.org>
3771
3772 * dbusbind.c: Add comment explaining reason for previous change.
3773
3774 2012-10-15 Martin Rudalics <rudalics@gmx.at>
3775
3776 * window.c (Fwindow_end): Rewrite check whether cached position
3777 can be used (Bug#12600).
3778 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3779 Set windows_or_buffers_changed.
3780
3781 2012-10-15 Daniel Colascione <dancol@dancol.org>
3782
3783 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3784 enabled by undefining the symbol "interface", which the platform
3785 headers define to something incompatible.
3786
3787 2012-10-14 Daniel Colascione <dancol@dancol.org>
3788
3789 * image.c (init_tiff_functions, init_imagemagick_functions)
3790 (init_svg_functions): Fix cygw32 build break by using these
3791 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3792
3793 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3794
3795 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3796
3797 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3798
3799 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3800
3801 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3802
3803 * coding.c (detect_coding): Set coding->id before calling
3804 this->detector.
3805
3806 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3807
3808 * fileio.c: Formatting fixes.
3809
3810 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3811
3812 Fix some stat-related races.
3813 * fileio.c (Fwrite_region): Avoid race condition if a file is
3814 removed or renamed by some other process immediately after Emacs
3815 writes it but before Emacs stats it. Do not assume that stat (or
3816 fstat) succeeds.
3817 * image.c (slurp_file): Resolve the file name with fopen + fstat
3818 rather than stat + fopen.
3819 (pbm_read_file) [0]: Remove unused code with stat race.
3820 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3821 Remove ineffective code with stat race.
3822
3823 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3824
3825 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3826
3827 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3828
3829 * nsterm.m (hold_event_q): New static variable.
3830 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3831 ! q_event_ptr.
3832 (hold_event): New function.
3833 (ns_read_socket): If hold_event_q have events, store them and
3834 return (Bug#12384).
3835 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3836 is zero (Bug#12384).
3837
3838 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
3839
3840 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3841
3842 2012-10-12 Eli Zaretskii <eliz@gnu.org>
3843
3844 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3845
3846 * fileio.c (check_existing): New function.
3847 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3848 instead of calling 'stat', when what's needed is to check whether
3849 a file exists. This avoids expensive system calls on MS-Windows.
3850 (Bug#12587)
3851
3852 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
3853
3854 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3855 determine whether a file exists and is not a directory.
3856
3857 * lisp.h (check_existing): Add prototype.
3858
3859 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3860
3861 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3862
3863 2012-10-12 Glenn Morris <rgm@gnu.org>
3864
3865 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3866
3867 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3868
3869 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3870
3871 * eval.c (Fautoload): Remember previous autoload status in load-history.
3872
3873 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3874
3875 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3876 * lread.c (load_each_byte, new_backquote_flag, readchar)
3877 (read_filtered_event, lisp_file_lexically_bound_p)
3878 (safe_to_load_version, Fload, complete_filename_p, openp)
3879 (build_load_history, readevalloop, read_escape, read1)
3880 (string_to_number, read_vector, read_list):
3881 * macros.c (Fstart_kbd_macro):
3882 * marker.c (CONSIDER):
3883 * menu.c (parse_single_submenu, digest_single_submenu)
3884 (find_and_return_menu_selection, Fx_popup_menu):
3885 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3886 (Ftry_completion):
3887 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3888 (ns_menu_show):
3889 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3890 (xmenu_show, xdialog_show):
3891 Use bool for booleans.
3892 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3893 as it's not a predicate. All uses changed. Omit unnecessary
3894 buffer termination.
3895
3896 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3897
3898 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3899 (save_excursion_restore): Do not restore mark if it was not saved.
3900
3901 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3902
3903 * marker.c (cached_modiff): EMACS_INT, not int.
3904
3905 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3906 instead of having a wrong decl.
3907 * nsmenu.m (waiting_for_input): Remove wrong decl.
3908
3909 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3910
3911 keyboard.c, keymap.c: Use bool for booleans.
3912 * dispnew.c (sit_for): Distinguish between 3-way display_option
3913 and boolean do_display.
3914 * keyboard.c (single_kboard, this_command_key_count_reset)
3915 (waiting_for_input, echoing, immediate_quit, input_pending)
3916 (interrupt_input, interrupts_deferred, pop_kboard)
3917 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3918 (command_loop_1, adjust_point_for_property)
3919 (safe_run_hooks_error, input_polling_used, read_char):
3920 (help_char_p, readable_events, kbd_buffer_events_waiting)
3921 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3922 (lucid_event_type_list_p, get_input_pending):
3923 (gobble_input, menu_separator_name_p, menu_bar_item)
3924 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3925 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3926 (keyremap_step, test_undefined, read_key_sequence)
3927 (detect_input_pending, detect_input_pending_ignore_squeezables)
3928 (detect_input_pending_run_timers, requeued_events_pending_p)
3929 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3930 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3931 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3932 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3933 (accessible_keymaps_1, Fkey_description, push_key_description):
3934 (shadow_lookup, struct where_is_internal_data)
3935 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3936 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3937 (describe_map, describe_vector):
3938 * menu.c (single_menu_item):
3939 * nsmenu.m (ns_update_menubar):
3940 * process.c (wait_reading_process_output):
3941 * search.c (scan_buffer, scan_newline):
3942 Use bool for boolean.
3943 * keyboard.c (timers_run, swallow_events)
3944 (detect_input_pending_run_timers):
3945 * process.c (wait_reading_process_output):
3946 Use unsigned for counter where wraparound-on-overflow is desired,
3947 since unsigned is guaranteed to have that behavior and signed is not.
3948 (read_char): Use ptrdiff_t for string length.
3949 (get_input_pending): Remove first argument, since it was always
3950 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3951 and behave as if it had that value. Return new value of
3952 input_pending. All callers changed.
3953 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3954 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3955 a string length.
3956 * keymap.c (push_key_description): Omit last arg, which was always 1.
3957 All callers changed.
3958
3959 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3960
3961 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
3962
3963 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3964 ($(BLD)/term.$(O)): Update dependencies.
3965
3966 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3967
3968 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3969 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3970 initializer for PVEC_NORMAL_VECTOR.
3971
3972 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3973
3974 Clean out old termopts cruft.
3975 * termopts.h (flow_control, meta_key): Remove unused decls.
3976 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3977 Don't include termopts.h.
3978
3979 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3980
3981 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3982
3983 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3984
3985 * commands.h (immediate_quit): Remove duplicate decl.
3986
3987 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3988
3989 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3990 caching.
3991 (nsfont_open): Remove setting of Vfonts_in_cache.
3992 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
3993
3994 2012-10-09 Eli Zaretskii <eliz@gnu.org>
3995
3996 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3997 match what GetLastError returns. Explain why the function is
3998 needed.
3999
4000 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4001 'is_tooltip_frame', to avoid confusion with its global namesake.
4002
4003 2012-10-08 Daniel Colascione <dancol@dancol.org>
4004
4005 * xdisp.c (start_hourglass): Call w32_note_current_window when
4006 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4007 build that caused Emacs to display the hourglass cursor forever.
4008
4009 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4010 which is broken under remote desktop, calculate the number of
4011 colors available for a display based on the display's number of
4012 planes and number of bits per pixel per plane. (bug#10397).
4013
4014 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
4015
4016 * nsfont.m (Vfonts_in_cache): New variable.
4017 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4018 are used. Add cached fonts to Vfonts_in_cache.
4019 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4020
4021 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
4022
4023 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4024 in nt/config.nt.
4025 (FONT_H): Define after FRAME_H.
4026 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4027 Update dependencies.
4028
4029 * w32term.c: Remove leftover declaration of keyboard_codepage.
4030
4031 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4032
4033 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4034 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4035 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4036 (GLOBAL_SOURCES): Add cygw32.c.
4037 ($(BLD)/unexw32.$(O)):
4038 ($(BLD)/w32.$(O)):
4039 ($(BLD)/w32console.$(O)):
4040 ($(BLD)/w32fns.$(O)):
4041 ($(BLD)/w32heap.$(O)):
4042 ($(BLD)/w32menu.$(O)):
4043 ($(BLD)/w32proc.$(O)): Add w32common.h.
4044
4045 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4046 'const char *'.
4047 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4048
4049 2012-10-08 Daniel Colascione <dancol@dancol.org>
4050
4051 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4052 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4053 accidental message numbering hole. Change other messages to
4054 match.
4055
4056 * w32select.h (HAVE_W32SELECT): Remove.
4057
4058 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4059 w32common.h instead of w32heap.h.
4060
4061 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4062 (get_allocation_unit, get_processor_type, get_w32_major_version)
4063 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4064 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4065 (OS_NT, os_subtype, cache_system_info): Move declarations to
4066 w32common.
4067
4068 * w32heap.c: Include w32common.h.
4069 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4070 (w32_minor_version, w32_build_number, w32_subtype):
4071 Remove duplicate definitions.
4072
4073 * w32fns.c: Include w32common.h; include w32heap.h only in
4074 WINDOWSNT.
4075
4076 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4077 Use `report_file_error' instead of `error' in order to better
4078 inform users of what went wrong. Increase NTGUI_UNICODE file
4079 dialog box file name length to 32k, the maximum allowed by the NT
4080 kernel.
4081
4082 * w32common.h: New file.
4083 (ROUND_UP, ROUND_DOWN, get_page_size)
4084 (get_allocation_unit, get_processor_type, get_w32_major_version)
4085 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4086 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4087 (OS_NT, os_subtype, cache_system_info): Move here.
4088
4089 * unexw32.c, unexcw.c: Include w32common.h.
4090
4091 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4092 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4093 to call syms_of_w32select.
4094
4095 * cygw32.h: Remove obsolete EXFUN declarations.
4096
4097 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4098
4099 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4100 of w32inevt.o from SOME_MACHINE_OBJECTS.
4101
4102 2012-10-08 Daniel Colascione <dancol@dancol.org>
4103
4104 * image.c: Permanent fix for JPEG compilation issue --- limit
4105 jpeglib `boolean' redefinition to Cygwin builds.
4106
4107 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4108
4109 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4110
4111 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4112 Cygwin.
4113
4114 2012-10-08 Daniel Colascione <dancol@dancol.org>
4115
4116 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4117 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4118 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4119 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4120 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4121 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4122 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4123 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4124 now a supported configuration.
4125
4126 * Makefile.in: consolidate image variables into LIBIMAGE; add
4127 W32_OBJ and W32_LIBS. Compile new files.
4128
4129 * conf_post.h:
4130 (_DebPrint) declare tracing facility for W32 debugging. We need
4131 to unify tracing later.
4132
4133 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4134 unconditional use of W32 Unicode functions. Cygwin runs only on
4135 100% Unicode operating systems.
4136
4137 * cygw32.c: New file. Define Cygwin-specific facilities.
4138 (Fcygwin_convert_path_to_windows)
4139 (Fcygwin_convert_path_from_windows): New user functions for
4140 accessing Cygwin path-munging routines.
4141
4142 * cygw32.h: New file.
4143 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4144 UTF-16LE strings temporarily inside non-Lisp-visible string
4145 objects.
4146
4147 (w32_strerror): Just what it says on the tin.
4148
4149 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4150 also run for Cygwin; both systems have the same problem with using
4151 GUI facilities in a forked child. Also call syms_of_cygw32,
4152 syms_of_w32select in correct places.
4153
4154 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4155 needs fork-then-exec for daemon launching.
4156
4157 * font.h: Include frame.h.
4158
4159 * image.c: Use the image library cache machinery only when we're
4160 compiling for native WINDOWSNT; Cygwin can use shared libraries
4161 like any other Unixlike system.
4162
4163 * keyboard.c: Clarify a comment regarding the input loop.
4164
4165 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4166 functions directly instead of trying to detect at runtime that our
4167 host operating system supports them. We make this change for two
4168 reasons: Cygwin lacks support for the multibyte character
4169 conversion functions used by the legacy menu code, and Cygwin
4170 never needs to rely on non-Unicode APIs.
4171
4172 * unexw32.c (hinst): Declare extern.
4173
4174 * w32.c: Change header order;
4175 (w32_strerror): Move to w32fns.c because we need it for
4176 non-WINDOWSNT builds.
4177
4178 * w32.h: Add #error macro to make sure we don't include w32.h for
4179 Cygwin builds. Remove w32select declarations.
4180
4181 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
4182 w32fns.c. w32console.c is WINDOWSNT-only.
4183
4184 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4185 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4186 POSIXy alternative.
4187 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4188 (w32_major_version, w32_minor_version, w32_build_number)
4189 (os_subtype, sound_type): Define here
4190 (w32_defined_color): Make color parameter const for consistency
4191 with other _defined_color functions.
4192 (w32_createwindow): Unconditionally call w32_init_class instead of
4193 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4194 through the code is complex and unnecessary because class
4195 registration is practically free.
4196 (w32_name_of_message): New EMACSDEBUG-only function.
4197 (Fset_message_beep): Move here
4198 (Fx_open_connection): Require that the display name for Windows be
4199 "w32" for consistency, emacsclient disambiguation, and maybe, one
4200 day, multi-window-system support.
4201 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4202 Cygwin files for W32 GUI facilities, since these clearly don't
4203 expect Cygwin names.
4204 (_DebPrint): Define.
4205 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4206 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4207 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4208 (w32_last_error): Remove.
4209
4210 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4211
4212 * w32heap.c (syspage_mask): Declare here.
4213 (cache_system_info): Remove.
4214
4215 * w32inevt.c (faked_key): Define globally, not statically.
4216 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4217 (w32_console_toggle_lock_key): Move to w32fns.c.
4218
4219 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4220
4221 * w32proc.c (_DebPrint): Move to w32fns.c.
4222 * w32select.c: Include string.h, stdio.h for Cygwin.
4223 * w32select.h: New File.
4224
4225 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4226 get_osfhandle.
4227 (w32_message_fd): New variable. Under Cygwin, holds the file
4228 descriptor the system used to tell us about pending thread
4229 messages.
4230
4231 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4232 that prevented compilation under non-WINDOWSNT systems.
4233
4234 (w32_initialize): Open /dev/windows and assign it to
4235 w32_message_fd. Provide w32 feature.
4236
4237 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4238 (WM_EMACS_INPUT_READY): add.
4239 (prepend_msg, w32_message_fd): Declare globally.
4240
4241 * w32xfns.c:
4242 (keyboard_handle): Use only when WINDOWSNT.
4243 (notify_msg_ready): New function. Posts a message to the main
4244 thread's message queue under CYGWIN, which wakes up the main
4245 thread from select(2) by making the /dev/windows file descriptor
4246 ready. Under WINDOWSNT, it sets an event the same way the old
4247 code did.
4248
4249 (post, prepend_msg): Actually call notify_msg_ready instead of
4250 setting the input event directly.
4251
4252 2012-10-07 Eli Zaretskii <eliz@gnu.org>
4253
4254 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4255 but it still has blocs in it, don't return it to the system,
4256 instead of aborting. (Bug#12402)
4257
4258 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4259
4260 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4261
4262 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4263 MAC_OS_X_VERSION_10_6.
4264 (syms_of_nsterm): Remove comment about Panther and above for
4265 ns-antialias-text.
4266 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4267 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4268 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4269
4270 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4271 MAC_OS_X_VERSION_10_4.
4272
4273 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4274 MAC_OS_X_VERSION_10_2.
4275
4276 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4277
4278 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4279 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4280
4281 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4282 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4283 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4284 Remove ns_in_resize check.
4285 (ns_clear_frame_area): Remove resize handle code.
4286
4287 * nsfns.m (ns_in_resize): Remove.
4288 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4289 Remove ns_in_resize check.
4290
4291 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4292
4293 Improve sys_siglist detection.
4294 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4295 defined as a macro, as is done in Solaris.
4296 (sys_siglist_entries): New macro.
4297 (save_strsignal): Use it.
4298 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4299 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4300
4301 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4302
4303 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4304 fullscreen/Fullscreen.
4305
4306 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4307 tobar_height is new.
4308
4309 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4310 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4311 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4312 (windowDidResize:): Check for correct window if old style fullscreen.
4313 Capitalize word in comment. Remove incorrect comment.
4314 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4315 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4316 error in drawing background.
4317 (toggleFullScreen:): Remove comment. Rearrange calls.
4318 Set toolbar values to zero, save old height in tobar_height.
4319 Restore tool bar height when leaving fullscreen.
4320 (canBecomeMainWindow): New function.
4321
4322 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4323
4324 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4325
4326 2012-10-05 Eli Zaretskii <eliz@gnu.org>
4327
4328 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4329
4330 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4331 that time stamps of directories could also be changed.
4332 Don't request the too broad GENERIC_WRITE, only the more restrictive
4333 FILE_WRITE_ATTRIBUTES access rights.
4334
4335 * fileio.c (Fset_file_times): Special-case ignoring errors for
4336 directories only on MSDOS, not on MS-Windows.
4337
4338 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
4339
4340 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4341
4342 2012-10-04 Eli Zaretskii <eliz@gnu.org>
4343
4344 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4345 see whether CreateFile failed.
4346
4347 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4348
4349 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4350 to avoid similar races.
4351 * keyboard.c (pending_signals): Now bool, not int.
4352
4353 Port timers to OpenBSD, plus check for timer failures.
4354 OpenBSD problem reported by Han Boetes.
4355 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4356 and/or setitimer.
4357 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4358 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4359 like OpenBSD, which has timer_settime but does not declare it.
4360 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4361 whether to use itimerspec-related primitives. All uses of
4362 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4363
4364 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4365
4366 * profiler.c (handle_profiler_signal): Fix a malloc race
4367 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4368
4369 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4370
4371 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4372
4373 2012-10-02 Eli Zaretskii <eliz@gnu.org>
4374
4375 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4376 consistent with the change in return value of 'safe_strsignal'.
4377
4378 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4379
4380 Prefer plain 'static' to 'static inline' (Bug#12541).
4381 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4382 (bidi_set_sor_type, bidi_push_embedding_level)
4383 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4384 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4385 (bidi_cache_search, bidi_cache_ensure_space)
4386 (bidi_cache_iterator_state, bidi_cache_find)
4387 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4388 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4389 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4390 Now 'static', not 'static inline'.
4391
4392 Count overruns when profiling; change units to ns.
4393 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4394 Give extra weight to samples after overruns, to attempt to count
4395 the time more accurately.
4396 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4397 the underlying primitives nominally do ns.
4398 (Fprofiler_cpu_start): Document the change. Mention that
4399 the sampling intervals are only approximate.
4400
4401 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4402
4403 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4404
4405 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4406 case for the special 0 coding-system.
4407
4408 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4409 (Fmake_overlay): Remove redundant tests.
4410 (fix_start_end_in_overlays): Remove redundant recentering.
4411
4412 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
4413
4414 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4415 Update dependencies.
4416
4417 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4418
4419 Fix a malloc race condition involving strsignal.
4420 A signal can arrive in the middle of a malloc, and Emacs's signal
4421 handler can invoke strsignal, which can invoke malloc, which is
4422 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4423 Fix it by altering the signal handler so that it does not invoke
4424 strsignal.
4425 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4426 * process.c (status_message): Use const pointer, in case strsignal
4427 is #defined to safe_strsignal.
4428 * sysdep.c (sys_siglist, init_signals): Always define and
4429 initialize a substitute sys_siglist if the system does not define
4430 one, even if HAVE_STRSIGNAL.
4431 (safe_strsignal): Rename from strsignal. Always define,
4432 using sys_siglist. Return a const pointer.
4433 * syssignal.h (safe_strsignal): New decl.
4434 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4435
4436 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4437
4438 * w32proc.c (timer_loop): Fix code that waits for timer
4439 expiration, to avoid high CPU usage.
4440
4441 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4442
4443 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4444 (sweep_weak_table): Remove redundant prototypes.
4445
4446 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4447
4448 * emacs.c: Move the inclusion of TERM_HEADER after including
4449 windows.h on WINDOWSNT. This avoids compilation problems with
4450 MSVC.
4451
4452 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4453
4454 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4455 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4456 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4457 as the previous version used 'void *'.
4458
4459 * ralloc.c (ROUNDUP): Fix last change.
4460 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4461 'size_t'.
4462
4463 * w32proc.c <disable_itimers>: New static flag.
4464 (init_timers): Initialize it to zero, after creating the critical
4465 sections used by the timer threads.
4466 (term_timers): Set to 1 before deleting the critical sections.
4467 (getitimer, setitimer): If disable_itimers is non-zero, return an
4468 error indication without doing anything. Reported by Fabrice
4469 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4470 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4471 return results.
4472 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4473 support timers.
4474
4475 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4476 term_ntproc after all the other bookkeeping, to get timers working
4477 as long as possible.
4478
4479 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4480
4481 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4482 Suggested by Juri Linkov in
4483 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4484
4485 Prefer plain 'static' to 'static inline' (Bug#12541).
4486 With static functions, modern compilers inline pretty well by
4487 themselves; advice from programmers often hurts as much as it helps.
4488 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4489 this change shrinks the text size of the Emacs executable by 1.1%
4490 without affecting CPU significantly in my benchmark.
4491 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4492 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4493 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4494 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4495 (bset_auto_fill_function, bset_auto_save_file_format)
4496 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4497 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4498 (bset_cache_long_line_scans, bset_case_fold_search)
4499 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4500 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4501 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4502 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4503 (bset_header_line_format, bset_indicate_buffer_boundaries)
4504 (bset_indicate_empty_lines, bset_invisibility_spec)
4505 (bset_left_fringe_width, bset_major_mode, bset_mark)
4506 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4507 (bset_name, bset_overwrite_mode, bset_pt_marker)
4508 (bset_right_fringe_width, bset_save_length)
4509 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4510 (bset_scroll_up_aggressively, bset_selective_display)
4511 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4512 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4513 (set_buffer_overlays_after):
4514 * category.c (bset_category_table):
4515 * charset.c (read_hex):
4516 * coding.c (produce_composition, produce_charset)
4517 (handle_composition_annotation, handle_charset_annotation)
4518 (char_encodable_p):
4519 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4520 (assign_row, set_frame_matrix_frame, make_current)
4521 (add_row_entry):
4522 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4523 * fns.c (maybe_resize_hash_table):
4524 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4525 * gmalloc.c (register_heapinfo):
4526 * image.c (lookup_image_type):
4527 * intervals.c (set_interval_object, set_interval_left)
4528 (set_interval_right, copy_interval_parent, rotate_right)
4529 (rotate_left, balance_possible_root_interval):
4530 * keyboard.c (kset_echo_string, kset_kbd_queue)
4531 (kset_keyboard_translate_table, kset_last_prefix_arg)
4532 (kset_last_repeatable_command, kset_local_function_key_map)
4533 (kset_overriding_terminal_local_map, kset_real_last_command)
4534 (kset_system_key_syms, clear_event, set_prop):
4535 * lread.c (digit_to_number):
4536 * marker.c (attach_marker, live_buffer, set_marker_internal):
4537 * nsterm.m (ns_compute_glyph_string_overhangs):
4538 * process.c (pset_buffer, pset_command)
4539 (pset_decode_coding_system, pset_decoding_buf)
4540 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4541 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4542 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4543 * syntax.c (bset_syntax_table, dec_bytepos):
4544 * terminal.c (tset_param_alist):
4545 * textprop.c (interval_has_some_properties)
4546 (interval_has_some_properties_list):
4547 * window.c (wset_combination_limit, wset_dedicated)
4548 (wset_display_table, wset_hchild, wset_left_fringe_width)
4549 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4550 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4551 (wset_right_fringe_width, wset_right_margin_cols)
4552 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4553 (wset_vertical_scroll_bar_type, wset_window_parameters):
4554 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4555 (wset_column_number_displayed, wset_region_showing)
4556 (window_box_edges, run_window_scroll_functions)
4557 (append_glyph_string_lists, prepend_glyph_string_lists)
4558 (append_glyph_string, set_glyph_string_background_width)
4559 (append_glyph, append_composite_glyph)
4560 (take_vertical_position_into_account):
4561 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4562 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4563 (lface_hash, lface_same_font_attributes_p, lookup_face):
4564 * xml.c (libxml2_loaded_p):
4565 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4566 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4567 Now 'static', not 'static inline'.
4568
4569 * bidi.c: Tune.
4570 (bidi_copy_it): Do the whole copy with a single memcpy.
4571 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4572
4573 Revert the FOLLOW-SYMLINKS change for file-attributes.
4574 Doing it right would require several changes to Tramp, and there's
4575 not enough time to get that tested before the freeze today.
4576 * dired.c (directory_files_internal, Ffile_attributes):
4577 Undo last change.
4578
4579 * frame.c (x_report_frame_params): Port better to wider ints.
4580 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4581 or that pointers can be printed in 15 decimal digits.
4582 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4583
4584 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4585
4586 Support x64 build on MS-Windows.
4587 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4588 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4589 compatibility with x64.
4590 (x_get_focus_frame): Add prototype.
4591
4592 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4593 defining an XRectangle structure.
4594
4595 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4596 arithmetics for compatibility with x64.
4597
4598 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4599 compatibility with x64.
4600
4601 * w32heap.h: Adjust prototypes and declarations.
4602
4603 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4604 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4605 DWORD, long, and unsigned long, for compatibility with x64.
4606 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4607 (sbrk): Argument is now of type ptrdiff_t.
4608
4609 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4610 less than 0x0500.
4611 (w32_msg_pump): Use WPARAM type for 'result'.
4612
4613 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4614 architecture.
4615 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4616 compatibility with x64.
4617
4618 * vm-limit.c (lim_data): Now size_t.
4619 (check_memory_limits): Adjust prototypes of real_morecore and
4620 __morecore to receive argument of type ptrdiff_t. Use size_t for
4621 five_percent and data_size.
4622
4623 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4624 variables, for compatibility with x64.
4625 (rva_to_section, offset_to_section, relocate_offset)
4626 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4627 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4628 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4629 for compatibility with x64.
4630
4631 * sysdep.c (STDERR_FILENO): Define if not already defined.
4632
4633 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4634 (__morecore): Argument type is now ptrdiff_t.
4635 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4636 (relinquish): Use ptrdiff_t type for 'excess'.
4637 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4638
4639 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4640 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4641 instead of a literal number.
4642
4643 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4644 (min): Define only if not already defined.
4645
4646 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4647 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4648 hosts.
4649
4650 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4651 'bitmaps' is a pointer.
4652
4653 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4654
4655 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4656
4657 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4660 * dired.c (directory_files_internal, Ffile_attributes):
4661 New arg follow_symlinks. All uses changed.
4662
4663 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4664
4665 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4666
4667 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4668
4669 Support atimers and CPU profiler via profile.c on MS-Windows.
4670 * w32proc.c (sig_mask, crit_sig): New static variables.
4671 (sys_signal): Support SIGALRM and SIGPROF.
4672 (sigemptyset, sigaddset, sigfillset, sigprocmask)
4673 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
4674 sigfillset, and sigprocmask are no longer no-ops.
4675 (sigismember): New function.
4676 (struct itimer_data): New definition.
4677 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4678 (crit_prof): New static variables.
4679 (MAX_SINGLE_SLEEP): New definition.
4680 (timer_loop, stop_timer_thread, term_timers, init_timers)
4681 (start_timer_thread, getitimer, setitimer): New functions.
4682 (alarm): No longer a no-op, calls setitimer.
4683
4684 * w32.c (term_ntproc): Call term_timers.
4685 (init_ntproc): Make sure all signals are unblocked at startup, to
4686 erase any traces of dumping. Call init_timers.
4687
4688 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4689 Windows-specific code to display the hourglass mouse pointer is no
4690 longer used.
4691 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4692 to hourglass timer expiration.
4693 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4694 Remove, no longer used.
4695 (w32_note_current_window, show_hourglass, hide_hourglass):
4696 New functions, in support of hourglass cursor display similar to other
4697 window systems.
4698 (syms_of_w32fns): Don't initialize hourglass_timer.
4699
4700 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4701 WINDOWSNT as well.
4702 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4703
4704 * w32.h (init_timers, term_timers): Add prototypes.
4705
4706 2012-09-30 Kenichi Handa <handa@gnu.org>
4707
4708 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4709 to the buffer relocation which may be caused by ccl_driver.
4710
4711 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4712
4713 * xfns.c (Fx_file_dialog): Update comment.
4714
4715 * w32fns.c (Fx_file_dialog): Update comment.
4716
4717 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4718 Initialize panel name field if OSX >= 10.6.
4719
4720 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4721
4722 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4723
4724 * nsterm.m (NEW_STYLE_FS): New define.
4725 (ns_fullscreen_hook, windowWillEnterFullScreen)
4726 (windowDidEnterFullScreen, windowWillExitFullScreen)
4727 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4728 (setFSValue): New functions.
4729 (EmacsFSWindow): New implementation.
4730 (canBecomeKeyWindow): New function for EmacsFSWindow.
4731 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4732 (dealloc): Release nonfs_window if in fullscreen.
4733 (updateFrameSize:): Call windowDidMove to update top/left.
4734 (windowWillResize:toSize:): Check if frame is still maximized.
4735 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4736 next_maximized, maximized_width, maximized_height and nonfs_window.
4737 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4738 tbar_height.
4739 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
4740 fullscreen. Set maximized_width/height. Act on next_maximized.
4741
4742 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4743 (EmacsView): Add variables for fullscreen.
4744 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4745 (EmacsFSWindow): New interface for fullscreen.
4746
4747 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
4748
4749 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4750
4751 2012-09-30 Chong Yidong <cyd@gnu.org>
4752
4753 * fns.c (Frandom): Doc fix.
4754
4755 2012-09-30 Martin Rudalics <rudalics@gmx.at>
4756
4757 * window.c (Vwindow_combination_limit): New default value.
4758 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4759
4760 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4761
4762 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4763 Suggested by Eli Zaretskii in
4764 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4765
4766 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4767
4768 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4769 HAVE_TIMER_SETTIME is defined.
4770
4771 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4772
4773 Profiler improvements: more-accurate timers, overflow checks.
4774 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4775 signal.h, setjmp.h. Include systime.h instead.
4776 (saturated_add): New function.
4777 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4778 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4779 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4780 New static vars.
4781 (enum profiler_cpu_running): New enum.
4782 (profiler_cpu_running): Now of that enum type, not bool.
4783 All uses changed to store the new value.
4784 (handle_profiler_signal): Rename from sigprof_handler_1,
4785 for consistency with other handlers. Do not check whether
4786 cpu_log is a hash-table if garbage collecting, since it
4787 doesn't matter in that case.
4788 (deliver_profiler_signal): Rename from sigprof_handler,
4789 for consistency with other handlers.
4790 (setup_cpu_timer): New function, with much of what used to be in
4791 Fprofiler_cpu_start. Check for out-of-range argument.
4792 Prefer timer_settime if available, and prefer
4793 thread cputime clocks, then process cputime clocks, then
4794 monotonic clocks, to the old realtime clock. Use make_timeval
4795 to round more-correctly when falling back to setitimer.
4796 (Fprofiler_cpu_start): Use it.
4797 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4798 Don't assume that passing NULL as the 2nd argument of setitimer
4799 is the same as passing a pointer to all-zero storage.
4800 Ignore SIGPROF afterwards.
4801 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4802 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4803 non-fatal signal handlers. Ignore SIGPROF on startup.
4804 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4805 in profiler.c, since sysdep.c now uses it.
4806
4807 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4808 Suggested by Eli Zaretskii in
4809 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4810
4811 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
4812
4813 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4814
4815 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4816
4817 * lisp.h (struct backtrace): Remove indirection for `function' field.
4818 * xdisp.c (redisplay_internal):
4819 * profiler.c (record_backtrace, sigprof_handler_1):
4820 * alloc.c (Fgarbage_collect):
4821 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4822 (Fbacktrace_frame): Adjust accordingly.
4823
4824 2012-09-28 Glenn Morris <rgm@gnu.org>
4825
4826 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4827 (Frun_hook_with_args_until_failure): Doc fixes.
4828
4829 2012-09-28 Eli Zaretskii <eliz@gnu.org>
4830
4831 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4832 Qautomatic_redisplay and change the symbol name. All users changed.
4833
4834 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4835
4836 * profiler.c (sigprof_handler): Fix race condition.
4837
4838 2012-09-28 Glenn Morris <rgm@gnu.org>
4839
4840 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4841
4842 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4843
4844 Check more robustly for timer_settime.
4845 * Makefile.in (LIB_TIMER_TIME): New macro.
4846 (LIBES): Add it.
4847 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4848 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4849 call timer_settime.
4850
4851 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4852
4853 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4854
4855 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
4856
4857 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4858
4859 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4860
4861 * character.h (MAYBE_UNIFY_CHAR): Remove.
4862 * charset.c, charset.h (maybe_unify_char): Now static.
4863 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4864 Since this stuff is now private to charset.c, there's no need for
4865 a public macro and no need to inline by hand.
4866
4867 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4868 Stefan Monnier <monnier@iro.umontreal.ca>
4869 Juanma Barranquero <lekktu@gmail.com>
4870
4871 * profiler.c: New file.
4872 * Makefile.in (base_obj): Add profiler.o.
4873 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4874 ($(BLD)/profiler.$(O)): New target.
4875 * emacs.c (main): Call syms_of_profiler.
4876 * alloc.c (Qautomatic_gc): New constant.
4877 (MALLOC_PROBE): New macro.
4878 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4879 (total_bytes_of_live_objects): New function.
4880 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4881 Call malloc_probe for the memory profiler.
4882 (syms_of_alloc): Define Qautomatic_gc.
4883 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4884 race condition.
4885 (struct backtrace): Move definition...
4886 * lisp.h (struct backtrace): ..here.
4887 (Qautomatic_gc, profiler_memory_running): Declare vars.
4888 (malloc_probe, syms_of_profiler): Declare functions.
4889 * xdisp.c (Qautomatic_redisplay): New constant.
4890 (redisplay_internal): Record itself in backtrace_list.
4891 (syms_of_xdisp): Define Qautomatic_redisplay.
4892
4893 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4894 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4895
4896 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4897
4898 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4899
4900 Prefer POSIX timers if available.
4901 They avoid a race if the timer is too close to the current time.
4902 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4903 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
4904 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
4905
4906 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4907
4908 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4909 CHAR_STRING_ADVANCE.
4910 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4911 STRING_CHAR_ADVANCE.
4912
4913 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4914
4915 Move Vlibrary_cache to emacs.c and reset before dumping.
4916
4917 * lisp.h (reset_image_types): Declare.
4918 [WINDOWSNT] (Vlibrary_cache): Declare.
4919
4920 * image.c (reset_image_types): New function.
4921
4922 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4923 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4924 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4925
4926 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4927 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4928
4929 * w32.h (Vlibrary_cache): Do not declare.
4930
4931 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4932
4933 * w32proc.c (sys_signal): Handle all signals defined by the
4934 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4935 handlers for signals supported by Windows. Don't override
4936 term_ntproc as the handler for SIGABRT.
4937 (sigaction): Rewrite to call sys_signal instead of duplicating its
4938 code.
4939 (sys_kill): Improve commentary.
4940
4941 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4942 consistency with a signature of a signal handler. All callers
4943 changed.
4944 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4945 install term_ntproc as a signal handler for SIGABRT, as that
4946 should be done by the dumped Emacs.
4947
4948 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4949
4950 * w32select.c (term_w32select): Protect against repeated
4951 invocation by setting clipboard_owner to NULL after calling
4952 DestroyWindow.
4953
4954 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4955 and term_ntproc to their modified signatures.
4956
4957 * character.c (char_string, string_char): Remove calls to
4958 MAYBE_UNIFY_CHAR. See the discussion starting at
4959 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4960 for the details.
4961
4962 2012-09-25 Chong Yidong <cyd@gnu.org>
4963
4964 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4965
4966 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4967
4968 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4969 when encountering an unknown bytecode.
4970
4971 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4972
4973 image.c, indent.c: Use bool for booleans.
4974 * dispextern.h (struct image_type): Members valid_p, load, init
4975 now return bool, not int. All uses changed.
4976 * image.c: Omit unnecessary static decls.
4977 (x_create_bitmap_mask, x_build_heuristic_mask):
4978 Return void, not int, since callers don't care about the return value.
4979 (x_create_bitmap_mask, define_image_type, valid_image_p)
4980 (struct image_keyword, parse_image_spec, image_spec_value)
4981 (check_image_size, image_background)
4982 (image_background_transparent, x_clear_image_1)
4983 (postprocess_image, lookup_image, x_check_image_size)
4984 (x_create_x_image_and_pixmap, xbm_image_p)
4985 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4986 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4987 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4988 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4989 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4990 (png_image_p, init_png_functions, png_load_body, png_load)
4991 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4992 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4993 (init_gif_functions, gif_load, imagemagick_image_p)
4994 (imagemagick_load_image, imagemagick_load, svg_image_p)
4995 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4996 (gs_load):
4997 * nsimage.m (ns_load_image):
4998 * nsterm.m (ns_defined_color):
4999 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5000 * xfns.c (x_defined_color):
5001 * xterm.c (x_alloc_lighter_color_for_widget)
5002 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5003 (x_alloc_lighter_color):
5004 * indent.c (disptab_matches_widthtab, current_column)
5005 (scan_for_column, string_display_width, indented_beyond_p)
5006 (compute_motion, vmotion, Fvertical_motion):
5007 Use bool for booleans.
5008
5009 2012-09-24 Chong Yidong <cyd@gnu.org>
5010
5011 * chartab.c (Fset_char_table_default): Obsolete function removed.
5012
5013 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5014
5015 Move pid_t related decls out of lisp.h.
5016 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5017 (interruptible_wait_for_termination):
5018 Move these decls from lisp.h to syswait.h, since they use pid_t.
5019 Needed on FreeBSD; see Herbert J. Skuhra in
5020 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5021 * callproc.c: Include syswait.h.
5022
5023 gnutls.c, gtkutil.c: Use bool for boolean.
5024 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5025 (emacs_gnutls_handle_error):
5026 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5027 (xg_hide_tooltip, xg_create_frame_widgets)
5028 (create_dialog, xg_uses_old_file_dialog)
5029 (xg_get_file_with_chooser, xg_get_file_with_selection)
5030 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5031 (xg_item_label_same_p, xg_update_menubar)
5032 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5033 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5034 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5035 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5036 (update_frame_tool_bar, free_frame_tool_bar):
5037 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5038 * nsmenu.m (ns_update_menubar):
5039 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5040 * xfns.c (Fx_show_tip) [USE_GTK]:
5041 Use bool for boolean.
5042 * gtkutil.c (xg_update_frame_menubar):
5043 * xmenu.c (update_frame_menubar):
5044 Return void, not int, since caller ignores return value.
5045 * gtkutil.c (xg_change_toolbar_position):
5046 Return void, not 1.
5047
5048 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5049
5050 * makefile.w32-in (BLOCKINPUT_H): Remove.
5051 (SYSSIGNAL_H): New macro.
5052 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5053 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5054 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5055 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5056 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5057 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5058 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5059 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5060 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5061 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5062 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5063 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5064 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5065 ($(BLD)/w32xfns.$(O)): Update dependencies.
5066
5067 2012-09-23 Eli Zaretskii <eliz@gnu.org>
5068
5069 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5070 fatal_error_backtrace.
5071
5072 * w32proc.c (sys_kill): Undo last change: don't do anything when
5073 invoked to deliver SIGABRT to our own process. This is now
5074 handled by emacs_raise.
5075
5076 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5077
5078 * w32term.c (w32_read_socket): Remove leftover reference to
5079 interrupt_input_pending.
5080
5081 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5082
5083 Do not use SA_NODEFER.
5084 Problem reported by Dani Moncayo in
5085 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5086 * alloc.c (die):
5087 * sysdep.c (emacs_abort): Do not reset signal handler.
5088 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5089 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5090 wanted even on POSIXish hosts, and it doesn't work on Windows.
5091
5092 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5093
5094 * xterm.c (x_term_init): Call fixup_locale before and after calling
5095 gtk_init (Bug#12392).
5096
5097 2012-09-23 Chong Yidong <cyd@gnu.org>
5098
5099 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5100 Vdynamic_library_alist.
5101
5102 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5103 (Fgnutls_available_p): Caller changed.
5104
5105 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5106 (Flibxml_parse_xml_region): Likewise.
5107
5108 * dispextern.h (struct image_type): Remove arg from init function.
5109
5110 * image.c (Finit_image_library, lookup_image_type)
5111 (define_image_type): Remove now-unneeded second arg.
5112 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5113 (init_tiff_functions, init_gif_functions, init_svg_functions):
5114 Arglist and w32_delayed_load calling convention changed.
5115 (gs_type): Remove init_gs_functions; there is no such function.
5116 (valid_image_p, make_image): Fix caller to lookup_image_type.
5117
5118 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 Simplify and avoid signal-handling races (Bug#12471).
5121 * alloc.c (die):
5122 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5123 Avoid recursive loop if there's a fatal error in the function itself.
5124 * atimer.c (pending_atimers):
5125 * blockinput.h: Don't include "atimer.h"; no longer needed.
5126 (interrupt_input_pending): Remove. All uses removed.
5127 pending_signals now counts both atimers and ordinary interrupts.
5128 This is less racy than having three separate pending-signal flags.
5129 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5130 (input_blocked_p):
5131 Rename from their upper-case counterparts BLOCK_INPUT,
5132 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5133 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5134 This makes it easier to access volatile variables more accurately.
5135 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5136 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5137 that's more reliable if the code is buggy and sets
5138 interrupt_input_blocked to a negative value. All uses changed.
5139 * atimer.c (deliver_alarm_signal):
5140 Remove. No need to deliver this to the parent; any thread can
5141 handle this signal now. All uses replaced by underlying handler.
5142 * atimer.c (turn_on_atimers):
5143 * dispnew.c (handle_window_change_signal):
5144 * emacs.c (handle_danger_signal):
5145 * keyboard.c (kbd_buffer_get_event):
5146 Don't reestablish signal handler; not needed with sigaction.
5147 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5148 (UNBLOCK_INPUT_TO):
5149 Rework to avoid unnecessary accesses to volatile variables.
5150 (UNBLOCK_INPUT_TO): Now a function.
5151 (totally_unblock_input, unblock_input): New decls.
5152 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5153 (init_data): Remove. Necessary stuff now done in init_signal.
5154 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5155 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5156 (fatal_error_code): Remove; no longer needed.
5157 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5158 it doesn't always backtrace. All uses changed. No need to reset
5159 signal to default, since sigaction and/or die does that for us now.
5160 Use emacs_raise (FOO), not kill (getpid (), FOO).
5161 (main): Check more-accurately whether we're dumping.
5162 Move fatal-error setup to sysdep.c
5163 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5164 * gtkutil.c (xg_get_file_name, xg_get_font):
5165 Remove no-longer-needed signal-mask manipulation.
5166 * keyboard.c, process.c (POLL_FOR_INPUT):
5167 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5168 * keyboard.c (read_avail_input): Remove.
5169 All uses replaced by gobble_input.
5170 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5171 (kbd_buffer_store_event_hold, gobble_input):
5172 (record_asynch_buffer_change) [USABLE_SIGIO]:
5173 (store_user_signal_events):
5174 No need to mess with signal mask.
5175 (gobble_input): If blocking input and there are terminals, simply
5176 set pending_signals to 1 and return. All hooks changed to not
5177 worry about whether input is blocked.
5178 (process_pending_signals): Clear pending_signals before processing
5179 them, in case a signal comes in while we're processing.
5180 By convention callers now test pending_signals before calling us.
5181 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5182 New functions, to support changes to blockinput.h.
5183 (handle_input_available_signal): Now extern.
5184 (reinvoke_input_signal): Remove. All uses replaced by
5185 handle_async_input.
5186 (quit_count): Now volatile, since a signal handler uses it.
5187 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5188 All callers changed. Block SIGINT only if not already blocked.
5189 Clear sigmask reliably, even if Fsignal returns, which it can.
5190 Omit unnecessary accesses to volatile var.
5191 (quit_throw_to_read_char): No need to restore sigmask.
5192 * keyboard.c (gobble_input, handle_user_signal):
5193 * process.c (wait_reading_process_output):
5194 Call signal-handling code rather than killing ourselves.
5195 * lisp.h: Include <float.h>, for...
5196 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5197 (pending_signals): Now volatile.
5198 (syms_of_data): Now const if IEEE floating point.
5199 (handle_input_available_signal) [USABLE_SIGIO]:
5200 (terminate_due_to_signal, record_child_status_change): New decls.
5201 * process.c (create_process): Avoid disaster if memory is exhausted
5202 while we're processing a vfork, by tightening the critical section
5203 around the vfork.
5204 (send_process_frame, process_sent_to, handle_pipe_signal)
5205 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5206 ignores SIGPIPE.
5207 (send_process): No need for setjmp/longjmp any more, since the
5208 SIGPIPE stuff is now gone. Instead, report an error if errno
5209 is EPIPE.
5210 (record_child_status_change): Now extern. PID and W are now args.
5211 Return void, not bool. All callers changed.
5212 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5213 Remove. All uses removed. This bug should be fixed now in a
5214 different way.
5215 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5216 and record the child status change directly. This avoids the
5217 need to futz with the signal mask.
5218 (process_fatal_action): Move here from emacs.c.
5219 (emacs_sigaction_flags): New function, containing
5220 much of what used to be in emacs_sigaction_init.
5221 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5222 caught by emacs, to make races less likely.
5223 (deliver_process_signal): Rename from handle_on_main_thread.
5224 All uses changed.
5225 (BACKTRACE_LIMIT_MAX): Now at top level.
5226 (thread_backtrace_buffer, threadback_backtrace_pointers):
5227 New static vars.
5228 (deliver_thread_signal, deliver_fatal_thread_signal):
5229 New functions, for more-accurate delivery of thread-specific signals.
5230 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5231 (deliver_arith_signal): Handle in this thread, not
5232 in the main thread, since it's triggered by this thread.
5233 (maybe_fatal_sig): New function.
5234 (init_signals): New arg DUMPING so that we can be more accurate
5235 about whether we're dumping. Caller changed.
5236 Treat thread-specific signals differently from process-general signals.
5237 Block all signals while handling fatal error; that's safer.
5238 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5239 on IEEE hosts.
5240 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5241 Ignore SIGPIPE unless batch.
5242 (emacs_backtrace): Output backtrace for the appropriate thread,
5243 which is not necessarily the main thread.
5244 * syssignal.h: Include <stdbool.h>.
5245 (emacs_raise): New macro.
5246 * xterm.c (x_connection_signal): Remove; no longer needed
5247 now that we use sigaction.
5248 (x_connection_closed): No need to mess with sigmask now.
5249 (x_initialize): No need to reset SIGPIPE handler here, since
5250 init_signals does this for us now.
5251
5252 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5253
5254 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5255 background rect may be larger (Bug#12245).
5256
5257 2012-09-23 Chong Yidong <cyd@gnu.org>
5258
5259 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5260
5261 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5262
5263 * .gdbinit: Just stop at fatal_error_backtrace.
5264 See Stefan Monnier's request in
5265 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5266 Remove no-longer-used query of system type.
5267
5268 2012-09-22 Chong Yidong <cyd@gnu.org>
5269
5270 * search.c (Freplace_match): Doc fix (Bug#12325).
5271
5272 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5273
5274 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5275 (Fline_end_position): Doc fix.
5276
5277 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5278
5279 2012-09-22 Chong Yidong <cyd@gnu.org>
5280
5281 * dispextern.h (struct image_type): Add new slot, storing a type
5282 initialization function.
5283
5284 * image.c (define_image_type): Call the image initializer function
5285 if it is defined. Arguments and return value changed.
5286 (valid_image_p, make_image): Callers changed.
5287 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5288 (gif_type, imagemagick_type, svg_type, gs_type):
5289 Add initialization functions.
5290 (Finit_image_library): Call lookup_image_type.
5291 (CHECK_LIB_AVAILABLE): Macro deleted.
5292 (lookup_image_type): Call define_image_type here, rather than via
5293 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5294 (syms_of_image): Move define_image_type calls for xbm_type and
5295 pbm_type to lookup_image_type.
5296
5297 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5298
5299 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5300 'idle_timers' from here ...
5301 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5302 lists, to avoid infloops when the timer does something stupid,
5303 like reinvoke itself with the same or smaller time-out.
5304 (Bug#12447)
5305
5306 2012-09-22 Martin Rudalics <rudalics@gmx.at>
5307
5308 * window.c (Fsplit_window_internal): Handle only Qt value of
5309 Vwindow_combination_limit separately.
5310 (Qtemp_buffer_resize): New symbol.
5311 (Vwindow_combination_limit): New default value.
5312 Rewrite doc-string.
5313
5314 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5315
5316 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5317 the new overlay string. (Bug#10159)
5318
5319 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5320
5321 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5322 or that fprintf is async-signal-safe. POSIX doesn't require
5323 either assumption.
5324
5325 2012-09-22 Chong Yidong <cyd@gnu.org>
5326
5327 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5328 (Bug#8207).
5329
5330 2012-09-22 Kenichi Handa <handa@gnu.org>
5331
5332 * composite.c (composition_reseat_it): Handle the case that a
5333 grapheme cluster is not covered by a single font (Bug#12352).
5334
5335 2012-09-21 Chong Yidong <cyd@gnu.org>
5336
5337 * image.c (define_image_type): Avoid adding duplicate types to
5338 image_types (Bug#12463). Suggested by Jörg Walter.
5339
5340 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5341
5342 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5343 (print_load_command_name): Add case LC_DATA_IN_CODE.
5344 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5345
5346 2012-09-21 Glenn Morris <rgm@gnu.org>
5347
5348 * eval.c (Frun_hook_with_args_until_success)
5349 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5350
5351 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
5352
5353 * fileio.c (Ffile_selinux_context): Only call freecon when
5354 lgetfilecon succeeded.
5355 (Fset_file_selinux_context): Likewise. (Bug#12444)
5356
5357 2012-09-21 Eli Zaretskii <eliz@gnu.org>
5358
5359 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5360 reordering, locate the cursor by calling set_cursor_from_row; if
5361 that fails, clear the desired glyph matrix before returning a
5362 failure indication to the caller. Fixes leaving garbled display
5363 when fast scrolling with a down-key. (Bug#12403)
5364 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5365 scrolling through multibyte text.
5366
5367 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5368
5369 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5370 calling mark_vectorlike since that's the one that marks the window.
5371 (mark_discard_killed_buffers): Mark the final cdr.
5372 * window.h (struct window): Move prev/next_buffers to the
5373 non-standard fields.
5374 * window.c (make_window): Initialize prev/next_buffers manually.
5375
5376 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5377
5378 Omit unused arg EXPECTED from socket hooks.
5379 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5380 * nsterm.m (ns_term_init):
5381 * termhooks.h (struct terminal.read_socket_hook):
5382 * w32inevt.c (w32_console_read_socket):
5383 * w32term.c (w32_read_socket):
5384 * xterm.c (XTread_socket):
5385 Omit unused arg EXPECTED. All callers changed.
5386 (store_user_signal_events): Return void, not int, since callers no
5387 longer care about the return value. All uses changed.
5388
5389 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
5390
5391 * w32gui.h (XParseGeometry): Do not declare.
5392
5393 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5394
5395 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
5396 Ignore 'expected'. See Eli Zaretskii in
5397 <http://bugs.gnu.org/12471#8> (last line).
5398
5399 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5400 (XParseGeometry): Now static. Substitute extremal values for
5401 values that are out of range.
5402
5403 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5404
5405 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5406
5407 * nsfns.m (XParseGeometry): Remove.
5408 (Fx_create_frame): Call x_set_offset to correctly interpret
5409 top_pos in geometry.
5410
5411 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
5412 (Fx_parse_geometry): If there is a space in string, call
5413 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5414
5415 2012-09-17 Eli Zaretskii <eliz@gnu.org>
5416
5417 * search.c (scan_buffer): Use character positions in calls to
5418 region_cache_forward and region_cache_backward, not byte
5419 positions. (Bug#12196)
5420
5421 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5422 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5423
5424 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5425 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5426 emacs_blocked_malloc, now deleted.
5427
5428 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5429
5430 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5431 The workaround was for improving performance on Solaris 2.4, but
5432 is getting in the way now. Emacs will still work if someone is
5433 still running Solaris 2.4 in a museum somewhere; Sun dropped
5434 support for Solaris 2.4 in 2003.
5435 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5436 * process.c (create_process) [HAVE_WORKING_VFORK]:
5437 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5438 since Emacs no longer uses vfork on that platform.
5439
5440 2012-09-17 Glenn Morris <rgm@gnu.org>
5441
5442 * emacs.c: Use COPYRIGHT.
5443
5444 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5445
5446 Remove configure's --without-sync-input option (Bug#12450).
5447 When auditing signal-handling in preparation for cleaning it up,
5448 I found that SYNC_INPUT has race conditions and would be a real
5449 pain to fix. Since it's an undocumented and deprecated
5450 configure-time option, now seems like a good time to remove it.
5451 Also see <http://bugs.gnu.org/11080#16>.
5452 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5453 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5454 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5455 (malloc_hysteresis):
5456 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5457 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5458 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5459 (dont_register_blocks, bytes_used_when_reconsidered)
5460 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5461 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5462 [!SYSTEM_MALLOC && !SYNC_INPUT]:
5463 Remove. All uses removed.
5464 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5465 implementation, one that depends on whether the new macro
5466 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5467 is defined.
5468 * atimer.c (run_timers, handle_alarm_signal):
5469 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5470 (handle_async_input, process_pending_signals)
5471 (handle_input_available_signal, init_keyboard):
5472 * nsterm.m (ns_read_socket):
5473 * process.c (wait_reading_process_output):
5474 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5475 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5476 (emacs_write):
5477 * xterm.c (XTread_socket):
5478 Assume SYNC_INPUT.
5479 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5480 * eval.c (handling_signal): Remove. All uses removed.
5481 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5482 All uses replaced with the SYNC_INPUT version.
5483 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5484 Remove decls.
5485 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5486 Now static.
5487
5488 * font.c (Ffont_shape_gstring): Remove unused local.
5489
5490 2012-09-16 Glenn Morris <rgm@gnu.org>
5491
5492 * Makefile.in (clean): No longer run nextstep's clean.
5493
5494 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5495 (ns_frag): Remove.
5496 (ns-app): Move here from ns.mk, and simplify.
5497 (clean): Simplify nextstep entry.
5498 * ns.mk: Remove file.
5499
5500 2012-09-17 Kenichi Handa <handa@gnu.org>
5501
5502 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5503 not covert the last few charactes.
5504
5505 2012-09-16 Kenichi Handa <handa@gnu.org>
5506
5507 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5508 here, but just check the validity of glyphs in the glyph-string.
5509
5510 2012-09-16 Martin Rudalics <rudalics@gmx.at>
5511
5512 * window.c (Fwindow_parameter, Fset_window_parameter):
5513 Accept any window as argument (Bug#12452).
5514
5515 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5516
5517 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5518 to ns_term_init to avoid memory leak.
5519
5520 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5521 explicit retain/release.
5522 (ns_term_init): Only allow one display. Initialize outerpool and
5523 ns_*_types.
5524
5525 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5526
5527 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5528 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5529 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5530 the Microsoft problem in a different way, by altering ../nt/config.nt.
5531
5532 2012-09-15 Eli Zaretskii <eliz@gnu.org>
5533
5534 * w32xfns.c:
5535 * w32uniscribe.c:
5536 * w32term.c:
5537 * w32select.c:
5538 * w32reg.c:
5539 * w32proc.c:
5540 * w32menu.c:
5541 * w32inevt.c:
5542 * w32heap.c:
5543 * w32font.c:
5544 * w32fns.c:
5545 * w32console.c:
5546 * w32.c:
5547 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5548 by lisp.h. This completes removal of setjmp.h inclusion
5549 erroneously announced in the previous commit. (Bug#12446)
5550
5551 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5552 more accurate.
5553
5554 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5555 not defined as a macro. The latter happens on MS-Windows.
5556 (Bug#12446)
5557
5558 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5559
5560 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5561 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
5562 Some instances of '#include <setjmp.h>' removed, if the
5563 only reason for the instance was because "lisp.h" was included.
5564 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5565 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5566 and _longjmp with the new symbols. Emacs already uses _setjmp if
5567 available, so this change affects only POSIXish hosts that have
5568 sigsetjmp but not _setjmp, such as some versions of Solaris and
5569 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5570 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5571 (png_load_body) [HAVE_PNG]:
5572 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5573 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5574 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5575 since PNG requires jmp_buf. This is the only exception to the
5576 general rule that we now use sys_setjmp and sys_longjmp.
5577 This exception is OK since this code does not change the signal
5578 mask or longjmp out of a signal handler.
5579
5580 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5581
5582 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5583 Include "syssignal.h", for 'main_thread'.
5584
5585 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5586
5587 Avoid out-of-range marker position (Bug#12426).
5588 * insdel.c (replace_range, replace_range_2):
5589 Adjust markers before overlays, as suggested by comments.
5590 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5591 Remove redundant check before calling offset_intervals.
5592
5593 2012-09-14 Martin Rudalics <rudalics@gmx.at>
5594
5595 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5596 current buffer (Bug#12387).
5597
5598 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
5599
5600 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5601
5602 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5603
5604 Use a more backwards-compatible timer format (Bug#12430).
5605 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5606 vector element, not from the 4th, since PSECS is now at the end.
5607 (Fcurrent_idle_time): Doc fix.
5608
5609 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5610
5611 Function to mark objects and remove killed buffers at once.
5612 * alloc.c (discard_killed_buffers): Rename to ...
5613 (mark_discard_killed buffers) ... new name. Add marking
5614 of remaining objects. Fix comment. Adjust users.
5615 (mark_object): Do not touch frame buffer lists here.
5616 * frame.c (delete_frame): Reset frame buffer lists here.
5617
5618 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5619
5620 Better workaround for GNOME bug when --enable-gcc-warnings.
5621 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5622 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5623 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5624
5625 Simplify SIGIO usage (Bug#12408).
5626 The code that dealt with SIGIO was crufty and confusing, e.g., it
5627 played tricks like "#undef SIGIO" but these tricks were not used
5628 consistently. Simplify mostly by not #undeffing standard symbols,
5629 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5630 or not as we please) rather than "defined SIGIO" (standard symbol
5631 that we probably shouldn't #undef).
5632 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5633 Modules that need it can include it.
5634 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5635 * dispextern.h (ignore_sigio): New decl.
5636 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5637 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5638 * emacs.c (shut_down_emacs):
5639 * keyboard.c (kbd_buffer_store_event_hold):
5640 Use ignore_sigio rather than invoking 'signal' directly.
5641 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5642 for FIONREAD.
5643 (FIONREAD, SIGIO): Do not #undef.
5644 (tty_read_avail_input): Use #error rather than a syntax error.
5645 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5646 for I_PIPE, used by SETUP_SLAVE_PTY.
5647 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5648 * sysdep.c (croak): Remove; no longer needed. This bit of
5649 temporary code, with Fred N. Fish's comment that it's temporary,
5650 has been in Emacs since at least 1992!
5651 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5652 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5653 * syssignal.h (croak): Remove decl.
5654 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5655 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5656 now that we're termios-only.
5657 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5658 * term.c (dissociate_if_controlling_tty): Use #error rather than
5659 a run-time error.
5660
5661 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5662 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5663 to work around GNOME bug 683906.
5664 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5665 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5666 This works around GCC bug 54561.
5667
5668 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5669
5670 More fixes for 'volatile' and setjmp/longjmp.
5671 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5672 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5673 (png_load_body) [HAVE_PNG]:
5674 (jpeg_load_body) [HAVE_JPEG]:
5675 New function, with most of the old parent function's body.
5676 (png_load) [HAVE_PNG]:
5677 (jpeg_load) [HAVE_JPEG]:
5678 Invoke the new function, to avoid longjmp munging our locals.
5679 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5680 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5681 longjmp is passed 2, as the C standard doesn't guarantee this.
5682 Instead, store the failure code into mgr->failure_code.
5683
5684 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5685
5686 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5687 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5688 (syms_of_keyboard): Remove support for unread-command-char.
5689
5690 2012-09-12 Eli Zaretskii <eliz@gnu.org>
5691
5692 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5693 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5694 violation. (Bug#12426)
5695
5696 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5697
5698 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5699
5700 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5701
5702 * eval.c: Add `inhibit-debugger'.
5703 (Qinhibit_debugger): New symbol.
5704 (call_debugger): Bind it instead of Qdebug_on_error.
5705 (maybe_call_debugger): Test Vinhibit_debugger.
5706 (syms_of_eval): Define inhibit-debugger.
5707 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5708 (syms_of_xdisp): Remove inhibit-debug-on-message.
5709
5710 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5711
5712 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5713 If a nonvolatile local variable is written before a _longjmp to
5714 the frame containing the variable, and is read after the _longjmp,
5715 the value read is indeterminate. Some local variables of type
5716 'struct handler' and 'struct catchtag' are used in this way, so
5717 mark each of their slots as volatile if the slot can be set before
5718 _longjmp and read afterwards.
5719 * lisp.h (struct handler): var and chosen_clause are now volatile.
5720 (struct catchtag): val, next, and pdlcount are now volatile.
5721
5722 * bidi.c (bidi_push_it, bidi_pop_it):
5723 * fns.c (copy_hash_table):
5724 * image.c (define_image_type):
5725 * keyboard.c (kbd_buffer_store_event_hold):
5726 * process.c (Fprocess_send_eof):
5727 * xfaces.c (x_create_gc) [HAVE_NS]:
5728 * xgselect.c (xg_select):
5729 Prefer assignment to memcpy when either will do.
5730
5731 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5732 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5733 time an item is removed. No need to mark this function 'inline';
5734 the compiler knows better than we do.
5735
5736 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5737
5738 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5739 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5740 to change_frame_size (Bug#12388).
5741 (windowDidResize:): Pass YES to updateFrameSize.
5742
5743 * nsterm.h: Add delay parameter to updateFrameSize.
5744
5745 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5746
5747 Discard killed buffers from deleted window and frame objects.
5748 This reduces an amount of references to killed buffers and
5749 helps GC to reclaim them faster.
5750 * alloc.c (discard_killed_buffers): New function.
5751 (mark_object): Use it for deleted windows and frames.
5752 (mark_object): If symbol's value is set up for a killed buffer
5753 or deleted frame, restore its global binding.
5754 * data.c (swap_in_global_binding): Add GC notice.
5755 (swap_in_symval_forwarding): Use convenient set_blv_where.
5756 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5757 * window.h: ... to here.
5758
5759 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5760
5761 Convenient macro to check whether the buffer is live.
5762 * buffer.h (BUFFER_LIVE_P): New macro.
5763 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5764 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5765
5766 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5767
5768 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5769 composition cases (Bug#12364).
5770
5771 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5772 overhang of succeeding glyphs overlapping box cursor.
5773
5774 * w32term.c (x_draw_glyph_string): Likewise.
5775
5776 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5777
5778 Simplify, document, and port floating-point (Bug#12381).
5779 The porting part of this patch fixes bugs on non-IEEE platforms
5780 with frexp, ldexp, logb.
5781 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5782 Now static.
5783 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5784 support, by removing commented-out code and briefly listing the
5785 C89 functions excluded. The commented-out stuff was confusing
5786 maintenance, e.g., we thought we needed cbrt but it was commented out.
5787 (logb): Remove decl; no longer needed.
5788 (isfinite): New macro, if not already supplied.
5789 (isnan): Don't replace any existing macro.
5790 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5791 are present on all C89 platforms.
5792 (Ffrexp): Do not special-case zero, as frexp does the right thing
5793 for that case.
5794 (Flogb): Do not use logb, as it doesn't have the desired meaning
5795 on hosts that use non-base-2 floating point. Instead, stick with
5796 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5797 frexp, to avoid getting an unspecified result.
5798
5799 * xdisp.c (Qinhibit_debug_on_message): Now static.
5800
5801 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5802
5803 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5804 NSBezierPath (Bug#12131).
5805
5806 2012-09-10 Chong Yidong <cyd@gnu.org>
5807
5808 * fns.c (Fdelq, Fdelete): Doc fix.
5809
5810 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5811
5812 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5813 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5814
5815 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5816
5817 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5818 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5819 Use it.
5820
5821 2012-09-09 Eli Zaretskii <eliz@gnu.org>
5822
5823 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5824 left fringe if the window has a left margin. This avoids leaving
5825 traces of the cursor because its leftmost pixel is not drawn over.
5826
5827 * dispnew.c (update_window_line): When the left margin area of a
5828 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5829 that screen line. (Bug#12277)
5830
5831 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5832
5833 Assume C89 or later for math functions (Bug#12381).
5834 This simplifies the code, and makes it a bit smaller and faster,
5835 and (most important) makes it easier to clean up signal handling
5836 since we can stop worring about floating-point exceptions in
5837 library code. That was a problem before C89, but the problem
5838 went away many years ago on all practical Emacs targets.
5839 * data.c, image.c, lread.c, print.c:
5840 Don't include <math.h>; no longer needed.
5841 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5842 might be autoconfigured, as that never happens.
5843 * data.c (fmod):
5844 * doprnt.c (DBL_MAX_10_EXP):
5845 * print.c (DBL_DIG):
5846 Remove. C89 or later always defines these.
5847 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5848 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5849 (arith_error, domain_error, domain_error2):
5850 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5851 no longer needed -- we simply return what C returns. All uses removed.
5852 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5853 the wrapped code.
5854 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5855 Remove. All uses expanded, as these macros are no longer used
5856 more than once and are now more trouble than they're worth.
5857 (Ftan): Use tan, not sin / cos.
5858 (Flogb): Assume C89 frexp.
5859 (fmod_float): Assume C89 fmod.
5860 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5861 (init_floatfns): Remove. All uses removed.
5862
5863 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5864
5865 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5866 compositeToPoint for OSX < 10.6 (Bug#12390).
5867
5868 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5869
5870 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5871 This produces more-accurate results.
5872
5873 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5874
5875 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5876 changes (Bug#12088).
5877
5878 2012-09-08 Chong Yidong <cyd@gnu.org>
5879
5880 * syntax.c (Fstring_to_syntax): Doc fix.
5881
5882 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5883
5884 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5885 in the internal border.
5886 (x_set_window_size): Remove static variables and their usage.
5887 (ns_redraw_scroll_bars): Fix NSTRACE arg.
5888 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5889 Remove fringe/internal border adjustment (Bug#11052).
5890 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5891 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5892 (ns_fix_rect_ibw): Remove.
5893 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5894 (ns_dumpglyphs_box_or_relief): Ditto.
5895 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5896 adjustment.
5897 (ns_dumpglyphs_image): Ditto.
5898 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
5899 border adjustment.
5900 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5901 their usage. Add fringe_extended_p and its use as in other terms.
5902 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5903 scroll bar was removed.
5904 (updateFrameSize): New function.
5905 (windowDidResize): Move code to updateFrameSize and call it.
5906
5907 * nsterm.h (EmacsView): Add updateFrameSize.
5908
5909 2012-09-07 Chong Yidong <cyd@gnu.org>
5910
5911 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5912
5913 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5914
5915 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5916
5917 More signal-handler cleanup (Bug#12327).
5918 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5919 Problem introduced when merging patches. Noted by Eli Zaretskii in
5920 <http://bugs.gnu.org/12327#67>.
5921 * floatfns.c: Comment fix.
5922 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5923 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5924 and anyway the declaration is harmless even if SIGDANGER is not defined.
5925 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5926 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5927 source files not surprisingly expected syssignal.h to define, or
5928 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5929 Include <sys/ioctl.h>, for FIONREAD.
5930 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5931 This eliminates a problem whereby other files mysteriously had
5932 to include "syssignal.h" before including "systty.h" if they
5933 wanted to use "#ifdef SIGIO".
5934
5935 2012-09-07 Eli Zaretskii <eliz@gnu.org>
5936
5937 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5938
5939 * w32.c (sigemptyset): Empty the set.
5940 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5941
5942 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5943
5944 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5945
5946 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5947 (mark_object): Likewise for frame objects.
5948
5949 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5950
5951 * syssignal.h (handle_on_main_thread): Always declare,
5952 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5953 This ports to platforms without HAVE_PTHREAD.
5954
5955 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5956
5957 Signal-handler cleanup (Bug#12327).
5958 Emacs's signal handlers were written in the old 4.2BSD style with
5959 sigblock and sigmask and so forth, and this led to some
5960 inefficiencies and confusion. Rewrite these to use
5961 pthread_sigmask etc. without copying signal sets around. Also,
5962 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5963 'signal', and instead use functions that do not attempt to take
5964 over the system name space. This patch causes Emacs's text
5965 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5966 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5967 Do not include <signal.h> or "syssignal.h", as these
5968 modules do not use signals.
5969 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5970 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5971 Do not include <signal.h>, as "syssignal.h" does that for us now.
5972 * atimer.c (sigmask_atimers): New function.
5973 (block_atimers, unblock_atimers): New functions,
5974 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5975 All uses replaced.
5976 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5977 no longer needed here.
5978 * emacs.c (main): Inspect existing signal handler with sigaction,
5979 so that there's no need to block and unblock SIGHUP.
5980 * sysdep.c (struct save_signal): New member 'action', replacing
5981 old member 'handler'.
5982 (save_signal_handlers, restore_signal_handlers):
5983 Use sigaction instead of 'signal' to save and restore.
5984 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5985 New function. All users of 'signal' modified to use set_sighandler
5986 if they're writeonly, and to use sys_signal if they're read+write.
5987 (emacs_sigaction_init, forwarded_signal): New functions.
5988 (sys_signal): Remove. All uses replaced by calls to sigaction
5989 and emacs_sigaction_init, or by direct calls to 'signal'.
5990 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5991 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5992 all uses replaced by pthread_sigmask etc. calls.
5993 * syssignal.h: Include <signal.h>.
5994 (emacs_sigaction_init, forwarded_signal): New decls.
5995 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5996 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5997 (sigmask, sys_sigmask): Remove; no longer needed.
5998 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5999 (sigblock, sigunblock, sigfree):
6000 (sigsetmask) [!defined sigsetmask]:
6001 Remove. All uses replaced by pthread_sigmask.
6002 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6003 no longer need to be replaced, and its typical old uses
6004 are now done via emacs_sigaction_init and sigaction.
6005 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6006 (sys_sigdel): Remove; unused.
6007 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6008
6009 2012-09-06 Eli Zaretskii <eliz@gnu.org>
6010
6011 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6012 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6013
6014 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6015
6016 Explicitly mark buffer_defaults and buffer_local_symbols.
6017 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6018 mark_local_symbols here.
6019 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6020 since special buffers aren't marked here any more.
6021 (allocate_buffer): Chain new buffer with all_buffers here...
6022 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6023 not here.
6024 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6025 (syms_of_buffer): Remove staticpro of the above.
6026 (init_buffer_once): Set names for buffer_defaults and
6027 buffer_local_symbols.
6028
6029 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6030
6031 Use bool for booleans in font-related modules.
6032 * font.c (font_intern_prop, font_style_to_value)
6033 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6034 (generate_otf_features, font_check_otf_features, font_check_otf)
6035 (font_match_p, font_list_entities, font_at):
6036 * fontset.c (fontset_id_valid_p, reorder_font_vector
6037 (fontset_find_font, Fset_fontset_font)
6038 (face_suitable_for_char_p) [0]:
6039 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6040 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6041 (m17n_flt_initialized, ftfont_shape_by_flt):
6042 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6043 * nsfont.m (nsfont_draw):
6044 * w32font.c (w32font_draw):
6045 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6046 Use bool for booleans.
6047 * font.h: Adjust to above API changes.
6048 (struct font, struct font_driver, struct font_driver_list):
6049 Use bool for booleans.
6050 (struct font): Remove useless member encoding_type.
6051 All users removed.
6052 * fontset.c, xftfont.c: Omit unnecessary static decls.
6053
6054 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6055
6056 * alloc.c (mark_object): Revert window marking code
6057 since it's unsafe for the Fset_window_configuration.
6058
6059 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6060
6061 Fix race conditions with signal handlers and errno (Bug#12327).
6062 Be more systematic about preserving errno whenever a signal
6063 handler returns, even if it's not in the main thread. Do this by
6064 renaming signal handlers to distinguish between signal delivery
6065 and signal handling. All uses changed.
6066 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6067 * data.c (deliver_arith_signal): Rename from arith_error.
6068 * dispnew.c (deliver_window_change_signal): Rename from
6069 window_change_signal.
6070 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6071 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6072 * keyboard.c (deliver_input_available_signal): Rename from
6073 input_available_signal.
6074 (deliver_user_signal): Rename from handle_user_signal.
6075 (deliver_interrupt_signal): Rename from interrupt_signal.
6076 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6077 (deliver_child_signal): Rename from sigchld_handler.
6078 * atimer.c (handle_alarm_signal):
6079 * data.c (handle_arith_signal):
6080 * dispnew.c (handle_window_change_signal):
6081 * emacs.c (handle_fatal_signal, handle_danger_signal):
6082 * keyboard.c (handle_input_available_signal):
6083 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6084 * process.c (handle_pipe_signal, handle_child_signal):
6085 New functions, with the actual signal-handling code taken from the
6086 original respective signal handlers, sans the sporadic attempts to
6087 preserve errno, since that's now done by handle_on_main_thread.
6088 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6089 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6090 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6091 Move to sysdep.c.
6092 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6093 Move initialization of main_thread to sysdep.c's init_signals.
6094 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6095 our usage, and simplifies the mainline code.
6096 (record_child_status_change): New static function, as a helper
6097 for handle_child_signal, and with most of the old child handler's
6098 contents.
6099 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6100 (handle_child_signal): Use the above.
6101 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6102 Moved here from emacs.c.
6103 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6104 code moved here from emacs.c's main function.
6105 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6106 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6107 This lets callers save and restore errno properly.
6108
6109 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6110
6111 Remove redundant or unused things here and there.
6112 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6113 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6114 * editfns.c (Fcompare_buffer_substrings): Likewise.
6115 * frame.h (struct terminal, struct font_driver_list):
6116 Remove redundant declarations.
6117 * window.h (Qleft, Qright): Likewise.
6118
6119 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6120
6121 Do not mark objects from deleted buffers, windows and frames.
6122 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6123 (mark_object): Likewise for windows and frames.
6124
6125 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6126
6127 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6128 buffer_defaults and buffer_local_symbols as valid objects.
6129 Return special value to denote them.
6130
6131 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6132
6133 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6134 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6135 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6136 (file_name_absolute_p, Fsubstitute_in_file_name):
6137 (check_executable, check_writable, Ffile_accessible_directory_p)
6138 (Fset_file_selinux_context, Fdefault_file_modes)
6139 (Finsert_file_contents, choose_write_coding_system)
6140 (Fwrite_region, build_annotations, a_write, e_write)
6141 (Fdo_auto_save):
6142 * filelock.c (boot_time_initialized, get_boot_time)
6143 (get_boot_time_1, lock_file_1, within_one_second):
6144 * floatfns.c (in_float):
6145 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6146 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6147 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6148 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6149 * window.c (compare_window_configurations):
6150 Use bool for booleans.
6151 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6152 (Fdefault_file_modes): Now mode_t, not int, for modes.
6153 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6154 (internal_delete_file): Now returns void, not a (boolean) int,
6155 since nobody was looking at the return value.
6156 * lisp.h, window.h: Adjust to above API changes.
6157
6158 * xdisp.c (set_message): Simplify and reindent last change.
6159
6160 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
6161
6162 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6163
6164 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6165
6166 * eval.c (call_debugger): Make the function non-static so that we
6167 can call it from set_message.
6168
6169 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6170 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6171
6172 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6173
6174 Give more-useful info on a fatal error (Bug#12328).
6175 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6176 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6177 of doing the work ourselves.
6178 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6179 do most of the work.
6180 (fatal_error_backtrace): New function, taken from the guts
6181 of the old fatal_error_signal, but with a new option to output
6182 a backtrace.
6183 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6184 info about the signal than just its number.
6185 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6186 * sysdep.c: Include <execinfo.h>
6187 (emacs_backtrace): New function, taken partly from the previous
6188 code of the 'die' function.
6189 (emacs_abort): Call fatal_error_backtrace rather than abort.
6190
6191 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6192
6193 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6194 eager (load-time) macro-expansion.
6195 * lisp.mk (lisp): Add macroexp.
6196
6197 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6198
6199 Simplify redefinition of 'abort' (Bug#12316).
6200 Do not try to redefine the 'abort' function. Instead, redo
6201 the code so that it calls 'emacs_abort' rather than 'abort'.
6202 This removes the need for the NO_ABORT configure-time macro
6203 and makes it easier to change the abort code to do a backtrace.
6204 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6205 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6206 Remove; sysdep.c's emacs_abort now takes its place.
6207 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6208 'abort' changed to use 'emacs_abort'.
6209 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6210 (abort) [!defined abort]: Rename to ...
6211 (emacs_abort): ... new name.
6212 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6213 the place of the old 'abort' in emacs.c.
6214 * w32.c, w32fns.c (abort): Do not #undef.
6215 * w32.c (emacs_abort): Rename from w32_abort.
6216
6217 2012-09-04 Eli Zaretskii <eliz@gnu.org>
6218
6219 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6220 offsets[j].dv, since the y axis of the screen coordinates points
6221 down, while the y axis of the font definition coordinates points
6222 up. This fixes display of Arabic diacritics such as KASRA and
6223 KASRATAN. (Bug#11860)
6224
6225 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6226
6227 Be more systematic about _setjmp vs setjmp.
6228 * alloc.c (test_setjmp, mark_stack):
6229 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6230 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6231 (png_load, my_error_exit, jpeg_load):
6232 * process.c (send_process_trap, send_process):
6233 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6234 The underscored versions are up to 30x faster on some hosts.
6235 Formerly, the code used setjmp+longjmp sometimes and
6236 _setjmp+_longjmp at other times, with no particular reason to
6237 prefer setjmp+longjmp.
6238
6239 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 Fix minor problem found by static checking.
6242 * buffer.c (Fdelete_all_overlays): Return nil.
6243
6244 2012-09-03 Martin Rudalics <rudalics@gmx.at>
6245
6246 * buffer.c (Fdelete_all_overlays): New function.
6247
6248 2012-09-03 Chong Yidong <cyd@gnu.org>
6249
6250 * gtkutil.c: Add extern decl for Qxft.
6251
6252 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6253
6254 * emacs.c, eval.c: Use bool for boolean.
6255 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6256 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6257 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6258 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6259 (main, decode_env_path, Fdaemon_initialized):
6260 * eval.c (call_debugger, Finteractive_p, interactive_p):
6261 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6262 (maybe_call_debugger, Fbacktrace):
6263 * process.c (read_process_output, exec_sentinel):
6264 Use bool for booleans.
6265 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6266 All callers changed.
6267 * eval.c (interactive_p): Omit always-true boolean argument
6268 EXCLUDE_SUBRS_P. All callers changed.
6269 * dispextern.h, lisp.h: Reflect above API changes.
6270 * firstfile.c (dummy): Use the address of 'main', whose signature
6271 won't change, instead of the address of 'initialize', whose
6272 signature just changed from int to bool.
6273 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6274 * msdos.c (fatal_error_in_progress): ... from here.
6275 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6276 of incrementing it.
6277 (redisplay_internal, unwind_redisplay): Simply clear
6278 REDISPLAYING_P when unwinding, instead of saving its previous,
6279 always-false value and then restoring it.
6280
6281 Clean up some extern decls.
6282 Mostly, this hoists extern decls out of .c files and into .h files.
6283 That way, we're more likely to catch errors if the interfaces change.
6284 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6285 declare xg_mark_data.
6286 * dispextern.h (x_frame_parm_handlers):
6287 * font.h (Qxft):
6288 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6289 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6290 (Qultra_bold, Qoblique, Qitalic):
6291 Move extern decl here from .c file.
6292 * alloc.c (xg_mark_data) [USE_GTK]:
6293 * doc.c (Qclosure):
6294 * eval.c (Qlexical_binding):
6295 * fns.c (time) [!HAVE_UNISTD_H]:
6296 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6297 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6298 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6299 * lread.c (Qinternal_interpreter_environment):
6300 * minibuf.c (Qbuffer):
6301 * process.c (QCfamily, QCfilter):
6302 * widget.c (free_frame_faces):
6303 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6304 * xfont.c (x_clear_errors):
6305 * xterm.c (x_frame_parm_handlers):
6306 Remove now-redundant extern decls.
6307 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6308 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6309 Now static.
6310 * xfaces.c: Remove unnecessary static decls.
6311 * xterm.c (updating_frame): Remove decl of nonexistent object.
6312
6313 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6314 when building globals.h, as the objects that are not built on
6315 this host are not needed to compile C files on this host.
6316
6317 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6318
6319 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6320
6321 * frame.h: Add missing prototype for x_wm_set_size_hint.
6322
6323 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6326 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6327 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6328 (Fsubstitute_command_keys):
6329 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6330 (save_excursion_save, save_excursion_restore)
6331 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6332 (format_time_string, general_insert_function)
6333 (make_buffer_string, make_buffer_string_both)
6334 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6335 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6336 (copy_text, insert_1, insert_1_both, insert_from_string)
6337 (insert_from_string_before_markers, insert_from_string_1)
6338 (insert_from_buffer, insert_from_buffer_1, replace_range)
6339 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6340 (del_range_2, modify_region):
6341 * intervals.c (intervals_equal, balance_possible_root_interval)
6342 (adjust_intervals_for_insertion, merge_properties_sticky)
6343 (graft_intervals_into_buffer, lookup_char_property)
6344 (adjust_for_invis_intang, set_point_both)
6345 (get_property_and_range, compare_string_intervals)
6346 (set_intervals_multibyte_1, set_intervals_multibyte):
6347 * keyboard.c (decode_timer):
6348 Use bool for boolean.
6349 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6350 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6351
6352 2012-09-02 Chong Yidong <cyd@gnu.org>
6353
6354 * keymap.c (push_key_description): Print M-TAB as C-M-i
6355 (Bug#11758).
6356
6357 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
6358
6359 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6360 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6361 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6362 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6363 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6364 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6365 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6366
6367 2012-09-01 Eli Zaretskii <eliz@gnu.org>
6368
6369 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6370 more than one grapheme cluster passed to the shaper: compute the
6371 offset adjustment values separately for each cluster. (Bug#11860)
6372
6373 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6374 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6375 about implicit conversions from integer to pointer.
6376
6377 2012-09-01 Daniel Colascione <dancol@dancol.org>
6378
6379 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6380 system used too early.
6381
6382 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6383
6384 Better seed support for (random).
6385 * emacs.c (main): Call init_random.
6386 * fns.c (Frandom): Set the seed from a string argument, if given.
6387 Remove long-obsolete Gentzel cruft.
6388 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6389 (init_random): New function.
6390
6391 2012-09-01 Daniel Colascione <dancol@dancol.org>
6392
6393 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6394 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6395 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6396 x_wm_set_size_hint, x_query_colors, x_real_positions,
6397 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6398 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6399 all of which have been moved to common code.
6400
6401 * xfaces.c: Include TERM_HEADER instead of listing all possible
6402 window-system headers.
6403
6404 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6405 to match header.
6406
6407 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6408 directly accessing frame internals.
6409
6410 * w32font.h: Include font.h. Define syms_of_w32font and
6411 globals_of_w32font.
6412
6413 * process.c: Include TERM_HEADER instead of listing all possible
6414 window-system headers.
6415
6416 * nsterm.h: Remove declarations now in frame.h.
6417 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
6418
6419 * menu.c: Include TERM_HEADER instead of listing all possible
6420 window-system headers.
6421
6422 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6423 window system.
6424
6425 * keyboard.c: Include TERM_HEADER instead of listing all possible
6426 window-system headers.
6427
6428 * image.c: Include TERM_HEADER instead of listing all possible
6429 window-system headers. Declare Vlibrary_cache when compiling for
6430 Windows.
6431
6432 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6433 window system declarations.
6434
6435 * frame.h: Move common functions here: set_frame_menubar,
6436 x_set_window_size, x_sync, x_get_focus_frame,
6437 x_set_mouse_position, x_set_mouse_pixel_position,
6438 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6439 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6440 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6441 x_activate_menubar, x_real_positions, x_bitmap_icon,
6442 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6443 and x_query_colors.
6444
6445 * frame.c: Include TERM_HEADER instead of listing all possible
6446 window-system headers.
6447
6448 * font.c: Include TERM_HEADER instead of listing all possible
6449 window-system headers.
6450
6451 * emacs.c: Include TERM_HEADER.
6452
6453 * dispnew.c: Include TERM_HEADER instead of listing all possible
6454 window-system headers.
6455
6456 * ccl.h: Include character.h.
6457
6458 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6459 the current window system; include in list of objects to link into
6460 Emacs.
6461
6462 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6463
6464 Remove mark_ttys function and fix tty_display_info initialization.
6465 * lisp.h (mark_ttys): Remove prototype.
6466 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6467 to mark_ttys because all possible values of 'top_frame' slot are
6468 the frames which are reachable from Vframe_list.
6469 * term.c (mark_ttys): Remove.
6470 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6471
6472 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6473
6474 Change struct frame bitfields from unsigned char to unsigned.
6475 * frame.h (struct frame): Change type of 'display_preempted',
6476 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6477 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6478 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6479 bitfields from unsigned char to unsigned.
6480
6481 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6482
6483 Remove unused member of struct x_output and struct w32_output.
6484 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6485 * w32term.h (struct w32_output): Likewise.
6486
6487 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6488
6489 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6490 does not become zero (Bug#12234).
6491
6492 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6493
6494 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6495 for GCC 4.7.1 x86-64.
6496
6497 2012-08-30 Glenn Morris <rgm@gnu.org>
6498
6499 * lread.c (init_lread): For out-of-tree builds, only add the
6500 source directory's site-lisp dir to the load-path if it exists,
6501 consistent with in-tree builds. (Bug#12302)
6502
6503 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6504
6505 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
6506 button_values to NULL. Call setStykeMask so dialogs get a close button.
6507 (windowShouldClose:): Set window_closed.
6508 (dealloc): New member, free button_values.
6509 (process_dialog:): Make member function. Remove window argument,
6510 replace window with self. Count buttons and allocate and store values
6511 in button_values.
6512 (addButton:value:row:): value is int with the name tag. Call setTag
6513 with tag. Remove return self, declare return value as void.
6514 (addString:row:): Remove return self, declare return value as void.
6515 (addSplit): Remove return self, declare return value as void.
6516 (clicked:): Remove return self, declare return value as void.
6517 Set dialog_return to button_values[seltag]. Code formatting change.
6518 (initFromContents:isQuestion:): Adjust call to process_dialog.
6519 Code formatting change.
6520 (timeout_handler:): Set timer_fired to YES.
6521 (runDialogAt:): Set timer_fired to NO.
6522 Handle click on close button as quit.
6523
6524 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6525 Add window_closed and button_values. Add void as return value for
6526 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6527 Add process_dialog as new member.
6528
6529 2012-08-28 Eli Zaretskii <eliz@gnu.org>
6530
6531 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6532 is not one of the heaps we manage. (Bug#12242)
6533
6534 2012-08-28 Glenn Morris <rgm@gnu.org>
6535
6536 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6537
6538 2012-08-28 Martin Rudalics <rudalics@gmx.at>
6539
6540 * window.c (Fset_window_configuration): Remove handling of
6541 auto-buffer-name window parameter. Install revision of reverted
6542 fix.
6543
6544 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6545
6546 Do not allow to set major mode for a dead buffer.
6547 * buffer.c (Fset_buffer_major_mode): Signal an error
6548 if the buffer is dead.
6549 (Fother_buffer, other_buffer_safely): Remove redundant
6550 nested declaration.
6551
6552 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6553
6554 Always use set_buffer_if_live to restore original buffer at unwind.
6555 * buffer.h (record_unwind_current_buffer): New function.
6556 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6557 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6558 * undo.c, window.c: Adjust users.
6559 * buffer.c (set_buffer_if_live): Fix comment.
6560
6561 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6562
6563 Fix usage of set_buffer_internal.
6564 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6565 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6566 * coding.c (decode_coding): Omit redundant test.
6567 * fileio.c (decide_coding_unwind): Likewise.
6568 * fns.c (secure_hash): Likewise.
6569 * insdel.c (modify_region): Likewise.
6570 * keyboard.c (command_loop_1): Likewise.
6571 * print.c (PRINTFINISH): Likewise.
6572 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6573
6574 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6575
6576 * dispnew.c: Use bool for boolean.
6577 (frame_garbaged, display_completed, delayed_size_change)
6578 (fonts_changed_p, add_window_display_history)
6579 (add_frame_display_history, verify_row_hash)
6580 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6581 (row_equal_p, realloc_glyph_pool)
6582 (allocate_matrices_for_frame_redisplay)
6583 (showing_window_margins_p)
6584 (adjust_frame_glyphs_for_frame_redisplay)
6585 (build_frame_matrix_from_leaf_window, make_current)
6586 (mirrored_line_dance, mirror_line_dance, update_frame)
6587 (update_window_tree, update_single_window)
6588 (check_current_matrix_flags, update_window, update_text_area)
6589 (update_window_line, set_window_update_flags, scrolling_window)
6590 (update_frame_1, scrolling, buffer_posn_from_coords)
6591 (do_pending_window_change, change_frame_size)
6592 (change_frame_size_1, sit_for):
6593 Use bool for boolean.
6594 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6595 and remove last int (actually boolean) argument, which was always 0.
6596 All callers changed.
6597 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6598 * dispextern.h (struct composition_it): Use bool for boolean.
6599 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6600 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6601 * dired.c (file_name_completion):
6602 Use bool for boolean. (This was missed in an earlier change.)
6603
6604 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6605
6606 * window.c (Fset_window_configuration): Revert first part of
6607 last change.
6608
6609 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6610
6611 * nsterm.h (NSPanel): New class variable dialog_return.
6612
6613 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6614 Initialize dialog_return.
6615 (windowShouldClose:): Use stop instead of stopModalWithCode.
6616 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6617 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6618 event.
6619 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6620 modal loop returns.
6621
6622 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6623
6624 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6625 * composite.c (find_composition, composition_gstring_p)
6626 (composition_reseat_it, find_automatic_composition):
6627 * data.c (let_shadows_buffer_binding_p)
6628 (let_shadows_global_binding_p, set_internal, make_blv)
6629 (Fmake_variable_buffer_local, Fmake_local_variable)
6630 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6631 (cons_to_signed, arith_driver):
6632 * dbusbind.c (xd_in_read_queued_messages):
6633 * dired.c (directory_files_internal, file_name_completion):
6634 Use bool for booleans.
6635 * dired.c (file_name_completion):
6636 * process.h (fd_callback):
6637 Omit int (actually boolean) argument. It wasn't being used.
6638 All uses changed.
6639 * composite.h, lisp.h: Reflect above API changes.
6640
6641 * cmds.c, coding.c: Use bool for booleans.
6642 * cmds.c (move_point, Fself_insert_command):
6643 * coding.h (struct composition status, struct coding_system):
6644 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6645 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6646 (emacs_mule_char, decode_coding_emacs_mule)
6647 (encode_coding_emacs_mule, detect_coding_iso_2022)
6648 (decode_coding_iso_2022, encode_invocation_designation)
6649 (encode_designation_at_bol, encode_coding_iso_2022)
6650 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6651 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6652 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6653 (encode_coding_raw_text, detect_coding_charset)
6654 (decode_coding_charset, encode_coding_charset, detect_eol)
6655 (detect_coding, get_translation_table, produce_chars)
6656 (consume_chars, reused_workbuf_in_use)
6657 (make_conversion_work_buffer, code_conversion_save)
6658 (decode_coding_object, encode_coding_object)
6659 (detect_coding_system, char_encodable_p)
6660 (Funencodable_char_position, code_convert_region)
6661 (code_convert_string, code_convert_string_norecord)
6662 (Fset_coding_system_priority):
6663 * fileio.c (Finsert_file_contents):
6664 Use bool for booleans.
6665 * coding.h, lisp.h: Reflect above API changes.
6666 * coding.c: Remove unnecessary static function decls.
6667 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6668 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6669 not a boolean 'int', since callers never look at the return value.
6670 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6671 * coding.h (decoding_buffer_size, encoding_buffer_size)
6672 (emacs_mule_string_char): Remove unused extern decls.
6673 (struct iso_2022_spec, struct coding_system):
6674 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6675 (struct emacs_mule_spec): Remove unused field 'full_support'.
6676 All initializations removed.
6677 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6678
6679 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6680
6681 Fix spare memory change (Bug#12286).
6682 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6683 (valid_lisp_object_p): Likewise.
6684
6685 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6686
6687 * window.c (Fset_window_configuration): Record any window's old
6688 buffer if it's replaced (see Bug#8789). If the new current
6689 buffer doesn't appear in the selected window, go to its old
6690 point (Bug#12208).
6691
6692 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6693
6694 Special MEM_TYPE_SPARE to denote reserved memory.
6695 * alloc.c (enum mem_type): New memory type.
6696 (refill_memory_reserve): Use new type for spare memory.
6697 This prevents live_cons_p and live_string_p from incorrect
6698 detection of uninitialized objects from spare memory as live.
6699
6700 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6701
6702 Spelling fixes.
6703 * Makefile.in (.PHONY): versioclean -> versionclean.
6704
6705 Remove unused external symbols.
6706 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6707 * window.c (Qwindow_valid_p, decode_valid_window):
6708 Now static, not extern.
6709 * data.c (Qinterval): Remove; unused.
6710 (syms_of_data): Do not define 'interval'.
6711 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6712 * window.h (decode_valid_window):
6713 Remove decls.
6714
6715 * character.c, charset.c, chartab.c: Use bool for booleans.
6716 * character.c (lisp_string_width, string_count_byte8)
6717 (string_escape_byte8):
6718 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6719 (load_charset_map_from_file, map_charset_chars)
6720 (Fdefine_charset_internal, define_charset_internal)
6721 (Fdeclare_equiv_charset, find_charsets_in_text)
6722 (Ffind_charset_region, char_charset, Fiso_charset):
6723 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6724 (sub_char_table_set, sub_char_table_set_range)
6725 (char_table_set_range, optimize_sub_char_table)
6726 (map_sub_char_table):
6727 Use bool for boolean.
6728 * character.c (str_to_unibyte): Omit last boolean argument; it was
6729 always 0. All callers changed.
6730 * character.h, charset.h: Adjust to match previous changes.
6731 * character.h (char_printable_p): Remove decl of nonexistent function.
6732 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6733 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6734 are all boolean, so make them single-bit bitfields.
6735
6736 * lisp.h (ASET): Remove attempt to detect side effects.
6737 It was meant to be temporary and it often doesn't work,
6738 because when IDX has side effects the behavior of IDX==IDX
6739 is undefined. See Stefan Monnier in
6740 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6741
6742 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6743
6744 * lisp.h (functionp): New function (extracted from Ffunctionp).
6745 (FUNCTIONP): Use it.
6746 * eval.c (Ffunctionp): Use it.
6747
6748 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6749
6750 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6751 as that's faster and simpler than static storage. Don't bother
6752 with the g_main_context_query overhead if g_main_context_pending
6753 says no events are pending.
6754 (gfds, gfds_size): Remove these static vars.
6755 (xgselect_initialize): Remove; no longer needed.
6756 All uses and decls removed.
6757
6758 * emacs.c (fatal_error_signal_hook): Remove.
6759 All uses removed. This leftover from old code was always 0.
6760
6761 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6762 * casefiddle.c (casify_object, casify_region):
6763 * casetab.c (set_case_table):
6764 * category.c, category.h (word_boundary_p):
6765 * category.h (CHAR_HAS_CATEGORY):
6766 Use bool for booleans, instead of int.
6767
6768 2012-08-25 Eli Zaretskii <eliz@gnu.org>
6769
6770 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6771
6772 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 On assertion failure, print backtrace if available.
6775 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6776 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6777 * Makefile.in (LIB_EXECINFO): New macro.
6778 (LIBES): Use it.
6779
6780 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6781 * bytecode.c (exec_byte_code):
6782 * callint.c (check_mark, Fcall_interactively):
6783 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6784 (getenv_internal, sync_process_alive, call_process_exited):
6785 * lisp.h (USE_SAFE_ALLOCA):
6786 Use bool for booleans, instead of int.
6787 * lisp.h, process.h: Adjust prototypes to match above changes.
6788 * callint.c (Fcall_interactively): Don't assume the mark's
6789 offset fits in 'int'.
6790
6791 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6792
6793 * buffer.c, buffer.h: Use bool for boolean.
6794 * buffer.c (reset_buffer_local_variables)
6795 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6796 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6797 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6798 (overlay_touches_p, overlay_strings, Foverlay_put)
6799 (report_overlay_modification, call_overlay_mod_hooks):
6800 (mmap_enlarge, mmap_set_vars):
6801 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6802 Use bool for booleans, instead of int.
6803 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6804 since the 1-or-0 return value is always ignored anyway.
6805 (mmap_initialized_p):
6806 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6807 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6808
6809 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6810
6811 * bidi.c: Use bool for boolean.
6812 This is a bit more readable, and makes the text segment of bidi.o
6813 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6814 Presumably it's faster too.
6815 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6816 Now bool.
6817 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6818 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6819 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6820 (bidi_explicit_dir_char, bidi_level_of_next_char)
6821 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6822 Use bool for booleans, instead of int.
6823 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6824 (bidi_unshelve_cache): Adjust decls to match code.
6825
6826 2012-08-23 Martin Rudalics <rudalics@gmx.at>
6827
6828 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6829 argument.
6830
6831 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6832
6833 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6834 * atimer.h: Include <stdbool.h>.
6835
6836 2012-08-22 Dan Nicolaescu <dann@gnu.org>
6837
6838 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6839 compile time tests instead of run time tests on systems that do
6840 not use them.
6841 (FRAME_MAC_P): Remove leftover from deleted code.
6842 * frame.c (syms_of_frame): Remove leftover from deleted code.
6843
6844 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6845
6846 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6847
6848 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6849
6850 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6851 Otherwise, the compiler complains about (A?B:C) where B is void
6852 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
6853 (fontset_add): Return void, for FONTSET_ADD.
6854
6855 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6856
6857 * alloc.c: Use bool for booleans.
6858 (gc_in_progress, abort_on_gc)
6859 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6860 (dont_register_blocks) [GC_MALLOC_CHECK]:
6861 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6862 (check_string_bytes, make_specified_string, memory_full)
6863 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6864 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6865 (mark_stack, valid_pointer_p, make_pure_string)
6866 (Fgarbage_collect, survives_gc_p, gc_sweep):
6867 Use bool for booleans, instead of int.
6868 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6869 Remove unused local.
6870 * alloc.c (PURE_POINTER_P):
6871 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6872 * editfns.c (Fformat):
6873 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6874 (Fdo_auto_save):
6875 * fns.c (sweep_weak_table):
6876 * lisp.h (suppress_checking, push_message, survives_gc_p)
6877 (make_pure_string, gc_in_progress, abort_on_gc):
6878 * lread.c (readchar, read1):
6879 * print.c (Fprin1_to_string):
6880 * xdisp.c (push_message):
6881 Use bool for booleans affected directly or indirectly by
6882 alloc.c's changes.
6883
6884 Make recently-introduced setters macros.
6885 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6886 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6887 (set_fontset_default, set_fontset_fallback): Rename from their
6888 upper-case counterparts, and make them functions rather than macros.
6889 This is more consistent with the other recently-introduced setters.
6890 These don't need to be inline, since they're local.
6891
6892 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6893
6894 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6895 the loop (Bug#12247).
6896
6897 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6898
6899 * lisp.h (vcopy): Use memcpy rather than our own loop.
6900 This fixes a performance regression introduced by the recent
6901 addition of vcopy. This means 'vcopy' will need to be modified
6902 for a copying collector, but that's OK. Also, tighten the
6903 checking in the assertion.
6904
6905 2012-08-21 Eli Zaretskii <eliz@gnu.org>
6906
6907 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6908 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6909 non-base glyph for the width of the base character, according to
6910 what x_draw_composite_glyph_string_foreground expects.
6911 Generate WADJUST value according to composition_gstring_width's
6912 expectations, to produce correct width of the composed character.
6913 Reverse the sign of the DU offset produced by ScriptPlace.
6914
6915 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6916
6917 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6918
6919 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6920
6921 Avoid direct writes to contents member of struct Lisp_Vector.
6922 * lisp.h (vcopy): New function to copy data into vector.
6923 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6924 * fns.c (Ffillarray): Use ASET.
6925 * keyboard.c (timer_check_2): Use AREF and ASET.
6926 (append_tool_bar_item, Frecent_keys): Use vcopy.
6927 * lread.c (read_vector): Use ASET.
6928 * msdos.c (Frecent_doskeys): Use vcopy.
6929 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6930 (Finternal_merge_in_global_face): Use ASET and vcopy.
6931 * xfont.c (xfont_list_pattern): Likewise.
6932
6933 2012-08-21 Martin Rudalics <rudalics@gmx.at>
6934
6935 * window.c (Fwindow_point): For the selected window always return
6936 the position of its buffer's point.
6937 (Fset_window_point): For the selected window always go in its
6938 buffer to the specified position.
6939
6940 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6941
6942 Setter macros for fontsets.
6943 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6944 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6945 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6946 Adjust users.
6947
6948 2012-08-20 Glenn Morris <rgm@gnu.org>
6949
6950 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6951 Don't assume that `ln -f' works.
6952
6953 2012-08-20 Eli Zaretskii <eliz@gnu.org>
6954
6955 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6956 and later about non-assignments with no effect. See discussion at
6957 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6958 details.
6959
6960 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6961
6962 Inline setter functions for Lisp_Objects slots of struct specbinding.
6963 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6964 Adjust users.
6965
6966 2012-08-20 Martin Rudalics <rudalics@gmx.at>
6967
6968 * window.c (select_window): Always make selected window's buffer
6969 current.
6970
6971 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6972
6973 Use AREF and ASET for docstrings of category tables.
6974 * category.h (CATEGORY_DOCSTRING): Use AREF.
6975 (SET_CATEGORY_DOCSTRING): Use ASET.
6976 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6977
6978 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6979
6980 Inline setter functions for hash table members.
6981 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6982 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6983 (set_hash_key_and_value, set_hash_index, set_hash_next)
6984 (set_hash_hash): New functions.
6985 * charset.c, fns.c: Adjust users.
6986
6987 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6988
6989 Inline getter and setter functions for per-buffer values.
6990 * buffer.h (per_buffer_default, set_per_buffer_default)
6991 (per_buffer_value, set_per_buffer_value): New functions.
6992 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6993 * buffer.c, data.c: Adjust users.
6994
6995 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
6996
6997 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6998
6999 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7000
7001 Rely on <config.h> + <unistd.h> to declare 'environ',
7002 as gnulib does this if the system doesn't.
7003 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7004 Remove declaration. MS-Windows declares it on stdlib.h which is
7005 included by conf_post.h.
7006 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7007 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7008 * vm-limit.c: Include <unistd.h>, for 'environ'.
7009
7010 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7011 (start_of_data): Remove decl; mem-limits.h provides it.
7012
7013 * xdisp.c (handle_invisible_prop): Make it a bit faster
7014 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7015
7016 2012-08-19 Chong Yidong <cyd@gnu.org>
7017
7018 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7019 ends (Bug#3874).
7020
7021 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7022
7023 * .gdbinit: Use call instead of set when calling a function in the
7024 inferior.
7025
7026 * data.c (set_internal): Don't use set_blv_found.
7027 (Fkill_local_variable): Likewise.
7028
7029 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7030
7031 * nsfont.m (ns_ascii_average_width): Ensure the string
7032 ascii_printable is initialized with a null-terminated character
7033 array. Otherwise, it can contain undesired extra characters.
7034
7035 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7036
7037 port new setting code to Sun C 5.8 2005/10/13
7038 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7039 Return void, not Lisp_Object. Otherwise, the compiler
7040 complains about (A?B:C) where B is void and C is Lisp_Object
7041 when compiling CHAR_TABLE_SET, due to the recent change to
7042 the API of sub_char_table_set_contents.
7043
7044 2012-08-18 Chong Yidong <cyd@gnu.org>
7045
7046 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7047 for the string case (Bug#3874).
7048
7049 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7050
7051 * buffer.h (BSET): Remove (Bug#12215).
7052 Replace all uses with calls to new setter functions.
7053 (bset_bidi_paragraph_direction, bset_case_canon_table)
7054 (bset_case_eqv_table, bset_directory, bset_display_count)
7055 (bset_display_time, bset_downcase_table)
7056 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7057 (bset_last_selected_window, bset_local_var_alist)
7058 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7059 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7060 (bset_width_table):
7061 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7062 (bset_auto_fill_function, bset_auto_save_file_format)
7063 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7064 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7065 (bset_cache_long_line_scans, bset_case_fold_search)
7066 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7067 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7068 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7069 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7070 (bset_header_line_format, bset_indicate_buffer_boundaries)
7071 (bset_indicate_empty_lines, bset_invisibility_spec)
7072 (bset_left_fringe_width, bset_major_mode, bset_mark)
7073 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7074 (bset_name, bset_overwrite_mode, bset_pt_marker)
7075 (bset_right_fringe_width, bset_save_length)
7076 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7077 (bset_scroll_up_aggressively, bset_selective_display)
7078 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7079 (bset_word_wrap, bset_zv_marker):
7080 * category.c (bset_category_table):
7081 * syntax.c (bset_syntax_table):
7082 New setter functions.
7083
7084 * process.h (PSET): Remove (Bug#12215).
7085 Replace all uses with calls to new setter functions.
7086 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7087 (PROCESS_INLINE): New macro.
7088 (pset_childp): New setter function.
7089 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7090 * process.c (PROCESS_INLINE):
7091 Define to EXTERN_INLINE, so that the corresponding functions
7092 are compiled into code.
7093 (pset_buffer, pset_command, pset_decode_coding_system)
7094 (pset_decoding_buf, pset_encode_coding_system)
7095 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7096 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7097 (pset_type, pset_write_queue): New setter functions.
7098
7099 * window.h (WSET): Remove (Bug#12215).
7100 Replace all uses with calls to new setter functions.
7101 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7102 (WINDOW_INLINE): New macro.
7103 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7104 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7105 (wset_total_lines, wset_vertical_scroll_bar)
7106 (wset_window_end_pos, wset_window_end_valid)
7107 (wset_window_end_vpos): New setter functions.
7108 * window.c (WINDOW_INLINE):
7109 Define to EXTERN_INLINE, so that the corresponding functions
7110 are compiled into code.
7111 (wset_combination_limit, wset_dedicated, wset_display_table)
7112 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7113 (wset_new_normal, wset_new_total, wset_next_buffers)
7114 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7115 (wset_prev_buffers, wset_right_fringe_width)
7116 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7117 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7118 (wset_window_parameters):
7119 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7120 (wset_column_number_displayed, wset_region_showing):
7121 New setter functions.
7122
7123 * termhooks.h (TSET): Remove (Bug#12215).
7124 Replace all uses with calls to new setter functions.
7125 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7126 (TERMHOOKS_INLINE): New macro.
7127 (tset_charset_list, tset_selection_alist): New setter functions.
7128 * terminal.c (TERMHOOKS_INLINE):
7129 Define to EXTERN_INLINE, so that the corresponding functions
7130 are compiled into code.
7131 (tset_param_alist): New setter function.
7132
7133 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 * keyboard.h (KSET): Remove (Bug#12215).
7136 Replace all uses with calls to new setter functions.
7137 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7138 (KEYBOARD_INLINE): New macro.
7139 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7140 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7141 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7142 New setter functions.
7143 * keyboard.c (KEYBOARD_INLINE):
7144 Define to EXTERN_INLINE, so that the corresponding functions
7145 are compiled into code.
7146 (kset_echo_string, kset_kbd_queue)
7147 (kset_keyboard_translate_table, kset_last_prefix_arg)
7148 (kset_last_repeatable_command, kset_local_function_key_map)
7149 (kset_overriding_terminal_local_map, kset_real_last_command)
7150 (kset_system_key_syms): New setter functions.
7151
7152 * frame.h (FSET): Remove (Bug#12215).
7153 Replace all uses with calls to new setter functions.
7154 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7155 (FRAME_INLINE): New macro.
7156 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7157 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7158 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7159 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7160 (fset_param_alist, fset_root_window, fset_scroll_bars)
7161 (fset_selected_window, fset_title, fset_tool_bar_items)
7162 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7163 * frame.c (FRAME_INLINE):
7164 Define to EXTERN_INLINE, so that the corresponding functions
7165 are compiled into code.
7166 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7167
7168 A few more naming-convention fixes for getters and setters.
7169 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7170 and rename from buffer_overlays_set_before.
7171 (set_buffer_overlays_after): Move here from buffer.h, and rename
7172 from buffer_overlays_set_after.
7173 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7174 All uses changed.
7175 (set_buffer_intervals): Rename from buffer_set_intervals.
7176 * intervals.c (set_interval_object): Move here from intervals.h,
7177 and rename from interval_set_object.
7178 (set_interval_left): Move here from intervals.h, and rename from
7179 interval_set_left.
7180 (set_interval_right): Move here from intervals.h, and rename from
7181 interval_set_right.
7182 (copy_interval_parent): Move here from intervals.h, and rename from
7183 interval_copy_parent.
7184 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7185 (set_interval_plist): Rename from interval_set_plist.
7186 Return void, not Lisp_Object, since no caller uses the result.
7187 * lisp.h (string_intervals): Rename from string_get_intervals.
7188 (set_string_intervals): Rename from string_set_intervals.
7189
7190 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7191 (set_char_table_contents): Rename from char_table_set_contents.
7192 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7193 All uses changed. See the end of
7194 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7195
7196 * lisp.h (CSET): Remove (Bug#12215).
7197 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7198 (set_char_table_purpose): New functions,
7199 replacing CSET. All uses changed. For example, replace
7200 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7201 "set_char_table_parent (char_table, parent);".
7202 The old version was confusing because it used the same name
7203 'parent' for two different things.
7204
7205 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7206
7207 Functions to get and set Lisp_Object fields of buffer-local variables.
7208 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7209 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7210 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7211 * data.c, eval.c, frame.c: Adjust users.
7212
7213 2012-08-17 Chong Yidong <cyd@gnu.org>
7214
7215 * xfaces.c (merge_face_vectors): If the target font specfies a
7216 font spec, make the font's attributes take precedence over
7217 directly-specified attributes.
7218 (merge_face_ref): Recognize :font.
7219
7220 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7221
7222 Do not use memcpy for copying intervals.
7223 * intervals.c (reproduce_interval): New function.
7224 (reproduce_tree, reproduce_tree_obj): Use it.
7225 (reproduce_tree_obj): Remove prototype.
7226
7227 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7228
7229 * lisp.h (duration_to_sec_usec): Remove unused decl.
7230
7231 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7232
7233 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7234 to an allocated instance of NSString, not to the class itself.
7235
7236 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
7237
7238 * makefile.w32-in (C_CTYPE_H): New macro.
7239 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7240 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7241 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7242
7243 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7244
7245 Use ASCII tests for character types.
7246 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7247 * xfns.c, xterm.c:
7248 Don't include <ctype.h>; was not needed.
7249 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7250 * sysdep.c, xfaces.c:
7251 Include <c-ctype.h> instead of <ctype.h>.
7252 * nsterm.m: Include <c-ctype.h>.
7253 * charset.c (read_hex):
7254 * doc.c (Fsnarf_documentation):
7255 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7256 (DRIVE_LETTER) [DOS_NT]:
7257 (Ffile_name_directory, Fexpand_file_name)
7258 (Fsubstitute_in_file_name):
7259 * font.c (font_parse_xlfd, font_parse_fcname):
7260 * frame.c (x_set_font_backend):
7261 * gtkutil.c (xg_get_font):
7262 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7263 * nsimage.m (hexchar):
7264 * nsterm.m (ns_xlfd_to_fontname):
7265 * sysdep.c (system_process_attributes):
7266 * xfaces.c (hash_string_case_insensitive):
7267 Use C-locale tests instead of locale-specific tests for character
7268 types, since we want the ASCII interpretation here, not the
7269 interpretation suitable for whatever happens to be the current locale.
7270
7271 2012-08-16 Martin Rudalics <rudalics@gmx.at>
7272
7273 Consistently check windows for validity/liveness
7274 (Bug#11984, Bug#12025, Bug#12026).
7275 * lisp.h (CHECK_VALID_WINDOW): New macro.
7276 * window.c (decode_window): Rename to decode_live_window.
7277 (decode_valid_window, Fwindow_valid_p): New functions.
7278 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7279 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7280 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7281 (Fwindow_prev_sibling, Fwindow_combination_limit)
7282 (Fset_window_combination_limit, Fwindow_use_time)
7283 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7284 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7285 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7286 (Fwindow_hscroll, Fset_window_hscroll)
7287 (Fwindow_redisplay_end_trigger)
7288 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7289 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7290 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7291 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7292 (Fwindow_end, Fset_window_point, Fset_window_start)
7293 (Fpos_visible_in_window_p, Fwindow_line_height)
7294 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7295 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7296 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7297 (Fset_window_parameter, Fwindow_display_table)
7298 (Fset_window_display_table, Fdelete_other_windows_internal)
7299 (Fset_window_buffer, Fset_window_new_total)
7300 (Fset_window_new_normal, Fdelete_window_internal)
7301 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7302 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7303 (Fwindow_scroll_bars): Check whether argument window is a valid or
7304 live window. Update doc-strings.
7305 (syms_of_window): New symbol Qwindow_valid_p.
7306 * keyboard.c (Fposn_at_x_y): Check whether argument
7307 frame_or_window denotes a valid window.
7308
7309 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7310
7311 Fix previous char table change.
7312 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7313 * chartab.c (optimize_sub_char_table): Likewise.
7314
7315 2012-08-16 Chong Yidong <cyd@gnu.org>
7316
7317 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7318
7319 * xfont.c (xfont_open):
7320 * xftfont.c (xftfont_open): Set the font's max_width field.
7321
7322 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7323 min_width to space_width and average_width to the average over
7324 printable ASCII characters.
7325 (ns_char_width): Code cleanup.
7326 (ns_ascii_average_width): New utility function.
7327
7328 * font.h (struct font): Update comments.
7329
7330 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7331
7332 Simple interface to set Lisp_Object fields of character tables.
7333 * lisp.h (CSET): New macro.
7334 (char_table_set_extras, char_table_set_contents)
7335 (sub_char_table_set_contents): New function.
7336 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7337 * syntax.c: Adjust users.
7338
7339 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7340
7341 * eval.c (eval_sub): Bind lexical-binding.
7342 * lread.c (Qlexical_binding): Make non-static.
7343
7344 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7345
7346 * nsmenu.m (popupSession): Remove.
7347 (pop_down_menu): Remove endModalSession.
7348 (timeout_handler:): New method.
7349 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7350 Call runModalForWindow. Check timer_fired when it returns.
7351 If not set, cancel timer and break out of loop.
7352 Otherwise loop again, with a new timeout.
7353
7354 * nsterm.m: Include fcntl.h if present.
7355 (fd_entry, t_readfds, inNsSelect): Remove.
7356 (select_writefds, select_valid, select_timeout, selfds)
7357 (select_mutex, apploopnr): Add.
7358 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7359 Otherwise call kbd_buffer_store_event.
7360 (ns_send_appdefined): Remove release of fd_entry.
7361 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7362 Increment and decrement apploopnr.
7363 (ns_select): If no file descriptors, just do a NSTimer.
7364 Otherwise copy read/write masks and start select thread (fd_handler).
7365 Start main loop and wait for application defined event.
7366 Inform select thread to stop selecting after main loop is exited.
7367 (ns_term_init): Create selfds pipe and set non-blocking.
7368 Initialize select_mutex. Start the select thread (fd_handler).
7369 (fd_handler:): Loop forever, wait for info from the main thread
7370 to either start or stop selecting. When select returns, send
7371 and appdefined event.
7372 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7373 If not call kbd_buffer_store_event.
7374
7375 * nsterm.h (EmacsApp): fd_handler takes id argument.
7376 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7377
7378 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7379
7380 2012-08-15 Eli Zaretskii <eliz@gnu.org>
7381
7382 * region-cache.c (move_cache_gap): Update gap_len using the actual
7383 growth of the boundaries array. Do not change cache_len.
7384 (Bug#12196)
7385
7386 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7387
7388 Generalize and cleanup font subsystem checks.
7389 * font.h (FONT_DEBUG, font_assert): Remove.
7390 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7391 Change font_assert to eassert. Use eassert where appropriate.
7392
7393 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7394
7395 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7396
7397 2012-08-15 Chong Yidong <cyd@gnu.org>
7398
7399 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7400 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7401 extract the font descriptor instead of just the font name.
7402 In that case, return a font spec instead of a string.
7403 (x_last_font_name): Move to this file from xfns.c.
7404
7405 * xfns.c (Fx_select_font): The return value can also be a font
7406 spec. Move x_last_font_name management to gtkutil.c.
7407
7408 * xfaces.c: Make font weight and style symbols non-static.
7409
7410 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7411
7412 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7413 (bug#12117).
7414
7415 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7416
7417 * alloc.c (Fgarbage_collect): Use plural form consistently.
7418
7419 2012-08-14 Eli Zaretskii <eliz@gnu.org>
7420
7421 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7422 iteration through the command loop. Fixes a problem whereby mouse
7423 movements are ignored until the first mouse click.
7424
7425 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7426
7427 Use bool, not int, for Lisp booleans.
7428 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7429 makes Emacs a bit smaller and presumably a bit faster.
7430 * lisp.h: Include <stdbool.h>.
7431 (struct Lisp_Boolfwd, defvar_bool):
7432 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7433 * regex.c [!emacs]: Include <stdbool.h>.
7434 (false, true): Remove; <stdbool.h> does this for us now.
7435
7436 2012-08-14 Chong Yidong <cyd@gnu.org>
7437
7438 * character.c (Fcharacterp): Doc fix (Bug#12076).
7439
7440 * data.c (Findirect_variable): Doc fix (Bug#11040).
7441
7442 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7443
7444 * editfns.c (Fformat): Doc fix (Bug#12059).
7445 (Fsave_current_buffer): Doc fix (Bug#11542).
7446
7447 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7448
7449 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7450 (bug#12022).
7451
7452 2012-08-14 Martin Rudalics <rudalics@gmx.at>
7453
7454 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7455 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7456 * minibuf.c (choose_minibuf_frame, read_minibuf):
7457 * w32fns.c (x_create_tip_frame):
7458 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7459 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7460
7461 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7462
7463 * intervals.c (offset_intervals): Remove obsolete comment.
7464
7465 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7466
7467 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7468
7469 2012-08-14 Gergely Risko <gergely@risko.hu>
7470
7471 * coding.c (decode_coding): Record buffer modification before
7472 disabling undo_list (Bug#11773).
7473
7474 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7475
7476 Revert and cleanup some recent overlay changes.
7477 * buffer.h (enum overlay_type): Remove.
7478 (buffer_get_overlays, buffer_set_overlays): Likewise.
7479 (buffer_set_overlays_before, buffer_set_overlays_after):
7480 New function. Adjust users.
7481 (unchain_both): Add eassert.
7482
7483 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7484
7485 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7486
7487 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7488
7489 * gtkutil.c (xg_mark_data): Don't assume C99.
7490
7491 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7492
7493 * gtkutil.c (xg_frame_tb_info): New struct.
7494 (TB_INFO_KEY): New define.
7495 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7496 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7497 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7498 if not present.
7499 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
7500 is up to date. Otherwise store new data.
7501 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7502
7503 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7504
7505 Use KSET for write access to Lisp_Object members of struct kboard.
7506 * keyboard.h (KSET): New macro.
7507 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7508 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7509 * xterm.c: Adjust users.
7510
7511 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7512
7513 Use BSET for write access to Lisp_Object members of struct buffer.
7514 * buffer.h (BSET): New macro.
7515 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7516 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7517 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7518 * window.c, xdisp.c, xfns.c: Adjust users.
7519
7520 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7521
7522 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7523
7524 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7525
7526 * nsterm.m (not_in_argv): New function.
7527 (application:openFile, application:openTempFile:):
7528 (application:openFileWithoutUI:, application:openFiles:): Open file
7529 if not_in_argv returns non-zero (bug#12171).
7530
7531 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
7532 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7533 Define for Gtk+ versions less than 3.2.
7534 (xg_get_font_name): Use those functions/macros here.
7535 Reported by Frans Oilinki <moilinki@gmail.com>.
7536
7537 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7538
7539 * unexmacosx.c (copy_data_segment): Copy initialized data in
7540 statically linked libraries from input file rather than memory.
7541
7542 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7543 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7544 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7545
7546 2012-08-10 Glenn Morris <rgm@gnu.org>
7547
7548 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7549 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7550
7551 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7552
7553 Fix last change to allow compilation with low optimization levels.
7554 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7555 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7556
7557 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7558
7559 Use common inline syntax in intervals.h.
7560 * intervals.h (INTERVALS_INLINE): New macro.
7561 Change all users from LISP_INLINE.
7562
7563 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7564
7565 Define Qnone once for all platforms.
7566 * frame.c (Qnone): Define here.
7567 (syms_of_frame): DEFSYM it.
7568 * lisp.h (Qnone): New declaration.
7569 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7570 * xfns.c: Remove duplication. Adjust users.
7571
7572 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7573
7574 Remove unused macros from intervals.h.
7575 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7576 * intervals.c: Adjust comment.
7577
7578 2012-08-10 Eli Zaretskii <eliz@gnu.org>
7579
7580 * w32fns.c <w32_unicode_gui>: New static variable.
7581 (globals_of_w32fns): Initialize it according to os_subtype.
7582 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7583 testing os_subtype.
7584
7585 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
7586 Eli Zaretskii <eliz@gnu.org>
7587
7588 Fix bug #10299 with Unicode characters sent by customized
7589 keyboards created by MSKLC.
7590 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7591 (w32_init_class): Use it to initialize the Emacs class with either
7592 ANSI or Unicode API calls.
7593 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7594 later.
7595 (w32_wnd_proc): If the character code sent by WM_CHAR or
7596 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7597 original message. Call DefWindowProcW on NT and later.
7598
7599 2012-08-10 Glenn Morris <rgm@gnu.org>
7600
7601 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7602
7603 * lisp.h (DIRECTORY_SEP): Let configure set it.
7604
7605 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7606
7607 Use TSET for write access to Lisp_Object slots of struct terminal.
7608 * termhooks.h (TSET): New macro.
7609 * coding.c, terminal.c, xselect.c: Adjust users.
7610
7611 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7612
7613 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7614 the failing expression, include them in the error message.
7615 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7616 * lisp.h (internal_condition_case_n): Update declaration.
7617
7618 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7619
7620 Inline functions to examine and change buffer overlays.
7621 * buffer.c (unchain_both): New function.
7622 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7623 (buffer_has_overlays): New function.
7624 (enum overlay_type): New enum.
7625 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7626 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7627
7628 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7629
7630 Inline functions to examine and change buffer intervals.
7631 * alloc.c (mark_interval_tree): Remove.
7632 (MARK_INTERVAL_TREE): Simplify.
7633 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7634 * intervals.c (buffer_balance_intervals): New function.
7635 (graft_intervals_into_buffer): Adjust indentation.
7636 (set_intervals_multibyte): Simplify.
7637 * buffer.h (BUF_INTERVALS): Remove.
7638 (buffer_get_intervals, buffer_set_intervals): New function.
7639 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7640 * intervals.c, textprop.c: Adjust users.
7641
7642 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7643
7644 Inline functions to examine and change string intervals.
7645 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7646 (string_get_intervals, string_set_intervals): New function.
7647 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7648 * lread.c, print.c, textprop.c: Adjust users.
7649
7650 2012-08-08 Glenn Morris <rgm@gnu.org>
7651
7652 * lisp.mk (lisp): Remove language/persian.elc.
7653
7654 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7655
7656 Cleanup intervals.
7657 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7658 (NULL_INTERVAL_P): Likewise. Adjust users.
7659 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7660 Adjust comment. Move under #if 0.
7661 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7662 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7663
7664 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7665
7666 Check total length of intervals with eassert.
7667 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7668 * intervals.c: Change all users to eassert.
7669
7670 2012-08-07 Eli Zaretskii <eliz@gnu.org>
7671
7672 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7673 Rename fields to match removal of FGET and WGET and disuse of
7674 INTERNAL_FIELD in Lisp_Cons.
7675
7676 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7677
7678 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7679 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7680 name since all xname users are fixed long time ago. Do not
7681 use INTERNAL_FIELD.
7682 (set_symbol_name, set_symbol_function, set_symbol_plist):
7683 (set_symbol_next, set_overlay_plist): New function.
7684 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7685 (struct Lisp_Overlay): Likewise.
7686 (CVAR, MVAR, SVAR): Remove.
7687 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7688 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7689 * xterm.c: Adjust users.
7690 * .gdbinit: Change to use name field of struct Lisp_Symbol
7691 where appropriate.
7692
7693 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7694
7695 Basic functions to set Lisp_Object and pointer slots of intervals.
7696 * intervals.h (interval_set_parent, interval_set_object):
7697 (interval_set_left, interval_set_right, interval_set_plist):
7698 (interval_copy_parent): New function.
7699 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7700 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7701 Adjust indentation.
7702 (INTERVAL_SIZE): Remove. Adjust users.
7703 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7704
7705 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7706
7707 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7708 * process.h (PGET): Remove.
7709 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7710 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7711
7712 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7713
7714 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7715 * window.h (WGET): Remove.
7716 (struct window): Do not use INTERNAL_FIELD.
7717 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7718 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7719 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7720 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7721 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7722 Adjust users.
7723
7724 2012-08-07 Chong Yidong <cyd@gnu.org>
7725
7726 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7727 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7728 (Fdelete_window_internal): Signal an error if the window is not on
7729 a live frame (Bug#12025).
7730
7731 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7732
7733 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7734 * frame.h (FGET): Remove.
7735 (struct frame): Do not use INTERNAL_FIELD.
7736 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7737 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7738 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7739 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7740
7741 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
7742
7743 * w32.c: Silence compiler warnings.
7744 (map_w32_filename): Remove unused variable `is_fat'.
7745 (chase_symlinks): Add parentheses around expression.
7746
7747 2012-08-06 Glenn Morris <rgm@gnu.org>
7748
7749 * sysdep.c: Respect BROKEN_GETWD.
7750
7751 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7752 Let configure handle it.
7753 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7754
7755 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7756
7757 Use GCALIGNMENT where appropriate.
7758 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7759 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7760 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7761
7762 2012-08-06 Eli Zaretskii <eliz@gnu.org>
7763
7764 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7765 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
7766
7767 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7768
7769 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7770 that should be sufficient for everyone.
7771
7772 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7773
7774 * keyboard.c (timer_check_2): Add break so timer_check returns next
7775 timeout.
7776
7777 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7778
7779 Fix Windows build errors introduced after converting to WGET and WSET.
7780 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7781 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7782
7783 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7784
7785 * nsterm.m (ns_frame_rehighlight): Use FSET.
7786
7787 * nsmenu.m (ns_update_menubar): Use FSET.
7788
7789 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7790
7791 Separate read and write access to Lisp_Object slots of Lisp_Process.
7792 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7793 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7794
7795 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7796
7797 Separate read and write access to Lisp_Object slots of struct window.
7798 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7799 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7800 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7801 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7802 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7803 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7804 Adjust users.
7805
7806 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7807
7808 Fix Windows build errors introduced after converting to FGET and FSET.
7809 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7810 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7811 (w32_judge_scroll_bars): Change to use FSET.
7812 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7813
7814 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7815
7816 Fix replacement typo.
7817 * window.c (replace_window): Set root_window instead of
7818 selected_window. This fixes a total window subsystem
7819 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7820
7821 2012-08-06 Glenn Morris <rgm@gnu.org>
7822
7823 * lisp.mk (lisp): Add language/persian.elc.
7824
7825 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7826
7827 Separate read and write access to Lisp_Object slots of struct frame.
7828 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7829 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7830 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7831 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7832 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7833
7834 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7835
7836 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7837
7838 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7839
7840 Generalize common compile-time constants.
7841 * lisp.h (header_size, bool_header_size, word_size): Now here.
7842 (struct Lisp_Vector): Add comment.
7843 (struct Lisp_Bool_Vector): Move up to define handy constants.
7844 (VECSIZE, PSEUDOVECSIZE): Simplify.
7845 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7846 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7847 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7848 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7849 * xfont.c, xmenu.c: Use word_size where appropriate.
7850
7851 2012-08-05 Lawrence Mitchell <wence@gmx.li>
7852
7853 * search.c (Freplace_match): Treat \? in the replacement text
7854 literally (Bug#8161).
7855
7856 2012-08-05 Chong Yidong <cyd@gnu.org>
7857
7858 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7859 * frame.c (Vdelete_frame_functions):
7860 * emacs.c (Vkill_emacs_hook): Doc fix.
7861
7862 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7863
7864 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7865 --with-x-toolkit=no builds.
7866 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7867
7868 2012-08-04 Chong Yidong <cyd@gnu.org>
7869
7870 * syntax.c (Fmodify_syntax_entry): Doc fix.
7871
7872 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7873
7874 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7875 * w32.c (init_environment): Change the default values of many
7876 environment variables in dflt_envvars[] to NULL, to avoid pushing
7877 them into environment when they were not already defined.
7878 Remove the code that deletes site-lisp subdirectories from the default
7879 value of EMACSLOADPATH, as it is no longer needed.
7880 (check_windows_init_file): Now external, not static.
7881 Use Vload_path as is, without adding anything, as this function is now
7882 called when Vload_path is already set up.
7883
7884 * w32.h (check_windows_init_file): Add prototype.
7885
7886 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7887 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7888 compatibility with Posix platforms.
7889 (main): Move the call to check_windows_init_file to here from
7890 w32.c.
7891 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7892 any, in the DEFALT argument into the root of the Emacs build or
7893 installation tree, as appropriate.
7894
7895 * callproc.c (init_callproc_1): Call decode_env_path instead of
7896 doing its equivalent by hand.
7897 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7898 the code that sets Vexec_path run on MS-Windows.
7899
7900 * lread.c (init_lread): Add comments to #ifdef's.
7901
7902 * msdos.c (dos_set_window_size, IT_update_begin)
7903 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7904 instead of direct references.
7905
7906 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7907
7908 Export DEFAULT_REHASH_* to GDB.
7909 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7910 Now constants, not macros.
7911
7912 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7913
7914 Remove unnecessary casts involving pointers.
7915 These casts are no longer needed now that we assume C89 or later,
7916 since they involve casting to or from void *.
7917 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7918 (make_pure_float, make_pure_vector):
7919 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7920 * macros.c (Fstart_kbd_macro):
7921 * menu.c (find_and_return_menu_selection):
7922 * minibuf.c (read_minibuf_noninteractive):
7923 * sysdep.c (closedir):
7924 * xdisp.c (x_produce_glyphs):
7925 * xfaces.c (compare_fonts_by_sort_order):
7926 * xfns.c (x_real_positions, select_visual):
7927 * xselect.c (x_stop_queuing_selection_requests)
7928 (x_get_window_property, x_get_window_property_as_lisp_data):
7929 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7930 Remove unnecessary pointer casts.
7931 * alloc.c (record_xmalloc): New function.
7932 * lisp.h (record_xmalloc): New decl.
7933 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7934 more like a function. This is because the pointer cast is not
7935 needed. All uses changed.
7936 * print.c (print_string, print_error_message): Avoid length recalc.
7937
7938 Improve fix for macroexp crash with debugging (Bug#12118).
7939 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7940 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7941 not supposed to be invoked from the garbage collector.
7942 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7943 (gc_aset): New function, which is like ASET but can be
7944 used in the garbage collector.
7945 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7946 (set_hash_index): Use it instead of ASET.
7947
7948 2012-08-03 Eli Zaretskii <eliz@gnu.org>
7949
7950 Support symlinks on latest versions of MS-Windows.
7951 * w32.c: Include winioctl.h and aclapi.h.
7952 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7953 (revert_to_self): Forward declarations of static functions.
7954 <static BOOL g_b_init_get_security_info>:
7955 <g_b_init_create_symbolic_link>: New static flags.
7956 (globals_of_w32): Initialize them to zero.
7957 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7958 (map_w32_filename): Improve commentary. Simplify switch.
7959 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7960 headers (most versions of MinGW w32api don't).
7961 (get_security_info, create_symbolic_link)
7962 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7963 New functions.
7964 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7965 in the argument file name.
7966 (sys_access): Call unc_volume_file_attributes only if
7967 GetFileAttributes fails with network-related error codes.
7968 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7969 have the required privileges.
7970 (get_file_security_desc_by_name): Rename from
7971 get_file_security_desc.
7972 (stat_worker): New function, with most of the guts of 'stat', and
7973 with addition of handling of symlinks and support for 'lstat'.
7974 If possible, get file's attributes and security information by
7975 handle, not by name. Produce S_IFLNK bit for symlinks, when
7976 called from 'lstat'.
7977 (stat, lstat): New functions, call 'stat_worker'.
7978 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7979 symlinks when the underlying filesystem supports them.
7980
7981 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7982
7983 Fix macroexp crash on Windows with debugging (Bug#12118).
7984 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7985 checking subscripts; problem introduced with the recent
7986 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7987 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7988 since it's used in non-static inline functions now.
7989
7990 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7991 Don't assume buffer size fits in 'int'. Remove unused local.
7992
7993 Use C99-style 'extern inline' if available.
7994 * buffer.h (BUFFER_INLINE):
7995 * category.h (CATEGORY_INLINE):
7996 * character.h (CHARACTER_INLINE):
7997 * charset.h (CHARSET_INLINE):
7998 * composite.h (COMPOSITE_INLINE):
7999 * dispextern.h (DISPEXTERN_INLINE):
8000 * lisp.h (LISP_INLINE):
8001 * systime.h (SYSTIME_INLINE):
8002 New macro, replacing 'static inline' in this header.
8003 * buffer.h, category.h, character.h, charset.h, composite.h:
8004 * dispextern.h, lisp.h, systime.h:
8005 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8006 * alloc.c (LISP_INLINE):
8007 * buffer.c (BUFFER_INLINE):
8008 * category.c (CATEGORY_INLINE):
8009 * character.c (CHARACTER_INLINE):
8010 * charset.c (CHARSET_INLINE):
8011 * composite.c (COMPOSITE_INLINE):
8012 * dispnew.c (DISPEXTERN_INLINE):
8013 * sysdep.c (SYSTIME_INLINE):
8014 Define to EXTERN_INLINE, so that the corresponding functions
8015 are compiled into code.
8016 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8017 (INLINE_HEADER_END): New macros.
8018 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8019 since it's used in non-static inline functions now.
8020 (VALMASK) [!USE_LSB_TAG]: Likewise.
8021
8022 2012-08-02 Glenn Morris <rgm@gnu.org>
8023
8024 * s/: Remove empty directory.
8025
8026 * s/ms-w32.h: Move to ../nt/inc.
8027 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8028 Update for new ms-w32.h location.
8029
8030 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8031
8032 Port to Solaris 8.
8033 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8034
8035 2012-08-02 Glenn Morris <rgm@gnu.org>
8036
8037 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8038 hard-coding the path separator.
8039
8040 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8041
8042 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8043 This how ASET and AREF are supposed to work, and makes
8044 it easier to think about future improvements. See
8045 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8046 * charset.h (set_charset_attr): New function.
8047 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8048 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8049 (aref_addr): New function. All uses of &AREF(...) changed.
8050 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8051 (set_hash_index): New functions. All lvalue-style uses of
8052 HASH_KEY etc. changed.
8053 * keyboard.c (set_prop): New function. All lvalue-style uses
8054 of PROP changed.
8055
8056 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8057
8058 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8059 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8060 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
8061 * nsfns.m (ns_set_name_as_filename): Likewise.
8062 * nsmenu.m (ns_update_menubar): Likewise.
8063 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8064
8065 2012-08-01 Eli Zaretskii <eliz@gnu.org>
8066
8067 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8068 Adapt to latest changes in field names of the corresponding Lisp
8069 objects.
8070
8071 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8072
8073 2012-08-01 Glenn Morris <rgm@gnu.org>
8074
8075 * s/msdos.h: Remove file.
8076 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8077 * Makefile.in (S_FILE): Remove.
8078 (config_h): Remove S_FILE.
8079
8080 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8081
8082 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8083 Remove; moved to nt/config.nt.
8084
8085 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8086
8087 Use INTERNAL_FIELD for conses and overlays.
8088 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8089 Remove obsolete comment.
8090 (MVAR): New macro.
8091 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8092 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8093
8094 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8095
8096 Use INTERNAL_FIELD for symbols.
8097 * lisp.h (SVAR): New macro. Adjust users.
8098 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8099 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8100
8101 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8102
8103 Use INTERNAL_FIELD for processes.
8104 * process.h (PVAR): New macro. Adjust style.
8105 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8106 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8107
8108 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8109
8110 Use INTERNAL_FIELD for windows.
8111 * window.h (WVAR): New macro.
8112 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8113 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8114 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8115 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8116 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8117 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8118
8119 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8120
8121 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8122
8123 2012-08-01 Glenn Morris <rgm@gnu.org>
8124
8125 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8126 Move to configure.ac.
8127
8128 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8129
8130 * makefile.w32-in (CONFIG_H): Update dependencies.
8131 (CONF_POST_H): New macro.
8132
8133 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8134
8135 2012-07-31 Glenn Morris <rgm@gnu.org>
8136
8137 * Makefile.in (S_FILE): No longer set by configure.
8138
8139 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8140 is available.
8141 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8142
8143 * process.h (NULL_DEVICE):
8144 * emacs.c (SEPCHAR):
8145 * editfns.c (USER_FULL_NAME): Let configure set them.
8146
8147 * s/README, s/template.h: Remove files.
8148
8149 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8150
8151 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8152 Move to configure.ac.
8153
8154 2012-07-31 Eli Zaretskii <eliz@gnu.org>
8155
8156 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8157 resulting renaming of 'struct frame' members.
8158
8159 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8160
8161 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8162 after introduction of FVAR.
8163
8164 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8165
8166 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8167
8168 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8169 instead of compositeToPoint.
8170 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8171
8172 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
8173
8174 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8175
8176 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8177 * lisp.h (INTERNAL_FIELD): New macro.
8178 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
8179 (BVAR): Change to use INTERNAL_FIELD.
8180 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8181 (KVAR): Change to use INTERNAL_FIELD.
8182 * frame.h (FVAR): New macro.
8183 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
8184 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8185 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8186 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8187 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8188
8189 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8190
8191 Miscellaneous fixes for non-default X toolkits.
8192 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8193 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8194 Move under #ifdef USE_LUCID.
8195 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8196 definition and usage to avoid warnings.
8197
8198 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8199
8200 * nsterm.m (openFiles): Fix previous checkin.
8201
8202 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 * indent.c (compute_motion): Remove unused local.
8205
8206 2012-07-31 Glenn Morris <rgm@gnu.org>
8207
8208 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8209
8210 * conf_post.h [USG5_4]:
8211 Move remaining contents of s/usg5-4-common.h here.
8212 * s/usg5-4-common.h: Remove file.
8213
8214 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8215 * s/irix6-5.h: Remove file.
8216
8217 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8218 * s/darwin.h: Remove file.
8219
8220 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8221 * s/hpux10-20.h: Remove file, which is now empty.
8222
8223 2012-07-30 Glenn Morris <rgm@gnu.org>
8224
8225 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8226 * Makefile.in (config_h): Add conf_post.h.
8227 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8228
8229 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8230
8231 * nsterm.m (ns_do_open_file): New variable.
8232 (ns_term_init): Set ns_do_open_file to YES after run returns.
8233 (openFile, openTempFile, openFileWithoutUI, openFiles):
8234 Open files only if ns_do_open_file.
8235
8236 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8237
8238 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8239 This no-op macro hasn't been needed for many years.
8240 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8241
8242 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8243 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8244 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8245 gdb_make_enums_visible.
8246 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8247 (DIRECTORY_SEP): Now a constant, not a macro.
8248
8249 2012-07-30 Eli Zaretskii <eliz@gnu.org>
8250
8251 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8252 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8253
8254 * w32term.c <w32_keyboard_codepage>: Renamed from
8255 keyboard_codepage and now external. All users changed.
8256
8257 * w32term.h: Add declaration of w32_keyboard_codepage.
8258
8259 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8260 the codepage to translate keys to Unicode. If this argument is
8261 -1, use the value returned by GetConsoleCP. All callers changed.
8262
8263 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8264
8265 Update .PHONY listings in makefiles.
8266 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8267 bootstrap-clean, distclean, maintainer-clean, versioclean,
8268 extraclean, frc.
8269
8270 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8271 This is a bit clearer. Fix some commentary typos.
8272
8273 2012-07-30 Glenn Morris <rgm@gnu.org>
8274
8275 * s/netbsd.h: Let configure include signal.h if needed.
8276 Remove file, which is now empty.
8277
8278 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8279 Let configure set them.
8280 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8281 No more need to undefine.
8282
8283 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8284
8285 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8286 non-single-byte char when adding meta modifier. (Bug#12090)
8287
8288 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8289
8290 Convert safe_call to use variable number of arguments.
8291 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8292 (safe_call2): Fix comment.
8293 * lisp.h (safe_call): Adjust prototype.
8294 * coding.c (encode_coding_object): Change to use safe_call2.
8295 * xfaces.c (merge_face_heights): Change to use safe_call1.
8296
8297 2012-07-30 Glenn Morris <rgm@gnu.org>
8298
8299 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8300 does that unconditionally. Remove file, which is now empty.
8301
8302 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8303 Remove empty files.
8304
8305 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 Export to GDB most of lisp.h's remaining object-like macros.
8308 * lisp.h (min, max): Move earlier, because they're used earlier now.
8309 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8310 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8311 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8312 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8313 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8314 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8315 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8316 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8317 Now constants, for GDB. They need not be macros.
8318 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8319 Now constants, for GDB, as well as macros, for static initializers.
8320 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8321 Move to after the definition of struct Lisp_Char_Table,
8322 since the former now needs that type defined.
8323 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8324 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8325 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8326 New enums, for gdb_make_enums_visible.
8327 (GLYPH_MODE_LINE_FACE): Remove; unused.
8328 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8329 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8330 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8331 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8332 enum maxargs, enum MAX_ALLOCA.
8333 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8334 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8335 no longer needed, now that they are done in lisp.h.
8336
8337 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8338
8339 Cleanup string bytes checking.
8340 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8341 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8342 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8343 (check_sblock, compact_small_strings): Simplify.
8344
8345 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8346
8347 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8348 These macros are confusing and no longer need to be defined, as
8349 the enum values now suffice. All uses replaced with definiens.
8350 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8351
8352 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
8353
8354 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8355 ($(BLD)/w32console.$(O)): Update dependencies.
8356
8357 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8358
8359 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8360 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8361 time. Adjust users.
8362 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8363
8364 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8365
8366 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8367 setting sitelisp (Bug#12010).
8368
8369 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8370
8371 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8372
8373 * w32heap.c (cache_system_info):
8374 * w32.c (sys_rename):
8375 * w32proc.c (find_child_console, sys_kill): All users changed.
8376
8377 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8378
8379 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8380
8381 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8382
8383 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8384
8385 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8386
8387 Cleanup statistics calculation in Fgarbage_collect.
8388 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8389 Fix zombies percentage calculation. Simplify elapsed time calculation.
8390
8391 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8392
8393 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8394 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8395 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8396 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8397 (replace_range, replace_range_2, del_range_2): Change to eassert.
8398 * marker.c (byte_char_debug_check): Adjust style.
8399
8400 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8401
8402 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8403 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8404 long-ago-commented-out code that talks about "WIN32".
8405 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8406 All uses changed.
8407
8408 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8409
8410 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8411 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8412 Simplify by using alignof.
8413 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8414 * lisp.h: Include <stdalign.h>.
8415 (GCALIGNMENT): New macro and constant.
8416 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8417 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8418 (stdalign): New macro, if not already defined.
8419
8420 2012-07-28 Eli Zaretskii <eliz@gnu.org>
8421
8422 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8423 * w32inevt.c: Include w32inevt.h.
8424 (w32_read_console_input): New inline function, calls either
8425 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8426 w32_console_unicode_input.
8427 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8428 (w32_kbd_patch_key, key_event): Use the codepage returned by
8429 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8430 (key_event): use uChar.UnicodeChar only if
8431 w32_console_unicode_input is non-zero.
8432
8433 * w32console.c: Include w32heap.h.
8434 <w32_console_unicode_input>: New global variable.
8435 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8436 family of Windows, zero otherwise.
8437
8438 * w32inevt.h: Declare w32_console_unicode_input.
8439
8440 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8441 --without-x. (Bug#11742)
8442
8443 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8444
8445 Adjust GDB to reflect pvec_type changes (Bug#12036).
8446 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
8447 2012-07-04 changes to pseudovector representation.
8448 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
8449
8450 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
8451
8452 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8453 bus address.
8454 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8455
8456 2012-07-27 Eli Zaretskii <eliz@gnu.org>
8457
8458 * alloc.c (listn): Fix the order the arguments are consed onto the
8459 list.
8460
8461 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8462 enumeration constants, as PURE and HEAP are too general, and clash
8463 with other headers and sources, such as gmalloc.c and the
8464 MS-Windows system headers. All users changed.
8465
8466 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8467
8468 Revert last save_excursion_save and save_excursion_restore changes.
8469 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8470 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8471
8472 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8473
8474 Fix recently-introduced typos in Windows port.
8475 Reported by Martin Rudalics <rudalics@gmx.at>.
8476 * w32.c (init_environment): Replace comma with semicolon.
8477 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
8478
8479 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8480
8481 Improve GDB symbol export (Bug#12036).
8482 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8483 arms of an 'if', not using conditional expressions; otherwise GDB
8484 complains about the types in the unevaluated arm when the argument
8485 is an integer literal.
8486 (xgetint): Simplify expression.
8487 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8488 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8489 Zaretskii in <http://bugs.gnu.org/12036#13>.
8490 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8491 needed now that we have gdb_make_enums_visible.
8492 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8493 (enum enum_USE_LSB_TAG):
8494 New enum types, packaging up enums that need to be exported to GDB.
8495
8496 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8497
8498 Utility function to make a list from specified amount of objects.
8499 * lisp.h (enum constype): New datatype.
8500 (listn): New prototype.
8501 * alloc.c (listn): New function.
8502 (Fmemory_use_count, syms_of_alloc): Use it.
8503 * buffer.c (syms_of_buffer): Likewise.
8504 * callint.c (syms_of_callint): Likewise.
8505 * charset.c (define_charset_internal): Likewise.
8506 * coding.c (syms_of_coding): Likewise.
8507 * keymap.c (syms_of_keymap): Likewise.
8508 * search.c (syms_of_search): Likewise.
8509 * syntax.c (syms_of_syntax): Likewise.
8510 * w32.c (init_environment): Likewise.
8511 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8512 * xdisp.c (syms_of_xdisp): Likewise.
8513 * xfns.c (syms_of_xfns): Likewise.
8514
8515 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8516
8517 Fast save_excursion_save and save_excursion_restore.
8518 * lisp.h (struct Lisp_Excursion): New data type.
8519 (PVEC_EXCURSION): New pseudovector type.
8520 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8521 to deal with it. Adjust comments.
8522 (init_marker, attach_marker): New prototype.
8523 (unchain_marker): Adjust prototype.
8524 * marker.c (attach_marker): Change to global.
8525 (init_marker): New function.
8526 * alloc.c (Fmake_marker, build_marker): Use it.
8527 (build_marker): More easserts.
8528 (mark_object): Handle struct Lisp_Excursion.
8529 * editfns.c (save_excursion_save, save_excursion_restore):
8530 Reimplement to use struct Lisp_Excursion. Add comments.
8531
8532 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8533
8534 Fix export of symbols to GDB (Bug#12036).
8535 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8536 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8537 emacs.c, as this is a more-suitable home. Had this been done earlier
8538 the fix for 12036 would have avoided some of the problems noted in
8539 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8540 would have been more obvious.
8541 * emacs.c: Do not include <verify.h>; no longer needed.
8542 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
8543 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8544 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8545 Remove; now done in lisp.h.
8546 * lisp.h (PUBLISH_TO_GDB): New macro.
8547 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8548 (DATA_SEG_BITS): Use it.
8549 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8550 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8551 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8552 not be usable in #if. This simplifies things.
8553
8554 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
8555
8556 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8557
8558 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8559
8560 Simplify export of symbols to GDB (Bug#12036).
8561 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8562 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8563 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8564 Adjust to changes in lisp.h and emacs.c, by using
8565 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8566 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8567 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8568 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8569 instead of gdb_valbits.
8570 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8571 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8572 instead of gdb_array_mark_flag.
8573 (xboolvector): Get size from $->size, not $->header.size.
8574 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8575 (xreload, hook-run, hookpost-run): Remove.
8576 * emacs.c: Include <verify.h>.
8577 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8578 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8579 Remove.
8580 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8581 (gdb_USE_LSB_TAG): New enum constants.
8582 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8583 Also define these as enum constants, so they're visible to GDB.
8584 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8585 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8586 as constants, so they're visible to GDB.
8587 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8588 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8589 Now enum constants, not macros, so they're visible to GDB.
8590 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8591 more convenient now. All uses changed.
8592 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8593 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8594
8595 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8596
8597 Explicitly free restriction data that are not needed anymore.
8598 * editfns.c (save_restriction_restore): Free restriction data.
8599
8600 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8601
8602 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8603 add argument, tune behavior, and adjust all callers.
8604
8605 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8606
8607 Use typedef for EMACS_INT, EMACS_UINT.
8608 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8609 than macros. This simplifies debugging in the usual case, since
8610 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8611 and it allows expressions involving EMACS_INT casts.
8612 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8613
8614 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8615
8616 * nsterm.m (ns_read_socket): Return early if there is a modal
8617 window (Bug#12043).
8618
8619 2012-07-25 Martin Rudalics <rudalics@gmx.at>
8620
8621 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8622 that FOCUS-FRAME can be omitted.
8623
8624 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8625
8626 Adjust buffer text indirection counters at the end of Fkill_buffer.
8627 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8628 buffer is definitely dead. This should really fix an issue reported
8629 by Christoph Scholtes again. (Bug#12007).
8630 (init_buffer_once): Initialize indirection counters of
8631 buffer_defaults and buffer_local_symbols (for sanity and safety).
8632
8633 2012-07-24 Eli Zaretskii <eliz@gnu.org>
8634
8635 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8636 and continuation glyphs on tooltip frames, leave them at zero.
8637 Avoids continued lines in tooltips. (Bug#11832)
8638
8639 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8640
8641 Simplify copy_overlay.
8642 * buffer.c (copy_overlay): Simplify. Use build_marker.
8643 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8644
8645 2012-07-23 Eli Zaretskii <eliz@gnu.org>
8646
8647 * print.c (print_object): Don't crash when a frame's name is nil
8648 or invalid. (Bug#12025)
8649
8650 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8651 it signals an error when a tooltip frame is being created.
8652
8653 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8654
8655 Cleanup miscellaneous objects allocation and initialization.
8656 * alloc.c (allocate_misc): Change to static. Add argument to
8657 specify the subtype. Adjust comment and users.
8658 (build_overlay): New function.
8659 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8660 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8661 (allocate_misc): Remove prototype.
8662 (build_overlay): Add prototype.
8663
8664 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8665
8666 Swap buffer text indirection counters in Fbuffer_swap_text.
8667 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8668 This avoids crash reported by Christoph Scholtes at
8669 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8670
8671 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8672
8673 * nsmenu.m (Popdown_data): New struct.
8674 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8675 free Popdown_data.
8676 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8677 (initWithContentRect): Make imgView and contentView non-static
8678 and autorelease them. Also autorelease img and matrix (Bug#12005).
8679 (dealloc): Remove (Bug#12005).
8680
8681 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8682
8683 Adjust consing_since_gc when objects are explicitly freed.
8684 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8685 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8686 (free_cons, free_misc): Subtract object size from consing_since_gc.
8687
8688 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8689
8690 Simplify and cleanup markers positioning code.
8691 * marker.c (attach_marker): More useful eassert.
8692 (live_buffer, set_marker_internal): New function.
8693 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8694 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8695
8696 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8697
8698 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8699 as it's limited by the amount of memory, not by INT_MAX.
8700
8701 2012-07-21 Eli Zaretskii <eliz@gnu.org>
8702
8703 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8704 in special-event-map. See the discussion at
8705 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8706 for the reasons.
8707
8708 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8709 info.dwItemData. Fixes crashes on 64-bit Windows.
8710 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8711
8712 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8713
8714 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
8715 (conversationIdentifier): Return value is NSInteger.
8716 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8717
8718 2012-07-21 Chong Yidong <cyd@gnu.org>
8719
8720 * window.c (decode_any_window): Signal an error if the window is
8721 on a dead frame (Bug#11984).
8722
8723 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8724
8725 Add indirection counting to speed up Fkill_buffer.
8726 * buffer.h (struct buffer): New member.
8727 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8728 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8729 base buffer indirection counter.
8730 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8731 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8732 through buffer list if indirection counter is 0.
8733
8734 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8735
8736 Extend the value returned by Fgarbage_collect with heap statistics.
8737 * alloc.c (Qheap): New symbol.
8738 (syms_of_alloc): DEFSYM it.
8739 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8740 (Fmemory_free): Remove.
8741 (syms_of_alloc): Don't defsubr it.
8742 * buffer.c (Fcompact_buffer): Remove.
8743 (syms_of_buffer): Don't defsubr it.
8744
8745 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8746
8747 Make maybe_gc inline.
8748 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8749 * lisp.h (consing_since_gc, gc_relative_threshold)
8750 (memory_full_cons_threshold): Revert declaration.
8751 (maybe_gc): Remove prototype, define as inline.
8752 * alloc.c: Remove old commented-out code.
8753 (consing_since_gc, gc_relative_threshold)
8754 (memory_full_cons_threshold): Revert to global.
8755 (maybe_gc): Remove.
8756
8757 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8758
8759 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8760 * lisp.h (build_unibyte_string): New function.
8761 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8762 * sysdep.c, w32fns.c, xfns.c: Use it.
8763 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8764 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8765 Adjust users accordingly.
8766 * font.h (font_open_by_name): Adjust prototype.
8767
8768 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8769
8770 Cleanup calls to Fgarbage_collect.
8771 * lisp.h (maybe_gc): New prototype.
8772 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8773 Remove declarations.
8774 * alloc.c (maybe_gc): New function.
8775 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8776 Make them static.
8777 * bytecode.c (MAYBE_GC): Use maybe_gc.
8778 * eval.c (eval_sub, Ffuncall): Likewise.
8779 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8780 to avoid dependency from auto-save feature.
8781
8782 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8783
8784 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8785 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8786 'for_each_per_buffer_object_at'.
8787 All uses changed. It's better to use upper-case for macros that
8788 cannot be implemented as functions, to give the reader a clue
8789 that they're special.
8790
8791 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8792
8793 * alloc.c (Fgarbage_collect): Tweak docstring.
8794
8795 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8796
8797 Tweak the value returned from Fgarbage_collect again.
8798 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8799 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8800 Adjust documentation.
8801 (total_vector_bytes): Rename to total_vector_slots, adjust
8802 accounting.
8803 (total_free_vector_bytes): Rename to total_free_vector_slots,
8804 adjust accounting.
8805 (Qstring_bytes, Qvector_slots): New symbols.
8806 (syms_of_alloc): DEFSYM them.
8807
8808 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8809
8810 Buffer compaction primitive which may be used from Lisp.
8811 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8812 (syms_of_buffer): Register Fcompact_buffer.
8813 * alloc.c (Fgarbage_collect): Use compact_buffer.
8814 * buffer.h (compact_buffer): New prototype.
8815 (struct buffer_text): New member.
8816
8817 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8818
8819 New macro to iterate over all buffers, miscellaneous cleanups.
8820 * lisp.h (all_buffers): Remove declaration.
8821 * buffer.h (all_buffers): Add declaration, with comment.
8822 (for_each_buffer): New macro.
8823 * alloc.c (Fgarbage_collect, mark_object): Use it.
8824 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8825 (init_buffer): Likewise.
8826 * data.c (Fset_default): Likewise.
8827 * coding.c (code_conversion_restore): Remove redundant check
8828 for dead buffer.
8829 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8830
8831 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8832
8833 Fix bug that created negative-length intervals.
8834 * intervals.c (merge_interval_right, merge_interval_left):
8835 Do not zero out this interval if it is absorbed by its children,
8836 as this interval's total length doesn't change in that case. See
8837 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8838
8839 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8840
8841 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8842 when invoking (make-bool-vector N t) and N is a positive
8843 multiple of 8 -- the last 8 bits were mistakenly cleared.
8844
8845 Remove some struct layout assumptions in bool vectors.
8846 * alloc.c (bool_header_size): New constant.
8847 (header_size, word_size): Move earlier, as they're now used earlier.
8848 Use 'word_size' in a few more places, where it's appropriate.
8849 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8850 padding before the data member of a bool vector.
8851 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8852 than doing the check by hand with an abort ().
8853
8854 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8855
8856 * eval.c (Fdefvar): Don't check constants since we only set the var if
8857 it's not yet defined anyway (bug#11904).
8858
8859 * lisp.h (last_undo_boundary): Declare new var.
8860 * keyboard.c (command_loop_1): Set it.
8861 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8862 were auto-added by the command loop (bug#11774).
8863
8864 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8865
8866 * w32font.c (Qsymbol): Remove local definition.
8867 (syms_of_w32font): Don't DEFSYM it.
8868
8869 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8870
8871 Fix sweep_vectors to handle large bool vectors correctly.
8872 * alloc.c (sweep_vectors): Account total_vector_bytes for
8873 bool vectors larger than VBLOCK_BYTES_MAX.
8874
8875 2012-07-18 Chong Yidong <cyd@gnu.org>
8876
8877 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8878 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8879
8880 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8881
8882 Return more descriptive data from Fgarbage_collect.
8883 Suggested by Stefan Monnier in
8884 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8885 * alloc.c (bounded_number): New function.
8886 (total_buffers, total_vectors): New variable.
8887 (total_string_size): Rename to total_string_bytes, adjust users.
8888 (total_vector_size): Rename to total_vector_bytes, adjust users.
8889 (sweep_vectors): Account total_vectors and total_vector_bytes.
8890 (Fgarbage_collect): New return value. Adjust documentation.
8891 (gc_sweep): Account total_buffers.
8892 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8893 (VECTOR_SIZE): Remove.
8894 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8895 (Qinterval, Qmisc): New symbols.
8896 (syms_of_data): Initialize them.
8897 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8898 (Qcons, Qbuffer): New declarations.
8899
8900 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8901
8902 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8903 Round up, not down. Improve doc.
8904
8905 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8906
8907 Restore old code in allocate_string_data to avoid Faset breakage.
8908 Reported by Julien Danjou <julien@danjou.info> in
8909 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8910 * alloc.c (allocate_string_data): Restore old code with minor
8911 adjustments, fix comment to explain this subtle issue.
8912
8913 2012-07-17 Eli Zaretskii <eliz@gnu.org>
8914
8915 Remove FILE_SYSTEM_CASE.
8916 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8917
8918 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8919 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8920 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8921 call-process-region passes it through expand-file-name.
8922
8923 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8924
8925 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8926
8927 Fix crash when creating indirect buffer (Bug#11917)
8928 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8929 Don't handle unbound variables specially if non-zero.
8930 (Fbuffer_local_variables): Pass zero.
8931 (clone_per_buffer_values): Pass non-zero.
8932
8933 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8934
8935 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8936 to make the loop interruptible.
8937
8938 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8939
8940 * gnutls.c (emacs_gnutls_handshake): Only retry if
8941 GNUTLS_E_INTERRUPTED.
8942
8943 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8944
8945 Cleanup and convert miscellaneous checks to eassert.
8946 * alloc.c (mark_interval): Fix comment, partially rephrase
8947 old comment from intervals.h (see below).
8948 * intervals.c (find_interval, adjust_intervals_for_insertion)
8949 (delete_interval, adjust_intervals_for_deletion)
8950 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8951 Convert to eassert.
8952 (adjust_intervals_for_insertion, make_new_interval):
8953 Remove obsolete and unused code.
8954 * intervals.h (struct interval): Remove obsolete comment.
8955 * textprotp.c (erase_properties): Remove unused code.
8956 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8957 (Fremove_list_of_text_properties): Convert to eassert.
8958
8959 2012-07-17 Chong Yidong <cyd@gnu.org>
8960
8961 * editfns.c (Finsert_char): Doc fix.
8962
8963 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8964
8965 Fix previous change to make Fmemory_free always accurate.
8966 * alloc.c (make_interval): Update total_free_intervals.
8967 (make_float): Likewise for total_free_floats.
8968 (free_cons, Fcons): Likewise for total_free_conses.
8969 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8970 Likewise for total_free_vector_bytes.
8971 (Fmake_symbol): Likewise for total_free_symbols.
8972 (bytes_free): Remove.
8973
8974 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8975
8976 Simple free memory accounting feature.
8977 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8978 (sweep_vectors): Accumulate size of free vectors.
8979 (Fgarbage_collect): Setup bytes_free.
8980 (Fmemory_free): New function.
8981 (syms_of_alloc): Register it.
8982
8983 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8984
8985 Cleanup overlays checking.
8986 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8987 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8988 eassert and OVERLAYP.
8989 (sort_overlays): Change to use OVERLAYP.
8990
8991 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8992
8993 * editfns.c (Finsert_char): Make it interactive, and make the
8994 second arg optional. Copy interactive spec and docstring from
8995 ucs-insert.
8996
8997 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8998
8999 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9000 Unlike the other wrapped functions, fabs has an unspecified
9001 effect on errno.
9002
9003 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9004
9005 * nsterm.m (keyDown): Interpret flags without left/right bits
9006 as the left key (Bug#11670).
9007
9008 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9009
9010 Remove empty and useless init functions.
9011 * lisp.h (init_character_once, init_fns, init_image)
9012 (init_filelock, init_sound): Remove prototype.
9013 * character.c (init_character_once): Remove.
9014 * filelock.c (init_filelock): Likewise.
9015 * fns.c (init_fns): Likewise.
9016 * image.c (init_image): Likewise.
9017 * sound.c (init_sound): Likewise.
9018 * emacs.c (main): Adjust accordingly.
9019
9020 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9021
9022 * gtkutil.h: Tiny cleanups.
9023 (use_old_gtk_file_dialog): Remove useless declaration.
9024 (xg_uses_old_file_dialog): Add suggested const attribute.
9025
9026 2012-07-15 Eli Zaretskii <eliz@gnu.org>
9027
9028 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9029 (bidi_paragraph_init): Use it to limit search forward for a strong
9030 directional character in abnormally large paragraphs full of
9031 neutral or weak characters. (Bug#11943)
9032
9033 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9034
9035 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9036 the toolbar (Bug#9451).
9037 (xg_make_tool_item): Give the widget event box a transparent
9038 background.
9039
9040 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9041
9042 Cleanup basic allocation variables and functions.
9043 * alloc.c (ignore_warnings, init_intervals, init_float)
9044 (init_cons, init_symbol, init_marker): Remove.
9045 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9046 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9047 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9048 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9049 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9050 (staticidx, init_alloc_once, init_strings, free_ablock):
9051 Remove redundant initialization.
9052 * fns.c (init_weak_hash_tables): Remove.
9053 * lisp.h (init_weak_hash_tables): Remove prototype.
9054
9055 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9056
9057 Use zero_vector where appropriate.
9058 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9059 accordingly.
9060 * lisp.h (zero_vector): New declaration.
9061 * font.c (null_vector): Remove.
9062 (syms_of_font): Remove initialization and staticpro.
9063 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9064 * keymap.c (Faccessible_keymaps): Likewise.
9065
9066 2012-07-15 Leo Liu <sdl.web@gmail.com>
9067
9068 * fringe.c: Fix typo in comments.
9069
9070 2012-07-14 Leo Liu <sdl.web@gmail.com>
9071
9072 * fringe.c: Add a new bitmap exclamation-mark.
9073
9074 2012-07-14 Eli Zaretskii <eliz@gnu.org>
9075
9076 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9077
9078 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9079 (HAVE_MENUS): Don't define, defined by editing config.in with
9080 msdos/sed2v2.inp.
9081 (GMALLOC_INHIBIT_VALLOC): Don't define.
9082 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9083
9084 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
9085
9086 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9087
9088 2012-07-14 Glenn Morris <rgm@gnu.org>
9089
9090 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9091 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9092 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9093
9094 2012-07-13 Glenn Morris <rgm@gnu.org>
9095
9096 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9097
9098 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9099 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9100
9101 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9102
9103 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9104 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9105 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9106 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9107 where appropriate.
9108 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9109 as boolean expression.
9110 (x_set_window_size): Remove unused variable toolbar.
9111 (ns_get_color_default, ns_mod_to_lisp): Remove.
9112 (ns_mouse_position): Remove unused variables xchar and ychar.
9113 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9114 (ns_set_vertical_scroll_bar): Remove unused variable count.
9115 (ns_delete_terminal): Remove unused variable i.
9116 (ns_term_init): Remove unused variables r, g and b.
9117 (mouseDown): Remove unused variable window.
9118 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9119 (initFrameFromEmacs): Remove unused variable vbextra.
9120 (mouseEntered): Remove unused variables p and dpyinfo.
9121 (mouseExited): Remove unused variables p and r.
9122 (ns_define_frame_cursor, ns_clear_frame_area)
9123 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9124 (menuDown): Assign [sender tag] to variable and cast the variable.
9125
9126 * nsterm.h (menuDown): Add id as type to argument sender.
9127 (ns_display_info_for_name): Add Lisp_Object argument.
9128 (ns_term_init): Add Lisp_Object argument.
9129 (ns_map_event_to_object): Add void argument.
9130 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9131 prototype with arguments and only declare if __OBJC__.
9132 (nxatoms_of_nsselect): Add void argument.
9133 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9134 (ns_alloc_autorelease_pool): Add void argument.
9135 (ns_release_autorelease_pool): Add void* argument.
9136 (ns_get_defaults_value): Add const char* argument.
9137
9138 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9139 (initFromContents): Use SSDATA where appropriate.
9140 (ns_update_menubar): Add braces to ambigous if-else.
9141 (initWithTitle): Put () around assignment in if statement.
9142 (ns_menu_show): Remove unused variables window and keymap.
9143 (update_frame_tool_bar): Remove unused variable selected_p.
9144 (initWithContentRect): Remove unused variable this_cmd_name.
9145
9146 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9147 appropriate.
9148 (setXBMColor): Remove unused variable len.
9149 (setPixmapData): Put () around assignment in loop statement.
9150
9151 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9152 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9153 where appropriate.
9154 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9155 around assignment in loop statement.
9156 (nsfont_open): Remove unused variable i.
9157 (nsfont_open): Remove unused variable len.
9158 (nsfont_draw): Remove unused variable cs.
9159
9160 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9161 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9162 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9163 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9164 (Fns_font_name, Fns_perform_service)
9165 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9166 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9167 (ns_set_name): Remove unused variable view.
9168 (x_set_menu_bar_lines): Remove unused variable olines.
9169 (x_set_tool_bar_lines): Remove unused variable root_window.
9170 (Fns_list_colors): Put () around assignment in while statement.
9171 (Fns_perform_service): Remove unused variable len.
9172 (Fns_display_usable_bounds): Remove unused variable top.
9173 (syms_of_nsfns): Remove unused variable i.
9174
9175 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9176 memcpy (Bug#11907).
9177
9178 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
9179
9180 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9181 and free it with DestroyExceptionInfo (Bug#11558).
9182
9183 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
9184
9185 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9186 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9187 Set here, not in nt/config.nt.
9188
9189 2012-07-13 Eli Zaretskii <eliz@gnu.org>
9190
9191 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9192 cursor overflow into the last glyph on display line when the right
9193 fringe is off. (Bug#11832)
9194
9195 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9196
9197 * xdisp.c (produce_special_glyphs): Now static.
9198 * dispextern.h (produce_special_glyphs): Remove decl.
9199
9200 2012-07-13 Glenn Morris <rgm@gnu.org>
9201
9202 * s/bsd-common.h, s/cygwin.h: Remove empty files.
9203 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9204
9205 * s/usg5-4-common.h (USG, USG5):
9206 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9207 * s/sol2-6.h (SOLARIS2):
9208 * s/irix6-5.h (IRIX6_5):
9209 * s/hpux10-20.h (USG, USG5, HPUX):
9210 * s/gnu-linux.h (USG, GNU_LINUX):
9211 * s/freebsd.h (BSD_SYSTEM):
9212 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9213 * s/cygwin.h (CYGWIN):
9214 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9215 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9216
9217 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
9218
9219 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9220
9221 2012-07-13 Glenn Morris <rgm@gnu.org>
9222
9223 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9224
9225 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9226
9227 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9228 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9229
9230 2012-07-12 Glenn Morris <rgm@gnu.org>
9231
9232 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9233
9234 * process.c (init_process_emacs): Rename from init_process.
9235 The old name is also the name of a Mach system call.
9236 * lisp.h, emacs.c: Update for this name change.
9237 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9238 longer needed.
9239
9240 2012-07-12 Eli Zaretskii <eliz@gnu.org>
9241
9242 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9243 memmove call that removes glyphs covered by the left truncation
9244 glyph. Improve commentary.
9245 (display_line): Fix display of continuation glyphs on GUI frames
9246 when the right fringe is turned off and variable-size fonts are
9247 used in the window. Move the code that appends a stretch glyph to
9248 produce_special_glyphs, so that it could be used for truncation
9249 and continuation glyphs alike.
9250 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9251 glyph of a suitably computed width, to align the special glyphs at
9252 the window margin. Code moved from display_line. (Bug#11832)
9253
9254 2012-07-12 Glenn Morris <rgm@gnu.org>
9255
9256 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9257
9258 * s/gnu-linux.h, s/hpux10-20.h:
9259 Do not unconditionally define HAVE_XRMSETDATABASE.
9260
9261 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9262
9263 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9264
9265 Fix typos that broke OS X build.
9266 Reported by Randal L. Schwartz in
9267 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9268 * nsterm.m (ns_timeout): Add missing local decl.
9269 (ns_get_color): snprintf -> sprintf, to fix typo.
9270
9271 2012-07-12 Glenn Morris <rgm@gnu.org>
9272
9273 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9274 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9275 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9276 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9277
9278 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9279 Move PTY_OPEN to configure.
9280
9281 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9282 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9283 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9284
9285 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9286
9287 Use empty_unibyte_string where applicable.
9288 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9289 * lread.c (read1): Likewise.
9290 * xsettings.c (syms_of_xsettings): Likewise.
9291
9292 2012-07-12 Glenn Morris <rgm@gnu.org>
9293
9294 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9295 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9296 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9297 * s/hpux10-20.h (RUN_TIME_REMAP):
9298 * s/bsd-common.h (TABDLY): Move to configure.
9299
9300 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9301
9302 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9303
9304 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9305 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9306
9307 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9308
9309 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9310 * s/template.h: Move NARROWPROTO to configure.
9311
9312 2012-07-11 Glenn Morris <rgm@gnu.org>
9313
9314 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9315 unused since 2011-01-17 change to systty.h.
9316
9317 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9318 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9319 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9320
9321 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9322
9323 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9324
9325 2012-07-11 Glenn Morris <rgm@gnu.org>
9326
9327 * s/darwin.h, s/gnu-linux.h, s/template.h:
9328 Move INTERRUPT_INPUT to configure.
9329
9330 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9331
9332 Minor adjustments to interning code.
9333 * lisp.h (intern, intern_c_string): Redefine as static inline
9334 wrappers for intern_1 and intern_c_string_1, respectively.
9335 (intern_1, intern_c_string_1): Rename prototypes.
9336 * lread.c (intern_1, intern_c_string_1, oblookup):
9337 Simplify Vobarray checking.
9338 * font.c (font_intern_prop): Likewise. Adjust comment.
9339 * w32font.c (intern_font_name): Likewise.
9340
9341 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9342
9343 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9344
9345 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9346 of Fcar/Fcdr if possible.
9347 * font.c (check_otf_features): Likewise.
9348 * fontset.c (Fnew_fontset): Likewise.
9349 * gnutls.c (Fgnutls_boot): Likewise.
9350 * minibuf.c (read_minibuf): Likewise.
9351 * msdos.c (IT_set_frame_parameters): Likewise.
9352 * xmenu.c (Fx_popup_dialog): Likewise.
9353 * w32menu.c (Fx_popup_dialog): Likewise.
9354
9355 2012-07-11 Glenn Morris <rgm@gnu.org>
9356
9357 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9358 since nothing has defined it on these platforms.
9359
9360 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9361 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9362
9363 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9364 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9365 Move CLASH_DETECTION to configure.
9366
9367 * s/gnu.h: Remove file, which is now empty.
9368
9369 * s/gnu.h, s/gnu-linux.h:
9370 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9371
9372 2012-07-11 John Wiegley <johnw@newartisans.com>
9373
9374 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9375 function attribute, so we only use it if it exists in the
9376 compiler.
9377
9378 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9379
9380 Avoid call to strlen in fast_c_string_match_ignore_case.
9381 * search.c (fast_c_string_match_ignore_case): Change to use
9382 length argument. Adjust users accordingly.
9383 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9384
9385 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9386
9387 Assume mkdir, rmdir.
9388 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9389 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9390
9391 Assume rename.
9392 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9393
9394 Assume perror.
9395 * s/hpux10-20.h (HAVE_PERROR): Remove.
9396 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9397 Remove dummy definition, as this problem was obsolete long ago.
9398
9399 Assume strerror.
9400 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9401
9402 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9403
9404 Avoid calls to strlen in font processing functions.
9405 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
9406 (font_open_by_name): Change to use length argument.
9407 Adjust users accordingly.
9408 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9409 Adjust prototypes.
9410 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9411 Change to return ptrdiff_t.
9412 (xfont_list_pattern, xfont_match): Use length returned by
9413 xfont_decode_coding_xlfd.
9414 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9415
9416 2012-07-11 Glenn Morris <rgm@gnu.org>
9417
9418 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9419 Move DONT_REOPEN_PTY to configure.
9420
9421 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9422 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9423
9424 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9425
9426 Remove "#define unix" that is no longer needed (Bug#11905).
9427 * s/aix4-2.h (unix): Remove; no longer needed.
9428
9429 EMACS_TIME simplification (Bug#11875).
9430 This replaces macros (which typically do not work in GDB)
9431 with functions, typedefs and enums, making the code easier to debug.
9432 The functional style also makes code easier to read and maintain.
9433 * systime.h: Include <sys/time.h> on all hosts, not just if
9434 WINDOWSNT, since 'struct timeval' is needed in general.
9435 (EMACS_TIME): Now a typedef, not a macro.
9436 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9437 not macros.
9438 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9439 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9440 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9441 (EMACS_TIME_LE): Now functions, not macros.
9442 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9443 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9444 which are not functions. All uses rewritten to use:
9445 (make_emacs_time): New function.
9446 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9447 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9448 not functions. All uses rewritten to use the following, respectively:
9449 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9450 (add_emacs_time, sub_emacs_time): New functions.
9451 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
9452 * fileio.c (Fcopy_file):
9453 * xterm.c (XTflash): Get the current time closer to when it's used.
9454 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9455
9456 * bytecode.c (targets): Suppress -Woverride-init warnings.
9457
9458 Simplify by avoiding confusing use of strncpy etc.
9459 * doc.c (Fsnarf_documentation):
9460 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9461 * frame.c (Fmake_terminal_frame):
9462 * gtkutil.c (get_utf8_string):
9463 * lread.c (openp):
9464 * nsmenu.m (ns_update_menubar):
9465 * regex.c (regerror):
9466 Prefer memcpy to strncpy and strncat when either will do.
9467 * fileio.c (Fsubstitute_in_file_name):
9468 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9469 (menu_separator_name_p):
9470 * nsmenu.m (ns_update_menubar):
9471 Prefer memcmp to strncmp when either will do.
9472 * nsterm.m: Include <ftoastr.h>.
9473 (ns_get_color):
9474 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9475 Prefer snprintf to strncpy.
9476 * nsterm.m (ns_term_init):
9477 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9478 * nsterm.m (ns_term_init):
9479 Avoid the need for strncpy, by using build_string or
9480 make_unibyte_string directly. Use dtoastr, not snprintf.
9481 * process.c (Fmake_network_process): Diagnose service names that
9482 are too long, rather than silently truncating them or creating
9483 non-null-terminated names.
9484 (Fnetwork_interface_info): Likewise, for interface names.
9485 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9486 Prefer sprintf to strncat.
9487 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9488 Prefer vsnprintf to vsprintf + strncpy.
9489
9490 2012-07-10 Glenn Morris <rgm@gnu.org>
9491
9492 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9493 Clarify fallback case.
9494
9495 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9496
9497 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9498 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9499 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
9500 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
9501 where argument type is known to be a Lisp_Cons.
9502
9503 2012-07-10 Tom Tromey <tromey@redhat.com>
9504
9505 * bytecode.c (BYTE_CODE_THREADED): New macro.
9506 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9507 (enum byte_code_op): New type.
9508 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9509 (exec_byte_code): Use them. Use token threading when applicable.
9510
9511 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9512
9513 Optimize pure C strings initialization.
9514 * lisp.h (make_pure_string): Fix prototype.
9515 (build_pure_c_string): New function, defined as static inline. This
9516 provides a better opportunity to optimize away calls to strlen when
9517 the function is called with compile-time constant argument.
9518 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9519 argument, adjust users accordingly. Use build_pure_c_string where
9520 appropriate.
9521 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9522 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9523 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9524
9525 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9526
9527 Avoid calls to strlen in miscellaneous functions.
9528 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9529 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9530 * lread.c (openp): Likewise.
9531
9532 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9533
9534 Avoid calls to strlen in path processing functions.
9535 * fileio.c (file_name_as_directory): Add comment. Change to add
9536 srclen argument and return the length of result. Adjust users
9537 accordingly.
9538 (directory_file_name): Fix comment. Change to add srclen argument,
9539 swap 1st and 2nd arguments to obey the common convention.
9540 Adjust users accordingly.
9541 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9542
9543 2012-07-10 Glenn Morris <rgm@gnu.org>
9544
9545 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9546 Move PENDING_OUTPUT_COUNT definition to configure.
9547
9548 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9549 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9550 * s/gnu.h (DATA_START): Move definitions to configure.
9551
9552 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9553 We include usg5-4-common.h, which defines them both.
9554
9555 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9556 O_RDONLY already includes it).
9557
9558 Stop ns builds setting the EMACSLOADPATH environment variable.
9559 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9560 Now it does not set EMACSLOADPATH, just returns the load-path string.
9561 * nsterm.h: Update accordingly.
9562 * lread.c [HAVE_NS]: Include nsterm.h.
9563 (init_lread) [HAVE_NS]: Use ns_load_path.
9564 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9565
9566 2012-07-09 Glenn Morris <rgm@gnu.org>
9567
9568 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9569 since the included bsd-common.h does so.
9570
9571 Stop ns builds setting the EMACSPATH environment variable.
9572 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9573 (ns_init_paths): Do not set EMACSPATH.
9574 * nsterm.h (ns_exec_path): Add it.
9575 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9576 Use ns_exec_path.
9577
9578 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9579
9580 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9581
9582 * process.c (wait_reading_process_output): 'waitchannels' was unset
9583 when read_kbd || !NILP (wait_for_cell); fix this.
9584
9585 Add GCC-style 'const' attribute to functions that can use it.
9586 * character.h (char_resolve_modifier_mask):
9587 * keyboard.h (make_ctrl_char):
9588 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9589 (init_character_once, next_almost_prime, init_fns, init_image)
9590 (flush_pending_output, init_sound):
9591 * mem-limits.h (start_of_data):
9592 * menu.h (finish_menu_items):
9593 Add ATTRIBUTE_CONST.
9594 * emacs.c (DEFINE_DUMMY_FUNCTION):
9595 Declare the dummy function with ATTRIBUTE_CONST.
9596 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9597 Add decls with ATTRIBUTE_CONST.
9598
9599 Minor improvements to make_formatted_string.
9600 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9601 where int is good enough, as vsprintf returns an int.
9602 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9603
9604 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9605
9606 Use make_formatted_string to avoid double length calculation.
9607 * lisp.h (make_formatted_string): New prototype.
9608 * alloc.c (make_formatted_string): New function.
9609 * buffer.c (Fgenerate_new_buffer_name): Use it.
9610 * dbusbind.c (syms_of_dbusbind): Likewise.
9611 * editfns.c (Fcurrent_time_zone): Likewise.
9612 * filelock.c (get_boot_time): Likewise.
9613 * frame.c (make_terminal_frame, set_term_frame_name)
9614 (x_report_frame_params): Likewise.
9615 * image.c (gs_load): Likewise.
9616 * minibuf.c (get_minibuffer): Likewise.
9617 * msdos.c (dos_set_window_size): Likewise.
9618 * process.c (make_process): Likewise.
9619 * xdisp.c (ensure_echo_area_buffers): Likewise.
9620 * xsettings.c (apply_xft_settings): Likewise.
9621
9622 2012-07-09 Glenn Morris <rgm@gnu.org>
9623
9624 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9625 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9626 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9627 * nsterm.h (ns_etc_directory): Add it.
9628 * callproc.c [HAVE_NS]: Include nsterm.h.
9629 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9630
9631 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9632
9633 Move marker debugging code under MARKER_DEBUG.
9634 * marker.c (MARKER_DEBUG): Move marker debugging code under
9635 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9636 for bootstrap with --enable-checking (~3x slowdown reported
9637 by Juanma Barranquero <lekktu@gmail.com>).
9638 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9639
9640 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9641
9642 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9643 See <http://bugs.gnu.org/11825#29>.
9644
9645 2012-07-08 Eli Zaretskii <eliz@gnu.org>
9646
9647 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9648 has no font, use the frame's font. (Bug#11813)
9649 (display_line): Add commentary about displaying truncation glyphs
9650 on GUI frames.
9651 (produce_special_glyphs): Move here from term.c.
9652
9653 * term.c (produce_special_glyphs): Move to xdisp.c.
9654
9655 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9656 section.
9657
9658 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9659
9660 * xdisp.c (display_line): Avoid warning about implicit declaration
9661 of FRAME_FONT.
9662
9663 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9664
9665 * lisp.h: Remove empty conditional.
9666
9667 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9668
9669 * lread.c (load_path_check): Now static.
9670
9671 Fix some minor --with-ns problems found by static checking.
9672 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9673 (x_set_font) [!HAVE_X_WINDOWS]:
9674 * image.c (xpm_load_image) [HAVE_NS]:
9675 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9676 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9677 Remove unused local.
9678 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9679 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9680 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9681 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9682 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9683 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9684 Fix pointer signedness problem.
9685 * xfaces.c (FRAME_X_FONT_TABLE):
9686 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9687
9688 2012-07-07 Glenn Morris <rgm@gnu.org>
9689
9690 * lread.c (load_path_check): New function, split from init_lread.
9691 (init_lread): Reorganize. Motivation:
9692 If EMACSLOADPATH is set, check/warn about that rather than the
9693 defaults, which we are not going to use. Hence we can remove
9694 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9695 Don't warn if site-lisp directories are missing.
9696 If not installed, start from a blank load-path, since
9697 PATH_LOADSEARCH refers to the eventual installation directories.
9698
9699 2012-07-07 Eli Zaretskii <eliz@gnu.org>
9700
9701 Support truncation and continuation glyphs on GUI frames, when
9702 fringes are disabled. (Bug#11832)
9703 * xdisp.c (init_iterator): Get dimensions of truncation and
9704 continuation glyphs even if on GUI frames.
9705 Adjust it->last_visible_x on GUI frames when the left or right fringes,
9706 or both, are absent.
9707 (start_display, move_it_in_display_line_to): Handle the case of a
9708 GUI frame without a fringe to display continuation or truncation
9709 glyphs.
9710 (insert_left_trunc_glyphs): Support GUI frames: make sure
9711 truncation glyphs overwrite enough glyphs from the current line to
9712 have sufficient space in pixels.
9713 (display_line): Support truncation and continuation glyphs on GUI
9714 frames. If some spare pixels are left on the line after inserting
9715 the truncation glyphs, fill that space with a stretch glyph of a
9716 suitably computed width.
9717
9718 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9719 produce_glyphs, to support GUI sessions.
9720
9721 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9722
9723 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9724
9725 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9726
9727 Do not require float-time's arg to fit in time_t (Bug#11825).
9728 This works better on hosts where time_t is unsigned, and where
9729 float-time is applied to the (negative) difference between two times.
9730 * editfns.c (decode_time_components): Last arg is now double *,
9731 not int *, and means to store all the result as a double, without
9732 worrying about whether the seconds part fits in time_t.
9733 All callers changed.
9734 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9735 All callers changed.
9736 (Ffloat_time): Do not fail merely because the specified time falls
9737 outside of time_t range.
9738
9739 2012-07-07 Glenn Morris <rgm@gnu.org>
9740
9741 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9742 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9743 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9744
9745 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
9746
9747 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9748 Update dependencies.
9749
9750 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9751
9752 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9753
9754 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9755 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9756 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9757 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9758 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9759 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9760
9761 * xfont.c (compare_font_names): Redo to omit the need for casts.
9762
9763 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9764
9765 * xfns.c (Fx_change_window_property): Doc fix.
9766 * w32fns.c (Fx_change_window_property): Doc fix.
9767
9768 * w32fns.c (Fx_window_property): Accept the same arguments as the
9769 X Windows version. Doc fix.
9770 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9771
9772 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
9773 Eli Zaretskii <eliz@gnu.org>
9774
9775 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9776 Windows-specific code from nt/config.nt moved here.
9777 Obsolete settings removed.
9778
9779 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9780
9781 * process.c: Avoid unnecessary calls to gettime.
9782 (wait_reading_process_output): Don't get the time of day
9783 when gobbling data immediately and not waiting, as there's no need
9784 for it in that case. This removes a FIXME.
9785
9786 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9787
9788 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9789 is defined (Bug#11768).
9790
9791 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9792
9793 Fix marker debugging code.
9794 * marker.c (byte_char_debug_check): Do not perform the check
9795 if buffer is not multibyte.
9796 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9797 Call byte_char_debug_check with correct arguments.
9798
9799 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9800
9801 Compile marker debugging code only if ENABLE_CHECKING is defined.
9802 * marker.c (byte_char_debug_check, count_markers):
9803 Use only if ENABLE_CHECKING is defined.
9804 (byte_debug_flag): Remove.
9805 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9806 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9807
9808 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9809
9810 Avoid code repetition in marker-related functions.
9811 * marker.c (attach_marker): New function.
9812 (Fset_marker, set_marker_restricted, set_marker_both)
9813 (set_marker_restricted_both): Use it.
9814 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9815 Consistently rename charno to charpos.
9816 (marker_position): Add eassert.
9817 (marker_byte_position): Convert to eassert.
9818
9819 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9820
9821 Simplify list operations in unchain_overlay and unchain_marker.
9822 * buffer.c (unchain_overlay): Simplify. Add comment.
9823 * marker.c (unchain_marker): Simplify. Fix comments.
9824
9825 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9826
9827 Introduce fast path for the widely used marker operation.
9828 * alloc.c (build_marker): New function.
9829 * lisp.h (build_marker): New prototype.
9830 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9831 * composite.c (autocmp_chars): Likewise.
9832 * editfns.c (buildmark): Remove.
9833 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9834 (save_restriction_save): Use build_marker.
9835 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9836 * window.c (save_window_save): Likewise.
9837
9838 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9839
9840 Do not use Fdelete_overlay in delete_all_overlays
9841 to avoid redundant calls to unchain_overlay.
9842 * buffer.c (drop_overlay): New function.
9843 (delete_all_overlays, Fdelete_overlay): Use it.
9844 * minibuf.c (get_minibuffer): Fix comment.
9845
9846 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9847
9848 Port to OpenBSD 5.1 amd64.
9849 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9850 This is needed for OpenBSD, and should be harmless on all BSD systems.
9851 Also, include <sys/sysctl.h>, as it should be available on all
9852 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9853 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9854 use p_pid member, not kp_proc.pid.
9855
9856 2012-07-06 Glenn Morris <rgm@gnu.org>
9857
9858 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9859
9860 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9861
9862 More xmalloc and related cleanup.
9863 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9864 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9865 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9866 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9867 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9868 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9869 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9870 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9871 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9872 * xterm.c:
9873 Omit needless casts involving void * pointers and allocation.
9874 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9875 as the former is more robust if P's type is changed.
9876 Prefer xzalloc to xmalloc + memset 0.
9877 Simplify malloc-or-realloc to realloc.
9878 Don't worry about xmalloc returning a null pointer.
9879 Prefer xstrdup to xmalloc + strcpy.
9880 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9881 growing it.
9882 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9883 alloca of a constant.
9884
9885 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9886
9887 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9888 hscroll is larger than the line width. Fixes long and futile
9889 looping inside extend_face_to_end_of_line (on a TTY) producing
9890 glyphs that are not needed and thrown away.
9891
9892 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9893
9894 * marker.c (set_marker_restricted_both): Simplify by using
9895 clip_to_bounds.
9896
9897 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9898
9899 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9900
9901 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9902
9903 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9904 not defined (Bug#11768).
9905 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9906 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9907 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9908 followed by gtk_box_set_homogeneous (Bug#11768).
9909 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
9910 (update_theme_scrollbar_width, xg_create_scroll_bar):
9911 Use gtk_scrollbar_new (Bug#11768).
9912 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9913 (is_box_type): New function (Bug#11768).
9914 (xg_tool_item_stale_p): Call is_box_type.
9915 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
9916 with default display (Bug#11768).
9917
9918 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9919
9920 * xdisp.c (window_hscroll_limited): New function.
9921 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9922 coordinates when window's hscroll is set to insanely large
9923 values. (Bug#11857)
9924
9925 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
9926
9927 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9928 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9929
9930 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9931
9932 Cleanup xmalloc.
9933 * lisp.h (xzalloc): New prototype. Omit needless casts.
9934 * alloc.c (xzalloc): New function. Omit needless casts.
9935 * charset.c: Omit needless casts. Convert all calls to
9936 xmalloc with following memset to xzalloc.
9937 * dispnew.c: Likewise.
9938 * fringe.c: Likewise.
9939 * image.c: Likewise.
9940 * sound.c: Likewise.
9941 * term.c: Likewise.
9942 * w32fns.c: Likewise.
9943 * w32font.c: Likewise.
9944 * w32term.c: Likewise.
9945 * xfaces.c: Likewise.
9946 * xfns.c: Likewise.
9947 * xterm.c: Likewise.
9948 * atimer.c: Omit needless casts.
9949 * buffer.c: Likewise.
9950 * callproc.c: Likewise.
9951 * ccl.c: Likewise.
9952 * coding.c: Likewise.
9953 * composite.c: Likewise.
9954 * doc.c: Likewise.
9955 * doprnt.c: Likewise.
9956 * editfns.c: Likewise.
9957 * emacs.c: Likewise.
9958 * eval.c: Likewise.
9959 * filelock.c: Likewise.
9960 * fns.c: Likewise.
9961 * gtkutil.c: Likewise.
9962 * keyboard.c: Likewise.
9963 * lisp.h: Likewise.
9964 * lread.c: Likewise.
9965 * minibuf.c: Likewise.
9966 * msdos.c: Likewise.
9967 * print.c: Likewise.
9968 * process.c: Likewise.
9969 * region-cache.c: Likewise.
9970 * search.c: Likewise.
9971 * sysdep.c: Likewise.
9972 * termcap.c: Likewise.
9973 * terminal.c: Likewise.
9974 * tparam.c: Likewise.
9975 * w16select.c: Likewise.
9976 * w32.c: Likewise.
9977 * w32reg.c: Likewise.
9978 * w32select.c: Likewise.
9979 * w32uniscribe.c: Likewise.
9980 * widget.c: Likewise.
9981 * xdisp.c: Likewise.
9982 * xmenu.c: Likewise.
9983 * xrdb.c: Likewise.
9984 * xselect.c: Likewise.
9985
9986 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9987
9988 * fileio.c (time_error_value): Check the right error number.
9989 Problem reported by Troels Nielsen in
9990 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9991
9992 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9993
9994 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9995 This should be fixed in a better way; see Eli Zaretskii in
9996 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9997 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9998
9999 * fileio.c (time_error_value): Rename from special_mtime.
10000 The old name's problems were noted by Eli Zaretskii in
10001 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10002
10003 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10004 This variable's comment says Emacs needs at least one GDB-visible
10005 symbol of type enum pvec_type, to work around GDB problems.
10006 The symbol's value doesn't matter.
10007
10008 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10009 that causes compilation to fail on pre-C99 compilers.
10010
10011 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
10012
10013 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10014 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10015
10016 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10017
10018 * buffer.c (init_buffer_once): Fix initialization of
10019 headers for buffer_defaults and buffer_local_symbols.
10020 Reported by Juanma Barranquero <lekktu@gmail.com>.
10021
10022 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10023
10024 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10025 * lisp.h (enum pvec_type): Use fewer bits.
10026 (PSEUDOVECTOR_SIZE_BITS): New constant.
10027 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10028 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10029 change in pvec_type.
10030 (PSEUDOVECTOR_TYPEP): New macro.
10031 (TYPED_PSEUDOVECTORP): Use it.
10032 * fns.c (internal_equal): Adapt code to extract pvectype.
10033 * emacs.c (gdb_pvec_type): Update type.
10034 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10035 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10036 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10037 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10038 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10039 abusing vector->header.next.nbytes.
10040 (live_vector_p): Use PVEC_TYPE.
10041 (mark_object): Adapt code to extract pvectype. Use switch.
10042
10043 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10046 Tighten new eassert a bit.
10047
10048 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10049
10050 Fix compilation with --enable-gcc-warnings and -O1
10051 optimization level.
10052 * doprnt.c (doprnt): Change type of tem to int, initialize
10053 to avoid compiler warning. Add eassert.
10054 * search.c (simple_search): Initialize match_byte to avoid
10055 compiler warning. Add eassert.
10056
10057 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 Avoid weird behavior with large horizontal scrolls.
10060 Without this change, for example, large hscroll values would
10061 mess up Emacs's display on Fedora 15 x86, presumably due to
10062 overflows in int calculations in the display code.
10063 Also, if buffers had long lines, Emacs would freeze.
10064 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10065 (set_window_hscroll): New function, containing the old guts of
10066 Fset_window_hscroll. Return the clipped value.
10067 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10068 This avoids the need to check against PTRDIFF_MAX.
10069
10070 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10071
10072 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10073
10074 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10075
10076 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10077
10078 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10079 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10080 since GCC 4.4.6 issues a bogus warning for them.
10081
10082 Fix bugs in file timestamp newness comparisons.
10083 * fileio.c (Ffile_newer_than_file_p):
10084 * lread.c (Fload): Use full timestamp resolution of files,
10085 not just the 1-second resolution, so that files that are only
10086 slightly newer still count as newer.
10087 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10088 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10089
10090 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10091
10092 * fileio.c: Improve handling of file time marker. (Bug#11852)
10093 (special_mtime): New function.
10094 (Finsert_file_contents, Fverify_visited_file_modtime):
10095 Use it to set special mtime values consistently.
10096
10097 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10098
10099 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10100 marker for non-existing file. (Bug#11852)
10101
10102 2012-07-03 Glenn Morris <rgm@gnu.org>
10103
10104 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10105 and did not make it into globals.h).
10106
10107 2012-07-03 Tom Tromey <tromey@redhat.com>
10108
10109 * window.c (Fset_window_margins, Fset_window_fringes)
10110 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10111 * textprop.c (Fprevious_property_change): No longer static.
10112 * syntax.c (Fsyntax_table_p): No longer static.
10113 * process.c (Fget_process, Fprocess_datagram_address): No longer
10114 static.
10115 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10116 * keyboard.c (Fcommand_execute): No longer static.
10117 Remove EXFUN.
10118 * insdel.c (Fcombine_after_change_execute): No longer static.
10119 * image.c (Finit_image_library): No longer static.
10120 * fileio.c (Fmake_symbolic_link): No longer static.
10121 * eval.c (Ffetch_bytecode): No longer static.
10122 * editfns.c (Fuser_full_name): No longer static.
10123 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10124 No longer static.
10125 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10126 static.
10127 * dired.c (Ffile_attributes): No longer static.
10128 * composite.c (Fcomposition_get_gstring): No longer static.
10129 * callproc.c (Fgetenv_internal): No longer static.
10130
10131 * ccl.h: Remove EXFUNs.
10132 * buffer.h: Remove EXFUNs.
10133 * dispextern.h: Remove EXFUNs.
10134 * intervals.h: Remove EXFUNs.
10135 * fontset.h: Remove EXFUN.
10136 * font.h: Remove EXFUNs.
10137 * dosfns.c (system_process_attributes): Remove EXFUN.
10138 * keymap.h: Remove EXFUNs.
10139 * lisp.h: Remove EXFUNs.
10140 * w32term.h: Remove EXFUNs.
10141 * window.h: Remove EXFUNs.
10142 * xsettings.h: Remove EXFUN.
10143 * xterm.h: Remove EXFUN.
10144
10145 2012-07-03 Glenn Morris <rgm@gnu.org>
10146
10147 * lisp.h (Frandom): Make it visible to C.
10148 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10149 buffer for invisible buffers. (Bug#1229)
10150
10151 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10152
10153 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10154 values which aren't power of 2.
10155 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
10156 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
10157 accordingly.
10158
10159 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10160
10161 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10162
10163 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10164
10165 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10166
10167 * alloc.c (allocate_vector_block): Remove redundant
10168 calls to mallopt if DOUG_LEA_MALLOC is defined.
10169 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10170 avoid calls to mallopt if zero_vector is returned.
10171
10172 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10173
10174 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10175 is enabled, avoid dereferencing NULL current_sblock if
10176 running undumped.
10177
10178 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10179
10180 Cleanup basic buffer management.
10181 * buffer.h (struct buffer): Change layout to use generic vector
10182 marking code. Fix some comments. Change type of 'clip_changed'
10183 to bitfield. Remove unused #ifndef old.
10184 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10185 (GET_OVERLAYS_AT): Fix indentation.
10186 (for_each_per_buffer_object_at): New macro.
10187 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10188 (Fbuffer_local_variables): Use it.
10189 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10190 * alloc.c (allocate_buffer): Adjust to match new layout of
10191 struct buffer. Fix comment.
10192 (mark_overlay): New function.
10193 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10194 Lisp area of struct buffer.
10195 (mark_object): Use it. Adjust marking of misc objects
10196 and related comments.
10197
10198 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10199
10200 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10201 wrapper that is not needed because the wrapped code is a no-op (zero
10202 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10203 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10204
10205 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10206
10207 * alloc.c (mark_buffer): Simplify. Remove prototype.
10208 (mark_object): Add comment. Reorganize marking of vector-like
10209 objects. Use CHECK_LIVE for all vector-like objects except buffers
10210 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10211 Avoid redundant calls to mark_vectorlike for bool vectors.
10212
10213 2012-06-30 Glenn Morris <rgm@gnu.org>
10214
10215 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10216
10217 * epaths.in (PATH_SITELOADSEARCH): New.
10218 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10219 This is rather than relying on --enable-locallisppath elements
10220 having "site-lisp" in their names. (Bug#10208#25, 11658)
10221
10222 2012-06-30 Eli Zaretskii <eliz@gnu.org>
10223
10224 * w32proc.c (sys_select): Accept and ignore one more argument.
10225
10226 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10227
10228 * sysselect.h [DOS_NT]: Don't include sys/select.h.
10229 (pselect) [!MS_DOS]: Redirect to sys_select.
10230
10231 * sysdep.c: Don't include dos.h and dosfns.h.
10232
10233 * process.c (sys_select):
10234 * msdos.c (sys_select): Accept one more argument and ignore it.
10235
10236 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10237 adapt data types and code to that.
10238
10239 * dosfns.c:
10240 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10241 which clashes with the gnulib function of the same name.
10242
10243 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10244
10245 * font.c (font_style_to_value, font_style_symbolic)
10246 (font_prop_validate_style): Add type checks for values in
10247 font_style_table.
10248
10249 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10250 argument.
10251 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10252 uses.
10253
10254 2012-06-29 Eli Zaretskii <eliz@gnu.org>
10255
10256 * xdisp.c (try_window_id): Undo last change.
10257
10258 * w32.c (getwd): Adjust commentary about startup_dir.
10259 (init_environment): Always call sys_access, even in non-MSVC
10260 builds. Don't chdir to the directory of the Emacs executable.
10261 This undoes code from 1997 which was justified by the need to
10262 "avoid conflicts when removing and renaming directories". But its
10263 downside was that every relative file name was being interpreted
10264 relative to the directory of the Emacs executable, which can never
10265 be TRT. In particular, it broke sys_access when called with
10266 relative file names.
10267 (sys_access): Map GetLastError to errno.
10268
10269 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10270
10271 * window.h (struct window): Change type of 'fringes_outside_margins'
10272 to bitfield. Fix comment. Adjust users accordingly.
10273 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10274 Adjust comment.
10275 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10276 to ptrdiff_t.
10277
10278 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
10279
10280 * gnutls.c (emacs_gnutls_handshake):
10281 Add QUIT to make the loop interruptible.
10282
10283 2012-06-29 Glenn Morris <rgm@gnu.org>
10284
10285 * charset.c (init_charset): Make lack of etc/charsets fatal.
10286
10287 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10288
10289 * editfns.c (region_limit): Fix type mismatch.
10290
10291 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10292
10293 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10294 undefined. Convert from xassert to eassert.
10295 * nsmenu.m: Convert from xassert to eassert.
10296 * nsterm.m: Likewise.
10297
10298 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10299
10300 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10301
10302 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10303
10304 Avoid integer overflow on scroll-left and scroll-right.
10305 * window.c (HSCROLL_MAX): New macro.
10306 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10307 overflow when requested scroll falls outside ptrdiff_t range.
10308
10309 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10310
10311 * window.h (struct window): Change type of 'hscroll',
10312 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10313 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10314 Adjust users accordingly.
10315 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10316 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10317 from EMACS_INT to ptrdiff_t.
10318 (make_window): Omit redundant initialization.
10319
10320 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
10321
10322 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10323
10324 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10325
10326 * window.h (struct window): Change type of 'use_time' and
10327 'sequence_number' from Lisp_Object to int.
10328 * frame.c (make_frame): Adjust users accordingly.
10329 * print.c (print_object): Likewise.
10330 * window.c (select_window, Fwindow_use_time, make_parent_window)
10331 (make_window): Likewise.
10332
10333 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10334
10335 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10336 enabled with --enable-checking=[all,glyphs] configure option.
10337 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10338 adjust comments accordingly.
10339 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10340 undefined, adjust comments accordingly.
10341 * image.c: Likewise.
10342 * scroll.c: Likewise.
10343 * w32fns.c: Likewise.
10344 * w32term.c: Likewise.
10345 * xdisp.c: Likewise.
10346 * xfaces.c: Likewise.
10347 * xfns.c: Likewise.
10348 * xterm.c: Likewise.
10349
10350 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10351
10352 Generalize run-time debugging checks.
10353 * dispextern.h (XASSERTS): Remove.
10354 * fontset.c (xassert): Remove.
10355 Convert from xassert to eassert.
10356 * alloc.c: Convert from xassert to eassert.
10357 * bidi.c: Likewise.
10358 * dispnew.c: Likewise.
10359 * fns.c: Likewise.
10360 * fringe.c: Likewise.
10361 * ftfont.c: Likewise.
10362 * gtkutil.c: Likewise.
10363 * image.c: Likewise.
10364 * keyboard.c: Likewise.
10365 * menu.c: Likewise.
10366 * process.c: Likewise.
10367 * scroll.c: Likewise.
10368 * sound.c: Likewise.
10369 * term.c: Likewise.
10370 * w32console.c: Likewise.
10371 * w32fns.c: Likewise.
10372 * w32term.c: Likewise.
10373 * window.c: Likewise.
10374 * xdisp.c: Likewise.
10375 * xfaces.c: Likewise.
10376 * xfns.c: Likewise.
10377 * xselect.c: Likewise.
10378 * xterm.c: Likewise.
10379
10380 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10381
10382 * fns.c (maybe_resize_hash_table): Output message when growing the
10383 purify-hashtable.
10384
10385 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10386
10387 * alloc.c (allocate_string_data): Remove dead code.
10388 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10389 avoid GCC warning about unused macro.
10390
10391 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10392
10393 * alloc.c (allocate_string): Omit intervals initialization.
10394 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10395 as in make_pure_string and make_pure_c_string.
10396
10397 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10398
10399 * alloc.c (allocate_string): Fix last change.
10400
10401 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10402
10403 * alloc.c (allocate_string): Remove two redundant calls
10404 to memset, add explicit initialization where appropriate.
10405
10406 2012-06-27 Glenn Morris <rgm@gnu.org>
10407
10408 * lisp.mk (lisp): Remove paths.elc.
10409
10410 2012-06-27 Chong Yidong <cyd@gnu.org>
10411
10412 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10413
10414 2012-06-26 John Wiegley <johnw@newartisans.com>
10415
10416 * unexmacosx.c (copy_data_segment): Add two section names used
10417 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10418
10419 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10420 when building with Clang.
10421
10422 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10423
10424 * eval.c (Fapply): Allow calling it with a single argument.
10425
10426 2012-06-26 Eli Zaretskii <eliz@gnu.org>
10427
10428 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10429 _stricmp and _strnicmp.
10430 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10431
10432 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10433
10434 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10435 allocated window.
10436 (allocate_process): Likewise for new process.
10437 (allocate_terminal): Change to use offsetof.
10438 (allocate_frame): Likewise.
10439 * frame.c (make_frame): Omit redundant initialization.
10440 * window.c (make_parent_window): Use memset.
10441 (make_window): Omit redundant initialization.
10442 * process.c (make_process): Omit redundant initialization.
10443 * terminal.c (create_terminal): Likewise.
10444
10445 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10446
10447 * term.c (delete_tty): Remove redundant call to memset.
10448
10449 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10450
10451 * alloc.c: Remove build_string.
10452 * lisp.h: Define build_string as static inline. This provides
10453 a better opportunity to optimize away calls to strlen when the
10454 function is called with compile-time constant argument.
10455 * image.c (imagemagick_error): Convert to build_string.
10456 * w32proc.c (sys_spawnve): Likewise.
10457 * xterm.c (x_term_init): Likewise.
10458
10459 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10460
10461 Use sprintf return value instead of invoking strlen on result.
10462 In the old days this wasn't portable, since some sprintf
10463 implementations returned char *. But they died out years ago and
10464 Emacs already assumes sprintf returns int.
10465 Similarly for float_to_string.
10466 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10467 * ccl.c (ccl_driver):
10468 * character.c (string_escape_byte8):
10469 * data.c (Fnumber_to_string):
10470 * doprnt.c (doprnt):
10471 * print.c (print_object):
10472 * xdisp.c (message_dolog):
10473 * xfns.c (syms_of_xfns):
10474 Use sprintf or float_to_string result to avoid need to call strlen.
10475 * data.c (Fnumber_to_string):
10476 Use make_unibyte_string, since the string must be ASCII.
10477 * lisp.h, print.c (float_to_string): Now returns int length.
10478 * term.c (produce_glyphless_glyph):
10479 Use sprintf result rather than recomputing it.
10480
10481 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10482 * Makefile.in (ALL_CFLAGS):
10483 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10484 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10485
10486 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10487
10488 * dispextern.h (xstrcasecmp): Define to library function
10489 strcasecmp if available.
10490 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10491
10492 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10493
10494 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10495 Avoid comma operator.
10496 * menu.c (push_submenu_start, push_submenu_end)
10497 (push_left_right_boundary, push_menu_pane): Likewise.
10498 * msdos.c (dos_rawgetc): Likewise.
10499
10500 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10501
10502 * xfns.c (xic_create_fontsetname): Remove redundant calls
10503 to memset.
10504
10505 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10506
10507 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10508 sprintf already null-terminates its output.
10509
10510 * xfns.c (x_window): Remove redundant cast.
10511
10512 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10513
10514 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10515 `const char *' to `char *' to avoid compiler warning.
10516
10517 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10518
10519 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10520 instead of truncating it to 63 (admittedly a generous limit).
10521
10522 * process.c: Fix spelling and caps in comments.
10523
10524 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10525
10526 * emacs.c (setpgrp): Remove definition, unused.
10527 * sysdep.c (setpgrp): Remove definition, not used in this file.
10528
10529 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
10530
10531 * makefile.w32-in: Update dependencies.
10532
10533 2012-06-24 Eli Zaretskii <eliz@gnu.org>
10534
10535 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10536 (SYSTIME_H): Add nt/inc/sys/time.h.
10537
10538 * systime.h [WINDOWSNT]: Include sys/time.h.
10539
10540 * s/ms-w32.h (struct timespec): Definition moved from
10541 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10542
10543 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10544
10545 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10546 * buffer.h (buffer_slot_type_mismatch):
10547 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10548 * eval.c (unwind_to_catch):
10549 * image.c (my_png_error, my_error_exit):
10550 * keyboard.c (quit_throw_to_read_char, user_error)
10551 (Fexit_recursive_edit, Fabort_recursive_edit):
10552 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10553 (wrong_type_argument, buffer_overflow, __executable_start)
10554 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10555 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10556 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10557 (fatal):
10558 (child_setup) [!DOS_NT]:
10559 * lread.c (end_of_file_error, invalid_syntax):
10560 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10561 * puresize.h (pure_write_error):
10562 * search.c (matcher_overflow):
10563 * sound.c (sound_perror, alsa_sound_perror):
10564 * sysdep.c, syssignal.h (croak):
10565 * term.c (maybe_fatal, vfatal):
10566 * textprop.c (text_read_only):
10567 * undo.c (user_error):
10568 * unexmacosx.c (unexec_error):
10569 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10570 Use _Noreturn rather than NO_RETURN.
10571 No need for separate decl merely because of _Noreturn.
10572 * sound.c (sound_warning, parse_sound):
10573 Remove unnecessary forward decls.
10574
10575 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10576
10577 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10578 * lisp.h (WAIT_READING_MAX): New macro.
10579 * dispnew.c (Fsleep_for, sit_for):
10580 * keyboard.c (kbd_buffer_get_event):
10581 * process.c (Faccept_process_output):
10582 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10583 This improves on the previous patch, which introduced a bug
10584 when time_t is unsigned and as wide as intmax_t.
10585 See <http://bugs.gnu.org/9000#51>.
10586
10587 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10588
10589 * dispnew.c (sit_for, Fsleep_for):
10590 * keyboard.c (kbd_buffer_get_event):
10591 * process.c (Faccept_process_output): Avoid compiler warnings when
10592 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10593
10594 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
10595
10596 * makefile.w32-in: Update dependencies.
10597
10598 * w32.c (ltime): Add return type and declare static.
10599 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10600
10601 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10604 Privately reported by Herbert J. Skuhra.
10605 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10606 All uses changed.
10607 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10608 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10609
10610 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10611
10612 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10613 last argument of make_unibyte_string.
10614
10615 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10616 language ID in the event parameters.
10617
10618 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10619 event.code, not the obscure "character set ID".
10620
10621 2012-06-23 Chong Yidong <cyd@gnu.org>
10622
10623 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10624
10625 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10626
10627 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10628 * w32.c (fdutimens): New function.
10629
10630 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10631
10632 * s/ms-w32.h (pselect): Redirect to sys_select.
10633
10634 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10635
10636 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10637 in the logic of incrementing and decrementing the value of
10638 use_relocatable_buffers.
10639
10640 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10641
10642 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10643 Privately reported by Herbert J. Skuhra.
10644 [__FreeBSD__]: Remove "*/" typo after "#include".
10645 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10646 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10647 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10648 Don't assume EMACS_TIME and struct timeval are the same type.
10649
10650 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10651
10652 Support higher-resolution time stamps (Bug#9000).
10653 The time stamps are only nanosecond-resolution at the C level,
10654 since that's the best that any real-world system supports now.
10655 But they are picosecond-resolution at the Lisp level, as that's
10656 easy, and leaves room for future OS improvements.
10657
10658 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10659 (LIBES): Use it.
10660
10661 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10662 Don't get current time unless it's needed.
10663
10664 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10665 now provides it if it's absent.
10666 (start_atimer): Port to higher-res time stamps.
10667 Check for time stamp overflow. Don't get current time more
10668 often than is needed.
10669
10670 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10671 Include systime.h, not time.h.
10672 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10673
10674 * dired.c: Include stat-time.h.
10675 (Ffile-attributes): File times now have higher resolution.
10676
10677 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10678 (struct image): Timestamp now has higher resolution.
10679
10680 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10681 has at least microseconds now. All uses removed.
10682 (update_frame, update_single_window, update_window, update_frame_1)
10683 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10684 (duration_to_sec_usec): Remove; no longer needed.
10685
10686 * editfns.c (time_overflow): Now extern.
10687 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10688 (float-time, Fformat_time_string, Fcurrent_time_string)
10689 (Fcurrent_time_zone): Accept and generate higher-resolution
10690 time stamps.
10691 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10692 (decode_time_components, lisp_seconds_argument): New functions.
10693 (make_time): Now static.
10694 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10695 Report an error if the time is invalid, rather than having the caller
10696 do that.
10697
10698 * fileio.c: Include <stat-time.h>
10699 (Fcopy_file): Copy higher-resolution time stamps.
10700 Prefer to set the time stamp via a file descriptor if that works.
10701 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10702 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10703 (Fvisited_file_modtime, Fset_visited_file_modtime):
10704 Support higher-resolution time stamps.
10705
10706 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10707
10708 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10709
10710 * image.c (prepare_image_for_display, clear_image_cache)
10711 (lookup_image): Port to higer-resolution time stamps.
10712
10713 * keyboard.c (start_polling, bind_polling_period):
10714 Check for time stamp overflow.
10715 (read_char, kbd_buffer_get_event, timer_start_idle)
10716 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10717 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10718 Port to higher-resolution time stamps. Do not assume time_t is signed.
10719 (decode_timer): New function. Timers are now vectors of length 9,
10720 not 8, to accommodate the picosecond component.
10721 (timer_check_2): Use it.
10722
10723 * nsterm.m (select_timeout, timeval_subtract): Remove.
10724 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10725 as they're a bit more accurate and handle overflow better.
10726 (ns_select): Change prototype to be compatible with pselect.
10727 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10728 * nsterm.h (ns_select): Adjust prototype.
10729
10730 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10731 us-resolution time stamps.
10732 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10733
10734 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10735
10736 * lisp.h (time_overflow): New decl.
10737 (wait_reading_process_output): First arg is now intmax_t, not int,
10738 to accommodate larger waits.
10739
10740 * process.h (struct Lisp_Process.read_output_delay):
10741 Now counts nanoseconds, not microseconds.
10742 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10743 EMACS_HAS_USECS.
10744 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10745 (wait_reading_process_output):
10746 Port to ns-resolution time stamps.
10747 (Faccept_process_output, wait_reading_process_output):
10748 Check for time stamp overflow. Do not assume time_t is signed.
10749 (select_wrapper): Remove; we now use pselect.
10750 (Fprocess_attributes): Now generates ns-resolution time stamps.
10751
10752 * sysdep.c: Include utimens.h. Don't include utime.h
10753 or worry about struct utimbuf; gnulib does that for us now.
10754 (gettimeofday): Remove; gnulib provides a substitute.
10755 (make_timeval): New function.
10756 (set_file_times): Now sets ns-resolution time stamps.
10757 New arg FD; all uses changed.
10758 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10759 (system_process_attributes):
10760 Now returns ns-resolution time stamp. All uses changed.
10761 Check for time stamp overflow.
10762
10763 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10764 provides a substitute now.
10765
10766 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10767 since it guarantees struct timespec.
10768 (EMACS_TIME): Now struct timespec, so that we can support
10769 ns-resolution time stamps.
10770 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10771 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10772 (EMACS_USECS): Remove.
10773 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10774 so multiply the arg by 1000 before storing it.
10775 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10776 New macros.
10777 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10778 Port to ns-resolution time stamps.
10779 (EMACS_TIME_NEG_P): Remove; replaced by....
10780 (EMACS_TIME_SIGN): New macro.
10781 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10782 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10783 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10784 (make_timeval, make_lisp_time, decode_time_components): New decls.
10785 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10786 that it mishandled time_t overflow. You can't compare by subtracting!
10787 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10788 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10789
10790 * term.c: Include <sys/time.h>.
10791 (timeval_to_Time): New function, for proper overflow wraparound.
10792 (term_mouse_position, term_mouse_click): Use it.
10793
10794 * undo.c (record_first_change): Support higher-resolution time stamps
10795 in the undo buffer.
10796 (Fprimitive_undo): Use them when restoring time stamps.
10797
10798 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10799 (w32_get_internal_run_time):
10800 Port to higher-resolution Emacs time stamps.
10801 (ltime): Now accepts single 64-bit integer, as that's more convenient
10802 for callers.
10803
10804 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10805
10806 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10807 for compatibility with pselect. Support ns-resolution time stamps.
10808
10809 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10810
10811 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10812 Check for time stamp overflow, and support ns-resolution time stamps.
10813
10814 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10815 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10816 (timeval_subtract): Remove; no longer needed.
10817 (XTflash, XTring_bell, x_wait_for_event):
10818 Port to ns-resolution time stamps. Don't assume time_t is signed.
10819
10820 2012-06-22 Chong Yidong <cyd@gnu.org>
10821
10822 * xdisp.c (x_consider_frame_title): Revert last change.
10823
10824 2012-06-22 Eli Zaretskii <eliz@gnu.org>
10825
10826 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10827 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10828 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10829 staticidx goes up to 1597 out of 1600 = 0x640.)
10830
10831 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10832
10833 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10834 Otherwise, the umask might be mistakenly 0 while handling input signals.
10835
10836 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10837
10838 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10839
10840 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10841
10842 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10843 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10844 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10845 access to `contents' member of Lisp_Vector objects with AREF and ASET
10846 where appropriate.
10847
10848 2012-06-19 Chong Yidong <cyd@gnu.org>
10849
10850 * frame.c (delete_frame): When selecting a frame on a different
10851 text terminal, do not alter the terminal's top-frame.
10852
10853 * xdisp.c (format_mode_line_unwind_data): Record the target
10854 frame's selected window and its terminal's top-frame.
10855 (unwind_format_mode_line): Restore them.
10856 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10857 Callers changed.
10858 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10859 since tty frames can be explicitly named.
10860 (prepare_menu_bars): Likewise.
10861
10862 * term.c (Ftty_top_frame): New function.
10863
10864 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10865
10866 Port byte-code-meter to modern targets.
10867 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10868 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
10869 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
10870 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10871 (METER_1, METER_2): Simplify.
10872
10873 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10874
10875 * data.c (Fdefalias): Return `symbol' (bug#11686).
10876
10877 2012-06-18 Martin Rudalics <rudalics@gmx.at>
10878
10879 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
10880 gets killed during executing of this function (Bug#11665).
10881 Try to always return Qt when the buffer has been actually killed.
10882 (Vkill_buffer_query_functions): In doc-string say that functions
10883 run by this hook should not change the current buffer.
10884
10885 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10886
10887 Fix recently-introduced process.c problems found by static checking.
10888 * process.c (write_queue_push, write_queue_pop, send_process):
10889 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10890 (write_queue_pop): Fix pointer signedness problem.
10891 (send_process): Remove unused local.
10892
10893 2012-06-17 Chong Yidong <cyd@gnu.org>
10894
10895 * xdisp.c (redisplay_internal): No need to redisplay terminal
10896 frames that are not on top.
10897
10898 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
10899
10900 * process.c (make_process): Initialize write_queue.
10901 (write_queue_push, write_queue_pop): New functions.
10902 (send_process): Use them to maintain correct ordering of process
10903 writes (Bug#10815).
10904
10905 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10906
10907 * lisp.h (eassert): Assume C89 or later.
10908 This removes the need for CHECK.
10909 (CHECK): Remove. Its comments about always evaluating its
10910 argument were confusing, as 'eassert' typically does not evaluate
10911 its argument.
10912
10913 * coding.c (produce_chars): Use ptrdiff_t, not int.
10914
10915 * xterm.c (x_draw_underwave): Check for integer overflow.
10916 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10917
10918 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
10919
10920 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10921 referenced (Bug#11583).
10922
10923 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10924
10925 Implement wave-style variant of underlining.
10926 * dispextern.h (face_underline_type): New enum.
10927 (face): Add field for underline type.
10928 * nsterm.m (ns_draw_underwave): New function.
10929 (ns_draw_text_decoration): Use it.
10930 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10931 New functions.
10932 (x_draw_glyph_string): Use them.
10933 * xfaces.c (Qline, Qwave): New Lisp objects.
10934 (check_lface_attrs, merge_face_ref)
10935 (Finternal_set_lisp_face_attribute, realize_x_face):
10936 Handle wave-style underline face attributes.
10937 * xterm.c (x_draw_underwave): New function.
10938 (x_draw_glyph_string): Use it.
10939
10940 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
10941
10942 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10943 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10944 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10945 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10946 ($(BLD)/w32select.$(O)): Update dependencies.
10947
10948 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10949
10950 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10951 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10952 * character.c (_fetch_multibyte_char_p): Remove.
10953 * alloc.c: Include "character.h" before "buffer.h".
10954 * bidi.c: Likewise.
10955 * buffer.c: Likewise.
10956 * bytecode.c: Likewise.
10957 * callint.c: Likewise.
10958 * callproc.c: Likewise.
10959 * casefiddle.c: Likewise.
10960 * casetab.c: Likewise.
10961 * category.c: Likewise.
10962 * cmds.c: Likewise.
10963 * coding.c: Likewise.
10964 * composite.c: Likewise.
10965 * dired.c: Likewise.
10966 * dispnew.c: Likewise.
10967 * doc.c: Likewise.
10968 * dosfns.c: Likewise.
10969 * editfns.c: Likewise.
10970 * emacs.c: Likewise.
10971 * fileio.c: Likewise.
10972 * filelock.c: Likewise.
10973 * font.c: Likewise.
10974 * fontset.c: Likewise.
10975 * fringe.c: Likewise.
10976 * indent.c: Likewise.
10977 * insdel.c: Likewise.
10978 * intervals.c: Likewise.
10979 * keyboard.c: Likewise.
10980 * keymap.c: Likewise.
10981 * lread.c: Likewise.
10982 * macros.c: Likewise.
10983 * marker.c: Likewise.
10984 * minibuf.c: Likewise.
10985 * nsfns.m: Likewise.
10986 * nsmenu.m: Likewise.
10987 * print.c: Likewise.
10988 * process.c: Likewise.
10989 * regex.c: Likewise.
10990 * region-cache.c: Likewise.
10991 * search.c: Likewise.
10992 * syntax.c: Likewise.
10993 * term.c: Likewise.
10994 * textprop.c: Likewise.
10995 * undo.c: Likewise.
10996 * unexsol.c: Likewise.
10997 * w16select.c: Likewise.
10998 * w32fns.c: Likewise.
10999 * w32menu.c: Likewise.
11000 * window.c: Likewise.
11001 * xdisp.c: Likewise.
11002 * xfns.c: Likewise.
11003 * xmenu.c: Likewise.
11004 * xml.c: Likewise.
11005 * xselect.c: Likewise.
11006
11007 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11008
11009 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11010 If all the glyphs of the glyph row came from strings, and we have no
11011 cursor positioning clues, put the cursor on the first glyph of the
11012 row.
11013 (handle_face_prop): Use chunk-relative overlay string index when
11014 indexing into it->string_overlays array. (Bug#11653)
11015 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11016 the rightmost. (Bug#11720)
11017
11018 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11019
11020 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11021 (CATEGORY_MEMBER): Enforce 1/0 value.
11022 * category.c (_temp_category_set): Remove.
11023
11024 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11025
11026 * window.c (Fdelete_other_windows_internal)
11027 (Fdelete_window_internal): Don't access frame's mouse highlight
11028 info of the initial frame. (Bug#11677)
11029
11030 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11031
11032 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11033 Assume USE_2_TAGS_FOR_INTS.
11034 (xreload): Adjust $tagmask width to match recent lisp.h change.
11035
11036 Simplify lisp.h in minor ways that should not affect code.
11037 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11038 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11039 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11040 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11041 (INTTYPEBITS): New macro, for clarity.
11042 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11043 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11044 Simplify now that USE_LSB_TAG is always defined.
11045 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11046 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11047
11048 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
11049
11050 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11051
11052 2012-06-13 Glenn Morris <rgm@gnu.org>
11053
11054 * s/bsd-common.h (BSD4_3):
11055 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11056
11057 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11058
11059 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11060 instead of union.
11061 (XLI, XIL): Define.
11062 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11063 Use them.
11064 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11065 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11066 * alloc.c (widen_to_Lisp_Object): Remove.
11067 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11068 * frame.c (delete_frame): Remove outdated comment.
11069 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11070 USE_LISP_UNION_TYPE.
11071 (Fw32_unregister_hot_key): Likewise.
11072 (Fw32_toggle_lock_key): Likewise.
11073 * w32menu.c (add_menu_item): Likewise.
11074 (w32_menu_display_help): Use XIL instead of checking
11075 USE_LISP_UNION_TYPE.
11076 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11077 (init_heap): Likewise.
11078 * w32term.c (w32_read_socket): Update comment.
11079
11080 2012-06-13 Glenn Morris <rgm@gnu.org>
11081
11082 * s/usg5-4-common.h, src/s/unixware.h:
11083 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11084
11085 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11086
11087 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11088
11089 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11090 * alloc.c (make_number) [!defined make_number]:
11091 Remove, as lisp.h always defines this now.
11092 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11093 (roundup_size): Verify that it is a power of 2.
11094 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11095 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11096 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11097 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11098 USE_LSB_TAG now is always defined to be either 0 or 1.
11099 All uses changed.
11100 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11101 code works fine either way, and efficiency is not a concern here,
11102 as the union type is for debugging, not for production.
11103 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11104 Use an inline function on all platforms when using the union type,
11105 since this is simpler and 'static inline' can be used portably
11106 within Emacs now.
11107 (LISP_INITIALLY_ZERO): New macro.
11108 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11109 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11110
11111 2012-06-12 Glenn Morris <rgm@gnu.org>
11112
11113 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11114
11115 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
11116
11117 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11118 Move BROKEN_SIGIO to configure.
11119
11120 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11121 Move NO_TERMIO to configure.
11122
11123 2012-06-12 Chong Yidong <cyd@gnu.org>
11124
11125 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11126 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11127 MagickExportImagePixels is undefined.
11128
11129 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11130
11131 * image.c (imagemagick_load_image): Remove unused label.
11132
11133 2012-06-11 Glenn Morris <rgm@gnu.org>
11134
11135 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11136 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11137 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11138 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11139
11140 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11141
11142 * alloc.c (make_byte_code): New function.
11143 (Fmake_byte_code): Use it. Don't purify here.
11144 * lread.c (read1): Use it as well to avoid extra allocation.
11145
11146 2012-06-11 Chong Yidong <cyd@gnu.org>
11147
11148 * image.c (imagemagick_load_image): Implement transparency.
11149
11150 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11151
11152 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11153 account for preceding backslashes. (Bug#11663)
11154
11155 2012-06-09 Chong Yidong <cyd@gnu.org>
11156
11157 * term.c: Support italics in capable terminals (Bug#9652).
11158 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11159 (turn_on_face): Output using TS_enter_italic_mode if available.
11160 Don't handle unused blinking and alt-charset cases.
11161 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11162 and tty_alt_charset_p cases.
11163 (tty_capable_p, init_tty): Support italics.
11164
11165 * termchar.h (struct tty_display_info): Add field for italics.
11166 Remove unused blink field.
11167
11168 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11169 Handle slant.
11170
11171 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11172 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11173 tty_alt_charset_p. Add tty_italic_p.
11174
11175 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
11176
11177 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11178 dbus_type_is_basic if available.
11179 (xd_extract_signed, xd_extract_unsigned): Rename from
11180 extract_signed and extract_unsigned, respectively. Adapt callers.
11181
11182 2012-06-09 Chong Yidong <cyd@gnu.org>
11183
11184 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11185
11186 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11187 case (Bug#9752).
11188
11189 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11190
11191 * xdisp.c (vmessage): Treat frame message as multibyte.
11192 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11193 would generate the diagnostic "Making \302\247 buffer-local while
11194 let-bound!".
11195
11196 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11197
11198 * dispnew.c (showing_window_margins_p): Undo last change, which
11199 was done due to an inadvertent commit.
11200 (adjust_frame_glyphs_for_frame_redisplay): Do call
11201 showing_window_margins_p.
11202
11203 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11204
11205 * eval.c (Fmake_var_non_special): New primitive.
11206 (syms_of_eval): Defsubr it.
11207 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11208
11209 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
11210
11211 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11212 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11213
11214 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11215
11216 * alloc.c (allocate_vectorlike): Fix last change.
11217
11218 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11219
11220 Block-based vector allocation of small vectors.
11221 * lisp.h (struct vectorlike_header): New field `nbytes',
11222 adjust comment accordingly.
11223 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11224 to denote vector blocks. Adjust users (live_vector_p,
11225 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11226 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11227 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11228 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11229 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11230 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11231 (roundup_size): New constant.
11232 (struct vector_block): New data type.
11233 (vector_blocks, vector_free_lists, zero_vector): New variables.
11234 (all_vectors): Rename to `large_vectors'.
11235 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11236 (sweep_vectors): New functions.
11237 (allocate_vectorlike): Return `zero_vector' as the only vector of
11238 0 items. Allocate new vector from block if vector size is less than
11239 or equal to VBLOCK_BYTES_MAX.
11240 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11241 (init_alloc_once): Add call to init_vectors.
11242
11243 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11244
11245 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11246
11247 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11248
11249 * doprnt.c (doprnt): Truncate multibyte char correctly.
11250 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11251 would mishandle a string argument "Xc" if X was a multibyte
11252 character of length 2: it would truncate after X's first byte
11253 rather than including all of X.
11254
11255 2012-06-06 Chong Yidong <cyd@gnu.org>
11256
11257 * buffer.c (word_wrap): Doc fix.
11258
11259 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11260
11261 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11262
11263 2012-06-03 Glenn Morris <rgm@gnu.org>
11264
11265 * xdisp.c (tool-bar-style): Doc fix.
11266
11267 2012-06-03 Ulrich Müller <ulm@gentoo.org>
11268
11269 * Makefile.in (PAXCTL): Define.
11270 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11271 binary via PaX flags if the paxctl utility is available.
11272 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11273 Restore PaX flags to their default. (Bug#11398)
11274
11275 2012-06-03 Chong Yidong <cyd@gnu.org>
11276
11277 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11278 buffer (Bug#11226).
11279
11280 2012-06-03 Chong Yidong <cyd@gnu.org>
11281
11282 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11283 (note_mode_line_or_margin_highlight): If there is no help echo,
11284 use mode-line-default-help-echo. Handle the case where the mouse
11285 position is past the end of the mode line string.
11286
11287 * buffer.c (buffer_local_value_1): New function, split from
11288 Fbuffer_local_value; can return Qunbound.
11289 (Fbuffer_local_value): Use it.
11290 (Vmode_line_format): Docstring tweaks.
11291
11292 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11293
11294 * sysdep.c (system_process_attributes): Improve comment.
11295
11296 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11297
11298 * keyboard.c: Export real-this-command to Elisp.
11299 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11300 and DEFVAR it. Update all users.
11301
11302 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11305
11306 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11307 Convert pctcpu and pctmem to Lisp float properly.
11308 Let the compiler fold better, as 100.0/0x8000 is exact.
11309
11310 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11311
11312 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11313 cons_block.
11314
11315 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11316
11317 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11318
11319 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11320
11321 For a 'struct window', replace some Lisp_Object fields to
11322 bitfields where appropriate, remove unused fields.
11323 * window.h (struct window): Remove unused 'last_mark_x' and
11324 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
11325 change its type from Lisp_Object to bitfield.
11326 Change type of 'force_start', 'optional_new_start',
11327 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11328 fields from Lisp_Object to bitfield. Adjust users accordingly.
11329
11330 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11331
11332 Pacify gcc -Wdouble-precision when using Xaw.
11333 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11334 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11335 Use 'float' consistently, rather than 'float' in most places
11336 and 'double' in a couple of places.
11337
11338 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11339
11340 * xdisp.c (handle_stop): Detect whether we have overlay strings
11341 loaded by testing it->current.overlay_string_index to be
11342 non-negative, instead of checking whether n_overlay_strings is
11343 positive. (Bug#11587)
11344
11345 2012-05-31 Chong Yidong <cyd@gnu.org>
11346
11347 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11348
11349 * doc.c (Fsubstitute_command_keys): Doc fix.
11350
11351 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11352
11353 * search.c (search_buffer): Remove calls to
11354 r_alloc_inhibit_buffer_relocation, as it is now called by
11355 maybe_unify_char, which was the cause of relocation of buffer text
11356 in bug#11519.
11357
11358 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11359
11360 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11361 for the duration of call to load_charset, to avoid problems with
11362 callers of maybe_unify_char that access buffer text through C
11363 pointers.
11364
11365 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11366 decrement the inhibition flag, instead of just setting or
11367 resetting it.
11368
11369 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11370
11371 Remove obsolete '#define static' cruft.
11372 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11373 This #undef was "temporary" in 2000; it is no longer needed
11374 now that '#define static' has gone away.
11375 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11376 (gray_bitmap_bits): Remove; no longer needed.
11377 All uses replaced with definiens.
11378 * xterm.c: Include "bitmaps/gray.xbm".
11379
11380 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11381
11382 Clean up __executable_start, monstartup when --enable-profiling.
11383 The following changes affect the code only when profiling.
11384 * dispnew.c (__executable_start): Rename from safe_bcopy.
11385 Define only on platforms that need it.
11386 * emacs.c: Include <sys/gmon.h> when profiling.
11387 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11388 (__executable_start): Remove decl, since lisp.h does it now.
11389 (safe_bcopy): Remove decl; no longer has that name.
11390 (main): Coalesce #if into single bit of code, for simplicity.
11391 Cast pointers to uintptr_t, since standard libraries want integers
11392 and not pointers.
11393 * lisp.h (__executable_start): New decl.
11394
11395 2012-05-31 Glenn Morris <rgm@gnu.org>
11396
11397 * image.c (Fimagemagick_types): Doc fix.
11398
11399 2012-05-30 Jim Meyering <meyering@redhat.com>
11400
11401 * callproc.c (Fcall_process_region): Include directory component
11402 in mkstemp error message (Bug#11586).
11403
11404 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11405
11406 * alloc.c, lisp.h (make_pure_vector): Now static.
11407
11408 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11409
11410 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11411 Move to byte-run.el.
11412 (Fautoload): Do the hash-doc more carefully.
11413 * data.c (Fdefalias): Purify definition, except for keymaps.
11414 (Qdefun): Move from eval.c.
11415 * lisp.h (Qdefun): Remove.
11416 * lread.c (read1): Tiny simplification.
11417
11418 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
11419
11420 Do not create empty overlays with the evaporate property (Bug#9642).
11421 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11422 Bug#9642, but explicitly check that the buffer the overlay would
11423 be moved to is live and rearrange lines to make sure that errors
11424 will not put the overlay in an inconsistent state.
11425 (Fdelete_overlay): Cosmetics.
11426
11427 2012-05-28 Eli Zaretskii <eliz@gnu.org>
11428
11429 * w32term.c (my_bring_window_to_top): New function.
11430 (x_raise_frame): Use handle returned by DeferWindowPos, which
11431 could be different from the original one.
11432 Call my_bring_window_to_top instead of my_set_foreground_window.
11433 (Bug#11513)
11434
11435 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11436 by calling BringWindowToTop.
11437
11438 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11439 (WM_EMACS_END): Increase by one.
11440
11441 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11442
11443 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11444 This avoids undefined behavior that might cause the eassert
11445 to not catch an out-of-range value.
11446
11447 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
11448
11449 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11450 Update dependencies.
11451
11452 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11453
11454 * bidi.c (bidi_mirror_char): Fix last change.
11455
11456 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11457
11458 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11459 when referring to sectname field in printf format.
11460
11461 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11462
11463 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11464 Only r_alloc_inhibit_buffer_relocation needed to be added;
11465 the others were already declared.
11466
11467 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11468 before checking whether it's out of range. Put the check inside
11469 eassert. See
11470 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11471
11472 2012-05-27 Ken Brown <kbrown@cornell.edu>
11473
11474 * callproc.c (Fcall_process): Restore a line that was accidentally
11475 commented out in the 2011-02-13 change (bug#11547).
11476
11477 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11478
11479 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11480 defined on ralloc.c.
11481
11482 * buffer.c [REL_ALLOC]: Remove prototypes of
11483 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11484 they are now on lisp.h.
11485
11486 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11487
11488 * search.c (search_buffer): Use it to inhibit relocation of buffer
11489 text while re_search_2 is doing its job, because re_search_2 is
11490 passed C pointers to buffer text. (Bug#11519)
11491
11492 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11493 Update value to 24.
11494
11495 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11496 state after an additional call to move_it_in_display_line_to, keep
11497 the values of it->max_ascent and it->max_descent found for the
11498 entire line.
11499 (pos_visible_p): Revert the comparison against bottom_y to what it
11500 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11501 (Bug#11464)
11502
11503 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11504
11505 Fix coding-related core dumps with gcc -ftrapv.
11506 The code was computing A - B, where A and B are pointers, and B is
11507 random garbage. This can lead to core dumps on platforms that
11508 have special pointer registers, and it also leads to core dumps on
11509 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11510 A - B only when B is initialized properly.
11511 * coding.c (coding_set_source, coding_set_destination): Return void.
11512 (coding_change_source, coding_change_destinations): New functions,
11513 with the old behaviors of coding_set_source and coding_set_destination.
11514 All callers that need an offset changed to use these new functions.
11515
11516 2012-05-26 Glenn Morris <rgm@gnu.org>
11517
11518 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11519
11520 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11521
11522 Extend mouse support on W32 text-mode console.
11523 * xdisp.c (draw_row_with_mouse_face):
11524 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
11525
11526 * w32console.c: Include window.h.
11527 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11528 New functions.
11529 (initialize_w32_display): Initialize mouse-highlight data.
11530
11531 * w32inevt.c: Include termchar.h and window.h.
11532 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11533 moves, call note_mouse_highlight. If help_echo changed, call
11534 gen_help_event to produce help-echo message in the echo area.
11535 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11536 highlight info.
11537
11538 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11539
11540 * lread.c (read1): Simplify slightly to avoid an overflow warning
11541 with GCC 4.7.0 on x86-64.
11542
11543 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11544
11545 * bidi.c (bidi_mirror_char): Revert last change: an int is
11546 definitely wide enough here.
11547
11548 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
11549
11550 Fix integer width and related bugs (Bug#9874).
11551 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
11552 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11553 (string_bytes, check_sblock, allocate_string_data):
11554 (compact_small_strings, Fmake_bool_vector, make_string)
11555 (make_unibyte_string, make_multibyte_string)
11556 (make_string_from_bytes, make_specified_string)
11557 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11558 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11559 (mark_vectorlike):
11560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11561 (allocate_pseudovector):
11562 Use int, not EMACS_INT, where int is wide enough.
11563 (inhibit_garbage_collection, Fgarbage_collect):
11564 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11565 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11566 int might not be wide enough.
11567 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11568 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11569 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11570 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11571 (bidi_level_of_next_char, bidi_move_to_visually_next):
11572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11573 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11574 (Fkill_buffer, Fset_buffer_major_mode)
11575 (advance_to_char_boundary, Fbuffer_swap_text)
11576 (Fset_buffer_multibyte, overlays_at, overlays_in)
11577 (overlay_touches_p, struct sortvec, record_overlay_string)
11578 (overlay_strings, recenter_overlay_lists)
11579 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11580 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11581 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11582 (Foverlay_recenter, last_overlay_modification_hooks_used)
11583 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11585 (validate_region): Omit unnecessary test for b <= e,
11586 since that's guaranteed by the previous test.
11587 (adjust_overlays_for_delete): Avoid pos + length overflow.
11588 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11589 (report_overlay_modification):
11590 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11591 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11592 Omit pointer cast, which isn't needed anyway, and doesn't work
11593 after the EMACS_INT -> ptrdiff_t change.
11594 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
11595 * buffer.h: Adjust decls to match defn changes elsewhere.
11596 (struct buffer_text, struct buffer):
11597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11598 Use EMACS_INT, not int, where int might not be wide enough.
11599 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11600 not int, to avoid needless 32-bit limit on 64-bit hosts.
11601 (exec_byte_code): Use tighter memory-full test, one that checks
11602 for alloca overflow. Don't compute the address of the object just
11603 before an array, as that's not portable. Use EMACS_INT, not
11604 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
11605 * callint.c (Fcall_interactively):
11606 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11607 * callproc.c (call_process_kill, Fcall_process):
11608 Don't assume pid_t fits into an Emacs fixnum.
11609 (call_process_cleanup, Fcall_process, child_setup):
11610 Don't assume pid_t fits into int.
11611 (call_process_cleanup, Fcall_process, delete_temp_file)
11612 (Fcall_process_region):
11613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11614 (Fcall_process): Simplify handling of volatile integers.
11615 Use int, not EMACS_INT, where int will do.
11616 * casefiddle.c (casify_object, casify_region, operate_on_word)
11617 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11619 (casify_object): Avoid integer overflow when overallocating buffer.
11620 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
11621 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
11622 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11623 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11624 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11625 integers are now checked earlier. All uses replaced with XINT.
11626 (ccl_driver):
11627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11628 For CCL_MapSingle, check that content and value are in int range.
11629 (ccl_driver, Fregister_code_conversion_map):
11630 Check that Vcode_version_map_vector is a vector.
11631 (resolve_symbol_ccl_program): Check that vector header is in range.
11632 Always copy the vector, so that we can check its contents reliably
11633 now rather than having to recheck each instruction as it's being
11634 executed. Check that vector words fit in 'int'.
11635 (ccl_get_compiled_code, Fregister_ccl_program)
11636 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11637 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11638 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11639 contents are in range.
11640 (Fccl_execute_on_string): Check that status is in range.
11641 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11642 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11643 Accept and return EMACS_INT, not int, because callers can pass values
11644 out of 'int' range.
11645 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11646 (multibyte_chars_in_text, parse_str_as_multibyte)
11647 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11648 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11649 (string_escape_byte8, Fget_byte):
11650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11651 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
11652 avoid mishandling large integers.
11653 * character.h: Adjust decls to match defn changes elsewhere.
11654 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11655 (Ffind_charset_region):
11656 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11657 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11658 (load_charset_map_from_vector, Fdefine_charset_internal):
11659 Don't assume fixnum fits in int.
11660 (load_charset_map_from_vector, Fmap_charset_chars):
11661 Remove now-unnecessary CHECK_NATNUMs.
11662 (Fdefine_charset_internal): Check ranges here, more carefully.
11663 Don't rely on undefined behavior with signed left shift overflow.
11664 Don't assume unsigned int fits into fixnum, or that fixnum fits
11665 into unsigned int. Don't require max_code to be a valid fixnum;
11666 that's not true for gb10830 4-byte on a 32-bit host. Allow
11667 invalid_code to be a cons, for the same reason. Require code_offset
11668 to be a character. Avoid int overflow if max_char is close
11669 to INT_MAX.
11670 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11671 this is intended anyway and avoids some undefined behavior.
11672 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11673 INDEX_TO_CODE_POINT, as that's what it expects.
11674 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11675 * charset.h (DECODE_CHAR): Return int, not unsigned;
11676 this is what was intended anyway, and it avoids undefined behavior.
11677 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11678 integer-overflow issues.
11679 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11680 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11681 where the argument is EMACS_INT, and this behavior is not intended.
11682 * chartab.c (Fmake_char_table, Fset_char_table_range)
11683 (uniprop_get_decoder, uniprop_get_encoder):
11684 Don't assume fixnum fits in int.
11685 * cmds.c (move_point): New function, that does the gist of
11686 Fforward_char and Fbackward_char, but does so while checking
11687 for integer overflow more accurately.
11688 (Fforward_char, Fbackward_char): Use it.
11689 (Fforward_line, Fend_of_line, internal_self_insert)
11690 (internal_self_insert):
11691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11692 Fix a FIXME, by checking for integer overflow when calculating
11693 target_clm and actual_clm.
11694 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11695 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11696 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11697 (coding_alloc_by_making_gap, alloc_destination)
11698 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11699 (encode_coding_utf_16, detect_coding_emacs_mule)
11700 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11701 (detect_coding_iso_2022, decode_coding_iso_2022)
11702 (encode_invocation_designation, encode_designation_at_bol)
11703 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11704 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11705 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11706 (encode_coding_ccl, encode_coding_raw_text)
11707 (detect_coding_charset, decode_coding_charset)
11708 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11709 (produce_composition, produce_charset, produce_annotation)
11710 (decode_coding, handle_composition_annotation)
11711 (handle_charset_annotation, consume_chars, decode_coding_gap)
11712 (decode_coding_object, encode_coding_object, detect_coding_system)
11713 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11714 (code_convert_region, code_convert_string)
11715 (Fdefine_coding_system_internal)
11716 (coding_set_source, coding_set_destination):
11717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11718 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11719 (Fdefine_coding_system_internal):
11720 Don't assume fixnums fit in int.
11721 (decode_coding_gap, decode_coding_object, encode_coding_object)
11722 (Fread_coding_system, Fdetect_coding_region)
11723 (Funencodable_char_position, Fcheck_coding_systems_region)
11724 (get_translation, handle_composition_annotation, consume_chars):
11725 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11726 (consume_chars): Rewrite to not calculate an address outside buffer.
11727 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
11728 Don't access memory outside of the args array.
11729 (Fdefine_coding_system_internal): Check for charset-id overflow.
11730 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11731 result of ENCODE_CHAR.
11732 * coding.h: Adjust decls to match defn changes elsewhere.
11733 (struct coding_system):
11734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11735 * composite.c (get_composition_id, find_composition)
11736 (run_composition_function, update_compositions)
11737 (compose_text, composition_gstring_put_cache)
11738 (composition_gstring_p, composition_gstring_width)
11739 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11740 (composition_compute_stop_pos, composition_reseat_it)
11741 (composition_update_it, struct position_record)
11742 (find_automatic_composition, composition_adjust_point)
11743 (Fcomposition_get_gstring, Ffind_composition_internal):
11744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11745 (update_compositions):
11746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11747 * composite.h: Adjust decls to match defn changes elsewhere.
11748 (struct composition):
11749 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11750 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11751 Do not attempt to compute the address of the object just before a
11752 buffer; this is not portable.
11753 (Faref, Faset):
11754 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11755 (Faset): Use int, not EMACS_INT, where int is wide enough.
11756 (Fstring_to_number): Don't assume fixnums fit in int.
11757 (Frem): Don't assume arg is nonnegative.
11758 * dbusbind.c (xd_append_arg): Check for integers out of range.
11759 (Fdbus_call_method): Don't overflow the timeout int.
11760 (extract_signed, extract_unsigned): New functions.
11761 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11762 (xd_get_connection_references): Return ptrdiff_t, not int.
11763 All uses changed.
11764 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11765 (xd_read_message_1):
11766 Use int, not unsigned, where the dbus API uses int.
11767 (Fdbus_message_internal): Don't overflow mtype.
11768 (syms_of_dbusbind): Allocate right-sized buffer for integers.
11769 * dired.c (directory_files_internal, file_name_completion, scmp)
11770 (file_name_completion_stat):
11771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11772 (file_name_completion): Don't overflow matchcount.
11773 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11774 * dispextern.h: Adjust decls to match defn changes elsewhere.
11775 (struct text_pos, struct glyph, struct bidi_saved_info)
11776 (struct bidi_string_data, struct bidi_it, struct composition_it)
11777 (struct it):
11778 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11779 (struct display_pos, struct composition_it, struct it):
11780 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11781 * dispnew.c (increment_matrix_positions)
11782 (increment_row_positions, mode_line_string)
11783 (marginal_area_string):
11784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11785 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
11786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11787 (duration_to_sec_usec): New function, to check for overflow better.
11788 (Fsleep_for, sit_for): Use it.
11789 * doc.c (get_doc_string, store_function_docstring):
11790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11791 (get_doc_string, Fsnarf_documentation):
11792 Use int, not EMACS_INT, where int is wide enough.
11793 (get_doc_string):
11794 Use SAFE_ALLOCA, not alloca.
11795 Check for overflow when converting EMACS_INT to off_t.
11796 * doprnt.c (doprnt):
11797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11798 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11799 Don't assume uid_t fits into fixnum.
11800 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11801 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11802 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11803 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11804 (general_insert_function)
11805 (Finsert_char, make_buffer_string, make_buffer_string_both)
11806 (update_buffer_properties, Fbuffer_substring)
11807 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11808 (Fsubst_char_in_region, check_translation)
11809 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11810 (transpose_markers, Ftranspose_regions):
11811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11812 (clip_to_bounds): Move to lisp.h as an inline function).
11813 (Fconstrain_to_field): Don't assume integers are nonnegative.
11814 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11815 (Fsubst_char_in_region, Fsave_restriction):
11816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11817 (Femacs_pid): Don't assume pid_t fits into fixnum.
11818 (lo_time): Use int, not EMACS_INT, when int suffices.
11819 (lisp_time_argument): Check for usec out of range.
11820 (Fencode_time): Don't assume fixnum fits in int.
11821 (Fuser_login_name, Fuser_full_name): Signal an error
11822 if a uid argument is out of range, rather than relying on
11823 undefined behavior.
11824 (Fformat_time_string): Remove now-unnecessary check.
11825 lisp_time_argument checks for out-of-range usec now.
11826 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
11827 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11828 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11829 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11830 (init_cmdargs, Fdump_emacs):
11831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11832 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11833 the bottom (typically) 32 bits of the fixnum.
11834 * eval.c (specpdl_size, call_debugger):
11835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11836 (when_entered_debugger, Fbacktrace_debug):
11837 Don't assume fixnum can fit in int.
11838 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11839 the object just before a buffer; this is not portable.
11840 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11841 (grow_specpdl, unbind_to):
11842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11843 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11844 (grow_specpdl): Simplify allocation by using xpalloc.
11845 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
11846 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11847 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11849 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11850 (a_write, e_write):
11851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11852 (Fcopy_file, non_regular_nbytes, read_non_regular)
11853 (Finsert_file_contents):
11854 Use int, not EMACS_INT, where int is wide enough.
11855 (READ_BUF_SIZE): Verify that it fits in int.
11856 (Finsert_file_contents): Check that counts are in proper range,
11857 rather than assuming fixnums fit into ptrdiff_t etc.
11858 Don't assume fixnums fit into int.
11859 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
11860 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11861 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
11862 (string_char_to_byte, string_byte_to_char)
11863 (string_make_multibyte, string_to_multibyte)
11864 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11865 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11866 (substring_both, Fdelete, internal_equal, Ffillarray)
11867 (Fclear_string, mapcar1)
11868 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11869 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11870 (larger_vector, make_hash_table, maybe_resize_hash_table)
11871 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11872 (Fmaphash, secure_hash):
11873 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11874 (concat): Check for string index and length overflow.
11875 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11876 (Frequire):
11877 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11878 (larger_vector): New API (vec, incr_min, size_max) replaces old
11879 one (vec, new_size, init). This catches size overflow.
11880 INIT was removed because it was always Qnil.
11881 All callers changed.
11882 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11883 the upper bound on a hash table index size.
11884 (make_hash_table, maybe_resize_hash_table): Use it.
11885 (secure_hash): Computer start_byte and end_byte only after
11886 they're known to be in ptrdiff_t range.
11887 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11888 (Ffont_get_glyphs, Ffont_at):
11889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11890 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11891 (Flist_fonts, Fopen_font):
11892 Don't assume fixnum can fit in int.
11893 (check_gstring): Don't assume index can fit in int.
11894 (font_match_p): Check that fixnum is a character, not a nonnegative
11895 fixnum, since the later code needs to stuff it into an int.
11896 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11897 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11898 conversion overflow issues.
11899 (Fopen_font): Check for integer out of range.
11900 (Ffont_get_glyphs): Don't assume index can fit in int.
11901 * font.h: Adjust decls to match defn changes elsewhere.
11902 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11903 integer overflow.
11904 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11905 printmax_t, where ptrdiff_t is wide enough.
11906 (Finternal_char_font):
11907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11908 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11909 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11910 (Fset_frame_position, x_set_frame_parameters)
11911 (x_set_line_spacing, x_set_border_width)
11912 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11913 Check that fixnums are in proper range for system types.
11914 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11915 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11916 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11917 Use SAFE_ALLOCA_LISP, not alloca.
11918 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11919 intptr_t is wide enough.
11920 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11921 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11922 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11923 Check for fixnum out of range.
11924 * ftfont.c (ftfont_list): Don't assume index fits in int.
11925 Check that fixnums are in proper range for system types.
11926 (ftfont_shape_by_flt):
11927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11928 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11930 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11931 Check that fixnums are in proper range for system types.
11932 * gnutls.h: Adjust decls to match defn changes elsewhere.
11933 * gtkutil.c (xg_dialog_run):
11934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11935 (update_frame_tool_bar):
11936 Check that fixnums are in proper range for system types.
11937 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
11938 (lookup_image): Check that fixnums are in range for system types.
11939 * indent.c (last_known_column, last_known_column_point):
11940 (current_column_bol_cache):
11941 (skip_invisible, current_column, check_display_width):
11942 (check_display_width, scan_for_column, current_column_1)
11943 (Findent_to, Fcurrent_indentation, position_indentation)
11944 (indented_beyond_p, Fmove_to_column, compute_motion):
11945 (Fcompute_motion, Fvertical_motion):
11946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11947 (last_known_column_modified): Use EMACS_INT, not int.
11948 (check_display_width):
11949 (Fcompute_motion):
11950 Check that fixnums and floats are in proper range for system types.
11951 (compute_motion): Don't assume index or fixnum fits in int.
11952 (compute_motion, Fcompute_motion):
11953 Use int, not EMACS_INT, when it is wide enough.
11954 (vmotion): Omit local var start_hpos that is always 0; that way
11955 we don't need to worry about overflow in expressions involving it.
11956 * indent.h: Adjust decls to match defn changes elsewhere.
11957 (struct position):
11958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11959 Use int, not EMACS_INT, where int is wide enough.
11960 Remove unused members ovstring_chars_done and tab_offset;
11961 all uses removed.
11962 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11963 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11964 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11965 (make_gap, copy_text, insert, insert_and_inherit)
11966 (insert_before_markers, insert_before_markers_and_inherit)
11967 (insert_1, count_combining_before, count_combining_after)
11968 (insert_1_both, insert_from_string)
11969 (insert_from_string_before_markers, insert_from_string_1)
11970 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11971 (adjust_after_replace, adjust_after_insert, replace_range)
11972 (replace_range_2, del_range, del_range_1, del_range_byte)
11973 (del_range_both, del_range_2, modify_region)
11974 (prepare_to_modify_buffer, signal_before_change)
11975 (signal_after_change, Fcombine_after_change_execute):
11976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11977 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11978 (balance_an_interval, split_interval_right, split_interval_left)
11979 (find_interval, next_interval, update_interval)
11980 (adjust_intervals_for_insertion, delete_node, delete_interval)
11981 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11982 (static_offset_intervals, offset_intervals)
11983 (merge_interval_right, merge_interval_left, make_new_interval)
11984 (graft_intervals_into_buffer, temp_set_point_both)
11985 (temp_set_point, set_point, adjust_for_invis_intang)
11986 (set_point_both, move_if_not_intangible, get_property_and_range)
11987 (get_local_map, copy_intervals, copy_intervals_to_string)
11988 (compare_string_intervals, set_intervals_multibyte_1):
11989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11990 * intervals.h: Adjust decls to match defn changes elsewhere.
11991 (struct interval):
11992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11993 * keyboard.c (this_command_key_count, this_single_command_key_start)
11994 (before_command_key_count, before_command_echo_length, echo_now)
11995 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11996 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11997 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11998 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11999 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12000 (last_non_minibuf_size, last_point_position, echo_truncate)
12001 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12002 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12003 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12004 (stuff_buffered_input):
12005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12006 (last_auto_save, command_loop_1, read_char):
12007 Use EMACS_INT, not int, to avoid integer overflow.
12008 (record_char): Avoid overflow in total_keys computation.
12009 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12010 * keyboard.h: Adjust decls to match defn changes elsewhere.
12011 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12012 (Fkey_description, Fdescribe_vector, Flookup_key):
12013 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12014 (click_position): New function, to check that positions are in range.
12015 (Fcurrent_active_maps):
12016 (describe_command):
12017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12018 (Faccessible_keymaps, Fkey_description):
12019 (preferred_sequence_p):
12020 Don't assume fixnum can fit into int.
12021 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12022 Check for integer overflow in size calculations.
12023 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12024 avoid mishandling large integers.
12025 * lisp.h: Adjust decls to match defn changes elsewhere.
12026 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12027 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12028 (struct Lisp_Marker):
12029 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12030 (clip_to_bounds): Now an inline function, moved here from editfns.c.
12031 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12032 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12033 All callers changed.
12034 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12035 Assume the arg has valid form, since it always does.
12036 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12037 unsigned integer system type.
12038 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12039 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12041 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12042 (duration_to_sec_usec): New decl.
12043 * lread.c (read_from_string_index, read_from_string_index_byte)
12044 (read_from_string_limit, readchar, unreadchar, openp)
12045 (read_internal_start, read1, oblookup):
12046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12047 (Fload, readevalloop, Feval_buffer, Feval_region):
12048 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12049 (openp): Check for out-of-range argument to 'access'.
12050 (read1): Use int, not EMACS_INT, where int is wide enough.
12051 Don't assume fixnum fits into int.
12052 Fix off-by-one error that can read outside a buffer.
12053 (read_filtered_event): Use duration_to_sec_usec
12054 to do proper overflow checking on durations.
12055 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12056 in size calculation.
12057 (Fexecute_kbd_macro):
12058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12059 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12060 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12061 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12062 (set_marker_both, set_marker_restricted_both, marker_position)
12063 (marker_byte_position, Fbuffer_has_markers_at):
12064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12065 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12066 * menu.c (ensure_menu_items): Rename from grow_menu_items.
12067 It now merely ensures that the menu is large enough, without
12068 necessarily growing it, as this avoids some integer overflow issues.
12069 All callers changed.
12070 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12072 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12073 Use SAFE_ALLOCA_LISP, not alloca.
12074 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12075 to EMACS_INT. Check that fixnums are in proper range for system types.
12076 * minibuf.c (minibuf_prompt_width, string_to_object)
12077 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12078 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12080 (get_minibuffer, read_minibuf_unwind):
12081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12082 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12083 this simplifies overflow checking. All callers changed.
12084 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12085 (Ftest_completion):
12086 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12087 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12088 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12089 Check that fixnums are in proper range for system types.
12090 (Fx_create_frame, Fx_show_tip):
12091 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12092 * nsfont.m (ns_findfonts, nsfont_list_family):
12093 Don't assume fixnum fits in long.
12094 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12095 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12096 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12097 wide enough.
12098 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12099 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12100 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12101 (PRINTDECLARE, PRINTPREPARE):
12102 (strout, print_string):
12103 (print, print_preprocess, print_check_string_charset_prop)
12104 (print_object):
12105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12106 (PRINTDECLARE):
12107 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12109 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12110 (printchar, strout): Use xpalloc to catch size calculation overflow.
12111 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12112 (print_error_message): Use SAFE_ALLOCA, not alloca.
12113 (print_object): Use int, not EMACS_INT, where int is wide enough.
12114 (print_depth, new_backquote_output, print_number_index):
12115 Use ptrdiff_t, not int, where int might not be wide enough.
12116 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12117 (Fset_process_window_size, Fformat_network_address)
12118 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
12119 (sigchld_handler):
12120 Check that fixnums are in proper range for system types.
12121 (Fsignal_process): Simplify by avoiding a goto.
12122 Check for process-ids out of pid_t range rather than relying on
12123 undefined behavior.
12124 (process_tick, update_tick): Use EMACS_INT, not int.
12125 (Fformat_network_address, read_process_output, send_process)
12126 (Fprocess_send_region, status_notify):
12127 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12128 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12129 (wait_reading_process_output, read_process_output, exec_sentinel):
12130 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12131 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12132 (Faccept_process_output): Use duration_to_sec_usec to do proper
12133 overflow checking on durations.
12134 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12135 Don't assume pid_t fits in int.
12136 * process.h (struct Lisp_Process): Members tick and update_tick
12137 are now of type EMACS_INT, not int.
12138 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12139 configured --with-wide-int.
12140 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12141 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12142 * search.c (looking_at_1, string_match_1):
12143 (fast_string_match, fast_c_string_match_ignore_case)
12144 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12145 (scan_newline, find_before_next_newline, search_command)
12146 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12147 (set_search_regs, wordify):
12148 (Freplace_match):
12149 (Fmatch_data):
12150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12151 (string_match_1, search_buffer, set_search_regs):
12152 (Fmatch_data):
12153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12154 (wordify): Check for overflow in size calculation.
12155 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12156 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12157 Check that fixnums are in proper range for system types.
12158 * sound.c (struct sound_device)
12159 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12161 (Fplay_sound_internal):
12162 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12163 * syntax.c (struct lisp_parse_state, find_start_modiff)
12164 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12165 (Fparse_partial_sexp):
12166 Don't assume fixnums can fit in int.
12167 (struct lisp_parse_state, find_start_pos, find_start_value)
12168 (find_start_value_byte, find_start_begv)
12169 (update_syntax_table, char_quoted, dec_bytepos)
12170 (find_defun_start, prev_char_comend_first, back_comment):
12171 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12172 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12174 (Finternal_describe_syntax_value): Check that match_lisp is a
12175 character, not an integer, since the code stuffs it into int.
12176 (scan_words, scan_sexps_forward):
12177 Check that fixnums are in proper range for system types.
12178 (Fforward_word):
12179 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12180 (scan_sexps_forward):
12181 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12182 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12183 * syntax.h: Adjust decls to match defn changes elsewhere.
12184 (struct gl_state_s):
12185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12186 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12187 MOST_POSITIVE_FIXNUM.
12188 * sysdep.c (wait_for_termination_1, wait_for_termination)
12189 (interruptible_wait_for_termination, mkdir):
12190 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12191 (emacs_read, emacs_write):
12192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12193 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12194 and double all fit in int.
12195 * term.c (set_tty_color_mode):
12196 Check that fixnums are in proper range for system types.
12197 * termhooks.h (struct input_event):
12198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12199 * textprop.c (validate_interval_range, interval_of)
12200 (Fadd_text_properties, set_text_properties_1)
12201 (Fremove_text_properties, Fremove_list_of_text_properties)
12202 (Ftext_property_any, Ftext_property_not_all)
12203 (copy_text_properties, text_property_list, extend_property_ranges)
12204 (verify_interval_modification):
12205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12206 (Fnext_single_char_property_change)
12207 (Fprevious_single_char_property_change):
12208 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12209 (copy_text_properties):
12210 Check for integer overflow in index calculation.
12211 * undo.c (last_boundary_position, record_point, record_insert)
12212 (record_delete, record_marker_adjustment, record_change)
12213 (record_property_change):
12214 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12215 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12217 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12218 (Fx_hide_tip, Fx_file_dialog):
12219 * w32menu.c (set_frame_menubar):
12220 Use ptrdiff_t, not int, for consistency with rest of code.
12221 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12222 (select_window, Fdelete_other_windows_internal)
12223 (window_scroll_pixel_based, window_scroll_line_based)
12224 (Frecenter, Fset_window_configuration):
12225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12226 (Fset_window_hscroll, run_window_configuration_change_hook)
12227 (set_window_buffer, temp_output_buffer_show, scroll_command)
12228 (Fscroll_other_window, Frecenter):
12229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12230 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12231 Don't assume fixnum fits in int.
12232 (Fset_window_scroll_bars):
12233 Check that fixnums are in proper range for system types.
12234 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12235 (string_pos, c_string_pos, number_of_chars, init_iterator)
12236 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12237 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12238 (compute_display_string_end, handle_face_prop)
12239 (face_before_or_after_it_pos, handle_invisible_prop)
12240 (handle_display_prop, handle_display_spec, handle_single_display_spec)
12241 (display_prop_intangible_p, string_buffer_position_lim)
12242 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12243 (get_overlay_strings_1, get_overlay_strings)
12244 (iterate_out_of_display_property, forward_to_next_line_start)
12245 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12246 (get_next_display_element, set_iterator_to_next)
12247 (get_visually_first_element, compute_stop_pos_backwards)
12248 (handle_stop_backwards, next_element_from_buffer)
12249 (move_it_in_display_line_to, move_it_in_display_line)
12250 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12251 (add_to_log, message_dolog, message_log_check_duplicate)
12252 (message2, message2_nolog, message3, message3_nolog
12253 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12254 (current_message_1, truncate_echo_area, truncate_message_1)
12255 (set_message, set_message_1, store_mode_line_noprop)
12256 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12257 (text_outside_line_unchanged_p, check_point_in_composition)
12258 (reconsider_clip_changes)
12259 (redisplay_internal, set_cursor_from_row, try_scrolling)
12260 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12261 (redisplay_window, find_last_unchanged_at_beg_row)
12262 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12263 (trailing_whitespace_p, find_row_edges, display_line)
12264 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12265 (display_mode_element, store_mode_line_string)
12266 (pint2str, pint2hrstr, decode_mode_spec)
12267 (display_count_lines, display_string, draw_glyphs)
12268 (x_produce_glyphs, x_insert_glyphs)
12269 (rows_from_pos_range, mouse_face_from_buffer_pos)
12270 (fast_find_string_pos, mouse_face_from_string_pos)
12271 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12273 (safe_call, init_from_display_pos, handle_fontified_prop)
12274 (handle_single_display_spec, load_overlay_strings)
12275 (with_echo_area_buffer, setup_echo_area_for_printing)
12276 (display_echo_area, echo_area_display)
12277 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12278 (update_tool_bar, hscroll_window_tree, redisplay_internal)
12279 (redisplay_window, dump_glyph_row, display_mode_line)
12280 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12281 (handle_display_spec, display_prop_string_p):
12282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12283 (handle_single_display_spec, build_desired_tool_bar_string)
12284 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12285 (get_specified_cursor_type):
12286 Check that fixnums are in proper range for system types.
12287 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12288 (Flookup_image_map):
12289 Don't assume fixnums fit in int.
12290 (compare_overlay_entries):
12291 Avoid mishandling comparisons due to subtraction overflow.
12292 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12293 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12294 (handle_tool_bar_click):
12295 Use int, not unsigned, since we prefer signed and the signedness
12296 doesn't matter here.
12297 (get_next_display_element, next_element_from_display_vector):
12298 Use int, not EMACS_INT, when int is wide enough.
12299 (start_hourglass): Use duration_to_sec_usec to do proper
12300 overflow checking on durations.
12301 * xfaces.c (Fbitmap_spec_p):
12302 Check that fixnums are in proper range for system types.
12303 (compare_fonts_by_sort_order):
12304 Avoid mishandling comparisons due to subtraction overflow.
12305 (Fx_family_fonts, realize_basic_faces):
12306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12307 (Fx_family_fonts):
12308 Don't assume fixnum fits in int.
12309 Use SAFE_ALLOCA_LISP, not alloca.
12310 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12311 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12312 (face_at_buffer_position, face_for_overlay_string)
12313 (face_at_string_position):
12314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12315 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12316 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12317 (Fx_show_tip):
12318 Check that fixnums are in proper range for system types.
12319 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12320 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12322 (Fx_change_window_property): Don't assume fixnums fit in int.
12323 * xfont.c (xfont_chars_supported):
12324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12325 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12326 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12327 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12328 * xml.c (parse_region):
12329 * xrdb.c (magic_file_p):
12330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12331 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12332 (x_get_local_selection, x_reply_selection_request)
12333 (x_handle_selection_request, wait_for_property_change):
12334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12335 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12336 short is wide enough.
12337 (x_send_client_event): Don't assume fixnum fits in int.
12338 * xterm.c (x_x_to_emacs_modifiers):
12339 Don't assume EMACS_INT overflows nicely into int.
12340 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12341 may come from Lisp.
12342 (handle_one_xevent): NATNUMP can eval its arg twice.
12343 (x_connection_closed):
12344 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12345 * xterm.h: Adjust decls to match defn changes elsewhere.
12346 (struct scroll_bar): Use struct vectorlike_header
12347 rather than rolling our own approximation.
12348 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12349
12350 2012-05-25 Glenn Morris <rgm@gnu.org>
12351
12352 * lisp.mk (lisp): Update for more files being compiled now.
12353
12354 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12355
12356 * lread.c: Remove `read_pure' which makes no difference.
12357 (read_pure): Remove var.
12358 (unreadpure): Remove function.
12359 (readevalloop): Don't call read_list with -1 flag.
12360 (read1, read_vector): Don't test read_pure any more.
12361 (read_list): Simplify.
12362
12363 * fileio.c, character.h: Minor style tweaks.
12364
12365 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12366
12367 * window.h (clip_changed): Remove useless declaration.
12368
12369 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
12370
12371 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12372 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12373
12374 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12375
12376 Remove src/m/*.
12377 This directory predates autoconf and is no longer needed nowadays.
12378 Move its few remaining bits of functionality to where they're needed.
12379 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12380 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12381 * m/template.h: Remove.
12382 * Makefile.in (M_FILE): Remove. All uses removed.
12383 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12384 * lisp.h (USE_LSB_TAG):
12385 * mem-limits.h (EXCEEDS_LISP_PTR):
12386 Use VAL_MAX, not VALBITS, in #if.
12387 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12388 (EMACS_UINT): Define unconditionally now.
12389 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12390 (BITS_PER_EMACS_INT): New constants, replacing
12391 what used to be in config.h, but not useful in #if.
12392 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12393 define them any more.
12394 (VAL_MAX): New macro.
12395 (VALMASK): Use it.
12396 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12397 BITS_PER_EMACS_INT, in #if.
12398 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12399 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12400 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12401 * s/ms-w32.h (DATA_START):
12402 Move here from removed file m/intel386.h.
12403 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12404 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12405
12406 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12407
12408 Assume C89 or later.
12409 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12410 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12411 (xrealloc):
12412 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12413 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12414 * textprop.c, tparam.c (NULL): Remove.
12415 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12416 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12417 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12418 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12419 * xterm.c (input_signal_count): Assume volatile works.
12420
12421 2012-05-21 Ken Brown <kbrown@cornell.edu>
12422
12423 * xgselect.c (xg_select): Fix first argument in call to 'select'
12424 (bug#11508).
12425
12426 2012-05-20 Ken Brown <kbrown@cornell.edu>
12427
12428 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
12429 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
12430
12431 2012-05-19 Ken Brown <kbrown@cornell.edu>
12432
12433 * xfns.c (x_in_use): Remove `static' qualifier.
12434 * xterm.h (x_in_use): Declare.
12435 * xgselect.c: Include xterm.h.
12436 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12437 and `display_arg' (bug#9754).
12438
12439 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12440
12441 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12442
12443 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12444 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12445
12446 2012-05-18 Eli Zaretskii <eliz@gnu.org>
12447
12448 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12449
12450 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
12451 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
12452
12453 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12454 reference to image_cache->refcount.
12455 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12456
12457 2012-05-17 Juri Linkov <juri@jurta.org>
12458
12459 * search.c (Fword_search_regexp, Fword_search_backward)
12460 (Fword_search_forward, Fword_search_backward_lax)
12461 (Fword_search_forward_lax): Move functions to isearch.el
12462 (bug#10145, bug#11381).
12463
12464 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12467
12468 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12469
12470 * lread.c (init_obarray): Declare Qt and Qnil as special.
12471
12472 2012-05-14 Glenn Morris <rgm@gnu.org>
12473
12474 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12475 Put "libexec" before "bin", for the sake of init_callproc_1.
12476
12477 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12478
12479 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12480
12481 * unexaix.c: Port to more-recent AIX compilers.
12482 (report_error, report_error_1, make_hdr, copy_sym)
12483 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12484 Make arguments const char *, not char *, to avoid violations of C
12485 standard and to fix some AIX warnings reported by Gilles Pion.
12486
12487 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12488
12489 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12490 already have overlays loaded.
12491 (handle_single_display_spec): Before returning without displaying
12492 fringe bitmap, synchronize the bidi iterator with the main display
12493 iterator, by calling iterate_out_of_display_property.
12494 (iterate_out_of_display_property): Detect buffer iteration by
12495 testing that it->string is a Lisp string.
12496 (get_next_display_element): When the current object is exhausted,
12497 and there's something on it->stack, call set_iterator_to_next to
12498 proceed with what's on the stack, instead of returning zero.
12499 (set_iterator_to_next): If called at the end of a Lisp string,
12500 proceed to consider_string_end without incrementing string
12501 position. Don't increment display vector index past the end of
12502 the display vector. (Bug#11417)
12503 (pos_visible_p): Don't report a position visible when move_it_to
12504 stopped at the last line of window, which happens to be scanned
12505 backwards by the bidi iteration. (Bug#11464)
12506
12507 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12508
12509 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12510 and right-margin display specs even if the spec is invalid or we
12511 are on a TTY, and thus unable to display on the fringes.
12512 That's because the text with the property will not be displayed anyway,
12513 so we need to signal to the caller that this is a "replacing"
12514 display spec. This fixes display when the spec is invalid or we
12515 are on a TTY.
12516
12517 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12518
12519 * unexaix.c (make_hdr): Fix typo in prototype.
12520 This bug broke the build on AIX. Problem reported by Gilles Pion.
12521
12522 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
12523
12524 * keyboard.c (kbd_buffer_get_event): Read special events also in
12525 batch mode. (Bug#11415)
12526
12527 2012-05-12 Glenn Morris <rgm@gnu.org>
12528
12529 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12530
12531 2012-05-12 Eli Zaretskii <eliz@gnu.org>
12532
12533 * lisp.mk (lisp): Add newcomment.elc.
12534
12535 2012-05-12 Glenn Morris <rgm@gnu.org>
12536
12537 * Makefile.in (MKDIR_P): New, set by configure.
12538 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12539
12540 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12541
12542 Remove unused function hourglass_started.
12543 * dispextern.h (hourglass_started):
12544 * w32fns.c (hourglass_started):
12545 * xdisp.c (hourglass_started): Remove.
12546
12547 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
12548
12549 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12550 Update dependencies.
12551
12552 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12553
12554 * xgselect.c (xg_select): Put maxfds+1 into a var.
12555 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12556
12557 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12558
12559 2012-05-10 Dave Abrahams <dave@boostpro.com>
12560
12561 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12562 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12563
12564 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
12565
12566 * dbusbind.c (xd_registered_buses): New internal Lisp object.
12567 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
12568 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12569 Initialize xd_registered_buses.
12570
12571 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12572
12573 Untag more efficiently if USE_LSB_TAG.
12574 This is based on a proposal by YAMAMOTO Mitsuharu in
12575 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12576 For an admittedly artificial (nth 8000 longlist) benchmark on
12577 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12578 Emacs's overall text size by 1%.
12579 * lisp.h (XUNTAG): New macro.
12580 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12581 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12582 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12583 * eval.c (Fautoload):
12584 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12585 * frame.h (XFRAME): Use XUNTAG.
12586
12587 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12588 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12589 Remove unportable assumptions about print widths of types like
12590 dbus_uint32_t.
12591 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12592 intptr_t when converting between pointer and integer, to avoid GCC
12593 warnings about wrong width.
12594
12595 2012-05-09 Eli Zaretskii <eliz@gnu.org>
12596
12597 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12598 stack for each reader_thread, instead of defaulting to 8MB
12599 determined by the linker. This avoids failures in creating
12600 subprocesses on Windows 7, see the discussion in this thread:
12601 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12602
12603 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12604
12605 Fix up display of the *Minibuf-0* buffer in the mini window.
12606 * keyboard.c (read_char): Don't clear the echo area if there's no
12607 message to clear.
12608 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
12609 contents of *Minibuf-0*) if there's no message displayed in its stead.
12610
12611 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
12612
12613 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12614 batch mode.
12615
12616 2012-05-06 Chong Yidong <cyd@gnu.org>
12617
12618 * lisp.mk (lisp): Update.
12619
12620 2012-05-05 Jim Meyering <meyering@redhat.com>
12621
12622 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12623
12624 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12625
12626 * data.c (PUT_ERROR): New macro.
12627 (syms_of_data): Use it. Add new error type `user-error'.
12628 * undo.c (user_error): New function.
12629 (Fprimitive_undo): Use it.
12630 * print.c (print_error_message): Adjust print style for `user-error'.
12631 * keyboard.c (user_error): New function.
12632 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12633
12634 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12635
12636 Do not limit current-time-string to years 1000..9999.
12637 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12638 (Fcurrent_time_string): Support any year that is supported by the
12639 underlying localtime representation. Don't use asctime, as it
12640 has undefined behavior for years outside the range -999..9999.
12641
12642 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12643
12644 Fix race conditions involving setenv, gmtime, localtime, asctime.
12645 Without this fix, interrupts could mess up code that uses these
12646 nonreentrant functions, since setting TZ invalidates existing
12647 tm_zone or tzname values, and since most of these functions return
12648 pointers to static storage.
12649 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12650 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12651 Grow the critical sections to include not just invoking
12652 localtime/gmtime, but also accessing these functions' results
12653 including their tm_zone values if any, and any related TZ setting.
12654 (format_time_string): Last arg is now struct tm *, not struct tm **,
12655 so that the struct tm is saved in the critical section.
12656 All callers changed. Simplify allocation of initial buffer, partly
12657 motivated by the fact that memory allocation needs to be outside
12658 the critical section.
12659
12660 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12661
12662 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12663 with RESET_INTERVAL.
12664
12665 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12666 Remove duplicated buffer name initialization.
12667
12668 2012-05-02 Jim Meyering <jim@meyering.net>
12669
12670 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12671
12672 * xfns.c (x_window): Use xstrdup (Bug#11375).
12673
12674 2012-05-02 Eli Zaretskii <eliz@gnu.org>
12675
12676 * xdisp.c (pos_visible_p): If already at a newline from the
12677 display string before the 'while' loop, don't walk back the glyphs
12678 from it3.glyph_row. Solves assertion violation when the display
12679 string begins with a newline (egg.el). (Bug#11367)
12680
12681 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12682
12683 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12684 Move to simple.el.
12685
12686 2012-05-01 Glenn Morris <rgm@gnu.org>
12687
12688 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12689 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12690 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12691 All were removed before 23.1.
12692
12693 * dispnew.c: Remove HAVE_LIBNCURSES test;
12694 it is always true on relevant platforms.
12695
12696 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12697 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12698
12699 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12700
12701 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12702
12703 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12704 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12705 Remove.
12706
12707 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12708
12709 Do not avoid creating empty evaporating overlays (Bug#9642).
12710 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12711 That is, do not delete an evaporating overlay if it becomes
12712 empty after its bounds are adjusted to fit within its buffer.
12713 This fix caused other problems, and I'm reverting it until we get
12714 to the bottom of them.
12715
12716 2012-04-27 Chong Yidong <cyd@gnu.org>
12717
12718 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12719
12720 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12721
12722 * xdisp.c (pos_visible_p): If the window start position is beyond
12723 ZV, start the display from buffer beginning. Prevents assertion
12724 violation in init_iterator when the minibuffer window is scrolled
12725 via the scroll bar.
12726
12727 * window.c (window_scroll_pixel_based): Likewise.
12728
12729 2012-04-27 Chong Yidong <cyd@gnu.org>
12730
12731 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12732
12733 2012-04-27 Glenn Morris <rgm@gnu.org>
12734
12735 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12736 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12737
12738 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12739
12740 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12741 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
12742
12743 2012-04-26 Eli Zaretskii <eliz@gnu.org>
12744
12745 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12746 display element, check also the underlying string or buffer
12747 character. (Bug#11341)
12748
12749 * w32menu.c: Include w32heap.h.
12750 (add_menu_item): If the call to AppendMenuW (via
12751 unicode_append_menu) fails, disable Unicode menus only if we are
12752 running on Windows 9X/Me.
12753
12754 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12755
12756 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12757 (xgetint): Add missing shift for LSB tags.
12758
12759 2012-04-24 Martin Rudalics <rudalics@gmx.at>
12760
12761 * keyboard.c (read_char): Don't wipe echo area for select window
12762 events: These might get delayed via `mouse-autoselect-window'
12763 (Bug#11304).
12764
12765 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
12766
12767 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12768 manipulation of :loaded-from data.
12769
12770 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
12771
12772 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12773 now a cons (bug#11311).
12774
12775 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12776
12777 Do not create empty overlays with the evaporate property (Bug#9642).
12778 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12779 if it becomes empty after its bounds are adjusted to fit within
12780 its buffer. Without this fix, in a nonempty buffer (let ((o
12781 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12782 yields an empty overlay that has the evaporate property, which is
12783 not supposed to happen.
12784
12785 Fix minor GTK3 problems found by static checking.
12786 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12787 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12788 (struct _EmacsFixedClass, emacs_fixed_get_type):
12789 Move decls here from emacsgtkfixed.h, since they needn't be public.
12790 (emacs_fixed_get_type): Now static.
12791 (emacs_fixed_class_init): Omit unused local.
12792 (emacs_fixed_child_type): Remove; unused.
12793 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12794 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12795 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12796 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12797 (EMACS_FIXED_GET_CLASS): Remove; unused.
12798 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12799
12800 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12801 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12802
12803 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12804
12805 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
12806 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
12807 (__malloc_size_t, __malloc_ptrdiff_t):
12808 Remove. All uses removed, replaced by the definiens if needed,
12809 since we can assume C89 or better now.
12810 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12811 (protect_malloc_state, align, get_contiguous_space)
12812 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12813 (malloc_atfork_handler_child, malloc_enable_thread)
12814 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12815 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12816 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12817 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12818 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12819 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12820 Define using prototypes, not old style.
12821 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12822 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12823 (align): Don't assume that signed integer overflow wraps around.
12824 Omit unused local var.
12825 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12826 (_free_internal_nolock, memalign, mallochook, reallochook):
12827 Omit no-longer-needed casts.
12828 (valloc): Use getpagesize, not __getpagesize.
12829 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12830 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12831
12832 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12833
12834 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
12835
12836 Move functions from C to Lisp. Make non-blocking method calls
12837 the default. Implement further D-Bus standard interfaces.
12838
12839 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12840 (QCdbus_request_name_allow_replacement)
12841 (QCdbus_request_name_replace_existing)
12842 (QCdbus_request_name_do_not_queue)
12843 (QCdbus_request_name_reply_primary_owner)
12844 (QCdbus_request_name_reply_in_queue)
12845 (QCdbus_request_name_reply_exists)
12846 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12847 (QCdbus_registered_serial, QCdbus_registered_method)
12848 (QCdbus_registered_signal): New Lisp objects.
12849 (XD_DEBUG_MESSAGE): Use sizeof.
12850 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12851 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12852 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12853 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12854 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12855 (xd_signature, xd_append_arg): Allow float for integer types.
12856 (xd_get_connection_references): New function.
12857 (xd_get_connection_address): Rename from xd_initialize.
12858 Return cached address.
12859 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12860 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12861 level.
12862 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
12863 Return number of refcounts.
12864 (Fdbus_get_unique_name): Make stronger parameter check.
12865 (Fdbus_message_internal): New defun.
12866 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12867 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12868 (Fdbus_send_signal, Fdbus_register_service)
12869 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12870 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12871 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12872 (Vdbus_compiled_version, Vdbus_runtime_version)
12873 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12874 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12875 (Vdbus_message_type_signal): New defvars.
12876 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12877 Adapt docstring.
12878
12879 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12880
12881 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12882 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12883 Do not assume ptrdiff_t is the same width as 'int'.
12884
12885 * alloc.c: Handle unusual debugging option combinations.
12886 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12887 since the two debugging options are incompatible.
12888 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12889 is defined.
12890 (mem_init, mem_insert, mem_insert_fixup):
12891 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12892 (NEED_MEM_INSERT): Remove; no longer needed.
12893
12894 2012-04-22 Leo Liu <sdl.web@gmail.com>
12895
12896 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12897
12898 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12899
12900 * sysdep.c [__FreeBSD__]: Minor cleanups.
12901 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12902 Use Emacs indenting style more consistently. Avoid some casts.
12903 Use 'double' consistently rather than mixing 'float' and 'double'.
12904
12905 2012-04-21 Eduard Wiebe <usenet@pusto.de>
12906
12907 * sysdep.c (list_system_processes, system_process_attributes):
12908 Add implementation for FreeBSD (Bug#5243).
12909
12910 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12911
12912 * lisp.mk (lisp): Update.
12913
12914 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12915
12916 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12917 It is never used otherwise.
12918
12919 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12920
12921 * print.c (print_preprocess): Only check print_depth if print-circle
12922 is nil.
12923 (print_object): Check for cycles even when print-circle is nil and
12924 print-gensym is t, but only check print_depth if print-circle is nil.
12925
12926 2012-04-20 Chong Yidong <cyd@gnu.org>
12927
12928 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12929 set the status to "failed" and ensure that sentinel is run.
12930
12931 2012-04-20 Glenn Morris <rgm@gnu.org>
12932
12933 * process.c (Fset_process_inherit_coding_system_flag)
12934 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
12935 (Fmake_network_process, Fmake_serial_process): Doc fix.
12936
12937 2012-04-20 Eli Zaretskii <eliz@gnu.org>
12938
12939 * xdisp.c (string_buffer_position_lim): Limit starting position to
12940 BEGV.
12941 (set_cursor_from_row): If called for a mode-line or header-line
12942 row, return zero immediately.
12943 (try_cursor_movement): If inside continuation line, don't back up
12944 farther than the first row after the header line, if any.
12945 Don't consider the header-line row as "partially visible", even if
12946 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12947
12948 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12949
12950 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12951 (bug#11238).
12952
12953 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
12954 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
12955
12956 configure: new option --enable-gcc-warnings (Bug#11207)
12957 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12958 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12959 (ALL_CFLAGS): Use new macros rather than old.
12960 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12961 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12962 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12963 -Wunused-result, -Wunused-variable. This should go away once
12964 the Emacs and Gnulib regex code is merged.
12965 (xmalloc, xrealloc): Now static.
12966
12967 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12968
12969 * dired.c (Fsystem_groups): Remove unused local.
12970
12971 2012-04-17 Glenn Morris <rgm@gnu.org>
12972
12973 * dired.c (Fsystem_users): Doc fix.
12974
12975 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12976
12977 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12978 (syms_of_dired): Add them.
12979
12980 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12981
12982 Fix minor alloc.c problems found by static checking.
12983 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12984 New extern decls, to avoid calling undeclared functions.
12985 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12986 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12987 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12988 (NEED_MEM_INSERT): New macro.
12989 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
12990 Remove one incorrect comment and fix another.
12991
12992 Fix minor ralloc.c problems found by static checking.
12993 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12994 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12995 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12996 (r_alloc_sbrk): Now static.
12997
12998 Improve ralloc.c interface checking.
12999 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13000 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13001 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13002 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13003 [REL_ALLOC]: ... to here, to check interface.
13004 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13005 Remove decls. This fixes an "It stinks!".
13006
13007 * alloc.c (which_symbols): Fix alignment issue / type clash.
13008
13009 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13010
13011 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13012 (struct Lisp_Misc_Any): Likewise.
13013 (struct Lisp_Free): Likewise.
13014 * alloc.c (union aligned_Lisp_Symbol): Define.
13015 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13016 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13017 (union aligned_Lisp_Misc): Define.
13018 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13019 aligned_Lisp_Misc instead of union Lisp_Misc.
13020 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13021
13022 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13023
13024 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13025 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13026 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13027 * s/netbsd.h, s/sol2-6.h:
13028 Remove definition of GC_MARK_STACK, since the default now works.
13029 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13030 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13031 no longer the default.
13032 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13033
13034 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13035
13036 * lread.c (lisp_file_lexically_bound_p):
13037 Fix hang at ";-*-\n" (bug#11238).
13038
13039 2012-04-14 Eli Zaretskii <eliz@gnu.org>
13040
13041 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13042 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13043
13044 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13045
13046 * nsterm.m (constrainFrameRect): Always constrain when there is only
13047 one screen (Bug#10962).
13048
13049 2012-04-13 Ken Brown <kbrown@cornell.edu>
13050
13051 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13052
13053 2012-04-13 Reuben Thomas <rrt@sc3d.org>
13054
13055 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13056
13057 2012-04-11 Daniel Colascione <dancol@dancol.org>
13058
13059 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13060 against is gone. It's better to use vfork now so that when Cygwin
13061 gains a new, working vfork, we use it automatically (bug#10398).
13062
13063 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13064
13065 * window.c (save_window_save): Obey window-point-insertion-type.
13066
13067 2012-04-11 Glenn Morris <rgm@gnu.org>
13068
13069 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13070
13071 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13072
13073 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13074
13075 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
13076
13077 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13078 (force_quit_count): New var.
13079 (handle_interrupt): Use it.
13080
13081 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
13082
13083 * w32.c (w32_delayed_load): Record the full path of the library
13084 being loaded (bug#10424).
13085
13086 2012-04-09 Glenn Morris <rgm@gnu.org>
13087
13088 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13089 not just in the obarray, before snarfing them. (Bug#11036)
13090
13091 * Makefile.in ($(leimdir)/leim-list.el):
13092 Pass EMACS rather than BUILT_EMACS.
13093
13094 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13095
13096 * process.c (make_process):
13097 * process.h: Add integer `gnutls_handshakes_tried' member to
13098 process struct.
13099
13100 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13101 Add convenience `GNUTLS_LOG2i' macro.
13102
13103 * gnutls.c (gnutls_log_function2i): Convenience log function.
13104 (emacs_gnutls_read): Use new log functions,
13105 `gnutls_handshakes_tried' process member, and
13106 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13107 attempts per process (connection).
13108
13109 2012-04-09 Chong Yidong <cyd@gnu.org>
13110
13111 * eval.c (Fuser_variable_p, user_variable_p_eh)
13112 (lisp_indirect_variable): Functions deleted.
13113 (Fdefvar): Caller changed.
13114
13115 * callint.c (Finteractive, Fcall_interactively):
13116 * minibuf.c (Fread_variable): Callers changed.
13117
13118 2012-04-09 Eli Zaretskii <eliz@gnu.org>
13119
13120 * xdisp.c (set_cursor_from_row): If the display string appears in
13121 the buffer at position that is closer to point than the position
13122 after the display string, display the cursor on the first glyph of
13123 the display string. Fixes cursor display when a 'display' text
13124 property immediately follows invisible text. (Bug#11094)
13125
13126 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13127
13128 composite.c: use 'double' consistently
13129 * composite.c (get_composition_id): Use 'double' consistently
13130 instead of converting 'float' to 'double' and vice versa; this is
13131 easier to understand and avoids a GCC warning.
13132
13133 2012-04-09 Glenn Morris <rgm@gnu.org>
13134
13135 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13136 preparation for dumping it with emacs. (Bug#4789)
13137 (leimdir): New variable.
13138 ($(leimdir)/leim-list.el): New rule.
13139 (emacs$(EXEEXT)): Depend on leim-list.el.
13140
13141 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13142 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13143 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13144
13145 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13146
13147 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13148 proper alignment.
13149
13150 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
13151
13152 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13153 Remove unused local variable.
13154
13155 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13156
13157 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13158 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13159 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13160 objects, as mark_maybe_pointer will catch them otherwise.
13161 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13162 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13163
13164 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13165
13166 Fix typo that broke non-Windows builds.
13167 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13168
13169 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13170
13171 Support building on MS-Windows with libxml2.
13172
13173 * makefile.w32-in (OBJ2): Add xml.$(O).
13174 (GLOBAL_SOURCES): Add xml.c.
13175 ($(BLD)/xml.$(O)): New dependency list.
13176
13177 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13178 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13179 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13180 [!WINDOWSNT]: New macros.
13181 (init_libxml2_functions, libxml2_loaded_p): New functions.
13182 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13183 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13184 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13185 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13186 linked in).
13187 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13188 Call init_libxml2_functions before calling libxml2 functions.
13189 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13190
13191 * emacs.c: Don't include libxml/parser.h.
13192 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13193 xmlCleanupParser directly.
13194
13195 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13196
13197 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13198
13199 * indent.c (Fvertical_motion): If there is a display string at
13200 point, use it.vpos to compute how many lines to backtrack after
13201 move_it_to point. (Bug#11133)
13202
13203 2012-04-06 Eli Zaretskii <eliz@gnu.org>
13204
13205 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13206 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13207 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13208 macros related to unification of CJK characters. For the details,
13209 see the discussion following the message here:
13210 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13211
13212 2012-04-04 Chong Yidong <cyd@gnu.org>
13213
13214 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13215
13216 2012-04-01 Eli Zaretskii <eliz@gnu.org>
13217
13218 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13219 instead of alloca. (Bug#11138)
13220
13221 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13222
13223 * w32menu.c (is_simple_dialog): Properly check lisp types.
13224 (Bug#11141)
13225
13226 2012-03-31 Eli Zaretskii <eliz@gnu.org>
13227
13228 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13229 position we get to after a call to move_it_to fails the
13230 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13231 only if we wind up in a string from display property. (Bug#11063)
13232
13233 * window.c (Fdelete_other_windows_internal): Invalidate the row
13234 and column information about mouse highlight, so that redisplay
13235 restores it after reallocating the glyph matrices. (Bug#7464)
13236
13237 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13238 string comes from a `display' text property, use the buffer
13239 position of that property as if we actually saw that position in
13240 the row's glyphs.
13241 (move_it_by_lines): Remove the assertion that
13242 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13243 violated when there's a before-string at the beginning of a line.
13244 (Bug#11063)
13245
13246 2012-03-30 Eli Zaretskii <eliz@gnu.org>
13247
13248 * xdisp.c (append_space_for_newline): If the default face was
13249 remapped, use the remapped face for the appended newline.
13250 (extend_face_to_end_of_line): Use the remapped default face for
13251 extending the face to the end of the line.
13252 (display_line): Call extend_face_to_end_of_line when the default
13253 face was remapped. (Bug#11068)
13254
13255 2012-03-29 Eli Zaretskii <eliz@gnu.org>
13256
13257 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13258
13259 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13260
13261 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13262
13263 2012-03-27 Glenn Morris <rgm@gnu.org>
13264
13265 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13266 Doc fixes.
13267
13268 2012-03-26 Kenichi Handa <handa@m17n.org>
13269
13270 * dispextern.h (struct glyph): Fix previous change. Change the
13271 bit length of glyphless.ch to 25 (Bug#11082).
13272
13273 2012-03-26 Chong Yidong <cyd@gnu.org>
13274
13275 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13276 (command_loop_1): Use it; inhibit selection update for
13277 handle-select-window too (Bug#8996).
13278
13279 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13280
13281 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13282
13283 2012-03-25 Kenichi Handa <handa@m17n.org>
13284
13285 * dispextern.h (struct glyph): Change the bit length of
13286 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13287
13288 2012-03-24 Eli Zaretskii <eliz@gnu.org>
13289
13290 * s/ms-w32.h (tzname): Include time.h before redirecting to
13291 _tzname. Fixes the MSVC build. (Bug#9960)
13292
13293 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13294
13295 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13296 characters.
13297
13298 * xterm.c (XTread_socket): Only modify handling_signal if
13299 !SYNC_INPUT. (Bug#11080)
13300
13301 2012-03-23 Eli Zaretskii <eliz@gnu.org>
13302
13303 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13304 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13305 when fetching a multibyte character consumes more bytes than
13306 CHAR_BYTES returns, due to unification of CJK characters in
13307 string_char. (Bug#11073)
13308
13309 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13310
13311 * process.c (wait_reading_process_output): Handle pty disconnect
13312 by refraining from sending oneself a SIGCHLD (bug#10933).
13313
13314 2012-03-22 Chong Yidong <cyd@gnu.org>
13315
13316 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13317
13318 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13319 Mark string as coming from a prefix property.
13320 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13321 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13322
13323 2012-03-21 Chong Yidong <cyd@gnu.org>
13324
13325 * xfaces.c (Vface_remapping_alist): Doc fix.
13326
13327 2012-03-20 Eli Zaretskii <eliz@gnu.org>
13328
13329 * w32proc.c (Fw32_set_console_codepage)
13330 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13331 Doc fixes.
13332
13333 2012-03-20 Chong Yidong <cyd@gnu.org>
13334
13335 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13336 to reflect default non-nil value of redisplay-dont-pause.
13337
13338 2012-03-19 Kenichi Handa <handa@m17n.org>
13339
13340 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13341 it fit in a valid range (Bug#11003).
13342
13343 2012-03-18 Eli Zaretskii <eliz@gnu.org>
13344
13345 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13346 that is not from display property, accept the row as a "cursor
13347 row" if one of the string's character has a non-nil `cursor'
13348 property. Fixes cursor positioning when there are newlines in
13349 overlay strings, e.g. in icomplete.el. (Bug#11035)
13350
13351 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13352
13353 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13354
13355 2012-03-12 Chong Yidong <cyd@gnu.org>
13356
13357 * eval.c (inhibit_lisp_code): Rename from
13358 inhibit_window_configuration_change_hook; move from window.c.
13359
13360 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13361 * window.c (run_window_configuration_change_hook)
13362 (syms_of_window): Callers changed.
13363
13364 2012-03-11 Chong Yidong <cyd@gnu.org>
13365
13366 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13367
13368 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13369
13370 2012-03-10 Chong Yidong <cyd@gnu.org>
13371
13372 * frame.c (other_visible_frames): Don't assume the selected frame
13373 is visible (Bug#10955).
13374
13375 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13376
13377 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13378
13379 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13380
13381 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13382 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13383 zero (Bug#10954).
13384
13385 2012-03-03 Glenn Morris <rgm@gnu.org>
13386
13387 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13388
13389 2012-03-02 Eli Zaretskii <eliz@gnu.org>
13390
13391 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13392 position past the first glyph_row that ends at ZV. (Bug#10902)
13393 (redisplay_window, next_element_from_string): Fix typos in
13394 comments.
13395 (redisplay_window): Pass to move_it_vertically the margin in
13396 pixels, not in screen lines.
13397
13398 2012-03-02 Glenn Morris <rgm@gnu.org>
13399
13400 * buffer.c (buffer-list-update-hook): Doc fix.
13401
13402 2012-02-29 Eli Zaretskii <eliz@gnu.org>
13403
13404 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13405 push_it before setting up the iterator for the first overlay
13406 string, even if we have an empty string loaded.
13407 (next_overlay_string): If there's an empty string on the iterator
13408 stack, pop the stack. (Bug#10903)
13409
13410 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13411
13412 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13413 Suggested by Stefan Monnier in
13414 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13415 * alloc.c (widen_to_Lisp_Object): New static function.
13416 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13417 and widening them to Lisp_Objects. This would work even if
13418 USE_LSB_TAG is defined and wide integers are used, which might
13419 happen in a future version of Emacs.
13420
13421 2012-02-25 Chong Yidong <cyd@gnu.org>
13422
13423 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13424 Doc fix.
13425
13426 * xselect.c (Fx_selection_exists_p): Doc fix.
13427 (x_clipboard_manager_save_all): Print an informative message
13428 before saving to clipboard manager.
13429
13430 2012-02-24 Chong Yidong <cyd@gnu.org>
13431
13432 * keyboard.c (process_special_events): Handle all X selection
13433 requests in kbd_buffer, not just the next one (Bug#8869).
13434
13435 2012-02-23 Chong Yidong <cyd@gnu.org>
13436
13437 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13438 call when setting menu-bar-lines and tool-bar-lines parameters.
13439 (unwind_create_frame_1): New helper function.
13440
13441 * window.c (inhibit_window_configuration_change_hook): New var.
13442 (run_window_configuration_change_hook): Obey it.
13443 (syms_of_window): Initialize it.
13444
13445 2012-02-22 Chong Yidong <cyd@gnu.org>
13446
13447 * xterm.c (x_draw_image_relief): Add missing type check for
13448 Vtool_bar_button_margin (Bug#10743).
13449
13450 2012-02-21 Chong Yidong <cyd@gnu.org>
13451
13452 * fileio.c (Vfile_name_handler_alist): Doc fix.
13453
13454 * buffer.c (Fget_file_buffer): Protect against invalid file
13455 handler return value.
13456
13457 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13458
13459 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13460 when computing $valmask.
13461
13462 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13463 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13464 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13465 It's useless in that case, and it can cause problems on hosts
13466 that allocate halves of EMACS_INT values separately.
13467 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13468 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13469 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13470 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13471 it avoids undefined behavior on hosts where shifting right by more
13472 than the word width has undefined behavior.
13473
13474 2012-02-19 Chong Yidong <cyd@gnu.org>
13475
13476 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13477 (Funhandled_file_name_directory, Ffile_name_as_directory)
13478 (Fdirectory_file_name, Fexpand_file_name)
13479 (Fsubstitute_in_file_name): Protect against invalid file handler
13480 return values (Bug#10845).
13481
13482 2012-02-18 Eli Zaretskii <eliz@gnu.org>
13483
13484 * .gdbinit (pitx): Fix incorrect references to fields of the
13485 iterator stack.
13486
13487 2012-02-17 Chong Yidong <cyd@gnu.org>
13488
13489 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13490
13491 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13492
13493 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13494 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13495
13496 2012-02-15 Chong Yidong <cyd@gnu.org>
13497
13498 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13499 marked as special. Also, starting docstrings with * is obsolete.
13500
13501 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13502
13503 * gnutls.c (emacs_gnutls_write): Fix last change.
13504
13505 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13506
13507 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13508 send_process.
13509
13510 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13511
13512 * keymap.c (Fsingle_key_description): Handle char ranges.
13513
13514 2012-02-12 Chong Yidong <cyd@gnu.org>
13515
13516 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13517 as that creates a dangerous corner case.
13518
13519 * window.c (Fdelete_window_internal): Invalidate the mouse
13520 highlight (Bug#9904).
13521
13522 2012-02-12 Glenn Morris <rgm@gnu.org>
13523
13524 * xselect.c (Fx_own_selection_internal)
13525 (Fx_get_selection_internal, Fx_disown_selection_internal)
13526 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13527 * nsselect.m (Fx_own_selection_internal)
13528 (Fx_disown_selection_internal, Fx_selection_exists_p)
13529 (Fx_selection_owner_p, Fx_get_selection_internal):
13530 Sync docs and argument specs with the xselect.c versions.
13531
13532 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13533
13534 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13535
13536 2012-02-11 Eli Zaretskii <eliz@gnu.org>
13537
13538 * w32select.c (Fx_selection_exists_p): Sync doc string and
13539 argument list with xselect.c. (Bug#10783)
13540
13541 * w16select.c (Fx_selection_exists_p): Sync doc string and
13542 argument list with xselect.c. (Bug#10783)
13543
13544 2012-02-10 Glenn Morris <rgm@gnu.org>
13545
13546 * fns.c (Fsecure_hash): Doc fix.
13547
13548 2012-02-09 Kenichi Handa <handa@m17n.org>
13549
13550 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13551
13552 2012-02-07 Chong Yidong <cyd@gnu.org>
13553
13554 * buffer.c (Fbuffer_local_variables)
13555 (buffer_lisp_local_variables): Handle unbound vars correctly;
13556 don't let Qunbound leak into Lisp.
13557
13558 2012-02-07 Glenn Morris <rgm@gnu.org>
13559
13560 * image.c (Fimagemagick_types): Doc fix.
13561
13562 * image.c (imagemagick-render-type): Change it from a lisp object
13563 to an integer. Move the doc here from the lisp manual.
13564 Treat all values not equal to 0 the same.
13565
13566 2012-02-06 Chong Yidong <cyd@gnu.org>
13567
13568 * doc.c (store_function_docstring): Avoid applying docstring of
13569 alias to base function (Bug#2603).
13570
13571 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13572
13573 * .gdbinit (pp1, pv1): Remove redundant defines.
13574 (pr): Use pp.
13575
13576 2012-02-04 Chong Yidong <cyd@gnu.org>
13577
13578 * nsterm.m: Declare a global (Bug#10694).
13579
13580 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13581
13582 * w32.c (get_emacs_configuration_options):
13583 Include --enable-checking, if specified, in the return value.
13584
13585 2012-02-04 Martin Rudalics <rudalics@gmx.at>
13586
13587 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13588 after rounding frame sizes. (Bug#9723)
13589
13590 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13591
13592 * keyboard.c (adjust_point_for_property): Don't position point
13593 before BEGV. (Bug#10696)
13594
13595 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13596
13597 Handle overflow when computing char display width (Bug#9496).
13598 * character.c (char_width): Return EMACS_INT, not int.
13599 (char_width, c_string_width): Check for overflow when
13600 computing the width; this is possible now that individual
13601 characters can have unbounded width. Problem introduced
13602 by merge from Emacs 23 on 2012-01-19.
13603
13604 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
13605
13606 * dbusbind.c (Fdbus_register_method): Mention the return value
13607 :ignore in the docstring.
13608
13609 2012-02-02 Glenn Morris <rgm@gnu.org>
13610
13611 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13612
13613 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13614 Unconditionally set to t. (Bug#10673)
13615 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13616 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13617 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13618
13619 2012-02-02 Kenichi Handa <handa@m17n.org>
13620
13621 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13622 0, do not call append_composite_glyph.
13623
13624 2012-02-02 Kenichi Handa <handa@m17n.org>
13625
13626 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13627 NULL (Bug#6988).
13628 (x_produce_glyphs): If the component of a composition is a null
13629 string, set it->pixel_width to 1 to avoid zero-width glyph.
13630
13631 2012-02-01 Eli Zaretskii <eliz@gnu.org>
13632
13633 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13634 first 2 arguments are identical. This makes inserting large
13635 output from a subprocess an order of magnitude faster on
13636 MS-Windows, where all sbrk'ed memory is always contiguous.
13637
13638 2012-01-31 Glenn Morris <rgm@gnu.org>
13639
13640 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13641 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13642 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13643
13644 2012-01-29 Glenn Morris <rgm@gnu.org>
13645
13646 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13647
13648 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13649
13650 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13651
13652 2012-01-28 Chong Yidong <cyd@gnu.org>
13653
13654 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13655
13656 2012-01-26 Chong Yidong <cyd@gnu.org>
13657
13658 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13659
13660 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13661 repeat counts (Bug#10507).
13662
13663 2012-01-26 Glenn Morris <rgm@gnu.org>
13664
13665 * lread.c (syms_of_lread): Doc fix.
13666
13667 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13668
13669 * coding.c (encode_designation_at_bol): Change return value to
13670 EMACS_INT.
13671
13672 2012-01-25 Chong Yidong <cyd@gnu.org>
13673
13674 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13675
13676 2012-01-21 Chong Yidong <cyd@gnu.org>
13677
13678 * floatfns.c (Fcopysign): Make the second argument non-optional,
13679 since nil is not allowed anyway.
13680
13681 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13682
13683 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13684 (send_process): Likewise.
13685
13686 2012-01-19 Martin Rudalics <rudalics@gmx.at>
13687
13688 * window.c (save_window_save, Fcurrent_window_configuration)
13689 (Vwindow_persistent_parameters): Do not use Qstate.
13690 Rewrite doc-strings.
13691
13692 2012-01-19 Kenichi Handa <handa@m17n.org>
13693
13694 * character.c (char_width): New function.
13695 (Fchar_width, c_string_width, lisp_string_width):
13696 Use char_width (Bug#9496).
13697
13698 2012-01-16 Martin Rudalics <rudalics@gmx.at>
13699
13700 * window.c (Vwindow_persistent_parameters): New variable.
13701 (Fset_window_configuration, save_window_save): Handle persistent
13702 window parameters.
13703
13704 2012-01-14 Eli Zaretskii <eliz@gnu.org>
13705
13706 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13707 thrashing the stack of the thread. (Bug#9087)
13708
13709 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13710
13711 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13712
13713 2012-01-11 Eli Zaretskii <eliz@gnu.org>
13714
13715 * xdisp.c (rows_from_pos_range): Handle the case where the
13716 highlight ends on a newline. (Bug#10464)
13717 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13718 he end column for display of highlight that ends on a newline
13719 before a R2L line.
13720
13721 2012-01-11 Glenn Morris <rgm@gnu.org>
13722
13723 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13724 from load-path also when installation-directory is nil. (Bug#10208)
13725
13726 2012-01-10 Glenn Morris <rgm@gnu.org>
13727
13728 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13729
13730 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13731 Update template values to be closer to their typical values these days.
13732
13733 2012-01-09 Eli Zaretskii <eliz@gnu.org>
13734
13735 * xdisp.c (rows_from_pos_range): Accept additional argument
13736 DISP_STRING, and accept any glyph in a row whose object is that
13737 string as eligible for mouse highlight. Fixes mouse highlight of
13738 display strings from overlays. (Bug#10464)
13739
13740 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
13741
13742 emacs: fix an auto-save permissions race condition (Bug#10400)
13743 * fileio.c (auto_saving_dir_umask): New static var.
13744 (Fmake_directory_internal): Use it.
13745 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13746 creating the directory. The old code temporarily assigns
13747 too-generous permissions to the directory.
13748 (do_auto_save_eh): Clear it.
13749 (Fdo_auto_save): Catch all errors, not just file errors, so
13750 that the var is always cleared.
13751
13752 2012-01-07 Eli Zaretskii <eliz@gnu.org>
13753
13754 * search.c (scan_buffer): Pass character positions to
13755 know_region_cache, not byte positions. (Bug#6540)
13756
13757 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
13758
13759 * w32.c (sys_rename): Report EXDEV when rename of a directory
13760 fails because the target is on another logical disk. (Bug#10284)
13761
13762 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13763
13764 * xterm.c (x_embed_request_focus): New function.
13765
13766 * xterm.h: Add prototype.
13767
13768 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13769
13770 2012-01-05 Glenn Morris <rgm@gnu.org>
13771
13772 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13773
13774 2012-01-01 Eli Zaretskii <eliz@gnu.org>
13775
13776 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13777 Load gnutls_transport_set_lowat only if GnuTLS version is below
13778 2.11.1.
13779 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13780 GnuTLS versions below 2.11.1.
13781
13782 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13783
13784 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13785 to the doc string advising against its use for altering the way
13786 windows are scrolled.
13787
13788 2011-12-28 Kenichi Handa <handa@m17n.org>
13789
13790 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13791 coding-system ASCII compatible only when it does not produce BOM
13792 on encoding (Bug#10383).
13793
13794 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13795
13796 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13797 can scroll.
13798 (create_and_show_popup_menu): Always use menu_position_func for
13799 Gtk3 (Bug#10361).
13800
13801 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13802
13803 * callint.c (Fcall_interactively): Don't truncate prompt string.
13804
13805 2011-12-23 Eli Zaretskii <eliz@gnu.org>
13806
13807 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13808 property that ends at ZV, so that the bidi iteration could be
13809 resumed from there (after widening). (Bug#10360)
13810
13811 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13812
13813 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13814
13815 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13816
13817 * nsterm.m (x_free_frame_resources):
13818 Release f->output_data.ns->miniimage.
13819 (ns_index_color): Fix indentation. Do not retain
13820 color_table->colors[i].
13821
13822 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13823 before returning.
13824
13825 * nsfns.m (x_set_background_color): Assign return value from
13826 ns_index_color to face-background instead of NSColor*.
13827 (ns_implicitly_set_icon_type): Fix indentation.
13828 Change assignment in for loop to comparison.
13829
13830 * emacs.c (ns_pool): New variable.
13831 (main): Assign ns_pool.
13832 (Fkill_emacs): Call ns_release_autorelease_pool.
13833
13834 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13835 autorelease fdesc, release fdAttrs and tdict.
13836 (ns_get_covering_families): Release charset.
13837 (ns_findfonts): Release NSFontDescriptor created with new.
13838 (ns_uni_to_glyphs): Fix indentation.
13839 (setString): Release attrStr before assigning new value.
13840
13841 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13842
13843 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13844 and NS_IMPL_COCOA.
13845 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13846 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13847
13848 2011-12-18 David Reitter <reitter@cmu.edu>
13849
13850 * nsterm.m (ns_term_init): Subscribe for notifications
13851 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13852 to method trackingNotification in EmacsMenu.
13853
13854 * nsmenu.m (trackingMenu): New variable.
13855 (trackingNotification): New method (from Aquamacs).
13856 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
13857 from Aquamacs (Bug#7030).
13858
13859 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13860
13861 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13862 (symbol_to_nsstring): Fix indentation.
13863 (ns_symbol_to_pb): New function.
13864 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13865 (Fns_rotate_cut_buffers_internal): Remove.
13866 (Fns_store_selection_internal): Rename from
13867 Fns_store_cut_buffer_internal.
13868 (ns_get_foreign_selection, Fx_own_selection_internal)
13869 (Fx_disown_selection_internal, Fx_selection_exists_p)
13870 (Fns_get_selection_internal, Fns_store_selection_internal):
13871 Use ns_symbol_to_pb and check if return value is nil.
13872 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13873 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
13874 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13875 renamed to Sns_store_selection_internal.
13876 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13877 and remove this function.
13878 (ns_handle_selection_clear): Remove, never used.
13879 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13880 here.
13881
13882 2011-12-17 Ken Brown <kbrown@cornell.edu>
13883
13884 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13885 GID is unknown (Bug#10257).
13886
13887 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13888
13889 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13890 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13891 which caused a build failure on GNU/Linux IA-64. This problem was
13892 introduced by my 2011-10-07 patch.
13893
13894 2011-12-15 Juri Linkov <juri@jurta.org>
13895
13896 * image.c (imagemagick_error): New function. (Bug#10112)
13897 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13898 Use `imagemagick_error' where ImageMagick functions return
13899 `MagickFalse'.
13900 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13901 proper order.
13902
13903 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13904
13905 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13906 fill background (Bug#8992).
13907
13908 2011-12-13 Martin Rudalics <rudalics@gmx.at>
13909
13910 * window.c (Vwindow_combination_resize)
13911 (Vwindow_combination_limit): Use t instead of non-nil in
13912 doc-strings.
13913 (Vrecenter_redisplay): Add first sentence of doc-string on
13914 separate line.
13915 (Frecenter): Fix doc-string typo.
13916
13917 2011-12-11 Kenichi Handa <handa@m17n.org>
13918
13919 * coding.c (Funencodable_char_position): Pay attention to the
13920 buffer text relocation (Bug#9389).
13921
13922 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13923
13924 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13925 gtk_init (Bug#10100).
13926
13927 2011-12-10 Eli Zaretskii <eliz@gnu.org>
13928
13929 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13930 IT->string is nil. (Bug#10263)
13931
13932 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13933
13934 * nsterm.h (x_free_frame_resources): Declare.
13935
13936 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13937 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13938
13939 * nsterm.h (ns_get_defaults_value): Declare.
13940
13941 * nsterm.m (ns_default): Call ns_get_defaults_value.
13942
13943 2011-12-09 Eli Zaretskii <eliz@gnu.org>
13944
13945 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13946 (Bug#10170)
13947
13948 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13949
13950 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13951 that where the value of an _OBJC_* symbol points to is in the .bss
13952 section (Bug#10240).
13953
13954 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13955
13956 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
13957 after the loop to call ccl_driver at least once (Bug#8619).
13958
13959 2011-12-08 Kenichi Handa <handa@m17n.org>
13960
13961 * ftfont.c (get_adstyle_property): Fix previous change
13962 (Bug#10233).
13963
13964 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
13965
13966 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13967 dirs from the default value of EMACSLOADPATH (bug#10208).
13968
13969 2011-12-07 Glenn Morris <rgm@gnu.org>
13970
13971 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13972 installation and source directories as well. (Bug#10208)
13973
13974 2011-12-06 Chong Yidong <cyd@gnu.org>
13975
13976 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13977
13978 2011-12-06 Glenn Morris <rgm@gnu.org>
13979
13980 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13981 as an error, not just -1. (Bug#10217)
13982
13983 2011-12-05 Chong Yidong <cyd@gnu.org>
13984
13985 * keyboard.c (process_special_events): New function.
13986 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13987
13988 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13989
13990 * coding.c (encode_designation_at_bol): Don't use uninitialized
13991 local variable (Bug#9318).
13992
13993 2011-12-05 Kenichi Handa <handa@m17n.org>
13994
13995 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13996 return Qnil (Bug#8046, Bug#10193).
13997
13998 2011-12-05 Kenichi Handa <handa@m17n.org>
13999
14000 * coding.c (encode_designation_at_bol): New args charbuf_end and
14001 dst. Return the number of produced bytes. Callers changed.
14002 (coding_set_source): Return how many bytes coding->source was
14003 relocated.
14004 (coding_set_destination): Return how many bytes
14005 coding->destination was relocated.
14006 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14007 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14008
14009 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14010
14011 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14012 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14013 macro (Bug#9318).
14014
14015 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14016
14017 The following changes are to fix Bug#9318.
14018
14019 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14020 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14021 (encode_coding_iso_2022, encode_coding_sjis)
14022 (encode_coding_big5, encode_coding_charset): Use the above macros.
14023
14024 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
14025
14026 * lisp.h (process_quit_flag): Fix external declaration.
14027
14028 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14029
14030 Don't macro-inline non-performance-critical code.
14031 * eval.c (process_quit_flag): New function.
14032 * lisp.h (QUIT): Use it.
14033
14034 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14035
14036 * nsfns.m (get_geometry_from_preferences): New function.
14037 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14038
14039 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14040
14041 * emacs.c (Qkill_emacs): Define.
14042 (syms_of_emacs): Initialize it.
14043 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14044 Qquit_flag to `kill-emacs' instead.
14045 (quit_throw_to_read_char): Add parameter `from_signal'.
14046 All callers changed. Call Fkill_emacs if requested and safe.
14047 * lisp.h (QUIT): Call Fkill_emacs if requested.
14048
14049 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14050
14051 * widget.c (update_wm_hints): Return if wmshell is null.
14052 (widget_update_wm_size_hints): New function.
14053
14054 * widget.h (widget_update_wm_size_hints): Declare.
14055
14056 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14057 widget_update_wm_size_hints (Bug#10104).
14058
14059 2011-12-03 Eli Zaretskii <eliz@gnu.org>
14060
14061 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14062 before a newline, prepare the bidi iterator for consuming the
14063 newline, and keep the current paragraph direction. (Bug#10183)
14064 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
14065
14066 2011-12-02 Juri Linkov <juri@jurta.org>
14067
14068 * search.c (Fword_search_regexp): New Lisp function created from
14069 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14070 (Fword_search_backward, Fword_search_forward)
14071 (Fword_search_backward_lax, Fword_search_forward_lax):
14072 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14073 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14074
14075 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14076
14077 * fileio.c (Finsert_file_contents): Move after-change-function call
14078 to before the "handled:" label, since all "goto handled" appear in
14079 cases where the *-change-functions have already been properly called
14080 (bug#10117).
14081
14082 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14083
14084 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14085 waiting for input. (Bug#10169)
14086
14087 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14088
14089 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14090 verifies glyph row's hash code--we have just reallocated the
14091 glyphs, so their contents can be complete garbage. (Bug#10164)
14092
14093 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
14094
14095 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14096
14097 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14098
14099 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14100 attributes are tested _before_ calling verify_row_hash, to protect
14101 against GCC re-ordering of the tests. (Bug#10164)
14102
14103 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14104
14105 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14106
14107 * xterm.c (handle_one_xevent): Only set async_visible and friends
14108 if net_wm_state_hidden_seen is non-zero (Bug#10002)
14109 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14110 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14111
14112 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14113
14114 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14115 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14116 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14117 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14118 All uses changed to use GCPRO1 etc.
14119 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14120 Revert to old implementation (i.e., before 2011-03-11).
14121
14122 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14123
14124 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14125 of scroll runs so as to avoid assigning disabled bogus rows and
14126 unnecessary graphics copy operations.
14127
14128 2011-11-27 Eli Zaretskii <eliz@gnu.org>
14129
14130 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14131 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14132 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14133 (malloc, free, realloc, calloc): Redirect to e_* only when
14134 compiling Emacs.
14135
14136 * lisp.h (GCTYPEBITS): Move before first use.
14137 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14138 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14139 this macro definition.
14140
14141 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14142 _MSC_VER.
14143
14144 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14145
14146 * gtkutil.c (xg_create_frame_widgets):
14147 Call gtk_window_set_has_resize_grip (FALSE) if that function is
14148 present with Gtk+ 2.0.
14149
14150 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14151
14152 * fileio.c (Finsert_file_contents): Undo previous change; see
14153 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14154
14155 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14156
14157 Rename locals to avoid shadowing.
14158 * fileio.c (Finsert_file_contents):
14159 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14160 * process.c (wait_reading_process_output):
14161 Rename inner 'proc' to 'p' to avoid shadowing.
14162 Indent for consistency with usual Emacs style.
14163
14164 2011-11-25 Eli Zaretskii <eliz@gnu.org>
14165
14166 * xdisp.c (redisplay_window): If cursor row is not fully visible
14167 after recentering, and scroll-conservatively is set to a large
14168 number, scroll window by a few more lines to make the cursor fully
14169 visible and out of scroll-margin. (Bug#10105)
14170 (start_display): Don't move to the next line if the display should
14171 start at a newline that is part of a display vector or an overlay
14172 string. (Bug#10119)
14173
14174 2011-11-24 Juri Linkov <juri@jurta.org>
14175
14176 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14177 after the `MagickPingImage' call. (Bug#10112)
14178
14179 2011-11-23 Chong Yidong <cyd@gnu.org>
14180
14181 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14182
14183 2011-11-23 Martin Rudalics <rudalics@gmx.at>
14184
14185 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14186 making another buffer current. (Bug#10114)
14187
14188 2011-11-23 Glenn Morris <rgm@gnu.org>
14189
14190 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14191
14192 2011-11-23 Chong Yidong <cyd@gnu.org>
14193
14194 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14195 using it (Bug#5984).
14196
14197 2011-11-22 Eli Zaretskii <eliz@gnu.org>
14198
14199 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14200 and header-lines, as they don't have one computed for them.
14201 (Bug#10098)
14202
14203 * .gdbinit (prow): Make displayed values more self-explaining.
14204 Add row's hash code.
14205
14206 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14207
14208 * process.c (wait_reading_process_output): Fix asynchrounous
14209 GnuTLS socket handling on some versions of the GnuTLS library.
14210 (wait_reading_process_output): Add comment and URL.
14211
14212 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14213
14214 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14215
14216 2011-11-21 Chong Yidong <cyd@gnu.org>
14217
14218 * window.c (Fnext_window, Fprevious_window): Doc fix.
14219
14220 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14221
14222 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14223
14224 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14225
14226 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14227
14228 2011-11-20 Martin Rudalics <rudalics@gmx.at>
14229
14230 * window.c (Fset_window_combination_limit): Rename argument
14231 STATUS to LIMIT.
14232 (Vwindow_combination_limit): Remove "status" from doc-string.
14233
14234 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14235
14236 * m/ibms390.h: Remove.
14237 * m/ibms390x.h: Don't include "ibms390.h".
14238
14239 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14240
14241 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14242 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14243
14244 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14245
14246 * casetab.c (Fset_case_table):
14247 * charset.c (Fcharset_after): Fix typos.
14248
14249 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
14250
14251 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14252 Otherwise, valgrind does not work on some platforms.
14253 Problem reported by Andreas Schwab in
14254 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14255 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14256 is set, removing the need for VIRT_ADDRESS_VARIES.
14257 (PURE_P): Use a more-efficient implementation that needs just one
14258 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14259 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14260 to 4 (xorl, subq, cmpq, setbe).
14261 * alloc.c (pure): Always extern now, since that's the
14262 VIRT_ADDR_VARIES behavior.
14263 (PURE_POINTER_P): Use a single comparison, not two, for
14264 consistency with the new puresize.h.
14265 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14266 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14267 Remove VIRT_ADDR_VARIES no longer needed.
14268
14269 2011-11-19 Eli Zaretskii <eliz@gnu.org>
14270
14271 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14272 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14273 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14274 behave as if the cursor position were at the window margin.
14275
14276 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14277 and the cursor position is out of bounds, behave as if the cursor
14278 position were at the window margin. (Bug#10075)
14279
14280 2011-11-18 Chong Yidong <cyd@gnu.org>
14281
14282 * window.c (Fwindow_combination_limit): Make first argument
14283 non-optional, since it is meaningless for live windows like the
14284 selected window.
14285
14286 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14287
14288 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14289
14290 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14291
14292 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14293 (graft_intervals_into_buffer): Simplify.
14294
14295 2011-11-18 Eli Zaretskii <eliz@gnu.org>
14296
14297 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14298 hash values of the two rows.
14299 (copy_row_except_pointers): Preserve the used[] arrays and the
14300 hash values of the two rows. (Bug#10035)
14301 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14302
14303 * xdisp.c (row_hash): New function, body extracted from
14304 compute_line_metrics.
14305 (compute_line_metrics): Call row_hash, instead of computing the
14306 hash code inline.
14307
14308 * dispnew.c (verify_row_hash): Call row_hash for computing the
14309 hash code of a row, instead of duplicating code from xdisp.c.
14310
14311 * dispextern.h (row_hash): Add prototype.
14312
14313 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14314
14315 * frame.c (delete_frame): Don't delete the terminal when the last
14316 X frame is closed if emacs is built with GTK toolkit.
14317
14318 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
14319
14320 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14321
14322 2011-11-17 Martin Rudalics <rudalics@gmx.at>
14323
14324 * window.c (Vwindow_splits): Rename to
14325 Vwindow_combination_resize. Suggested by Juri Linkov.
14326 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14327 of Vwindow_splits.
14328
14329 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
14330
14331 * nsfns.m (Fns_font_name):
14332 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14333
14334 2011-11-16 Martin Rudalics <rudalics@gmx.at>
14335
14336 * window.h (window): Rename slot "nest" to "combination_limit".
14337 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14338 (Fset_window_nest): Rename to Fset_window_combination_limit.
14339 (Vwindow_nest): Rename to Vwindow_combination_limit.
14340 (recombine_windows, make_parent_window, make_window)
14341 (Fsplit_window_internal, saved_window)
14342 (Fset_window_configuration, save_window_save): Rename all
14343 occurrences of window_nest to window_combination_limit.
14344
14345 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
14346
14347 * image.c (imagemagick_load_image): Fix typo.
14348
14349 2011-11-14 Eli Zaretskii <eliz@gnu.org>
14350
14351 * xdisp.c (display_line): Move the call to
14352 highlight_trailing_whitespace before the call to
14353 compute_line_metrics, since the latter needs to see the final
14354 faces of all the glyphs to compute ROW's hash value.
14355 Fixes assertion violations in row_equal_p. (Bug#10035)
14356
14357 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
14358
14359 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14360 just return (bug#10044).
14361
14362 2011-11-12 Eli Zaretskii <eliz@gnu.org>
14363
14364 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14365 with user-defined heap size. Bump the default size of the temacs
14366 heap to 27MB, to avoid memory warning when running temacs.
14367 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14368
14369 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14370 current_matrix and desired_matrix. (Bug#9990)
14371 (verify_row_hash) [XASSERTS]: New function.
14372 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14373 that the hash value of glyph rows is correct.
14374
14375 2011-11-12 Martin Rudalics <rudalics@gmx.at>
14376
14377 * window.h (window): Remove splits slot.
14378 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14379 (Fdelete_other_windows_internal, make_parent_window)
14380 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14381 (Fset_window_configuration, save_window_save): Don't deal with
14382 split status of windows.
14383 (saved_window): Remove splits slot.
14384 (Vwindow_splits): Rewrite doc-string.
14385
14386 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14387
14388 * xfns.c (unwind_create_frame):
14389 * nsfns.m (unwind_create_frame):
14390 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14391 Vframe_list (Bug#9999).
14392
14393 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14394
14395 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
14396
14397 2011-11-11 Kenichi Handa <handa@m17n.org>
14398
14399 * callproc.c (Fcall_process): Set the member dst_multibyte of
14400 process_coding.
14401
14402 2011-11-11 Johan Bockgård <bojohan@gnu.org>
14403
14404 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14405 avoid a crash (bug#9496).
14406
14407 2011-11-09 Chong Yidong <cyd@gnu.org>
14408
14409 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14410 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14411
14412 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14413
14414 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14415
14416 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14417
14418 Avoid some portability problems by eschewing 'extern inline' functions.
14419 The trivial performance wins aren't worth the portability hassles; see
14420 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14421 et seq.
14422 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14423 (window_box_width, window_box_left, window_box_left_offset)
14424 (window_box_right, window_box_right_offset): Undo previous change,
14425 by removing the "extern"s.
14426 * intervals.c (adjust_intervals_for_insertion)
14427 (adjust_intervals_for_deletion): Undo previous change,
14428 making these static again.
14429 (offset_intervals, temp_set_point_both, temp_set_point)
14430 (copy_intervals_to_string): No longer inline.
14431 * xdisp.c (window_text_bottom_y, window_box_width)
14432 (window_box_height, window_box_left_offset)
14433 (window_box_right_offset, window_box_left, window_box_right)
14434 (window_box): No longer inline.
14435
14436 2011-11-08 Chong Yidong <cyd@gnu.org>
14437
14438 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
14439 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14440 Signal an error if not a live window.
14441 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14442 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14443
14444 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
14445
14446 * lisp.h (syms_of_abbrev): Remove declaration.
14447 Reported by CHENG Gao <chenggao@royau.me>.
14448
14449 2011-11-07 Eli Zaretskii <eliz@gnu.org>
14450
14451 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14452 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14453 of temacs in GUI mode.
14454
14455 2011-11-07 Martin Rudalics <rudalics@gmx.at>
14456
14457 * window.h: Declare delete_all_child_windows instead of
14458 delete_all_subwindows.
14459 * window.c (Fwindow_nest, Fset_window_nest)
14460 (Fset_window_new_total, Fset_window_new_normal)
14461 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14462 (delete_all_subwindows): Rename to delete_all_child_windows.
14463 (Fdelete_other_windows_internal, Fset_window_configuration):
14464 Call delete_all_child_windows instead of delete_all_subwindows.
14465 * frame.c (delete_frame): Call delete_all_child_windows instead
14466 of delete_all_subwindows.
14467
14468 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14469
14470 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14471 This is also needed for porting to any host where GC_MARK_STACK is
14472 not GC_MAKE_GCPROS_NOOPS.
14473 (which_symbols): Use it.
14474
14475 2011-11-07 Kenichi Handa <handa@m17n.org>
14476
14477 * coding.c (coding_set_destination): Check coding->src_pos only
14478 when coding->src_object is a buffer (bug#9910).
14479
14480 * process.c (send_process): Set the member src_multibyte of coding
14481 to 0 (bug#9911) when sending a unibyte text.
14482
14483 * callproc.c (Fcall_process): Set the member src_multibyte of
14484 process_coding to 0 (bug#9912).
14485
14486 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14487
14488 * xmenu.c (cleanup_widget_value_tree): New function.
14489 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14490 calling free_menubar_widget_value_tree directly (Bug#9830).
14491
14492 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14493
14494 Fix some portability problems with 'inline'.
14495 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14496 (window_box_width, window_box_left, window_box_left_offset)
14497 (window_box_right, window_box_right_offset): Declare extern.
14498 Otherwise, these inline functions do not conform to C99 and
14499 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14500 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14501 * intervals.c (adjust_intervals_for_insertion)
14502 (adjust_intervals_for_deletion): Now extern, because otherwise the
14503 extern inline functions 'offset_intervals' couldn't refer to it.
14504 (static_offset_intervals): Remove.
14505 (offset_intervals): Rewrite using the old contents of
14506 static_offset_intervals. The old version didn't conform to C99
14507 because an extern inline function contained a reference to an
14508 identifier with static linkage.
14509
14510 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14511
14512 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14513 GC.
14514
14515 2011-11-06 Eli Zaretskii <eliz@gnu.org>
14516
14517 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14518 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14519 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14520 return Qleft_to_right.
14521
14522 2011-11-06 Chong Yidong <cyd@gnu.org>
14523
14524 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14525 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14526 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14527 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14528 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14529 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14530 (Fwindow_vscroll): Doc fix.
14531 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14532 argument, since it makes no sense to pass a live window and for
14533 consistency with window-child.
14534
14535 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14536
14537 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14538 support MSVC.
14539
14540 2011-11-05 Jason Rumney <jasonr@gnu.org>
14541
14542 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14543 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14544 fonts (Bug#6029).
14545 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14546 bitwise arithmetic preventing use of unicode-sip and non-truetype
14547 opentype fonts.
14548
14549 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14550
14551 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14552 "emacs"-only part.
14553
14554 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14555 initialization code to keep similarity to xfns.c after changes
14556 from 2011-11-05.
14557
14558 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14559
14560 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14561 (unwind_create_frame): New function (Bug#9943).
14562 (Fx_create_frame): Restructure code to be more similar to the one in
14563 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14564 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14565 Move terminal->reference_count++ just before making the frame official
14566 (Bug#9943).
14567
14568 * nsterm.m (x_free_frame_resources): New function.
14569 (x_destroy_window): Move code to x_free_frame_resources.
14570
14571 * xfns.c (unwind_create_frame): Fix comment.
14572 (Fx_create_frame, x_create_tip_frame):
14573 Move terminal->reference_count++ just before making the frame
14574 official. Move initialization of image_cache_refcount and
14575 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14576
14577 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14578
14579 Support MSVC build with newer versions of Visual Studio.
14580 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14581 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14582 nt/gmake.defs.
14583
14584 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14585 which are not supported by MSVC.
14586 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14587 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14588 bitfields.
14589 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14590 types in bitfields.
14591 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14592
14593 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14594
14595 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
14596
14597 Support MSVC build with newer versions of Visual Studio.
14598 * w32.c: Don't include w32api.h for MSVC.
14599 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14600
14601 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14602 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14603 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14604 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14605 e_* cousins.
14606 (alloca) [_MSC_VER]: Define to _alloca.
14607
14608 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14609
14610 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14611
14612 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14613
14614 * xdisp.c (note_mouse_highlight): If either of
14615 previous/next-single-property-change returns nil, treat that as
14616 the beginning or the end of the buffer. (Bug#9955)
14617
14618 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14619
14620 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
14621 label is not null (Bug#9951).
14622 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14623 may be NULL.
14624
14625 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14626
14627 * window.c (Fwindow_body_size): Mention in the doc string that the
14628 return value is in frame's canonical units. (Bug#9949)
14629
14630 2011-11-03 Eli Zaretskii <eliz@gnu.org>
14631
14632 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14633
14634 * w32fns.c (unwind_create_frame): If needed, free the glyph
14635 matrices of the partially constructed frame. (Bug#9943)
14636 * xfns.c (unwind_create_frame): Likewise.
14637
14638 2011-11-01 Eli Zaretskii <eliz@gnu.org>
14639
14640 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14641 Don't stop backward scan on the continuation glyph, even though
14642 its CHARPOS is positive.
14643 (mouse_face_from_buffer_pos, note_mouse_highlight):
14644 Rename cover_string to disp_string.
14645
14646 2011-11-01 Martin Rudalics <rudalics@gmx.at>
14647
14648 * window.c (temp_output_buffer_show): Don't use
14649 Vtemp_buffer_show_specifiers.
14650 (Vtemp_buffer_show_specifiers): Remove unused variable.
14651
14652 2011-10-30 Eli Zaretskii <eliz@gnu.org>
14653
14654 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14655 past the beginning of the current glyph matrix.
14656
14657 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
14658
14659 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14660 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14661 HAVE_GTK3 (Bug#9869).
14662
14663 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14664 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14665
14666 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14667
14668 * xterm.c: Declare x_handle_net_wm_state to return int.
14669 (handle_one_xevent): Check if we are iconified but don't have
14670 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14671 (get_current_wm_state): Return non-zero if not hidden,
14672 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14673 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14674 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14675 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14676
14677 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14678
14679 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14680 so that this new function doesn't get optimized away by a
14681 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14682
14683 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14684
14685 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14686
14687 2011-10-29 Eli Zaretskii <eliz@gnu.org>
14688
14689 Fix the `xbytecode' command.
14690 * .gdbinit (xprintbytestr): New command.
14691 (xwhichsymbols): Rename from `which'; all callers changed.
14692 (xbytecode): Print the byte-code string as well.
14693
14694 2011-10-29 Kim Storm <storm@cua.dk>
14695
14696 * alloc.c (which_symbols): New function.
14697
14698 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14699
14700 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14701 line. (Bug#9903)
14702
14703 2011-10-29 Glenn Morris <rgm@gnu.org>
14704
14705 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14706 Not clear what it was for, and it causes various bugs. (Bug#9839)
14707
14708 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14709
14710 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14711 possible random value that matches one of those tested as
14712 condition to clear the mouse face.
14713
14714 2011-10-28 Chong Yidong <cyd@gnu.org>
14715
14716 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14717
14718 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14719
14720 * window.c (make_window): Initialize phys_cursor_on_p.
14721
14722 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14723
14724 * lisp.h (struct Lisp_Symbol): Update comments.
14725
14726 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
14727
14728 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14729
14730 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14731
14732 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14733 <oslsachem@gmail.com> for helping to debug this.
14734
14735 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14736 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14737 (g_b_init_get_glyph_outline_w): New static variables.
14738 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14739 (GetGlyphOutlineW_Proc): New typedefs.
14740 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
14741 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14742 New functions.
14743 (w32font_open_internal, compute_metrics):
14744 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
14745 instead of calling the "wide" APIs directly.
14746
14747 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14748
14749 * w32.h (syms_of_w32font): Add prototype.
14750
14751 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14752
14753 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14754 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14755 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14756 (Fmove_to_window_line): Doc fix.
14757
14758 2011-10-27 Chong Yidong <cyd@gnu.org>
14759
14760 * process.c (make_process): Set gnutls_state to NULL.
14761
14762 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14763 non-NULL, regardless of GNUTLS_INITSTAGE.
14764 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14765 an error. Set process slots as soon as we allocate them.
14766
14767 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14768
14769 2011-10-27 Chong Yidong <cyd@gnu.org>
14770
14771 * gnutls.c (emacs_gnutls_deinit): New function.
14772 Deallocate credentials structures as well as calling gnutls_deinit.
14773 (Fgnutls_deinit, Fgnutls_boot): Use it.
14774
14775 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14776 (deactivate_process): Call emacs_gnutls_deinit.
14777
14778 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14779
14780 * image.c (x_create_x_image_and_pixmap):
14781 * w32.c (sys_rename, w32_delayed_load):
14782 * w32font.c (fill_in_logfont):
14783 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14784
14785 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
14786
14787 * w32fns.c (w32_default_color_map): New function,
14788 extracted from Fw32_default_color_map.
14789 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
14790
14791 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14792
14793 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14794
14795 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14796
14797 * keyboard.c (test_undefined): New function (bug#9751).
14798 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14799
14800 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14801
14802 * sysdep.c (init_sys_modes): Fix the check for the controlling
14803 terminal (Bug#6649).
14804
14805 2011-10-20 Eli Zaretskii <eliz@gnu.org>
14806
14807 * dispextern.h (struct bidi_it): New member next_en_type.
14808
14809 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14810 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14811 current character, check also for next_en_type being WEAK_EN.
14812 (bidi_resolve_weak): Don't enter the expensive loop if the current
14813 position is before next_en_pos. Record the bidi type of the first
14814 non-ET, non-BN character we find, in addition to its position.
14815 (bidi_level_of_next_char): Invalidate next_en_type when
14816 next_en_pos is over-stepped.
14817
14818 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14819
14820 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14821 * editfns.c: Rewrite current-time-zone so that it invokes
14822 the equivalent of (format-time-string "%Z") to get the time zone name.
14823 This fixes a bug when the time zone name contains characters that
14824 need converting from the system time locale to Emacs internal format.
14825 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14826 that patch fixed format-time-string to do the conversion, but
14827 I forgot to fix current-time-zone.
14828 (format_time_string): New function, containing most of
14829 what Fformat_time_string used to contain.
14830 (Fformat_time_string): Rewrite in terms of format_time_string.
14831 This doesn't change this function's behavior.
14832 (current-time-zone): Rewrite to use format_time_string.
14833 This fixes the bug reported by Michael Schierl in
14834 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14835 Jason Rumney's 2007-06-07 change worked around this bug, but
14836 didn't fix it.
14837 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14838
14839 2011-10-19 Eli Zaretskii <eliz@gnu.org>
14840
14841 * xdisp.c (start_display): If the character at POS is displayed
14842 via a display vector, reset IT->current.dpvec_index to zero.
14843 (try_window_reusing_current_matrix): If a line ends in a display
14844 vector or the next line starts in a display vector, continue
14845 redrawing the window even though the character position of
14846 start_row was reached.
14847 (Bug#9771, part 2)
14848
14849 2011-10-18 Chong Yidong <cyd@gnu.org>
14850
14851 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14852 with nobreak-char-display too.
14853
14854 2011-10-18 Eli Zaretskii <eliz@gnu.org>
14855
14856 Fix part 3 of bug#9771.
14857 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14858 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14859 non-neutral characters if the current character is a paragraph
14860 separator (a.k.a. Newline). This avoids running the same
14861 expensive loop twice, once when we consume the preceding newline
14862 and the other time when the line actually needs to be displayed.
14863 Avoid the loop when we see neutrals on the base embedding level
14864 following a character whose directionality is the same as the
14865 paragraph's. This avoids running the expensive loop when a line
14866 ends in a long sequence of neutrals, like control characters.
14867 Add assertion against STRONG_AL type. Slightly rearrange code
14868 that determines the type of a neutral given the first non-neutral
14869 that follows it.
14870 (bidi_level_of_next_char): Set next_en_pos to zero when
14871 invalidating its info.
14872
14873 2011-10-17 Eli Zaretskii <eliz@gnu.org>
14874
14875 * xdisp.c (push_display_prop): Determine whether to record string
14876 or buffer position by IT->string, not by IT->method. Allow
14877 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
14878 (move_it_vertically_backward): Don't look for character position
14879 immediately after the newline when in a continuation line.
14880 (Bug#9771, part 1)
14881
14882 2011-10-15 Martin Rudalics <rudalics@gmx.at>
14883
14884 * window.c (coordinates_in_window): Rewrite and delabelize
14885 vertical border check. (Bug#5357) (Bug#9618)
14886
14887 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14888
14889 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14890 errors in XSetWindowBorder (bug#9310).
14891
14892 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14893
14894 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14895 avoid crash when xmalloc overrun checking is enabled.
14896
14897 2011-10-13 Eli Zaretskii <eliz@gnu.org>
14898
14899 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14900 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14901 cursor motion with <left> and <right> arrow keys.
14902
14903 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14904 some callers set that themselves.
14905
14906 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14907
14908 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14909 display string and the previous row comes from the same string and
14910 is empty. (Bug#9739) (Bug#9738)
14911
14912 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14913
14914 * doc.c (get_doc_string): Encode file name (bug#9735).
14915
14916 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14917
14918 * bidi.c (bidi_level_of_next_char):
14919 * xdisp.c (get_visually_first_element): Remove old incorrect
14920 comments regarding the Unicode Line Separator character.
14921
14922 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14923
14924 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14925
14926 * alloc.c (Fgc_status): Do not access beyond zombies array
14927 boundary if nzombies > MAX_ZOMBIES.
14928 * alloc.c (dump_zombies): Add missing format specifier.
14929
14930 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14931
14932 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14933 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14934
14935 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14936 Some packages use them to denote characters with modifiers.
14937
14938 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14939
14940 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14941 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14942 matching a pp-number. Rename parameter var to var1.
14943
14944 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14945
14946 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14947
14948 2011-10-08 Glenn Morris <rgm@gnu.org>
14949
14950 * callint.c (Fcall_interactively): Give a more explicit error for the
14951 'c' case with a non-character input. (Bug#8479)
14952
14953 2011-10-08 Eli Zaretskii <eliz@gnu.org>
14954
14955 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14956 lines.
14957 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14958 lines that are hscrolled on the left.
14959
14960 * dispnew.c (buffer_posn_from_coords): Account for a possible
14961 presence of header-line. (Bug#4426)
14962
14963 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14964
14965 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14966 Don't advertise functionality which we discourage or doesn't work.
14967
14968 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14969
14970 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14971 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14972 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14973 this makes Emacs dump core during garbage collection on rare
14974 occasions. sizeof is obviously inferior to offsetof here, so
14975 stick with offsetof.
14976 (GC_POINTER_ALIGNMENT): New macro.
14977 (mark_memory): Omit 3rd (offset) arg; caller changed.
14978 Don't assume EMACS_INT alignment is the same as pointer alignment.
14979
14980 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14981
14982 * keyboard.c (read_key_sequence_remapped): New var.
14983 (read_key_sequence): Compute remapping in the right buffer.
14984 (command_loop_1): Use read_key_sequence's remapping directly.
14985
14986 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14987
14988 * dired.c (file_name_completion): Don't expand file name.
14989 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14990 before checking file name handler.
14991
14992 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14993 they've been requested explicitly (bug#9591).
14994
14995 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
14996
14997 * keymap.c (Fsingle_key_description): Use make_specified_string
14998 instead of build_string to build string from push_key_description.
14999 (Bug#5193)
15000
15001 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15002
15003 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15004 This fixes a Y2038 bug on 64-bit hosts.
15005 * buffer.c (reset_buffer):
15006 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15007 (Fclear_buffer_auto_save_failure):
15008 Use 0, not -1, to represent an unset failure time, since time_t
15009 might not be signed.
15010
15011 Remove dependency on glibc malloc internals.
15012 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15013 Move back here from lisp.h, but with their new implementations.
15014 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15015 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15016 * charset.c (charset_table_init): New static var.
15017 (syms_of_charset): Use it instead of xmalloc. This removes a
15018 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15019 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15020 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15021 Move back to alloc.c.
15022 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15023 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15024
15025 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15026
15027 * nsterm.m (windowDidResize): Call x_set_window_size only when
15028 ns_in_resize is true. Otherwise set pixelwidth/height and
15029 call change_frame_size (Bug#9628).
15030
15031 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15032
15033 Port --enable-checking=all to Fedora 14 x86-64.
15034 * charset.c (syms_of_charset): Also account for glibc malloc's
15035 internal overhead when calculating the initial malloc maximum.
15036
15037 Port --enable-checking=all to Fedora 14 x86.
15038 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15039 Move to lisp.h.
15040 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15041 (overrun_check_realloc, overrun_check_free):
15042 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15043 That way, xmalloc returns a properly-aligned pointer even if
15044 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15045 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15046 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15047 into account when calculating the initial malloc maximum.
15048 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15049 Move here from alloc.c, so that charset.c can use it too.
15050 Properly align; the old code wasn't right for common 32-bit hosts
15051 when configured with --enable-checking=all.
15052 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15053 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15054
15055 2011-09-29 Eli Zaretskii <eliz@gnu.org>
15056
15057 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15058 use EDOM.
15059
15060 2011-09-28 Eli Zaretskii <eliz@gnu.org>
15061
15062 * xdisp.c (compute_display_string_end): If there's no display
15063 string at CHARPOS, return -1.
15064
15065 * bidi.c (bidi_fetch_char): When compute_display_string_end
15066 returns a negative value, treat the character as a normal
15067 character not covered by a display string. (Bug#9624)
15068
15069 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
15070
15071 * lread.c (Fread_from_string): Fix typo in docstring.
15072
15073 2011-09-27 Eli Zaretskii <eliz@gnu.org>
15074
15075 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15076 newline, reseat the iterator instead of bidi-iterating there one
15077 character at a time. (Bug#9610)
15078 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15079 TO_CHARPOS if the bidi iterator is at base embedding level.
15080
15081 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15082
15083 * lread.c (readevalloop): Use correct code for NBSP.
15084 (read1): Likewise. (Bug#9608)
15085
15086 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
15087
15088 * dbusbind.c (Fdbus_register_signal): When service is not
15089 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15090
15091 2011-09-25 Glenn Morris <rgm@gnu.org>
15092
15093 * buffer.c (truncate-lines): Doc fix.
15094
15095 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
15096
15097 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15098 (Fset_window_next_buffers): Doc fix.
15099
15100 2011-09-24 Glenn Morris <rgm@gnu.org>
15101
15102 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15103
15104 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15105
15106 Fix minor problems found by static checking.
15107 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15108 * indent.c (Fvertical_motion): Fix == vs = typo.
15109
15110 2011-09-24 Eli Zaretskii <eliz@gnu.org>
15111
15112 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15113 Default value is now t. Doc fix.
15114
15115 * indent.c (Fvertical_motion): Compute and apply the overshoot
15116 logic when moving up, not only when moving down. Fix the
15117 confusing name and values of the it_overshoot_expected variable;
15118 logic changes accordingly. (Bug#9254) (Bug#9549)
15119
15120 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15121 CHARPOS is covered by a display string which includes newlines.
15122 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15123 is covered by a display string with embedded newlines.
15124
15125 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
15126
15127 * dbusbind.c (Fdbus_register_signal): Add match rule to
15128 Vdbus_registered_objects_table. (Bug#9581)
15129 (Fdbus_register_method, Vdbus_registered_objects_table):
15130 Fix docstring.
15131
15132 2011-09-24 Jim Meyering <meyering@redhat.com>
15133
15134 do not ignore write error for any output size
15135 The previous change was incomplete.
15136 While it makes emacs --batch detect the vast majority of stdout
15137 write failures, errors were still ignored whenever the output size is
15138 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15139 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15140 && echo FAIL: ignored write error
15141 FAIL: ignored write error
15142 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15143 && echo FAIL: ignored write error
15144 FAIL: ignored write error
15145 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15146
15147 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15148
15149 * emacs.c (Fkill_emacs): In noninteractive mode exit
15150 non-successfully if a write error occurred on stdout. (Bug#9574)
15151
15152 2011-09-21 Eli Zaretskii <eliz@gnu.org>
15153
15154 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15155 the xassert test.
15156
15157 * dispextern.h (struct it): Update the comment documenting what
15158 can it->OBJECT be.
15159
15160 2011-09-20 Eli Zaretskii <eliz@gnu.org>
15161
15162 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15163 a display string, extend search for cursor position to end of row.
15164 (find_row_edges): If the row ends in a newline from a display
15165 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15166 Handle the case of a display string with multiple newlines.
15167 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15168 non-empty line. Fixes confusing cursor motion with arrow keys at
15169 the beginning of a line that starts with whitespace.
15170
15171 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15172
15173 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15174 (bug#9493).
15175
15176 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
15177
15178 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15179 boolean (Bug#9154).
15180
15181 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15182
15183 * xdisp.c (display_line): Record maximum and minimum buffer
15184 positions even if no glyphs were produced (e.g., by a zero-width
15185 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15186 buffer positions that will be removed from the glyph row because
15187 they don't fit.
15188 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15189 column is beyond frame width: don't subtract 1 "pixel" when
15190 computing width of the stretch.
15191 (reseat_at_next_visible_line_start): Undo the change made on
15192 2011-09-17 that saved paragraph information and restored it after
15193 the call to `reseat'. (Bug#9545)
15194
15195 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15196
15197 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15198 and turn window cursor on if cleared (Bug#9415).
15199
15200 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
15201
15202 * search.c (boyer_moore): Take unibyte characters from pattern
15203 literally. (Bug#9458)
15204
15205 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15206
15207 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15208
15209 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15210
15211 Fix minor problem found by static checking.
15212 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15213 initialized, to pacify gcc -Wuninitialized.
15214
15215 * fileio.c: Report proper errno when syscall falls.
15216 (Finsert_file_contents): Save and restore errno,
15217 so that report_file_error outputs the correct diagnostic.
15218 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15219
15220 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15221
15222 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15223
15224 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15225
15226 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15227 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15228
15229 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15230
15231 * xdisp.c (reseat_at_next_visible_line_start): Keep information
15232 about the current paragraph and restore it after the call to reseat.
15233
15234 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15235 (bidi_find_paragraph_start): Search back for paragraph beginning
15236 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15237 (bidi_move_to_visually_next): Only trigger paragraph-related
15238 computations when the last character is a newline or at EOB, not
15239 just any NEUTRAL_B. (Bug#9470)
15240
15241 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15242 truncated lines if point is covered by a display string. (Bug#9524)
15243
15244 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15245
15246 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15247 (cons_to_x_long): New function.
15248 (lisp_data_to_selection_data): Use it. Correct the test for
15249 short-versus-long data; it was negated. Break out of vector
15250 loop, for efficiency, when a long datum is discovered.
15251
15252 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15253
15254 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15255
15256 2011-09-16 Eli Zaretskii <eliz@gnu.org>
15257
15258 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15259 GCC PR/17406) by declaring this function with external scope.
15260
15261 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15262
15263 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15264 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15265
15266 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15267
15268 * editfns.c (Fformat): Correctly handle text properties on "%%".
15269
15270 2011-09-15 Eli Zaretskii <eliz@gnu.org>
15271
15272 * xterm.c (x_draw_composite_glyph_string_foreground):
15273 * w32term.c (x_draw_composite_glyph_string_foreground):
15274 * term.c (encode_terminal_code):
15275 * composite.c (composition_update_it, get_composition_id):
15276 * xdisp.c (get_next_display_element)
15277 (fill_composite_glyph_string): Add comments about special meaning
15278 of TAB characters in a composition.
15279
15280 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15281
15282 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15283 This occurs when processing a multibyte format.
15284 Problem reported by Wolfgang Jenker.
15285
15286 2011-09-15 Johan Bockgård <bojohan@gnu.org>
15287
15288 * xdisp.c (try_cursor_movement): Only check for exact match if
15289 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15290
15291 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15292
15293 Remove unused external symbols.
15294 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15295 * xdisp.c (calc_pixel_width_or_height): Now static.
15296 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15297 * indent.c (check_display_width):
15298 * w32term.c: Fix comment to match code.
15299 * xterm.c, xterm.h (x_catching_errors): Remove.
15300
15301 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15302
15303 * xselect.c: Use signed conversions more consistently (Bug#9498).
15304 (selection_data_to_lisp_data): Assume incoming selection data are
15305 signed integers, not unsigned. This is to be consistent with
15306 outgoing selection data, which was modified to use signed integers
15307 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15308 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15309 expects long, not unsigned long.
15310
15311 2011-09-14 Eli Zaretskii <eliz@gnu.org>
15312
15313 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15314 computation of loop end. Reported by Johan Bockgård
15315 <bojohan@gnu.org>.
15316
15317 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
15318
15319 * frame.c (Fother_visible_frames_p): Function deleted.
15320
15321 2011-09-12 Eli Zaretskii <eliz@gnu.org>
15322
15323 * indent.c (compute_motion): Process display vector front to back
15324 rather than the other way around. (Bug#2496)
15325
15326 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15327
15328 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15329
15330 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
15331
15332 * minibuf.c (Fread_from_minibuffer): Doc fix.
15333
15334 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15335
15336 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15337 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15338
15339 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15340
15341 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15342 value for non-existent files.
15343
15344 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15345
15346 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15347 set its "size" to -1. This will set the modtime_size field of
15348 the corresponding buffer to -1, which is what
15349 verify-visited-file-modtime expects for files that do not exist.
15350 (Bug#9139)
15351
15352 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15353
15354 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15355 here ...
15356 * lisp.h: ... from here. push_key_description is no longer
15357 defined in keyboard.c, so its declaration should not be in
15358 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15359 logically belongs with push_key_description.
15360
15361 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15362
15363 * buffer.h: Include <sys/types.h> instead of <time.h>.
15364 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15365 Problem reported by Herbert J. Skuhra.
15366
15367 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15368
15369 * xml.c (parse_region): Make the parsing work for
15370 non-comment-starting XML files again (bug#9144).
15371
15372 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15373
15374 * image.c (gif_load): Fix calculation of bottom and right corner.
15375 (Bug#9468)
15376
15377 2011-09-10 Eli Zaretskii <eliz@gnu.org>
15378
15379 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15380 redisplay in small windows.
15381
15382 2011-09-09 Eli Zaretskii <eliz@gnu.org>
15383
15384 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15385
15386 2011-09-08 Martin Rudalics <rudalics@gmx.at>
15387
15388 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15389 Operate on live windows only.
15390
15391 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
15392
15393 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15394
15395 2011-09-07 Eli Zaretskii <eliz@gnu.org>
15396
15397 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15398 only under bidi iteration.
15399
15400 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15401
15402 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15403
15404 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15405
15406 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15407 Without this fix, the command to link temacs failed due to an
15408 undefined symbol __builtin_isnan. This is because
15409 /usr/include/iso/math_c99.h #defines isnan(x) to
15410 __builtin_isnan(x), but the bundled gcc, which identifies itself
15411 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15412 a __builtin_isnan.
15413 * floatfns.c (isnan): #undef, and then #define to a clone of
15414 what's in data.c.
15415 (Fisnan): Always define, since it's always available now.
15416 (syms_of_floatfns): Always define isnan at the Lisp level.
15417
15418 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15419
15420 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15421
15422 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15423
15424 * fileio.c: Fix bugs with large file offsets (Bug#9428).
15425 The previous code assumed that file offsets (off_t values) fit in
15426 EMACS_INT variables, which is not true on typical 32-bit hosts.
15427 The code messed up by falsely reporting buffer overflow in cases
15428 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15429 when "big" contains more than 2**29 bytes, even though this
15430 inserts just one byte and does not overflow the buffer.
15431 (Finsert_file_contents): Store file offsets as off_t
15432 values, not as EMACS_INT values. Check for overflow when
15433 converting between EMACS_INT and off_t. When checking for
15434 buffer overflow or for overlap, take the offsets into account.
15435 Don't use EMACS_INT for small values where int suffices.
15436 When checking for overlap, fix a typo: ZV was used where
15437 ZV_BYTE was intended.
15438 (Fwrite_region): Don't assume off_t fits into 'long'.
15439 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15440
15441 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
15442
15443 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15444
15445 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15446
15447 sprintf-related integer and memory overflow issues (Bug#9412).
15448
15449 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
15450 (esprintf, exprintf, evxprintf): New functions.
15451 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
15452 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
15453 (modify_event_symbol): Do not assume that the length of
15454 name_alist_or_stem is safe to alloca and fits in int.
15455 (Fexecute_extended_command): Likewise for function name and binding.
15456 (Frecursion_depth): Wrap around reliably on integer overflow.
15457 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15458 since some callers pass EMACS_INT values.
15459 (Fsingle_key_description): Don't crash if symbol name contains more
15460 than MAX_ALLOCA bytes.
15461 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15462 (get_minibuffer): Arg is now EMACS_INT, not int.
15463 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
15464 (esprintf, exprintf, evxprintf): New decls.
15465 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15466
15467 * dbusbind.c (signature_cat): New function.
15468 (xd_signature, Fdbus_register_signal):
15469 Do not overrun buffer; instead, report string overflow.
15470
15471 * dispnew.c (add_window_display_history): Don't overrun buffer.
15472 Truncate instead; this is OK since it's just a log.
15473
15474 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15475 even if the time zone offset is outlandishly large.
15476 Don't mishandle offset == INT_MIN.
15477
15478 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15479 when creating daemon; the previous buffer-overflow check was incorrect.
15480
15481 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15482 which has the guts of the old verror function.
15483
15484 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15485 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15486
15487 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15488 (font_unparse_xlfd): Don't blindly alloca long strings.
15489 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
15490 fits in int, when using sprintf. Use single snprintf to count
15491 length of string rather than counting it via multiple sprintfs;
15492 that's simpler and more reliable.
15493 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15494 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15495 sprintf, in case result does not fit in int.
15496
15497 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15498 (fontset_from_font): Print it.
15499
15500 * frame.c (tty_frame_count): Now printmax_t, not int.
15501 (make_terminal_frame, set_term_frame_name): Print it.
15502 (x_report_frame_params): In X, window IDs are unsigned long,
15503 not signed long, so print them as unsigned.
15504 (validate_x_resource_name): Check for implausibly long names,
15505 and don't assume name length fits in 'int'.
15506 (x_get_resource_string): Don't blindly alloca invocation name;
15507 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15508 not fit in int.
15509
15510 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15511 (xg_check_special_colors, xg_set_geometry):
15512 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15513
15514 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15515 Use esprintf, not sprintf, in case result does not fit in int.
15516
15517 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15518 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15519 it as a large positive number.
15520 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15521 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15522
15523 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15524 in case result does not fit in int.
15525
15526 * print.c (float_to_string): Detect width overflow more reliably.
15527 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15528 buffer overrun. Don't assume list length fits in 'int'. Treat
15529 print length of 0 as 0, not as infinity; to be consistent with other
15530 uses of print length in this function. Don't overflow print length
15531 index. Don't assume hash table size fits in 'long', or that
15532 vectorlike size fits in 'unsigned long'.
15533
15534 * process.c (make_process): Use printmax_t, not int, to format
15535 process-name gensyms.
15536
15537 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15538
15539 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15540 to avoid potential buffer overrun.
15541
15542 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15543 if X resource line is longer than 512 bytes.
15544
15545 * xfns.c (x_window): Make sprintf buffer a bit bigger
15546 to avoid potential buffer overrun.
15547
15548 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15549
15550 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15551
15552 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15553
15554 Integer overflow fixes for scrolling, etc.
15555 Without these, Emacs silently mishandles large integers sometimes.
15556 For example, "C-u 4294967297 M-x recenter" was treated as if
15557 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15558
15559 * xdisp.c (try_window_id): Check Emacs fixnum range before
15560 converting to 'int'.
15561
15562 * window.c (window_scroll_line_based, Frecenter):
15563 Check that an Emacs fixnum is in range before assigning it to 'int'.
15564 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15565 values converted from Emacs fixnums.
15566 (Frecenter): Don't wrap around a line count if it is out of 'int'
15567 range; instead, treat it as an extreme value.
15568 (Fset_window_configuration, compare_window_configurations):
15569 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15570
15571 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15572 that can exceed INT_MAX. Check that EMACS_INT value is in range
15573 before assigning it to the (possibly-narrower) index.
15574 (match_limit): Don't assume that a fixnum can fit in 'int'.
15575
15576 * print.c (print_object): Use ptrdiff_t, not int, for index that can
15577 exceed INT_MAX.
15578
15579 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
15580 (Fvertical_motion): Don't wrap around LINES values that don't fit
15581 in 'int'. Instead, treat them as extreme values. This is good
15582 enough for windows, which can't have more than INT_MAX lines anyway.
15583
15584 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15585
15586 * Require libxml/parser.h to avoid compilation warning.
15587
15588 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15589
15590 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15591 since this reportedly can destroy thread storage.
15592
15593 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
15594
15595 * syntax.c (find_defun_start): Update all cache variables if
15596 exiting early (Bug#9401).
15597
15598 2011-08-30 Eli Zaretskii <eliz@gnu.org>
15599
15600 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15601
15602 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15603 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15604 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15605
15606 * term.c (tty_append_glyph): New function.
15607 (produce_stretch_glyph): Static function and its prototype deleted.
15608
15609 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15610 Add prototypes.
15611
15612 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15613
15614 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15615 when checking :margin (Bug#9390).
15616 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
15617 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
15618 so that the name doesn't mislead. All uses changed.
15619
15620 2011-08-28 Johan Bockgård <bojohan@gnu.org>
15621
15622 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15623 set_tty_hooks.
15624
15625 2011-08-27 Eli Zaretskii <eliz@gnu.org>
15626
15627 * xdisp.c (move_it_to): Don't bail out early when reaching
15628 position beyond to_charpos, if we are scanning backwards.
15629 (move_it_vertically_backward): When DY == 0, make sure we get to
15630 the first character in the line after the newline.
15631
15632 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15633
15634 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15635 (ccl_driver): Do not generate an out-of-range pointer.
15636 (Fccl_execute_on_string): Remove unnecessary check for
15637 integer overflow, noted by Stefan Monnier in
15638 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15639 Remove a FIXME that didn't need fixing.
15640 Simplify the newly-introduced buffer reallocation code.
15641
15642 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
15643
15644 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15645
15646 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
15647
15648 Integer and memory overflow issues (Bug#9196).
15649
15650 * doc.c (get_doc_string): Rework so that
15651 get_doc_string_buffer_size is the actual buffer size, rather than
15652 being 1 less than the actual buffer size; this makes xpalloc more
15653 convenient.
15654
15655 * image.c (x_allocate_bitmap_record, cache_image):
15656 * xselect.c (Fx_register_dnd_atom):
15657 Simplify previous changes by using xpalloc.
15658
15659 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15660 since either will do and ptrdiff_t is convenient with xpalloc.
15661
15662 * charset.c (charset_table_size)
15663 (struct charset_sort_data.priority): Now ptrdiff_t.
15664 (charset_compare): Don't overflow if priorities differ greatly.
15665 (Fsort_charsets): Don't assume list length fits in int.
15666 Check for size-calculation overflow when allocating sort data.
15667 (syms_of_charset): Allocate an initial charset table that is
15668 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15669
15670 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15671
15672 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15673 The actual value is always <= INT_MAX, and leaving it unsigned made
15674 overflow checking harder.
15675
15676 * dispextern.h (struct glyph_matrix.rows_allocated)
15677 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15678 with xpalloc. The values are still always <= INT_MAX.
15679
15680 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15681
15682 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15683 (SAFE_NALLOCA): New macro.
15684
15685 * region-cache.c (struct boundary.pos, find_cache_boundary)
15686 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15687 (set_cache_region, invalidate_region_cache)
15688 (revalidate_region_cache, know_region_cache, region_cache_forward)
15689 (region_cache_backward, pp_cache):
15690 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15691 so that ptrdiff_t * can be passed to xpalloc.
15692 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15693 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15694 (pp_cache): Don't assume cache_len fits in int.
15695 * region-cache.h: Adjust extern decls to match.
15696
15697 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15698 EMACS_INT, since either will do, for xpalloc.
15699
15700 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15701 (xnmalloc, xnrealloc, xpalloc): New functions.
15702
15703 * bidi.c (bidi_shelve_header_size): New constant.
15704 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15705 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15706
15707 * bidi.c (bidi_cache_shrink):
15708 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15709 (overlay_strings):
15710 Don't update size of array until after memory allocation succeeds,
15711 because xmalloc/xrealloc may not return.
15712 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15713 now that we have proper integer overflow checking.
15714 (record_overlay_string, overlay_strings): Catch overflows when
15715 calculating size of overlay_str_buf.
15716
15717 * callproc.c (Fcall_process): Check for size overflow when
15718 calculating size of args2.
15719 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15720 Normally we prefer signed values, but sticking with ptrdiff_t would
15721 require adding more-complicated checks.
15722
15723 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15724 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15725 Redo buffer-overflow calculations to avoid integer overflow.
15726 Add a FIXME comment where memory seems to be over-allocated.
15727
15728 * character.c (Fstring): Check for size-calculation overflow.
15729
15730 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15731 unnecessary integer overflow. Check for size overflow.
15732 (encode_coding_object): Don't update size until xmalloc succeeds.
15733
15734 * composite.c (get_composition_id): Check for overflow in glyph
15735 length calculations.
15736
15737 Integer and memory overflow fixes for display code.
15738 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15739 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15740 (scrolling_window): Check for overflow in size calculations.
15741 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15742 Don't assume glyph table len fits in int.
15743 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15744 (row_table_size): Now ptrdiff_t, not int.
15745 (scrolling_window): Avoid overflow in size calculations.
15746 Don't update size until allocation succeeds.
15747 * fns.c (concat): Check for overflow in size calculations.
15748 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15749 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15750 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15751
15752 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15753 (get_doc_string): Check for size calculation overflow.
15754 Don't update size until allocation succeeds.
15755 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15756 EMACS_INT, where ptrdiff_t will do.
15757 (Fsubstitute_command_keys): Check for string overflow.
15758
15759 * editfns.c (set_time_zone_rule): Don't assume environment length
15760 fits in int.
15761 (message_length): Now ptrdiff_t, not int.
15762 (Fmessage_box): Don't update size until allocation succeeds.
15763 Don't assume message length fits in int.
15764 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15765
15766 * emacs.c (main): Do not reallocate argv, since there is a null at
15767 the end that can be overwritten, and this way there's no need to
15768 worry about size-calculation overflow.
15769 (sort_args): Check for size-calculation overflow.
15770
15771 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15772 alloc succeeds.
15773 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15774
15775 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15776 (x_set_scroll_bar_width, x_figure_window_size):
15777 Check for integer overflow.
15778 (x_set_alpha): Do not assume XINT fits in int.
15779
15780 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15781 This is for the members text_lines, text_cols, total_lines, total_cols,
15782 where the system imposes an 'int' limit.
15783
15784 * fringe.c (Fdefine_fringe_bitmap):
15785 Don't update size until alloc works.
15786
15787 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15788 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15789
15790 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15791 Check for size-calculation overflow.
15792 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15793 do, as we prefer signed integers.
15794 (id_to_widget.max_size, id_to_widget.used)
15795 (xg_store_widget_in_map, xg_remove_widget_from_map)
15796 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15797 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15798 Use and return ptrdiff_t, not int.
15799 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15800 * gtkutil.h: Change prototypes to match the above.
15801
15802 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15803 are duplicate now that they've been promoted to lisp.h.
15804 (x_allocate_bitmap_record, x_alloc_image_color)
15805 (make_image_cache, cache_image, xpm_load):
15806 Don't update size until alloc is done.
15807 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15808 (x_detect_edges):
15809 Check for size calculation overflow.
15810 (ct_colors_allocated_max): New constant.
15811 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15812 overflow.
15813
15814 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15815 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15816 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15817 Use ptrdiff_t, not int, to count maps.
15818 (read_char_minibuf_menu_prompt): Check for overflow in size
15819 calculations. Don't update size until allocation succeeds.
15820 Redo calculations to avoid overflow.
15821 * keyboard.h: Change prototypes to match the above.
15822
15823 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15824 to count maps.
15825 (current_minor_maps): Check for size calculation overflow.
15826 * keymap.h: Change prototypes to match the above.
15827
15828 * lread.c (read1, init_obarray): Don't update size until alloc done.
15829
15830 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15831 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15832
15833 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15834 Now ptrdiff_t, not int.
15835 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15836 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15837
15838 * process.c (Fnetwork_interface_list): Check for overflow
15839 in size calculation.
15840
15841 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15842
15843 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15844 overflow. Don't bother calling xmalloc when xrealloc will do.
15845
15846 * search.c (Freplace_match): Check for size calculation overflow.
15847 (Fset_match_data): Don't assume list lengths fit in 'int'.
15848
15849 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15850 for command line length. Do not attempt to address one before the
15851 beginning of an array, as that's not portable.
15852
15853 * term.c (max_frame_lines): Remove; unused.
15854 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15855 not int.
15856 (encode_terminal_code, calculate_costs): Check for size
15857 calculation overflow.
15858 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15859 table lengths and related sizes. Don't update size until alloc
15860 done. Redo calculations to avoid overflow.
15861 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15862
15863 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15864 subtracting pointers.
15865 (gobble_line): Check for overflow more carefully. Don't update size
15866 until alloc done.
15867
15868 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15869 Don't update size until alloc done.
15870 Redo size calculations to avoid overflow.
15871 Check for size calculation overflow.
15872 (main) [DEBUG]: Fix typo in invoking tparam1.
15873
15874 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15875 Use ptrdiff_t, not int, for sizes.
15876 (store_mode_line_noprop_char): Don't update size until alloc done.
15877
15878 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15879 Use ptrdiff_t, not int, for sizes.
15880 (Finternal_make_lisp_face, cache_face):
15881 Check for size calculation overflow.
15882 (cache_face): Treat size calculation overflows as if they were
15883 memory exhaustion (the usual treatment), rather than aborting.
15884
15885 * xfns.c (x_encode_text, x_set_name_internal)
15886 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15887 sizes, since they can exceed INT_MAX in size. Check for size
15888 calculation overflow.
15889
15890 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15891 (xg_select): Check for size calculation overflow.
15892 Don't update size until alloc done.
15893
15894 * xrdb.c (get_environ_db): Don't assume path length fits in int,
15895 as sprintf is limited to int lengths.
15896
15897 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15898 (X_LONG_MIN): New macros.
15899 Use them to make the following changes clearer.
15900 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15901 This change doesn't affect the value now, but it may help remind
15902 future maintainers not to raise the value too much later.
15903 (SELECTION_QUANTUM): Remove, replacing with ...
15904 (selection_quantum): ... new function, which avoids overflow.
15905 All uses changed.
15906 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15907 assumption that selection length fits in 'int'.
15908 (x_reply_selection_request, x_handle_selection_request)
15909 (x_get_window_property, receive_incremental_selection)
15910 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15911 (lisp_data_to_selection_data, clean_local_selection_data):
15912 Use ptrdiff_t, not int, to record length of selection.
15913 (x_reply_selection_request, x_get_window_property)
15914 (receive_incremental_selection, x_property_data_to_lisp):
15915 Redo calculations to avoid overflow.
15916 (x_reply_selection_request): When sending hint, ceiling it at
15917 X_LONG_MAX rather than relying on wraparound overflow to send
15918 something.
15919 (x_get_window_property, receive_incremental_selection)
15920 (lisp_data_to_selection_data, x_property_data_to_lisp):
15921 Check for size-calculation overflow.
15922 (x_get_window_property, receive_incremental_selection)
15923 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15924 Don't store size until memory allocation succeeds.
15925 (x_get_window_property): Plug memory leak on memory exhaustion.
15926 Don't double-block input; malloc is safe here. Don't assume 2**34
15927 - 4 fits in unsigned long. Add an xassert to check
15928 XGetWindowProperty overflow. Be more careful about overflow
15929 calculations, and distinguish size from memory overflow better.
15930 (receive_incremental_selection): When tracing, don't assume
15931 unsigned int is less than INT_MAX.
15932 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15933 harmful) conversions of unsigned short to int.
15934 (lisp_data_to_selection_data): Don't assume that integers
15935 in the range -65535 through -1 fit in an X unsigned short.
15936 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15937 result parameters unless successful. Rely on cons_to_unsigned
15938 to report problems with elements; the old code wasn't right anyway.
15939 (x_check_property_data): Check for int overflow; we cannot use
15940 a wider type due to X limits.
15941 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15942
15943 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
15944
15945 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15946 (x_term_init): Check for size calculation overflow.
15947 (x_color_cells): Don't store size until memory allocation succeeds.
15948 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
15949 Don't assume alloca size is less than MAX_ALLOCA.
15950 (x_term_init): Don't assume length fits in int (sprintf is limited
15951 to int size).
15952
15953 Use ptrdiff_t for composition IDs.
15954 * character.c (lisp_string_width):
15955 * composite.c (composition_table_size, n_compositions)
15956 (get_composition_id, composition_gstring_from_id):
15957 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15958 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15959 * window.c (Frecenter):
15960 Use ptrdiff_t, not int, for composition IDs.
15961 * composite.c (get_composition_id): Check for integer overflow.
15962 * composite.h: Adjust prototypes to match the above changes.
15963
15964 Use ptrdiff_t for hash table indexes.
15965 * category.c (hash_get_category_set):
15966 * ccl.c (ccl_driver):
15967 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15968 * coding.c (coding_system_charset_list, detect_coding_system):
15969 * coding.h (struct coding_system.id):
15970 * composite.c (get_composition_id, gstring_lookup_cache):
15971 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15972 * image.c (xpm_get_color_table_h):
15973 * lisp.h (hash_lookup, hash_put):
15974 * minibuf.c (Ftest_completion):
15975 Use ptrdiff_t for hash table indexes, not int (which is too
15976 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15977 32-bit --with-wide-int hosts).
15978
15979 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15980 Add a FIXME comment about memory leaks.
15981 (syms_of_charset): Don't assume xmalloc returns.
15982
15983 Don't assume that stated character widths fit in int.
15984 * character.c (Fchar_width, c_string_width, lisp_string_width):
15985 * character.h (CHAR_WIDTH):
15986 * indent.c (MULTIBYTE_BYTES_WIDTH):
15987 Use sanitize_char_width to avoid undefined and/or bad behavior
15988 with outlandish widths.
15989 * character.h (sanitize_tab_width): Rename from sanitize_width,
15990 now that we have two such functions. All uses changed.
15991 (sanitize_char_width): New inline function.
15992
15993 Don't assume that tab-width fits in int.
15994 * character.h (sanitize_width): New inline function.
15995 (SANE_TAB_WIDTH): New macro.
15996 (ASCII_CHAR_WIDTH): Use it.
15997 * indent.c (sane_tab_width): Remove. All uses replaced by
15998 SANE_TAB_WIDTH (current_buffer).
15999 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16000
16001 * fileio.c: Integer overflow issues with file modes.
16002 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16003
16004 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16005 Remove unreachable code.
16006 (read_hex, load_charset_map_from_file): Check for integer overflow.
16007
16008 * xterm.c: Don't go over XClientMessageEvent limit.
16009 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16010 (x_send_scroll_bar_event): Likewise. Check that the size does not
16011 exceed limits imposed by XClientMessageEvent, as well as the usual
16012 ptrdiff_t and size_t limits.
16013
16014 * keyboard.c: Overflow, signedness and related fixes.
16015 (make_lispy_movement): Use same integer type in forward decl
16016 that is used in the definition.
16017 (read_key_sequence, keyremap_step):
16018 Change bufsize argument back to int, undoing my 2011-03-30 change.
16019 We prefer signed types, and int is wide enough here.
16020 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16021 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16022 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16023 length, not size_t. Use ptrdiff_t for index, not int.
16024 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16025 possibility of integer overflow.
16026
16027 Overflow, signedness and related fixes for images.
16028
16029 * dispextern.h (struct it.stack[0].u.image.image_id)
16030 (struct_it.image_id, struct image.id, struct image_cache.size)
16031 (struct image_cache.used, struct image_cache.ref_count):
16032 * gtkutil.c (update_frame_tool_bar):
16033 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16034 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16035 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16036 * nsmenu.m (update_frame_tool_bar):
16037 * xdisp.c (calc_pixel_width_or_height):
16038 * xfns.c (image_cache_refcount):
16039 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16040 on typical 64-bit hosts.
16041
16042 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16043 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16044 Omit unnecessary casts to int.
16045 (parse_image_spec): Check that integers fall into 'int' range
16046 when the callers expect that.
16047 (image_ascent): Redo ascent calculation to avoid int overflow.
16048 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16049 (lookup_image): Remove unnecessary tests.
16050 (xbm_image_p): Locals are now of int, not EMACS_INT,
16051 since parse_image_check makes sure they fit into int.
16052 (png_load, gif_load, svg_load_image):
16053 Prefer int to unsigned where either will do.
16054 (tiff_handler): New function, combining the cores of the
16055 old tiff_error_handler and tiff_warning_handler.
16056 This function is rewritten to use vsnprintf and thereby avoid
16057 stack buffer overflows. It uses only the features of vsnprintf
16058 that are common to both POSIX and native Microsoft.
16059 (tiff_error_handler, tiff_warning_handler): Use it.
16060 (tiff_load, gif_load, imagemagick_load_image):
16061 Don't assume :index value fits in 'int'.
16062 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16063 (imagemagick_load_image): Check that crop parameters fit into
16064 the integer types that MagickCropImage accepts. Don't assume
16065 Vimagemagick_render_type has a nonnegative value. Don't assume
16066 size_t fits in 'long'.
16067 (gs_load): Use printmax_t to print the widest integers possible.
16068 Check for integer overflow when computing image height and width.
16069
16070 2011-08-26 Eli Zaretskii <eliz@gnu.org>
16071
16072 * xdisp.c (redisplay_window): Don't force window start if point
16073 will be invisible in the resulting window. (Bug#9324)
16074
16075 2011-08-25 Eli Zaretskii <eliz@gnu.org>
16076
16077 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16078 the display spec is of the form `(space ...)'.
16079 (handle_display_spec): Return the value returned by
16080 handle_single_display_spec, not just 1 or zero.
16081 (handle_single_display_spec): If the display spec is of the form
16082 `(space ...)', and specifies display in the text area, return 2
16083 rather than 1.
16084 (try_cursor_movement): Check for the need to scroll more
16085 accurately, and prefer exact match for point under bidi.
16086 Don't advance `row' beyond the last row of the window.
16087
16088 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16089 into disp_prop; all users changed.
16090
16091 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16092 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16093 for the text covered by the display property.
16094
16095 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
16096
16097 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16098 Change return value to nil.
16099 (Frecord_buffer): Delete unused function.
16100
16101 2011-08-24 Eli Zaretskii <eliz@gnu.org>
16102
16103 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16104 buffers, return left-to-right.
16105 (set_cursor_from_row): Consider candidate row a win if its glyph
16106 represents a newline and point is on that newline. Fixes cursor
16107 positioning on the newline at EOL of R2L text within L2R
16108 paragraph, and vice versa.
16109 (try_cursor_movement): Check continued rows, in addition to
16110 continuation rows. Fixes unwarranted scroll when point enters a
16111 continued line of R2L text within an L2R paragraph, or vice versa.
16112 (cursor_row_p): Consider the case of point being equal to
16113 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16114 from the end of a short line to the beginning of a continued line
16115 of R2L text within L2R paragraph.
16116 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16117 composed characters.
16118
16119 * bidi.c (bidi_check_type): Use xassert.
16120 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16121 members.
16122
16123 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16124
16125 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16126 a character.
16127
16128 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
16129
16130 * nsfont.m (ns_otf_to_script): Fix typo.
16131
16132 2011-08-22 Kenichi Handa <handa@m17n.org>
16133
16134 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16135 extra slot even if the purpose is char-code-property-table.
16136
16137 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16138
16139 * xdisp.c (redisplay_window): When computing centering_position,
16140 account for the height of the header line. (Bug#8874)
16141
16142 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16143 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16144 candidate is selected by the mouse, and that candidate has a
16145 composed character under the mouse.
16146
16147 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16148 coordinates reported by pos-visible-in-window-p for a composed
16149 character in column zero.
16150
16151 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16152
16153 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16154
16155 2011-08-22 Eli Zaretskii <eliz@gnu.org>
16156
16157 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16158 consider it a hit if to_charpos is anywhere in the range of the
16159 composed buffer positions.
16160
16161 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
16162
16163 * image.c (gif_load): Don't assume that each subimage has the same
16164 dimensions as the base image. Handle disposal method that is
16165 "undefined" by the gif spec (Bug#9335).
16166
16167 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
16168
16169 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
16170 (Fcondition_case): Document `debug' symbol in error handler.
16171
16172 2011-08-19 Eli Zaretskii <eliz@gnu.org>
16173
16174 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16175 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16176 from an Org mode buffer to a Speedbar frame.
16177
16178 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16179 a composition, take its buffer position from IT->cmp_it.charpos.
16180 Fixes cursor positioning at the beginning of a line that begins
16181 with a composed character.
16182
16183 2011-08-18 Eli Zaretskii <eliz@gnu.org>
16184
16185 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16186 character bidirectional type, use STRONG_L instead. Fixes crashes
16187 in a buffer produced by `describe-categories'.
16188
16189 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16190 members before the level stack, so they would be saved and
16191 restored when copying iterator state. Fixes incorrect reordering
16192 around TABs covered by display properties.
16193
16194 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16195
16196 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16197
16198 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
16199
16200 * eval.c (internal_condition_case, internal_condition_case_1)
16201 (internal_condition_case_2, internal_condition_case_n):
16202 Remove unnecessary aborts (Bug#9081).
16203
16204 2011-08-17 Eli Zaretskii <eliz@gnu.org>
16205
16206 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16207 has no `load' handler, try opening the file locally. (Bug#9311)
16208
16209 2011-08-16 Ken Brown <kbrown@cornell.edu>
16210
16211 * gmalloc.c: Expand comment.
16212
16213 2011-08-16 Eli Zaretskii <eliz@gnu.org>
16214
16215 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16216 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16217
16218 2011-08-16 Ken Brown <kbrown@cornell.edu>
16219
16220 Fix memory allocation problems in Cygwin build (Bug#9273).
16221
16222 * unexcw.c ( __malloc_initialized): Declare external variable.
16223 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16224
16225 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16226 New variables.
16227 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16228 dumped emacs.
16229 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16230 in the static heap.
16231 [CYGWIN] (special_realloc): New function.
16232 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16233 requests to realloc storage in the static heap.
16234
16235 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16236
16237 * bidi.c (bidi_initialize): Remove unused local.
16238
16239 2011-08-15 Eli Zaretskii <eliz@gnu.org>
16240
16241 * bidimirror.h:
16242 * biditype.h: Remove file.
16243 * makefile.w32-in ($(BLD)/bidi.$(O)):
16244 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16245
16246 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16247
16248 * chartab.c: Improve commentary for the uniprop_table API.
16249
16250 * bidi.c (bidi_paragraph_init): Support zero value of
16251 bidi_ignore_explicit_marks_for_paragraph_level.
16252 (bidi_initialize): Use uniprop_table instead of including
16253 biditype.h and bidimirror.h.
16254
16255 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16256 coordinates of the iterator when restoring from ppos_it.
16257 (Bug#9296)
16258
16259 2011-08-14 Kenichi Handa <handa@m17n.org>
16260
16261 * process.c (create_process): Call setup_process_coding_systems
16262 after the pid of the process is set to -1 (Bug#8162).
16263
16264 2011-08-14 Eli Zaretskii <eliz@gnu.org>
16265
16266 * xdisp.c (move_it_in_display_line_to): Don't invoke
16267 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16268 ppos_it. Fixes vertical cursor motion when line beginning is
16269 covered by an image. (Bug#9296)
16270
16271 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16272
16273 * nsterm.h (ns_run_ascript): Declare.
16274 (NSAPP_DATA2_RUNASSCRIPT): Define.
16275
16276 * nsfns.m (as_script, as_result, as_status): New static variables.
16277 (ns_run_ascript): New function.
16278 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
16279 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16280 the event loop. Get status from as_status (Bug#7276).
16281
16282 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16283 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16284 the event loop (Bug#7276).
16285
16286 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16287
16288 * gnutls.c (QCgnutls_bootprop_priority)
16289 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16290 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16291 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16292 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16293 (QCgnutls_bootprop_verify_hostname_error)
16294 (QCgnutls_bootprop_callbacks_verify): Rename from
16295 Qgnutls_bootprop_..., all uses changed.
16296
16297 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16298 uses changed.
16299
16300 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16301
16302 * xfaces.c (Qframe_set_background_mode): Now static.
16303 * dispextern.h (Qframe_set_background_mode): Remove decl.
16304
16305 * process.c (Fnetwork_interface_info): Declare local only if needed.
16306
16307 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16308
16309 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16310 (Fnetwork_interface_list): Allocate in increments of bytes instead
16311 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16312 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16313 sockaddr.
16314 (struct ifflag_def): notrailers is smart on OSX.
16315 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16316 Get hardware address with getifaddrs if available.
16317
16318 2011-08-12 Eli Zaretskii <eliz@gnu.org>
16319
16320 * xdisp.c (iterate_out_of_display_property): xassert that
16321 IT->position is set to within IT->object's boundaries. Break from
16322 the loop as soon as EOB is reached; avoids infloops in redisplay
16323 when IT->position is set up wrongly due to some bug.
16324 Set IT->current to match the bidi iterator unconditionally.
16325 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16326 entry. Force push_it to save on the stack the current
16327 buffer/string position, to be restored by pop_it. Fix flags in
16328 the iterator structure wrt the object coming from a display
16329 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16330 properties. (Bug#9284)
16331
16332 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
16333
16334 * fontset.c (fontset_get_font_group): Add proper type checks.
16335 (Bug#9172)
16336
16337 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16338
16339 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16340 and LC_VERSION_MIN_MACOSX.
16341 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16342 (dump_it) [LC_FUNCTION_STARTS]: Use it.
16343
16344 2011-08-08 Eli Zaretskii <eliz@gnu.org>
16345
16346 * xdisp.c (forward_to_next_line_start): Allow to use the
16347 no-display-properties-and-no-overlays under bidi display.
16348 Set disp_pos in the bidi iterator to avoid searches for display
16349 properties and overlays.
16350
16351 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
16352
16353 * editfns.c (Fset_time_zone_rule): Document relationship with the
16354 setenv function.
16355
16356 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16357 the font entity extracted from the cache (Bug#8109).
16358
16359 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
16360
16361 * composite.c (autocmp_chars): Don't reset point. That is done by
16362 restore_point_unwind (Bug#5984).
16363
16364 2011-08-07 Juri Linkov <juri@jurta.org>
16365
16366 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16367 to show the arg `TIME' instead of `TIMEVAL'.
16368
16369 2011-08-06 Eli Zaretskii <eliz@gnu.org>
16370
16371 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16372 display property strides EOL and includes a newline, as in
16373 longlines-mode. (Bug#9254)
16374 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16375 word-wrap under bidirectional display. (Bug#9224)
16376
16377 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16378 is non-zero, even if the data buffer is NULL. Fixes a crash in
16379 vertical-motion with longlines-mode. (Bug#9254)
16380
16381 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16382
16383 * bidi.c <bidi_cache_total_alloc>: Now static.
16384 (bidi_initialize): Initialize bidi_cache_total_alloc.
16385
16386 * xdisp.c (display_line): Release buffer allocated for shelved bidi
16387 cache. (Bug#9221)
16388
16389 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16390 amount allocated this far in `bidi_cache_total_alloc'.
16391 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16392 non-zero, only free the data buffer without restoring the cache
16393 contents. All callers changed.
16394
16395 * dispextern.h (bidi_unshelve_cache): Update prototype.
16396
16397 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16398 (move_it_in_display_line, move_it_to)
16399 (move_it_vertically_backward, move_it_by_lines): Replace the call
16400 to xfree to an equivalent call to bidi_unshelve_cache.
16401 (move_it_in_display_line_to): Fix logic of returning
16402 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
16403
16404 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16405
16406 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16407 came from a string character with a `cursor' property. (Bug#9229)
16408
16409 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16410
16411 * Makefile.in (LIB_PTHREAD): New variable.
16412 (LIBES): Add LIB_PTHREAD (Bug#9216).
16413
16414 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16415 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16416
16417 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16418
16419 * regex.c (re_iswctype): Remove some redundant boolean conversions.
16420
16421 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16422
16423 * xterm.c (x_find_topmost_parent): New function.
16424 (x_set_frame_alpha): Find topmost parent window with
16425 x_find_topmost_parent and set the property there also (bug#9181).
16426 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16427
16428 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16429
16430 * callproc.c (Fcall_process): Avoid vfork clobbering
16431 the local vars buffer, coding_systems, current_dir.
16432
16433 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16434
16435 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16436
16437 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16438
16439 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16440 so that it is not optimized away.
16441
16442 * xdisp.c (compute_display_string_pos): Remove unused local.
16443
16444 2011-08-02 Eli Zaretskii <eliz@gnu.org>
16445
16446 Fix slow cursor motion and scrolling in large buffers with
16447 selective display, like Org Mode buffers. (Bug#9218)
16448
16449 * dispextern.h (struct bidi_it): New member disp_prop_p.
16450
16451 * xdisp.c: Remove one-slot cache of display string positions.
16452 (compute_display_string_pos): Accept an additional argument
16453 DISP_PROP_P; callers changed. Scan at most 5K characters forward
16454 for a display string or property. If found, set DISP_PROP_P
16455 non-zero.
16456
16457 * bidi.c (bidi_fetch_char): Accept an additional argument
16458 DISP_PROP_P, and pass it to compute_display_string_pos.
16459 Only handle text covered by a display string if DISP_PROP_P is returned
16460 non-zero. All callers of bidi_fetch_char changed.
16461
16462 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16463
16464 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16465
16466 2010-12-03 Don March <don@ohspite.net>
16467
16468 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16469 last character M-[char] is translated to ESC [char] (bug#7541).
16470
16471 2011-08-02 Kenichi Handa <handa@m17n.org>
16472
16473 * lisp.h (uniprop_table): Extern it.
16474
16475 * chartab.c (uniprop_table): Make it non-static.
16476
16477 2011-08-01 Eli Zaretskii <eliz@gnu.org>
16478
16479 * xdisp.c (forward_to_next_line_start): Accept additional argument
16480 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16481 on the newline.
16482 (reseat_at_next_visible_line_start): Use the bidi iterator state
16483 returned by forward_to_next_line_start to restore the state of
16484 it->bidi_it after backing up to previous newline. (Bug#9212)
16485
16486 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16487
16488 * regex.c (re_comp): Protoize.
16489 (re_exec): Fix return type.
16490 (regexec): Fix type of `ret'. (Bug#9203)
16491
16492 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16493
16494 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16495 This is needed if max-image-size is a floating-point number.
16496
16497 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16498
16499 * print.c (print_object): Print empty symbol as ##.
16500
16501 * lread.c (read1): Read ## as empty symbol.
16502
16503 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16504
16505 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16506 setting frame foreground color (Bug#9175).
16507 (x_set_background_color): Likewise.
16508
16509 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16510 contents (Bug#9176).
16511 (EmacsTooltip -init): Remove bezels and add shadows to
16512 tooltip windows.
16513
16514 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16515 or scroll bar (Bug#8470).
16516
16517 * nsfont.m (nsfont_open): Remove assignment to voffset and
16518 unnecessary vars hshink, expand, hd, full_height, min_height.
16519 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16520
16521 * nsterm.h (nsfont_info): Remove voffset field.
16522
16523 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16524
16525 Implement strike-through and overline on NextStep (Bug#8863).
16526
16527 * nsfont.m (nsfont_open): Use underline position provided by font,
16528 instead of hard-coded value of 2.
16529 (nsfont_draw): Call ns_draw_text_decoration instead.
16530
16531 * nsterm.h: Add declaration for ns_draw_text_decoration.
16532
16533 * nsterm.m (ns_draw_text_decoration): New function for drawing
16534 underline, overline, and strike-through.
16535 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16536 ns_draw_text_decoration. Change treatment of cursor drawing to
16537 accommodate underlining, etc.
16538
16539 2011-07-28 Eli Zaretskii <eliz@gnu.org>
16540
16541 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16542 default.
16543
16544 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16545
16546 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16547 Without this fix, if a signal arrives just after memory fills up,
16548 'malloc' might be invoked reentrantly.
16549
16550 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16551 In other words, assume that every image size is allowed, on non-X
16552 hosts. This assumption is probably wrong, but it lets Emacs compile.
16553
16554 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16555
16556 * regex.c (re_iswctype): Convert return values to boolean.
16557
16558 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16559
16560 * xdisp.c (compute_display_string_pos): Don't use cached display
16561 string position if the buffer had its restriction changed.
16562 (Bug#9184)
16563
16564 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16565
16566 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16567
16568 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16569
16570 Integer signedness and overflow and related fixes. (Bug#9079)
16571
16572 * bidi.c: Integer size and overflow fixes.
16573 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16574 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16575 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16576 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16577 (bidi_find_other_level_edge):
16578 Use ptrdiff_t instead of EMACS_INT where either will do.
16579 This works better on 32-bit hosts configured --with-wide-int.
16580 (bidi_cache_ensure_space): Check for size-calculation overflow.
16581 Use % rather than repeated addition, for better worst-case speed.
16582 Don't set bidi_cache_size until after xrealloc returns, because it
16583 might not return.
16584 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
16585 (bidi_cache_ensure_space): Also check that the bidi cache size
16586 does not exceed that of the largest Lisp string or buffer. See Eli
16587 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
16588
16589 * alloc.c (__malloc_size_t): Remove.
16590 All uses replaced by size_t. See Andreas Schwab's note
16591 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16592
16593 * image.c: Improve checking for integer overflow.
16594 (check_image_size): Assume that f is nonnull, since
16595 it is always nonnull in practice. This is one less thing to
16596 worry about when checking for integer overflow later.
16597 (x_check_image_size): New function, which checks for integer
16598 overflow issues inside X.
16599 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16600 This removes the need for a memory_full check.
16601 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16602 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16603 (xbm_read_bitmap_data): Change locals back to 'int', since
16604 their values must fit in 'int'.
16605 (xpm_load_image, png_load, tiff_load):
16606 Invoke x_create_x_image_and_pixmap earlier,
16607 to avoid much needless work if the image is too large.
16608 (tiff_load): Treat overly large images as if
16609 x_create_x_image_and_pixmap failed, not as malloc failures.
16610 (gs_load): Use x_check_image_size.
16611
16612 * gtkutil.c: Omit integer casts.
16613 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16614 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16615
16616 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16617
16618 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16619 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16620 would wrongly return t on a 64-bit host.
16621
16622 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16623 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16624 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16625 and therefore cause GCC to emit a bogus diagnostic in some cases.
16626
16627 * image.c: Integer signedness and overflow and related fixes.
16628 This is not an exhaustive set of fixes, but it's time to
16629 record what I've got.
16630 (lookup_pixel_color, check_image_size): Remove redundant decls.
16631 (check_image_size): Don't assume that arbitrary EMACS_INT values
16632 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16633 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16634 (tiff_load, imagemagick_load_image):
16635 Check for overflow in size calculations.
16636 (x_create_x_image_and_pixmap): Remove unnecessary test for
16637 xmalloc returning NULL; that can't happen.
16638 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16639 (xpm_color_bucket): Use better integer hashing function.
16640 (xpm_cache_color): Don't possibly over-allocate memory.
16641 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16642 (gif_memory_source):
16643 Use ptrdiff_t, not int or size_t, to record sizes.
16644 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16645 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16646 either works, as we prefer signed integers.
16647 (tiff_read_from_memory, tiff_write_from_memory):
16648 Return tsize_t, not size_t, since that's what the TIFF API wants.
16649 (tiff_read_from_memory): Don't fail simply because the read would
16650 go past EOF; instead, return a short read.
16651 (tiff_load): Omit no-longer-needed casts.
16652 (Fimagemagick_types): Don't assume size fits into 'int'.
16653
16654 Improve hashing quality when configured --with-wide-int.
16655 * fns.c (hash_string): New function, taken from sxhash_string.
16656 Do not discard information about ASCII character case; this
16657 discarding is no longer needed.
16658 (sxhash-string): Use it. Change sig to match it. Caller changed.
16659 * lisp.h: Declare it.
16660 * lread.c (hash_string): Remove, since we now use fns.c's version.
16661 The fns.c version returns a wider integer if --with-wide-int is
16662 specified, so this should help the quality of the hashing a bit.
16663
16664 * emacs.c: Integer overflow minor fix.
16665 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16666 Define only if GNU_LINUX.
16667 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16668
16669 * dispnew.c: Integer signedness and overflow fixes.
16670 Remove unnecessary forward decls, that were a maintenance hassle.
16671 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16672 All uses changed.
16673 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16674 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16675 (prepare_desired_row, line_draw_cost):
16676 Use int, not unsigned, where either works.
16677 (save_current_matrix, restore_current_matrix):
16678 Use ptrdiff_t, not size_t, where either works.
16679 (init_display): Check for overflow more accurately, and without
16680 relying on undefined behavior.
16681
16682 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16683 Remove, replacing with the new symbols in lisp.h. All uses changed.
16684 * fileio.c (make_temp_name):
16685 * filelock.c (lock_file_1, lock_file):
16686 * xdisp.c (message_dolog):
16687 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16688 Use pMd etc. instead.
16689 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16690 replacing the pWIDE etc. symbols removed from editfns.c.
16691
16692 * keyboard.h (num_input_events): Now uintmax_t.
16693 This is (very slightly) less likely to mess up due to wraparound.
16694 All uses changed.
16695
16696 * buffer.c: Integer signedness fixes.
16697 (alloc_buffer_text, enlarge_buffer_text):
16698 Use ptrdiff_t rather than size_t when either will do, as we prefer
16699 signed integers.
16700
16701 * alloc.c: Integer signedness and overflow fixes.
16702 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16703 (__malloc_size_t): Default to size_t, not to int.
16704 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16705 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16706 Prefer ptrdiff_t to size_t when either would do, as we prefer
16707 signed integers.
16708 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16709 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16710 Now const. Initialize with values that are in range even if char
16711 is signed.
16712 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16713 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16714 These functions do the right thing with sizes > 2**32.
16715 (check_depth): Now ptrdiff_t, not int.
16716 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16717 Adjust to new way of storing sizes. Check for size overflow bugs
16718 in rest of code.
16719 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16720 slightly wrong anyway, as it missed one instance of
16721 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16722 (refill_memory_reserve): Omit needless cast to size_t.
16723 (mark_object_loop_halt): Mark as externally visible.
16724
16725 * xselect.c: Integer signedness and overflow fixes.
16726 (Fx_register_dnd_atom, x_handle_dnd_message):
16727 Use ptrdiff_t, not size_t, since we prefer signed.
16728 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16729 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16730 x_dnd_atoms_size and x_dnd_atoms_length.
16731
16732 * doprnt.c: Prefer signed to unsigned when either works.
16733 * eval.c (verror):
16734 * doprnt.c (doprnt):
16735 * lisp.h (doprnt):
16736 * xdisp.c (vmessage):
16737 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16738 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16739 prefer signed arithmetic to avoid comparison confusion.
16740 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16741 but is a bit tricky.
16742
16743 Assume freestanding C89 headers, string.h, stdlib.h.
16744 * data.c, doprnt.c, floatfns.c, print.c:
16745 Include float.h unconditionally.
16746 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16747 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16748 * regex.c: Likewise for stddef.h, string.h.
16749 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16750 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16751 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16752 (STDC_HEADERS): Remove obsolete defines.
16753 * sysdep.c: Include limits.h unconditionally.
16754
16755 Assume support for memcmp, memcpy, memmove, memset.
16756 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16757 * regex.c (memcmp, memcpy):
16758 Remove; we assume C89 now.
16759
16760 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16761 (__malloc_safe_bcopy): Remove; no longer needed.
16762
16763 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
16764 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16765 well either way, and we prefer signed to unsigned.
16766
16767 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16768
16769 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16770 closes the connection while we're reading (bug#9182).
16771
16772 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
16773
16774 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16775 are specified (Bug#9168).
16776
16777 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16778
16779 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16780 Found by GCC static checking and --with-wide-int on a 32-bit host.
16781
16782 2011-07-25 Eli Zaretskii <eliz@gnu.org>
16783
16784 * xdisp.c (compute_display_string_pos): Fix logic of caching
16785 previous display string position. Initialize cached_prev_pos to
16786 -1. Fixes slow-down at the beginning of a buffer.
16787
16788 2011-07-24 Eli Zaretskii <eliz@gnu.org>
16789
16790 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16791 for attrs[LFACE_FONTSET_INDEX].
16792
16793 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16794
16795 * xml.c (parse_region): Remove unused local
16796 that was recently introduced.
16797
16798 2011-07-23 Eli Zaretskii <eliz@gnu.org>
16799
16800 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16801 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16802
16803 * xdisp.c (move_it_in_display_line_to): Record the best matching
16804 position for TO_CHARPOS while scanning the line, and restore it on
16805 exit if none of the characters scanned was an exact match.
16806 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
16807 when exact match is impossible due to invisible text, and the
16808 lines are truncated.
16809
16810 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16811
16812 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16813 for OSX >= 10.7.
16814
16815 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16816
16817 Fix a significant slow-down of cursor motion with C-n, C-p,
16818 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16819 auto-repeat under bidi redisplay in fontified buffers.
16820 * xdisp.c (compute_stop_pos_backwards): New function.
16821 (next_element_from_buffer): Call compute_stop_pos_backwards to
16822 find a suitable prev_stop when we find ourselves before
16823 base_level_stop.
16824 (reseat): Don't look for prev_stop, as that could mean a very long
16825 run.
16826 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16827 <cached_disp_overlay_modiff>: Cache for last found display string
16828 position.
16829 (compute_display_string_pos): Return the cached position if asked
16830 about the same buffer in the same area of character positions, and
16831 the buffer wasn't changed since the time the display string
16832 position was cached.
16833
16834 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16835
16836 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16837 is an integer, which is important for empty lines. (Bug#9149)
16838
16839 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
16840
16841 * frame.c (Fmodify_frame_parameters): In tty case, update the
16842 default face if necessary (Bug#4238).
16843
16844 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
16845
16846 * editfns.c (Fstring_to_char): No need to explain what a character
16847 is in the docstring (Bug#6576).
16848
16849 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16850
16851 * xml.c (parse_region): Make sure we always return a tree.
16852
16853 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16854
16855 * xml.c (parse_region): If a document contains only comments,
16856 return that, too.
16857
16858 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16859
16860 * xml.c (make_dom): Return comments, too.
16861
16862 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16863
16864 Port to OpenBSD.
16865 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16866 and the surrounding thread.
16867 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16868 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16869 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16870 timer goes off.
16871 * s/openbsd.h (BROKEN_SIGIO): Define.
16872 * unexelf.c (unexec) [__OpenBSD__]:
16873 Don't update the .mdebug section of the Alpha COFF symbol table.
16874
16875 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16876
16877 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16878 (bug#8460).
16879
16880 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16881
16882 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16883 This fixes some race conditions on the permissions of any newly
16884 created file.
16885
16886 * alloc.c (valid_pointer_p): Use pipe, not open.
16887 This fixes some permissions issues when debugging.
16888
16889 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16890 If fchown fails to set both uid and gid, try to set just gid,
16891 as that is sometimes allowed. Adjust the file's mode to eliminate
16892 setuid or setgid bits that are inappropriate if fchown fails.
16893
16894 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16895
16896 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16897 to compare Lisp_Objects.
16898 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16899 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16900 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16901
16902 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16903
16904 * lread.c (read_integer): Unread even EOF character.
16905 (read1): Likewise. Properly record start position of symbol.
16906
16907 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16908 symbol character follows.
16909
16910 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16911
16912 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16913 This works around a problem with the previous change to Fcopy_file.
16914 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16915 and without this change, GCC might complain about discarding
16916 fchown's return value.
16917
16918 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
16919
16920 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16921
16922 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16923
16924 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16925
16926 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16927
16928 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16929 it's used from the C level.
16930
16931 * process.c: Use the same condition for POLL_FOR_INPUT in both
16932 keyboard.c and process.c (bug#1858).
16933
16934 2011-07-09 Lawrence Mitchell <wence@gmx.li>
16935
16936 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16937 (Fgnutls_boot): Use it.
16938
16939 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16940
16941 * doc.c (Fsubstitute_command_keys): Revert last change.
16942
16943 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16944
16945 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16946 quotes the next character, and doesn't affect other longer
16947 sequences (bug#8935).
16948
16949 * lread.c (syms_of_lread): Clarify that is isn't only
16950 `eval-buffer' and `eval-defun' that's affected by
16951 `lexical-binding' (bug#8460).
16952
16953 2011-07-15 Eli Zaretskii <eliz@gnu.org>
16954
16955 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
16956 bidi redisplay when a line includes both an image and is truncated.
16957
16958 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16959
16960 Fix minor problems found by static checking.
16961 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16962 (elsz): Now a signed constant, not a size_t var. We prefer signed
16963 types to unsigned, to avoid integer comparison confusion. Without
16964 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16965 "cannot optimize loop, the loop counter may overflow", a symptom
16966 of the confusion.
16967 * indent.c (Fvertical_motion): Mark locals as initialized.
16968 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16969
16970 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16971
16972 * search.c (Fre_search_backward): Mention `case-fold-search' in
16973 all the re_search_* functions (bug#8138).
16974
16975 * keyboard.c (Fopen_dribble_file): Document when the file is
16976 closed (bug#8056).
16977
16978 2011-07-14 Eli Zaretskii <eliz@gnu.org>
16979
16980 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16981 bidi_cache_idx.
16982
16983 Support bidi reordering of display and overlay strings.
16984 * xdisp.c (compute_display_string_pos)
16985 (compute_display_string_end): Accept additional argument STRING.
16986 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16987 (reseat_to_string): Initialize bidi_it->string.s and
16988 bidi_it->string.schars.
16989 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
16990 NULL (avoids a crash in bidi_paragraph_init).
16991 Initialize itb.string.lstring.
16992 (init_iterator): Call bidi_init_it only of a valid
16993 buffer position was specified. Initialize paragraph_embedding to
16994 L2R.
16995 (reseat_to_string): Initialize the bidi iterator.
16996 (display_string): If we need to ignore text properties of
16997 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16998 original value of -1 will not work with bidi.)
16999 (compute_display_string_pos): First arg is now struct
17000 `text_pos *'; all callers changed. Support display properties on
17001 Lisp strings.
17002 (compute_display_string_end): Support display properties on Lisp
17003 strings.
17004 (init_iterator, reseat_1, reseat_to_string): Initialize the
17005 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17006 when iterating on a string not from display properties).
17007 (compute_display_string_pos, compute_display_string_end):
17008 Fix calculation of the object to scan. Fixes an error when using
17009 arrow keys.
17010 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17011 base_level_stop; instead, set base_level_stop to BEGV.
17012 Fixes crashes in vertical-motion.
17013 (next_element_from_buffer): Improve commentary for when
17014 the iterator is before prev_stop.
17015 (init_iterator): Initialize bidi_p from the default value of
17016 bidi-display-reordering, not from buffer-local value. Use the
17017 buffer-local value only if initializing for buffer iteration.
17018 (handle_invisible_prop): Support invisible properties on strings
17019 that are being bidi-reordered.
17020 (set_iterator_to_next): Support bidi reordering of C strings and
17021 Lisp strings.
17022 (next_element_from_string): Support bidi reordering of Lisp
17023 strings.
17024 (handle_stop_backwards): Support Lisp strings as well.
17025 (display_string): Support display of R2L glyph rows.
17026 Use IT_STRING_CHARPOS when displaying from a Lisp string.
17027 (init_iterator): Don't initialize it->bidi_p for strings
17028 here.
17029 (reseat_to_string): Initialize it->bidi_p for strings here.
17030 (next_element_from_string, next_element_from_c_string)
17031 (next_element_from_buffer): Add xassert's for correspondence
17032 between IT's object being iterated and it->bidi_it.string
17033 structure.
17034 (face_before_or_after_it_pos): Support bidi iteration.
17035 (next_element_from_c_string): Handle the case of the first string
17036 character that is not the first one in the visual order.
17037 (get_visually_first_element): New function, refactored from common
17038 parts of next_element_from_buffer, next_element_from_string, and
17039 next_element_from_c_string.
17040 (tool_bar_lines_needed, redisplay_tool_bar)
17041 (display_menu_bar): Force left-to-right direction. Add a FIXME
17042 comment for making that be controlled by a user option.
17043 (push_it, pop_it): Save and restore the state of the
17044 bidi iterator. Save and restore the bidi_p flag.
17045 (pop_it): Iterate out of display property for string iteration as
17046 well.
17047 (iterate_out_of_display_property): Support iteration over strings.
17048 (handle_single_display_spec): Set up it->bidi_it for iteration
17049 over a display string, and call bidi_init_it.
17050 (handle_single_display_spec, next_overlay_string)
17051 (get_overlay_strings_1, push_display_prop): Set up the bidi
17052 iterator for displaying display or overlay strings.
17053 (forward_to_next_line_start): Don't use the shortcut if
17054 bidi-iterating.
17055 (back_to_previous_visible_line_start): If handle_display_prop
17056 pushed the iterator stack, restore the internal state of the bidi
17057 iterator by calling bidi_pop_it same number of times.
17058 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17059 and we are bidi-iterating, don't decrement the iterator position;
17060 instead, set the first_elt flag in the bidi iterator, to produce
17061 the same effect.
17062 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17063 (push_display_prop): xassert that we are iterating a buffer.
17064 (push_it, pop_it): Save and restore paragraph_embedding member.
17065 (handle_single_display_spec, next_overlay_string)
17066 (get_overlay_strings_1, reseat_1, reseat_to_string)
17067 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17068 correctly. Don't assume unibyte strings are not bidi-reordered.
17069 (compute_display_string_pos)
17070 (compute_display_string_end): Fix handling the case of C string.
17071 (push_it, pop_it): Save and restore from_disp_prop_p.
17072 (handle_single_display_spec, push_display_prop): Set the
17073 from_disp_prop_p flag.
17074 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17075 (pop_it): Call iterate_out_of_display_property only if we are
17076 popping after iteration over a string that came from a display
17077 property. Fix a typo in popping stretch info. Add an assertion
17078 for verifying that the iterator position is in sync with the bidi
17079 iterator.
17080 (handle_single_display_spec, get_overlay_strings_1)
17081 (push_display_prop): Fix initialization of paragraph direction for
17082 string when that of the parent object is not yet determined.
17083 (reseat_1): Call bidi_init_it to resync the bidi
17084 iterator with IT's position. (Bug#7616)
17085 (find_row_edges): If ROW->start.pos gives position
17086 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17087 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17088 Reset the from_disp_prop_p flag.
17089 (SAVE_IT, RESTORE_IT): New macros.
17090 (pos_visible_p, face_before_or_after_it_pos)
17091 (back_to_previous_visible_line_start)
17092 (move_it_in_display_line_to, move_it_in_display_line)
17093 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17094 (try_scrolling, redisplay_window, display_line): Use them when
17095 saving a temporary copy of the iterator and restoring it back.
17096 (back_to_previous_visible_line_start, reseat_1)
17097 (init_iterator): Empty the bidi cache "stack".
17098 (move_it_in_display_line_to): If iterator ended up at
17099 EOL, but we never saw any buffer positions smaller than
17100 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17101 motion in bidi-reordered lines.
17102 (move_it_in_display_line_to): Record prev_method and prev_pos
17103 immediately before the call to set_iterator_to_next. Fixes cursor
17104 motion in bidi-reordered lines with stretch glyphs and strings
17105 displayed in margins. (Bug#8133) (Bug#8867)
17106 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17107 TO_CHARPOS.
17108 (pos_visible_p): Support positions in bidi-reordered lines.
17109 Save and restore bidi cache.
17110
17111 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17112 (bidi_paragraph_info): Delete unused struct.
17113 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17114 (bidi_cache_start): New variable.
17115 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17116 to zero.
17117 (bidi_cache_fetch_state, bidi_cache_search)
17118 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17119 (bidi_cache_find, bidi_peek_at_next_level)
17120 (bidi_level_of_next_char, bidi_find_other_level_edge)
17121 (bidi_move_to_visually_next): Compare cache index with
17122 bidi_cache_start rather than with zero.
17123 (bidi_fetch_char): Accept new argument STRING; all callers
17124 changed. Support iteration over a string. Support strings with
17125 display properties. Support unibyte strings. Fix the type of
17126 `len' according to what STRING_CHAR_AND_LENGTH expects.
17127 (bidi_paragraph_init, bidi_resolve_explicit_1)
17128 (bidi_resolve_explicit, bidi_resolve_weak)
17129 (bidi_level_of_next_char, bidi_move_to_visually_next):
17130 Support iteration over a string.
17131 (bidi_set_sor_type, bidi_resolve_explicit_1)
17132 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17133 can now be zero (for strings); special values 0 and -1 were
17134 changed to -1 and -2, respectively.
17135 (bidi_char_at_pos): New function.
17136 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17137 Call it instead of FETCH_MULTIBYTE_CHAR.
17138 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17139 initialized to valid values.
17140 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17141 values.
17142 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17143 the test for valid cached positions. Fix the logic for looking up
17144 the sentinel state in the cache. GCPRO the Lisp string we are
17145 iterating.
17146 (bidi_push_it, bidi_pop_it): New functions.
17147 (bidi_initialize): Initialize the bidi cache start stack pointer.
17148 (bidi_cache_ensure_space): New function, refactored from part of
17149 bidi_cache_iterator_state. Don't assume the required size is just
17150 one BIDI_CACHE_CHUNK away.
17151 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17152 (bidi_count_bytes, bidi_char_at_pos): New functions.
17153 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17154 always valid if bidi_cache_idx is valid.
17155 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17156 is valid if it's going to be used.
17157 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17158 (bidi_cache_fetch_state, bidi_cache_search)
17159 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17160 (bidi_cache_iterator_state, bidi_cache_find)
17161 (bidi_find_other_level_edge, bidi_cache_start_stack):
17162 All variables related to cache indices are now EMACS_INT.
17163
17164 * dispextern.h (struct bidi_string_data): New structure.
17165 (struct bidi_it): New member `string'. Make flag members be 1-bit
17166 fields, and put them last in the struct.
17167 (compute_display_string_pos, compute_display_string_end):
17168 Update prototypes.
17169 (bidi_push_it, bidi_pop_it): Add prototypes.
17170 (struct iterator_stack_entry): New members bidi_p,
17171 paragraph_embedding, and from_disp_prop_p.
17172 (struct it): Member bidi_p is now a bit field 1 bit wide.
17173 (bidi_shelve_cache, bidi_unshelve_cache):
17174 Declare prototypes.
17175
17176 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17177 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17178 and vector-like objects.
17179
17180 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17181 cache around display iteration.
17182
17183 * window.c (Fwindow_end, window_scroll_pixel_based)
17184 (displayed_window_lines, Frecenter): Save and restore the bidi
17185 cache around display iteration.
17186
17187 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17188
17189 * editfns.c (Fdelete_region): Clarify the use of the named
17190 parameters (bug#6788).
17191
17192 2011-07-14 Martin Rudalics <rudalics@gmx.at>
17193
17194 * indent.c (Fvertical_motion): Set and restore w->pointm when
17195 saving and restoring the window's buffer (Bug#9006).
17196
17197 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17198
17199 * editfns.c (Fstring_to_char): Clarify just what is returned
17200 (bug#6576). Text by Eli Zaretskii.
17201
17202 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
17203
17204 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17205
17206 2011-07-13 Eli Zaretskii <eliz@gnu.org>
17207
17208 * buffer.c (mmap_find): Fix a typo.
17209
17210 2011-07-13 Johan Bockgård <bojohan@gnu.org>
17211
17212 Fix execution of x selection hooks.
17213 * xselect.c (Qx_lost_selection_functions)
17214 (Qx_sent_selection_functions): New vars.
17215 (syms_of_xselect): DEFSYM them.
17216 (x_handle_selection_request): Pass Qx_sent_selection_functions
17217 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17218 (x_handle_selection_clear,x_clear_frame_selections):
17219 Pass Qx_lost_selection_functions rather than
17220 Vx_lost_selection_functions to Frun_hook_with_args.
17221
17222 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17223
17224 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17225 The old code sometimes used this field without initializing it.
17226
17227 * alloc.c (gc_sweep): Don't read past end of array.
17228 In theory, the old code could also have corrupted Emacs internals,
17229 though it'd be very unlikely.
17230
17231 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17232
17233 * character.c (Fcharacterp): Don't advertise optional ignored
17234 argument. (Bug#4026)
17235
17236 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17237
17238 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17239 key" (bug#4257).
17240
17241 * window.c (Fset_window_start): Doc fix (bug#4199).
17242 (Fset_window_hscroll): Ditto.
17243
17244 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17245
17246 Fix minor new problems caught by GCC 4.6.1.
17247 * term.c (init_tty): Remove unused local.
17248 * xsettings.c (store_monospaced_changed): Define this function only
17249 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17250 not used otherwise.
17251
17252 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
17253
17254 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17255
17256 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17257
17258 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17259 are the mini-buffer and the echo area (bug#3320).
17260
17261 * term.c (init_tty): Remove support for supdup, c10 and perq
17262 terminals, which are no longer supported (bug#1482).
17263
17264 2011-07-10 Johan Bockgård <bojohan@gnu.org>
17265
17266 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17267
17268 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17269
17270 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17271 for non-popups (Bug#3642).
17272
17273 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17274
17275 * alloc.c (reset_malloc_hooks): Protoize.
17276 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17277 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17278 * cm.c (losecursor): Likewise.
17279 * data.c (fmod): Likewise.
17280 * dispnew.c (swap_glyphs_in_rows): Likewise.
17281 * emacs.c (memory_warning_signal): Likewise.
17282 * floatfns.c (float_error): Likewise.
17283 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17284 (otf_open, font_otf_capability, generate_otf_features)
17285 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17286 Likewise.
17287 * image.c (pbm_read_file): Likewise.
17288 * indent.c (string_display_width): Likewise.
17289 * intervals.c (check_for_interval, search_for_interval)
17290 (inc_interval_count, count_intervals, root_interval)
17291 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17292 * lread.c (defalias): Likewise.
17293 * ralloc.c (r_alloc_check): Likewise.
17294 * regex.c (set_image_of_range_1, set_image_of_range)
17295 (regex_grow_registers): Likewise.
17296 * sysdep.c (strerror): Likewise.
17297 * termcap.c (valid_filename_p, tprint, main): Likewise.
17298 * tparam.c (main): Likewise.
17299 * unexhp9k800.c (run_time_remap, save_data_space)
17300 (update_file_ptrs, read_header, write_header, calculate_checksum)
17301 (copy_file, copy_rest, display_header): Likewise.
17302 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17303 Likewise.
17304 * xdisp.c (check_it): Likewise.
17305 * xfaces.c (register_color, unregister_color, unregister_colors):
17306 Likewise.
17307 * xfns.c (print_fontset_result): Likewise.
17308 * xrdb.c (member, fatal, main): Likewise.
17309
17310 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17311
17312 Fix minor problems found by static checking (Bug#9031).
17313 * chartab.c (char_table_set_range, map_sub_char_table):
17314 Remove unused locals.
17315 (uniprop_table): Now static.
17316 * composite.c (_work_char): Remove unused static var.
17317
17318 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
17319
17320 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17321
17322 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17323
17324 * gtkutil.c (qttip_cb): Remove code without function.
17325
17326 2011-07-09 Eli Zaretskii <eliz@gnu.org>
17327
17328 * w32.c (pthread_sigmask): New stub.
17329
17330 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
17331
17332 Use pthread_sigmask, not sigprocmask (Bug#9010).
17333 sigprocmask is portable only for single-threaded applications, and
17334 Emacs can be multi-threaded when it uses GTK.
17335 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17336 (LIBES): Use it.
17337 * callproc.c (Fcall_process):
17338 * process.c (create_process):
17339 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17340 Use pthread_sigmask, not sigprocmask.
17341
17342 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17343
17344 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17345 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17346 wrong (Bug#8591).
17347
17348 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17349
17350 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17351 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17352 (xg_hide_tooltip): Fix comment.
17353
17354 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17355 in registerServicesMenuSendTypes.
17356 (validRequestorForSendType): Don't check ns_return_types.
17357
17358 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17359 ns_return_type.
17360
17361 2011-07-08 Jason Rumney <jasonr@gnu.org>
17362
17363 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17364 SH_SHOW for hidden windows (Bug#5482).
17365
17366 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17367 frame struct members of non-existent frames (Bug#6284).
17368
17369 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17370
17371 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17372 variable firstTime not needed on OSX >= 10.6.
17373 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17374 >= 10.5. Use setKnobProportion, setDoubleValue.
17375
17376 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17377 (MAC_OS_X_VERSION_10_5): Define if not defined.
17378 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17379 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17380 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17381
17382 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17383 cString and lossyCString on OSX >= 10.4.
17384
17385 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17386 sizeToFit on OSX >= 10.2.
17387
17388 * nsimage.m (allocInitFromFile): Don't use deprecated method
17389 bestRepresentationForDevice on OSX >= 10.6.
17390
17391 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17392 to avoid warning.
17393
17394 * emacs.c: Declare unexec_init_emacs_zone.
17395
17396 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17397
17398 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17399
17400 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17401 on svcsMenu (Bug#8842).
17402
17403 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17404 ns_return_types.
17405 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17406
17407 * nsterm.m (QUTF8_STRING): Declare.
17408 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17409 (validRequestorForSendType): Return type is (id).
17410 Change indexOfObjectIdenticalTo to indexOfObject.
17411 Check if we have local selection before returning self (Bug#8842).
17412 (writeSelectionToPasteboard): Put local selection into paste board
17413 if we have a local selection (Bug#8842).
17414 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17415
17416 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17417 (ns_get_local_selection): Declare.
17418
17419 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17420
17421 * keymap.c (describe_map_tree): Don't insert a double newline at
17422 the end of the buffer (bug#1169) and return whether we inserted
17423 something.
17424
17425 * callint.c (Fcall_interactively): Change "reading args" to
17426 "providing args" to try to clarify what it does (bug#1010).
17427
17428 2011-07-07 Kenichi Handa <handa@m17n.org>
17429
17430 * composite.c (composition_compute_stop_pos): Ignore a static
17431 composition starting before CHARPOS (Bug#8915).
17432
17433 * xdisp.c (handle_composition_prop): Likewise.
17434
17435 2011-07-07 Eli Zaretskii <eliz@gnu.org>
17436
17437 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17438 (Bug#9015)
17439
17440 2011-07-07 Kenichi Handa <handa@m17n.org>
17441
17442 * character.h (unicode_category_t): New enum type.
17443
17444 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17445 (Qchar_code_property_table): New variable.
17446 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17447 (UNIPROP_COMPRESSED_FORM_P): New macros.
17448 (char_table_ascii): Uncompress the compressed values.
17449 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17450 Uncompress the compressed values.
17451 (sub_char_table_ref_and_range): Likewise.
17452 (char_table_ref_and_range): Uncompress the compressed values.
17453 (sub_char_table_set): New arg is_uniprop. Callers changed.
17454 Uncompress the compressed values.
17455 (sub_char_table_set_range): Args changed. Callers changed.
17456 (char_table_set_range): Adjuted for the above change.
17457 (map_sub_char_table): Delete args default_val and parent. Add arg
17458 top. Give decoded values to a Lisp function.
17459 (map_char_table): Adjust for the above change. Give decoded
17460 values to a Lisp function. Gcpro more variables.
17461 (uniprop_table_uncompress)
17462 (uniprop_decode_value_run_length): New functions.
17463 (uniprop_decoder, uniprop_decoder_count): New variables.
17464 (uniprop_get_decoder, uniprop_encode_value_character)
17465 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17466 New functions.
17467 (uniprop_encoder, uniprop_encoder_count): New variables.
17468 (uniprop_get_encoder, uniprop_table)
17469 (Funicode_property_table_internal, Fget_unicode_property_internal)
17470 (Fput_unicode_property_internal): New functions.
17471 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17472 Sunicode_property_table_internal, Sget_unicode_property_internal,
17473 and Sput_unicode_property_internal. Defvar_lisp
17474 char-code-property-alist.
17475
17476 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
17477 Vunicode_category_table.
17478
17479 * font.c (font_range): Adjust for the change of
17480 Vunicode_category_table.
17481
17482 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17483
17484 * m/iris4d.h: Remove file, move contents ...
17485 * s/irix6-5.h: ... here.
17486
17487 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17488
17489 Remove unportable assumption about struct layout (Bug#8884).
17490 * alloc.c (mark_buffer):
17491 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17492 (clone_per_buffer_values): Don't assume that
17493 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17494 This isn't true in general, and it's particularly not true
17495 if Emacs is configured with --with-wide-int.
17496 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17497 New macros, used in the buffer.c change.
17498
17499 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17500
17501 * xsettings.c: Use both GConf and GSettings if both are available.
17502 (store_config_changed_event): Add comment.
17503 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17504 (store_tool_bar_style_changed): New functions.
17505 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
17506 (struct xsettings): Move font inside HAVE_XFT.
17507 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
17508 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
17509 Move inside HAVE_XFT.
17510 (something_changed_gsettingsCB): Rename from something_changedCB.
17511 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17512 also.
17513 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
17514 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
17515 (something_changed_gconfCB): Rename from something_changedCB.
17516 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17517 (parse_settings): Move check for font inside HAVE_XFT.
17518 (read_settings, apply_xft_settings): Add comment.
17519 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17520 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17521 call store_font_name_changed.
17522 (xft_settings_event): Add comment.
17523 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17524 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17525 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17526 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17527 (xsettings_initialize): Call init_gsettings last.
17528 (xsettings_get_system_font, xsettings_get_system_normal_font):
17529 Add comment.
17530
17531 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17532
17533 Random fixes. E.g., (random) never returned negative values.
17534 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17535 subseconds part to the entropy, as that's a bit more random.
17536 Prefer signed to unsigned, since the signedness doesn't matter and
17537 in general we prefer signed. When given a limit, use a
17538 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17539 latter isn't right if USE_2_TAGS_FOR_INTS.
17540 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17541 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17542
17543 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17544
17545 * textprop.c (text_property_stickiness):
17546 Obey Vtext_property_default_nonsticky.
17547 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17548 * w32fns.c (syms_of_w32fns):
17549 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17550
17551 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17552
17553 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17554 This is more efficient than Ffile_directory_p and avoids a minor race.
17555
17556 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17557
17558 * buffer.c (Foverlay_put): Say what the return value is
17559 (bug#7835).
17560
17561 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17562 is a directory before asking whether to use the file name
17563 (bug#7564).
17564 (barf_or_query_if_file_exists): Make the "File is a directory"
17565 error be more correct.
17566
17567 * fns.c (Frequire): Remove the mention of the .gz files, since
17568 that's installation-specific, but keep the mention of
17569 `get-load-suffixes'.
17570
17571 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17572
17573 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17574 Report string overflow if the output is too long.
17575
17576 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
17577
17578 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17579 (syms_of_gnutls): Remove duplicate DEFSYM for
17580 Qgnutls_bootprop_verify_hostname_error, an error for
17581 Qgnutls_bootprop_verify_error (which is no longer used).
17582
17583 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17584 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17585 Also (re)move comments that are misplaced or no longer relevant.
17586
17587 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17588
17589 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17590
17591 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
17592
17593 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17594 and background color parameters if they have been changed.
17595
17596 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17597
17598 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17599
17600 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17601
17602 * xsettings.c (SYSTEM_FONT): Define only when used.
17603 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17604
17605 * keymap.c (access_keymap_1): Now static.
17606
17607 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
17608
17609 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17610 leave any prefix arg for the up event (Bug#1586).
17611
17612 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17613
17614 * lread.c (syms_of_lread): Mention single symbols defined by
17615 `defvar' or `defconst' (bug#7154).
17616
17617 * fns.c (Frequire): Mention .el.gz files (bug#7314).
17618 (Frequire): Mention get-load-suffixes.
17619
17620 2011-07-02 Martin Rudalics <rudalics@gmx.at>
17621
17622 * window.h (window): Remove clone_number slot.
17623 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17624 Remove.
17625 (make_parent_window, make_window, saved_window)
17626 (Fset_window_configuration, save_window_save): Don't deal with
17627 clone numbers.
17628 * buffer.c (Qclone_number): Remove declaration.
17629 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17630
17631 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17632
17633 Add multiple inheritance to keymaps.
17634 * keymap.c (Fmake_composed_keymap): New function.
17635 (Fset_keymap_parent): Simplify.
17636 (fix_submap_inheritance): Remove.
17637 (access_keymap_1): New function extracted from access_keymap to handle
17638 embedded parents and handle lists of maps.
17639 (access_keymap): Use it.
17640 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17641 (Fcopy_keymap): Handle embedded parents.
17642 (Fcommand_remapping, define_as_prefix): Simplify.
17643 (Fkey_binding): Simplify.
17644 (syms_of_keymap): Move minibuffer-local-completion-map,
17645 minibuffer-local-filename-completion-map,
17646 minibuffer-local-must-match-map, and
17647 minibuffer-local-filename-must-match-map to Elisp.
17648 (syms_of_keymap): Defsubr make-composed-keymap.
17649 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17650 (parse_menu_item): Trivial simplification.
17651
17652 2011-07-01 Glenn Morris <rgm@gnu.org>
17653
17654 * Makefile.in (SETTINGS_LIBS): Fix typo.
17655
17656 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
17657
17658 * coding.c (Fencode_coding_string): Record the last coding system
17659 used, as the function doc string says (bug#8738).
17660
17661 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17662
17663 * xsettings.c (store_monospaced_changed): Take new font as arg and
17664 check for change against current_mono_font.
17665 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17666 (emacs_settings_constructor, emacs_settings_get_property)
17667 (emacs_settings_set_property, emacs_settings_class_init)
17668 (emacs_settings_init, gsettings_obj): Remove.
17669 (something_changedCB): New function for HAVE_GSETTINGS.
17670 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17671 with value as argument.
17672 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17673 g_settings_new (Bug#8967). Do not create gsettings_obj.
17674 Remove calls to g_settings_bind. Connect something_changedCB to
17675 "changed".
17676
17677 * xgselect.c: Add defined (HAVE_GSETTINGS).
17678 (xgselect_initialize): Ditto.
17679
17680 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17681 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17682 xg_select.
17683
17684 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17685
17686 * eval.c (struct backtrace): Simplify and port the data structure.
17687 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17688 signed bit field, as this assumption is not portable and it makes
17689 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17690 "char debug_on_exit : 1" as this is not portable either; instead,
17691 use the portable "unsigned int debug_on_exit : 1". Remove unused
17692 member evalargs. Remove obsolete comments about cc bombing out.
17693
17694 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17695
17696 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17697 Let HAVE_GSETTINGS override HAVE_GCONF.
17698 (store_monospaced_changed): New function.
17699 (EMACS_SETTINGS): A new type derived from GObject to handle
17700 GSettings notifications.
17701 (emacs_settings_constructor, emacs_settings_get_property)
17702 (emacs_settings_set_property, emacs_settings_class_init):
17703 New functions.
17704 (gsettings_client, gsettings_obj): New variables.
17705 (GSETTINGS_SCHEMA): New define.
17706 (something_changedCB): Call store_monospaced_changed.
17707 (init_gsettings): New function.
17708 (xsettings_initialize): Call init_gsettings.
17709 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17710 to NULL.
17711
17712 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17713 GCONF_CFLAGS/LIBS.
17714
17715 2011-06-29 Martin Rudalics <rudalics@gmx.at>
17716
17717 * window.c (resize_root_window, grow_mini_window)
17718 (shrink_mini_window): Rename Qresize_root_window to
17719 Qwindow_resize_root_window and Qresize_root_window_vertically to
17720 Qwindow_resize_root_window_vertically.
17721
17722 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17723
17724 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17725
17726 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
17727
17728 * makefile.w32-in: Redesign dependencies so they reflect more
17729 clearly which files are directly included by each source file,
17730 and not through other includes.
17731
17732 2011-06-27 Martin Rudalics <rudalics@gmx.at>
17733
17734 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17735 (sort_overlays, overlay_strings): When an overlay's clone number
17736 matches the window's clone number process the overlay even if
17737 the overlay's window property doesn't match the current window.
17738
17739 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17740 (Fwindow_hchild): Rename to Fwindow_left_child.
17741 (Fwindow_next): Rename to Fwindow_next_sibling.
17742 (Fwindow_prev): Rename to Fwindow_prev_sibling.
17743 (resize_window_check): Rename to window_resize_check.
17744 (resize_window_apply): Rename to window_resize_apply.
17745 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17746 (Fdelete_other_windows_internal, resize_frame_windows)
17747 (Fsplit_window_internal, Fdelete_window_internal)
17748 (grow_mini_window, shrink_mini_window)
17749 (Fresize_mini_window_internal): Fix callers accordingly.
17750
17751 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17752
17753 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17754 (emacs_fixed_set_min_size): Remove.
17755 (emacs_fixed_new): Take frame as argument.
17756
17757 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17758 (_EmacsFixedPrivate): Remove minwidth/height.
17759 Add struct frame *f.
17760 (emacs_fixed_init): Initialize priv->f.
17761 (get_parent_class, emacs_fixed_set_min_size): Remove.
17762 (emacs_fixed_new): Set priv->f to argument.
17763 (emacs_fixed_get_preferred_width)
17764 (emacs_fixed_get_preferred_height): Use min_width/height from
17765 frames size_hint to set minimum and natural (Bug#8919).
17766 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17767 and use min_width/height from frames size_hint to set
17768 min_width/height (Bug#8919).
17769
17770 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
17771 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17772 Fix indentation.
17773
17774 2011-06-26 Eli Zaretskii <eliz@gnu.org>
17775
17776 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17777 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17778 called at ZV.
17779
17780 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
17781
17782 * process.c (wait_reading_process_output): Bypass select if
17783 waiting for a cell while ignoring keyboard input, and input is
17784 pending. Suggested by Jan Djärv (Bug#8869).
17785
17786 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17787
17788 Use gnulib's dup2 module instead of rolling our own.
17789 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17790
17791 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17792
17793 * dispnew.c (scrolling_window): Before scrolling, turn off a
17794 mouse-highlight in the window being scrolled.
17795
17796 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
17797
17798 Move DEFSYM to lisp.h and use everywhere.
17799
17800 * character.h (DEFSYM): Move declaration...
17801 * lisp.h (DEFSYM): ...here.
17802
17803 * gnutls.c:
17804 * minibuf.c:
17805 * w32menu.c:
17806 * w32proc.c:
17807 * w32select.c: Don't include character.h.
17808
17809 * alloc.c (syms_of_alloc):
17810 * buffer.c (syms_of_buffer):
17811 * bytecode.c (syms_of_bytecode):
17812 * callint.c (syms_of_callint):
17813 * casefiddle.c (syms_of_casefiddle):
17814 * casetab.c (init_casetab_once):
17815 * category.c (init_category_once, syms_of_category):
17816 * ccl.c (syms_of_ccl):
17817 * cmds.c (syms_of_cmds):
17818 * composite.c (syms_of_composite):
17819 * dbusbind.c (syms_of_dbusbind):
17820 * dired.c (syms_of_dired):
17821 * dispnew.c (syms_of_display):
17822 * doc.c (syms_of_doc):
17823 * editfns.c (syms_of_editfns):
17824 * emacs.c (syms_of_emacs):
17825 * eval.c (syms_of_eval):
17826 * fileio.c (syms_of_fileio):
17827 * fns.c (syms_of_fns):
17828 * frame.c (syms_of_frame):
17829 * fringe.c (syms_of_fringe):
17830 * insdel.c (syms_of_insdel):
17831 * keymap.c (syms_of_keymap):
17832 * lread.c (init_obarray, syms_of_lread):
17833 * macros.c (syms_of_macros):
17834 * msdos.c (syms_of_msdos):
17835 * print.c (syms_of_print):
17836 * process.c (syms_of_process):
17837 * search.c (syms_of_search):
17838 * sound.c (syms_of_sound):
17839 * syntax.c (init_syntax_once, syms_of_syntax):
17840 * terminal.c (syms_of_terminal):
17841 * textprop.c (syms_of_textprop):
17842 * undo.c (syms_of_undo):
17843 * w32.c (globals_of_w32):
17844 * window.c (syms_of_window):
17845 * xdisp.c (syms_of_xdisp):
17846 * xfaces.c (syms_of_xfaces):
17847 * xfns.c (syms_of_xfns):
17848 * xmenu.c (syms_of_xmenu):
17849 * xsettings.c (syms_of_xsettings):
17850 * xterm.c (syms_of_xterm): Use DEFSYM.
17851
17852 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17853
17854 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
17855
17856 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17857
17858 Integer and buffer overflow fixes (Bug#8873).
17859
17860 * print.c (printchar, strout): Check for string overflow.
17861 (PRINTPREPARE, printchar, strout):
17862 Don't set size unless allocation succeeds.
17863
17864 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17865 for sizes. Check for string overflow more accurately.
17866 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17867
17868 * macros.c: Integer and buffer overflow fixes.
17869 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17870 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17871 Use ptrdiff_t, not int, for sizes.
17872 Don't increment bufsize until after realloc succeeds.
17873 Check for size-calculation overflow.
17874 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17875
17876 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17877
17878 * lread.c: Integer overflow fixes.
17879 (read_integer): Radix is now EMACS_INT, not int,
17880 to improve quality of diagnostics for out-of-range radices.
17881 Calculate buffer size correctly for out-of-range radices.
17882 (read1): Check for integer overflow in radices, and in
17883 read-circle numbers.
17884 (read_escape): Avoid int overflow.
17885 (Fload, openp, read_buffer_size, read1)
17886 (substitute_object_recurse, read_vector, read_list, map_obarray):
17887 Use ptrdiff_t, not int, for sizes.
17888 (read1): Use EMACS_INT, not int, for sizes.
17889 Check for size overflow.
17890
17891 * image.c (cache_image): Check for size arithmetic overflow.
17892
17893 * lread.c: Integer overflow issues.
17894 (saved_doc_string_size, saved_doc_string_length)
17895 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17896 Now ptrdiff_t, not int.
17897 (read1): Don't assume doc string length fits in int. Check for
17898 out-of-range doc string lengths.
17899 (read_list): Don't assume file position fits in int.
17900 (read_escape): Check for hex character overflow.
17901
17902 2011-06-22 Leo Liu <sdl.web@gmail.com>
17903
17904 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17905 Move to minibuffer.el.
17906
17907 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17908
17909 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
17910 The following patches are for when GLYPH_DEBUG && !XASSERT.
17911 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17912 * dispnew.c (flush_stdout):
17913 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17914 Mark as externally visible.
17915 * dispnew.c (check_window_matrix_pointers): Now static.
17916 * dispnew.c (window_to_frame_vpos):
17917 * xfns.c (unwind_create_frame):
17918 * xterm.c (x_check_font): Remove unused local.
17919 * scroll.c (CHECK_BOUNDS):
17920 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17921 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17922 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17923 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17924 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17925 Now static.
17926 (debug_method_add): Use va_list and vsprintf rather than relying
17927 on undefined behavior with wrong number of arguments.
17928 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17929 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17930 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17931 since we're not interested in debugging glyphs with old libraries.
17932 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17933 GCC 4.6.0's static checking.
17934
17935 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17936
17937 Integer overflow and signedness fixes (Bug#8873).
17938 A few related buffer overrun fixes, too.
17939
17940 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17941
17942 * dispextern.h (struct face.stipple):
17943 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17944 (x_bitmap_mask, x_allocate_bitmap_record)
17945 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17946 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17947 (x_create_bitmap_from_xpm_data):
17948 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17949 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17950 (.bitmaps_last):
17951 * xfaces.c (load_pixmap):
17952 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17953 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17954 (.bitmaps_last, struct x_output.icon_bitmap):
17955 Use ptrdiff_t, not int, for bitmap indexes.
17956 (x_allocate_bitmap_record): Check for size overflow.
17957 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17958
17959 Use ptrdiff_t, not int, for overlay counts.
17960 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17961 * editfns.c (overlays_around, get_pos_property):
17962 * textprop.c (get_char_property_and_overlay):
17963 * xdisp.c (next_overlay_change, note_mouse_highlight):
17964 * xfaces.c (face_at_buffer_position):
17965 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17966 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17967 (Fnext_overlay_change, Fprevious_overlay_change)
17968 (mouse_face_overlay_overlaps, Foverlays_in):
17969 Use ptrdiff_t, not int, for sizes.
17970 (overlays_at, overlays_in): Check for size-calculation overflow.
17971
17972 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17973
17974 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17975 (x_session_initialize): Do not assume string length fits in int.
17976
17977 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17978 This is unlikely, but can occur if DPI is outlandish.
17979
17980 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
17981 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17982
17983 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17984 * xrdb.c (magic_file_p, search_magic_path):
17985 Omit last arg SUFFIX; it was always 0. All callers changed.
17986 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17987
17988 * xfont.c (xfont_match): Avoid need for strlen.
17989
17990 * xfns.c: Don't assume strlen fits in int.
17991 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17992
17993 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17994 not unsigned long, as we prefer signed integers. All callers changed.
17995 Detect integer overflow in repeat count.
17996 (message_dolog): Don't assume print length fits in 39 bytes.
17997 (display_mode_element): Don't assume strlen fits in int.
17998
17999 * termcap.c: Don't assume sizes fit in int and never overflow.
18000 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18001 (gobble_line): Check for size-calculation overflow.
18002
18003 * minibuf.c (Fread_buffer):
18004 * lread.c (intern, intern_c_string):
18005 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18006 Don't assume string length fits in int.
18007
18008 * keyboard.c (parse_tool_bar_item):
18009 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18010
18011 * font.c: Don't assume string length fits in int.
18012 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18013 Use ptrdiff_t, not int.
18014 (font_intern_prop): Don't assume string length fits in int.
18015 Don't assume integer property fits in fixnum.
18016 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18017
18018 * filelock.c: Fix some buffer overrun and integer overflow issues.
18019 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18020 Reformulate so as not to need the command string.
18021 Invoke gzip -cd rather than gunzip, as it's more portable.
18022 (lock_info_type, lock_file_1, lock_file):
18023 Don't assume pid_t and time_t fit in unsigned long.
18024 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18025 (current_lock_owner): Prefer signed type for sizes.
18026 Use memcpy, not strncpy, where memcpy is what is really wanted.
18027 Don't assume (via atoi) that time_t and pid_t fit in int.
18028 Check for time_t and/or pid_t out of range, e.g., via a network share.
18029 Don't alloca where an auto var works fine.
18030
18031 * fileio.c: Fix some integer overflow issues.
18032 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18033 Don't assume string length fits in int.
18034 (directory_file_name): Don't assume string length fits in long.
18035 (make_temp_name): Don't assume pid fits in int, or that its print
18036 length is less than 20.
18037
18038 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18039
18040 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18041
18042 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18043
18044 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18045 We prefer signed integers, even for size calculations.
18046
18047 * emacs.c: Don't assume string length fits in 'int'.
18048 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18049 (main): Don't invoke strlen when not needed.
18050
18051 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18052 (XD_DEBUG_MESSAGE): Don't waste a byte.
18053
18054 * callproc.c (getenv_internal_1, getenv_internal)
18055 (Fgetenv_internal):
18056 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18057
18058 * lread.c (invalid_syntax): Omit length argument.
18059 All uses changed. This doesn't fix a bug, but it simplifies the
18060 code away from its former Hollerith-constant appearance, and it's
18061 one less 'int' to worry about when looking at integer-overflow issues.
18062 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18063
18064 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18065 This didn't break anything, but it didn't help either.
18066 It's confusing to put a bogus integer in a place where the actual
18067 value does not matter.
18068 (LIST_END_P): Remove unused macro and its bogus comment.
18069 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18070
18071 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18072 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18073 implementation.
18074 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18075 We prefer signed types, and the value cannot exceed the EMACS_INT
18076 range anyway (because otherwise the length would not be representable).
18077 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18078 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18079 This avoids a GCC warning when WIDE_EMACS_INT.
18080
18081 * indent.c (sane_tab_width): New function.
18082 (current_column, scan_for_column, Findent_to, position_indentation)
18083 (compute_motion): Use it. This is just for clarity.
18084 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18085
18086 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18087
18088 * lisp.h (lint_assume): New macro.
18089 * composite.c (composition_gstring_put_cache):
18090 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18091
18092 * editfns.c, insdel.c:
18093 Omit unnecessary forward decls, to simplify future changes.
18094
18095 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18096
18097 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18098
18099 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18100 Use much-faster test for byte-length change.
18101 Don't assume string byte-length fits in 'int'.
18102 Check that character arg fits in 'int'.
18103 (mapcar1): Declare byte as byte, for clarity.
18104
18105 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18106
18107 * fns.c (concat): Catch string overflow earlier.
18108 Do not rely on integer wraparound.
18109
18110 * dispextern.h (struct it.overlay_strings_charpos)
18111 (struct it.selective): Now EMACS_INT, not int.
18112 * xdisp.c (forward_to_next_line_start)
18113 (back_to_previous_visible_line_start)
18114 (reseat_at_next_visible_line_start, next_element_from_buffer):
18115 Don't arbitrarily truncate the value of 'selective' to int.
18116
18117 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18118
18119 * composite.c: Don't truncate sizes to 'int'.
18120 (composition_gstring_p, composition_reseat_it)
18121 (composition_adjust_point): Use EMACS_INT, not int.
18122 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18123 not EMACS_UINT, for indexes.
18124
18125 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18126
18127 * buffer.c: Include <verify.h>.
18128 (struct sortvec.priority, struct sortstr.priority):
18129 Now EMACS_INT, not int.
18130 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
18131 (struct sortstr.size, record_overlay_string)
18132 (struct sortstrlist.size, struct sortlist.used):
18133 Don't truncate size to int.
18134 (record_overlay_string): Check for size-calculation overflow.
18135 (init_buffer_once): Check at compile-time, not run-time.
18136
18137 2011-06-22 Jim Meyering <meyering@redhat.com>
18138
18139 Don't leak an XBM-image-sized buffer
18140 * image.c (xbm_load): Free the image buffer after using it.
18141
18142 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18143
18144 Port to Sun C.
18145 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18146 that Sun C diagnosed.
18147 * fns.c (secure_hash): Fix pointer signedness issue.
18148 * intervals.c (static_offset_intervals): New function.
18149 (offset_intervals): Use it.
18150
18151 2011-06-21 Leo Liu <sdl.web@gmail.com>
18152
18153 * deps.mk (fns.o):
18154 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18155 sha512.h.
18156
18157 * fns.c (secure_hash): Rename from crypto_hash_function and change
18158 the first arg to accept symbols.
18159 (Fsecure_hash): New primitive.
18160 (syms_of_fns): New symbols.
18161
18162 2011-06-20 Deniz Dogan <deniz@dogan.se>
18163
18164 * process.c (Fset_process_buffer): Clarify return value in
18165 docstring.
18166
18167 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
18168
18169 * dispnew.c (add_window_display_history): Use BVAR.
18170
18171 * xdisp.c (debug_method_add): Use BVAR.
18172 (check_window_end, dump_glyph_matrix, dump_glyph)
18173 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18174
18175 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18176 Likewise.
18177
18178 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18179 check till after the cache is created in init_frame_faces.
18180
18181 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18182
18183 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18184
18185 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18186
18187 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18188 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18189 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18190
18191 Improve buffer-overflow checking (Bug#8873).
18192 * fileio.c (Finsert_file_contents):
18193 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18194 Remove the old (too-loose) buffer overflow checks.
18195 They weren't needed, since make_gap checks for buffer overflow.
18196 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18197 The old code merely checked for Emacs fixnum overflow, and relied
18198 on undefined (wraparound) behavior. The new code avoids undefined
18199 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18200
18201 * editfns.c (Finsert_char): Don't dump core with very negative counts.
18202 Tune. Don't use wider integers than needed. Don't use alloca.
18203 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
18204
18205 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18206
18207 * insdel.c, lisp.h (buffer_overflow): New function.
18208 (insert_from_buffer_1, replace_range, replace_range_2):
18209 * insdel.c (make_gap_larger):
18210 * editfns.c (Finsert_char):
18211 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18212
18213 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18214
18215 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18216
18217 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18218
18219 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18220 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18221
18222 * fileio.c: Don't assume EMACS_INT fits in off_t.
18223 (emacs_lseek): New static function.
18224 (Finsert_file_contents, Fwrite_region): Use it.
18225 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18226
18227 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18228
18229 * fns.c: Don't overflow int when computing a list length.
18230 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18231 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18232 truncation on 64-bit hosts. Check for QUIT every
18233 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18234 faster and is responsive enough.
18235 (Flength): Report an error instead of overflowing an integer.
18236 (Fsafe_length): Return a float if the value is not representable
18237 as a fixnum. This shouldn't happen except in contrived situations.
18238 (Fnthcdr, Fsort): Don't assume list length fits in int.
18239 (Fcopy_sequence): Don't assume vector length fits in int.
18240
18241 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18242 (header_size, word_size): New constants.
18243 (allocate_vectorlike): Don't check size overflow here.
18244 (allocate_vector): Check it here instead, since this is the only
18245 caller of allocate_vectorlike that could cause overflow.
18246 Check that the new vector's length is representable as a fixnum.
18247
18248 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18249 The previous code was bogus. For example, next_almost_prime (32)
18250 returned 39, which is undesirable as it is a multiple of 3; and
18251 next_almost_prime (24) returned 25, which is a multiple of 5 so
18252 why was the code bothering to check for multiples of 7?
18253
18254 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18255
18256 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18257
18258 Variadic C functions now count arguments with ptrdiff_t.
18259 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18260 Back then I didn't know that the Emacs coding style prefers signed int.
18261 Also, in the meantime I found a few more instances where arguments
18262 were being counted with int, which may truncate counts on 64-bit
18263 machines, or EMACS_INT, which may be unnecessarily wide.
18264 * lisp.h (struct Lisp_Subr.function.aMANY)
18265 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18266 Arg counts are now ptrdiff_t, not size_t.
18267 All variadic functions and their callers changed accordingly.
18268 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18269 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18270 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18271 * callint.c (Fcall_interactively): Check arg count for overflow,
18272 to avoid potential buffer overrun. Use signed char, not 'int',
18273 for 'varies' array, so that we needn't bother to check its size
18274 calculation for overflow.
18275 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18276 * eval.c (apply_lambda):
18277 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18278 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18279 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18280
18281 * callint.c (Fcall_interactively): Don't use index var as event count.
18282
18283 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18284 * mem-limits.h (SIZE): Remove; no longer used.
18285
18286 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18287
18288 Remove unnecessary casts.
18289 * xterm.c (x_term_init):
18290 * xfns.c (x_set_border_pixel):
18291 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18292 These aren't needed now that we assume ANSI C.
18293
18294 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18295 It's more likely to cause problems (due to unsigned overflow)
18296 than to cure them.
18297
18298 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18299
18300 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18301
18302 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18303
18304 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18305
18306 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18307
18308 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18309
18310 GLYPH_CODE_FACE returns EMACS_INT, not int.
18311 * dispextern.h (merge_faces):
18312 * xfaces.c (merge_faces):
18313 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18314 Don't assume EMACS_INT fits in int.
18315
18316 * character.h (CHAR_VALID_P): Remove unused parameter.
18317 * fontset.c, lisp.h, xdisp.c: All uses changed.
18318
18319 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18320
18321 * fns.c (concat): Minor tuning based on overflow analysis.
18322 This doesn't fix any bugs. Use int to hold character, instead
18323 of constantly refetching from Emacs object. Use XFASTINT, not
18324 XINT, for value known to be a character. Don't bother comparing
18325 a single byte to 0400, as it's always less.
18326
18327 * floatfns.c (Fexpt):
18328 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18329
18330 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18331 for characters.
18332
18333 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18334
18335 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18336 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18337 incorrectly succeed when S was a string, because 4294967386 was
18338 truncated before it was used.
18339
18340 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18341 Otherwise, an out-of-range integer could cause undefined behavior
18342 on a 64-bit host.
18343
18344 * composite.c: Use int, not EMACS_INT, for characters.
18345 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18346 EMACS_INT, for values that are known to be in character range.
18347 This doesn't fix any bugs but is the usual style inside Emacs and
18348 may generate better code on 32-bit machines.
18349
18350 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18351 This is for reasons similar to the recent CHAR_STRING fix.
18352 * charset.c (Fencode_char): Check that character arg is actually
18353 a character. Pass an int to ENCODE_CHAR.
18354 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18355 wider than 'int', as a compile-time check to prevent future regressions
18356 in this area.
18357
18358 * character.c (char_string): Remove unnecessary casts.
18359
18360 Make sure a 64-bit char is never passed to CHAR_STRING.
18361 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18362 by silently ignoring the top 32 bits, allowing some values
18363 that were far too large to be valid characters.
18364 * character.h: Include <verify.h>.
18365 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18366 arguments are no wider than unsigned, as a compile-time check
18367 to prevent future regressions in this area.
18368 * data.c (Faset):
18369 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18370 (Fsubst_char_in_region):
18371 * fns.c (concat):
18372 * xdisp.c (decode_mode_spec_coding):
18373 Adjust to CHAR_STRING's new requirement.
18374 * editfns.c (Finsert_char, Fsubst_char_in_region):
18375 * fns.c (concat): Check that character args are actually
18376 characters. Without this test, these functions did the wrong
18377 thing with wildly out-of-range values on 64-bit hosts.
18378
18379 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18380 These casts should not be needed on 32-bit hosts, either.
18381 * keyboard.c (read_char):
18382 * lread.c (Fload): Remove casts to unsigned.
18383
18384 * lisp.h (UNSIGNED_CMP): New macro.
18385 This fixes comparison bugs on 64-bit hosts.
18386 (ASCII_CHAR_P): Use it.
18387 * casefiddle.c (casify_object):
18388 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18389 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18390 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18391 * dispextern.h (FACE_FROM_ID):
18392 * keyboard.c (read_char): Use UNSIGNED_CMP.
18393
18394 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18395 not to EMACS_INT, to avoid GCC warning.
18396
18397 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18398
18399 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18400 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18401 isn't needed on 32-bit machines.
18402
18403 * buffer.c (Fgenerate_new_buffer_name):
18404 Use EMACS_INT for count, not int.
18405 (advance_to_char_boundary): Return EMACS_INT, not int.
18406
18407 * data.c (Qcompiled_function): Now static.
18408
18409 * window.c (window_body_lines): Now static.
18410
18411 * image.c (gif_load): Rename local to avoid shadowing.
18412
18413 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18414 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18415 * alloc.c (make_save_value): Integer argument is now of type
18416 ptrdiff_t, not int.
18417 (mark_object): Use ptrdiff_t, not int.
18418 * lisp.h (pD): New macro.
18419 * print.c (print_object): Use it.
18420
18421 * alloc.c: Use EMACS_INT, not int, to count objects.
18422 (total_conses, total_markers, total_symbols, total_vector_size)
18423 (total_free_conses, total_free_markers, total_free_symbols)
18424 (total_free_floats, total_floats, total_free_intervals)
18425 (total_intervals, total_strings, total_free_strings):
18426 Now EMACS_INT, not int. All uses changed.
18427 (Fgarbage_collect): Compute overall total using a double, so that
18428 integer overflow is less likely to be a problem. Check for overflow
18429 when converting back to an integer.
18430 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18431 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18432 These were 'int' variables that could overflow on 64-bit hosts;
18433 they were never used, so remove them instead of repairing them.
18434 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
18435 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18436 Previously, this ceilinged at INT_MAX, but that doesn't work on
18437 64-bit machines.
18438 (allocate_pseudovector): Don't use EMACS_INT when int would do.
18439
18440 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18441 (allocate_vectorlike): Check for ptrdiff_t overflow.
18442 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18443 when a (possibly-narrower) signed value would do just as well.
18444 We prefer using signed arithmetic, to avoid comparison confusion.
18445
18446 * alloc.c: Catch some string size overflows that we were missing.
18447 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18448 for convenience in STRING_BYTES_MAX.
18449 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18450 The definition here is exact; the one in lisp.h was approximate.
18451 (allocate_string_data): Check for string overflow. This catches
18452 some instances we weren't catching before. Also, it catches
18453 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18454 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18455 and ptrdiff_t and EMACS_INT are both 64 bits.
18456
18457 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18458 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
18459 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
18460
18461 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18462
18463 * alloc.c (Fmake_string): Check for out-of-range init.
18464
18465 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18466
18467 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18468
18469 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18470
18471 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18472 xg_get_default_scrollbar_width.
18473
18474 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18475 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18476 (style_changed_cb): Call update_theme_scrollbar_width and call
18477 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18478 all frames (Bug#8505).
18479 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18480 Call gtk_window_set_resizable if HAVE_GTK3.
18481 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18482 and height if HAVE_GTK3 (Bug#8505).
18483 (scroll_bar_width_for_theme): New variable.
18484 (update_theme_scrollbar_width): New function.
18485 (xg_get_default_scrollbar_width): Move code to
18486 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18487 (xg_initialize): Call update_theme_scrollbar_width.
18488
18489 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18490
18491 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18492
18493 2011-06-12 Martin Rudalics <rudalics@gmx.at>
18494
18495 * frame.c (make_frame): Call other_buffer_safely instead of
18496 other_buffer.
18497
18498 * window.c (temp_output_buffer_show): Call display_buffer with
18499 second argument Vtemp_buffer_show_specifiers and reset latter
18500 immediately after the call.
18501 (Vtemp_buffer_show_specifiers): New variable.
18502 (auto_window_vscroll_p, next_screen_context_lines)
18503 (Vscroll_preserve_screen_position): Remove leading asterisks from
18504 doc-strings.
18505
18506 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
18507
18508 Fix minor problems found by GCC 4.6.0 static checking.
18509 * buffer.c (Qclone_number): Remove for now, as it's unused.
18510 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18511 (record_buffer): Remove unused local.
18512 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18513 (set_frame_buffer_list): Remove; unused.
18514 * frame.h (other_visible_frames): Remove decl.
18515 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18516 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18517 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18518 if HAVE_GPM.
18519 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18520 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18521 Define only if HAVE_GPM.
18522 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18523 (update_hints_inhibit): Remove; never set. All uses removed.
18524 * widgetprv.h (emacsFrameClassRec): Remove decl.
18525 * window.c (delete_deletable_window): Now returns void, since it
18526 wasn't returning anything.
18527 (compare_window_configurations): Remove unused locals.
18528 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18529 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
18530 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18531 the same widths as pointers. This follows up on the 2011-05-06 patch.
18532 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18533 * xterm.h: Likewise.
18534 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18535
18536 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
18537
18538 * makefile.w32-in: Update dependencies.
18539 (LISP_H): Add lib/intprops.h.
18540
18541 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18542
18543 * image.c (gif_load): Add animation frame delay to the metadata.
18544 (syms_of_image): Use DEFSYM. New symbol `delay'.
18545
18546 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18547
18548 * window.c (delete_deletable_window): Re-add.
18549 (Fset_window_configuration): Rewrite to handle dead buffers and
18550 consequently deletable windows.
18551 (window_tree, Fwindow_tree): Remove. Supply functionality in
18552 window.el.
18553 (compare_window_configurations): Simplify code.
18554
18555 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18556
18557 * image.c (imagemagick_load_image): Fix type mismatch.
18558 (Fimagemagick_types): Likewise.
18559
18560 * window.h (replace_buffer_in_windows): Declare.
18561
18562 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18563
18564 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18565 Qclone_number. Remove external declaration of Qdelete_window.
18566 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18567 code.
18568 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18569 Run Qbuffer_list_update_hook if allowed.
18570 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18571 buffer list implementation.
18572 (other_buffer_safely): New function.
18573 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18574 calls to replace_buffer_in_windows and
18575 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18576 if allowed.
18577 (record_buffer): Inhibit quitting and rewrite using quittable
18578 functions. Run Qbuffer_list_update_hook if allowed.
18579 (Frecord_buffer, Funrecord_buffer): New functions.
18580 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18581 Move switch-to-buffer to window.el.
18582 (bury-buffer): Move to window.el.
18583 (Vbuffer_list_update_hook): New variable.
18584
18585 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18586 section.
18587
18588 * window.h (resize_frame_windows): Move up in code.
18589 (Fwindow_frame): Remove EXFUN.
18590 (replace_buffer_in_all_windows): Remove prototype.
18591 (replace_buffer_in_windows_safely): Add prototype.
18592
18593 * window.c: Declare Qdelete_window static again. Move down
18594 declaration of select_count.
18595 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18596 (Fother_window): Move to window.el.
18597 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18598 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18599 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18600 window.el.
18601 (replace_buffer_in_windows): Implement by calling
18602 Qreplace_buffer_in_windows.
18603 (replace_buffer_in_all_windows): Remove with some functionality
18604 moved into replace_buffer_in_windows_safely.
18605 (replace_buffer_in_windows_safely): New function.
18606 (select_window_norecord, select_frame_norecord): Move in front
18607 of run_window_configuration_change_hook. Remove now obsolete
18608 declarations.
18609 (Fset_window_buffer): Rewrite doc-string.
18610 Call Qrecord_window_buffer.
18611 (keys_of_window): Move binding for other-window to window.el.
18612
18613 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18614
18615 * dispextern.h (struct image): Replace data member, whose int_val
18616 and ptr_val fields were not used by anything, with a single
18617 lisp_val object.
18618
18619 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18620 (gif_clear_image, gif_load, imagemagick_load_image)
18621 (gs_clear_image, gs_load): Callers changed.
18622
18623 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18624
18625 * buffer.h: Include <time.h>, for time_t.
18626 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18627
18628 Fix minor problems found by static checking.
18629
18630 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18631
18632 Make identifiers static if they are not used in other modules.
18633 * data.c (Qcompiled_function, Qframe, Qvector):
18634 * image.c (QimageMagick, Qsvg):
18635 * minibuf.c (Qmetadata):
18636 * window.c (resize_window_check, resize_root_window): Now static.
18637 * window.h (resize_window_check, resize_root_window): Remove decls.
18638
18639 * window.c (window_deletion_count, delete_deletable_window):
18640 Remove; unused.
18641 (window_body_lines): Now static.
18642 (Fdelete_other_windows_internal): Mark vars as initialized.
18643 Make sure 'resize_failed' is initialized.
18644 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18645 (resize_window_apply): Remove unused local.
18646 * window.h (delete_deletable_window): Remove decl.
18647
18648 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
18649 (imagemagick_load_image): Fix pointer signedness problem by changing
18650 last arg from unsigned char * to char *. All uses changed.
18651 Also, fix a local for similar reasons.
18652 Remove unused locals. Remove locals to avoid shadowing.
18653 (fn_rsvg_handle_free): Remove; unused.
18654 (svg_load, svg_load_image): Fix pointer signedness problem.
18655 (imagemagick_load_image): Don't use garbage pointer image_wand.
18656
18657 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18658
18659 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
18660
18661 * image.c (gif_load): Fix omitted cast error introduced by
18662 2011-06-06 change.
18663
18664 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18665
18666 * window.h (resize_proportionally, orig_total_lines)
18667 (orig_top_line): Remove from window structure.
18668 (set_window_height, set_window_width, change_window_heights)
18669 (Fdelete_window): Remove prototypes.
18670 (resize_frame_windows): Remove duplicate declaration.
18671
18672 2011-06-10 Eli Zaretskii <eliz@gnu.org>
18673
18674 * window.h (resize_frame_windows, resize_window_check)
18675 (delete_deletable_window, resize_root_window)
18676 (resize_frame_windows): Declare prototypes.
18677
18678 * window.c (resize_window_apply): Make definition be "static" to
18679 match the prototype.
18680
18681 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18682
18683 * window.c: Remove declarations of Qwindow_size_fixed,
18684 window_min_size_1, window_min_size_2, window_min_size,
18685 size_window, window_fixed_size_p, enlarge_window, delete_window.
18686 Remove static from declaration of Qdelete_window, it's
18687 temporarily needed by Fbury_buffer.
18688 (replace_window): Don't assign orig_top_line and
18689 orig_total_lines.
18690 (Fdelete_window, delete_window): Remove. Window deletion is
18691 handled by window.el.
18692 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18693 Replace Fdelete_window calls with calls to Qdelete_window.
18694 (Fdelete_other_windows): Remove. Deleting other windows is
18695 handled by window.el.
18696 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18697 handled in window.el.
18698 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18699 Window minimum sizes are handled in window.el.
18700 (shrink_windows, size_window, set_window_height)
18701 (set_window_width, change_window_heights, window_height)
18702 (window_width, CURBEG, CURSIZE, enlarge_window)
18703 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18704 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18705 handled in window.el.
18706 (make_dummy_parent): Rename to make_parent_window and give it a
18707 second argument horflag.
18708 (make_window): Don't set resize_proportionally any more.
18709 (Fsplit_window): Remove. Windows are split in window.el.
18710 (save_restore_action, save_restore_orig_size)
18711 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18712 Resize mini windows in window.el.
18713 (grow_mini_window, shrink_mini_window): Implement by calling
18714 Qresize_root_window_vertically, resize_window_check and
18715 resize_window_apply.
18716 (saved_window, Fset_window_configuration, save_window_save):
18717 Do not handle orig_top_line, orig_total_lines, and
18718 resize_proportionally.
18719 (window_min_height, window_min_width): Move to window.el.
18720 (keys_of_window): Move bindings for delete-other-windows,
18721 split-window, delete-window and enlarge-window to window.el.
18722
18723 * buffer.c: Temporarily extern Qdelete_window.
18724 (Fbury_buffer): Temporarily call Qdelete_window instead of
18725 Fdelete_window (Fbury_buffer will move to window.el soon).
18726
18727 * frame.c (set_menu_bar_lines_1): Remove code handling
18728 orig_top_line and orig_total_lines.
18729
18730 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18731 set_window_height but set heights directly.
18732 (change_frame_size_1): Use resize_frame_windows.
18733
18734 * xdisp.c (init_xdisp): Don't use set_window_height but set
18735 heights directly.
18736
18737 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18738 Use resize_frame_windows instead of change_window_heights and run
18739 run_window_configuration_change_hook.
18740
18741 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18742 instead of change_window_heights and run
18743 run_window_configuration_change_hook.
18744
18745 2011-06-09 Martin Rudalics <rudalics@gmx.at>
18746
18747 * window.c (replace_window): Rename second argument REPLACEMENT to
18748 NEW. New third argument SETFLAG. Rewrite.
18749 (delete_window, make_dummy_parent): Call replace_window with
18750 third argument 1.
18751 (window_list_1): Move down in code.
18752 (run_window_configuration_change_hook): Move set_buffer part
18753 before select_frame_norecord part in order to unwind correctly.
18754 Rename count1 to count.
18755 (recombine_windows, delete_deletable_window, resize_root_window)
18756 (Fdelete_other_windows_internal)
18757 (Frun_window_configuration_change_hook, make_parent_window)
18758 (resize_window_check, resize_window_apply, Fresize_window_apply)
18759 (resize_frame_windows, Fsplit_window_internal)
18760 (Fdelete_window_internal, Fresize_mini_window_internal):
18761 New functions.
18762 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18763
18764 2011-06-08 Martin Rudalics <rudalics@gmx.at>
18765
18766 * window.h (window): Add some new members to window structure -
18767 normal_lines, normal_cols, new_total, new_normal, clone_number,
18768 splits, nest, prev_buffers, next_buffers.
18769 (WINDOW_TOTAL_SIZE): Move here from window.c.
18770 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
18771
18772 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18773 Remove.
18774 (make_dummy_parent): Set new members of windows structure.
18775 (make_window): Move down in code. Handle new members of window
18776 structure.
18777 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18778 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18779 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18780 (Fset_window_prev_buffers, Fwindow_next_buffers)
18781 (Fset_window_next_buffers, Fset_window_clone_number):
18782 New functions.
18783 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18784 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18785 Doc-string fixes.
18786 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18787 Argument WINDOW can be now internal window too.
18788 (Fwindow_use_time): Move up in code.
18789 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18790 Rewrite doc-string.
18791 (Fset_window_configuration, saved_window)
18792 (Fcurrent_window_configuration, save_window_save): Handle new
18793 members of window structure.
18794 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18795 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18796 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18797 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18798 Qget_mru_window, Qresize_root_window,
18799 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18800 Qauto_buffer_name; staticpro them.
18801
18802 2011-06-07 Martin Rudalics <rudalics@gmx.at>
18803
18804 * window.c (Fwindow_total_size, Fwindow_left_column)
18805 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18806 (Fwindow_list_1): New functions.
18807 (window_box_text_cols): Replace with window_body_cols.
18808 (Fwindow_width, Fscroll_left, Fscroll_right):
18809 Use window_body_cols instead of window_box_text_cols.
18810 (delete_window, Fset_window_configuration):
18811 Call delete_all_subwindows with window as argument.
18812 (delete_all_subwindows): Take a window as argument and not a
18813 structure. Rewrite.
18814 (window_loop): Remove handling of GET_LRU_WINDOW and
18815 GET_LARGEST_WINDOW.
18816 (Fget_lru_window, Fget_largest_window): Move to window.el.
18817
18818 * window.h: Extern window_body_cols instead of
18819 window_box_text_cols. delete_all_subwindows now takes a
18820 Lisp_Object as argument.
18821
18822 * indent.c (compute_motion, Fcompute_motion):
18823 Use window_body_cols instead of window_box_text_cols.
18824
18825 * frame.c (delete_frame): Call delete_all_subwindows with root
18826 window as argument.
18827
18828 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18829
18830 * fns.c (Fputhash): Document return value.
18831
18832 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
18833
18834 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18835
18836 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18837
18838 Cons<->int and similar integer overflow fixes (Bug#8794).
18839
18840 Check for overflow when converting integer to cons and back.
18841 * charset.c (Fdefine_charset_internal, Fdecode_char):
18842 Use cons_to_unsigned to catch overflow.
18843 (Fencode_char): Use INTEGER_TO_CONS.
18844 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18845 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18846 * data.c (long_to_cons, cons_to_long): Remove.
18847 (cons_to_unsigned, cons_to_signed): New functions.
18848 These signal an error for invalid or out-of-range values.
18849 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18850 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18851 * font.c (Ffont_variation_glyphs):
18852 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18853 * lisp.h: Include <intprops.h>.
18854 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18855 (cons_to_signed, cons_to_unsigned): New decls.
18856 (long_to_cons, cons_to_long): Remove decls.
18857 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18858 (Fprimitive_undo): Use CONS_TO_INTEGER.
18859 * xfns.c (Fx_window_property): Likewise.
18860 * xselect.c: Include <limits.h>.
18861 (x_own_selection, selection_data_to_lisp_data):
18862 Use INTEGER_TO_CONS.
18863 (x_handle_selection_request, x_handle_selection_clear)
18864 (x_get_foreign_selection, Fx_disown_selection_internal)
18865 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18866 (lisp_data_to_selection_data): Use cons_to_unsigned.
18867 (x_fill_property_data): Use cons_to_signed.
18868 Report values out of range.
18869
18870 Check for buffer and string overflow more precisely.
18871 * buffer.h (BUF_BYTES_MAX): New macro.
18872 * lisp.h (STRING_BYTES_MAX): New macro.
18873 * alloc.c (Fmake_string):
18874 * character.c (string_escape_byte8):
18875 * coding.c (coding_alloc_by_realloc):
18876 * doprnt.c (doprnt):
18877 * editfns.c (Fformat):
18878 * eval.c (verror):
18879 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18880 since they may not be the same number.
18881 * editfns.c (Finsert_char):
18882 * fileio.c (Finsert_file_contents):
18883 Likewise for BUF_BYTES_MAX.
18884
18885 * image.c: Use ptrdiff_t, not int, for sizes.
18886 (slurp_file): Switch from int to ptrdiff_t.
18887 All uses changed.
18888 (slurp_file): Check that file size fits in both size_t (for
18889 malloc) and ptrdiff_t (for sanity and safety).
18890
18891 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18892 if b->modtime has its maximal value.
18893
18894 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18895
18896 Don't assume time_t can fit into int.
18897 * buffer.h (struct buffer.modtime): Now time_t, not int.
18898 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18899 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18900
18901 Minor fixes for signed vs unsigned integers.
18902 * character.h (MAYBE_UNIFY_CHAR):
18903 * charset.c (maybe_unify_char):
18904 * keyboard.c (read_char, reorder_modifiers):
18905 XINT -> XFASTINT, since the integer must be nonnegative.
18906 * ftfont.c (ftfont_spec_pattern):
18907 * keymap.c (access_keymap, silly_event_symbol_error):
18908 XUINT -> XFASTINT, since the integer must be nonnegative.
18909 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18910 since it makes no difference and we prefer signed.
18911 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18912 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18913 nonnegative.
18914
18915 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18916
18917 * window.h (Fwindow_frame): Declare.
18918
18919 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18920
18921 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18922 (SPARE_MEMORY): Always define.
18923 (LARGE_REQUEST): Remove.
18924 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18925
18926 2011-06-06 Martin Rudalics <rudalics@gmx.at>
18927
18928 * lisp.h: Move EXFUNS for Fframe_root_window,
18929 Fframe_first_window and Fset_frame_selected_window to window.h.
18930
18931 * window.h: Move EXFUNS for Fframe_root_window,
18932 Fframe_first_window and Fset_frame_selected_window here from
18933 lisp.h.
18934
18935 * frame.c (Fwindow_frame, Fframe_first_window)
18936 (Fframe_root_window, Fframe_selected_window)
18937 (Fset_frame_selected_window): Move to window.c.
18938 (Factive_minibuffer_window): Move to minibuf.c.
18939 (Fother_visible_frames_p): New function.
18940
18941 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18942
18943 * window.c (decode_window, decode_any_window): Move up in code.
18944 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18945 (inhibit_frame_unsplittable): Remove unused variable.
18946 (Fwindow_buffer): Move up and rewrite doc-string.
18947 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18948 (Fwindow_prev): New functions.
18949 (Fwindow_frame): Move here from frame.c. Accept any window as
18950 argument.
18951 (Fframe_root_window, Fframe_first_window)
18952 (Fframe_selected_window): Move here from frame.c. Accept frame
18953 or arbitrary window as argument. Update doc-strings.
18954 (Fminibuffer_window): Move up in code.
18955 (Fwindow_minibuffer_p): Move up in code and simplify.
18956 (Fset_frame_selected_window): Move here from frame.c.
18957 Marginal rewrite.
18958 (Fselected_window, select_window, Fselect_window): Move up in
18959 code. Minor doc-string fixes.
18960
18961 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18962
18963 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18964 Do not assume that spare memory exists; that assumption is valid
18965 only if SYSTEM_MALLOC.
18966 (LARGE_REQUEST): New macro, so that the issue of large requests
18967 is separated from the issue of spare memory.
18968
18969 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18970
18971 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18972 format. (Bug#8806)
18973
18974 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18975
18976 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18977 before statements.
18978
18979 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18980
18981 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18982
18983 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18984
18985 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18986 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18987
18988 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
18989
18990 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18991
18992 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
18993
18994 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18995 (x_clipboard_manager_save): Add return value.
18996 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18997 New error handlers.
18998 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18999 Obey Vx_select_enable_clipboard_manager. Catch errors in
19000 x_clipboard_manager_save (Bug#8779).
19001 (Vx_select_enable_clipboard_manager): New variable.
19002 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19003
19004 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
19005
19006 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19007
19008 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19009
19010 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19011 in the current matrix if keep_current_p is non-zero.
19012
19013 2011-06-04 Eli Zaretskii <eliz@gnu.org>
19014
19015 * bidi.c (bidi_level_of_next_char): Fix last change.
19016
19017 2011-06-03 Eli Zaretskii <eliz@gnu.org>
19018
19019 Support bidi reordering of text covered by display properties.
19020
19021 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19022 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19023 (bidi_cache_search, bidi_cache_iterator_state)
19024 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19025 (bidi_level_of_next_char, bidi_move_to_visually_next):
19026 Support character positions inside a run of characters covered by a
19027 display string.
19028 (bidi_paragraph_init, bidi_resolve_explicit_1)
19029 (bidi_level_of_next_char): Call bidi_fetch_char and
19030 bidi_fetch_char_advance instead of FETCH_CHAR and
19031 FETCH_CHAR_ADVANCE.
19032 (bidi_init_it): Initialize new members.
19033 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19034 definitions.
19035 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19036 instead of using explicit *_CHAR codes.
19037 (bidi_resolve_explicit, bidi_resolve_weak):
19038 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19039 bidirectional text is supported only in multibyte buffers.
19040 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19041 it to initialize the frame_window_p member of struct bidi_it.
19042 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19043 (bidi_resolve_explicit, bidi_resolve_weak)
19044 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19045 bidi_it->nchars is non-positive.
19046 (bidi_level_of_next_char): Don't try to lookup the cache for the
19047 next/previous character if nothing is cached there yet, or if we
19048 were just reseat()'ed to a new position.
19049
19050 * xdisp.c (set_cursor_from_row): Set start and stop points
19051 according to the row's direction when priming the loop that looks
19052 for the glyph on which to display cursor.
19053 (single_display_spec_intangible_p): Function deleted.
19054 (display_prop_intangible_p): Reimplement to call
19055 handle_display_spec instead of single_display_spec_intangible_p.
19056 Accept 3 additional arguments needed by handle_display_spec.
19057 This fixes incorrect cursor motion across display property with complex
19058 values: lists, `(when COND...)' forms, etc.
19059 (single_display_spec_string_p): Support property values that are
19060 lists with the argument STRING its top-level element.
19061 (display_prop_string_p): Fix the condition for processing a
19062 property that is a list to be consistent with handle_display_spec.
19063 (handle_display_spec): New function, refactored from the
19064 last portion of handle_display_prop.
19065 (compute_display_string_pos): Accept additional argument
19066 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19067 value of a `display' property is a "replacing spec".
19068 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19069 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19070 the display property, but just return a value indicating whether
19071 the display property will replace the characters it covers.
19072 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19073 frame_window_p members of struct bidi_it.
19074 (compute_display_string_pos, compute_display_string_end):
19075 New functions.
19076 (push_it): Accept second argument POSITION, where pop_it should
19077 jump to continue iteration.
19078 (reseat_1): Initialize bidi_it.disp_pos.
19079
19080 * keyboard.c (adjust_point_for_property): Adjust the call to
19081 display_prop_intangible_p to its new signature.
19082
19083 * dispextern.h (struct bidi_it): New member frame_window_p.
19084 (bidi_init_it): Update prototypes.
19085 (display_prop_intangible_p): Update prototype.
19086 (compute_display_string_pos, compute_display_string_end):
19087 Declare prototypes.
19088 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19089 EMACS_INT.
19090
19091 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
19092
19093 Malloc failure behavior now depends on size of allocation.
19094 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19095 * lisp.h: Change signatures accordingly.
19096 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19097 All callers changed. (Bug#8762)
19098
19099 * gnutls.c: Use Emacs's memory allocators.
19100 Without this change, the gnutls library would invoke malloc etc.
19101 directly, which causes problems on non-SYNC_INPUT hosts, and which
19102 runs afoul of improving memory_full behavior. (Bug#8761)
19103 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19104 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19105 xfree instead of the default malloc, realloc, free.
19106 (Fgnutls_boot): No need to check for memory allocation failure,
19107 since xmalloc does that for us.
19108
19109 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
19110 * category.c (hash_get_category_set):
19111 * ccl.c (ccl_driver):
19112 * charset.c (Fdefine_charset_internal):
19113 * charset.h (struct charset.hash_index):
19114 * composite.c (get_composition_id, gstring_lookup_cache)
19115 (composition_gstring_put_cache):
19116 * composite.h (struct composition.hash_index):
19117 * dispextern.h (struct image.hash):
19118 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19119 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19120 (hashfn_equal, hashfn_user_defined, make_hash_table)
19121 (maybe_resize_hash_table, hash_lookup, hash_put)
19122 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19123 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19124 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19125 * image.c (make_image, search_image_cache, lookup_image)
19126 (xpm_put_color_table_h):
19127 * lisp.h (struct Lisp_Hash_Table):
19128 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
19129 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
19130 for hashes and hash indexes, instead of 'unsigned' and 'int'.
19131 * alloc.c (allocate_vectorlike):
19132 Check for overflow in vector size calculations.
19133 * ccl.c (ccl_driver):
19134 Check for overflow when converting EMACS_INT to int.
19135 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19136 need to be updated by these changes.
19137 * fns.c (make_hash_table, maybe_resize_hash_table):
19138 Check for integer overflow with large hash tables.
19139 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19140 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19141 (SXHASH_REDUCE): New macro.
19142 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19143 Use it instead of discarding useful hash info with large hash values.
19144 (sxhash_float): New function.
19145 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19146 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
19147 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19148 Rewrite to use FIXNUM_BITS, as this simplifies things.
19149 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19150 Adjust signatures to match updated version of code.
19151 (consing_since_gc): Now EMACS_INT, since a single hash table can
19152 use more than INT_MAX bytes.
19153
19154 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19155
19156 Make it possible to build with GCC-4.6+ -O2 -flto.
19157
19158 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19159
19160 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19161
19162 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19163 Call minibuffer-inactive-mode.
19164
19165 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
19166
19167 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19168 Update dependencies.
19169
19170 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19171
19172 * data.c (init_data): Remove code for UTS, this system is not
19173 supported anymore.
19174
19175 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19176
19177 Don't force ./temacs to start in terminal mode.
19178
19179 * frame.c (make_initial_frame): Initialize faces in all cases, not
19180 only when CANNOT_DUMP is defined.
19181 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19182
19183 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19184
19185 * dispnew.c (add_window_display_history): Use const for the string
19186 pointer. Remove declaration, not needed.
19187
19188 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19189
19190 Use 'inline', not 'INLINE'.
19191 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19192 * alloc.c, fontset.c (INLINE): Remove.
19193 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19194 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19195 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19196 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19197 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19198
19199 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19200
19201 Make it possible to run ./temacs.
19202
19203 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19204 syms_of_callproc does the same thing. Remove test for
19205 "initialized", do it in the caller.
19206 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19207
19208 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19209
19210 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19211 (read_minibuf): Use get_minibuffer.
19212 (syms_of_minibuf): Use DEFSYM.
19213 (Qmetadata): New var.
19214 * data.c (Qbuffer): Don't make it static.
19215 (syms_of_data): Use DEFSYM.
19216
19217 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19218
19219 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19220 (CCL_CODE_MIN): New macro.
19221
19222 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19223
19224 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19225
19226 * eval.c (Qdebug): Now static.
19227 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19228 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19229 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19230
19231 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19232
19233 * image.c: Various fixes to ImageMagick code comments.
19234 (Fimagemagick_types): Doc fix.
19235
19236 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19237
19238 Minor fixes prompted by GCC 4.6.0 warnings.
19239
19240 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19241
19242 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19243 (x_clipboard_manager_save_all): Move extern decl to ...
19244 * xterm.h: ... here, so that it can be checked for consistency.
19245
19246 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19247
19248 * xselect.c (x_clipboard_manager_save_frame)
19249 (x_clipboard_manager_save_all): New functions.
19250 (Fx_clipboard_manager_save): Lisp function deleted.
19251
19252 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19253 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19254
19255 * xterm.h: Update prototype.
19256
19257 2011-05-28 William Xu <william.xwl@gmail.com>
19258
19259 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19260 exiting (Bug#8239).
19261
19262 2011-05-28 Jim Meyering <meyering@redhat.com>
19263
19264 Avoid a sign-extension bug in crypto_hash_function.
19265 * fns.c (to_uchar): Define.
19266 (crypto_hash_function): Use it to convert some newly-signed
19267 variables to unsigned, to avoid sign-extension bugs. For example,
19268 without this change, (md5 "truc") would evaluate to
19269 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19270 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
19271 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19272
19273 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19274
19275 Integer overflow fixes.
19276
19277 * dbusbind.c: Serial number integer overflow fixes.
19278 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19279 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19280 to hold a serial number that is too large for a fixnum.
19281 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19282 Check for serial numbers out of range. Decode any serial number
19283 that was so large that it became a float. (Bug#8722)
19284
19285 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19286 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19287 Use XFASTINT rather than XUINT when numbers are nonnegative.
19288 (xd_append_arg, Fdbus_method_return_internal):
19289 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19290 arguments, check that Lisp number is nonnegative, rather than
19291 silently wrapping negative numbers around. (Bug#8722)
19292 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19293 (Bug#8722)
19294
19295 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19296
19297 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19298
19299 ccl: Add integer overflow checks.
19300 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19301 (IN_INT_RANGE): New macros.
19302 (ccl_driver): Use them to check for integer overflow when
19303 decoding a CCL program. Many of the new checks are whether XINT (x)
19304 fits in int; it doesn't always, on 64-bit hosts. The new version
19305 doesn't catch all possible integer overflows, but it's an
19306 improvement. (Bug#8719)
19307
19308 * alloc.c (make_event_array): Use XINT, not XUINT.
19309 There's no need for unsigned here.
19310
19311 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19312 This follows up to the 2011-05-06 change that substituted uintptr_t
19313 for EMACS_INT. This case wasn't caught back then.
19314
19315 Rework Fformat to avoid integer overflow issues.
19316 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19317 now (part of C89). Include <verify.h>.
19318 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19319 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19320 (Fformat): Avoid the prepass trying to compute sizes; it was only
19321 approximate and thus did not catch overflow reliably. Instead, walk
19322 through the format just once, formatting and computing sizes as we go,
19323 checking for integer overflow at every step, and allocating a larger
19324 buffer as needed. Keep track separately whether the format is
19325 multibyte. Keep only the most-recently calculated precision, rather
19326 than them all. Record whether each argument has been converted to
19327 string. Use EMACS_INT, not int, for byte and char and arg counts.
19328 Support field widths and precisions larger than INT_MAX. Avoid
19329 sprintf's undefined behavior with conversion specifications such as %#d
19330 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19331 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19332 formatting out-of-range floating point numbers with int
19333 formats. (Bug#8668)
19334
19335 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19336
19337 * data.c: Avoid integer truncation in expressions involving floats.
19338 * data.c: Include <intprops.h>.
19339 (arith_driver): When there's an integer overflow in an expression
19340 involving floating point, convert the integers to floating point
19341 so that the resulting value does not suffer from catastrophic
19342 integer truncation. For example, on a 64-bit host (* 4
19343 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19344 Do not rely on undefined behavior after integer overflow.
19345
19346 merge count_size_as_multibyte, parse_str_to_multibyte
19347 * character.c, character.h (count_size_as_multibyte):
19348 Rename from parse_str_to_multibyte; all uses changed.
19349 Check for integer overflow.
19350 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19351 since it's now a duplicate of the other. This is more of
19352 a character than a buffer op, so better that it's in character.c.
19353 * fns.c, print.c: Adjust to above changes.
19354
19355 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19356
19357 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19358
19359 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19360
19361 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19362 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19363 (x_clipboard_manager_save): Now static.
19364 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19365
19366 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19367 (crypto_hash_function): Now static.
19368 Fix pointer signedness problems. Avoid unnecessary initializations.
19369
19370 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
19371
19372 * termhooks.h (Vselection_alist): Make it terminal-local.
19373
19374 * terminal.c (create_terminal): Initialize it.
19375
19376 * xselect.c: Support for clipboard managers.
19377 (Vselection_alist): Move to termhooks.h as terminal-local var.
19378 (LOCAL_SELECTION): New macro.
19379 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19380 (symbol_to_x_atom): Remove gratuitous arg.
19381 (x_handle_selection_request, lisp_data_to_selection_data)
19382 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19383 (x_own_selection, x_get_local_selection, x_convert_selection):
19384 New arg, specifying work frame. Use terminal-local Vselection_alist.
19385 (some_frame_on_display): Delete unused function.
19386 (Fx_own_selection_internal, Fx_get_selection_internal)
19387 (Fx_disown_selection_internal, Fx_selection_owner_p)
19388 (Fx_selection_exists_p): New optional frame arg.
19389 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19390 (x_handle_selection_clear): Don't treat other terminals with the
19391 same keyboard specially. Use the terminal-local Vselection_alist.
19392 (x_clear_frame_selections): Use Frun_hook_with_args.
19393
19394 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19395
19396 * xterm.h: Add support for those atoms.
19397
19398 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
19399
19400 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19401 (converted_selections, conversion_fail_tag): New global variables.
19402 (x_selection_request_lisp_error): Free the above.
19403 (x_get_local_selection): Remove unnecessary code.
19404 (x_reply_selection_request): Args changed; handle arbitrary array
19405 of converted selections stored in converted_selections.
19406 Separate the XChangeProperty and SelectionNotify steps.
19407 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19408 (x_convert_selection): New function.
19409 (x_handle_selection_event): Simplify.
19410 (x_get_foreign_selection): Don't ignore incoming requests while
19411 waiting for an answer; this will fail when we implement
19412 SAVE_TARGETS, and seems unnecessary anyway.
19413 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19414 (Vx_sent_selection_functions): Doc fix.
19415
19416 2011-05-26 Leo Liu <sdl.web@gmail.com>
19417
19418 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19419
19420 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19421
19422 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19423
19424 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19425 for fringe update if it has periodic bitmap.
19426 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
19427 and fringe_bitmap_periodic_p.
19428
19429 * fringe.c (get_fringe_bitmap_data): New function.
19430 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19431 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19432 row. Mark glyph row for fringe update if periodicity changed.
19433
19434 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19435 for fringe update unless it has periodic bitmap.
19436
19437 2011-05-25 Kenichi Handa <handa@m17n.org>
19438
19439 * xdisp.c (get_next_display_element): Set correct it->face_id for
19440 a static composition.
19441
19442 2011-05-24 Leo Liu <sdl.web@gmail.com>
19443
19444 * deps.mk (fns.o):
19445 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19446
19447 * fns.c (crypto_hash_function, Fsha1): New function.
19448 (Fmd5): Use crypto_hash_function.
19449 (syms_of_fns): Add Ssha1.
19450
19451 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19452
19453 * gnutls.c: Remove unused macros.
19454 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19455 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19456 Remove macros that are defined and never used.
19457 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19458
19459 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19460
19461 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19462 (Fx_get_selection_internal): Minor cleanup.
19463 (Fx_own_selection_internal): Rename arguments for consistency with
19464 select.el.
19465
19466 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19467
19468 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19469
19470 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19471
19472 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19473
19474 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19475
19476 * dispnew.c (scrolling_window): Don't exclude the case that the
19477 last enabled row in the desired matrix touches the bottom boundary.
19478
19479 2011-05-21 Glenn Morris <rgm@gnu.org>
19480
19481 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
19482 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19483 and add some more files.
19484
19485 2011-05-20 Eli Zaretskii <eliz@gnu.org>
19486
19487 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19488 report_file_error introduced by the change from 2011-05-07.
19489
19490 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19491
19492 * systime.h (Time): Define only if emacs is defined.
19493 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19494 where the include path doesn't have X11/X.h by default. See
19495 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19496
19497 2011-05-20 Kenichi Handa <handa@m17n.org>
19498
19499 * composite.c (find_automatic_composition): Fix previous change.
19500
19501 2011-05-20 Glenn Morris <rgm@gnu.org>
19502
19503 * lisp.mk: New file, split from Makefile.in.
19504 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19505 (shortlisp): Remove.
19506 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19507
19508 2011-05-19 Glenn Morris <rgm@gnu.org>
19509
19510 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19511 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19512 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19513 (lisp): Set the order to that of loadup.el.
19514 (shortlisp): Make it a copy of $lisp.
19515 (SOME_MACHINE_LISP): Remove.
19516 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19517 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19518
19519 2011-05-18 Kenichi Handa <handa@m17n.org>
19520
19521 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19522 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19523 (find_automatic_composition): Mostly rewrite for efficiency.
19524
19525 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
19526
19527 * makefile.w32-in: Update dependencies.
19528
19529 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19530
19531 * menu.c: Include limits.h (fixes the MS-Windows build broken by
19532 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
19533
19534 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
19535
19536 Fix some integer overflow issues, such as string length overflow.
19537
19538 * insdel.c (count_size_as_multibyte): Check for string overflow.
19539
19540 * character.c (lisp_string_width): Check for string overflow.
19541 Use EMACS_INT, not int, for string indexes and lengths; in
19542 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19543 the resulting string length overflows an EMACS_INT; instead,
19544 report a string overflow if no precision given. When checking for
19545 precision exhaustion, use a check that cannot possibly have
19546 integer overflow. (Bug#8675)
19547 * character.h (lisp_string_width): Adjust to new signature.
19548
19549 * alloc.c (string_overflow): New function.
19550 (Fmake_string): Use it. This doesn't change behavior, but saves
19551 a few bytes and will simplify future changes.
19552 * character.c (string_escape_byte8): Likewise.
19553 * lisp.h (string_overflow): New decl.
19554
19555 Fixups, following up to the user-interface timestamp change.
19556 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19557 for UI timestamps, instead of unsigned long.
19558 * msdos.c (mouse_get_pos): Likewise.
19559 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
19560 * w32gui.h (Time): Define by including "systime.h" rather than by
19561 declaring it ourselves. (Bug#8664)
19562
19563 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19564 * image.c (clear_image_cache): Likewise.
19565
19566 * term.c (term_mouse_position): Don't assume time_t wraparound.
19567
19568 Be more systematic about user-interface timestamps.
19569 Before, the code sometimes used 'Time', sometimes 'unsigned long',
19570 and sometimes 'EMACS_UINT', to represent these timestamps.
19571 This change causes it to use 'Time' uniformly, as that's what X uses.
19572 This makes the code easier to follow, and makes it easier to catch
19573 integer overflow bugs such as Bug#8664.
19574 * frame.c (Fmouse_position, Fmouse_pixel_position):
19575 Use Time, not unsigned long, for user-interface timestamps.
19576 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19577 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19578 * keyboard.h (last_event_timestamp): Likewise.
19579 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19580 * menu.h (xmenu_show): Likewise.
19581 * term.c (term_mouse_position): Likewise.
19582 * termhooks.h (struct input_event.timestamp): Likewise.
19583 (struct terminal.mouse_position_hook): Likewise.
19584 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19585 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19586 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19587 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19588 what it was before.
19589 * menu.h, termhooks.h: Include "systime.h", for Time.
19590
19591 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19592 Don't assume that the difference between two unsigned long values
19593 can fit into an integer. At this point, we know button_down_time
19594 <= event->timestamp, so the difference must be nonnegative, so
19595 there's no need to cast the result if double-click-time is
19596 nonnegative, as it should be; check that it's nonnegative, just in
19597 case. This bug is triggered when events are more than 2**31 ms
19598 apart (about 25 days). (Bug#8664)
19599
19600 * xselect.c (last_event_timestamp): Remove duplicate decl.
19601 (x_own_selection): Remove needless cast to unsigned long.
19602
19603 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19604 that always fit in int. Use a sentinel instead of a counter, to
19605 avoid a temp and to allay GCC's concerns about possible int overflow.
19606 * frame.h (struct frame): Use int for menu_bar_items_used
19607 instead of EMACS_INT, since it always fits in int.
19608
19609 * menu.c (grow_menu_items): Check for int overflow.
19610
19611 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19612
19613 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19614 Before, the code was not consistent. These values cannot exceed
19615 2**31 - 1 so there's no need to make them unsigned.
19616 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19617 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19618 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19619 as modifiers.
19620 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19621
19622 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19623 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19624 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19625 presumably because the widths might not match.
19626
19627 * window.c (size_window): Avoid needless test at loop start.
19628
19629 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19630
19631 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19632
19633 2011-05-12 Drew Adams <drew.adams@oracle.com>
19634
19635 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19636
19637 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19638
19639 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19640 `width' to `bar_area_x' and `bar_area_width', respectively.
19641 (x_scroll_run): Take account of fringe background extension.
19642
19643 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19644 Rename local vars `left' and `width' to `bar_area_x' and
19645 `bar_area_width', respectively.
19646 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19647 background extension.
19648
19649 2011-05-10 Jim Meyering <meyering@redhat.com>
19650
19651 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19652
19653 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
19654
19655 * image.c (Finit_image_library): Return t for built-in image types,
19656 like pbm and xbm. (Bug#8640)
19657
19658 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19659
19660 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19661
19662 2011-05-07 Eli Zaretskii <eliz@gnu.org>
19663
19664 * w32console.c (Fset_screen_color): Doc fix.
19665 (Fget_screen_color): New function.
19666 (syms_of_ntterm): Defsubr it.
19667
19668 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19669 unlink the temporary file if Fcall_process didn't create it in the
19670 first place.
19671 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19672 child process will be redirected to a file specified with `:file'.
19673 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19674 cue to call_process_cleanup not to close that handle.
19675
19676 2011-05-07 Ben Key <bkey76@gmail.com>
19677
19678 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19679 one of two shell specific rules, either bootstrap-temacs-CMD or
19680 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19681 to the previous implementation of the bootstrap-temacs rule.
19682 The bootstrap-temacs-CMD rule is similar to the previous
19683 implementation of the bootstrap-temacs rule except that it
19684 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19685 variable.
19686
19687 These changes, along with some changes to nt/configure.bat,
19688 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19689 earlier fix to add support for --cflags and --ldflags options
19690 that include quotes so that it works whether make uses cmd or
19691 sh as the shell.
19692
19693 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
19694
19695 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19696 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19697 is a constant.
19698 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19699 a string. Handle both cases.
19700 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19701 (Fdbus_register_method): Use Qinvalid_function.
19702
19703 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19704
19705 * makefile.w32-in: Update dependencies.
19706 (LISP_H): Add inttypes.h and stdin.h.
19707 (PROCESS_H): Add unistd.h.
19708
19709 2011-05-06 Eli Zaretskii <eliz@gnu.org>
19710
19711 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19712 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19713
19714 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
19715
19716 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19717
19718 * term.c (vfatal): Remove stray call to va_end.
19719 It's not needed and the C Standard doesn't allow it here anyway.
19720
19721 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19722 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19723
19724 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19725 bytes.
19726
19727 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19728
19729 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19730
19731 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19732
19733 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19734
19735 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19736
19737 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19738 * charset.c (Fdefine_charset_internal): Don't initialize
19739 charset.code_space[15]. The value was garbage, on hosts with
19740 32-bit int (Bug#8600).
19741
19742 * lread.c (read_integer): Be more consistent with string-to-number.
19743 Use string_to_number to do the actual conversion; this avoids
19744 rounding errors and fixes some other screwups. Without this fix,
19745 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19746 (digit_to_number): Move earlier, for benefit of read_integer.
19747 Return -1 if the digit is out of range for the base, -2 if it is
19748 not a digit in any supported base. (Bug#8602)
19749
19750 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19751
19752 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19753 to match comment at start of function. This also removes a
19754 GCC warning about overflow in a 32+64-bit port.
19755
19756 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19757
19758 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19759 Reported by Stefan Monnier in
19760 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
19761 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19762 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
19763
19764 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19765 (EMACS_UINTPTR): Likewise, with uintptr_t.
19766
19767 * lisp.h: Prefer 64-bit EMACS_INT if available.
19768 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19769 on 32-bit hosts that have 64-bit int, so that they can access
19770 large files.
19771 However, temporarily disable this change unless the temporary
19772 symbol WIDE_EMACS_INT is defined.
19773
19774 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19775
19776 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19777 This removes an assumption that EMACS_INT and long are the same
19778 width as pointers. The assumption is true for Emacs porting targets
19779 now, but we want to make other targets possible.
19780 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19781 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19782 In the rest of the code, change types of integers that hold casted
19783 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19784 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19785 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19786 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19787 No need to cast type when ORing.
19788 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19789 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19790 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19791 assume EMACS_INT is the same width as char *.
19792 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19793 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19794 Remove no-longer-needed casts.
19795 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19796 (xg_tool_bar_help_callback, xg_make_tool_item):
19797 Use EMACS_INTPTR to hold an integer
19798 that will be cast to void *; this can avoid a GCC warning
19799 if EMACS_INT is not the same width as void *.
19800 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19801 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19802 (current_message_1, set_message_1):
19803 Use a local to convert to proper width without a cast.
19804 * xmenu.c (dialog_selection_callback): Likewise.
19805
19806 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19807 Also, don't assume VALBITS / RAND_BITS is less than 5,
19808 and don't rely on undefined behavior when shifting a 1 left into
19809 the sign bit.
19810 * lisp.h (get_random): Change signature to match.
19811
19812 * lread.c (hash_string): Use size_t, not int, for hash computation.
19813 Normally we prefer signed values; but hashing is special, because
19814 it's better to use unsigned division on hash table sizes so that
19815 the remainder is nonnegative. Also, size_t is the natural width
19816 for hashing into memory. The previous code used 'int', which doesn't
19817 retain enough info to hash well into very large tables.
19818 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19819
19820 * dbusbind.c: Don't possibly lose pointer info when converting.
19821 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19822 Use XPNTR rather than XHASH, so that the high-order bits of
19823 the pointer aren't lost when converting through void *.
19824
19825 * eval.c (Fautoload): Don't double-shift a pointer.
19826
19827 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19828
19829 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19830
19831 * gnutls.c (DEF_GNUTLS_FN):
19832 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19833
19834 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19835
19836 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19837 marker. (Bug#8610)
19838
19839 2011-05-05 Eli Zaretskii <eliz@gnu.org>
19840
19841 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19842 New version that can reserve upto 2GB of heap space.
19843
19844 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
19845
19846 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19847
19848 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19849
19850 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19851 `gnutls_certificate_set_x509_key_file'.
19852
19853 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
19854
19855 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19856 Update dependencies.
19857
19858 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19859
19860 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19861 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19862 Remove unused parameter `fildes'.
19863 * process.c (read_process_output, send_process): Don't pass it.
19864
19865 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19866
19867 Fix previous change: the library cache is defined in w32.c.
19868 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19869 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19870
19871 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19872
19873 Implement dynamic loading of GnuTLS on Windows.
19874
19875 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19876 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19877 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19878 Declare.
19879
19880 * gnutls.c (Qgnutls_dll): Define.
19881 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19882 (gnutls_*): Declare function pointers.
19883 (init_gnutls_functions): New function to initialize function pointers.
19884 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19885 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19886 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19887 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19888 (emacs_gnutls_write, emacs_gnutls_read)
19889 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19890 (Fgnutls_available_p): New function.
19891 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19892 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19893 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19894
19895 * image.c: Include w32.h.
19896 (Vimage_type_cache): Delete.
19897 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19898 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19899 (w32_delayed_load): Move to w32.c.
19900
19901 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19902
19903 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19904 (w32_delayed_load): Move from image.c. When loading a library, record
19905 its filename in the :loaded-from property of the library id.
19906 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19907 Initialize and staticpro them.
19908 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19909
19910 * process.c: Include lisp.h before w32.h, not after.
19911 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19912 instead of gnutls_record_check_pending.
19913
19914 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19915
19916 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19917
19918 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19919 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19920 as passed in.
19921
19922 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19923
19924 * xterm.c (x_set_frame_alpha): Do not set property on anything
19925 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19926
19927 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19928
19929 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19930
19931 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19932
19933 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19934 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19935 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19936 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19937 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19938 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19939 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19940 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19941 (Qgnutls_bootprop_callbacks_verify): Make static.
19942
19943 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19944
19945 * callproc.c: Indentation fixup.
19946
19947 * sysdep.c (wait_for_termination_1): Make static.
19948 (wait_for_termination, interruptible_wait_for_termination):
19949 Move after wait_for_termination_1.
19950
19951 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19952
19953 * sysdep.c (interruptible_wait_for_termination): New function
19954 which is like wait_for_termination, but allows keyboard
19955 interruptions.
19956
19957 * callproc.c (Fcall_process): Add (:file "file") as an option for
19958 the STDOUT buffer.
19959 (Fcall_process_region): Ditto.
19960
19961 2011-04-30 Eli Zaretskii <eliz@gnu.org>
19962
19963 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19964 rather than `XVECTOR (FOO)->size'.
19965
19966 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19967 inttypes.h, as a gnulib replacement is used if it not available in
19968 system headers.
19969
19970 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19971
19972 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19973 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19974 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19975
19976 * coding.c (coding_alloc_by_realloc): Error out if destination
19977 will grow beyond MOST_POSITIVE_FIXNUM.
19978 (decode_coding_emacs_mule): Abort if there isn't enough place in
19979 charbuf for the composition carryover bytes. Reserve an extra
19980 space for up to 2 characters produced in a loop.
19981 (decode_coding_iso_2022): Abort if there isn't enough place in
19982 charbuf for the composition carryover bytes.
19983
19984 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19985
19986 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19987 aborting when %lld or %lll format is passed.
19988 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19989 %llo or %llx format is passed. (Bug#8545)
19990
19991 * window.c (window_scroll_line_based): Use a marker instead of
19992 simple variables to record original value of point. (Bug#7952)
19993
19994 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19995 produced by %s or %c overflows available buffer space. (Bug#8545)
19996
19997 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19998
19999 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20000 (SIZE_MAX): Move defn after all includes, as they might #define it.
20001
20002 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20003
20004 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20005
20006 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20007
20008 * keyboard.c (Qdelayed_warnings_hook): Define.
20009 (command_loop_1): Run `delayed-warnings-hook'
20010 if Vdelayed_warnings_list is non-nil.
20011 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20012 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20013
20014 2011-04-28 Eli Zaretskii <eliz@gnu.org>
20015
20016 * doprnt.c (doprnt): Don't return value smaller than the buffer
20017 size if the message was truncated. (Bug#8545).
20018
20019 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20020
20021 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20022 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20023
20024 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20025
20026 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20027
20028 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
20029
20030 * makefile.w32-in: Update dependencies.
20031
20032 2011-04-27 Eli Zaretskii <eliz@gnu.org>
20033
20034 Improve `doprnt' and its usage. (Bug#8545)
20035 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20036 `format_end'. Remove support for %l as a conversion specifier.
20037 Don't use xrealloc. Improve diagnostics when the %l size modifier
20038 is used. Update the commentary.
20039
20040 * eval.c (verror): Simplify calculation of size_t.
20041
20042 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20043 messages.
20044
20045 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20046
20047 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20048 change.
20049
20050 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20051
20052 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20053 This makes this file independent of the recent pseudovector change.
20054
20055 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
20056
20057 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20058
20059 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20060 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20061 Remove unused local.
20062 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20063
20064 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
20065 GCC 4.6.0 optimizes based on type-based alias analysis.
20066 For example, if b is of type struct buffer * and v of type struct
20067 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20068 != &v->size, and therefore "v->size = 1; b->size = 2; return
20069 v->size;" must therefore return 1. This assumption is incorrect
20070 for Emacs, since it type-puns struct Lisp_Vector * with many other
20071 types. To fix this problem, this patch adds a new type struct
20072 vectorlike_header that documents the constraints on layout of vectors
20073 and pseudovectors, and helps optimizing compilers not get fooled
20074 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20075 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20076 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20077 the size member.
20078 (XSETPVECTYPE): Rewrite in terms of new macro.
20079 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20080 This is a bit clearer, and further avoids the possibility of
20081 undesirable aliasing.
20082 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20083 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20084 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20085 since Lisp_Subr is a special case (no "next" field).
20086 (ASIZE): Now uses header.size rather than size.
20087 All previous uses of XVECTOR (foo)->size replaced to use this macro,
20088 to avoid the hassle of writing XVECTOR (foo)->header.size.
20089 (struct vectorlike_header): New type.
20090 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20091 object, to help avoid aliasing.
20092 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20093 (SUBRP): Likewise, since Lisp_Subr is a special case.
20094 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20095 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20096 (struct Lisp_Hash_Table): Combine first two members into a single
20097 struct vectorlike_header member. All uses of "size" and "next" members
20098 changed to be "header.size" and "header.next".
20099 * buffer.h (struct buffer): Likewise.
20100 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20101 * frame.h (struct frame): Likewise.
20102 * process.h (struct Lisp_Process): Likewise.
20103 * termhooks.h (struct terminal): Likewise.
20104 * window.c (struct save_window_data, struct saved_window): Likewise.
20105 * window.h (struct window): Likewise.
20106 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20107 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20108 * buffer.c (init_buffer_once): Likewise.
20109 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20110 special case.
20111 * process.c (Fformat_network_address): Use local var for size,
20112 for brevity.
20113
20114 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20115
20116 Make the Lisp reader and string-to-float more consistent (Bug#8525)
20117 * data.c (atof): Remove decl; no longer used or needed.
20118 (digit_to_number): Move to lread.c.
20119 (Fstring_to_number): Use new string_to_number function, to be
20120 consistent with how the Lisp reader treats infinities and NaNs.
20121 Do not assume that floating-point numbers represent EMACS_INT
20122 without losing information; this is not true on most 64-bit hosts.
20123 Avoid double-rounding errors, by insisting on integers when
20124 parsing non-base-10 numbers, as the documentation specifies.
20125 * lisp.h (string_to_number): New decl, replacing ...
20126 (isfloat_string): Remove.
20127 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
20128 (read1): Do not accept +. and -. as integers; this
20129 appears to have been a coding error. Similarly, do not accept
20130 strings like +-1e0 as floating point numbers. Do not report
20131 overflow for integer overflows unless the base is not 10 which
20132 means we have no simple and reliable way to continue.
20133 Break out the floating-point parsing into a new
20134 function string_to_number, so that Fstring_to_number parses
20135 floating point numbers consistently with the Lisp reader.
20136 (digit_to_number): Move here from data.c. Make it static inline.
20137 (E_CHAR, EXP_INT): Remove, replacing with ...
20138 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20139 (string_to_number): New function, replacing isfloat_string.
20140 This function checks for valid syntax and produces the resulting
20141 Lisp float number too. Rework it so that string-to-number
20142 no longer mishandles examples like "1.0e+". Use strtoumax,
20143 so that overflow for non-base-10 numbers is reported only when
20144 there's no portable and simple way to convert to floating point.
20145
20146 * textprop.c (set_text_properties_1): Rewrite for clarity,
20147 and to avoid GCC warning about integer overflow.
20148
20149 * intervals.h (struct interval): Use EMACS_INT for members
20150 where EMACS_UINT might cause problems. See
20151 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20152 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20153 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20154 All uses changed.
20155 (offset_intervals): Tell GCC not to worry about length overflow
20156 when negating a negative length.
20157
20158 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20159 (overrun_check_free): Likewise.
20160
20161 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20162 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20163 word size.
20164
20165 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20166 (gnutls_make_error): Rename local to avoid shadowing.
20167 (gnutls_emacs_global_deinit): ifdef out; not used.
20168 (Fgnutls_boot): Use const for pointer to readonly storage.
20169 Comment out unused local. Fix pointer signedness problems.
20170
20171 * lread.c (openp): Don't stuff size_t into an 'int'.
20172 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20173 about possible signed overflow.
20174
20175 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20176 (GDK_KEY_g): Don't define if already defined.
20177 (xg_prepare_tooltip): Avoid pointer signedness problem.
20178 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20179
20180 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20181 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20182
20183 * xfns.c (Fx_window_property): Simplify a bit,
20184 to make a bit faster and to avoid GCC 4.6.0 warning.
20185 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20186
20187 * fns.c (internal_equal): Don't assume size_t fits in int.
20188
20189 * alloc.c (compact_small_strings): Tighten assertion a little.
20190
20191 Replace pEd with more-general pI, and fix some printf arg casts.
20192 * lisp.h (pI): New macro, generalizing old pEd macro to other
20193 conversion specifiers. For example, use "...%"pI"d..." rather
20194 than "...%"pEd"...".
20195 (pEd): Remove. All uses replaced with similar uses of pI.
20196 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20197 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20198 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20199 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20200 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20201 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20202 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20203 64-bit hosts.
20204 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20205 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20206 * print.c (safe_debug_print, print_object): Likewise.
20207 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20208 to int.
20209 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20210 avoiding the 0 flag, which is not portable.
20211 * process.c (Fmake_network_process): Use pI to avoid cast.
20212 * region-cache.c (pp_cache): Likewise.
20213 * xdisp.c (decode_mode_spec): Likewise.
20214 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20215 behavior on 64-bit hosts with printf arg.
20216 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20217 (x_stop_queuing_selection_requests): Likewise.
20218 (x_get_window_property): Don't truncate byte count to an 'int'
20219 when tracing.
20220
20221 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20222 here, since it parses constructs like leading '-' and spaces,
20223 which are not wanted; and it overflows with large numbers.
20224 Instead, simply match F[0-9]+, which is what is wanted anyway.
20225
20226 * alloc.c: Remove unportable assumptions about struct layout.
20227 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20228 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20229 (allocate_vectorlike, make_pure_vector): Use the new macros,
20230 plus offsetof, to remove unportable assumptions about struct layout.
20231 These assumptions hold on all porting targets that I know of, but
20232 they are not guaranteed, they're easy to remove, and removing them
20233 makes further changes easier.
20234
20235 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20236 This doesn't fix a bug but makes the code clearer.
20237 (string_overrun_cookie): Now const. Use initializers that
20238 don't formally overflow signed char, to avoid warnings.
20239 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20240 can cause Emacs to crash when string overrun checking is enabled.
20241 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20242 multiple of sizeof (EMACS_INT); it need not be, if
20243 alignof(EMACS_INT) < sizeof (EMACS_INT).
20244 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20245
20246 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
20247
20248 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20249
20250 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20251
20252 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20253 supposed to be handshaking. (Bug#8556)
20254 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20255
20256 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
20257
20258 * lisp.h (Qdebug): List symbol.
20259 * eval.c (Qdebug): Restore global linkage.
20260 * keyboard.c (debug-on-event): New variable.
20261 (handle_user_signal): Break into debugger when debug-on-event
20262 matches the current signal symbol.
20263
20264 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20265
20266 * alloc.c (check_sblock, check_string_bytes)
20267 (check_string_free_list): Convert to standard C.
20268
20269 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20270
20271 * w32.c (emacs_gnutls_push): Fix typo.
20272
20273 2011-04-25 Eli Zaretskii <eliz@gnu.org>
20274
20275 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20276 "cast to pointer from integer of different size".
20277
20278 Improve doprnt and its use in verror. (Bug#8545)
20279 * doprnt.c (doprnt): Document the set of format control sequences
20280 supported by the function. Use SAFE_ALLOCA instead of always
20281 using `alloca'.
20282
20283 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20284 is one byte too soon. Don't use xrealloc; instead xfree and
20285 xmalloc anew.
20286
20287 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20288
20289 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20290 callbacks stage.
20291
20292 * gnutls.c: Renamed global_initialized to
20293 gnutls_global_initialized. Added internals for the
20294 :verify-hostname-error, :verify-error, and :verify-flags
20295 parameters of `gnutls-boot' and documented those parameters in the
20296 docstring. Start callback support.
20297 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20298 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20299 on error. Return error code.
20300 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20301 (emacs_gnutls_read): Likewise.
20302 (Fgnutls_boot): Return handshake error code.
20303 (emacs_gnutls_handle_error): New function.
20304 (wsaerror_to_errno): Likewise.
20305
20306 * w32.h (emacs_gnutls_pull): Add prototype.
20307 (emacs_gnutls_push): Likewise.
20308
20309 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20310 (emacs_gnutls_push): Likewise.
20311
20312 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20313
20314 * process.c (wait_reading_process_output): Check if GnuTLS
20315 buffered some data internally if no FDs are set for TLS
20316 connections.
20317
20318 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20319 (LIBS): Link to USER_LIBS.
20320 ($(BLD)/gnutls.$(0)): New target.
20321
20322 2011-04-24 Eli Zaretskii <eliz@gnu.org>
20323
20324 * xdisp.c (handle_single_display_spec): Rename the
20325 display_replaced_before_p argument into display_replaced_p, to
20326 make it consistent with the commentary. Fix typos in the
20327 commentary.
20328
20329 * textprop.c (syms_of_textprop): Remove dead code.
20330 (copy_text_properties): Delete obsolete commentary about an
20331 interface that was deleted long ago. Fix typos in the description
20332 of arguments.
20333
20334 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20335 to changes in oldXMenu/XMenu.h from 2011-04-16.
20336 <menu_help_message, prev_menu_help_message>: Constify.
20337 (IT_menu_make_room): menu->help_text is now `const char **';
20338 adjust.
20339
20340 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20341 to changes in oldXMenu/XMenu.h from 2011-04-16.
20342 (struct XMenu): Declare `help_text' `const char **'.
20343
20344 * xfaces.c <Qunspecified>: Make extern again.
20345
20346 * syntax.c: Include sys/types.h before including regex.h, as
20347 required by POSIX.
20348
20349 * doc.c (get_doc_string): Improve the format passed to `error'.
20350
20351 * doprnt.c (doprnt): Improve commentary.
20352
20353 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20354
20355 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20356 them with etags.
20357
20358 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20359 changes in globals.h immediately force recompilation.
20360 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20361 $(CURDIR)/s/ms-w32.h.
20362 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20363
20364 * character.c (Fchar_direction): Function deleted.
20365 (syms_of_character): Don't defsubr it.
20366 <char-direction-table>: Deleted.
20367
20368 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20369
20370 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20371 * doprnt.c: Include limits.h.
20372 (SIZE_MAX): New macro.
20373 (doprnt): Return a size_t value. 2nd arg is now size_t.
20374 Many local variables are now size_t instead of int or unsigned.
20375 Improve overflow protection. Support `l' modifier for integer
20376 conversions. Support %l conversion. Don't assume an EMACS_INT
20377 argument for integer conversions and for %c.
20378
20379 * lisp.h (doprnt): Restore prototype.
20380
20381 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20382 $(SRC)/character.h.
20383
20384 * Makefile.in (base_obj): Add back doprnt.o.
20385
20386 * deps.mk (doprnt.o): Add back prerequisites.
20387 (callint.o): Depend on character.h.
20388
20389 * eval.c (internal_lisp_condition_case): Include the handler
20390 representation in the error message.
20391 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20392 when breaking from the loop.
20393
20394 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20395
20396 * callint.c (Fcall_interactively): When displaying error message
20397 about invalid control letter, pass the character's codepoint, not
20398 a pointer to its multibyte form. Improve display of the character
20399 in octal and display also its hex code.
20400
20401 * character.c (char_string): Use %x to display the (unsigned)
20402 codepoint of an invalid character, to avoid displaying a bogus
20403 negative value.
20404
20405 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20406 `error', not SYMBOL_NAME itself.
20407
20408 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20409 character arguments to `error'.
20410
20411 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20412 to `error' in error message about FINAL_CHAR argument. Make sure
20413 FINAL_CHAR is a character, and use %c when it is passed as
20414 argument to `error'.
20415
20416 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20417
20418 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20419
20420 * w32.c: Include <time.h>.
20421 (sys_localtime): New function.
20422
20423 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
20424
20425 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20426
20427 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
20428
20429 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
20430
20431 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20432 zombies (Bug#8467).
20433
20434 2011-04-19 Eli Zaretskii <eliz@gnu.org>
20435
20436 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20437 gl_state.e_property when gl_state.object is Qt.
20438
20439 * insdel.c (make_gap_larger): Remove limitation of buffer size
20440 to <= INT_MAX.
20441
20442 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
20443
20444 * xdisp.c (lookup_glyphless_char_display)
20445 (produce_glyphless_glyph): Handle cons cell entry in
20446 glyphless-char-display.
20447 (Vglyphless_char_display): Document it.
20448
20449 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20450 glyphless-char-display.
20451
20452 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
20453
20454 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20455
20456 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20457
20458 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20459 definition for no-X builds.
20460
20461 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
20462
20463 Static checks with GCC 4.6.0 and non-default toolkits.
20464
20465 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20466
20467 * process.c (keyboard_bit_set): Define only if SIGIO.
20468 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20469 (send_process): Repair possible setjmp clobbering.
20470
20471 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20472
20473 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20474
20475 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20476
20477 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20478 Define only if needed.
20479
20480 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20481 by pacifying GCC about it. Maybe it's time to retire it?
20482 * xfaces.c (USG, __TIMEVAL__): Likewise.
20483
20484 * dispextern.h (struct redisplay_interface): Rename param
20485 to avoid shadowing.
20486 * termhooks.h (struct terminal): Likewise.
20487 * xterm.c (xembed_send_message): Likewise.
20488
20489 * insdel.c (make_gap_smaller): Define only if
20490 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20491
20492 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20493 it.
20494
20495 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20496 so that we aren't warned about unused symbols.
20497
20498 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20499
20500 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
20501
20502 * xfns.c (x_real_positions): Mark locals as initialized.
20503
20504 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20505
20506 * xterm.c: Fix problems found by static analysis with other toolkits.
20507 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
20508 (x_dispatch_event): Declare static if USE_GTK, and
20509 define if USE_GTK || USE_X_TOOLKIT.
20510 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
20511 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
20512 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20513 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
20514
20515 * xmenu.c (menu_help_callback): Pointer type fixes.
20516 Use const pointers when pointing at readonly data. Avoid pointer
20517 signedness clashes.
20518 (FALSE): Remove unused macro.
20519 (update_frame_menubar): Remove unused decl.
20520
20521 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20522
20523 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20524 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20525 (single_menu_item): Rename local to avoid shadowing.
20526
20527 * keyboard.c (make_lispy_event): Remove unused local var.
20528
20529 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20530 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20531
20532 * bitmaps: Change bitmaps from unsigned char back to the X11
20533 compatible char. Avoid the old compiler warnings about
20534 out-of-range initializers by using, for example, '\xab' rather
20535 than 0xab.
20536
20537 * xgselect.c (xgselect_initialize): Check vs interface
20538 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20539
20540 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20541
20542 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20543 to read-only memory.
20544
20545 * fns.c (vector): Remove; this old hack is no longer needed.
20546
20547 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
20548 Remove unused var.
20549 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
20550
20551 * xrdb.c (x_load_resources): Omit unused local.
20552
20553 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
20554 (x_window): Rename locals to avoid shadowing.
20555 (USG): Use the kludged USG macro, to pacify gcc.
20556
20557 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
20558 (x_term_init): Remove local to avoid shadowing.
20559
20560 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
20561
20562 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20563 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20564
20565 2011-04-16 Eli Zaretskii <eliz@gnu.org>
20566
20567 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20568
20569 Fix regex.c, syntax.c and friends for buffers > 2GB.
20570 * syntax.h (struct gl_state_s): Declare character position members
20571 EMACS_INT.
20572
20573 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20574
20575 * textprop.c (verify_interval_modification, interval_of):
20576 Declare arguments EMACS_INT.
20577
20578 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20579 EMACS_INT.
20580
20581 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20582
20583 * indent.c (Fvertical_motion): Local variable it_start is now
20584 EMACS_INT.
20585
20586 * regex.c (re_match, re_match_2, re_match_2_internal)
20587 (bcmp_translate, regcomp, regexec, print_double_string)
20588 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20589 (re_compile_pattern, re_exec): Declare arguments and local
20590 variables `size_t' and `ssize_t' and return values `regoff_t', as
20591 appropriate.
20592 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20593 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20594 <compile_stack_type>: `size' and `avail' are now `size_t'.
20595
20596 * regex.h <regoff_t>: Use ssize_t, not int.
20597 (re_search, re_search_2, re_match, re_match_2): Arguments that
20598 specify buffer/string position and length are now ssize_t and
20599 size_t. Return type is regoff_t.
20600
20601 2011-04-16 Ben Key <bkey76@gmail.com>
20602
20603 * nsfont.m: Fixed bugs in ns_get_family and
20604 ns_descriptor_to_entity that were caused by using free to
20605 deallocate memory blocks that were allocated by xmalloc (via
20606 xstrdup). This caused Emacs to crash when compiled with
20607 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20608 --enable-checking=xmallocoverrun). xfree is now used to
20609 deallocate these memory blocks.
20610
20611 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
20612
20613 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20614
20615 emacs_write: Accept and return EMACS_INT for sizes.
20616 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20617 et seq.
20618 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20619 Accept and return EMACS_INT.
20620 (emacs_gnutls_write): Return the number of bytes written on
20621 partial writes.
20622 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
20623 (emacs_read, emacs_write): Remove check for negative size, as the
20624 Emacs source code has been audited now.
20625 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20626 (emacs_read, emacs_write): Use it.
20627 * process.c (send_process): Adjust to the new signatures of
20628 emacs_write and emacs_gnutls_write. Do not attempt to store
20629 a byte offset into an 'int'; it might overflow.
20630 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
20631
20632 * sound.c: Don't assume sizes fit in 'int'.
20633 (struct sound_device.period_size, alsa_period_size):
20634 Return EMACS_INT, not int.
20635 (struct sound_device.write, vox_write, alsa_write):
20636 Accept EMACS_INT, not int.
20637 (wav_play, au_play): Use EMACS_INT to store sizes and to
20638 record read return values.
20639
20640 2011-04-15 Ben Key <bkey76@gmail.com>
20641
20642 * keyboard.c (Qundefined): Don't declare static since it is used
20643 in nsfns.m.
20644 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20645 static since they are used in nsfont.m.
20646
20647 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20648
20649 * process.c (Qprocessp): Don't declare static.
20650 * lisp.h (Qprocessp): Declare again.
20651
20652 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
20653
20654 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20655
20656 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20657
20658 Improve C-level modularity by making more things 'static'.
20659
20660 Don't publish debugger-only interfaces to other modules.
20661 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20662 (verify_bytepos, count_markers): Move decls to the only modules
20663 that need them.
20664 * region-cache.h (pp_cache): Likewise.
20665 * window.h (check_all_windows): Likewise.
20666 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20667
20668 * sysdep.c (croak): Now static, if
20669 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20670 * syssignal.h (croak): Declare only if not static.
20671
20672 * alloc.c (refill_memory_reserve): Now static if
20673 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20674 * lisp.h (refill_memory_reserve): Declare only if not static.
20675
20676 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20677 Define only if USE_LUCID.
20678
20679 * xrdb.c (x_customization_string, x_rm_string): Now static.
20680
20681 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20682 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20683
20684 * xdisp.c (draw_row_with_mouse_face): Now static.
20685 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20686
20687 * window.h (check_all_windows): Mark externally visible.
20688
20689 * window.c (window_deletion_count): Now static.
20690
20691 * undo.c: Make symbols static if they're not exported.
20692 (last_undo_buffer, last_boundary_position, pending_boundary):
20693 Now static.
20694
20695 * textprop.c (interval_insert_behind_hooks): Now static.
20696 (interval_insert_in_front_hooks): Likewise.
20697
20698 * term.c: Make symbols static if they're not exported.
20699 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20700 (max_frame_lines, tty_set_terminal_modes):
20701 (tty_reset_terminal_modes, tty_turn_off_highlight):
20702 (get_tty_terminal): Now static.
20703 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20704 * termhooks.h (term_mouse_moveto): Do not declare if
20705 HAVE_WINDOW_SYSTEM.
20706 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20707 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20708
20709 * sysdep.c: Make symbols static if they're not exported.
20710 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20711 Now static.
20712 (sigprocmask_set, full_mask): Remove; unused.
20713 (wait_debugging): Mark as visible.
20714 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20715 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20716
20717 * syntax.c (syntax_temp): Define only if !__GNUC__.
20718
20719 * sound.c (current_sound_device, current_sound): Now static.
20720
20721 * search.c (searchbufs, searchbuf_head): Now static.
20722
20723 * scroll.c (scroll_cost): Remove; unused.
20724 * dispextern.h (scroll_cost): Remove decl.
20725
20726 * region-cache.h (pp_cache): Mark as externally visible.
20727
20728 * process.c: Make symbols static if they're not exported.
20729 (process_tick, update_tick, create_process, chan_process):
20730 (Vprocess_alist, proc_buffered_char, datagram_access):
20731 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20732 (deactivate_process): Mark defn as static, as well as decl.
20733 * lisp.h (create_process): Remove decl.
20734 * process.h (chan_process, Vprocess_alist): Remove decls.
20735
20736 * print.c: Make symbols static if they're not exported.
20737 (print_depth, new_backquote_output, being_printed, print_buffer):
20738 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20739 (print_interval, print_number_index, initial_stderr_stream):
20740 Now static.
20741 * lisp.h (Fprinc): Remove decl.
20742 (debug_output_compilation_hack): Mark as externally visible.
20743
20744 * sysdep.c (croak): Move decl from here to syssignal.h.
20745 * syssignal.h (croak): Put it here, so the API can be checked when
20746 'croak' is called from dissociate_if_controlling_tty.
20747
20748 * minibuf.c: Make symbols static if they're not exported.
20749 (minibuf_save_list, choose_minibuf_frame): Now static.
20750 * lisp.h (choose_minibuf_frame): Remove decl.
20751
20752 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20753
20754 * lread.c: Make symbols static if they're not exported.
20755 (read_objects, initial_obarray, oblookup_last_bucket_number):
20756 Now static.
20757 (make_symbol): Remove; unused.
20758 * lisp.h (initial_obarray, make_symbol): Remove decls.
20759
20760 * keyboard.c: Make symbols static if they're not exported.
20761 (single_kboard, recent_keys_index, total_keys, recent_keys):
20762 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20763 (this_single_command_key_start, echoing, last_auto_save):
20764 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20765 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20766 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20767 (Vlispy_mouse_stem, double_click_count):
20768 Now static.
20769 (force_auto_save_soon): Define only if SIGDANGER.
20770 (ignore_mouse_drag_p): Now static if
20771 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20772 (print_help): Remove; unused.
20773 (stop_character, last_timer_event): Mark as externally visible.
20774 * keyboard.h (ignore_mouse_drag_p): Declare only if
20775 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20776 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20777 * lisp.h (echoing): Remove decl.
20778 (force_auto_save_soon): Declare only if SIGDANGER.
20779 * xdisp.c (redisplay_window): Simplify code, to make it more
20780 obvious that ignore_mouse_drag_p is not accessed if !defined
20781 USE_GTK && !defined HAVE_NS.
20782
20783 * intervals.c: Make symbols static if they're not exported.
20784 (merge_properties_sticky, merge_interval_right, delete_interval):
20785 Now static.
20786 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20787
20788 * insdel.c: Make symbols static if they're not exported.
20789 However, leave prepare_to_modify_buffer alone. It's never
20790 called from outside this function, but that appears to be a bug.
20791 (combine_after_change_list, combine_after_change_buffer):
20792 (adjust_after_replace, signal_before_change): Now static.
20793 (adjust_after_replace_noundo): Remove; unused.
20794 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
20795 (signal_before_change): Remove decls.
20796
20797 * indent.c (val_compute_motion, val_vmotion): Now static.
20798
20799 * image.c: Make symbols static if they're not exported.
20800 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20801 if USE_GTK.
20802 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20803 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20804
20805 * fringe.c (standard_bitmaps): Now static.
20806 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20807
20808 * frame.c: Make symbols static if they're not exported.
20809 (x_report_frame_params, make_terminal_frame): Now static.
20810 (get_frame_param): Now static, unless HAVE_NS.
20811 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20812 (x_get_resource_string): Remove; not used.
20813 * frame.h (make_terminal_frame, x_report_frame_params):
20814 (x_get_resource_string); Remove decls.
20815 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20816 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20817
20818 * font.c, fontset.c: Make symbols static if they're not exported.
20819 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20820 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20821 * font.c (font_close_object): Now static.
20822 * font.h (font_close_object): Remove.
20823 * fontset.c (FONTSET_OBJLIST): Remove.
20824 (free_realized_fontset) #if-0 the body, which does nothing.
20825 (face_suitable_for_char_p): #if-0, as it's never called.
20826 * fontset.h (face_suitable_for_char_p): Remove decl.
20827 * xfaces.c (face_at_string_position):
20828 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
20829 since 0 is always ASCII.
20830
20831 * fns.c (weak_hash_tables): Now static.
20832
20833 * fileio.c: Make symbols static if they're not exported.
20834 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20835 (Vwrite_region_annotation_buffers): Now static.
20836
20837 * eval.c: Make symbols static if they're not exported.
20838 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20839 * lisp.h (backtrace_list): Remove decl.
20840
20841 * emacs.c: Make symbols static if they're not exported.
20842 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20843 (fatal_error_code, fatal_error_signal_hook, standard_args):
20844 Now static.
20845 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20846 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20847 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20848 * lisp.h (fatal_error_signal_hook): Remove decl.
20849 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20850
20851 * editfns.c: Move a (normally-unused) function to its only use.
20852 * editfns.c, lisp.h (get_operating_system_release): Remove.
20853 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20854 worth the hassle of breaking this out.
20855
20856 * xterm.c: Make symbols static if they're not exported.
20857 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20858 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20859 (x_destroy_window, x_delete_display):
20860 Now static.
20861 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20862 (x_mouse_leave): Remove; unused.
20863 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20864 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20865 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20866 Remove decls.
20867 (x_mouse_leave): Declare only if WINDOWSNT.
20868 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20869 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20870 USE_X_TOOLKIT.
20871
20872 * ftxfont.c: Make symbols static if they're not exported.
20873 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20874 HAVE_FREETYPE.
20875 * font.h (ftxfont_driver): Likewise.
20876
20877 * xfns.c: Make symbols static if they're not exported.
20878 (x_last_font_name, x_display_info_for_name):
20879 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20880 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20881 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20882 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20883 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20884 (last_show_tip_args): Now static.
20885 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20886 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20887 (x_screen_planes): Remove; unused.
20888 * dispextern.h (x_screen_planes): Remove decl.
20889
20890 * dispnew.c: Make symbols static if they're not exported.
20891 * dispextern.h (redraw_garbaged_frames, scrolling):
20892 (increment_row_positions): Remove.
20893 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20894 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20895 Now static.
20896 (redraw_garbaged_frames): Remove; unused.
20897
20898 * xfaces.c: Make symbols static if they're not exported.
20899 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20900 Remove decls.
20901 * xterm.h (defined_color): Remove decls.
20902 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20903 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20904 (menu_face_changed_default, defined_color, free_realized_face):
20905 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20906 (ascii_face_of_lisp_face): Remove; unused.
20907
20908 * xdisp.c: Make symbols static if they're not exported.
20909 * dispextern.h (scratch_glyph_row, window_box_edges):
20910 (glyph_to_pixel_coords, set_cursor_from_row):
20911 (get_next_display_element, set_iterator_to_next):
20912 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20913 (show_mouse_face): Remove decls
20914 * frame.h (message_buf_print): Likewise.
20915 * lisp.h (pop_message, set_message, check_point_in_composition):
20916 Likewise.
20917 * xterm.h (set_vertical_scroll_bar): Likewise.
20918 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20919 (message_buf_print, scratch_glyph_row, displayed_buffer):
20920 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20921 (get_next_display_element, show_mouse_face, window_box_edges):
20922 (frame_to_window_pixel_xy, check_point_in_composition):
20923 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20924 (glyph_to_pixel_coords): Remove; unused.
20925
20926 * dired.c (file_name_completion): Now static.
20927
20928 * dbusbind.c (xd_in_read_queued_messages): Now static.
20929
20930 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20931 * data.c (circular_list_error): Remove.
20932
20933 * commands.h (last_point_position, last_point_position_buffer):
20934 (last_point_position_window): Remove decls.
20935 * keyboard.c: Make these variables static.
20936
20937 * coding.h (coding, code_convert_region, encode_coding_gap):
20938 Remove decls.
20939 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20940 (iso_code_class, detect_coding, code_convert_region): Now static.
20941 (encode_coding_gap): Remove; unused.
20942
20943 * chartab.c (chartab_chars, chartab_bits): Now static.
20944
20945 * charset.h (charset_iso_8859_1): Remove decl.
20946 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20947 Now static.
20948
20949 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20950 * ccl.c (Vccl_program_table): Now static.
20951 (check_ccl_update): Remove; unused.
20952
20953 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20954 * category.h: ... from here.
20955 * category.c (check_category_table, set_category_set): Now static.
20956
20957 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20958 * lisp.h: Remove these decls.
20959
20960 * buffer.c (buffer_count): Remove unused var.
20961
20962 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20963 so that it's not optimized away.
20964 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20965 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20966 exported only to the debugger.
20967
20968 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
20969 * atimer.h (run_all_atimers): Remove; not exported.
20970
20971 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20972 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20973 was inaccessible from Lisp.
20974 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20975 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20976
20977 alloc.c: Import and export fewer symbols, and remove unused items.
20978 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20979 is defined.
20980 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20981 it's not optimized away by whole-program optimization.
20982 (message_enable_multibyte, free_misc): Remove.
20983 (catchlist, handlerlist, mark_backtrace):
20984 Declare only if BYTE_MARK_STACK.
20985 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20986 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20987 (message_enable_multibyte): Remove decl.
20988 (free_misc, interval_free_list, float_block, float_block_index):
20989 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20990 (cons_free_list, last_marked_index):
20991 Now static.
20992 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20993 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20994 (mark_backtrace): Define only if BYTE_MARK_STACK.
20995 * xdisp.c (message_enable_multibyte): Now static.
20996
20997 Declare Lisp_Object Q* variables to be 'static' if not exported.
20998 This makes it easier for human readers (and static analyzers)
20999 to see whether these variables are used from other modules.
21000 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21001 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21002 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21003 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21004 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21005 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21006 * xmenu.c, xselect.c:
21007 Declare Q* vars static if they are not used in other modules.
21008 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21009 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21010 Remove decls of unexported vars.
21011 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21012
21013 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21014
21015 Make Emacs functions such as Fatom 'static' by default.
21016 This makes it easier for human readers (and static analyzers)
21017 to see whether these functions can be called from other modules.
21018 DEFUN now defines a static function. To make the function external
21019 so that it can be used in other C modules, use the new macro DEFUE.
21020 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21021 (Finit_image_library):
21022 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21023 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21024 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21025 Remove decls, since these functions are now static.
21026 (Funintern, Fget_internal_run_time): New decls, since these functions
21027 were already external.
21028
21029 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21030 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21031 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21032 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21033 * keyboard.c, keymap.c, lread.c:
21034 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21035 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21036 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21037 Mark functions with DEFUE instead of DEFUN,
21038 if they are used in other modules.
21039 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21040 decls for now-static functions.
21041 * buffer.h (Fdelete_overlay): Remove decl.
21042 * callproc.c (Fgetenv_internal): Mark as internal.
21043 * composite.c (Fremove_list_of_text_properties): Remove decl.
21044 (Fcomposition_get_gstring): New forward static decl.
21045 * composite.h (Fcomposite_get_gstring): Remove decl.
21046 * dired.c (Ffile_attributes): New forward static decl.
21047 * doc.c (Fdocumntation_property): New forward static decl.
21048 * eval.c (Ffetch_bytecode): New forward static decl.
21049 (Funintern): Remove extern decl; now in .h file where it belongs.
21050 * fileio.c (Fmake_symbolic_link): New forward static decl.
21051 * image.c (Finit_image_library): New forward static decl.
21052 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21053 * intervals.h (Fprevious_property_change):
21054 (Fremove_list_of_text_properties): Remove decls.
21055 * keyboard.c (Fthis_command_keys): Remove decl.
21056 (Fcommand_execute): New forward static decl.
21057 * keymap.c (Flookup_key): New forward static decl.
21058 (Fcopy_keymap): Now static.
21059 * keymap.h (Flookup_key): Remove decl.
21060 * process.c (Fget_process): New forward static decl.
21061 (Fprocess_datagram_address): Mark as internal.
21062 * syntax.c (Fsyntax_table_p): New forward static decl.
21063 (skip_chars): Remove duplicate decl.
21064 * textprop.c (Fprevious_property_change): New forward static decl.
21065 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21066 Now internal.
21067 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21068 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21069
21070 * editfns.c (Fformat): Remove unreachable code.
21071
21072 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21073
21074 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21075 change. (Bug#8496)
21076
21077 2011-04-13 Eli Zaretskii <eliz@gnu.org>
21078
21079 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21080 when at ZV. (Bug#8487)
21081
21082 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21083
21084 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21085 (Bug#8437)
21086 * keyboard.c (parse_tool_bar_item): Likewise.
21087 * sound.c (sound_cleanup, alsa_close): Likewise.
21088 * termcap.c (tgetent): Likewise.
21089 * xfns.c (x_default_font_parameter): Likewise.
21090 * xsettings.c (read_and_apply_settings): Likewise.
21091
21092 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21093 (overrun_check_free): Protoize.
21094
21095 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21096
21097 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21098 since callers should never pass a negative size.
21099 Change the signature to match that of plain 'read' and 'write'; see
21100 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21101 * lisp.h: Update prototypes of emacs_write and emacs_read.
21102
21103 2011-04-11 Eli Zaretskii <eliz@gnu.org>
21104
21105 * xdisp.c (redisplay_window): Don't try to determine the character
21106 position of the scroll margin if the window start point w->startp
21107 is outside the buffer's accessible region. (Bug#8468)
21108
21109 2011-04-10 Eli Zaretskii <eliz@gnu.org>
21110
21111 Fix write-region and its subroutines for buffers > 2GB.
21112 * fileio.c (a_write, e_write): Modify declaration of arguments and
21113 local variables to support buffers larger than 2GB.
21114 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21115
21116 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21117 argument, local variables, and return value.
21118
21119 * lisp.h: Update prototypes of emacs_write and emacs_read.
21120
21121 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21122
21123 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
21124
21125 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21126
21127 Fix more problems found by GCC 4.6.0's static checks.
21128
21129 * xdisp.c (vmessage): Use a better test for character truncation.
21130
21131 * charset.c (load_charset_map): <, not <=, for optimization,
21132 and to avoid potential problems with integer overflow.
21133 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
21134 * casetab.c (set_identity, shuffle): Likewise.
21135 * editfns.c (Fformat): Likewise.
21136 * syntax.c (skip_chars): Likewise.
21137
21138 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21139 This also lets GCC 4.6.0 generate slightly better loop code.
21140
21141 * callint.c (Fcall_interactively): <, not <=, for optimization.
21142 (Fcall_interactively): Count the number of arguments produced,
21143 not the number of arguments given. This is simpler and lets GCC
21144 4.6.0 generate slightly better code.
21145
21146 * ftfont.c: Distingish more carefully between FcChar8 and char.
21147 The previous code passed unsigned char * to a functions like
21148 strlen and xstrcasecmp that expect char *, which does not
21149 conform to the C standard.
21150 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21151 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21152 char * when the C standard requires it.
21153
21154 * keyboard.c (read_char): Remove unused var.
21155
21156 * eval.c: Port to Windows vsnprintf (Bug#8435).
21157 Include <limits.h>.
21158 (SIZE_MAX): Define if the headers do not.
21159 (verror): Do not give up if vsnprintf returns a negative count.
21160 Instead, grow the buffer. This ports to Windows vsnprintf, which
21161 does not conform to C99. Problem reported by Eli Zaretskii.
21162 Also, simplify the allocation scheme, by avoiding the need for
21163 calling realloc, and removing the ALLOCATED variable.
21164
21165 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21166
21167 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21168 But keep the doprint source code for now, as we might revamp it
21169 and use it again (Bug#8435).
21170 * lisp.h (doprnt): Remove.
21171 * Makefile.in (base_obj): Remove doprnt.o.
21172 * deps.mk (doprnt.o): Remove.
21173
21174 error: Print 32- and 64-bit integers portably (Bug#8435).
21175 Without this change, on typical 64-bit hosts error ("...%d...", N)
21176 was used to print both 32- and 64-bit integers N, which relied on
21177 undefined behavior.
21178 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
21179 * lisp.h (error, verror): Mark as printf-like functions.
21180 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21181 Report overflow in size calculations when allocating printf buffer.
21182 Do not truncate output string at its first null byte.
21183 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21184 Truncate the output at a character boundary, since vsnprintf does not
21185 do that.
21186 * charset.c (check_iso_charset_parameter): Convert internal
21187 character to string before calling 'error', since %c now has the
21188 printf meaning.
21189 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21190 overflow when computing char to be passed to 'error'. Do not
21191 pass Lisp_Object to 'error'; pass the integer instead.
21192 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21193 formatted with plain %d.
21194
21195 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21196
21197 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21198
21199 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21200
21201 * xterm.c (x_catch_errors): Remove duplicate declaration.
21202
21203 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21204
21205 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21206
21207 2011-04-10 Jim Meyering <meyering@redhat.com>
21208
21209 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21210 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21211 return ssize_t not "int", and use size_t as the buffer length.
21212 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21213 * gnutls.h: Update declarations.
21214 * process.c (read_process_output): Use ssize_t, to match.
21215 (send_process): Likewise.
21216
21217 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21218
21219 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21220
21221 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21222
21223 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21224 Use unsigned char, to match FcChar8 type definition.
21225
21226 * xterm.c (handle_one_xevent):
21227 * xmenu.c (create_and_show_popup_menu):
21228 * xselect.c (x_decline_selection_request)
21229 (x_reply_selection_request): Avoid type-punned deref of X events.
21230
21231 2011-04-09 Eli Zaretskii <eliz@gnu.org>
21232
21233 Fix some uses of `int' instead of EMACS_INT.
21234 * search.c (string_match_1, fast_string_match)
21235 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21236 (scan_buffer, find_next_newline_no_quit)
21237 (find_before_next_newline, search_command, Freplace_match)
21238 (Fmatch_data): Make some `int' variables be EMACS_INT.
21239
21240 * xdisp.c (display_count_lines): 3rd argument and return value now
21241 EMACS_INT. All callers changed.
21242 (pint2hrstr): Last argument is now EMACS_INT.
21243
21244 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21245 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21246 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21247 (decode_coding_utf_16, decode_coding_emacs_mule)
21248 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21249 (decode_coding_ccl, decode_coding_charset)
21250 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21251 (decode_coding_iso_2022, decode_coding_emacs_mule)
21252 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21253 <char_offset, last_offset>: Declare EMACS_INT.
21254 (encode_coding_utf_8, encode_coding_utf_16)
21255 (encode_coding_emacs_mule, encode_invocation_designation)
21256 (encode_designation_at_bol, encode_coding_iso_2022)
21257 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21258 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21259 Declare EMACS_INT.
21260 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21261 (encode_invocation_designation): Last argument P_NCHARS is now
21262 EMACS_INT.
21263 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21264 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21265
21266 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21267 All users changed.
21268
21269 * ccl.c (Fccl_execute_on_string): Declare some variables
21270 EMACS_INT.
21271
21272 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
21273
21274 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21275
21276 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21277
21278 * process.c (Fformat_network_address): Doc fix.
21279
21280 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21281
21282 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21283
21284 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
21285
21286 * keyboard.c (read_char): Call Lisp function help-form-show,
21287 instead of using internal_with_output_to_temp_buffer.
21288 (Qhelp_form_show): New var.
21289 (syms_of_keyboard): Use DEFSYM macro.
21290
21291 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21292
21293 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21294
21295 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
21296
21297 * process.c (Flist_processes): Remove to Lisp.
21298 (list_processes_1): Delete.
21299
21300 2011-04-06 Eli Zaretskii <eliz@gnu.org>
21301
21302 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21303
21304 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21305
21306 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
21307
21308 Fix more problems found by GCC 4.6.0's static checks.
21309
21310 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21311
21312 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21313
21314 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21315
21316 * xdisp.c (vmessage): Mark as a printf-like function.
21317
21318 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21319
21320 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21321
21322 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21323 printf-like functions.
21324 (tiff_load): Add casts to remove these marks before passing them
21325 to system-supplied API.
21326
21327 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21328
21329 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21330 This avoids several warnings with gcc -Wstrict-overflow.
21331 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21332 directly, rather than having caller test rule sign. This avoids
21333 some unnecessary tests.
21334 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21335 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21336 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21337
21338 * xfont.c (xfont_text_extents): Remove var that was set but not used.
21339 (xfont_open): Avoid unnecessary tests.
21340
21341 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21342
21343 * composite.h, composite.c (composition_gstring_put_cache):
21344 Use EMACS_INT, not int, for length.
21345
21346 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21347 breaking out part of COMPOSITION_DECODE_RULE.
21348 (COMPOSITION_DECODE_RULE): Use it.
21349 * composite.c (get_composition_id): Remove unused local vars,
21350 by using the new macro.
21351
21352 * textprop.c (set_text_properties_1): Change while to do-while,
21353 since the condition is always true at first.
21354
21355 * intervals.c (graft_intervals_into_buffer): Mark var as used.
21356 (interval_deletion_adjustment): Return unsigned value.
21357 All uses changed.
21358
21359 * process.c (list_processes_1, create_pty, read_process_output):
21360 (exec_sentinel): Remove vars that were set but not used.
21361 (create_pty): Remove unnecessary "volatile"s.
21362 (Fnetwork_interface_info): Avoid possibility of int overflow.
21363 (read_process_output): Do adaptive read buffering even if carryover.
21364 (read_process_output): Simplify nbytes computation if buffered.
21365
21366 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21367
21368 * syntax.c (scan_words): Remove var that was set but not used.
21369 (update_syntax_table): Use unsigned instead of int.
21370
21371 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21372 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21373 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21374
21375 * print.c (print_error_message): Avoid int overflow.
21376
21377 * font.c (font_list_entities): Redo for clarity,
21378 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21379
21380 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21381 (font_score): Avoid potential overflow in diff calculation.
21382
21383 * fns.c (substring_both): Remove var that is set but not used.
21384 (sxhash): Redo loop for clarity and to avoid wraparound warning.
21385
21386 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21387
21388 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21389 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21390 can always succeed if overflow has undefined behavior.
21391
21392 * search.c (boyer_moore, wordify): Remove vars set but not used.
21393 (wordify): Omit three unnecessary tests.
21394
21395 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21396 All callers changed. This avoids the need for an unused var.
21397
21398 * casefiddle.c (casify_region): Remove var that is set but not used.
21399
21400 * dired.c (file_name_completion): Remove var that is set but not used.
21401
21402 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21403
21404 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
21405 (Finsert_file_contents): Remove unnecessary code checking fd.
21406
21407 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21408 Check for integer overflow on size calculations.
21409
21410 * buffer.c (Fprevious_overlay_change): Remove var that is set
21411 but not used.
21412
21413 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21414 Remove vars that are set but not used.
21415 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
21416 (timer_check_2): Mark vars as initialized.
21417
21418 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21419
21420 * image.c (lookup_image): Remove var that is set but not used.
21421 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
21422
21423 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21424 that are set but not used.
21425
21426 * xfns.c (make_invisible_cursor): Don't return garbage
21427 if XCreateBitmapFromData fails (Bug#8410).
21428
21429 * xselect.c (x_get_local_selection, x_handle_property_notify):
21430 Remove vars that are set but not used.
21431
21432 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
21433 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
21434
21435 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21436 Remove var that is set but not used.
21437 (scroll_bar_windows_size): Now size_t, not int.
21438 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21439 Check for overflow.
21440
21441 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21442 (map_tty_color) [!defined MSDOS]: Likewise.
21443
21444 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21445
21446 * coding.c: Remove vars that are set but not used.
21447 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21448 All callers changed.
21449 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21450 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21451 (decode_coding_charset): Remove vars that are set but not used.
21452
21453 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21454 that is set but not used.
21455
21456 * print.c (print_object): Remove var that is set but not used.
21457
21458 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
21459 The gnulib version avoids calling malloc in the usual case,
21460 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21461 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21462 * filelock.c (current_lock_owner): Likewise.
21463 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21464 * sysdep.c: Include allocator.h, careadlinkat.h.
21465 (emacs_no_realloc_allocator): New static constant.
21466 (emacs_readlink): New function.
21467 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21468 ../lib/careadlinkat.h.
21469
21470 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21471
21472 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21473 first non-nil return value).
21474
21475 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21476
21477 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21478 if not defined (Bug#8403).
21479
21480 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21481
21482 * xdisp.c (display_count_lines): Remove parameter `start',
21483 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21484 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21485 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21486 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21487 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21488 and thereabouts. All callers changed.
21489 (get_per_char_metric): Remove parameter `f', unused since
21490 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21491
21492 2011-04-02 Jim Meyering <meyering@redhat.com>
21493
21494 do not dereference NULL upon failed strdup
21495 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21496 (ns_get_family): Likewise.
21497
21498 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21499
21500 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21501
21502 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21503
21504 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21505 later (Bug#8403).
21506
21507 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21508
21509 Add lexical binding.
21510
21511 * window.c (Ftemp_output_buffer_show): New fun.
21512 (Fsave_window_excursion):
21513 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21514
21515 * lread.c (lisp_file_lexically_bound_p): New function.
21516 (Fload): Bind Qlexical_binding.
21517 (readevalloop): Remove `evalfun' arg.
21518 Bind Qinternal_interpreter_environment.
21519 (Feval_buffer): Bind Qlexical_binding.
21520 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21521 Mark as dynamic.
21522 (syms_of_lread): Declare `lexical-binding'.
21523
21524 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21525
21526 * keyboard.c (eval_dyn): New fun.
21527 (menu_item_eval_property): Use it.
21528
21529 * image.c (parse_image_spec): Use Ffunctionp.
21530
21531 * fns.c (concat, mapcar1): Accept byte-code-functions.
21532
21533 * eval.c (Fsetq): Handle lexical vars.
21534 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21535 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21536 (FletX, Flet): Obey lexical binding.
21537 (Fcommandp): Handle closures.
21538 (Feval): New `lexical' arg.
21539 (eval_sub): New function extracted from Feval. Use it almost
21540 everywhere where Feval was used. Look up vars in lexical env.
21541 Handle closures.
21542 (Ffunctionp): Move from subr.el.
21543 (Ffuncall): Handle closures.
21544 (apply_lambda): Remove `eval_flags'.
21545 (funcall_lambda): Handle closures and new byte-code-functions.
21546 (Fspecial_variable_p): New function.
21547 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21548 but without exporting it to Lisp.
21549
21550 * doc.c (Fdocumentation, store_function_docstring):
21551 * data.c (Finteractive_form): Handle closures.
21552
21553 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21554 interactive spec.
21555
21556 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21557 New byte-codes.
21558 (exec_byte_code): New function extracted from Fbyte_code to handle new
21559 calling convention for byte-code-functions. Add new byte-codes.
21560
21561 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
21562
21563 * alloc.c (Fmake_symbol): Init new `declared_special' field.
21564
21565 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21566
21567 * xdisp.c (redisplay_internal): Fix prototype.
21568
21569 2011-03-31 Eli Zaretskii <eliz@gnu.org>
21570
21571 * xdisp.c (SCROLL_LIMIT): New macro.
21572 (try_scrolling): Use it when setting scroll_limit.
21573 Limit scrolling to 100 screen lines.
21574 (redisplay_window): Even when falling back on "recentering",
21575 position point in the window according to scroll-conservatively,
21576 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21577
21578 (try_scrolling): When point is above the window, allow searching
21579 as far as scroll_max, or one screenful, to compute vertical
21580 distance from PT to the scroll margin position. This prevents
21581 try_scrolling from unnecessarily failing when
21582 scroll-conservatively is set to a value slightly larger than the
21583 window height. Clean up the case of PT below the margin at bottom
21584 of window: scroll_max can no longer be INT_MAX. When aggressive
21585 scrolling is in use, don't let point enter the opposite scroll
21586 margin as result of the scroll.
21587 (syms_of_xdisp) <scroll-conservatively>: Document the
21588 threshold of 100 lines for never-recentering scrolling.
21589
21590 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21591
21592 * dispextern.h (move_it_by_lines):
21593 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21594 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21595 (message_log_check_duplicate): Remove parameters `prev_bol' and
21596 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21597 (redisplay_internal): Remove parameter `preserve_echo_area',
21598 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21599
21600 * indent.c (Fvertical_motion):
21601 * window.c (window_scroll_pixel_based, Frecenter):
21602 Don't pass `need_y_p' to `move_it_by_lines'.
21603
21604 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21605
21606 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21607 steal a few bits to be more compact.
21608 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21609 Remove unneeded casts.
21610
21611 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21612
21613 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21614
21615 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21616 binding" message (bug#7967).
21617
21618 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21619
21620 Fix more problems found by GCC 4.6.0's static checks.
21621
21622 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21623 Remove unused local var.
21624
21625 * editfns.c (Fmessage_box): Remove unused local var.
21626
21627 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21628 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21629 Omit unused local vars.
21630 * window.c (shrink_windows): Omit unused local var.
21631 * menu.c (digest_single_submenu): Omit unused local var.
21632 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21633 Omit unused local var.
21634
21635 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21636 Don't assume string length fits in int.
21637 (keyremap_step, read_key_sequence): Use size_t for sizes.
21638 (read_key_sequence): Don't check last_real_key_start redundantly.
21639
21640 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21641 instead of alloca (Bug#8344).
21642
21643 * eval.c (Fbacktrace): Don't assume nargs fits in int.
21644 (Fbacktrace_frame): Don't assume nframes fits in int.
21645
21646 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21647
21648 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21649 concerns.
21650
21651 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21652
21653 * cm.c (calccost): Turn while-do into do-while, for clarity.
21654
21655 * keyboard.c (syms_of_keyboard): Use the same style as later
21656 in this function when indexing through an array. This also
21657 works around GCC bug 48267.
21658
21659 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21660
21661 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21662
21663 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21664 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21665
21666 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21667 This avoids undefined behavior on integer overflow, and is a bit
21668 more convenient anyway since it is compared to a size_t variable.
21669
21670 Variadic C functions now count arguments with size_t, not int.
21671 This avoids an unnecessary limitation on 64-bit machines, which
21672 caused (substring ...) to crash on large vectors (Bug#8344).
21673 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21674 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21675 All variadic functions and their callers changed accordingly.
21676 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21677 * data.c (arith_driver, float_arith_driver): Likewise.
21678 * editfns.c (general_insert_function): Likewise.
21679 * eval.c (struct backtrace.nargs, interactive_p)
21680 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21681 (funcall_lambda, mark_backtrace): Likewise.
21682 * fns.c (concat): Likewise.
21683 * frame.c (x_set_frame_parameters): Likewise.
21684 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21685 0 if not found, not -1. All callers changed.
21686
21687 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21688 (stack_copy_size): Now size_t, not int.
21689 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21690
21691 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21692
21693 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21694 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21695 All callers changed.
21696
21697 * lisp.h (multibyte_char_to_unibyte):
21698 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21699 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21700 * character.h (CHAR_TO_BYTE8):
21701 * cmds.c (internal_self_insert):
21702 * editfns.c (general_insert_function):
21703 * keymap.c (push_key_description):
21704 * search.c (Freplace_match):
21705 * xdisp.c (message_dolog, set_message_1): All callers changed.
21706
21707 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21708
21709 * keyboard.c (safe_run_hook_funcall): New function.
21710 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21711 don't set the hook to nil, but remove the offending function instead.
21712 (Qcommand_hook_internal): Remove, unused.
21713 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21714 Vcommand_hook_internal.
21715
21716 * eval.c (enum run_hooks_condition): Remove.
21717 (funcall_nil, funcall_not): New functions.
21718 (run_hook_with_args): Call each function through a `funcall' argument.
21719 Remove `cond' argument, now redundant.
21720 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21721 (Frun_hook_with_args_until_failure): Adjust accordingly.
21722 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21723
21724 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21725
21726 * dispextern.h (string_buffer_position): Remove declaration.
21727
21728 * print.c (strout): Remove parameter `multibyte', unused since
21729 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21730
21731 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21732 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21733 All callers changed.
21734
21735 * w32.c (_wsa_errlist): Use braces for struct initializers.
21736
21737 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21738 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21739 All callers changed.
21740 (string_buffer_position): Likewise. Also, make static (it's never
21741 used outside xdisp.c).
21742 (cursor_row_p): Remove parameter `w', unused since
21743 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21744 (decode_mode_spec): Remove parameter `precision', introduced during
21745 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21746 All callers changed.
21747
21748 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21749
21750 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21751
21752 2011-03-27 Anders Lindgren <andlind@gmail.com>
21753
21754 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21755 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21756 (ns_update_auto_hide_menu_bar): New functions.
21757 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21758 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21759 ns_constrain_all_frames.
21760 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21761 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21762
21763 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21764
21765 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21766
21767 2011-03-27 Glenn Morris <rgm@gnu.org>
21768
21769 * syssignal.h: Replace RETSIGTYPE with void.
21770 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21771 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21772 Replace SIGTYPE with void everywhere.
21773 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21774 * s/template.h (SIGTYPE): Remove commented out definition.
21775
21776 2011-03-26 Eli Zaretskii <eliz@gnu.org>
21777
21778 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21779 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21780
21781 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
21782
21783 * w32.c (read_unc_volume): Use parameter `henum', instead of
21784 global variable `wget_enum_handle'.
21785
21786 * keymap.c (describe_vector): Remove parameters `indices' and
21787 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21788 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21789
21790 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21791
21792 * keyboard.c (timer_check): Remove parameter `do_it_now',
21793 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21794 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21795 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21796
21797 * keyboard.c (read_char):
21798 * w32menu.c (w32_menu_display_help):
21799 * xmenu.c (show_help_event, menu_help_callback):
21800 Adjust calls to `show_help_echo'.
21801
21802 * gtkutil.c (xg_maybe_add_timer):
21803 * keyboard.c (readable_events):
21804 * process.c (wait_reading_process_output):
21805 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21806
21807 * insdel.c (adjust_markers_gap_motion):
21808 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21809 (gap_left, gap_right): Don't call it.
21810
21811 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
21812
21813 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21814 incurred during fontification.
21815
21816 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21817
21818 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21819 (DEFVAR_PER_BUFFER): Don't pass it.
21820
21821 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21822 (scrolling_window): Don't pass it.
21823
21824 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21825
21826 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21827
21828 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21829 and `suffix'.
21830 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21831 of variables specific to SELinux and computation of `encoded_absname'.
21832
21833 * image.c (XPutPixel): Remove unused variable `height'.
21834
21835 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21836
21837 * unexw32.c (get_section_info): Remove unused variable `section'.
21838
21839 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21840 (system_process_attributes): Remove unused variable `sess'.
21841 (sys_read): Remove unused variable `err'.
21842
21843 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21844 (w32_wnd_proc): Remove unused variable `isdead'.
21845 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21846 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21847 (x_create_tip_frame): Remove unused variable `tem'.
21848
21849 * w32inevt.c (w32_console_read_socket):
21850 Remove unused variable `no_events'.
21851
21852 * w32term.c (x_draw_composite_glyph_string_foreground):
21853 Remove unused variable `width'.
21854
21855 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
21856
21857 * w32term.c (x_set_glyph_string_clipping):
21858 Don't pass uninitialized region to CombineRgn.
21859
21860 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
21861
21862 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21863 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21864 (Fx_close_connection): Remove unused variable `i'.
21865
21866 * w32font.c (w32font_draw): Return number of glyphs.
21867 (w32font_open_internal): Remove unused variable `i'.
21868 (w32font_driver): Add missing initializer.
21869
21870 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21871 (fill_in_menu): Remove unused variable `items_added'.
21872
21873 * w32term.c (last_mouse_press_frame): Remove static global variable.
21874 (w32_clip_to_row): Remove unused variable `f'.
21875 (x_delete_terminal): Remove unused variable `i'.
21876
21877 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21878 (NOTHING): Remove unused static global variable.
21879 (uniscribe_check_otf): Remove unused variable `table'.
21880 (uniscribe_font_driver): Add missing initializers.
21881
21882 2011-03-23 Julien Danjou <julien@danjou.info>
21883
21884 * term.c (Fsuspend_tty, Fresume_tty):
21885 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21886 * window.c (temp_output_buffer_show):
21887 * insdel.c (signal_before_change):
21888 * frame.c (Fhandle_switch_frame):
21889 * fileio.c (Fdo_auto_save):
21890 * emacs.c (Fkill_emacs):
21891 * editfns.c (save_excursion_restore):
21892 * cmds.c (internal_self_insert):
21893 * callint.c (Fcall_interactively):
21894 * buffer.c (Fkill_all_local_variables):
21895 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21896 Use Frun_hooks.
21897 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
21898 unconditionally since it does the check itself.
21899
21900 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
21901
21902 Fix more problems found by GCC 4.5.2's static checks.
21903
21904 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21905 the first time through the loop, since we know p0 < p1 then.
21906 This also avoids a gcc -Wstrict-overflow warning.
21907
21908 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21909 leading to a memory leak, possible in functions like
21910 load_charset_map_from_file that can allocate an unbounded number
21911 of objects (Bug#8318).
21912
21913 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21914 that could (at least in theory) be that large.
21915
21916 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21917 This is less likely to overflow, and avoids undefined behavior if
21918 overflow does occur. All callers changed. Use strtoul to scan
21919 for the unsigned long integer.
21920 (pint2hrstr): Simplify and tune code slightly.
21921 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
21922
21923 * scroll.c (do_scrolling): Work around GCC bug 48228.
21924 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21925
21926 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21927 This also avoids a warning with gcc -Wstrict-overflow.
21928 (validate_x_resource_name): Simplify count usage.
21929 This also avoids a warning with gcc -Wstrict-overflow.
21930
21931 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21932 fail (Bug#8306).
21933
21934 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
21935
21936 * process.c (Fmake_network_process): Use socklen_t, not int,
21937 where POSIX says socklen_t is required in portable programs.
21938 This fixes a porting bug on hosts like 64-bit HP-UX, where
21939 socklen_t is wider than int (Bug#8277).
21940 (Fmake_network_process, server_accept_connection):
21941 (wait_reading_process_output, read_process_output):
21942 Likewise.
21943
21944 * process.c: Rename or move locals to avoid shadowing.
21945 (list_processes_1, Fmake_network_process):
21946 (read_process_output_error_handler, exec_sentinel_error_handler):
21947 Rename or move locals.
21948 (Fmake_network_process): Define label "retry_connect" only if needed.
21949 (Fnetwork_interface_info): Fix pointer signedness.
21950 (process_send_signal): Add cast to avoid pointer signedness problem.
21951 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
21952 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
21953
21954 Make tparam.h and terminfo.c consistent.
21955 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21956 Include tparam.h instead, since it declares them.
21957 * cm.h (PC): Remove extern decl; tparam.h now does this.
21958 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21959 * terminfo.c: Include tparam.h, to check interfaces.
21960 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21961 (tparam): Adjust signature to match interface in tparam.h;
21962 this removes some undefined behavior. Check that outstring and len
21963 are zero, which they always are with Emacs.
21964 * tparam.h (PC, BC, UP): New extern decls.
21965
21966 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
21967 (xftfont_open): Rename locals to avoid shadowing.
21968
21969 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
21970 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21971 (OTF_TAG_SYM): Omit macro if not needed.
21972 (ftfont_list): Remove unused local.
21973 (get_adstyle_property, ftfont_pattern_entity):
21974 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21975 Rename locals to avoid shadowing.
21976
21977 * xfont.c (xfont_list_family): Mark var as initialized.
21978
21979 * xml.c (make_dom): Now static.
21980
21981 * composite.c (composition_compute_stop_pos): Rename local to
21982 avoid shadowing.
21983 (composition_reseat_it): Remove unused locals.
21984 (find_automatic_composition, composition_adjust_point): Likewise.
21985 (composition_update_it): Mark var as initialized.
21986 (find_automatic_composition): Mark vars as initialized,
21987 with a FIXME (Bug#8290).
21988
21989 character.h: Rename locals to avoid shadowing.
21990 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21991 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21992 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21993 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21994 to avoid shadowing.
21995
21996 * textprop.c (property_change_between_p): Remove; unused.
21997
21998 * intervals.c (interval_start_pos): Now static.
21999
22000 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22001
22002 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22003 Rename locals to avoid shadowing.
22004
22005 * sound.c (wav_play, au_play, Fplay_sound_internal):
22006 Fix pointer signedness.
22007 (alsa_choose_format): Remove unused local var.
22008 (wav_play): Initialize a variable to 0, to prevent undefined
22009 behavior (Bug#8278).
22010
22011 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22012
22013 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22014
22015 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22016 clobbering (Bug#8298).
22017 * sysdep.c (sys_subshell): Likewise.
22018 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22019
22020 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22021 This should get cleaned up, so that child_setup has the
22022 same signature on all platforms.
22023
22024 * callproc.c (call_process_cleanup): Now static.
22025 (relocate_fd): Rename locals to avoid shadowing.
22026
22027 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
22028
22029 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22030 not to be necessary, and produces flickering.
22031
22032 2011-03-20 Glenn Morris <rgm@gnu.org>
22033
22034 * config.in: Remove file.
22035
22036 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
22037
22038 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22039 are now in src/globals.h.
22040 (syms_of_minibuf): Remove spurious & from previous change.
22041
22042 2011-03-20 Leo Liu <sdl.web@gmail.com>
22043
22044 * minibuf.c (completing-read-function): New variable.
22045 (completing-read-default): Rename from completing-read.
22046 (completing-read): Call completing-read-function.
22047
22048 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22049
22050 * xfaces.c (Fx_load_color_file):
22051 Read color file from absolute filename (bug#8250).
22052
22053 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22054
22055 * makefile.w32-in: Update dependencies.
22056
22057 2011-03-17 Eli Zaretskii <eliz@gnu.org>
22058
22059 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22060
22061 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22062
22063 Fix more problems found by GCC 4.5.2's static checks.
22064
22065 * process.c (make_serial_process_unwind, send_process_trap):
22066 (sigchld_handler): Now static.
22067
22068 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22069 That way, the code declares only the vars that it needs.
22070 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22071 * s/cygwin.h (PTY_ITERATION): Likewise.
22072 * s/darwin.h (PTY_ITERATION): Likewise.
22073 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22074
22075 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22076 * process.c (allocate_pty): Don't declare stb unless it's needed.
22077
22078 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22079 (CONSTANTLIM): Remove; unused.
22080 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22081 Define only if needed.
22082
22083 * unexelf.c (unexec): Name an expression,
22084 to avoid gcc -Wbad-function-cast warning.
22085 Use a different way to cause a compilation error if anyone uses
22086 n rather than nn, a way that does not involve shadowing.
22087 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22088
22089 * deps.mk (unexalpha.o): Remove; unused.
22090
22091 New file unexec.h, the (simple) interface for unexec (Bug#8267).
22092 * unexec.h: New file.
22093 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22094 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22095 Depend on unexec.h.
22096 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22097 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22098 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22099 Change as necessary to match prototype in unexec.h.
22100
22101 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22102 shadowing.
22103 (back_comment, skip_chars): Mark vars as initialized.
22104
22105 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22106 Rename locals to avoid shadowing.
22107
22108 * lread.c (read1): Rewrite so as not to use empty "else".
22109 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22110
22111 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22112
22113 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22114 warning when compiling print.c.
22115
22116 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22117 instead of using an uninitialized var.
22118 (font_sort_entities): Mark var as initialized.
22119
22120 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22121
22122 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22123 pointers to constants.
22124 (font_parse_fcname): Remove unused vars.
22125 (font_delete_unmatched): Now static.
22126 (font_get_spec): Remove; unused.
22127 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22128 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22129 Rename or move locals to avoid shadowing.
22130
22131 * fns.c (require_nesting_list, require_unwind): Now static.
22132 (Ffillarray): Rename locals to avoid shadowing.
22133
22134 * floatfns.c (domain_error2): Define only if needed.
22135 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
22136
22137 * alloc.c (mark_backtrace): Move decl from here ...
22138 * lisp.h: ... to here, so that it can be checked.
22139
22140 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
22141 (Fdefvar): Rewrite so as not to use empty "else".
22142 (lisp_indirect_variable): Name an expression,
22143 to avoid gcc -Wbad-function-cast warning.
22144 (Fdefvar): Rename locals to avoid shadowing.
22145
22146 * callint.c (quotify_arg, quotify_args): Now static.
22147 (Fcall_interactively): Rename locals to avoid shadowing.
22148 Use const pointer when appropriate.
22149
22150 * lisp.h (get_system_name, get_operating_system_release):
22151 Move decls here, to check interfaces.
22152 * process.c (get_operating_system_release): Move decl to lisp.h.
22153 * xrdb.c (get_system_name): Likewise.
22154 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22155 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22156 some of which prompt warnings from gcc -Wbad-function-cast.
22157 (Fformat_time_string, Fencode_time, Finsert_char):
22158 (Ftranslate_region_internal, Fformat):
22159 Rename or remove local vars to avoid shadowing.
22160 (Ftranslate_region_internal): Mark var as initialized.
22161
22162 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22163 avoid shadowing.
22164
22165 * lisp.h (eassert): Check that the argument compiles, even if
22166 ENABLE_CHECKING is not defined.
22167
22168 * data.c (Findirect_variable): Name an expression, to avoid
22169 gcc -Wbad-function-cast warning.
22170 (default_value, arithcompare, arith_driver, arith_error): Now static.
22171 (store_symval_forwarding): Rename local to avoid shadowing.
22172 (Fmake_variable_buffer_local, Fmake_local_variable):
22173 Mark variables as initialized.
22174 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
22175
22176 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
22177 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22178 Rename locals to avoid shadowing.
22179 (mark_stack): Move local variables into the #ifdef region where
22180 they're used.
22181 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22182 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22183 needed otherwise.
22184 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22185 (GC_STRING_CHARS): Remove; not used.
22186 (Fmemory_limit): Cast sbrk's returned value to char *.
22187
22188 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22189 avoids undefined behavior in theory.
22190
22191 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22192
22193 Use functions, not macros, for up- and down-casing (Bug#8254).
22194 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22195 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22196 to use the following functions instead of these macros.
22197 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22198 EMACS_INT, since callers assume the returned value fits in int.
22199 (upcase1): Likewise, for UPCASE_TABLE.
22200 (uppercasep, lowercasep, upcase): New static inline functions.
22201 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22202 the race-condition problem in the old DOWNCASE.
22203
22204 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22205 Rename locals to avoid shadowing.
22206 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22207 (regex_compile, re_search_2, re_match_2_internal):
22208 Remove unused local vars.
22209 (FREE_VAR): Rewrite so as not to use empty "else",
22210 which gcc can warn about.
22211 (regex_compile, re_match_2_internal): Mark locals as initialized.
22212 (RETALLOC_IF): Define only if needed.
22213 (WORDCHAR_P): Likewise. This one is never needed, but is used
22214 only in a comment talking about a compiler bug, so put inside
22215 the #if 0 of that comment.
22216 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22217 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22218 Remove; unused.
22219
22220 * search.c (boyer_moore): Rename locals to avoid shadowing.
22221 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22222 (PREV_CHAR_BOUNDARY): Likewise.
22223
22224 * search.c (simple_search): Remove unused var.
22225
22226 * dired.c (compile_pattern): Move decl from here ...
22227 * lisp.h: ... to here, so that it can be checked.
22228 (struct re_registers): New forward decl.
22229
22230 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22231
22232 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22233 All uses changed.
22234 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22235 Rename locals to avoid shadowing.
22236 (Fvertical_motion): Mark locals as initialized.
22237
22238 * casefiddle.c (casify_object, casify_region): Now static.
22239 (casify_region): Mark local as initialized.
22240
22241 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22242
22243 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22244 New macros, so that the caller can use some names other than
22245 gcpro1, gcpro2, etc.
22246 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22247 of the new macros.
22248 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22249 argument, for consistency with GCPRO2_VAR, etc: it is now the
22250 prefix of the variable, not the variable itself. All uses
22251 changed.
22252 * dired.c (directory_files_internal, file_name_completion):
22253 Rename locals to avoid shadowing.
22254
22255 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22256 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22257 dired.c's scmp function, had undefined behavior.
22258 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22259 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22260 * buffer.h: ... to here, because these macros use current_buffer,
22261 and the new implementation with inline functions needs to have
22262 current_buffer in scope now, rather than later when the macros
22263 are used.
22264 (downcase, upcase1): New static inline functions.
22265 (DOWNCASE, UPCASE1): Reimplement using these functions.
22266 This avoids undefined behavior in expressions like
22267 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22268 from race conditions in accessing the global variables
22269 case_temp1 and case_temp2.
22270 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22271 * lisp.h (case_temp1, case_temp2): Remove their decls.
22272 * character.h (ASCII_CHAR_P): Move from here ...
22273 * lisp.h: ... to here, so that the inline functions mentioned
22274 above can use them.
22275
22276 * dired.c (directory_files_internal_unwind): Now static.
22277
22278 * fileio.c (file_name_as_directory, directory_file_name):
22279 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22280 Now static.
22281 (file_name_as_directory): Use const pointers when appropriate.
22282 (Fexpand_file_name): Likewise. In particular, newdir might
22283 point at constant storage, so make it a const pointer.
22284 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22285 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22286 signedness issues.
22287 (Fset_file_times, Finsert_file_contents, auto_save_error):
22288 Rename locals to avoid shadowing.
22289
22290 * minibuf.c (choose_minibuf_frame_1): Now static.
22291 (Ftry_completion, Fall_completions): Rename or remove locals
22292 to avoid shadowing.
22293
22294 * marker.c (bytepos_to_charpos): Remove; unused.
22295
22296 * lisp.h (verify_bytepos, count_markers): New decls,
22297 so that gcc does not warn that these functions aren't declared.
22298
22299 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22300 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22301 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22302 (copy_text): Remove unused local var.
22303
22304 * filelock.c (within_one_second): Now static.
22305 (lock_file_1): Rename local to avoid shadowing.
22306
22307 * buffer.c (fix_overlays_before): Mark locals as initialized.
22308 (fix_start_end_in_overlays): Likewise. This function should be
22309 simplified by using pointers-to-pointers, but that's a different
22310 matter.
22311 (switch_to_buffer_1): Now static.
22312 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22313 (report_overlay_modification): Rename locals to avoid shadowing.
22314
22315 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22316 Fix pointer signedness issue.
22317 (sys_subshell): Mark local as volatile if checking for lint,
22318 to suppress a gcc -Wclobbered warning that does not seem to be right.
22319 (MAXPATHLEN): Define only if needed.
22320
22321 * process.c (serial_open, serial_configure): Move decls from here ...
22322 * systty.h: ... to here, so that they can be checked.
22323
22324 * fns.c (get_random, seed_random): Move extern decls from here ...
22325 * lisp.h: ... to here, so that they can be checked.
22326
22327 * sysdep.c (reset_io): Now static.
22328 (wait_for_termination_signal): Remove; unused.
22329
22330 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22331 (copy_keymap_item, append_key, push_text_char_description):
22332 Now static.
22333 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22334 (DENSE_TABLE_SIZE): Remove; unused.
22335 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22336 (describe_map_tree):
22337 Rename locals to avoid shadowing.
22338
22339 * keyboard.c: Declare functions static if they are not used elsewhere.
22340 (echo_char, echo_dash, cmd_error, top_level_2):
22341 (poll_for_input, handle_async_input): Now static.
22342 (read_char, kbd_buffer_get_event, make_lispy_position):
22343 (make_lispy_event, make_lispy_movement, apply_modifiers):
22344 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22345 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22346 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22347 (read_key_sequence, read_char): Mark locals as initialized.
22348 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22349
22350 * keyboard.h (make_ctrl_char): New decl.
22351 (mark_kboards): Move decl here ...
22352 * alloc.c (mark_kboards): ... from here.
22353
22354 * lisp.h (force_auto_save_soon): New decl.
22355
22356 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22357 (DEFINE_DUMMY_FUNCTION): New macro.
22358 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22359 Use it.
22360 (main): Add casts to avoid warnings
22361 if GCC considers string literals to be constants.
22362
22363 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22364
22365 * dbusbind.c: Pointer signedness fixes.
22366 (xd_signature, xd_append_arg, xd_initialize):
22367 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22368 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22369 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22370 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22371
22372 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22373 if GCC considers string literals to be constants.
22374 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22375
22376 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22377
22378 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22379 (print_preprocess, print_object): New macro to fix last change.
22380
22381 * print.c (print_preprocess): Don't forget font objects.
22382
22383 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
22384
22385 * emacs.c (USAGE3): Doc fixes.
22386
22387 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22388
22389 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22390 structure.
22391
22392 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
22393
22394 * lisp.h (VWindow_system, Qfile_name_history):
22395 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22396 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22397 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22398
22399 * w32select.c: Don't #include "keyboard.h".
22400 (run_protected): Add extern declaration for waiting_for_input.
22401
22402 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22403 * w32console.c (detect_input_pending, read_input_pending)
22404 (encode_terminal_code):
22405 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22406 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22407 (w32_system_caret_y, Qfile_name_history):
22408 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22409 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22410 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22411 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22412 * w32proc.c (Qlocal, report_file_error):
22413 * w32term.c (Vwindow_system, updating_frame):
22414 * w32uniscribe.c (initialized, uniscribe_font_driver):
22415 Remove unneeded extern declarations.
22416
22417 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
22418
22419 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
22420
22421 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
22422
22423 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22424 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22425 These macros can no longer be used for assignment.
22426
22427 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22428 Assign struct members directly, instead of using BUF_BEGV etc.
22429 (record_buffer_markers, fetch_buffer_markers): New functions for
22430 recording and fetching special buffer markers.
22431 (set_buffer_internal_1, set_buffer_temp): Use them.
22432
22433 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22434
22435 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22436
22437 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22438 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22439
22440 * xdisp.c (hscroll_window_tree):
22441 (reconsider_clip_changes): Use PT instead of BUF_PT.
22442
22443 2011-03-13 Eli Zaretskii <eliz@gnu.org>
22444
22445 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22446 $(EMACS_ROOT)/lib/intprops.h.
22447
22448 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22449
22450 Fix more problems found by GCC 4.5.2's static checks.
22451
22452 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22453 to unsigned char * to avoid compiler diagnostic.
22454 (xg_free_frame_widgets): Make it clear that a local variable is
22455 needed only if USE_GTK_TOOLTIP.
22456 (gdk_window_get_screen): Make it clear that this macro is needed
22457 only if USE_GTK_TOOLTIP.
22458 (int_gtk_range_get_value): New function, which avoids a diagnostic
22459 from gcc -Wbad-function-cast.
22460 (xg_set_toolkit_scroll_bar_thumb): Use it.
22461 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22462 diagnostic from gcc -Wbad-function-cast.
22463 (get_utf8_string, xg_get_file_with_chooser):
22464 Rename locals to avoid shadowing.
22465 (create_dialog): Move locals to avoid shadowing.
22466
22467 * xgselect.c (xg_select): Remove unused var.
22468
22469 * image.c (four_corners_best): Mark locals as initialized.
22470 (gif_load): Initialize transparent_p to zero (Bug#8238).
22471 Mark another local as initialized.
22472 (my_png_error, my_error_exit): Mark with NO_RETURN.
22473
22474 * image.c (clear_image_cache): Now static.
22475 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
22476 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
22477 (x_edge_detection): Remove unnecessary cast that
22478 gcc -Wbad-function-cast diagnoses.
22479 (gif_load): Fix pointer signedness.
22480 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22481 (jpeg_load, gif_load): Rename locals to avoid shadowing.
22482
22483 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
22484
22485 Improve quality of tests for time stamp overflow.
22486 For example, without this patch (encode-time 0 0 0 1 1
22487 1152921504606846976) returns the obviously-bogus value (-948597
22488 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22489 reports time overflow. See
22490 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
22491 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22492 * editfns.c: Include limits.h and intprops.h.
22493 (TIME_T_MIN, TIME_T_MAX): New macros.
22494 (time_overflow): Move earlier, to before first use.
22495 (hi_time, lo_time): New functions, for an accurate test for
22496 out-of-range times.
22497 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22498 (Fget_internal_run_time): Don't assume time_t fits in int.
22499 (make_time): Use list2 instead of Fcons twice.
22500 (Fdecode_time): More accurate test for out-of-range times.
22501 (check_tm_member): New function.
22502 (Fencode_time): Use it, to test for out-of-range times.
22503 (lisp_time_argument): Don't rely on undefined left-shift and
22504 right-shift behavior when checking for time stamp overflow.
22505
22506 * editfns.c (time_overflow): New function, refactoring common code.
22507 (Fformat_time_string, Fdecode_time, Fencode_time):
22508 (Fcurrent_time_string): Use it.
22509
22510 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22511 * dired.c (make_time): Move to ...
22512 * editfns.c (make_time): ... here.
22513 * systime.h: Note the move.
22514
22515 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
22516
22517 * fringe.c (update_window_fringes): Remove unused variables.
22518
22519 * unexmacosx.c (copy_data_segment): Also copy __got section.
22520 (Bug#8223)
22521
22522 2011-03-12 Eli Zaretskii <eliz@gnu.org>
22523
22524 * termcap.c [MSDOS]: Include "msdos.h".
22525 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22526 Constify `char *' arguments and their references according to
22527 prototypes in tparam.h.
22528
22529 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
22530
22531 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22532 Adapt all references accordingly.
22533
22534 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22535
22536 2011-03-11 Tom Tromey <tromey@redhat.com>
22537
22538 * buffer.c (syms_of_buffer): Remove obsolete comment.
22539
22540 2011-03-11 Eli Zaretskii <eliz@gnu.org>
22541
22542 * termhooks.h (encode_terminal_code): Declare prototype.
22543
22544 * msdos.c (encode_terminal_code): Don't declare prototype.
22545
22546 * term.c (encode_terminal_code): Now external again, used by
22547 w32console.c and msdos.c.
22548
22549 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22550 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
22551
22552 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
22553
22554 Fix some minor problems found by GCC 4.5.2's static checks.
22555
22556 * fringe.c (update_window_fringes): Mark locals as initialized
22557 (Bug#8227).
22558 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
22559
22560 * alloc.c (mark_fringe_data): Move decl from here ...
22561 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22562 to check its interface.
22563 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22564
22565 * fontset.c (free_realized_fontset): Now static.
22566 (Fset_fontset_font): Rename local to avoid shadowing.
22567 (fontset_font): Mark local as initialized.
22568 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
22569
22570 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22571
22572 * xselect.c (x_disown_buffer_selections): Remove; not used.
22573 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
22574 (x_own_selection, Fx_disown_selection_internal): Rename locals
22575 to avoid shadowing.
22576 (x_handle_dnd_message): Remove local to avoid shadowing.
22577
22578 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22579 so that the caller can use some name other than gcpro1.
22580 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
22581 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22582 (Fx_backspace_delete_keys_p):
22583 Use them to avoid shadowing, and rename vars to avoid shadowing.
22584 (x_decode_color, x_set_name, x_window): Now static.
22585 (Fx_create_frame): Add braces to silence GCC warning.
22586 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
22587 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22588 Remove unused locals.
22589 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22590 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22591 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22592 macros.
22593
22594 * xterm.h (x_mouse_leave): New decl.
22595
22596 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22597 Remove unused functions.
22598 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22599 (x_calc_absolute_position): Now static.
22600 (XTread_socket): Don't define label "out" unless it's used.
22601 Don't declare local "event" unless it's used.
22602 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22603 unless they are used.
22604 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22605 (x_fatal_error_signal): Remove; not used.
22606 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22607 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22608 (x_error_catcher, x_connection_closed, x_error_handler):
22609 (x_error_quitter, xembed_send_message, x_iconify_frame):
22610 (my_log_handler): Rename locals to avoid shadowing.
22611 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
22612 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
22613
22614 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22615 Rename or move locals to avoid shadowing.
22616 (tty_defined_color, merge_face_heights): Now static.
22617 (free_realized_faces_for_fontset): Remove; not used.
22618 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22619 does not deduce is never used uninitialized.
22620 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22621 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
22622
22623 * terminal.c (store_terminal_param): Now static.
22624
22625 * xmenu.c (menu_highlight_callback): Now static.
22626 (set_frame_menubar): Remove unused local.
22627 (xmenu_show): Rename parameter to avoid shadowing.
22628 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22629 since they might point to immutable storage.
22630 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22631 since it's unused otherwise.
22632
22633 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
22634 Add a FIXME, since the code still doesn't look right. (Bug#8215)
22635 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22636 avoids a gcc -Wuninitialized diagnostic.
22637 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
22638 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22639 does not deduce are never used uninitialized.
22640
22641 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22642
22643 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
22644 * window.c (window_loop, size_window):
22645 (run_window_configuration_change_hook, enlarge_window): Likewise.
22646
22647 * window.c (display_buffer): Now static.
22648 (size_window): Mark variables that gcc -Wuninitialized
22649 does not deduce are never used uninitialized.
22650 * window.h (check_all_windows): New decl, to forestall
22651 gcc -Wmissing-prototypes diagnostic.
22652 * dispextern.h (bidi_dump_cached_states): Likewise.
22653
22654 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22655 shadowing.
22656 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
22657 Include <limits.h>.
22658 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22659 and to avoid gcc -Wuninitialized warning.
22660 (load_charset_map): Mark variables that gcc -Wuninitialized
22661 does not deduce are never used uninitialized.
22662 (load_charset): Abort instead of using uninitialized var (Bug#8229).
22663
22664 * coding.c (coding_set_source, coding_set_destination):
22665 Use "else { /* comment */ }" rather than "else /* comment */;"
22666 for clarity, and to avoid gcc -Wempty-body warning.
22667 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22668 a block, when the outer 'i' will do.
22669 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22670 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22671 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22672 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22673 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22674 Rename locals to avoid shadowing.
22675 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22676 * coding.c (emacs_mule_char, encode_invocation_designation):
22677 Now static, since they're not used elsewhere.
22678 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22679 (decode_coding_object, encode_coding_object, detect_coding_system):
22680 (decode_coding_emacs_mule): Mark variables that gcc
22681 -Wuninitialized does not deduce are never used uninitialized.
22682 (detect_coding_iso_2022): Initialize a local variable that might
22683 be used uninitialized. Leave a FIXME because it's not clear that
22684 this initialization is needed. (Bug#8211)
22685 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22686 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22687 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22688 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22689 Remove unused macros.
22690
22691 * category.c (hash_get_category_set): Remove unused local var.
22692 (copy_category_table): Now static, since it's not used elsewhere.
22693 * character.c (string_count_byte8): Likewise.
22694
22695 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22696 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22697
22698 * chartab.c (copy_sub_char_table): Now static, since it's not used
22699 elsewhere.
22700 (sub_char_table_ref_and_range, char_table_ref_and_range):
22701 Rename locals to avoid shadowing.
22702 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22703
22704 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22705 (BIDI_BOB): Remove unused macro.
22706
22707 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22708 deduce are never used uninitialized.
22709 * term.c (encode_terminal_code): Likewise.
22710
22711 * term.c (encode_terminal_code): Now static. Remove unused local.
22712
22713 * tparam.h: New file.
22714 * term.c, tparam.h: Include it.
22715 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22716 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22717 Move these decls to tparam.h, and make them agree with what
22718 is actually in tparam.c. The previous trick of using incompatible
22719 decls in different modules does not conform to the C standard.
22720 All callers of tparam changed to use tparam's actual API.
22721 * tparam.c (tparam1, tparam, tgoto):
22722 Use const pointers where appropriate.
22723
22724 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22725 * cm.h (struct cm): Likewise.
22726 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22727 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22728 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22729 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22730 (turn_on_face, init_tty): Likewise.
22731 * termchar.h (struct tty_display_info): Likewise.
22732
22733 * term.c (term_mouse_position): Rename local to avoid shadowing.
22734
22735 * alloc.c (mark_ttys): Move decl from here ...
22736 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22737
22738 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22739
22740 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22741
22742 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
22743
22744 * search.c (compile_pattern_1): Remove argument regp, unused since
22745 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22746 (compile_pattern): Don't pass it.
22747
22748 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22749
22750 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22751 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22752 for ! HAVE_GTK3.
22753 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22754
22755 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22756
22757 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22758 gdk_window_get_screen, gdk_window_get_geometry,
22759 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22760 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22761 (xg_get_pixbuf_from_pixmap): New function.
22762 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22763 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22764 Call xg_get_pixbuf_from_pixmap instead of
22765 gdk_pixbuf_get_from_drawable.
22766 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22767 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22768 (xg_check_special_colors): Use GtkStyleContext and its functions
22769 for HAVE_GTK3.
22770 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22771 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22772 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
22773 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22774 Call gtk_widget_get_preferred_size.
22775 (xg_frame_resized): gdk_window_get_geometry only takes 5
22776 parameters.
22777 (xg_win_to_widget, xg_event_is_for_menubar):
22778 Call gdk_x11_window_lookup_for_display.
22779 (xg_set_widget_bg): New function.
22780 (delete_cb): New function.
22781 (xg_create_frame_widgets): Connect delete-event to delete_cb.
22782 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
22783 (xg_set_background_color): Call xg_set_widget_bg.
22784 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22785 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22786 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22787 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22788 if ! HAVE_GTK3.
22789 (update_frame_tool_bar): Call gtk_widget_hide.
22790 (xg_initialize): Use GDK_KEY_g.
22791
22792 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22793 if ! HAVE_GTK3
22794 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22795
22796 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22797 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22798 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22799
22800 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
22801
22802 * w32xfns.c (select_palette): Check success of RealizePalette against
22803 GDI_ERROR, not zero.
22804
22805 See ChangeLog.11 for earlier changes.
22806
22807 ;; Local Variables:
22808 ;; coding: utf-8
22809 ;; End:
22810
22811 Copyright (C) 2011-2013 Free Software Foundation, Inc.
22812
22813 This file is part of GNU Emacs.
22814
22815 GNU Emacs is free software: you can redistribute it and/or modify
22816 it under the terms of the GNU General Public License as published by
22817 the Free Software Foundation, either version 3 of the License, or
22818 (at your option) any later version.
22819
22820 GNU Emacs is distributed in the hope that it will be useful,
22821 but WITHOUT ANY WARRANTY; without even the implied warranty of
22822 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22823 GNU General Public License for more details.
22824
22825 You should have received a copy of the GNU General Public License
22826 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.