Fix misuse of ImageMagick that caused core dump.
[bpt/emacs.git] / src / ChangeLog
1 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix misuse of ImageMagick that caused core dump (Bug#13846).
4 * image.c (imagemagick_load_image): Calculate height and width
5 after flattening the image, not before.
6
7 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
8
9 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
10 * ftfont.c (ftfont_shape_by_flt): Likewise.
11 * w32uniscribe.c (uniscribe_shape): Likewise.
12
13 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
14
15 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
16 The old approach, which fell back on DIR/.#FILE.0 through
17 DIR/.#FILE.9, had race conditions that could not be easily fixed.
18 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
19 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
20 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
21 because the locking mechanism was never reliable in that case).
22 This patch fixes this and other bugs discovered by a code
23 inspection that was prompted by
24 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
25 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
26 to avoid interoperability problems between the MS-Windows and
27 non-MS-Windows implementations. MS-Windows and non-MS-Windows
28 instances of Emacs now ignore each others' locks.
29 * filelock.c (defined_WINDOWSNT): New constant.
30 (MAKE_LOCK_NAME, fill_in_lock_file_name):
31 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
32 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
33 regular files on MS-Windows hosts.
34 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
35 Use SAFE_ALLOCA to avoid problems with long file names.
36 (MAX_LFINFO): Now a local constant, not a global macro.
37 (IS_LOCK_FILE): Remove.
38 (lock_file_1): Don't inspect errno if symlink call succeeds;
39 that's not portable.
40 (lock_file): Document that this function can return if lock
41 creation fails.
42 (lock_file): Don't access freed storage.
43
44 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
45
46 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
47
48 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
49
50 * textprop.c: Use bool for booleans.
51 (validate_interval_range, Fadd_text_properties)
52 (Fremove_text_properties): Prefer bool to int when either works.
53
54 2013-03-02 Eli Zaretskii <eliz@gnu.org>
55
56 * textprop.c (Fadd_text_properties, Fremove_text_properties): If
57 the interval tree changes as a side effect of calling
58 modify_region, re-do processing starting from the call to
59 validate_interval_range. (Bug#13743)
60
61 2013-02-28 Eli Zaretskii <eliz@gnu.org>
62
63 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
64 (Bug#13546).
65
66 2013-02-27 Eli Zaretskii <eliz@gnu.org>
67
68 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
69 _SH_DENYRW flag, instead of emacs_open, to deny any other process
70 access to the lock file until it is written and closed.
71 (Bug#13807)
72
73 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
74
75 * callint.c (Qcall_interactively):
76 * macros.c (Qexecute_kbd_macro):
77 Now static.
78
79 2013-02-26 Bastien Guerry <bzg@gnu.org>
80
81 * window.c (Frecenter): Tiny docstring enhancement.
82
83 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
84
85 Minor textprop integer cleanup.
86 * intervals.h, textprop.c (add_text_properties_from_list):
87 Return void, not int, since nobody uses the return value.
88 * textprop.c (validate_plist, add_properties, remove_properties)
89 (Fadd_text_properties):
90 Don't assume list length fits in int.
91 (interval_has_all_properties, interval_has_some_properties)
92 (interval_has_some_properties_list, add_properties, remove_properties)
93 (Fadd_text_properties, Fremove_text_properties)
94 (Fremove_list_of_text_properties, text_property_stickiness):
95 Use bool for booleans.
96 (Fadd_text_properties, Fremove_text_properties):
97 (Fremove_list_of_text_properties):
98 Reindent do-while as per GNU style.
99
100 2013-02-25 Eli Zaretskii <eliz@gnu.org>
101
102 Implement CLASH_DETECTION for MS-Windows.
103
104 * filelock.c [WINDOWSNT]: Include w32.h.
105 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
106 function of that name. Up-case the macro arguments.
107 (IS_LOCK_FILE): New macro.
108 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
109 (create_lock_file): New function, with body extracted from
110 lock_file_1.
111 [WINDOWSNT]: Implement lock files by writing a regular file with
112 the lock information as its contents.
113 (read_lock_data): New function, on Posix platforms just calls
114 emacs_readlinkat.
115 [WINDOWSNT]: Read the lock info from the file.
116 (current_lock_owner): Call read_lock_data instead of calling
117 emacs_readlinkat directly.
118 (lock_file) [WINDOWSNT]: Run the file name through
119 dostounix_filename.
120
121 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
122 just check if the process by that PID exists.
123
124 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
125 also present, as doing so will fail to error out if the file
126 already exists.
127
128 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
129
130 * textprop.c (Fadd_text_properties, Fremove_text_properties)
131 (Fremove_list_of_text_properties): Skip all of the intervals in
132 the region between START and END that already have resp. don't
133 have the requested properties, not just the first one. Add
134 assertions that the loop afterwards always modifies the
135 properties. (Bug#13743)
136
137 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
138
139 * callint.c (Fcall_interactively): Use the right lexical environment
140 for `interactive' specs (bug#13811).
141 * eval.c (Feval): Accept a lexical environment.
142
143 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
144
145 Simplify data_start configuration (Bug#13783).
146 This is a followon simplification to the fix for Bug#13650.
147 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
148 (START_FILES): Remove. All uses removed.
149 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
150 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
151 (buildobj.h): Use it.
152 ($(ALLOBJS)): Depend on globals.h.
153 (temacs$(EXEEXT)): Use $(ALLOBJS).
154 * autodeps.mk (ALLOBJS): Move to Makefile.in.
155 * deps.mk (vm-limit.o):
156 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
157 Do not depend on mem-limits.h.
158 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
159 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
160 [__GNUC__ && !ORDINARY_LINK]: Remove.
161 * mem-limits.h, pre-crt0.c: Remove.
162 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
163 * unexcoff.c (etext): New decl.
164 (make_hdr): Use DATA_START instead of start_of_data.
165 * vm-limit.c: Move most of mem-limits.h's contents here.
166 (data_start): New decl. It's OK if this is approximate,
167 so simplify-away some unnecessary exactness.
168 (POINTER): Remove; all uses removed.
169 (data_space_start): Now char *, to avoid casts.
170 (exceeds_lisp_ptr): New function, replacing the old
171 EXCEEDS_LISP_PTR macro. All uses changed.
172 (check_memory_limits): Simplify and remove casts.
173 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
174 (memory_warnings): Use data_start instead of start_of_data.
175
176 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
177
178 * xdisp.c (set_message): Only check for debug-on-message if STRING
179 is a string. (Bug#13797)
180
181 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
182
183 Fix regression introduced by July 10 filelock.c patch.
184 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
185 2012-07-10 patch to this file. Reported by Eli Zaretskii in
186 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
187 and diagnosed by Andreas Schwab in
188 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
189
190 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
191
192 Assume C89 or better.
193 * ralloc.c (SIZE, POINTER, NIL):
194 * vm-limit.c (POINTER):
195 Remove, replacing all uses with C89 equivalents. These old
196 symbols were present only for porting to pre-C89 platforms.
197
198 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
199
200 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
201 This avoids warning messages reported as part of Bug#13546.
202
203 2013-02-21 Ken Brown <kbrown@cornell.edu>
204
205 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
206
207 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
208
209 * sheap.c (report_sheap_usage): Prefer message1_nolog.
210
211 * keyboard.c (Qcommand_execute): New var.
212 (command_loop_1, read_char): Use it.
213 (Fcommand_execute): Remove, replace by an Elisp implementation.
214 (syms_of_keyboard): Adjust accordingly.
215
216 2013-02-19 Daniel Colascione <dancol@dancol.org>
217
218 * sheap.c (report_sheap_usage): Use message, not message1, so
219 that we don't try to create a buffer while we're in the middle
220 of dumping Emacs. Explain why.
221
222 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
223
224 * search.c (find_newline): Return byte position in bytepos.
225 Adjust comment.
226 (find_next_newline_no_quit, find_before_next_newline):
227 Add bytepos argument.
228 * lisp.h (find_newline, find_next_newline_no_quit)
229 (find_before_next_newline): Adjust prototypes.
230 * bidi.c (bidi_find_paragraph_start):
231 * editfns.c (Fconstrain_to_field, Fline_end_position):
232 * indent.c (compute_motion, vmotion):
233 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
234 (get_visually_first_element, move_it_vertically_backward):
235 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
236
237 2013-02-19 Eli Zaretskii <eliz@gnu.org>
238
239 * w32proc.c (new_child): Avoid leaking handles if the subprocess
240 resources were not orderly released.
241
242 2013-02-17 Eli Zaretskii <eliz@gnu.org>
243
244 * xdisp.c (x_draw_vertical_border): For a window that is neither
245 the leftmost nor the rightmost, redraw both the left and the right
246 vertical borders. (Bug#13723)
247
248 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
249
250 * xml.c (init_libxml2_functions):
251 * sound.c (sound_warning):
252 * sheap.c (report_sheap_usage):
253 * process.c (wait_reading_process_output):
254 * msdos.c (XMenuActivate):
255 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
256 * keyboard.c (top_level_1):
257 * editfns.c (Fmessage, Fmessage_box):
258 * callint.c (Fcall_interactively):
259 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
260
261 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
262
263 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
264 * frame.c (syms_of_frame): ... to here.
265
266 2013-02-16 Eli Zaretskii <eliz@gnu.org>
267
268 * w32.c (sys_chown): Remove unused function.
269
270 * w32term.c <input_signal_count>: Declare 'volatile'
271 unconditionally. (Bug#9066)
272
273 * w32.c (set_errno): Reset h_errno and don't set it to any other
274 value. Set errno instead.
275 (check_errno): Reset h_errno.
276 (sys_socket, socket_to_fd, sys_bind, sys_connect)
277 (sys_gethostname, sys_getservbyname, sys_getpeername)
278 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
279 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
280 h_errno.
281 (sys_gethostbyname): Set h_errno only errors detected.
282
283 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
284
285 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
286
287 2013-02-15 Eli Zaretskii <eliz@gnu.org>
288
289 * keyboard.c (read_char): Fix calculation of auto-save time out
290 when auto-save-timeout is less than 4. (Bug#13720)
291
292 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
293 time. Improve diagnostics in DebPrint. (Bug#13546)
294
295 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
296 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
297 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
298 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
299 make sure errno is set to an appropriate value. (Bug#13546)
300 (socket_to_fd): Add assertion against indexing fd_info[] with a
301 value that is out of bounds.
302 (sys_accept): If fd is negative, do not set up the child_process
303 structure for reading.
304
305 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
306
307 * composite.c (fill_gstring_header): Remove useless prototype.
308 Break long line.
309 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
310 * print.c (PRINTDECLARE, print_object):
311 * search.c (compile_pattern, fast_looking_at, search_buffer):
312 (simple_search, boyer_moore, Freplace_match):
313 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
314 (get_overlay_arrow_glyph_row, display_mode_element):
315 (decode_mode_spec_coding, message3):
316 * xfaces.c (face_at_string_position): Use bool for booleans.
317 Adjust comments.
318
319 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
320
321 Fix AIX port (Bug#13650).
322 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
323 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
324 was #undeffed earlier, so it cannot be used as a macro here.
325 Use the constant and not the macro.
326
327 2013-02-15 Eli Zaretskii <eliz@gnu.org>
328
329 * w32proc.c (new_child): If no vacant slots are found in
330 child_procs[], make another pass looking for slots whose process
331 has exited or died. (Bug#13546)
332
333 * w32.c (sys_pipe): When failing due to file descriptors above
334 MAXDESC, set errno to EMFILE.
335 (_sys_read_ahead): Update cp->status when failing to read serial
336 communications input, so that the status doesn't stay at
337 STATUS_READ_IN_PROGRESS. (Bug#13546)
338
339 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
340
341 * gtkutil.c (tb_size_cb): New function.
342 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
343
344 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
345
346 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
347 an event.
348
349 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
350
351 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
352
353 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
354
355 * font.c (font_range): Add pos_byte argument. Adjust comment
356 and break long line.
357 * font.h (font_range): Adjust prototype.
358 * composite.c (autocmp_chars): Pass byte position to font_range.
359 Break long line. Remove useless prototype and format comment.
360
361 2013-02-13 Glenn Morris <rgm@gnu.org>
362
363 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
364
365 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
366
367 Improve AIX port some more (Bug#13650).
368 With this, it should be as good as it was in 23.3, though it's
369 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
370 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
371 * unexaix.c (start_of_text): Remove.
372 (_data, _text): Declare as char[], not int, as AIX manual suggests.
373 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
374 (orig_load_scnptr, orig_data_scnptr):
375 Now off_t, not long, since they are file offsets.
376 (make_hdr): Use _data, not start_of_data ().
377 This is the key part of the fix.
378 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
379 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
380
381 * pre-crt0.c (data_start): Initialize to 1.
382 This ports to compilers that optimize the external declaration
383 'int x = 0;' as if it were 'int x;' to shrink the executable.
384
385 Improve AIX port (Bug#13650).
386 This doesn't fix the bug, but it makes progress: Emacs builds now.
387 * unexaix.c: Include inttypes.h, stdarg.h.
388 (report_error, report_error_1): Mark as _Noreturn.
389 (report_error): Don't report the wrong errno.
390 (report_error_1): Now varargs. All callers changed.
391 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
392 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
393 (write_ptr): Use %p to print address rather than %lx and a cast
394 to unsigned long. Grow buffer a bit, to be safer.
395
396 2013-02-13 Eli Zaretskii <eliz@gnu.org>
397
398 * bidi.c (bidi_resolve_neutral): After finding the next
399 non-neutral character, accept NEUTRAL_ON type as well, because
400 directional control characters, such as LRE and RLE, have their
401 type converted to that by bidi_resolve_weak. This avoids aborts
402 when LRE/RLE follows a run of neutrals.
403 (bidi_move_to_visually_next): Assert that return value of
404 bidi_peek_at_next_level is non-negative. Negative values will
405 cause an infloop.
406
407 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
408
409 Minor getenv-related fixes.
410 * callproc.c (Fcall_process_region) [!DOS_NT]:
411 Avoid unnecessary duplicate call to getenv.
412 * callproc.c (init_callproc):
413 * dispnew.c (init_display):
414 * sysdep.c (sys_subshell):
415 Omit unnecessary cast of getenv or egetenv.
416
417 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
418
419 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
420 Update dependencies.
421
422 2013-02-12 Eli Zaretskii <eliz@gnu.org>
423
424 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
425 marker's position.
426 (display_line): Set w->region_showing to the value of
427 it->region_beg_charpos, not to -1. This fixes redisplay
428 optimization when cursor is moved up after M->. (Bug#13623)
429 (Bug#13626)
430 (try_scrolling): Scroll text up more if point is too close to ZV
431 and inside the scroll margin. This makes sure point is moved
432 outside the scroll margin in these cases.
433
434 * window.h (struct window): region_showing can no longer be
435 negative.
436
437 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
438
439 Tune by using memchr and memrchr.
440 * doc.c (Fsnarf_documentation):
441 * fileio.c (Fsubstitute_in_file_name):
442 * search.c (find_newline, scan_newline):
443 * xdisp.c (pos_visible_p, display_count_lines):
444 Use memchr and memrchr rather than scanning byte-by-byte.
445 * search.c (find_newline): Rename from scan_buffer.
446 Omit first arg TARGET, as it's always '\n'. All callers changed.
447
448 Clean up read_key_sequence a tiny bit more.
449 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
450 (read_key_sequence): Remove unused locals.
451
452 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
453
454 Clean up read_key_sequence a bit; reread active keymaps after first event.
455 * keyboard.c (read_char, read_char_x_menu_prompt)
456 (read_char_minibuf_menu_prompt):
457 Replace nmaps+maps with a single `map' arg.
458 (follow_key): Operate on a single map.
459 (active_maps): New function.
460 (test_undefined): Also return true for nil bindings.
461 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
462 a single (composed) keymap. Remember `first_event' to choose the right
463 set of active keymaps. Recompute the set of keymaps after receiving
464 the first event. Remove GOBBLE_FIRST_EVENT.
465 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
466 * keyboard.h (read_char): Update declaration.
467 * lread.c (read_filtered_event): Adjust call to read_char.
468
469 2013-02-11 Eli Zaretskii <eliz@gnu.org>
470
471 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
472 Don't use the limitation on backwards movement when lines are truncated
473 in the window. (Bug#13675)
474
475 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
476
477 * marker.c (set_marker_internal): If desired position is passed
478 as a marker, avoid call to buf_charpos_to_bytepos.
479 * window.c (Fset_window_point): Omit redundant type checking.
480 (Fset_window_start): Likewise. Format comment.
481 (window_scroll_pixel_based): Use set_marker_restricted_both
482 with character and byte positions obtained from an iterator.
483 (Fset_window_configuration): Use set_marker_restricted_both.
484 * xdisp.c (message_dolog): Likewise.
485
486 2013-02-10 Eli Zaretskii <eliz@gnu.org>
487
488 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
489 When text lines are longer than window's screen lines, don't move back
490 too far. This speeds up some redisplay operations. (Bug#13675)
491
492 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
493
494 * syntax.c (scan_sexps_forward): Fix byte position calculation
495 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
496
497 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
498
499 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
500 that was not needed.
501
502 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
503
504 Minor hashing refactoring.
505 * fns.c (SXHASH_REDUCE): Move to lisp.h.
506 (sxhash_float): Return EMACS_UINT, for consistency with the other
507 hash functions.
508 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
509 non-static inline function and therefore can't use static vars.
510 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
511 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
512 with the other hash functions.
513
514 2013-02-09 Eli Zaretskii <eliz@gnu.org>
515
516 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
517 XXXXXX part of the temporary file pattern is not downcased even
518 when w32-downcase-file-names is non-nil. (Bug#13661)
519
520 * xdisp.c (decode_mode_spec): Remove handling of %t.
521
522 * msdos.c (careadlinkatcwd): Remove.
523
524 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
525
526 * lread.c (skip_dyn_bytes): New function (bug#12598).
527 (read1): Use it. Use getc instead of READCHAR to read bytes.
528 (load_each_byte): Remove. Update users.
529
530 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
531
532 * search.c (scan_buffer): Calculate end byte position just once.
533 (scan_newline): Do not recalculate start_byte.
534 (search_command): Use eassert.
535 * syntax.c (struct lisp_parse_state): New member location_byte.
536 (scan_sexps_forward): Record from_byte and avoid redundant
537 character to byte position calculation ...
538 (Fparse_partial_sexp): ... here. Break too long line.
539
540 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
541
542 * lisp.h (make_uninit_vector): New function.
543 * alloc.c (Fvector, Fmake_byte_code):
544 * ccl.c (Fregister_ccl_program):
545 * charset.c (Fdefine_charset_internal, define_charset_internal):
546 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
547 * composite.c (syms_of_composite):
548 * font.c (Fquery_font, Ffont_info, syms_of_font):
549 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
550 * ftfont.c (ftfont_shape_by_flt):
551 * indent.c (recompute_width_table):
552 * nsselect.m (clean_local_selection_data):
553 * syntax.c (init_syntax_once):
554 * w32unsubscribe.c (uniscribe_shape):
555 * window.c (Fcurrent_window_configuration):
556 * xfaces.c (Fx_family_fonts):
557 * xselect.c (selection_data_to_lisp_data): Use it.
558
559 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
560
561 * coding.c (Fdefine_coding_system_internal): Use AREF where
562 argument is known to be a vector.
563 * fns.c (Flocale_info): Likewise for ASET.
564 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
565 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
566
567 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
568
569 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
570 height.
571
572 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
573 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
574 updateCollectionBehaviour.
575
576 * nsterm.m (NEW_STYLE_FS): Remove.
577 (ns_last_use_native_fullscreen): New variable.
578 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
579 (x_set_window_size): Do not take title bar and tool bar into account
580 if isFullscreen returns YES.
581 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
582 (check_native_fs): New function.
583 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
584 (ns_term_init): Remove NEW_STYLE_FS.
585 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
586 and tool bar if isFullscreen returns NO.
587 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
588 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
589 with HAVE_NATIVE_FS.
590 (window:willUseFullScreenPresentationOptions:): New method.
591 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
592 Hide toolbar if not enabled (Bug#13444).
593 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
594 Restore tool bar if enabled, hide it otherwise (Bug#13444).
595 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
596 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
597 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
598 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
599 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
600 (syms_of_nsterm): Add ns-use-native-fullscreen.
601
602 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
603
604 * fileio.c (Qchoose_write_coding_system): Now static.
605
606 2013-02-04 Eli Zaretskii <eliz@gnu.org>
607
608 * xdisp.c (window_buffer_changed): region_showing can be negative,
609 which still means region is being displayed.
610 (redisplay_internal): Resurrect code that forced redisplay of the
611 whole window when showing region and the mark has changed.
612 Record the new mark position to allow redisplay optimizations.
613 (display_line): If it->region_beg_charpos is non-zero, set the
614 window's region_showing member to -1. (Bug#13623) (Bug#13626)
615
616 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
617 not bitfield of 1 bit.
618
619 2013-02-03 Daniel Colascione <dancol@dancol.org>
620
621 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
622 daemon mode works on cygw32 when Emacs is installed and not just
623 during development.
624
625 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
626
627 Avoid file time stamp bug on MS-Windows (Bug#13149).
628 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
629 as FAT32 doesn't update time stamps when truncating them.
630 Also, check that a file time stamp is not a multiple of 100 ns;
631 this should catch all instances of the problem on MS-Windows,
632 as its native file system resolution is 100 ns or worse, and
633 checking for a non-multiple of 100 ns should impose only a small
634 overhead on systems with ns resolution.
635
636 2013-02-02 Eli Zaretskii <eliz@gnu.org>
637
638 Avoid encoding file names on MS-Windows when they need to be run
639 through dostounix_filename.
640 * w32.c (normalize_filename): Accept an additional argument
641 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
642 downcase it even if w32-downcase-file-names is non-nil.
643 (dostounix_filename): Accept an additional argument MULTIBYTE and
644 pass it to normalize_filename.
645 (emacs_root_dir): Adjust.
646
647 * msdos.h (dostounix_filename): Adjust prototype.
648
649 * w32.h (dostounix_filename): Adjust prototype.
650
651 * msdos.c (dostounix_filename): Accept an additional argument and
652 ignore it.
653 (init_environment): Adjust callers of dostounix_filename.
654
655 * fileio.c (Ffile_name_directory, file_name_as_directory)
656 (directory_file_name, Fexpand_file_name)
657 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
658 dostounix_filename.
659 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
660 non-nil.
661 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
662 variables, as egetenv is case-insensitive for DOS_NT.
663
664 * dired.c (file_name_completion): Don't call Fdirectory_file_name
665 with an encoded file name.
666
667 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
668 Adjust calls to dostounix_filename.
669
670 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
671
672 * unexw32.c (unexec): Adjust call to dostounix_filename.
673
674 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
675
676 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
677 dostounix_filename.
678
679 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
680 dostounix_filename.
681
682 * callproc.c (Fcall_process): Make sure program name in PATH and
683 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
684 is passed to exec/spawnve, which fails unless the file-name
685 encoding is UTF-8.
686
687 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
688 even if w32-quote-process-args is nil.
689
690 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
691
692 Fix timestamp bug when write-region appends nothing (Bug#13149).
693 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
694 the file's time stamp doesn't change if Emacs happens to write nothing
695 to the file, and on a buggy file system this could cause Emacs to
696 incorrectly infer that the file system doesn't have the bug.
697 Avoid this problem by inhibiting the inference in this case.
698
699 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
700
701 * window.h (struct window): Convert base_line_number, base_line_pos
702 and column_number_displayed members from Lisp_Object to ptrdiff_t.
703 Convert region_showing member from Lisp_Object to bitfield.
704 Remove sequence_number member. Adjust comments.
705 * window.c (sequence_number): Remove.
706 (make_window): Initialize column_number_displayed.
707 * print.c (print_object): Follow the printed representation of
708 frames and print window pointer to distinguish between windows.
709 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
710 * xdisp.c (wset_base_line_number, wset_base_line_pos)
711 (wset_column_number_displayed, wset_region_showing): Remove.
712 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
713 (try_scrolling, try_cursor_movement, redisplay_window)
714 (try_window_reusing_current_matrix, try_window_id, display_line)
715 (display_mode_lines, decode_mode_spec): Adjust users.
716 * .gdbinit (pwinx): Do not print sequence_number.
717
718 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
719
720 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
721 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
722 * dired.c: Include <fcntl.h>.
723 (open_directory): New function, which uses open and fdopendir
724 rather than opendir. DOS_NT platforms still use opendir, though.
725 (directory_files_internal, file_name_completion): Use it.
726 (file_attributes): New function, with most of the old Ffile_attributes.
727 (directory_files_internal, Ffile_attributes): Use it.
728 (file_attributes, file_name_completion_stat): First arg is now fd,
729 not dir name. All uses changed. Use fstatat rather than lstat +
730 stat.
731 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
732 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
733 (emacs_readlinkat): New function, with much of the old
734 Ffile_symlink_p, but with an fd argument for speed.
735 It uses readlinkat rather than careadlinkatcwd, so that it
736 need not assume the working directory.
737 (Ffile_symlink_p): Use it.
738 * filelock.c (current_lock_owner): Use emacs_readlinkat
739 rather than emacs_readlink.
740 * lisp.h (emacs_readlinkat): New decl.
741 (READLINK_BUFSIZE, emacs_readlink): Remove.
742 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
743 (emacs_norealloc_allocator, emacs_readlink): Remove.
744 This stuff is moved to fileio.c.
745 * w32.c (fstatat, readlinkat): New functions.
746 (careadlinkat): Don't check that fd == AT_FDCWD.
747 (careadlinkatcwd): Remove; no longer needed.
748
749 2013-01-31 Glenn Morris <rgm@gnu.org>
750
751 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
752 (Fwrite_region): Update for new choose_write_coding_system args.
753 Move the last piece of choose_write_coding_system here. (Bug#13522)
754 (syms_of_fileio): Add choose-write-coding-system.
755
756 2013-01-30 Eli Zaretskii <eliz@gnu.org>
757
758 * w32.c (sys_open): Zero out the flags for the new file descriptor.
759 (sys_close): Zero out the flags for the file descriptor before
760 closing it. (Bug#13546)
761
762 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
763 (logon_network_drive, stat_worker, symlink, chase_symlinks):
764 Use CharNextExA and CharPrevExA to iterate over file names encoded in
765 DBCS. (Bug#13553)
766
767 * w32.c (w32_get_long_filename, init_environment, readlink):
768 Support file names encoded in DBCS codepages.
769 (readlink): Use the current file-name-coding-system, not the ANSI
770 codepage, to decode and handle targets of symlinks.
771
772 2013-01-28 Eli Zaretskii <eliz@gnu.org>
773
774 * w32.c (opendir): Now accepts a 'const char *'.
775
776 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
777
778 Remove obsolete redisplay code. See the discussion at
779 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
780 * dispnew.c (preemption_period, preemption_next_check): Remove.
781 (Vredisplay_preemption_period): Likewise.
782 (update_frame, update_single_window, update_window, update_frame_1):
783 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
784 used, following the 2012-06-22 change.
785
786 2013-01-25 Eli Zaretskii <eliz@gnu.org>
787
788 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
789
790 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
791
792 * font.c (num_fonts): Remove the leftover from old
793 debugging code. Adjust comment style here and there.
794 * insdel.c (insert_1): Remove.
795 * lisp.h (insert_1): Remove prototype.
796 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
797
798 2013-01-25 Eli Zaretskii <eliz@gnu.org>
799
800 * w32.c (max_filename_mbslen): New function.
801 (normalize_filename, readdir): Use it to detect locales where ANSI
802 encoding of file names uses a double-byte character set (DBCS).
803 If a DBCS encoding is used, advance by characters using
804 CharNextExA, instead of incrementing a 'char *' pointer.
805 Use _mbslwr instead of _strlwr. (Bug#13515)
806
807 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
808 request of memory reservation to 1.7GB. (Bug#13065)
809
810 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
811
812 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
813 at check_extra_latin label. (Bug#13505)
814
815 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
816
817 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
818 Avoid redundant calls to strlen.
819
820 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
821
822 Drop async_visible and async_iconified fields of struct frame.
823 This is possible because async input is gone; for details, see
824 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
825 * frame.h (struct frame): Remove async_visible and async_iconified
826 members, convert garbaged to unsigned bitfield. Adjust comments.
827 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
828 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
829 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
830 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
831 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
832 * w32term.c: Ditto.
833 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
834 properly. Likewise for obscured.
835 * xterm.c: Ditto.
836 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
837 properly.
838 * nsterm.m: Ditto.
839 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
840
841 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
842
843 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
844 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
845
846 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
847
848 * xdisp.c (message2, message2_nolog): Remove functions.
849 (message3, message3_nolog): Extract nbytes and multibyteness directly
850 from the string. Change all callers.
851 (message3_nolog): Don't set message_enable_multibyte since set_message
852 will reset it anyway.
853 (message1, message1_nolog): Use message3.
854 (vmessage): Use a stack allocated buffer rather than f->message_buf.
855 (with_echo_area_buffer): Remove last two arguments. Update all callers.
856 (set_message): Drop all but the second arg, which has to be a string.
857 (set_message_1): Simplify now that we know that a1 is NULL and the
858 second arg is a string.
859 * frame.h (struct frame): Remove `message_buf' field.
860 Use glyphs_initialized_p instead.
861 (FRAME_MESSAGE_BUF): Remove macro.
862 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
863 * lisp.h (message2, message2_nolog): Remove declarations.
864 (message3, message3_nolog): Update declarations.
865 * keyboard.c (read_char_minibuf_menu_text)
866 (read_char_minibuf_menu_width): Remove vars.
867 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
868 to correctly handle multibyte strings.
869 * frame.c (delete_frame): Don't free message_buf any more.
870 * editfns.c (message_text, message_length): Remove vars.
871 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
872 * fileio.c (auto_save_error): Use message3 instead of message2.
873 * dispnew.c (adjust_frame_message_buffer): Remove function.
874
875 2013-01-23 Eli Zaretskii <eliz@gnu.org>
876
877 * w32term.c (w32fullscreen_hook): Account correctly for the screen
878 real estate used for the tool bar and the menu bar.
879
880 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
881
882 * insdel.c (prepare_to_modify_buffer): Force redisplay if
883 hidden buffer is prepared to modification (Bug#13164).
884
885 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
886
887 * window.h (struct window): Change window_end_valid member from
888 Lisp_Object to a bitfield. Adjust comments.
889 (wset_window_end_valid): Remove.
890 * window.c (adjust_window_count): Clear window_end_valid.
891 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
892 (Fwindow_line_height, set_window_buffer, Frecenter)
893 (Fsplit_window_internal, Fdelete_other_windows_internal)
894 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
895 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
896 * xdisp.c (check_window_end, reconsider_clip_changes)
897 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
898 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
899 (find_first_unchanged_at_end_row, try_window_id): Likewise.
900
901 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
902
903 * xdisp.c (mark_window_display_accurate): Simplify the loop
904 assuming that the only one of vchild, hchild or buffer window
905 slots is non-nil. Call mark_window_display_accurate_1 for
906 the leaf windows only.
907 (mark_window_display_accurate_1): Always assume leaf window.
908 Adjust comment.
909
910 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
911
912 * emacs.c (Qkill_emacs_hook): Now static.
913
914 * fileio.c (Finsert_file_contents): Simplify.
915 Remove unnecessary assignments and tests.
916
917 2013-01-21 Eli Zaretskii <eliz@gnu.org>
918
919 * w32.c (acl_set_file): Don't test for errors unless
920 set_file_security returns FALSE. Avoids spurious errors when
921 saving files.
922
923 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
924
925 * fileio.c (Finsert_file_contents): Revert code introduced at
926 2013-01-18 in favor of the simpler and generally better fix.
927 Save stack space by removing 'buffer' and reusing 'read_buf'
928 where appropriate.
929
930 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
931
932 * lisp.h (eabs): Define unconditionally (Bug#13419).
933 The old "#if !defined (eabs)" was an unnecessary revenant of back
934 when this macro was called "abs". Document 'eabs' better.
935
936 2013-01-19 Glenn Morris <rgm@gnu.org>
937
938 * fns.c (Frandom): Doc fix.
939
940 2013-01-19 Eli Zaretskii <eliz@gnu.org>
941
942 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
943 segfault when there are lots of overlays.
944
945 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
946 when there are lots of overlays.
947 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
948 for the details and a way to reproduce.
949
950 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
951
952 * fileio.c: Use O_APPEND to append.
953 This corresponds better to the natural interpretation of "append",
954 and avoids the need to open the output file twice, or to invoke
955 lseek when APPEND is neither nil nor a number.
956 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
957 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
958 file possibly twice, and lseeking to its end; this avoids the
959 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
960 at the same time: the combination is never needed and apparently
961 it doesn't work with DOS_NT.
962
963 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
964 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
965
966 Allow floating-point file offsets.
967 Problem reported by Vitalie Spinu in
968 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
969 * fileio.c (emacs_lseek): Remove.
970 (file_offset): New function.
971 (Finsert_file_contents, Fwrite_region): Use it.
972
973 2013-01-19 Chong Yidong <cyd@gnu.org>
974
975 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
976 aborting on Fsignal (Bug#13289).
977
978 2013-01-19 Eli Zaretskii <eliz@gnu.org>
979
980 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
981 set_file_security as failure due to insufficient privileges.
982 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
983 (fstat): Return owner and group like 'stat' and 'lstat' do.
984
985 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
986
987 Work around bug in CIFS and vboxsf file systems (Bug#13149).
988 The bug was observed on Ubuntu operating inside a virtual machine,
989 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
990 The workaround introduces a race condition on non-buggy hosts,
991 but it's an unlikely race and anyway there's a nearly identical
992 nearby race that can't be fixed.
993 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
994 New static vars.
995 (Fwrite_region): Test for file system time stamp bug.
996 (init_fileio): New function.
997 * lisp.h (init_fileio): Declare it.
998 * emacs.c (main): Call it.
999
1000 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1001 and make it more consistent with other stat-failure diagnostics.
1002
1003 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1004
1005 Fix crash when inserting data from non-regular files.
1006 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1007 for the error description produced by valgrind.
1008 * fileio.c (read_non_regular): Rename to read_contents.
1009 Free Lisp_Save_Value object used to pass parameters.
1010 (read_non_regular_quit): Rename to read_contents_quit.
1011 (Finsert_file_contents): Redesign internal file reading loop to adjust
1012 gap and end positions after each read and so help make_gap to work
1013 properly. Do not signal an I/O error too early and so do not leave
1014 not yet decoded characters in a buffer, which was the reason of
1015 redisplay crash. Use list2 to build return value. Adjust comments.
1016
1017 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1018
1019 Close a race when statting and reading files (Bug#13149).
1020 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1021 This avoids a race if the file is renamed between stat and open.
1022 This race is not the problem originally noted in Bug#13149;
1023 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1024
1025 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1026
1027 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1028 objects, related functions and macros.
1029 (make_save_value): Adjust prototype.
1030 (make_save_pointer): New prototype.
1031 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1032 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1033 * alloc.c (format_save_value): Rename to make_save_value.
1034 (make_save_pointer): New function.
1035 (record_xmalloc): Use make_save_pointer.
1036 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1037 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1038 Change users of make_save_value to make_save_pointer.
1039 Likewise for format_save_value and make_save_value.
1040
1041 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1042
1043 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1044 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1045 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1046 debugging stubs.
1047
1048 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1049
1050 * alloc.c (free_save_value): Now static.
1051
1052 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1053
1054 * keymap.c (map_keymap_internal): Use format_save_value.
1055 (map_keymap_char_table_item): Adjust accordingly.
1056 * fileio.c (non_regular_fd, non_regular_inserted)
1057 (non_regular_nbytes): Remove.
1058 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1059 Use format_save_value to pass parameters to read_non_regular.
1060 (read_non_regular): Use XSAVE_ macros to extract parameters.
1061 Adjust comment.
1062 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1063 format_save_value.
1064 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1065
1066 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1067
1068 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1069 extraction from any Lisp_Save_Value slot. Add type checking.
1070 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1071 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1072 * xselect.c: All users changed.
1073
1074 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1075
1076 Some convenient bits to deal with Lisp_Save_Values.
1077 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1078 (allocate_misc): Remove prototype.
1079 (format_save_value): New prototype.
1080 * alloc.c (allocate_misc): Revert back to static.
1081 (format_save_value): New function to build Lisp_Save_Value
1082 object with the specified internal structure.
1083 (make_save_value): Reimplement using format_save_value.
1084 * editfns.c (save_excursion_save): Use format_save_value.
1085 (save_excursion_restore): Use XSAVE_OBJECT.
1086
1087 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1088
1089 Avoid needless casts with XSAVE_POINTER.
1090 * alloc.c (mark_object) [GC_MARK_STACK]:
1091 * dired.c (directory_files_internal_unwind):
1092 * fileio.c (do_auto_save_unwind):
1093 * gtkutil.c (pop_down_dialog):
1094 * keymap.c (map_keymap_char_table_item):
1095 * lread.c (load_unwind):
1096 * nsmenu.m (pop_down_menu):
1097 * print.c (print_object) [GC_MARK_STACK]:
1098 * xfns.c (clean_up_file_dialog):
1099 * xmenu.c (cleanup_widget_value_tree):
1100 Omit casts between XSAVE_POINTER and a pointer type.
1101
1102 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1103
1104 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1105 * eval.c (eval_sub): Protect `form' from being GCed before its
1106 car and cdr becomes protected with the backtrace entry.
1107
1108 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1109
1110 Make Lisp_Save_Value more versatile storage for up to four objects.
1111 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1112 (struct Lisp_Save_Value): New layout. Adjust comments.
1113 (XSAVE_POINTER): New macro.
1114 (XSAVE_INTEGER): Likewise.
1115 (allocate_misc): Add prototype.
1116 (free_misc): Likewise.
1117 * alloc.c (allocate_misc): Now global.
1118 (free_misc): Likewise. Adjust comment.
1119 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1120 (free_save_value): Likewise.
1121 (mark_object): Likewise.
1122 * editfns.c (save_excursion_save): Pack everything within
1123 Lisp_Save_Value and so avoid xmalloc.
1124 (save_excursion_restore): Adjust to match new layout. Use free_misc
1125 because we do not allocate extra memory any more. Add eassert.
1126 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1127 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1128 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1129 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1130 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1131
1132 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1133
1134 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1135 (nsfont_draw): Remove disabling of LCD smoothing.
1136 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1137 Bug#11484 with LCD smoothing on.
1138
1139 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
1140
1141 Fix SIGDANGER handlers, for AIX (Bug#13408).
1142 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1143 Move handlers here from emacs.c; they were out of place.
1144
1145 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1146
1147 * xterm.c (syms_of_xterm): Adjust documentation for
1148 scroll-bar-adjust-thumb-portion.
1149
1150 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
1151
1152 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1153 determine whether scroll bar thumb size should be adjusted or
1154 not. Use variable for MOTIF.
1155
1156 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1157 GTK.
1158
1159 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1160
1161 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1162 event is generated.
1163 (doCommandBySelector:): Set processingCompose to NO.
1164
1165 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1166 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1167 (nsfont_list_family): Add block/unblock_input calls.
1168 (nsfont_open): Move block_input earlier. Add unblock_input before early
1169 return.
1170 (nsfont_draw): Add block/unblock_input calls.
1171
1172 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1173
1174 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1175 for old_charpos and old_bytepos.
1176
1177 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1178
1179 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1180 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1181 Clear tzvalbuf_in_environ if this workaround is in effect.
1182 Problem and fix reported by Kazuhiro Ito.
1183
1184 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1185
1186 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1187 Fix ambiguous doc string cross-reference(s).
1188
1189 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1190 doc string cross-reference(s).
1191
1192 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1193 string cross-reference(s).
1194
1195 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1196
1197 Avoid unnecessary byte position calculation for the gap movement.
1198 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1199 anyway, all of them should use move_gap_both instead.
1200 * lisp.h (move_gap): Remove prototype.
1201 * insdel.c (move_gap): Remove.
1202 (move_gap_both): Add eassert.
1203 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1204 * xml.c (parse_region): Likewise.
1205
1206 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1207
1208 emacsclient -t should not suspend Emacs server (Bug#13387)
1209 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1210 New functions.
1211 * term.c (init_tty): Use them instead of rolling our own code.
1212 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1213 switches from 'signal' to 'pthread_sigmask', which is safer in
1214 multithreaded applications.
1215 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1216 which has already arranged for that.
1217 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1218 This is the main part of the bug fix.
1219
1220 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
1221
1222 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1223 x_last_font_name (Bug#13403).
1224
1225 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1226
1227 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1228 the type of per-buffer values where appropriate.
1229 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1230 predicate, which is how it's really used now. Adjust comment.
1231 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1232 * buffer.c (buffer_slot_type_mismatch): Remove.
1233 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1234 predicate. Adjust comment.
1235 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1236 fill-column, left-margin, tab-width, buffer-saved-size,
1237 left-margin-width, right-margin-width, left-fringe-width,
1238 right-fringe-width, scroll-bar-width and buffer-display-count.
1239 Use Qstringp for default-directory, buffer-file-name,
1240 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1241 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1242 line-spacing.
1243 * data.c (store_symval_forwarding): Adjust to call the predicate.
1244
1245 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
1246
1247 * w32.c (get_name_and_id, acl_set_file):
1248 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1249
1250 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1251
1252 * lisp.h (make_gap_1): New prototype.
1253 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1254 gap size values.
1255 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1256 naming convention.
1257 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
1258 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
1259 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1260 (make_gap_1): New function to adjust the gap of any buffer.
1261 * coding.c (coding_alloc_by_making_gap): Use it.
1262 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1263 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1264
1265 2013-01-08 Juri Linkov <juri@jurta.org>
1266
1267 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1268 of (supports :underline (:style wave)). (Bug#13000)
1269
1270 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1271
1272 * undo.c (Fprimitive_undo): Move to simple.el.
1273 (syms_of_undo): Remove declarations for Sprimitive_undo.
1274
1275 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1276
1277 * keyboard.c (echo_add_key): Rename from echo_add_char.
1278
1279 2013-01-06 Chong Yidong <cyd@gnu.org>
1280
1281 * keyboard.c (echo_add_char): New function, factored out from
1282 echo_char. Don't add a space if the previous echo string was
1283 empty (Bug#13255).
1284 (echo_char): Use it.
1285 (read_key_sequence): When echoing mock input, ensure that the
1286 trailing dash is properly added.
1287
1288 2013-01-05 Eli Zaretskii <eliz@gnu.org>
1289
1290 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1291 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
1292 digits for buffer positions, before misalignment starts.
1293 Display "0" for integer "object" field.
1294 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1295 Display the newline glyph more unambiguously.
1296
1297 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1298
1299 * nsterm.m (ns_draw_underwave):
1300 * w32term.c (w32_draw_underwave):
1301 * xterm.c (x_draw_underwave): Make underwave look more triangular
1302 and also degrade gracefully for small fonts. (Bug#13000)
1303
1304 * nsterm.m (ns_draw_text_decoration):
1305 * w32term.c (x_draw_glyph_string):
1306 * xterm.c (x_draw_glyph_string): Don't use previous underline
1307 thickness and position if previous underline type is underwave.
1308
1309 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1310
1311 * fileio.c (Ffile_acl): Undocument return format.
1312
1313 2013-01-02 Glenn Morris <rgm@gnu.org>
1314
1315 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1316
1317 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1318
1319 Simplify via eabs.
1320 * dired.c (file_name_completion):
1321 * doc.c (get_doc_string):
1322 * floatfns.c (round2):
1323 * font.c (font_score, font_delete_unmatched):
1324 * fringe.c (compute_fringe_widths):
1325 * lread.c (read_list):
1326 * minibuf.c (Ftry_completion):
1327 * term.c (tty_ins_del_lines):
1328 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1329 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1330
1331 2012-12-31 Eli Zaretskii <eliz@gnu.org>
1332
1333 * w32.c (unsetenv): Set up the string passed to _putenv
1334 correctly.
1335 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
1336 for the bug this caused.
1337
1338 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1339
1340 * coding.c (Qmac): Now static.
1341
1342 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1343
1344 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1345 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1346 handlebox_widget. Set toolbar_in_hbox to false/true, set
1347 toolbar_is_packed to true.
1348 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1349 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1350 Show all on TOOLBAR_TOP_WIDGET.
1351 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1352 by TOOLBAR_TOP_WIDGET.
1353 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1354 Check toolbar_is_packed.
1355 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1356 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1357 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1358 false.
1359 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1360 (xg_update_menubar): Update title only if
1361 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1362 (xg_update_submenu): Skip tearoff only if
1363 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1364 (xg_initialize): Initialize xg_detached_menus only if
1365 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1366
1367 * xterm.h (struct x_output): Surround handlebox_widget with
1368 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1369 toolbar_in_hbox is bool.
1370
1371 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
1372
1373 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1374 (LIBS_GNUSTEP): Define.
1375 (LIBES): Add $(LIBS_GNUSTEP).
1376 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1377
1378 2012-12-30 Eli Zaretskii <eliz@gnu.org>
1379
1380 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1381 continuation glyph on a TTY with an indication of an empty line.
1382 (Bug#13277)
1383
1384 2012-12-29 Eli Zaretskii <eliz@gnu.org>
1385
1386 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1387 file's SELinux context or ACLs successfully set, nil otherwise.
1388 (Bug#13298)
1389 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
1390
1391 * w32proc.c (reader_thread): Avoid passing NULL handles to
1392 SetEvent and WaitForSingleObject.
1393
1394 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1395
1396 Port EXTERNALLY_VISIBLE to Clang 3.2.
1397 * conf_post.h (__has_attribute): New macro.
1398 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1399
1400 2012-12-27 Glenn Morris <rgm@gnu.org>
1401
1402 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1403 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1404
1405 2012-12-27 Eli Zaretskii <eliz@gnu.org>
1406
1407 * fileio.c (file_name_as_directory, directory_file_name):
1408 Accept an additional argument MULTIBYTE to indicate whether the input C
1409 came from a multibyte or a unibyte Lisp string; all callers
1410 adjusted. Don't assume the input string is always multibyte.
1411 (Bug#13262)
1412 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1413 don't ENCODE_FILE them, and return a unibyte string if the input
1414 was unibyte.
1415 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1416 don't assume the input strings will always be multibyte. If the
1417 input strings are multibyte, decode strings obtained from C
1418 library functions.
1419
1420 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1421
1422 * lisp.h (toplevel): Add two notices to the comment about
1423 defining a new Lisp data type.
1424 * print.c (print_object): If Lisp_Save_Value object's pointer
1425 is the address of a memory area containing Lisp_Objects, try
1426 to print them.
1427 * alloc.c (valid_lisp_object_p): Adjust comment.
1428
1429 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1430
1431 * keyboard.c (record_asynch_buffer_change): Initialize an event
1432 only if it's really needed.
1433 * frame.h (enum output_method): Remove output_mac member since
1434 it's a leftover from the deleted code.
1435 * frame.c (Fframep): Adjust user here ...
1436 * terminal.c (Fterminal_live_p): ... and here.
1437 * coding.c (Qmac): Now here because it's only used to denote
1438 end-of-line encoding type.
1439 (syms_of_coding): DEFSYM it.
1440 * frame.h (Qmac): Remove duplicated declaration.
1441
1442 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1443
1444 * window.c (select_window_1): Now static, since it's used only here.
1445
1446 2012-12-25 Eli Zaretskii <eliz@gnu.org>
1447
1448 * window.c (window_body_cols): Subtract display margins from the
1449 window body width on TTYs as well. See
1450 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1451 for the original report.
1452
1453 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1454
1455 * xdisp.c (redisplay_window): Remove inner local variable
1456 because the outer shadowed one has the same meaning.
1457 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1458 set but never used.
1459 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1460 (xg_create_tool_bar): Adjust users.
1461
1462 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1463
1464 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1465 * buffer.c (Fget_buffer_create): Use it to set compact field of
1466 struct buffer_text to avoid accessing an uninitialized value
1467 when compact_buffer is called for the first time.
1468 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
1469 (Fset_buffer_modified_p): Use buffer_window_count to check
1470 whether the buffer is displayed in some window.
1471 * xdisp.c (message_dolog): Likewise.
1472
1473 2012-12-23 Eli Zaretskii <eliz@gnu.org>
1474
1475 * w32.c (acl_set_file): If setting the file security descriptor
1476 fails, and the new DACL is identical to the existing one, silently
1477 return success. This fixes problems for users backing up their
1478 own files without having the necessary privileges for setting
1479 security descriptors.
1480
1481 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1482 values.
1483 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1484 after WaitForSingleObject returns normally. This expedites reader
1485 thread shutdown when delete_child triggers it.
1486 (reap_subprocess): More accurate commentary for why we call
1487 delete_child only when cp->fd is negative.
1488
1489 * w32.c (sys_close): Do not call delete_child on a subprocess
1490 whose handle is not yet closed. Instead, set its file descriptor
1491 to a negative value, so that reap_subprocess will call
1492 delete_child on that subprocess when its SIGCHLD arrives.
1493 This avoids closing handles used for communications between sys_select
1494 and reader_thread, which doesn't give sys_select a chance to
1495 notice that the process exited and invoke the SIGCHLD handler for
1496 it.
1497
1498 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1499
1500 * nsfns.m (Fns_do_applescript): Run event loop until script has
1501 been executed (Bug#12969).
1502 (ns_run_ascript): Chech as_script for nil, set to nil after
1503 executing script.
1504
1505 2012-12-22 Martin Rudalics <rudalics@gmx.at>
1506
1507 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1508
1509 2012-12-22 Eli Zaretskii <eliz@gnu.org>
1510
1511 * w32term.c (w32fullscreen_hook): New function.
1512 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1513
1514 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1515
1516 * fileio.c (Finsert_file_contents): Doc fix.
1517
1518 * w32proc.c (new_child, delete_child, find_child_pid): For a
1519 subprocess, consider its slot being in use as long as its process
1520 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1521 slot when a new process is started immediately after killing
1522 another one, without waiting enough time for the first process to
1523 be reaped and resources allocated for it be orderly freed.
1524 (Bug#13086)
1525 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1526
1527 2012-12-21 Chong Yidong <cyd@gnu.org>
1528
1529 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1530
1531 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1532
1533 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1534
1535 * w32.c (get_name_and_id): Always pass NULL as the first argument
1536 of lookup_account_sid. Avoids crashes with UNC file names that
1537 refer to DFS domains, not to specific machine names. (Bug#12621)
1538 Remove now unused argument FNAME; all callers changed.
1539 (get_file_owner_and_group): Remove now unused argument FNAME; all
1540 callers changed.
1541
1542 2012-12-21 Chong Yidong <cyd@gnu.org>
1543
1544 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1545 error for invalid chars, don't check for a nil return value.
1546
1547 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1548
1549 Avoid calls to CHAR_TO_BYTE if byte position is known.
1550 * editfns.c (make_buffer_string_both): Use move_gap_both.
1551 (Fbuffer_string): Use make_buffer_string_both.
1552 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1553 Adjust comment.
1554 (buf_bytepos_to_charpos): Likewise.
1555 (charpos_to_bytepos): Remove.
1556 * fileio.c (Finsert_file_contents): Use move_gap_both.
1557 * search.c (Freplace_match): Likewise.
1558 * process.c (process_send_region): Likewise. Use convenient
1559 names for byte positions.
1560 * lisp.h (charpos_to_bytepos): Remove prototype.
1561 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1562 * insdel.c (move_gap): Likewise.
1563
1564 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1565
1566 * xdisp.c (redisplay_internal): Remove now-unused local.
1567
1568 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1569
1570 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1571 (redisplay_internal): Don't bother selecting the frame to get the
1572 proper value of frame-local variables (bug#13225).
1573
1574 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1575
1576 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1577 Rename 4th argument since it may be buffer or string. Adjust comment.
1578 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1579
1580 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1581
1582 * coding.c (Fdetect_coding_region): Do not check start and end with
1583 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1584 (code_convert_region): Likewise.
1585
1586 2012-12-18 Eli Zaretskii <eliz@gnu.org>
1587
1588 * w32.c (acl_get_file, acl_set_file): Run the file name through
1589 map_w32_filename, and resolve any symlinks in the file name, like
1590 Posix platforms do.
1591 (acl_set_file): Call revert_to_self, if any privileges were
1592 enabled.
1593
1594 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
1595
1596 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1597 ($(BLD)/w32.$(O)): Update dependencies.
1598
1599 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1600
1601 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1602 propagate redisplay's scrolling (if any) to the right window.
1603 (redisplay_internal): Use ensure_selected_frame.
1604 (display_mode_lines): Complete last fix.
1605 * window.c (select_window_1): New func, extracted from select_window.
1606 (select_window): Use it.
1607 * window.h (select_window_1): Declare.
1608
1609 2012-12-17 Eli Zaretskii <eliz@gnu.org>
1610
1611 Emulate Posix ACL APIs on MS-Windows.
1612 * w32.c: Include sddl.h and sys/acl.h.
1613 (SDDL_REVISION_1): Define if not already defined.
1614 (g_b_init_get_security_descriptor_dacl)
1615 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1616 (g_b_init_is_valid_security_descriptor)
1617 (g_b_init_set_file_security): New static flags.
1618 (globals_of_w32): Initialize them to zero.
1619 (SetFileSecurity_Name): New string constant.
1620 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1621 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1622 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1623 (IsValidSecurityDescriptor_Proc): New typedefs.
1624 (get_file_security, get_security_descriptor_owner)
1625 (get_security_descriptor_group): Set errno to ENOTSUP.
1626 (set_file_security, get_security_descriptor_dacl)
1627 (is_valid_security_descriptor, convert_sd_to_sddl)
1628 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1629 (acl_free, acl_get_file, acl_set_file): New functions.
1630
1631 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1632
1633 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1634
1635 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1636 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1637 for some of that bug's symptoms can now cause Emacs to abort.
1638 Remove the workaround.
1639 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1640 The bug that caused SIGCHLD to get lost has been fixed, and the
1641 workaround for it can now cause Emacs to abort.
1642
1643 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1644
1645 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1646 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1647 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1648
1649 2012-12-16 Romain Francoise <romain@orebokech.com>
1650
1651 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1652 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1653 and copy ACL entries of file in addition to SELinux context if set.
1654 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1655
1656 * Makefile.in (LIBACL_LIBS): New macro.
1657 (LIBES): Use it.
1658
1659 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1660
1661 * fileio.c (internal_delete_file): Use bool for boolean.
1662
1663 2012-12-15 Eli Zaretskii <eliz@gnu.org>
1664
1665 Fix bug #13079 on MS-Windows with temp files not being deleted.
1666 * w32.h (_child_process): New members input_file and
1667 pending_deletion.
1668 (register_child): First argument is now pid_t.
1669 (record_infile, record_pending_deletion): New prototypes.
1670
1671 * w32proc.c (new_child): Initialize input_file and
1672 pending_deletion members of the child.
1673 (delete_child): Delete the child's temporary input file, if any,
1674 that is pending deletion.
1675 (register_child): First argument is now pid_t.
1676 (record_infile, record_pending_deletion): New functions.
1677 (reap_subprocess): Fix a typo in DebPrint string.
1678 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1679
1680 * fileio.c (internal_delete_file): Return an int again: non-zero
1681 if delete-file succeeds, zero otherwise.
1682
1683 * lisp.h (internal_delete_file): Adjust prototype.
1684
1685 * callproc.c (Fcall_process): Don't overwrite infile with result
1686 of DECODE_FILE.
1687 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1688 asynchronous subprocess, record the name of the input file name,
1689 if any.
1690 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1691 delete the file, record it as pending deletion when the subprocess
1692 exits.
1693
1694 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1695
1696 * editfns.c [HAVE_PWD_H]: Include grp.h.
1697
1698 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1699
1700 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1701
1702 Fix permissions bugs with setgid directories etc. (Bug#13125)
1703 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1704 to mark it as a placeholder. The old value was often wrong.
1705 The only user of this attribute has been changed to use
1706 file-ownership-preserved-p instead, with its new group arg.
1707 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1708
1709 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1710
1711 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1712 Keep selected_window and selected_frame in sync.
1713
1714 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1715
1716 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1717 try to get accurate owner and group information from NT file
1718 security APIs. This is to make most callers of 'stat' and
1719 'lstat', which don't need that information, much faster.
1720
1721 * dired.c (Ffile_attributes) [WINDOWSNT]:
1722 Set w32_stat_get_owner_group to a non-zero value, to request accurate
1723 owner and group information from 'lstat'.
1724
1725 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1726
1727 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1728 as that confuses set-auto-coding, so insist on the head-read
1729 returning the full 1024 bytes. Let lseek compute the tail offset;
1730 less work for us. Do not ignore I/O errors when reading the tail.
1731
1732 * xdisp.c: Minor style fixes.
1733 (init_iterator): Hoist assignment out of if-expression.
1734 (markpos_of_region): Callers now test for sign, not for -1.
1735
1736 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1737
1738 Minor redisplay optimization when the region length is zero.
1739 * xdisp.c (markpos_of_region): New function.
1740 (init_iterator): Do not highlight the region of zero length.
1741 (redisplay_window): Check whether the region is of non-zero length.
1742 (try_cursor_movement): Allow if the region length is zero.
1743 (try_window_reusing_current_matrix, try_window_id): Likewise.
1744
1745 2012-12-13 Eli Zaretskii <eliz@gnu.org>
1746
1747 * search.c (search_buffer): Check the inverse translations of each
1748 character in pattern when the buffer being searched is unibyte.
1749 (Bug#13084)
1750
1751 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1754 files, fixing a regression from 24.2.
1755 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
1756
1757 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1758
1759 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1760 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1761 Remove unnecessary S_ISLNK test, as (contra the comments) this
1762 function can't copy symlinks. Improve quality of error message
1763 when attempting to copy files that are neither regular files nor
1764 directories.
1765
1766 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1767
1768 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1769 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1770 * window.c (Frecenter):
1771 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1772 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1773
1774 2012-12-12 Daniel Colascione <dancol@dancol.org>
1775
1776 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
1777 the dumped Emacs is not a sparse file, greatly improving Cygwin
1778 "make bootstrap" performance.
1779
1780 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
1781
1782 * inotify.c (inotify_callback): Generate an Emacs event for every
1783 incoming inotify event.
1784
1785 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1786
1787 * xdisp.c (handle_face_prop): Fix logic of computing
1788 it->start_of_box_run_p.
1789 (append_space_for_newline): If the glyph row is R2L, reset the
1790 iterator's end_of_box_run_p flag before prepending the space glyph.
1791 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1792 iterator's start_of_box_run_p flag before prepending the stretch.
1793 (append_glyph, produce_image_glyph, append_composite_glyph)
1794 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1795 left_box_line_p and right_box_line_p flags of the glyph for R2L
1796 glyph rows. (Bug#13011)
1797
1798 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1799
1800 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1801 if changed buffer is not shown in a window.
1802 * insdel.c (prepare_to_modify_buffer): Likewise.
1803 * window.c (replace_buffer_in_windows_safely): Do nothing
1804 if buffer is not shown in a window.
1805 (Fforce_window_update): Likewise if string or buffer argument
1806 is passed.
1807
1808 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1809
1810 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1811 encoded_file_name, which is what it is.
1812
1813 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1814
1815 Consistently use marker_position and marker_byte_position.
1816 * fringe.c (Ffringe_bitmaps_at_pos):
1817 * indent.c (Fvertical_motion):
1818 * insdel.c (prepare_to_modify_buffer):
1819 * keyboard.c (make_lispy_position):
1820 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1821 (window_scroll_pixel_based, displayed_window_lines)
1822 (Fset_window_configuration):
1823 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1824 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1825 Replace direct access to marker fields with calls
1826 to marker_position and/or marker_byte_position.
1827
1828 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
1829
1830 * makefile.w32-in (SIG2STR_H): New macro.
1831 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1832 ($(BLD)/w32notify.$(O)): Update dependencies.
1833
1834 2012-12-10 Daniel Colascione <dancol@dancol.org>
1835
1836 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1837 Windows file notification functionality unless WINDOWSNT.
1838
1839 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1840 declarations.
1841
1842 * w32fns.c (cache_system_info): Initialize the global hinst
1843 variable here so various initialization calls DTRT.
1844
1845 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1846 (hinst): Remove unneeded extern declaration.
1847 (_start): Remove initialization of above variables; remove
1848 initialization of hinst, as cache_system_info now does that.
1849
1850 * emacs.c (main): Call cache_system_info early in startup; we
1851 previously weren't calling it in Cygwin builds.
1852
1853 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1854 Teach the autoconf build system how to compile a Windows resource file
1855 and link it to Emacs.
1856
1857 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1858
1859 Per-buffer window counters.
1860 * buffer.h (struct buffer): New member window_count.
1861 (buffer_window_count): New function.
1862 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1863 Initialize window_count.
1864 (Fkill_buffer): Verify window_count for the buffer being killed.
1865 (modify_overlay): Do not force redisplay if buffer is not shown
1866 in any window.
1867 (init_buffer_once): Initialize window_count for buffer_defaults
1868 and buffer_local_symbols.
1869 * window.h (buffer_shared): Remove declaration.
1870 (wset_buffer): Convert from inline ...
1871 * window.c (wset_buffer): ... to an ordinary function.
1872 (adjust_window_count): New function.
1873 (make_parent_window): Use it.
1874 * xdisp.c (buffer_shared): Remove.
1875 (redisplay_internal, redisplay_window): Adjust users.
1876 (buffer_shared_and_changed): Use per-buffer window counter.
1877
1878 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1879
1880 Support for filesystem notifications on MS-Windows.
1881 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1882 and this is a TTY frame, signal the caller that keyboard input is
1883 available.
1884
1885 * w32xfns.c (drain_message_queue): Now returns an int: an
1886 indication whether any WM_EMACS_FILENOTIFY messages were found in
1887 the queue.
1888
1889 * w32inevt.c (handle_file_notifications): New function.
1890 (w32_console_read_socket): Call it to process file notifications.
1891
1892 * w32console.c (initialize_w32_display): Record the main thread ID
1893 in dwMainThreadId.
1894
1895 * deps.mk (inotify.o): New dependency list.
1896
1897 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1898
1899 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1900 (WM_EMACS_END): Bump value by 1.
1901 (notification_buffer_in_use, file_notifications)
1902 (notifications_size, notifications_desc): Declare.
1903 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1904 Add prototypes.
1905
1906 * w32term.c (lispy_file_action, queue_notifications): New functions.
1907 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1908 <Qrenamed_to>: New symbols.
1909 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1910
1911 * w32notify.c: New file, implements file event notifications for
1912 MS-Windows.
1913
1914 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1915 by posting it to the w32_read_socket queue.
1916
1917 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
1918
1919 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1920 (GLOBAL_SOURCES): Add w32notify.c
1921 ($(BLD)/w32notify.$(O)): New set of dependencies.
1922
1923 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1924
1925 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1926 Handle FILE_NOTIFY_EVENT.
1927 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1928 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1929 w32notify-handle-event by default.
1930
1931 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1932 syms_of_w32notify.
1933
1934 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1935
1936 Support for filesystem notifications on GNU/Linux via inotify.
1937 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
1938
1939 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1940
1941 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1942 (syms_of_keyboard): DEFSYM it.
1943 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1944 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1945 Qfile_inotify events.
1946 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1947 special-event-map to inotify-handle-event.
1948
1949 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1950
1951 * Makefile.in (base_obj): Add inotify.o.
1952
1953 * inotify.c: New file.
1954
1955 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
1956
1957 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1958
1959 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
1960
1961 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1962 DWORD_PTR, for compatibility with 64-bit builds.
1963
1964 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
1965 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1966 (system_process_attributes): Use SIZE_T rather than DWORD, for
1967 compatibility with 64-bit builds.
1968
1969 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
1970
1971 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1972
1973 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1974
1975 * indent.c (Fvertical_motion): If a display string will be
1976 displayed on the left or the right margin, don't consider it as a
1977 factor in cursor positioning. (Bug#13108)
1978
1979 2012-12-10 Martin Rudalics <rudalics@gmx.at>
1980
1981 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1982
1983 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
1984
1985 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
1986 for string length.
1987
1988 2012-12-08 Eli Zaretskii <eliz@gnu.org>
1989
1990 * w32.c (unsetenv): Return 0 if the input string is too long.
1991
1992 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1993
1994 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
1995 * alloc.c (xputenv): New function.
1996 * dbusbind.c (Fdbus_init_bus):
1997 * emacs.c (main):
1998 * xterm.c (x_term_init):
1999 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2000 * editfns.c (initial_tz): Move static var decl up.
2001 (tzvalbuf_in_environ): New static var.
2002 (init_editfns): Initialize these two static vars.
2003 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2004 Save old TZ value on stack, if it's small.
2005 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2006 instead, use xputenv+unsetenv to set and restore TZ.
2007 (environbuf): Remove static var. All uses removed.
2008 (Fset_time_zone_rule): Do not save TZ and environ;
2009 no longer needed here.
2010 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2011 Move to inside set_time_zone_rule; they don't need file scope any more.
2012 (set_time_zone_rule): Maintain the TZ=value string separately.
2013 (syms_of_editfns): Don't initialize initial_tz;
2014 init_editfns now does it.
2015 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2016 * lisp.h (xputenv): New decl.
2017
2018 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2019
2020 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2021
2022 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2023
2024 * w32.c (unsetenv, sys_putenv): New functions.
2025
2026 2012-12-08 Chong Yidong <cyd@gnu.org>
2027
2028 * editfns.c (Finsert_char): Make the error message more
2029 informative (Bug#12992).
2030
2031 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2032
2033 Simplify get_lim_data.
2034 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2035 Remove USG and vlimit methods; no longer used these days.
2036 Add #error catchall just in case.
2037
2038 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2039 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2040 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2041 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2042 (deleted_pid_list, Fdelete_process, create_process)
2043 (record_child_status_change, handle_child_signal, deliver_child_signal)
2044 (init_process_emacs, syms_of_process):
2045 Assume SIGCHLD is defined.
2046 (parse_signal): Remove. All uses removed.
2047 (abbr_to_signal): New static function.
2048 (Fsignal_process): Use it to convert signal names to ints.
2049 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2050 kill (getpgrp (), ...).
2051 (emacs_sigaction_init): Assume SIGCHLD is defined.
2052 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2053 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2054 * syssignal.h (EMACS_KILLPG): Remove.
2055 All uses replaced by 'kill' with a negative pid.
2056 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2057 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2058
2059 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2060
2061 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2062 This will cause a production Emacs to dump core instead of
2063 infinite-looping.
2064
2065 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2066
2067 * frame.c (make_frame): Do not set window's buffer to t.
2068 * window.c (Fsplit_window_internal): Likewise. Previously it was
2069 used to indicate that the window is being set up. Now we use
2070 set_window_buffer for all new windows, so the condition in ...
2071 (Fset_window_buffer): ... is always true and can be removed.
2072
2073 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2074
2075 Convenient macro to check whether the buffer is hidden.
2076 * buffer.h (BUFFER_HIDDEN_P): New macro.
2077 * frame.c (make_frame): Use it. Adjust comment.
2078 * buffer.c (candidate_buffer): New function.
2079 (Fother_buffer, other_buffer_safely): Use it.
2080
2081 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2082
2083 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2084 if the child process is still running. Instead, exit the wait
2085 loop and return zero. (Bug#13086)
2086
2087 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2088
2089 * frame.h (x_char_width, x_char_height): Remove prototypes.
2090 * w32term.h (x_char_width, x_char_height): Likewise.
2091 * xfns.c (x_char_width, x_char_height): Remove.
2092 * w32fns.c (x_char_width, x_char_height): Likewise.
2093 * nsfns.c (x_char_width, x_char_height): Likewise.
2094 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2095 all window frames.
2096 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2097 * keyboard.c (command_loop_1): Remove prototype.
2098 (command_loop_2, top_level_1): Add static to match prototype.
2099
2100 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 Fix a recently-introduced delete-process race condition.
2103 * callproc.c, process.h (record_kill_process):
2104 New function, containing part of the old call_process_kill.
2105 (call_process_kill): Use it.
2106 This does not change call_process_kill's behavior.
2107 * process.c (Fdelete_process): Use record_kill_process to fix a
2108 race condition that could cause Emacs to lose track of a child.
2109
2110 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2111
2112 Avoid code duplication between prev_frame and next_frame.
2113 * frame.c (candidate_frame): New function. Add comment.
2114 (prev_frame, next_frame): Use it. Adjust comment.
2115
2116 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2117
2118 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2119 fails, signal an error instead of continuing with an empty
2120 string. (Bug#13079)
2121 Encode expanded temp file pattern before passing it to mkstemp or
2122 mktemp.
2123
2124 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2125 Encode the file name before passing it to dostounix_filename, in
2126 case it will downcase it (under w32-downcase-file-names).
2127 (Bug#12933)
2128
2129 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2130
2131 Minor call-process cleanups.
2132 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2133 at the same time as other platforms, to simplify analysis.
2134 No need for fd0_volatile since we have synch_process_fd.
2135 Avoid needless emacs_close; arg is always negative.
2136
2137 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2138
2139 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2140 processes.
2141
2142 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2143
2144 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2145 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2146 and mouse_face_hidden members to a bitfields.
2147 * frame.h (struct frame): Remove set-but-not-used space_width member.
2148 (FRAME_SPACE_WIDTH): Remove.
2149 * nsterm.m, w32term.c, xterm.c: Adjust users.
2150 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2151 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2152 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2153 members to a bitfields.
2154
2155 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 Don't let call-process be a zombie factory (Bug#12980).
2158 Fixing this bug required some cleanup of the signal-handling code.
2159 As a side effect, this change also fixes a longstanding rare race
2160 condition whereby Emacs could mistakenly kill unrelated processes,
2161 and it fixes a bug where a second C-g does not kill a recalcitrant
2162 synchronous process in GNU/Linux and similar platforms.
2163 The patch should also fix the last vestiges of Bug#9488,
2164 a bug which has mostly been fixed on the trunk by other changes.
2165 * callproc.c, process.h (synch_process_alive, synch_process_death)
2166 (synch_process_termsig, sync_process_retcode):
2167 Remove. All uses removed, to simplify analysis and so that
2168 less consing is done inside critical sections.
2169 * callproc.c (call_process_exited): Remove. All uses replaced
2170 with !synch_process_pid.
2171 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2172 These take the role of what used to be in unwind-protect arg.
2173 All uses changed.
2174 (block_child_signal, unblock_child_signal):
2175 New functions, to avoid races that could kill innocent-victim processes.
2176 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2177 (call_process_kill): Record killed processes as deleted, so that
2178 zombies do not clutter up the system. Do this inside a critical
2179 section, to avoid a race that would allow the clutter.
2180 (call_process_cleanup): Fix code so that the second C-g works again
2181 on common platforms such as GNU/Linux.
2182 (Fcall_process): Create the child process in a critical section,
2183 to fix a race condition. If creating an asynchronous process,
2184 record it as deleted so that zombies do not clutter up the system.
2185 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2186 light of these changes. Omit unnecessary call to emacs_close
2187 before failure, as the unwind-protect code does that.
2188 * callproc.c (call_process_cleanup):
2189 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2190 * process.c (record_deleted_pid): New function, containing
2191 code refactored out of Fdelete_process.
2192 (Fdelete_process): Use it.
2193 (process_status_retrieved): Remove. All callers changed to use
2194 child_status_change.
2195 (record_child_status_change): Remove, folding its contents into ...
2196 (handle_child_signal): ... this signal handler. Now, this
2197 function is purely a handler for SIGCHLD, and is not called after
2198 a synchronous waitpid returns; the synchronous code is moved to
2199 wait_for_termination. There is no need to worry about reaping
2200 more than one child now.
2201 * sysdep.c (get_child_status, child_status_changed): New functions.
2202 (wait_for_termination): Now takes int * status and bool
2203 interruptible arguments, too. Do not record child status change;
2204 that's now the caller's responsibility. All callers changed.
2205 Reimplement in terms of get_child_status.
2206 (wait_for_termination_1, interruptible_wait_for_termination):
2207 Remove. All callers changed to use wait_for_termination.
2208 * syswait.h: Include <stdbool.h>, for bool.
2209 (record_child_status_change, interruptible_wait_for_termination):
2210 Remove decls.
2211 (record_deleted_pid, child_status_changed): New decls.
2212 (wait_for_termination): Adjust to API changes noted above.
2213
2214 * bytecode.c, lisp.h (Qbytecode): Remove.
2215 No longer needed after 2012-11-20 interactive-p changes.
2216
2217 2012-12-03 Eli Zaretskii <eliz@gnu.org>
2218
2219 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2220 the scroll margin, move point outside the margin. (Bug#13055)
2221
2222 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2223
2224 * gtkutil.c (my_log_handler): New function.
2225 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2226
2227 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2228
2229 * lisp.h (modify_region): Rename to...
2230 (modify_region_1): ...new prototype.
2231 * textprop.c (modify_region): Now static. Adjust users.
2232 * insdel.c (modify_region): Rename to...
2233 (modify_region_1): ...new function to work with current buffer.
2234 Adjust comment and users. Use true and false for booleans.
2235
2236 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2237
2238 * alloc.c (free_save_value): New function.
2239 (safe_alloca_unwind): Use it.
2240 * lisp.h (free_save_value): New prototype.
2241 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2242 Add comment.
2243 (save_excursion_restore): Adjust to match saved data structure.
2244 Use free_save_value to offload some work from GC. Drop obsolete
2245 #if 0 code.
2246
2247 2012-12-03 Chong Yidong <cyd@gnu.org>
2248
2249 * fileio.c (Vauto_save_list_file_name): Doc fix.
2250
2251 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
2252
2253 * w32fns.c: Remove prototype of atof.
2254 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
2255 builds.
2256 (file_dialog_callback): Make it UINT_PTR.
2257
2258 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2259 with 64-bit builds.
2260
2261 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2262 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2263 defined.
2264
2265 2012-12-03 Glenn Morris <rgm@gnu.org>
2266
2267 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
2268
2269 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2270
2271 Fix xpalloc confusion after memory is exhausted.
2272 * alloc.c (xpalloc): Comment fix.
2273 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2274 and signals an error, do not clear charset_table_size, as
2275 charset_table is still valid.
2276 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2277
2278 Use execve to avoid need to munge environ (Bug#13054).
2279 * callproc.c (Fcall_process):
2280 * process.c (create_process):
2281 Don't save and restore environ; no longer needed.
2282 * callproc.c (child_setup):
2283 Use execve, not execvp, to preserve environ.
2284
2285 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2288
2289 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2290
2291 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2292 display for sliced images (Bug#10500).
2293
2294 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2295
2296 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
2297
2298 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2299 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2300
2301 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2302
2303 * xdisp.c (window_outdated): Remove eassert since it hits
2304 some suspicious corner cases (see Bug#13007 and Bug#13012).
2305 (mode_line_update_needed): New function.
2306 (redisplay_internal, redisplay_window): Use it.
2307 (ensure_selected_frame): New function.
2308 (redisplay_internal, unwind_redisplay): Use it.
2309 (redisplay_internal): Move comment about buffer_shared...
2310 (buffer_shared_and_changed): ...near to its real use.
2311
2312 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2313
2314 * callproc.c (Fcall_process): Don't misreport vfork failure.
2315
2316 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 * callproc.c (Fcall_process): Fix vfork portability problems.
2319 Do not assume that fd[0], count, filefd, and save_environ survive
2320 vfork. Fix bug whereby wrong errno value could be reported for
2321 pipe failure. Some minor cleanups, too, as follows. Move buf and
2322 bufsize to the context where they're needed. Change new_argv to
2323 be of type char **, as this is more convenient and avoids casts.
2324 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2325 Now local constants, not macros.
2326
2327 2012-11-18 Kenichi Handa <handa@gnu.org>
2328
2329 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2330 for the variable "f".
2331
2332 2012-11-13 Kenichi Handa <handa@gnu.org>
2333
2334 * font.c (font_unparse_xlfd): Exclude special characters from the
2335 generating XLFD name.
2336
2337 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2338
2339 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2340 * dired.c (stat_uname, stat_gname):
2341 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2342
2343 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2344 * dired.c (directory_files_internal, file_name_completion):
2345 Assume EAGAIN and EINTR are defined.
2346
2347 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2348 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2349 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2350 * lread.c (readbyte_from_file): Assume EINTR is defined.
2351 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2352 Assume EIO and EAGAIN are defined.
2353 * unexcoff.c (write_segment): Assume EFAULT is defined.
2354
2355 2012-11-27 Eli Zaretskii <eliz@gnu.org>
2356
2357 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2358 (Bug#11964)
2359
2360 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2361 highlighting on the frame was cleared. Prevents assertion
2362 violations when repeatedly clicking on the "Top" link of the
2363 "bread-crumbs" in Info buffers.
2364
2365 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2366
2367 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2368
2369 2012-11-24 Ken Brown <kbrown@cornell.edu>
2370
2371 * keyboard.c (HAVE_MOUSE):
2372 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2373 were always defined.
2374
2375 2012-11-24 Eli Zaretskii <eliz@gnu.org>
2376
2377 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2378 between bpos_covered and bpos_max. This fixes cursor display when
2379 several display strings follow each other.
2380
2381 * .gdbinit (pgx): If the glyph's object is a string, display the
2382 pointer to string data, rather than the value of the string object
2383 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2384
2385 * indent.c (Fvertical_motion): If the starting position is covered
2386 by a display string, return to one position before that, to avoid
2387 overshooting it inside move_it_to. (Bug#12930)
2388
2389 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2390
2391 * frame.h (struct frame): Remove display_preempted member
2392 since all users are dead long ago.
2393 * nsterm.h (struct x_output): Use the only dummy member.
2394 * w32menu.c (pending_menu_activation): Remove since not
2395 really used.
2396 (set_frame_menubar): Adjust user.
2397 * w32term.h (struct x_output): Drop outdated #if 0 code.
2398 (struct w32_output): Use bitfields for explicit_parent,
2399 asked_for_visible and menubar_active members.
2400 Drop unused pending_menu_activation member.
2401 * xterm.h (struct x_output): Drop outdated #if 0 code.
2402 Use bitfields for explicit_parent, asked_for_visible,
2403 has_been_visible and net_wm_state_hidden_seen members.
2404
2405 2012-11-23 Eli Zaretskii <eliz@gnu.org>
2406
2407 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2408 of a literal "/". (Bug#12955)
2409 (gl-stamp): Invoke fc.exe directly, not through cmd.
2410
2411 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2412
2413 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2414 * dired.c: Assume HAVE_DIRENT_H.
2415 (NAMLEN): Remove, replacing with ...
2416 (dirent_namelen): New function. All uses changed. Use the GNU macro
2417 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2418 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2419 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2420 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2421 $(NT_INC)/dirent.h.
2422 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2423 * ndir.h: Rename to ../nt/inc/dirent.h.
2424 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2425 Do not include <dirent.h>; no longer needed.
2426 * w32.c: Include <dirent.h> rather than "ndir.h".
2427
2428 2012-11-23 Chong Yidong <cyd@gnu.org>
2429
2430 * xftfont.c (xftfont_open): Remove duplicate assignment.
2431
2432 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2433
2434 * alloc.c (Fgarbage_collect): Unblock input after clearing
2435 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2436 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2437 * msdos.c (IT_frame_up_to_date): Use it here...
2438 * w32term.c (w32_frame_up_to_date): ...here...
2439 * xterm.c (XTframe_up_to_date): ...and here...
2440 * nsterm.m (ns_frame_up_to_date): ...but not here.
2441 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2442 Adjust users.
2443 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2444 Do not check whether GC is in progress.
2445
2446 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2447
2448 * xdisp.c (window_buffer_changed): New function.
2449 (update_menu_bar, update_tool_bar): Use it to
2450 simplify large 'if' statements.
2451 (redisplay_internal): Generalize commonly used
2452 'tail' and 'frame' local variables.
2453
2454 2012-11-22 Eli Zaretskii <eliz@gnu.org>
2455
2456 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2457 with Windows system header.
2458
2459 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2462 * alloc.c: Assume unistd.h exists.
2463 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2464 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2465 (getwd) [USG]: Remove; no longer needed.
2466 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2467 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2468 * w32.h (getcwd): Remove decl.
2469
2470 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2471
2472 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2473 Make it set selected_window as well.
2474 (update_tool_bar): Use it.
2475
2476 2012-11-21 Ken Brown <kbrown@cornell.edu>
2477
2478 * emacs.c (main): Set the G_SLICE environment variable for all
2479 Cygwin builds, not just GTK builds. See
2480 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2481
2482 2012-11-21 Eli Zaretskii <eliz@gnu.org>
2483
2484 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2485 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2486 Define for the MSVC compiler.
2487
2488 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2489
2490 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2491 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2492 dostounix_filename. Prevents crashes down the road, because
2493 dostounix_filename assumes it gets a unibyte string.
2494 Reported by Michel de Ruiter <michel@sentient.nl>, see
2495 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2496
2497 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2498
2499 Conflate Qnil and Qunbound for `symbol-function'.
2500 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2501 * lread.c (init_obarray): Set `function' fields to Qnil.
2502 * eval.c (Fcommandp): Ignore Qunbound.
2503 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2504 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2505 Test NILP rather than Qunbound.
2506 (Ffmakunbound): Set to Qnil.
2507 (Fsymbol_function): Never signal an error.
2508 (Finteractive_form): Ignore Qunbound.
2509
2510 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2511
2512 * eval.c (interactive_p): Remove no-longer-used decl.
2513
2514 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2515
2516 * xdisp.c (buffer_shared): Adjust comment.
2517 (buffer_shared_and_changed): New function.
2518 (prepare_menu_bars, redisplay_internal): Use it to
2519 decide whether all windows or frames should be updated.
2520 (window_outdated): New function.
2521 (text_outside_line_unchanged_p, redisplay_window): Use it.
2522 (redisplay_internal): Likewise. Fix indentation.
2523
2524 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2525
2526 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2527 (syms_of_eval): Remove corresponding defsubr.
2528 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2529
2530 2012-11-19 Daniel Colascione <dancol@dancol.org>
2531
2532 * w32fns.c (Fx_file_dialog):
2533 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2534 cygwin_convert_file_name*.
2535
2536 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2537 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2538
2539 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2540
2541 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2542
2543 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2544
2545 * w32select.c: Include w32common.h before w32term.h, so that
2546 windows.h gets included before w32term.h uses some of its
2547 features, see below.
2548
2549 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2550 New typedefs.
2551 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2552 New prototypes.
2553 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2554
2555 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
2556
2557 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2558 (ns_select): Return at once if events are held (Bug#12834).
2559
2560 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
2561
2562 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2563 Needed following 2012-10-20 change. (Bug#12902)
2564
2565 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
2566
2567 * w32proc.c (waitpid): Remove unused label get_result.
2568
2569 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
2570
2571 * makefile.w32-in (SYSWAIT_H): New macro.
2572 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2573 ($(BLD)/sysdep.$(O)): Update dependencies.
2574
2575 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2576
2577 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2578 * callproc.c (relocate_fd): Assume F_DUPFD.
2579 * emacs.c, term.c (O_RDWR): Remove.
2580 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2581 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2582 * nsterm.m: Assume <fcntl.h> exists.
2583 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2584 (create_pty, Fmake_network_process, server_accept_connection)
2585 (wait_reading_process_output, init_process_emacs):
2586 Assume O_NONBLOCK.
2587 (wait_reading_process_output): Put in a special case for WINDOWSNT
2588 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2589 It's not clear this is needed, but it's a more-conservative change.
2590 (create_process): Assume FD_CLOEXEC.
2591 (create_process, create_pty): Assume O_NOCTTY.
2592 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2593 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2594 Omit if not DOS_NT, since F_GETFL is not defined there.
2595 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2596 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2597 (O_NOCTTY): Remove.
2598 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2599 lack it, since gnulib guarantees this.
2600 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2601
2602 2012-11-17 Eli Zaretskii <eliz@gnu.org>
2603
2604 * w32.c (faccessat): Pretend that directories have the execute bit
2605 set. Emacs expects that, e.g., in files.el:cd-absolute.
2606
2607 * w32proc.c (create_child): Don't clip the PID of the child
2608 process to fit into an Emacs integer, as this is no longer a
2609 restriction.
2610 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2611 reaping only the process specified by PID argument, if that is
2612 positive. Use PID instead of dead_child to know which process to
2613 reap. Wait for the child to die only if WNOHANG is not in
2614 OPTIONS.
2615 (sys_select): Don't set dead_child.
2616
2617 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2618 as it is no longer needed.
2619
2620 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2621 no longer needed.
2622 (record_child_status_change): Remove the setting of
2623 record_at_most_one_child for the !WNOHANG case.
2624
2625 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2626
2627 Fix problems in ns port found by static checking.
2628 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2629 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2630 not to process group.
2631 (ns_select): Use emacs_write, not write, as that's more robust
2632 in the presence of signals.
2633 (fd_handler:): Check for read errors.
2634
2635 2012-11-16 Glenn Morris <rgm@gnu.org>
2636
2637 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2638
2639 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
2640
2641 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2642
2643 2012-11-16 Eli Zaretskii <eliz@gnu.org>
2644
2645 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2646 use the same value of thread handle.
2647 (start_timer_thread): If the timer thread exited (due to error),
2648 clean up by closing the two handles it used. Duplicate the caller
2649 thread's handle here, so it gets duplicated only once, when
2650 launching the timer thread. Set priority of the timer thread, not
2651 the caller thread.
2652 (getitimer): Don't duplicate the caller thread's handle here.
2653 (Bug#12832)
2654
2655 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
2656
2657 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2658 called (Bug#12834).
2659
2660 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2661
2662 Remove no-longer-used pty_max_bytes variable.
2663 * process.c (pty_max_bytes): Remove; unused.
2664 (send_process): Do not set it.
2665
2666 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
2667
2668 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2669 Update dependencies.
2670
2671 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2674 This follows up on the 2012-09-29 patch that removed indirection
2675 for the 'function' field. Reported by Sergey Vinokurov in
2676 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2677
2678 2012-11-14 Eli Zaretskii <eliz@gnu.org>
2679
2680 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2681 different name, as the MS runtime does not have such a function,
2682 and probably never will.) All callers changed. Ignore DIRFD
2683 value if PATH is an absolute file name, to match Posix spec
2684 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2685 symlinks.
2686
2687 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2688
2689 * xdisp.c (echo_area_display, redisplay_internal):
2690 Omit redundant check whether frame_garbaged is set.
2691
2692 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2693
2694 Use faccessat, not access, when checking file permissions (Bug#12632).
2695 This fixes a bug that has been present in Emacs since its creation.
2696 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2697 which must set some sort of record. (Torek's bug report was against
2698 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2699 same common flaw.) See Torek's Usenet posting
2700 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2701 Posted: Fri Apr 8 14:18:56 1983.
2702 * Makefile.in (LIB_EACCESS): New macro.
2703 (LIBES): Use it.
2704 * callproc.c (init_callproc):
2705 * charset.c (init_charset):
2706 * fileio.c (check_existing, check_executable, check_writable)
2707 (Ffile_readable_p):
2708 * lread.c (openp, load_path_check):
2709 * process.c (allocate_pty):
2710 * xrdb.c (file_p):
2711 Use effective UID when checking permissions, not real UID.
2712 * callproc.c (init_callproc):
2713 * charset.c (init_charset):
2714 * lread.c (load_path_check, init_lread):
2715 Test whether directories are accessible, not merely whether they exist.
2716 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2717 * fileio.c (check_existing, check_executable, check_writable)
2718 (Ffile_readable_p):
2719 Use symbolic names instead of integers for the flags, as they're
2720 portable now.
2721 (check_writable): New arg AMODE. All uses changed.
2722 Set errno on failure.
2723 (Ffile_readable_p): Use faccessat, not stat + open + close.
2724 (Ffile_writable_p): No need to call check_existing + check_writable.
2725 Just call check_writable and then look at errno. This saves a syscall.
2726 dir should never be nil; replace an unnecessary runtime check
2727 with an eassert. When checking the parent directory of a nonexistent
2728 file, check that the directory is searchable as well as writable, as
2729 we can't create files in unsearchable directories.
2730 (file_directory_p): New function, which uses 'stat' on most platforms
2731 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2732 (Ffile_directory_p, Fset_file_times): Use it.
2733 (file_accessible_directory_p): New function, which uses a single
2734 syscall for efficiency.
2735 (Ffile_accessible_directory_p): Use it.
2736 * xrdb.c (file_p): Use file_directory_p.
2737 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2738 * lread.c (openp): When opening a file, use fstat rather than
2739 stat, as that avoids a permissions race. When not opening a file,
2740 use file_directory_p rather than stat.
2741 (dir_warning): First arg is now a usage string, not a format.
2742 Use errno. All uses changed.
2743 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2744 that merely introduced a race.
2745 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2746 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2747 and similarly for the other O_* flags.
2748 * w32.c (sys_faccessat): Rename from sys_access and switch to
2749 faccessat's API. All uses changed.
2750 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2751 (magic_db): Rename from magic_file_p.
2752 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2753 char *, so that we don't have to test for file existence
2754 separately from opening the file for reading. This removes a race
2755 fixes a permission-checking problem, and simplifies the code.
2756 All uses changed.
2757 (file_p): Remove; no longer needed.
2758
2759 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2760
2761 Omit glyphs initialization at startup.
2762 * dispnew.c (glyphs_initialized_initially_p): Remove.
2763 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2764 (Fredraw_frame): Move actual code from here...
2765 (redraw_frame): ...to here. Add eassert. Adjust comment.
2766 (Fredraw_display): Use redraw_frame.
2767 * xdisp.c (clear_garbaged_frames): Likewise.
2768
2769 2012-11-13 Eli Zaretskii <eliz@gnu.org>
2770
2771 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2772 passed to pint2str and pint2hrstr to be at most the size of the
2773 frame's decode_mode_spec_buffer. This avoids crashes with very
2774 large values of FIELD_WIDTH argument to decode_mode_spec.
2775 (Bug#12867)
2776
2777 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2778
2779 Fix a race with verify-visited-file-modtime (Bug#12863).
2780 Since at least 1991 Emacs has ignored an mtime difference of no
2781 more than one second, but my guess is that this was to work around
2782 file system bugs that were fixed long ago. Since the race is
2783 causing problems now, let's remove that code.
2784 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2785 whose time stamp is off by no more than a second. Insist that the
2786 file time stamps match exactly.
2787
2788 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2789
2790 * frame.h (struct frame): Convert external_tool_bar member to
2791 1-bit unsigned bitfield.
2792 * termhooks.h (struct terminal): Remove mouse_moved member since
2793 all users are long dead. Adjust comment on mouse_position_hook.
2794
2795 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2796
2797 Simplify by using FOR_EACH_FRAME here and there.
2798 * frame.c (next_frame, prev_frame, other_visible_frames)
2799 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2800 * w32term.c (x_window_to_scroll_bar): Likewise.
2801 * window.c (window_list): Likewise.
2802 * xdisp.c (x_consider_frame_title): Likewise.
2803 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2804 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2805 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2806 * xmenu.c (menubar_id_to_frame): Likewise.
2807 * xselect.c (frame_for_x_selection): Likewise.
2808 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2809 (x_window_to_menu_bar): Likewise.
2810 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2811
2812 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2813
2814 * data.c (Qdefalias_fset_function): Now static.
2815
2816 Another tweak to vectorlike_header change.
2817 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2818 Remove, and replace all uses with ...
2819 (next_in_free_list, set_next_in_free_list):
2820 New functions, which respect C's aliasing rules better.
2821
2822 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2823
2824 * window.c (list4i): Rename from 'quad'. All uses changed.
2825 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2826
2827 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
2828
2829 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2830 warning about mixing declarations and code in ISO C90.
2831
2832 2012-11-10 Martin Rudalics <rudalics@gmx.at>
2833
2834 * window.c (Fsplit_window_internal): Set combination limit of
2835 new parent window to t iff Vwindow_combination_limit is t;
2836 fixing a regression introduced with the change from 2012-09-22.
2837 (Fset_window_combination_limit): Fix doc-string.
2838
2839 2012-11-10 Eli Zaretskii <eliz@gnu.org>
2840
2841 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2842 amount when the scroll margins are too large. When scrolling
2843 backwards in the buffer, give up if cannot reach point or the
2844 scroll margin within a reasonable number of screen lines.
2845 Fixes point position in window under scroll-up/down-aggressively when
2846 point is positioned many lines beyond the window top/bottom.
2847 (Bug#12811)
2848
2849 * ralloc.c (relinquish): If real_morecore fails to return memory
2850 to the system, don't crash; instead, leave the last heap
2851 unchanged and return. (Bug#12774)
2852
2853 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2854
2855 * lisp.h (AUTOLOADP): New macro.
2856 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2857 * data.c (Ffset): Remove special ad-advice-info handling.
2858 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2859 (Fsubr_arity): CSE.
2860 (Finteractive_form): Simplify.
2861 (Fquo): Don't insist on having at least 2 arguments.
2862 (Qdefalias_fset_function): New var.
2863
2864 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2865
2866 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2867
2868 * nsfont.m (Qcondensed, Qexpanded): New variables.
2869 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2870 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2871
2872 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2873
2874 Fix recently introduced crash on MS-Windows (Bug#12839).
2875 * w32term.h (struct scroll_bar): Use convenient header.
2876 (SCROLL_BAR_VEC_SIZE): Remove.
2877 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2878
2879 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2880
2881 Tweak last vectorlike_header change.
2882 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2883 vectorlike object on the free list. This is introduced to avoid
2884 some (but not all) pointer casting and aliasing problems, see
2885 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2886 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2887 objects.
2888 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2889
2890 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2891
2892 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
2893 been removed, so remove them here also.
2894
2895 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2896
2897 * doc.c (Fdocumentation): Handle new property
2898 dynamic-docstring-function to replace the old ad-advice-info.
2899
2900 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2901
2902 * fns.c (Qeql, hashtest_eq): Now static.
2903
2904 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2905
2906 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2907 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2908 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2909 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2910
2911 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2912
2913 Use same hash function for hashfn_profiler as for hash_string etc.
2914 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2915 * lisp.h (sxhash_combine): New inline function, with the contents
2916 of the old SXHASH_COMBINE.
2917 * profiler.c (hashfn_profiler): Use it, instead of having a
2918 special hash function containing a comparison that always yields 1.
2919
2920 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2921
2922 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2923 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2924 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2925 Remove unused vars.
2926
2927 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2928
2929 * image.c (xpm_make_color_table_h): Fix compiler error because
2930 make_hash_table changed.
2931
2932 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
2933
2934 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2935
2936 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2937
2938 Use ad-hoc comparison function for the profiler's hash-tables.
2939 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2940 (make_log): Use them.
2941 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2942 call Fequal any more.
2943 (Ffunction_equal): New function.
2944 (cmpfn_profiler, hashfn_profiler): New functions.
2945 (syms_of_profiler): Initialize them.
2946 * lisp.h (struct hash_table_test): New struct.
2947 (struct Lisp_Hash_Table): Use it.
2948 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2949 * fns.c (make_hash_table): Take a struct to describe the test.
2950 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2951 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2952 (hash_lookup, hash_remove_from_table): Move assertion checking of
2953 hashfn result here. Check hash-equality before calling cmpfn.
2954 (Fmake_hash_table): Adjust call to make_hash_table.
2955 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2956 (syms_of_fns): Initialize them.
2957 * emacs.c (main): Move syms_of_fns earlier.
2958 * xterm.c (syms_of_xterm):
2959 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2960 * print.c (print_object): Adjust to new hash-table struct.
2961 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2962
2963 2012-11-08 Eli Zaretskii <eliz@gnu.org>
2964
2965 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2966 value of w32-scroll-lock-modifier is neither nil nor one of the
2967 known key modifiers. (Bug#12806)
2968
2969 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2970
2971 Shrink struct vectorlike_header to the only size field.
2972 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2973 Adjust comment.
2974 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2975 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2976 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2977 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2978 information from the vector header. Adjust comment.
2979 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2980 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2981 layout.
2982 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
2983 (struct vectorlike_header): Remove next member. Adjust comment.
2984 (struct Lisp_Subr): Add convenient header. Adjust comment.
2985 (allocate_pseudovector): Adjust prototype.
2986 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
2987 (sweep_string, lisp_malloc): Remove useless prototypes.
2988 (enum mem_type): Adjust comment.
2989 (NEXT_IN_FREE_LIST): New macro.
2990 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
2991 (Fmake_bool_vector): Likewise.
2992 (struct large_vector): New type to represent allocation unit for
2993 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
2994 (large_vectors): Change type to struct large_vector.
2995 (allocate_vector_from_block): Simplify.
2996 (PSEUDOVECTOR_NBYTES): Replace with...
2997 (vector_nbytes): ...new function. Adjust users.
2998 (sweep_vectors): Adjust processing of large vectors.
2999 (allocate_vectorlike): Likewise.
3000 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3001 Add easserts. Adjust XSETPVECTYPESIZE usage.
3002 (allocate_buffer): Use BUFFER_PVEC_INIT.
3003 (live_vector_p): Adjust to match large vector.
3004 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3005 * buffer.h (struct buffer): Add next member.
3006 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3007 New macros.
3008 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3009 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3010 (copy_hash_table): Adjust to match vector header change.
3011 * lread.c (defsubr): Use XSETPVECTYPE.
3012 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3013 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3014 (xvecsize): New command.
3015
3016 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3017
3018 * keyboard.c (event_to_kboard): Do not dereference
3019 frame_or_window field of SELECTION_REQUEST_EVENT
3020 and SELECTION_CLEAR_EVENT events (Bug#12814).
3021 * xterm.h (struct selection_input_event): Adjust comment.
3022
3023 2012-11-07 Eli Zaretskii <eliz@gnu.org>
3024
3025 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3026 such as Scroll Lock, if the respective keys are treated as
3027 function keys, not as modifiers. This avoids destroying non-ASCII
3028 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
3029
3030 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3031
3032 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3033
3034 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3035
3036 Restore some duplicate definitions (Bug#12814).
3037 This undoes part of the 2012-11-03 changes. Some people build
3038 with plain -g rather than with -g3, and they need the duplicate
3039 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3040 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3041 Define as macros, as well as as enums or as constants.
3042
3043 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3044
3045 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3046 to keypad keys (Bug#12816).
3047
3048 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3049
3050 Minor adjustments of recently-changed frame functions.
3051 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3052 known to be a frame (we're in the FRAMEP branch).
3053 * lisp.h (Qframep): Remove decl. frame.h declares this.
3054 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3055 since they're meant for Lisp fixnum values.
3056
3057 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3058
3059 * window.c (Fwindow_combination_limit): Revert to the only
3060 required argument and adjust docstring as suggested in
3061 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3062 by Martin Rudalics <rudalics@gmx.at>.
3063
3064 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3065
3066 Widely used frame validity and checking functions.
3067 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3068 * frame.c (decode_live_frame, decode_any_frame): New functions.
3069 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3070 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3071 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3072 (Fframe_pointer_visible_p): Use decode_any_frame.
3073 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3074 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3075 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3076 (Fframe_focus): Likewise. Allow zero number of arguments.
3077 Adjust docstring.
3078 (frame_buffer_list, frame_buffer_predicate): Remove.
3079 * lisp.h (frame_buffer_predicate): Remove prototype.
3080 * buffer.c (Fother_buffer): Use decode_any_frame.
3081 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3082 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3083 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3084 (Fclose_font, Ffont_info): Use decode_live_frame.
3085 * fontset.c (check_fontset_name): Likewise.
3086 * terminal.c (Fframe_terminal): Likewise.
3087 * w32fns.c (check_x_frame): Likewise.
3088 * window.c (Fminibuffer_window, Fwindow_at)
3089 (Fcurrent_window_configuration): Likewise.
3090 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3091 Likewise. Allow zero number of arguments. Adjust docstring.
3092 * dispnew.c (Fredraw_frame): Likewise.
3093 * xfaces.c (frame_or_selected_frame): Remove.
3094 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3095 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3096 (Fframe_face_alist): Use decode_live_frame.
3097 * xfns.c (check_x_frame): Likewise.
3098
3099 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3100
3101 * window.c (quad): New function.
3102 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3103 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3104 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3105 (Fwindow_line_height): Use it.
3106 (Fwindow_fringes): Use list3.
3107 (Fwindow_scroll_bars): Use list4.
3108 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3109 (Fwindow_combination_limit): Allow zero number of arguments.
3110
3111 2012-11-05 Eli Zaretskii <eliz@gnu.org>
3112
3113 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3114
3115 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3116 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3117 file descriptor 2 for standard error. (Bug#12805)
3118
3119 2012-11-05 Chong Yidong <cyd@gnu.org>
3120
3121 * process.c (wait_reading_process_output): Revert previous change.
3122
3123 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3124
3125 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3126 This removes code that has been obsolete since around 1990.
3127 * callproc.c (Fcall_process):
3128 * emacs.c (main):
3129 * process.c (create_process):
3130 * term.c (dissociate_if_controlling_tty):
3131 Assume setsid exists.
3132 * callproc.c (child_setup): Assume setpgid exists and behaves as
3133 per POSIX.1-1988 or later.
3134 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3135 * emacs.c (shut_down_emacs):
3136 * sysdep.c (sys_suspend, init_foreground_group):
3137 Assume getpgrp behaves as per POSIX.1-1998 or later.
3138 * msdos.c (setpgrp): Remove.
3139 (tcgetpgrp, setpgid, setsid): New functions.
3140 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3141 * term.c (no_controlling_tty): Remove; unused.
3142 * w32proc.c (setpgrp): Remove.
3143 (setsid, tcgetpgrp): New functions.
3144
3145 Simplify by assuming __fpending.
3146 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3147 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3148 Do not assume that __fpending's result fits in int.
3149
3150 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3151
3152 Remove EMACS_OUTQSIZE+sleep hack.
3153 * dispnew.c (update_frame_1): Remove hack for terminals slower
3154 than 2400 bps, which throttled Emacs by having it sleep.
3155 This code hasn't worked since at least 2007, when the multi-tty stuff
3156 was added, and anyway those old terminals are long dead.
3157 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3158 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3159
3160 Fix data-loss with --version (Bug#9574).
3161 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3162 as we can't assume that emacs_strerror is initialized, and strerror
3163 is good enough here.
3164 (main): Invoke atexit earlier, to catch earlier instances of
3165 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3166
3167 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3168
3169 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3170 (keyDown): Remap keypad keys to X11 virtual key codes.
3171
3172 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3173
3174 Fix data-loss with --batch (Bug#9574).
3175 * emacs.c: Include <close-stream.h>.
3176 (close_output_streams): New function.
3177 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3178 and handles errors appropriately.
3179 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3180 does that now.
3181
3182 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3183 The symptom is a diagnostic "GLib-WARNING **: In call to
3184 g_spawn_sync(), exit status of a child process was requested but
3185 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3186 waitpid(), so exit status can't be returned." The diagnostic
3187 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3188 The real bug is a race condition between Emacs and glib: Emacs
3189 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3190 so that glib can't find it. Work around the bug by invoking
3191 waitpid only on subprocesses that Emacs itself creates.
3192 * process.c (create_process, record_child_status_change):
3193 Don't use special value -1 in pid field, as the caller now must
3194 know the pid rather than having the callee infer it.
3195 The inference was sometimes incorrect anyway, due to another race.
3196 (create_process): Set new 'alive' member if child is created.
3197 (process_status_retrieved): New function.
3198 (record_child_status_change): Use it.
3199 Accept negative 1st argument, which means to wait for the
3200 processes that Emacs already knows about. Move special-case code
3201 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3202 processes that have already been waited for, by testing and
3203 clearing new 'alive' member.
3204 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3205 now does this internally.
3206 (handle_child_signal): Let record_child_status_change do all
3207 the work, since we do not want to reap all exited child processes,
3208 only the child processes that Emacs itself created.
3209 * process.h (Lisp_Process): New boolean member 'alive'.
3210
3211 Omit duplicate definitions no longer needed with gcc -g3.
3212 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3213 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3214 Define only as macros. There's no longer any need to also define
3215 these symbols as enums or as constants, since we now assume
3216 gcc -g3 when debugging.
3217
3218 2012-11-03 Eli Zaretskii <eliz@gnu.org>
3219
3220 * lisp.mk: Adjust comments to the fact that term/internal is now
3221 loaded from loadup.el.
3222
3223 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3224 (msdos_fatal_signal): New function.
3225 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3226 its argument list.
3227
3228 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3229 for GCC versions before 4.
3230 (emacs_raise): Define to call msdos_fatal_signal.
3231
3232 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3233 iterator when starting in the middle of a display or overlay
3234 string. (Bug#12745)
3235
3236 2012-11-03 Chong Yidong <cyd@gnu.org>
3237
3238 * process.c (wait_reading_process_output): Clean up the last
3239 change.
3240
3241 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3242
3243 * process.c (wait_reading_process_output): Avoid a race condition
3244 with SIGIO delivery (Bug#11536).
3245
3246 2012-11-03 Chong Yidong <cyd@gnu.org>
3247
3248 * buffer.c (cursor_type): Untabify docstring.
3249
3250 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3251
3252 * frame.h (struct frame): Drop can_have_scroll_bars member
3253 which is meaningless for a long time. Adjust comments.
3254 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3255 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3256
3257 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3258
3259 * window.c (decode_next_window_args): Update window arg after
3260 calling decode_live_window and so fix crash reported at
3261 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3262 by Juanma Barranquero <lekktu@gmail.com>.
3263 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3264 * font.c (Ffont_at): Likewise.
3265
3266 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3267
3268 * widget.c (resize_cb): New function.
3269 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3270 (EmacsFrameResize): Check if all is up to date before changing frame
3271 size.
3272
3273 2012-11-02 Eli Zaretskii <eliz@gnu.org>
3274
3275 Implement backtrace output for fatal errors on MS-Windows.
3276 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3277 (BACKTRACE_LIMIT_MAX): New macro.
3278 (w32_backtrace): New function.
3279 (emacs_abort): Use w32_backtrace when the user chooses not to
3280 attach a debugger. Update the text of the abort dialog.
3281
3282 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3283
3284 Window-related stuff cleanup here and there.
3285 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3286 Use decode_any_window.
3287 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3288 * xdisp.c (Fformat_mode_line): Likewise.
3289 * font.c (Ffont_at): Use decode_live_window.
3290 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3291 * window.c (decode_next_window_args): Likewise.
3292 (decode_any_window): Remove static.
3293 * window.h (decode_any_window): Add prototype.
3294 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3295 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3296 respectively.
3297
3298 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3299
3300 Remove pad from struct input_event.
3301 * termhooks.h (struct input_event): Remove padding field.
3302 Adjust comment.
3303 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3304 member is never cons for a long time. Adjust comment.
3305 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3306 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3307 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3308 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3309
3310 2012-11-01 Eli Zaretskii <eliz@gnu.org>
3311
3312 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3313
3314 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3315
3316 Fix crash when using Emacs as commit editor for git (Bug#12697).
3317 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3318 and it is configured in conf_post.h.
3319 (Fcall_process): Don't invoke both setsid and setpgid; the former
3320 is enough, if it exists.
3321 * callproc.c (Fcall_process, child_setup):
3322 * process.c (create_process): Use setpgid.
3323 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3324 for the real thing.
3325 * dispnew.c (init_display): Initialize the foreground group
3326 if we are running a tty display.
3327 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3328 * lisp.h (init_foreground_group): New decl.
3329 * sysdep.c (inherited_pgroup): New static var.
3330 (init_foreground_group, tcsetpgrp_without_stopping)
3331 (narrow_foreground_group, widen_foreground_group): New functions.
3332 (init_sys_modes): Narrow foreground group.
3333 (reset_sys_modes): Widen foreground group.
3334
3335 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
3336
3337 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3338
3339 2012-10-31 Martin Rudalics <rudalics@gmx.at>
3340
3341 * minibuf.c (read_minibuf): Restore current buffer since
3342 choose_minibuf_frame calling Fset_frame_selected_window may
3343 change it (Bug#12766).
3344
3345 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3346
3347 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3348
3349 2012-10-30 Kenichi Handa <handa@gnu.org>
3350
3351 * font.c (Ffont_at): If WINDOW is specified and it is not
3352 displaying the current buffer, signal an error.
3353
3354 2012-10-29 Daniel Colascione <dancol@dancol.org>
3355
3356 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3357 In preparation for fixing bug#12739, move these functions from
3358 here...
3359
3360 * coding.h, coding.c: ... to here, and compile them only when
3361 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3362 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
3363
3364 2012-10-28 Eli Zaretskii <eliz@gnu.org>
3365
3366 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3367 (timer_loop, getitimer, setitimer): Use it instead of
3368 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3369 'clock'.
3370 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3371 literal 10000.
3372
3373 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3374
3375 * nsterm.m (NO_APPDEFINED_DATA): New define.
3376 (last_appdefined_event_data): New variable
3377 (last_appdefined_event): Remove.
3378 (ns_select): Initialize t from last_appdefined_event_data instead
3379 of [last_appdefined_event data1].
3380 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3381 remove last_appdefined_event (Bug#12698).
3382
3383 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3384
3385 * frame.c (x_set_font): Catch internal error.
3386
3387 2012-10-27 Eli Zaretskii <eliz@gnu.org>
3388
3389 Avoid overflow in w32 implementation of interval timers.
3390 When possible, for ITIMER_PROF count only times the main thread
3391 actually executes.
3392 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
3393 'volatile ULONGLONG' types. All the other data which was
3394 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
3395 (GetThreadTimes_Proc): New typedef.
3396 (w32_get_timer_time): New function, returns a suitable time value
3397 for the timer.
3398 (timer_loop): Enter critical section when accessing ULONGLONG
3399 values of the itimer_data struct, as these accesses are no longer
3400 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3401 Remove unused variable.
3402 (init_timers): Initialize s_pfn_Get_Thread_Times.
3403 (start_timer_thread): Don't assign itimer->caller_thread here.
3404 (getitimer): Assign itimer->caller_thread here.
3405 (setitimer): Always call getitimer to get the value of ticks_now.
3406 (sys_spawnve): Avoid compiler warning about format mismatch.
3407
3408 2012-10-26 Eli Zaretskii <eliz@gnu.org>
3409
3410 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3411 mouse movement events if the menu bar is active. This avoids
3412 producing a busy "hour-glass" cursor by Windows if the mouse
3413 pointer is positioned over a tooltip shown for some menu item.
3414
3415 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3416
3417 Don't assume process IDs fit in int.
3418 * emacs.c (shut_down_emacs) [!DOS_NT]:
3419 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3420 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3421 Use pid_t, not int, to store process IDs, as 'int'
3422 is not wide enough on a few platforms (e.g., AIX and IRIX).
3423
3424 2012-10-23 Kenichi Handa <handa@gnu.org>
3425
3426 The following change is to make face-font-rescale-alist work
3427 correctly for non-ASCII fonts.
3428
3429 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3430 (font_open_for_lface): Handle Vface_font_rescale_alist.
3431
3432 2012-10-23 Chong Yidong <cyd@gnu.org>
3433
3434 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3435
3436 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3437
3438 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3439 for screen font.
3440 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3441
3442 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3443 event (Bug#12681).
3444
3445 2012-10-21 Glenn Morris <rgm@gnu.org>
3446
3447 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3448
3449 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3450
3451 Port to OpenBSD 5.1.
3452 * frame.c (Fmouse_position, Fmouse_pixel_position):
3453 * xdisp.c (produce_stretch_glyph):
3454 Declare local vars only when they're needed.
3455 This is clearer and avoids a warning on OpenBSD about unused vars.
3456 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3457 This is safer, and avoids OpenBSD warnings about unused vars.
3458 * keyboard.c (record_menu_key): Remove unnecessary decl.
3459 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3460 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3461 as our definition clashes with OpenBSD's.
3462 * xfaces.c (load_face_colors, check_lface_attrs)
3463 (get_lface_attributes_no_remap, get_lface_attributes)
3464 (lface_fully_specified_p, x_supports_face_attributes_p)
3465 (tty_supports_face_attributes_p, face_fontset, realize_face)
3466 (realize_x_face, realize_tty_face):
3467 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3468 merely Lisp_Object *. This is more informative and avoids
3469 a warning on OpenBSD about accessing beyond an object's size.
3470
3471 2012-10-20 Chong Yidong <cyd@gnu.org>
3472
3473 * lread.c (Fload): Doc fix (Bug#12592).
3474
3475 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3476
3477 * font.c (Ffont_at): Fix previous change.
3478
3479 2012-10-19 Eli Zaretskii <eliz@gnu.org>
3480
3481 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3482 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3483 for the reasons.
3484
3485 * alloc.c (NSTATICS): Decrease to 0x800.
3486
3487 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3488
3489 * fns.c (Fnreverse): Include the problem element when signaling an
3490 error (bug#12677).
3491
3492 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3493
3494 * nsterm.m (ns_select): Check writefds before call to
3495 FD_ISSET (Bug#12668).
3496
3497 2012-10-18 Daniel Colascione <dancol@dancol.org>
3498
3499 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3500 (staticpro): If we run out of staticpro slots, die with an
3501 informative error instead of just calling emacs_abort.
3502
3503 2012-10-18 Martin Rudalics <rudalics@gmx.at>
3504
3505 Fix two flaws reported by Dmitry Antipov.
3506 * window.c (Ftemp_output_buffer_show): Remove.
3507 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3508 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3509
3510 2012-10-17 Eli Zaretskii <eliz@gnu.org>
3511
3512 * makefile.w32-in ($(BLD)/w32.$(O)):
3513 ($(BLD)/vm-limit.$(O)):
3514 ($(BLD)/term.$(O)):
3515 ($(BLD)/unexw32.$(O)):
3516 ($(BLD)/fileio.$(O)):
3517 ($(BLD)/dispnew.$(O)): Update dependencies.
3518
3519 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3520 Add prototypes.
3521
3522 * w32proc.c: Include ctype.h.
3523
3524 * w32.h (init_environment, check_windows_init_file)
3525 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3526 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3527 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3528 (sys_link): Add prototypes.
3529
3530 * w32.c: Include w32select.h.
3531 (sys_access, e_malloc, sys_select): Add prototypes.
3532 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3533
3534 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3535
3536 * unexw32.c: Include lisp.h and w32.h.
3537
3538 * term.c [WINDOWSNT]: Include w32term.h.
3539
3540 * process.c [WINDOWSNT]: Add prototype of sys_select.
3541
3542 * fileio.c [WINDOWSNT]: Include w32.h.
3543
3544 * dispnew.c [WINDOWSNT]: Include w32.h.
3545
3546 * cygw32.c (Fcygwin_convert_path_to_windows)
3547 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3548 Lisp_Object values. (Bug#12661)
3549
3550 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3551 to Lisp_Object. (Bug#12661)
3552
3553 2012-10-17 Kenichi Handa <handa@gnu.org>
3554
3555 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3556 invalidate.
3557
3558 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3559
3560 * buffer.c (Fkill_buffer): When unchaining the marker,
3561 reset its buffer pointer to NULL (Bug#12652).
3562
3563 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3564
3565 Do not verify indirection counters of killed buffers (Bug#12579).
3566 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3567 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3568
3569 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3570
3571 * alloc.c (Fmake_byte_code): Fix typo in comment.
3572 * print.c (print_interval): Define as static to match prototype.
3573 * indent.c (disptab_matches_widthtab, recompute_width_table):
3574 Convert to eassert.
3575
3576 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3577
3578 * editfns.c (get_system_name): Remove.
3579 * lisp.h (get_system_name): Remove prototype.
3580 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3581 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3582
3583 2012-10-15 Daniel Colascione <dancol@dancol.org>
3584
3585 * dbusbind.c: Add comment explaining reason for previous change.
3586
3587 2012-10-15 Martin Rudalics <rudalics@gmx.at>
3588
3589 * window.c (Fwindow_end): Rewrite check whether cached position
3590 can be used (Bug#12600).
3591 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3592 Set windows_or_buffers_changed.
3593
3594 2012-10-15 Daniel Colascione <dancol@dancol.org>
3595
3596 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3597 enabled by undefining the symbol "interface", which the platform
3598 headers define to something incompatible.
3599
3600 2012-10-14 Daniel Colascione <dancol@dancol.org>
3601
3602 * image.c (init_tiff_functions, init_imagemagick_functions)
3603 (init_svg_functions): Fix cygw32 build break by using these
3604 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3605
3606 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3607
3608 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3609
3610 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3611
3612 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3613
3614 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3615
3616 * coding.c (detect_coding): Set coding->id before calling
3617 this->detector.
3618
3619 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3620
3621 * fileio.c: Formatting fixes.
3622
3623 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3624
3625 Fix some stat-related races.
3626 * fileio.c (Fwrite_region): Avoid race condition if a file is
3627 removed or renamed by some other process immediately after Emacs
3628 writes it but before Emacs stats it. Do not assume that stat (or
3629 fstat) succeeds.
3630 * image.c (slurp_file): Resolve the file name with fopen + fstat
3631 rather than stat + fopen.
3632 (pbm_read_file) [0]: Remove unused code with stat race.
3633 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3634 Remove ineffective code with stat race.
3635
3636 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3637
3638 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3639
3640 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3641
3642 * nsterm.m (hold_event_q): New static variable.
3643 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3644 ! q_event_ptr.
3645 (hold_event): New function.
3646 (ns_read_socket): If hold_event_q have events, store them and
3647 return (Bug#12384).
3648 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3649 is zero (Bug#12384).
3650
3651 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
3652
3653 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3654
3655 2012-10-12 Eli Zaretskii <eliz@gnu.org>
3656
3657 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3658
3659 * fileio.c (check_existing): New function.
3660 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3661 instead of calling 'stat', when what's needed is to check whether
3662 a file exists. This avoids expensive system calls on MS-Windows.
3663 (Bug#12587)
3664
3665 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
3666
3667 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3668 determine whether a file exists and is not a directory.
3669
3670 * lisp.h (check_existing): Add prototype.
3671
3672 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3673
3674 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3675
3676 2012-10-12 Glenn Morris <rgm@gnu.org>
3677
3678 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3679
3680 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3681
3682 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3683
3684 * eval.c (Fautoload): Remember previous autoload status in load-history.
3685
3686 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3689 * lread.c (load_each_byte, new_backquote_flag, readchar)
3690 (read_filtered_event, lisp_file_lexically_bound_p)
3691 (safe_to_load_version, Fload, complete_filename_p, openp)
3692 (build_load_history, readevalloop, read_escape, read1)
3693 (string_to_number, read_vector, read_list):
3694 * macros.c (Fstart_kbd_macro):
3695 * marker.c (CONSIDER):
3696 * menu.c (parse_single_submenu, digest_single_submenu)
3697 (find_and_return_menu_selection, Fx_popup_menu):
3698 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3699 (Ftry_completion):
3700 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3701 (ns_menu_show):
3702 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3703 (xmenu_show, xdialog_show):
3704 Use bool for booleans.
3705 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3706 as it's not a predicate. All uses changed. Omit unnecessary
3707 buffer termination.
3708
3709 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3710
3711 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3712 (save_excursion_restore): Do not restore mark if it was not saved.
3713
3714 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3715
3716 * marker.c (cached_modiff): EMACS_INT, not int.
3717
3718 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3719 instead of having a wrong decl.
3720 * nsmenu.m (waiting_for_input): Remove wrong decl.
3721
3722 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3723
3724 keyboard.c, keymap.c: Use bool for booleans.
3725 * dispnew.c (sit_for): Distinguish between 3-way display_option
3726 and boolean do_display.
3727 * keyboard.c (single_kboard, this_command_key_count_reset)
3728 (waiting_for_input, echoing, immediate_quit, input_pending)
3729 (interrupt_input, interrupts_deferred, pop_kboard)
3730 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3731 (command_loop_1, adjust_point_for_property)
3732 (safe_run_hooks_error, input_polling_used, read_char):
3733 (help_char_p, readable_events, kbd_buffer_events_waiting)
3734 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3735 (lucid_event_type_list_p, get_input_pending):
3736 (gobble_input, menu_separator_name_p, menu_bar_item)
3737 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3738 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3739 (keyremap_step, test_undefined, read_key_sequence)
3740 (detect_input_pending, detect_input_pending_ignore_squeezables)
3741 (detect_input_pending_run_timers, requeued_events_pending_p)
3742 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3743 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3744 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3745 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3746 (accessible_keymaps_1, Fkey_description, push_key_description):
3747 (shadow_lookup, struct where_is_internal_data)
3748 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3749 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3750 (describe_map, describe_vector):
3751 * menu.c (single_menu_item):
3752 * nsmenu.m (ns_update_menubar):
3753 * process.c (wait_reading_process_output):
3754 * search.c (scan_buffer, scan_newline):
3755 Use bool for boolean.
3756 * keyboard.c (timers_run, swallow_events)
3757 (detect_input_pending_run_timers):
3758 * process.c (wait_reading_process_output):
3759 Use unsigned for counter where wraparound-on-overflow is desired,
3760 since unsigned is guaranteed to have that behavior and signed is not.
3761 (read_char): Use ptrdiff_t for string length.
3762 (get_input_pending): Remove first argument, since it was always
3763 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3764 and behave as if it had that value. Return new value of
3765 input_pending. All callers changed.
3766 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3767 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3768 a string length.
3769 * keymap.c (push_key_description): Omit last arg, which was always 1.
3770 All callers changed.
3771
3772 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3773
3774 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
3775
3776 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3777 ($(BLD)/term.$(O)): Update dependencies.
3778
3779 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3780
3781 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3782 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3783 initializer for PVEC_NORMAL_VECTOR.
3784
3785 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3786
3787 Clean out old termopts cruft.
3788 * termopts.h (flow_control, meta_key): Remove unused decls.
3789 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3790 Don't include termopts.h.
3791
3792 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3793
3794 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3795
3796 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3797
3798 * commands.h (immediate_quit): Remove duplicate decl.
3799
3800 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3801
3802 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3803 caching.
3804 (nsfont_open): Remove setting of Vfonts_in_cache.
3805 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
3806
3807 2012-10-09 Eli Zaretskii <eliz@gnu.org>
3808
3809 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3810 match what GetLastError returns. Explain why the function is
3811 needed.
3812
3813 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3814 'is_tooltip_frame', to avoid confusion with its global namesake.
3815
3816 2012-10-08 Daniel Colascione <dancol@dancol.org>
3817
3818 * xdisp.c (start_hourglass): Call w32_note_current_window when
3819 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3820 build that caused Emacs to display the hourglass cursor forever.
3821
3822 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3823 which is broken under remote desktop, calculate the number of
3824 colors available for a display based on the display's number of
3825 planes and number of bits per pixel per plane. (bug#10397).
3826
3827 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
3828
3829 * nsfont.m (Vfonts_in_cache): New variable.
3830 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3831 are used. Add cached fonts to Vfonts_in_cache.
3832 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3833
3834 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
3835
3836 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3837 in nt/config.nt.
3838 (FONT_H): Define after FRAME_H.
3839 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3840 Update dependencies.
3841
3842 * w32term.c: Remove leftover declaration of keyboard_codepage.
3843
3844 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3845
3846 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3847 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3848 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3849 (GLOBAL_SOURCES): Add cygw32.c.
3850 ($(BLD)/unexw32.$(O)):
3851 ($(BLD)/w32.$(O)):
3852 ($(BLD)/w32console.$(O)):
3853 ($(BLD)/w32fns.$(O)):
3854 ($(BLD)/w32heap.$(O)):
3855 ($(BLD)/w32menu.$(O)):
3856 ($(BLD)/w32proc.$(O)): Add w32common.h.
3857
3858 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3859 'const char *'.
3860 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3861
3862 2012-10-08 Daniel Colascione <dancol@dancol.org>
3863
3864 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3865 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3866 accidental message numbering hole. Change other messages to
3867 match.
3868
3869 * w32select.h (HAVE_W32SELECT): Remove.
3870
3871 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
3872 w32common.h instead of w32heap.h.
3873
3874 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3875 (get_allocation_unit, get_processor_type, get_w32_major_version)
3876 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3877 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3878 (OS_NT, os_subtype, cache_system_info): Move declarations to
3879 w32common.
3880
3881 * w32heap.c: Include w32common.h.
3882 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
3883 (w32_minor_version, w32_build_number, w32_subtype):
3884 Remove duplicate definitions.
3885
3886 * w32fns.c: Include w32common.h; include w32heap.h only in
3887 WINDOWSNT.
3888
3889 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3890 Use `report_file_error' instead of `error' in order to better
3891 inform users of what went wrong. Increase NTGUI_UNICODE file
3892 dialog box file name length to 32k, the maximum allowed by the NT
3893 kernel.
3894
3895 * w32common.h: New file.
3896 (ROUND_UP, ROUND_DOWN, get_page_size)
3897 (get_allocation_unit, get_processor_type, get_w32_major_version)
3898 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3899 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3900 (OS_NT, os_subtype, cache_system_info): Move here.
3901
3902 * unexw32.c, unexcw.c: Include w32common.h.
3903
3904 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3905 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3906 to call syms_of_w32select.
3907
3908 * cygw32.h: Remove obsolete EXFUN declarations.
3909
3910 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3911
3912 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3913 of w32inevt.o from SOME_MACHINE_OBJECTS.
3914
3915 2012-10-08 Daniel Colascione <dancol@dancol.org>
3916
3917 * image.c: Permanent fix for JPEG compilation issue --- limit
3918 jpeglib `boolean' redefinition to Cygwin builds.
3919
3920 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3921
3922 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3923
3924 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3925 Cygwin.
3926
3927 2012-10-08 Daniel Colascione <dancol@dancol.org>
3928
3929 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3930 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3931 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3932 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3933 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3934 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3935 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3936 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3937 now a supported configuration.
3938
3939 * Makefile.in: consolidate image variables into LIBIMAGE; add
3940 W32_OBJ and W32_LIBS. Compile new files.
3941
3942 * conf_post.h:
3943 (_DebPrint) declare tracing facility for W32 debugging. We need
3944 to unify tracing later.
3945
3946 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3947 unconditional use of W32 Unicode functions. Cygwin runs only on
3948 100% Unicode operating systems.
3949
3950 * cygw32.c: New file. Define Cygwin-specific facilities.
3951 (Fcygwin_convert_path_to_windows)
3952 (Fcygwin_convert_path_from_windows): New user functions for
3953 accessing Cygwin path-munging routines.
3954
3955 * cygw32.h: New file.
3956 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3957 UTF-16LE strings temporarily inside non-Lisp-visible string
3958 objects.
3959
3960 (w32_strerror): Just what it says on the tin.
3961
3962 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3963 also run for Cygwin; both systems have the same problem with using
3964 GUI facilities in a forked child. Also call syms_of_cygw32,
3965 syms_of_w32select in correct places.
3966
3967 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3968 needs fork-then-exec for daemon launching.
3969
3970 * font.h: Include frame.h.
3971
3972 * image.c: Use the image library cache machinery only when we're
3973 compiling for native WINDOWSNT; Cygwin can use shared libraries
3974 like any other Unixlike system.
3975
3976 * keyboard.c: Clarify a comment regarding the input loop.
3977
3978 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3979 functions directly instead of trying to detect at runtime that our
3980 host operating system supports them. We make this change for two
3981 reasons: Cygwin lacks support for the multibyte character
3982 conversion functions used by the legacy menu code, and Cygwin
3983 never needs to rely on non-Unicode APIs.
3984
3985 * unexw32.c (hinst): Declare extern.
3986
3987 * w32.c: Change header order;
3988 (w32_strerror): Move to w32fns.c because we need it for
3989 non-WINDOWSNT builds.
3990
3991 * w32.h: Add #error macro to make sure we don't include w32.h for
3992 Cygwin builds. Remove w32select declarations.
3993
3994 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
3995 w32fns.c. w32console.c is WINDOWSNT-only.
3996
3997 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
3998 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
3999 POSIXy alternative.
4000 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4001 (w32_major_version, w32_minor_version, w32_build_number)
4002 (os_subtype, sound_type): Define here
4003 (w32_defined_color): Make color parameter const for consistency
4004 with other _defined_color functions.
4005 (w32_createwindow): Unconditionally call w32_init_class instead of
4006 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4007 through the code is complex and unnecessary because class
4008 registration is practically free.
4009 (w32_name_of_message): New EMACSDEBUG-only function.
4010 (Fset_message_beep): Move here
4011 (Fx_open_connection): Require that the display name for Windows be
4012 "w32" for consistency, emacsclient disambiguation, and maybe, one
4013 day, multi-window-system support.
4014 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4015 Cygwin files for W32 GUI facilities, since these clearly don't
4016 expect Cygwin names.
4017 (_DebPrint): Define.
4018 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4019 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4020 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4021 (w32_last_error): Remove.
4022
4023 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4024
4025 * w32heap.c (syspage_mask): Declare here.
4026 (cache_system_info): Remove.
4027
4028 * w32inevt.c (faked_key): Define globally, not statically.
4029 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4030 (w32_console_toggle_lock_key): Move to w32fns.c.
4031
4032 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4033
4034 * w32proc.c (_DebPrint): Move to w32fns.c.
4035 * w32select.c: Include string.h, stdio.h for Cygwin.
4036 * w32select.h: New File.
4037
4038 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4039 get_osfhandle.
4040 (w32_message_fd): New variable. Under Cygwin, holds the file
4041 descriptor the system used to tell us about pending thread
4042 messages.
4043
4044 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4045 that prevented compilation under non-WINDOWSNT systems.
4046
4047 (w32_initialize): Open /dev/windows and assign it to
4048 w32_message_fd. Provide w32 feature.
4049
4050 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4051 (WM_EMACS_INPUT_READY): add.
4052 (prepend_msg, w32_message_fd): Declare globally.
4053
4054 * w32xfns.c:
4055 (keyboard_handle): Use only when WINDOWSNT.
4056 (notify_msg_ready): New function. Posts a message to the main
4057 thread's message queue under CYGWIN, which wakes up the main
4058 thread from select(2) by making the /dev/windows file descriptor
4059 ready. Under WINDOWSNT, it sets an event the same way the old
4060 code did.
4061
4062 (post, prepend_msg): Actually call notify_msg_ready instead of
4063 setting the input event directly.
4064
4065 2012-10-07 Eli Zaretskii <eliz@gnu.org>
4066
4067 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4068 but it still has blocs in it, don't return it to the system,
4069 instead of aborting. (Bug#12402)
4070
4071 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4072
4073 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4074
4075 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4076 MAC_OS_X_VERSION_10_6.
4077 (syms_of_nsterm): Remove comment about Panther and above for
4078 ns-antialias-text.
4079 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4080 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4081 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4082
4083 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4084 MAC_OS_X_VERSION_10_4.
4085
4086 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4087 MAC_OS_X_VERSION_10_2.
4088
4089 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4090
4091 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4092 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4093
4094 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4095 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4096 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4097 Remove ns_in_resize check.
4098 (ns_clear_frame_area): Remove resize handle code.
4099
4100 * nsfns.m (ns_in_resize): Remove.
4101 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4102 Remove ns_in_resize check.
4103
4104 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4105
4106 Improve sys_siglist detection.
4107 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4108 defined as a macro, as is done in Solaris.
4109 (sys_siglist_entries): New macro.
4110 (save_strsignal): Use it.
4111 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4112 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4113
4114 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4115
4116 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4117 fullscreen/Fullscreen.
4118
4119 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4120 tobar_height is new.
4121
4122 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4123 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4124 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4125 (windowDidResize:): Check for correct window if old style fullscreen.
4126 Capitalize word in comment. Remove incorrect comment.
4127 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4128 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4129 error in drawing background.
4130 (toggleFullScreen:): Remove comment. Rearrange calls.
4131 Set toolbar values to zero, save old height in tobar_height.
4132 Restore tool bar height when leaving fullscreen.
4133 (canBecomeMainWindow): New function.
4134
4135 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4136
4137 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4138
4139 2012-10-05 Eli Zaretskii <eliz@gnu.org>
4140
4141 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4142
4143 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4144 that time stamps of directories could also be changed.
4145 Don't request the too broad GENERIC_WRITE, only the more restrictive
4146 FILE_WRITE_ATTRIBUTES access rights.
4147
4148 * fileio.c (Fset_file_times): Special-case ignoring errors for
4149 directories only on MSDOS, not on MS-Windows.
4150
4151 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
4152
4153 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4154
4155 2012-10-04 Eli Zaretskii <eliz@gnu.org>
4156
4157 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4158 see whether CreateFile failed.
4159
4160 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4163 to avoid similar races.
4164 * keyboard.c (pending_signals): Now bool, not int.
4165
4166 Port timers to OpenBSD, plus check for timer failures.
4167 OpenBSD problem reported by Han Boetes.
4168 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4169 and/or setitimer.
4170 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4171 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4172 like OpenBSD, which has timer_settime but does not declare it.
4173 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4174 whether to use itimerspec-related primitives. All uses of
4175 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4176
4177 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4178
4179 * profiler.c (handle_profiler_signal): Fix a malloc race
4180 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4181
4182 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4183
4184 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4185
4186 2012-10-02 Eli Zaretskii <eliz@gnu.org>
4187
4188 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4189 consistent with the change in return value of 'safe_strsignal'.
4190
4191 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4192
4193 Prefer plain 'static' to 'static inline' (Bug#12541).
4194 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4195 (bidi_set_sor_type, bidi_push_embedding_level)
4196 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4197 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4198 (bidi_cache_search, bidi_cache_ensure_space)
4199 (bidi_cache_iterator_state, bidi_cache_find)
4200 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4201 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4202 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4203 Now 'static', not 'static inline'.
4204
4205 Count overruns when profiling; change units to ns.
4206 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4207 Give extra weight to samples after overruns, to attempt to count
4208 the time more accurately.
4209 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4210 the underlying primitives nominally do ns.
4211 (Fprofiler_cpu_start): Document the change. Mention that
4212 the sampling intervals are only approximate.
4213
4214 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4215
4216 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4217
4218 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4219 case for the special 0 coding-system.
4220
4221 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4222 (Fmake_overlay): Remove redundant tests.
4223 (fix_start_end_in_overlays): Remove redundant recentering.
4224
4225 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
4226
4227 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4228 Update dependencies.
4229
4230 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 Fix a malloc race condition involving strsignal.
4233 A signal can arrive in the middle of a malloc, and Emacs's signal
4234 handler can invoke strsignal, which can invoke malloc, which is
4235 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4236 Fix it by altering the signal handler so that it does not invoke
4237 strsignal.
4238 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4239 * process.c (status_message): Use const pointer, in case strsignal
4240 is #defined to safe_strsignal.
4241 * sysdep.c (sys_siglist, init_signals): Always define and
4242 initialize a substitute sys_siglist if the system does not define
4243 one, even if HAVE_STRSIGNAL.
4244 (safe_strsignal): Rename from strsignal. Always define,
4245 using sys_siglist. Return a const pointer.
4246 * syssignal.h (safe_strsignal): New decl.
4247 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4248
4249 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4250
4251 * w32proc.c (timer_loop): Fix code that waits for timer
4252 expiration, to avoid high CPU usage.
4253
4254 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4255
4256 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4257 (sweep_weak_table): Remove redundant prototypes.
4258
4259 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4260
4261 * emacs.c: Move the inclusion of TERM_HEADER after including
4262 windows.h on WINDOWSNT. This avoids compilation problems with
4263 MSVC.
4264
4265 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4266
4267 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4268 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4269 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4270 as the previous version used 'void *'.
4271
4272 * ralloc.c (ROUNDUP): Fix last change.
4273 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4274 'size_t'.
4275
4276 * w32proc.c <disable_itimers>: New static flag.
4277 (init_timers): Initialize it to zero, after creating the critical
4278 sections used by the timer threads.
4279 (term_timers): Set to 1 before deleting the critical sections.
4280 (getitimer, setitimer): If disable_itimers is non-zero, return an
4281 error indication without doing anything. Reported by Fabrice
4282 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4283 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4284 return results.
4285 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4286 support timers.
4287
4288 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4289 term_ntproc after all the other bookkeeping, to get timers working
4290 as long as possible.
4291
4292 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4293
4294 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4295 Suggested by Juri Linkov in
4296 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4297
4298 Prefer plain 'static' to 'static inline' (Bug#12541).
4299 With static functions, modern compilers inline pretty well by
4300 themselves; advice from programmers often hurts as much as it helps.
4301 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4302 this change shrinks the text size of the Emacs executable by 1.1%
4303 without affecting CPU significantly in my benchmark.
4304 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4305 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4306 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4307 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4308 (bset_auto_fill_function, bset_auto_save_file_format)
4309 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4310 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4311 (bset_cache_long_line_scans, bset_case_fold_search)
4312 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4313 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4314 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4315 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4316 (bset_header_line_format, bset_indicate_buffer_boundaries)
4317 (bset_indicate_empty_lines, bset_invisibility_spec)
4318 (bset_left_fringe_width, bset_major_mode, bset_mark)
4319 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4320 (bset_name, bset_overwrite_mode, bset_pt_marker)
4321 (bset_right_fringe_width, bset_save_length)
4322 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4323 (bset_scroll_up_aggressively, bset_selective_display)
4324 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4325 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4326 (set_buffer_overlays_after):
4327 * category.c (bset_category_table):
4328 * charset.c (read_hex):
4329 * coding.c (produce_composition, produce_charset)
4330 (handle_composition_annotation, handle_charset_annotation)
4331 (char_encodable_p):
4332 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4333 (assign_row, set_frame_matrix_frame, make_current)
4334 (add_row_entry):
4335 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4336 * fns.c (maybe_resize_hash_table):
4337 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4338 * gmalloc.c (register_heapinfo):
4339 * image.c (lookup_image_type):
4340 * intervals.c (set_interval_object, set_interval_left)
4341 (set_interval_right, copy_interval_parent, rotate_right)
4342 (rotate_left, balance_possible_root_interval):
4343 * keyboard.c (kset_echo_string, kset_kbd_queue)
4344 (kset_keyboard_translate_table, kset_last_prefix_arg)
4345 (kset_last_repeatable_command, kset_local_function_key_map)
4346 (kset_overriding_terminal_local_map, kset_real_last_command)
4347 (kset_system_key_syms, clear_event, set_prop):
4348 * lread.c (digit_to_number):
4349 * marker.c (attach_marker, live_buffer, set_marker_internal):
4350 * nsterm.m (ns_compute_glyph_string_overhangs):
4351 * process.c (pset_buffer, pset_command)
4352 (pset_decode_coding_system, pset_decoding_buf)
4353 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4354 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4355 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4356 * syntax.c (bset_syntax_table, dec_bytepos):
4357 * terminal.c (tset_param_alist):
4358 * textprop.c (interval_has_some_properties)
4359 (interval_has_some_properties_list):
4360 * window.c (wset_combination_limit, wset_dedicated)
4361 (wset_display_table, wset_hchild, wset_left_fringe_width)
4362 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4363 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4364 (wset_right_fringe_width, wset_right_margin_cols)
4365 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4366 (wset_vertical_scroll_bar_type, wset_window_parameters):
4367 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4368 (wset_column_number_displayed, wset_region_showing)
4369 (window_box_edges, run_window_scroll_functions)
4370 (append_glyph_string_lists, prepend_glyph_string_lists)
4371 (append_glyph_string, set_glyph_string_background_width)
4372 (append_glyph, append_composite_glyph)
4373 (take_vertical_position_into_account):
4374 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4375 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4376 (lface_hash, lface_same_font_attributes_p, lookup_face):
4377 * xml.c (libxml2_loaded_p):
4378 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4379 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4380 Now 'static', not 'static inline'.
4381
4382 * bidi.c: Tune.
4383 (bidi_copy_it): Do the whole copy with a single memcpy.
4384 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4385
4386 Revert the FOLLOW-SYMLINKS change for file-attributes.
4387 Doing it right would require several changes to Tramp, and there's
4388 not enough time to get that tested before the freeze today.
4389 * dired.c (directory_files_internal, Ffile_attributes):
4390 Undo last change.
4391
4392 * frame.c (x_report_frame_params): Port better to wider ints.
4393 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4394 or that pointers can be printed in 15 decimal digits.
4395 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4396
4397 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4398
4399 Support x64 build on MS-Windows.
4400 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4401 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4402 compatibility with x64.
4403 (x_get_focus_frame): Add prototype.
4404
4405 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4406 defining an XRectangle structure.
4407
4408 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4409 arithmetics for compatibility with x64.
4410
4411 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4412 compatibility with x64.
4413
4414 * w32heap.h: Adjust prototypes and declarations.
4415
4416 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4417 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4418 DWORD, long, and unsigned long, for compatibility with x64.
4419 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4420 (sbrk): Argument is now of type ptrdiff_t.
4421
4422 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4423 less than 0x0500.
4424 (w32_msg_pump): Use WPARAM type for 'result'.
4425
4426 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4427 architecture.
4428 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4429 compatibility with x64.
4430
4431 * vm-limit.c (lim_data): Now size_t.
4432 (check_memory_limits): Adjust prototypes of real_morecore and
4433 __morecore to receive argument of type ptrdiff_t. Use size_t for
4434 five_percent and data_size.
4435
4436 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4437 variables, for compatibility with x64.
4438 (rva_to_section, offset_to_section, relocate_offset)
4439 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4440 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4441 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4442 for compatibility with x64.
4443
4444 * sysdep.c (STDERR_FILENO): Define if not already defined.
4445
4446 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4447 (__morecore): Argument type is now ptrdiff_t.
4448 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4449 (relinquish): Use ptrdiff_t type for 'excess'.
4450 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4451
4452 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4453 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4454 instead of a literal number.
4455
4456 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4457 (min): Define only if not already defined.
4458
4459 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4460 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4461 hosts.
4462
4463 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4464 'bitmaps' is a pointer.
4465
4466 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4467
4468 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4469
4470 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4471
4472 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4473 * dired.c (directory_files_internal, Ffile_attributes):
4474 New arg follow_symlinks. All uses changed.
4475
4476 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4477
4478 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4479
4480 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4481
4482 Support atimers and CPU profiler via profile.c on MS-Windows.
4483 * w32proc.c (sig_mask, crit_sig): New static variables.
4484 (sys_signal): Support SIGALRM and SIGPROF.
4485 (sigemptyset, sigaddset, sigfillset, sigprocmask)
4486 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
4487 sigfillset, and sigprocmask are no longer no-ops.
4488 (sigismember): New function.
4489 (struct itimer_data): New definition.
4490 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4491 (crit_prof): New static variables.
4492 (MAX_SINGLE_SLEEP): New definition.
4493 (timer_loop, stop_timer_thread, term_timers, init_timers)
4494 (start_timer_thread, getitimer, setitimer): New functions.
4495 (alarm): No longer a no-op, calls setitimer.
4496
4497 * w32.c (term_ntproc): Call term_timers.
4498 (init_ntproc): Make sure all signals are unblocked at startup, to
4499 erase any traces of dumping. Call init_timers.
4500
4501 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4502 Windows-specific code to display the hourglass mouse pointer is no
4503 longer used.
4504 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4505 to hourglass timer expiration.
4506 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4507 Remove, no longer used.
4508 (w32_note_current_window, show_hourglass, hide_hourglass):
4509 New functions, in support of hourglass cursor display similar to other
4510 window systems.
4511 (syms_of_w32fns): Don't initialize hourglass_timer.
4512
4513 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4514 WINDOWSNT as well.
4515 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4516
4517 * w32.h (init_timers, term_timers): Add prototypes.
4518
4519 2012-09-30 Kenichi Handa <handa@gnu.org>
4520
4521 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4522 to the buffer relocation which may be caused by ccl_driver.
4523
4524 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4525
4526 * xfns.c (Fx_file_dialog): Update comment.
4527
4528 * w32fns.c (Fx_file_dialog): Update comment.
4529
4530 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4531 Initialize panel name field if OSX >= 10.6.
4532
4533 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4534
4535 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4536
4537 * nsterm.m (NEW_STYLE_FS): New define.
4538 (ns_fullscreen_hook, windowWillEnterFullScreen)
4539 (windowDidEnterFullScreen, windowWillExitFullScreen)
4540 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4541 (setFSValue): New functions.
4542 (EmacsFSWindow): New implementation.
4543 (canBecomeKeyWindow): New function for EmacsFSWindow.
4544 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4545 (dealloc): Release nonfs_window if in fullscreen.
4546 (updateFrameSize:): Call windowDidMove to update top/left.
4547 (windowWillResize:toSize:): Check if frame is still maximized.
4548 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4549 next_maximized, maximized_width, maximized_height and nonfs_window.
4550 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4551 tbar_height.
4552 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
4553 fullscreen. Set maximized_width/height. Act on next_maximized.
4554
4555 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4556 (EmacsView): Add variables for fullscreen.
4557 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4558 (EmacsFSWindow): New interface for fullscreen.
4559
4560 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
4561
4562 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4563
4564 2012-09-30 Chong Yidong <cyd@gnu.org>
4565
4566 * fns.c (Frandom): Doc fix.
4567
4568 2012-09-30 Martin Rudalics <rudalics@gmx.at>
4569
4570 * window.c (Vwindow_combination_limit): New default value.
4571 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4572
4573 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4574
4575 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4576 Suggested by Eli Zaretskii in
4577 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4578
4579 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4580
4581 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4582 HAVE_TIMER_SETTIME is defined.
4583
4584 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4585
4586 Profiler improvements: more-accurate timers, overflow checks.
4587 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4588 signal.h, setjmp.h. Include systime.h instead.
4589 (saturated_add): New function.
4590 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4591 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4592 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4593 New static vars.
4594 (enum profiler_cpu_running): New enum.
4595 (profiler_cpu_running): Now of that enum type, not bool.
4596 All uses changed to store the new value.
4597 (handle_profiler_signal): Rename from sigprof_handler_1,
4598 for consistency with other handlers. Do not check whether
4599 cpu_log is a hash-table if garbage collecting, since it
4600 doesn't matter in that case.
4601 (deliver_profiler_signal): Rename from sigprof_handler,
4602 for consistency with other handlers.
4603 (setup_cpu_timer): New function, with much of what used to be in
4604 Fprofiler_cpu_start. Check for out-of-range argument.
4605 Prefer timer_settime if available, and prefer
4606 thread cputime clocks, then process cputime clocks, then
4607 monotonic clocks, to the old realtime clock. Use make_timeval
4608 to round more-correctly when falling back to setitimer.
4609 (Fprofiler_cpu_start): Use it.
4610 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4611 Don't assume that passing NULL as the 2nd argument of setitimer
4612 is the same as passing a pointer to all-zero storage.
4613 Ignore SIGPROF afterwards.
4614 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4615 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4616 non-fatal signal handlers. Ignore SIGPROF on startup.
4617 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4618 in profiler.c, since sysdep.c now uses it.
4619
4620 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4621 Suggested by Eli Zaretskii in
4622 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4623
4624 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
4625
4626 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4627
4628 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4629
4630 * lisp.h (struct backtrace): Remove indirection for `function' field.
4631 * xdisp.c (redisplay_internal):
4632 * profiler.c (record_backtrace, sigprof_handler_1):
4633 * alloc.c (Fgarbage_collect):
4634 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4635 (Fbacktrace_frame): Adjust accordingly.
4636
4637 2012-09-28 Glenn Morris <rgm@gnu.org>
4638
4639 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4640 (Frun_hook_with_args_until_failure): Doc fixes.
4641
4642 2012-09-28 Eli Zaretskii <eliz@gnu.org>
4643
4644 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4645 Qautomatic_redisplay and change the symbol name. All users changed.
4646
4647 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4648
4649 * profiler.c (sigprof_handler): Fix race condition.
4650
4651 2012-09-28 Glenn Morris <rgm@gnu.org>
4652
4653 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4654
4655 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4656
4657 Check more robustly for timer_settime.
4658 * Makefile.in (LIB_TIMER_TIME): New macro.
4659 (LIBES): Add it.
4660 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4661 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4662 call timer_settime.
4663
4664 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4665
4666 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4667
4668 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
4669
4670 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4671
4672 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4673
4674 * character.h (MAYBE_UNIFY_CHAR): Remove.
4675 * charset.c, charset.h (maybe_unify_char): Now static.
4676 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4677 Since this stuff is now private to charset.c, there's no need for
4678 a public macro and no need to inline by hand.
4679
4680 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4681 Stefan Monnier <monnier@iro.umontreal.ca>
4682 Juanma Barranquero <lekktu@gmail.com>
4683
4684 * profiler.c: New file.
4685 * Makefile.in (base_obj): Add profiler.o.
4686 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4687 ($(BLD)/profiler.$(O)): New target.
4688 * emacs.c (main): Call syms_of_profiler.
4689 * alloc.c (Qautomatic_gc): New constant.
4690 (MALLOC_PROBE): New macro.
4691 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4692 (total_bytes_of_live_objects): New function.
4693 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4694 Call malloc_probe for the memory profiler.
4695 (syms_of_alloc): Define Qautomatic_gc.
4696 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4697 race condition.
4698 (struct backtrace): Move definition...
4699 * lisp.h (struct backtrace): ..here.
4700 (Qautomatic_gc, profiler_memory_running): Declare vars.
4701 (malloc_probe, syms_of_profiler): Declare functions.
4702 * xdisp.c (Qautomatic_redisplay): New constant.
4703 (redisplay_internal): Record itself in backtrace_list.
4704 (syms_of_xdisp): Define Qautomatic_redisplay.
4705
4706 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4707 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4708
4709 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4710
4711 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4712
4713 Prefer POSIX timers if available.
4714 They avoid a race if the timer is too close to the current time.
4715 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4716 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
4717 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
4718
4719 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4720
4721 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4722 CHAR_STRING_ADVANCE.
4723 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4724 STRING_CHAR_ADVANCE.
4725
4726 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4727
4728 Move Vlibrary_cache to emacs.c and reset before dumping.
4729
4730 * lisp.h (reset_image_types): Declare.
4731 [WINDOWSNT] (Vlibrary_cache): Declare.
4732
4733 * image.c (reset_image_types): New function.
4734
4735 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4736 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4737 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4738
4739 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4740 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4741
4742 * w32.h (Vlibrary_cache): Do not declare.
4743
4744 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4745
4746 * w32proc.c (sys_signal): Handle all signals defined by the
4747 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4748 handlers for signals supported by Windows. Don't override
4749 term_ntproc as the handler for SIGABRT.
4750 (sigaction): Rewrite to call sys_signal instead of duplicating its
4751 code.
4752 (sys_kill): Improve commentary.
4753
4754 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4755 consistency with a signature of a signal handler. All callers
4756 changed.
4757 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4758 install term_ntproc as a signal handler for SIGABRT, as that
4759 should be done by the dumped Emacs.
4760
4761 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4762
4763 * w32select.c (term_w32select): Protect against repeated
4764 invocation by setting clipboard_owner to NULL after calling
4765 DestroyWindow.
4766
4767 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4768 and term_ntproc to their modified signatures.
4769
4770 * character.c (char_string, string_char): Remove calls to
4771 MAYBE_UNIFY_CHAR. See the discussion starting at
4772 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4773 for the details.
4774
4775 2012-09-25 Chong Yidong <cyd@gnu.org>
4776
4777 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4778
4779 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4780
4781 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4782 when encountering an unknown bytecode.
4783
4784 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 image.c, indent.c: Use bool for booleans.
4787 * dispextern.h (struct image_type): Members valid_p, load, init
4788 now return bool, not int. All uses changed.
4789 * image.c: Omit unnecessary static decls.
4790 (x_create_bitmap_mask, x_build_heuristic_mask):
4791 Return void, not int, since callers don't care about the return value.
4792 (x_create_bitmap_mask, define_image_type, valid_image_p)
4793 (struct image_keyword, parse_image_spec, image_spec_value)
4794 (check_image_size, image_background)
4795 (image_background_transparent, x_clear_image_1)
4796 (postprocess_image, lookup_image, x_check_image_size)
4797 (x_create_x_image_and_pixmap, xbm_image_p)
4798 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4799 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4800 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4801 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4802 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4803 (png_image_p, init_png_functions, png_load_body, png_load)
4804 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4805 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4806 (init_gif_functions, gif_load, imagemagick_image_p)
4807 (imagemagick_load_image, imagemagick_load, svg_image_p)
4808 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4809 (gs_load):
4810 * nsimage.m (ns_load_image):
4811 * nsterm.m (ns_defined_color):
4812 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4813 * xfns.c (x_defined_color):
4814 * xterm.c (x_alloc_lighter_color_for_widget)
4815 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4816 (x_alloc_lighter_color):
4817 * indent.c (disptab_matches_widthtab, current_column)
4818 (scan_for_column, string_display_width, indented_beyond_p)
4819 (compute_motion, vmotion, Fvertical_motion):
4820 Use bool for booleans.
4821
4822 2012-09-24 Chong Yidong <cyd@gnu.org>
4823
4824 * chartab.c (Fset_char_table_default): Obsolete function removed.
4825
4826 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4827
4828 Move pid_t related decls out of lisp.h.
4829 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4830 (interruptible_wait_for_termination):
4831 Move these decls from lisp.h to syswait.h, since they use pid_t.
4832 Needed on FreeBSD; see Herbert J. Skuhra in
4833 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4834 * callproc.c: Include syswait.h.
4835
4836 gnutls.c, gtkutil.c: Use bool for boolean.
4837 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4838 (emacs_gnutls_handle_error):
4839 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4840 (xg_hide_tooltip, xg_create_frame_widgets)
4841 (create_dialog, xg_uses_old_file_dialog)
4842 (xg_get_file_with_chooser, xg_get_file_with_selection)
4843 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4844 (xg_item_label_same_p, xg_update_menubar)
4845 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4846 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4847 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4848 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4849 (update_frame_tool_bar, free_frame_tool_bar):
4850 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4851 * nsmenu.m (ns_update_menubar):
4852 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4853 * xfns.c (Fx_show_tip) [USE_GTK]:
4854 Use bool for boolean.
4855 * gtkutil.c (xg_update_frame_menubar):
4856 * xmenu.c (update_frame_menubar):
4857 Return void, not int, since caller ignores return value.
4858 * gtkutil.c (xg_change_toolbar_position):
4859 Return void, not 1.
4860
4861 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4862
4863 * makefile.w32-in (BLOCKINPUT_H): Remove.
4864 (SYSSIGNAL_H): New macro.
4865 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4866 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4867 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4868 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4869 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4870 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4871 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4872 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4873 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4874 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4875 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4876 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4877 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4878 ($(BLD)/w32xfns.$(O)): Update dependencies.
4879
4880 2012-09-23 Eli Zaretskii <eliz@gnu.org>
4881
4882 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4883 fatal_error_backtrace.
4884
4885 * w32proc.c (sys_kill): Undo last change: don't do anything when
4886 invoked to deliver SIGABRT to our own process. This is now
4887 handled by emacs_raise.
4888
4889 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4890
4891 * w32term.c (w32_read_socket): Remove leftover reference to
4892 interrupt_input_pending.
4893
4894 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 Do not use SA_NODEFER.
4897 Problem reported by Dani Moncayo in
4898 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4899 * alloc.c (die):
4900 * sysdep.c (emacs_abort): Do not reset signal handler.
4901 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4902 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4903 wanted even on POSIXish hosts, and it doesn't work on Windows.
4904
4905 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4906
4907 * xterm.c (x_term_init): Call fixup_locale before and after calling
4908 gtk_init (Bug#12392).
4909
4910 2012-09-23 Chong Yidong <cyd@gnu.org>
4911
4912 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4913 Vdynamic_library_alist.
4914
4915 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4916 (Fgnutls_available_p): Caller changed.
4917
4918 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4919 (Flibxml_parse_xml_region): Likewise.
4920
4921 * dispextern.h (struct image_type): Remove arg from init function.
4922
4923 * image.c (Finit_image_library, lookup_image_type)
4924 (define_image_type): Remove now-unneeded second arg.
4925 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4926 (init_tiff_functions, init_gif_functions, init_svg_functions):
4927 Arglist and w32_delayed_load calling convention changed.
4928 (gs_type): Remove init_gs_functions; there is no such function.
4929 (valid_image_p, make_image): Fix caller to lookup_image_type.
4930
4931 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 Simplify and avoid signal-handling races (Bug#12471).
4934 * alloc.c (die):
4935 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4936 Avoid recursive loop if there's a fatal error in the function itself.
4937 * atimer.c (pending_atimers):
4938 * blockinput.h: Don't include "atimer.h"; no longer needed.
4939 (interrupt_input_pending): Remove. All uses removed.
4940 pending_signals now counts both atimers and ordinary interrupts.
4941 This is less racy than having three separate pending-signal flags.
4942 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4943 (input_blocked_p):
4944 Rename from their upper-case counterparts BLOCK_INPUT,
4945 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4946 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4947 This makes it easier to access volatile variables more accurately.
4948 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4949 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4950 that's more reliable if the code is buggy and sets
4951 interrupt_input_blocked to a negative value. All uses changed.
4952 * atimer.c (deliver_alarm_signal):
4953 Remove. No need to deliver this to the parent; any thread can
4954 handle this signal now. All uses replaced by underlying handler.
4955 * atimer.c (turn_on_atimers):
4956 * dispnew.c (handle_window_change_signal):
4957 * emacs.c (handle_danger_signal):
4958 * keyboard.c (kbd_buffer_get_event):
4959 Don't reestablish signal handler; not needed with sigaction.
4960 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4961 (UNBLOCK_INPUT_TO):
4962 Rework to avoid unnecessary accesses to volatile variables.
4963 (UNBLOCK_INPUT_TO): Now a function.
4964 (totally_unblock_input, unblock_input): New decls.
4965 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4966 (init_data): Remove. Necessary stuff now done in init_signal.
4967 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4968 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4969 (fatal_error_code): Remove; no longer needed.
4970 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4971 it doesn't always backtrace. All uses changed. No need to reset
4972 signal to default, since sigaction and/or die does that for us now.
4973 Use emacs_raise (FOO), not kill (getpid (), FOO).
4974 (main): Check more-accurately whether we're dumping.
4975 Move fatal-error setup to sysdep.c
4976 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4977 * gtkutil.c (xg_get_file_name, xg_get_font):
4978 Remove no-longer-needed signal-mask manipulation.
4979 * keyboard.c, process.c (POLL_FOR_INPUT):
4980 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4981 * keyboard.c (read_avail_input): Remove.
4982 All uses replaced by gobble_input.
4983 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
4984 (kbd_buffer_store_event_hold, gobble_input):
4985 (record_asynch_buffer_change) [USABLE_SIGIO]:
4986 (store_user_signal_events):
4987 No need to mess with signal mask.
4988 (gobble_input): If blocking input and there are terminals, simply
4989 set pending_signals to 1 and return. All hooks changed to not
4990 worry about whether input is blocked.
4991 (process_pending_signals): Clear pending_signals before processing
4992 them, in case a signal comes in while we're processing.
4993 By convention callers now test pending_signals before calling us.
4994 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
4995 New functions, to support changes to blockinput.h.
4996 (handle_input_available_signal): Now extern.
4997 (reinvoke_input_signal): Remove. All uses replaced by
4998 handle_async_input.
4999 (quit_count): Now volatile, since a signal handler uses it.
5000 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5001 All callers changed. Block SIGINT only if not already blocked.
5002 Clear sigmask reliably, even if Fsignal returns, which it can.
5003 Omit unnecessary accesses to volatile var.
5004 (quit_throw_to_read_char): No need to restore sigmask.
5005 * keyboard.c (gobble_input, handle_user_signal):
5006 * process.c (wait_reading_process_output):
5007 Call signal-handling code rather than killing ourselves.
5008 * lisp.h: Include <float.h>, for...
5009 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5010 (pending_signals): Now volatile.
5011 (syms_of_data): Now const if IEEE floating point.
5012 (handle_input_available_signal) [USABLE_SIGIO]:
5013 (terminate_due_to_signal, record_child_status_change): New decls.
5014 * process.c (create_process): Avoid disaster if memory is exhausted
5015 while we're processing a vfork, by tightening the critical section
5016 around the vfork.
5017 (send_process_frame, process_sent_to, handle_pipe_signal)
5018 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5019 ignores SIGPIPE.
5020 (send_process): No need for setjmp/longjmp any more, since the
5021 SIGPIPE stuff is now gone. Instead, report an error if errno
5022 is EPIPE.
5023 (record_child_status_change): Now extern. PID and W are now args.
5024 Return void, not bool. All callers changed.
5025 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5026 Remove. All uses removed. This bug should be fixed now in a
5027 different way.
5028 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5029 and record the child status change directly. This avoids the
5030 need to futz with the signal mask.
5031 (process_fatal_action): Move here from emacs.c.
5032 (emacs_sigaction_flags): New function, containing
5033 much of what used to be in emacs_sigaction_init.
5034 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5035 caught by emacs, to make races less likely.
5036 (deliver_process_signal): Rename from handle_on_main_thread.
5037 All uses changed.
5038 (BACKTRACE_LIMIT_MAX): Now at top level.
5039 (thread_backtrace_buffer, threadback_backtrace_pointers):
5040 New static vars.
5041 (deliver_thread_signal, deliver_fatal_thread_signal):
5042 New functions, for more-accurate delivery of thread-specific signals.
5043 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5044 (deliver_arith_signal): Handle in this thread, not
5045 in the main thread, since it's triggered by this thread.
5046 (maybe_fatal_sig): New function.
5047 (init_signals): New arg DUMPING so that we can be more accurate
5048 about whether we're dumping. Caller changed.
5049 Treat thread-specific signals differently from process-general signals.
5050 Block all signals while handling fatal error; that's safer.
5051 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5052 on IEEE hosts.
5053 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5054 Ignore SIGPIPE unless batch.
5055 (emacs_backtrace): Output backtrace for the appropriate thread,
5056 which is not necessarily the main thread.
5057 * syssignal.h: Include <stdbool.h>.
5058 (emacs_raise): New macro.
5059 * xterm.c (x_connection_signal): Remove; no longer needed
5060 now that we use sigaction.
5061 (x_connection_closed): No need to mess with sigmask now.
5062 (x_initialize): No need to reset SIGPIPE handler here, since
5063 init_signals does this for us now.
5064
5065 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5066
5067 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5068 background rect may be larger (Bug#12245).
5069
5070 2012-09-23 Chong Yidong <cyd@gnu.org>
5071
5072 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5073
5074 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5075
5076 * .gdbinit: Just stop at fatal_error_backtrace.
5077 See Stefan Monnier's request in
5078 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5079 Remove no-longer-used query of system type.
5080
5081 2012-09-22 Chong Yidong <cyd@gnu.org>
5082
5083 * search.c (Freplace_match): Doc fix (Bug#12325).
5084
5085 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5086
5087 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5088 (Fline_end_position): Doc fix.
5089
5090 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5091
5092 2012-09-22 Chong Yidong <cyd@gnu.org>
5093
5094 * dispextern.h (struct image_type): Add new slot, storing a type
5095 initialization function.
5096
5097 * image.c (define_image_type): Call the image initializer function
5098 if it is defined. Arguments and return value changed.
5099 (valid_image_p, make_image): Callers changed.
5100 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5101 (gif_type, imagemagick_type, svg_type, gs_type):
5102 Add initialization functions.
5103 (Finit_image_library): Call lookup_image_type.
5104 (CHECK_LIB_AVAILABLE): Macro deleted.
5105 (lookup_image_type): Call define_image_type here, rather than via
5106 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5107 (syms_of_image): Move define_image_type calls for xbm_type and
5108 pbm_type to lookup_image_type.
5109
5110 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5111
5112 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5113 'idle_timers' from here ...
5114 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5115 lists, to avoid infloops when the timer does something stupid,
5116 like reinvoke itself with the same or smaller time-out.
5117 (Bug#12447)
5118
5119 2012-09-22 Martin Rudalics <rudalics@gmx.at>
5120
5121 * window.c (Fsplit_window_internal): Handle only Qt value of
5122 Vwindow_combination_limit separately.
5123 (Qtemp_buffer_resize): New symbol.
5124 (Vwindow_combination_limit): New default value.
5125 Rewrite doc-string.
5126
5127 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5128
5129 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5130 the new overlay string. (Bug#10159)
5131
5132 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5133
5134 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5135 or that fprintf is async-signal-safe. POSIX doesn't require
5136 either assumption.
5137
5138 2012-09-22 Chong Yidong <cyd@gnu.org>
5139
5140 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5141 (Bug#8207).
5142
5143 2012-09-22 Kenichi Handa <handa@gnu.org>
5144
5145 * composite.c (composition_reseat_it): Handle the case that a
5146 grapheme cluster is not covered by a single font (Bug#12352).
5147
5148 2012-09-21 Chong Yidong <cyd@gnu.org>
5149
5150 * image.c (define_image_type): Avoid adding duplicate types to
5151 image_types (Bug#12463). Suggested by Jörg Walter.
5152
5153 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5154
5155 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5156 (print_load_command_name): Add case LC_DATA_IN_CODE.
5157 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5158
5159 2012-09-21 Glenn Morris <rgm@gnu.org>
5160
5161 * eval.c (Frun_hook_with_args_until_success)
5162 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5163
5164 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
5165
5166 * fileio.c (Ffile_selinux_context): Only call freecon when
5167 lgetfilecon succeeded.
5168 (Fset_file_selinux_context): Likewise. (Bug#12444)
5169
5170 2012-09-21 Eli Zaretskii <eliz@gnu.org>
5171
5172 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5173 reordering, locate the cursor by calling set_cursor_from_row; if
5174 that fails, clear the desired glyph matrix before returning a
5175 failure indication to the caller. Fixes leaving garbled display
5176 when fast scrolling with a down-key. (Bug#12403)
5177 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5178 scrolling through multibyte text.
5179
5180 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5181
5182 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5183 calling mark_vectorlike since that's the one that marks the window.
5184 (mark_discard_killed_buffers): Mark the final cdr.
5185 * window.h (struct window): Move prev/next_buffers to the
5186 non-standard fields.
5187 * window.c (make_window): Initialize prev/next_buffers manually.
5188
5189 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5190
5191 Omit unused arg EXPECTED from socket hooks.
5192 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5193 * nsterm.m (ns_term_init):
5194 * termhooks.h (struct terminal.read_socket_hook):
5195 * w32inevt.c (w32_console_read_socket):
5196 * w32term.c (w32_read_socket):
5197 * xterm.c (XTread_socket):
5198 Omit unused arg EXPECTED. All callers changed.
5199 (store_user_signal_events): Return void, not int, since callers no
5200 longer care about the return value. All uses changed.
5201
5202 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
5203
5204 * w32gui.h (XParseGeometry): Do not declare.
5205
5206 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5207
5208 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
5209 Ignore 'expected'. See Eli Zaretskii in
5210 <http://bugs.gnu.org/12471#8> (last line).
5211
5212 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5213 (XParseGeometry): Now static. Substitute extremal values for
5214 values that are out of range.
5215
5216 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5217
5218 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5219
5220 * nsfns.m (XParseGeometry): Remove.
5221 (Fx_create_frame): Call x_set_offset to correctly interpret
5222 top_pos in geometry.
5223
5224 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
5225 (Fx_parse_geometry): If there is a space in string, call
5226 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5227
5228 2012-09-17 Eli Zaretskii <eliz@gnu.org>
5229
5230 * search.c (scan_buffer): Use character positions in calls to
5231 region_cache_forward and region_cache_backward, not byte
5232 positions. (Bug#12196)
5233
5234 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5235 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5236
5237 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5238 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5239 emacs_blocked_malloc, now deleted.
5240
5241 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5242
5243 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5244 The workaround was for improving performance on Solaris 2.4, but
5245 is getting in the way now. Emacs will still work if someone is
5246 still running Solaris 2.4 in a museum somewhere; Sun dropped
5247 support for Solaris 2.4 in 2003.
5248 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5249 * process.c (create_process) [HAVE_WORKING_VFORK]:
5250 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5251 since Emacs no longer uses vfork on that platform.
5252
5253 2012-09-17 Glenn Morris <rgm@gnu.org>
5254
5255 * emacs.c: Use COPYRIGHT.
5256
5257 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5258
5259 Remove configure's --without-sync-input option (Bug#12450).
5260 When auditing signal-handling in preparation for cleaning it up,
5261 I found that SYNC_INPUT has race conditions and would be a real
5262 pain to fix. Since it's an undocumented and deprecated
5263 configure-time option, now seems like a good time to remove it.
5264 Also see <http://bugs.gnu.org/11080#16>.
5265 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5266 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5267 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5268 (malloc_hysteresis):
5269 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5270 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5271 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5272 (dont_register_blocks, bytes_used_when_reconsidered)
5273 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5274 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5275 [!SYSTEM_MALLOC && !SYNC_INPUT]:
5276 Remove. All uses removed.
5277 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5278 implementation, one that depends on whether the new macro
5279 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5280 is defined.
5281 * atimer.c (run_timers, handle_alarm_signal):
5282 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5283 (handle_async_input, process_pending_signals)
5284 (handle_input_available_signal, init_keyboard):
5285 * nsterm.m (ns_read_socket):
5286 * process.c (wait_reading_process_output):
5287 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5288 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5289 (emacs_write):
5290 * xterm.c (XTread_socket):
5291 Assume SYNC_INPUT.
5292 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5293 * eval.c (handling_signal): Remove. All uses removed.
5294 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5295 All uses replaced with the SYNC_INPUT version.
5296 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5297 Remove decls.
5298 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5299 Now static.
5300
5301 * font.c (Ffont_shape_gstring): Remove unused local.
5302
5303 2012-09-16 Glenn Morris <rgm@gnu.org>
5304
5305 * Makefile.in (clean): No longer run nextstep's clean.
5306
5307 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5308 (ns_frag): Remove.
5309 (ns-app): Move here from ns.mk, and simplify.
5310 (clean): Simplify nextstep entry.
5311 * ns.mk: Remove file.
5312
5313 2012-09-17 Kenichi Handa <handa@gnu.org>
5314
5315 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5316 not covert the last few charactes.
5317
5318 2012-09-16 Kenichi Handa <handa@gnu.org>
5319
5320 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5321 here, but just check the validity of glyphs in the glyph-string.
5322
5323 2012-09-16 Martin Rudalics <rudalics@gmx.at>
5324
5325 * window.c (Fwindow_parameter, Fset_window_parameter):
5326 Accept any window as argument (Bug#12452).
5327
5328 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5329
5330 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5331 to ns_term_init to avoid memory leak.
5332
5333 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5334 explicit retain/release.
5335 (ns_term_init): Only allow one display. Initialize outerpool and
5336 ns_*_types.
5337
5338 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5339
5340 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5341 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5342 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5343 the Microsoft problem in a different way, by altering ../nt/config.nt.
5344
5345 2012-09-15 Eli Zaretskii <eliz@gnu.org>
5346
5347 * w32xfns.c:
5348 * w32uniscribe.c:
5349 * w32term.c:
5350 * w32select.c:
5351 * w32reg.c:
5352 * w32proc.c:
5353 * w32menu.c:
5354 * w32inevt.c:
5355 * w32heap.c:
5356 * w32font.c:
5357 * w32fns.c:
5358 * w32console.c:
5359 * w32.c:
5360 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5361 by lisp.h. This completes removal of setjmp.h inclusion
5362 erroneously announced in the previous commit. (Bug#12446)
5363
5364 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5365 more accurate.
5366
5367 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5368 not defined as a macro. The latter happens on MS-Windows.
5369 (Bug#12446)
5370
5371 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5374 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
5375 Some instances of '#include <setjmp.h>' removed, if the
5376 only reason for the instance was because "lisp.h" was included.
5377 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5378 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5379 and _longjmp with the new symbols. Emacs already uses _setjmp if
5380 available, so this change affects only POSIXish hosts that have
5381 sigsetjmp but not _setjmp, such as some versions of Solaris and
5382 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5383 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5384 (png_load_body) [HAVE_PNG]:
5385 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5386 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5387 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5388 since PNG requires jmp_buf. This is the only exception to the
5389 general rule that we now use sys_setjmp and sys_longjmp.
5390 This exception is OK since this code does not change the signal
5391 mask or longjmp out of a signal handler.
5392
5393 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5394
5395 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5396 Include "syssignal.h", for 'main_thread'.
5397
5398 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5399
5400 Avoid out-of-range marker position (Bug#12426).
5401 * insdel.c (replace_range, replace_range_2):
5402 Adjust markers before overlays, as suggested by comments.
5403 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5404 Remove redundant check before calling offset_intervals.
5405
5406 2012-09-14 Martin Rudalics <rudalics@gmx.at>
5407
5408 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5409 current buffer (Bug#12387).
5410
5411 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
5412
5413 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5414
5415 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5416
5417 Use a more backwards-compatible timer format (Bug#12430).
5418 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5419 vector element, not from the 4th, since PSECS is now at the end.
5420 (Fcurrent_idle_time): Doc fix.
5421
5422 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5423
5424 Function to mark objects and remove killed buffers at once.
5425 * alloc.c (discard_killed_buffers): Rename to ...
5426 (mark_discard_killed buffers) ... new name. Add marking
5427 of remaining objects. Fix comment. Adjust users.
5428 (mark_object): Do not touch frame buffer lists here.
5429 * frame.c (delete_frame): Reset frame buffer lists here.
5430
5431 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5432
5433 Better workaround for GNOME bug when --enable-gcc-warnings.
5434 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5435 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5436 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5437
5438 Simplify SIGIO usage (Bug#12408).
5439 The code that dealt with SIGIO was crufty and confusing, e.g., it
5440 played tricks like "#undef SIGIO" but these tricks were not used
5441 consistently. Simplify mostly by not #undeffing standard symbols,
5442 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5443 or not as we please) rather than "defined SIGIO" (standard symbol
5444 that we probably shouldn't #undef).
5445 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5446 Modules that need it can include it.
5447 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5448 * dispextern.h (ignore_sigio): New decl.
5449 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5450 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5451 * emacs.c (shut_down_emacs):
5452 * keyboard.c (kbd_buffer_store_event_hold):
5453 Use ignore_sigio rather than invoking 'signal' directly.
5454 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5455 for FIONREAD.
5456 (FIONREAD, SIGIO): Do not #undef.
5457 (tty_read_avail_input): Use #error rather than a syntax error.
5458 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5459 for I_PIPE, used by SETUP_SLAVE_PTY.
5460 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5461 * sysdep.c (croak): Remove; no longer needed. This bit of
5462 temporary code, with Fred N. Fish's comment that it's temporary,
5463 has been in Emacs since at least 1992!
5464 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5465 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5466 * syssignal.h (croak): Remove decl.
5467 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5468 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5469 now that we're termios-only.
5470 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5471 * term.c (dissociate_if_controlling_tty): Use #error rather than
5472 a run-time error.
5473
5474 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5475 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5476 to work around GNOME bug 683906.
5477 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5478 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5479 This works around GCC bug 54561.
5480
5481 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5482
5483 More fixes for 'volatile' and setjmp/longjmp.
5484 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5485 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5486 (png_load_body) [HAVE_PNG]:
5487 (jpeg_load_body) [HAVE_JPEG]:
5488 New function, with most of the old parent function's body.
5489 (png_load) [HAVE_PNG]:
5490 (jpeg_load) [HAVE_JPEG]:
5491 Invoke the new function, to avoid longjmp munging our locals.
5492 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5493 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5494 longjmp is passed 2, as the C standard doesn't guarantee this.
5495 Instead, store the failure code into mgr->failure_code.
5496
5497 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5498
5499 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5500 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5501 (syms_of_keyboard): Remove support for unread-command-char.
5502
5503 2012-09-12 Eli Zaretskii <eliz@gnu.org>
5504
5505 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5506 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5507 violation. (Bug#12426)
5508
5509 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5510
5511 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5512
5513 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5514
5515 * eval.c: Add `inhibit-debugger'.
5516 (Qinhibit_debugger): New symbol.
5517 (call_debugger): Bind it instead of Qdebug_on_error.
5518 (maybe_call_debugger): Test Vinhibit_debugger.
5519 (syms_of_eval): Define inhibit-debugger.
5520 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5521 (syms_of_xdisp): Remove inhibit-debug-on-message.
5522
5523 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5524
5525 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5526 If a nonvolatile local variable is written before a _longjmp to
5527 the frame containing the variable, and is read after the _longjmp,
5528 the value read is indeterminate. Some local variables of type
5529 'struct handler' and 'struct catchtag' are used in this way, so
5530 mark each of their slots as volatile if the slot can be set before
5531 _longjmp and read afterwards.
5532 * lisp.h (struct handler): var and chosen_clause are now volatile.
5533 (struct catchtag): val, next, and pdlcount are now volatile.
5534
5535 * bidi.c (bidi_push_it, bidi_pop_it):
5536 * fns.c (copy_hash_table):
5537 * image.c (define_image_type):
5538 * keyboard.c (kbd_buffer_store_event_hold):
5539 * process.c (Fprocess_send_eof):
5540 * xfaces.c (x_create_gc) [HAVE_NS]:
5541 * xgselect.c (xg_select):
5542 Prefer assignment to memcpy when either will do.
5543
5544 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5545 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5546 time an item is removed. No need to mark this function 'inline';
5547 the compiler knows better than we do.
5548
5549 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5550
5551 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5552 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5553 to change_frame_size (Bug#12388).
5554 (windowDidResize:): Pass YES to updateFrameSize.
5555
5556 * nsterm.h: Add delay parameter to updateFrameSize.
5557
5558 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5559
5560 Discard killed buffers from deleted window and frame objects.
5561 This reduces an amount of references to killed buffers and
5562 helps GC to reclaim them faster.
5563 * alloc.c (discard_killed_buffers): New function.
5564 (mark_object): Use it for deleted windows and frames.
5565 (mark_object): If symbol's value is set up for a killed buffer
5566 or deleted frame, restore its global binding.
5567 * data.c (swap_in_global_binding): Add GC notice.
5568 (swap_in_symval_forwarding): Use convenient set_blv_where.
5569 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5570 * window.h: ... to here.
5571
5572 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5573
5574 Convenient macro to check whether the buffer is live.
5575 * buffer.h (BUFFER_LIVE_P): New macro.
5576 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5577 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5578
5579 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5580
5581 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5582 composition cases (Bug#12364).
5583
5584 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5585 overhang of succeeding glyphs overlapping box cursor.
5586
5587 * w32term.c (x_draw_glyph_string): Likewise.
5588
5589 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5590
5591 Simplify, document, and port floating-point (Bug#12381).
5592 The porting part of this patch fixes bugs on non-IEEE platforms
5593 with frexp, ldexp, logb.
5594 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5595 Now static.
5596 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5597 support, by removing commented-out code and briefly listing the
5598 C89 functions excluded. The commented-out stuff was confusing
5599 maintenance, e.g., we thought we needed cbrt but it was commented out.
5600 (logb): Remove decl; no longer needed.
5601 (isfinite): New macro, if not already supplied.
5602 (isnan): Don't replace any existing macro.
5603 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5604 are present on all C89 platforms.
5605 (Ffrexp): Do not special-case zero, as frexp does the right thing
5606 for that case.
5607 (Flogb): Do not use logb, as it doesn't have the desired meaning
5608 on hosts that use non-base-2 floating point. Instead, stick with
5609 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5610 frexp, to avoid getting an unspecified result.
5611
5612 * xdisp.c (Qinhibit_debug_on_message): Now static.
5613
5614 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5615
5616 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5617 NSBezierPath (Bug#12131).
5618
5619 2012-09-10 Chong Yidong <cyd@gnu.org>
5620
5621 * fns.c (Fdelq, Fdelete): Doc fix.
5622
5623 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5624
5625 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5626 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5627
5628 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5629
5630 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5631 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5632 Use it.
5633
5634 2012-09-09 Eli Zaretskii <eliz@gnu.org>
5635
5636 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5637 left fringe if the window has a left margin. This avoids leaving
5638 traces of the cursor because its leftmost pixel is not drawn over.
5639
5640 * dispnew.c (update_window_line): When the left margin area of a
5641 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5642 that screen line. (Bug#12277)
5643
5644 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5645
5646 Assume C89 or later for math functions (Bug#12381).
5647 This simplifies the code, and makes it a bit smaller and faster,
5648 and (most important) makes it easier to clean up signal handling
5649 since we can stop worring about floating-point exceptions in
5650 library code. That was a problem before C89, but the problem
5651 went away many years ago on all practical Emacs targets.
5652 * data.c, image.c, lread.c, print.c:
5653 Don't include <math.h>; no longer needed.
5654 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5655 might be autoconfigured, as that never happens.
5656 * data.c (fmod):
5657 * doprnt.c (DBL_MAX_10_EXP):
5658 * print.c (DBL_DIG):
5659 Remove. C89 or later always defines these.
5660 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5661 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5662 (arith_error, domain_error, domain_error2):
5663 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5664 no longer needed -- we simply return what C returns. All uses removed.
5665 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5666 the wrapped code.
5667 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5668 Remove. All uses expanded, as these macros are no longer used
5669 more than once and are now more trouble than they're worth.
5670 (Ftan): Use tan, not sin / cos.
5671 (Flogb): Assume C89 frexp.
5672 (fmod_float): Assume C89 fmod.
5673 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5674 (init_floatfns): Remove. All uses removed.
5675
5676 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5677
5678 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5679 compositeToPoint for OSX < 10.6 (Bug#12390).
5680
5681 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5682
5683 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5684 This produces more-accurate results.
5685
5686 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5687
5688 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5689 changes (Bug#12088).
5690
5691 2012-09-08 Chong Yidong <cyd@gnu.org>
5692
5693 * syntax.c (Fstring_to_syntax): Doc fix.
5694
5695 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5696
5697 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5698 in the internal border.
5699 (x_set_window_size): Remove static variables and their usage.
5700 (ns_redraw_scroll_bars): Fix NSTRACE arg.
5701 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5702 Remove fringe/internal border adjustment (Bug#11052).
5703 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5704 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5705 (ns_fix_rect_ibw): Remove.
5706 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5707 (ns_dumpglyphs_box_or_relief): Ditto.
5708 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5709 adjustment.
5710 (ns_dumpglyphs_image): Ditto.
5711 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
5712 border adjustment.
5713 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5714 their usage. Add fringe_extended_p and its use as in other terms.
5715 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5716 scroll bar was removed.
5717 (updateFrameSize): New function.
5718 (windowDidResize): Move code to updateFrameSize and call it.
5719
5720 * nsterm.h (EmacsView): Add updateFrameSize.
5721
5722 2012-09-07 Chong Yidong <cyd@gnu.org>
5723
5724 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5725
5726 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5727
5728 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 More signal-handler cleanup (Bug#12327).
5731 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5732 Problem introduced when merging patches. Noted by Eli Zaretskii in
5733 <http://bugs.gnu.org/12327#67>.
5734 * floatfns.c: Comment fix.
5735 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5736 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5737 and anyway the declaration is harmless even if SIGDANGER is not defined.
5738 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5739 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5740 source files not surprisingly expected syssignal.h to define, or
5741 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5742 Include <sys/ioctl.h>, for FIONREAD.
5743 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5744 This eliminates a problem whereby other files mysteriously had
5745 to include "syssignal.h" before including "systty.h" if they
5746 wanted to use "#ifdef SIGIO".
5747
5748 2012-09-07 Eli Zaretskii <eliz@gnu.org>
5749
5750 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5751
5752 * w32.c (sigemptyset): Empty the set.
5753 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5754
5755 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5756
5757 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5758
5759 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5760 (mark_object): Likewise for frame objects.
5761
5762 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5763
5764 * syssignal.h (handle_on_main_thread): Always declare,
5765 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5766 This ports to platforms without HAVE_PTHREAD.
5767
5768 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5769
5770 Signal-handler cleanup (Bug#12327).
5771 Emacs's signal handlers were written in the old 4.2BSD style with
5772 sigblock and sigmask and so forth, and this led to some
5773 inefficiencies and confusion. Rewrite these to use
5774 pthread_sigmask etc. without copying signal sets around. Also,
5775 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5776 'signal', and instead use functions that do not attempt to take
5777 over the system name space. This patch causes Emacs's text
5778 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5779 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5780 Do not include <signal.h> or "syssignal.h", as these
5781 modules do not use signals.
5782 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5783 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5784 Do not include <signal.h>, as "syssignal.h" does that for us now.
5785 * atimer.c (sigmask_atimers): New function.
5786 (block_atimers, unblock_atimers): New functions,
5787 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5788 All uses replaced.
5789 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5790 no longer needed here.
5791 * emacs.c (main): Inspect existing signal handler with sigaction,
5792 so that there's no need to block and unblock SIGHUP.
5793 * sysdep.c (struct save_signal): New member 'action', replacing
5794 old member 'handler'.
5795 (save_signal_handlers, restore_signal_handlers):
5796 Use sigaction instead of 'signal' to save and restore.
5797 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5798 New function. All users of 'signal' modified to use set_sighandler
5799 if they're writeonly, and to use sys_signal if they're read+write.
5800 (emacs_sigaction_init, forwarded_signal): New functions.
5801 (sys_signal): Remove. All uses replaced by calls to sigaction
5802 and emacs_sigaction_init, or by direct calls to 'signal'.
5803 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5804 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5805 all uses replaced by pthread_sigmask etc. calls.
5806 * syssignal.h: Include <signal.h>.
5807 (emacs_sigaction_init, forwarded_signal): New decls.
5808 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5809 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5810 (sigmask, sys_sigmask): Remove; no longer needed.
5811 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5812 (sigblock, sigunblock, sigfree):
5813 (sigsetmask) [!defined sigsetmask]:
5814 Remove. All uses replaced by pthread_sigmask.
5815 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5816 no longer need to be replaced, and its typical old uses
5817 are now done via emacs_sigaction_init and sigaction.
5818 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5819 (sys_sigdel): Remove; unused.
5820 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5821
5822 2012-09-06 Eli Zaretskii <eliz@gnu.org>
5823
5824 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5825 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5826
5827 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5828
5829 Explicitly mark buffer_defaults and buffer_local_symbols.
5830 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5831 mark_local_symbols here.
5832 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5833 since special buffers aren't marked here any more.
5834 (allocate_buffer): Chain new buffer with all_buffers here...
5835 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5836 not here.
5837 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5838 (syms_of_buffer): Remove staticpro of the above.
5839 (init_buffer_once): Set names for buffer_defaults and
5840 buffer_local_symbols.
5841
5842 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5843
5844 Use bool for booleans in font-related modules.
5845 * font.c (font_intern_prop, font_style_to_value)
5846 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5847 (generate_otf_features, font_check_otf_features, font_check_otf)
5848 (font_match_p, font_list_entities, font_at):
5849 * fontset.c (fontset_id_valid_p, reorder_font_vector
5850 (fontset_find_font, Fset_fontset_font)
5851 (face_suitable_for_char_p) [0]:
5852 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5853 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5854 (m17n_flt_initialized, ftfont_shape_by_flt):
5855 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5856 * nsfont.m (nsfont_draw):
5857 * w32font.c (w32font_draw):
5858 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5859 Use bool for booleans.
5860 * font.h: Adjust to above API changes.
5861 (struct font, struct font_driver, struct font_driver_list):
5862 Use bool for booleans.
5863 (struct font): Remove useless member encoding_type.
5864 All users removed.
5865 * fontset.c, xftfont.c: Omit unnecessary static decls.
5866
5867 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5868
5869 * alloc.c (mark_object): Revert window marking code
5870 since it's unsafe for the Fset_window_configuration.
5871
5872 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5873
5874 Fix race conditions with signal handlers and errno (Bug#12327).
5875 Be more systematic about preserving errno whenever a signal
5876 handler returns, even if it's not in the main thread. Do this by
5877 renaming signal handlers to distinguish between signal delivery
5878 and signal handling. All uses changed.
5879 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5880 * data.c (deliver_arith_signal): Rename from arith_error.
5881 * dispnew.c (deliver_window_change_signal): Rename from
5882 window_change_signal.
5883 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5884 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5885 * keyboard.c (deliver_input_available_signal): Rename from
5886 input_available_signal.
5887 (deliver_user_signal): Rename from handle_user_signal.
5888 (deliver_interrupt_signal): Rename from interrupt_signal.
5889 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5890 (deliver_child_signal): Rename from sigchld_handler.
5891 * atimer.c (handle_alarm_signal):
5892 * data.c (handle_arith_signal):
5893 * dispnew.c (handle_window_change_signal):
5894 * emacs.c (handle_fatal_signal, handle_danger_signal):
5895 * keyboard.c (handle_input_available_signal):
5896 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5897 * process.c (handle_pipe_signal, handle_child_signal):
5898 New functions, with the actual signal-handling code taken from the
5899 original respective signal handlers, sans the sporadic attempts to
5900 preserve errno, since that's now done by handle_on_main_thread.
5901 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5902 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5903 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5904 Move to sysdep.c.
5905 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5906 Move initialization of main_thread to sysdep.c's init_signals.
5907 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5908 our usage, and simplifies the mainline code.
5909 (record_child_status_change): New static function, as a helper
5910 for handle_child_signal, and with most of the old child handler's
5911 contents.
5912 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5913 (handle_child_signal): Use the above.
5914 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5915 Moved here from emacs.c.
5916 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5917 code moved here from emacs.c's main function.
5918 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
5919 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5920 This lets callers save and restore errno properly.
5921
5922 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5923
5924 Remove redundant or unused things here and there.
5925 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5926 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5927 * editfns.c (Fcompare_buffer_substrings): Likewise.
5928 * frame.h (struct terminal, struct font_driver_list):
5929 Remove redundant declarations.
5930 * window.h (Qleft, Qright): Likewise.
5931
5932 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 Do not mark objects from deleted buffers, windows and frames.
5935 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5936 (mark_object): Likewise for windows and frames.
5937
5938 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5939
5940 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5941 buffer_defaults and buffer_local_symbols as valid objects.
5942 Return special value to denote them.
5943
5944 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5945
5946 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5947 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5948 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5949 (file_name_absolute_p, Fsubstitute_in_file_name):
5950 (check_executable, check_writable, Ffile_accessible_directory_p)
5951 (Fset_file_selinux_context, Fdefault_file_modes)
5952 (Finsert_file_contents, choose_write_coding_system)
5953 (Fwrite_region, build_annotations, a_write, e_write)
5954 (Fdo_auto_save):
5955 * filelock.c (boot_time_initialized, get_boot_time)
5956 (get_boot_time_1, lock_file_1, within_one_second):
5957 * floatfns.c (in_float):
5958 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5959 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5960 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5961 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5962 * window.c (compare_window_configurations):
5963 Use bool for booleans.
5964 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5965 (Fdefault_file_modes): Now mode_t, not int, for modes.
5966 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5967 (internal_delete_file): Now returns void, not a (boolean) int,
5968 since nobody was looking at the return value.
5969 * lisp.h, window.h: Adjust to above API changes.
5970
5971 * xdisp.c (set_message): Simplify and reindent last change.
5972
5973 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
5974
5975 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5976
5977 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5978
5979 * eval.c (call_debugger): Make the function non-static so that we
5980 can call it from set_message.
5981
5982 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
5983 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
5984
5985 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5986
5987 Give more-useful info on a fatal error (Bug#12328).
5988 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
5989 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
5990 of doing the work ourselves.
5991 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
5992 do most of the work.
5993 (fatal_error_backtrace): New function, taken from the guts
5994 of the old fatal_error_signal, but with a new option to output
5995 a backtrace.
5996 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
5997 info about the signal than just its number.
5998 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
5999 * sysdep.c: Include <execinfo.h>
6000 (emacs_backtrace): New function, taken partly from the previous
6001 code of the 'die' function.
6002 (emacs_abort): Call fatal_error_backtrace rather than abort.
6003
6004 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6005
6006 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6007 eager (load-time) macro-expansion.
6008 * lisp.mk (lisp): Add macroexp.
6009
6010 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6011
6012 Simplify redefinition of 'abort' (Bug#12316).
6013 Do not try to redefine the 'abort' function. Instead, redo
6014 the code so that it calls 'emacs_abort' rather than 'abort'.
6015 This removes the need for the NO_ABORT configure-time macro
6016 and makes it easier to change the abort code to do a backtrace.
6017 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6018 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6019 Remove; sysdep.c's emacs_abort now takes its place.
6020 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6021 'abort' changed to use 'emacs_abort'.
6022 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6023 (abort) [!defined abort]: Rename to ...
6024 (emacs_abort): ... new name.
6025 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6026 the place of the old 'abort' in emacs.c.
6027 * w32.c, w32fns.c (abort): Do not #undef.
6028 * w32.c (emacs_abort): Rename from w32_abort.
6029
6030 2012-09-04 Eli Zaretskii <eliz@gnu.org>
6031
6032 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6033 offsets[j].dv, since the y axis of the screen coordinates points
6034 down, while the y axis of the font definition coordinates points
6035 up. This fixes display of Arabic diacritics such as KASRA and
6036 KASRATAN. (Bug#11860)
6037
6038 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6039
6040 Be more systematic about _setjmp vs setjmp.
6041 * alloc.c (test_setjmp, mark_stack):
6042 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6043 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6044 (png_load, my_error_exit, jpeg_load):
6045 * process.c (send_process_trap, send_process):
6046 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6047 The underscored versions are up to 30x faster on some hosts.
6048 Formerly, the code used setjmp+longjmp sometimes and
6049 _setjmp+_longjmp at other times, with no particular reason to
6050 prefer setjmp+longjmp.
6051
6052 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6053
6054 Fix minor problem found by static checking.
6055 * buffer.c (Fdelete_all_overlays): Return nil.
6056
6057 2012-09-03 Martin Rudalics <rudalics@gmx.at>
6058
6059 * buffer.c (Fdelete_all_overlays): New function.
6060
6061 2012-09-03 Chong Yidong <cyd@gnu.org>
6062
6063 * gtkutil.c: Add extern decl for Qxft.
6064
6065 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6066
6067 * emacs.c, eval.c: Use bool for boolean.
6068 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6069 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6070 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6071 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6072 (main, decode_env_path, Fdaemon_initialized):
6073 * eval.c (call_debugger, Finteractive_p, interactive_p):
6074 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6075 (maybe_call_debugger, Fbacktrace):
6076 * process.c (read_process_output, exec_sentinel):
6077 Use bool for booleans.
6078 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6079 All callers changed.
6080 * eval.c (interactive_p): Omit always-true boolean argument
6081 EXCLUDE_SUBRS_P. All callers changed.
6082 * dispextern.h, lisp.h: Reflect above API changes.
6083 * firstfile.c (dummy): Use the address of 'main', whose signature
6084 won't change, instead of the address of 'initialize', whose
6085 signature just changed from int to bool.
6086 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6087 * msdos.c (fatal_error_in_progress): ... from here.
6088 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6089 of incrementing it.
6090 (redisplay_internal, unwind_redisplay): Simply clear
6091 REDISPLAYING_P when unwinding, instead of saving its previous,
6092 always-false value and then restoring it.
6093
6094 Clean up some extern decls.
6095 Mostly, this hoists extern decls out of .c files and into .h files.
6096 That way, we're more likely to catch errors if the interfaces change.
6097 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6098 declare xg_mark_data.
6099 * dispextern.h (x_frame_parm_handlers):
6100 * font.h (Qxft):
6101 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6102 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6103 (Qultra_bold, Qoblique, Qitalic):
6104 Move extern decl here from .c file.
6105 * alloc.c (xg_mark_data) [USE_GTK]:
6106 * doc.c (Qclosure):
6107 * eval.c (Qlexical_binding):
6108 * fns.c (time) [!HAVE_UNISTD_H]:
6109 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6110 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6111 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6112 * lread.c (Qinternal_interpreter_environment):
6113 * minibuf.c (Qbuffer):
6114 * process.c (QCfamily, QCfilter):
6115 * widget.c (free_frame_faces):
6116 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6117 * xfont.c (x_clear_errors):
6118 * xterm.c (x_frame_parm_handlers):
6119 Remove now-redundant extern decls.
6120 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6121 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6122 Now static.
6123 * xfaces.c: Remove unnecessary static decls.
6124 * xterm.c (updating_frame): Remove decl of nonexistent object.
6125
6126 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6127 when building globals.h, as the objects that are not built on
6128 this host are not needed to compile C files on this host.
6129
6130 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6131
6132 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6133
6134 * frame.h: Add missing prototype for x_wm_set_size_hint.
6135
6136 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6137
6138 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6139 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6140 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6141 (Fsubstitute_command_keys):
6142 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6143 (save_excursion_save, save_excursion_restore)
6144 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6145 (format_time_string, general_insert_function)
6146 (make_buffer_string, make_buffer_string_both)
6147 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6148 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6149 (copy_text, insert_1, insert_1_both, insert_from_string)
6150 (insert_from_string_before_markers, insert_from_string_1)
6151 (insert_from_buffer, insert_from_buffer_1, replace_range)
6152 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6153 (del_range_2, modify_region):
6154 * intervals.c (intervals_equal, balance_possible_root_interval)
6155 (adjust_intervals_for_insertion, merge_properties_sticky)
6156 (graft_intervals_into_buffer, lookup_char_property)
6157 (adjust_for_invis_intang, set_point_both)
6158 (get_property_and_range, compare_string_intervals)
6159 (set_intervals_multibyte_1, set_intervals_multibyte):
6160 * keyboard.c (decode_timer):
6161 Use bool for boolean.
6162 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6163 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6164
6165 2012-09-02 Chong Yidong <cyd@gnu.org>
6166
6167 * keymap.c (push_key_description): Print M-TAB as C-M-i
6168 (Bug#11758).
6169
6170 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
6171
6172 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6173 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6174 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6175 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6176 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6177 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6178 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6179
6180 2012-09-01 Eli Zaretskii <eliz@gnu.org>
6181
6182 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6183 more than one grapheme cluster passed to the shaper: compute the
6184 offset adjustment values separately for each cluster. (Bug#11860)
6185
6186 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6187 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6188 about implicit conversions from integer to pointer.
6189
6190 2012-09-01 Daniel Colascione <dancol@dancol.org>
6191
6192 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6193 system used too early.
6194
6195 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6196
6197 Better seed support for (random).
6198 * emacs.c (main): Call init_random.
6199 * fns.c (Frandom): Set the seed from a string argument, if given.
6200 Remove long-obsolete Gentzel cruft.
6201 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6202 (init_random): New function.
6203
6204 2012-09-01 Daniel Colascione <dancol@dancol.org>
6205
6206 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6207 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6208 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6209 x_wm_set_size_hint, x_query_colors, x_real_positions,
6210 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6211 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6212 all of which have been moved to common code.
6213
6214 * xfaces.c: Include TERM_HEADER instead of listing all possible
6215 window-system headers.
6216
6217 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6218 to match header.
6219
6220 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6221 directly accessing frame internals.
6222
6223 * w32font.h: Include font.h. Define syms_of_w32font and
6224 globals_of_w32font.
6225
6226 * process.c: Include TERM_HEADER instead of listing all possible
6227 window-system headers.
6228
6229 * nsterm.h: Remove declarations now in frame.h.
6230 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
6231
6232 * menu.c: Include TERM_HEADER instead of listing all possible
6233 window-system headers.
6234
6235 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6236 window system.
6237
6238 * keyboard.c: Include TERM_HEADER instead of listing all possible
6239 window-system headers.
6240
6241 * image.c: Include TERM_HEADER instead of listing all possible
6242 window-system headers. Declare Vlibrary_cache when compiling for
6243 Windows.
6244
6245 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6246 window system declarations.
6247
6248 * frame.h: Move common functions here: set_frame_menubar,
6249 x_set_window_size, x_sync, x_get_focus_frame,
6250 x_set_mouse_position, x_set_mouse_pixel_position,
6251 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6252 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6253 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6254 x_activate_menubar, x_real_positions, x_bitmap_icon,
6255 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6256 and x_query_colors.
6257
6258 * frame.c: Include TERM_HEADER instead of listing all possible
6259 window-system headers.
6260
6261 * font.c: Include TERM_HEADER instead of listing all possible
6262 window-system headers.
6263
6264 * emacs.c: Include TERM_HEADER.
6265
6266 * dispnew.c: Include TERM_HEADER instead of listing all possible
6267 window-system headers.
6268
6269 * ccl.h: Include character.h.
6270
6271 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6272 the current window system; include in list of objects to link into
6273 Emacs.
6274
6275 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6276
6277 Remove mark_ttys function and fix tty_display_info initialization.
6278 * lisp.h (mark_ttys): Remove prototype.
6279 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6280 to mark_ttys because all possible values of 'top_frame' slot are
6281 the frames which are reachable from Vframe_list.
6282 * term.c (mark_ttys): Remove.
6283 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6284
6285 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6286
6287 Change struct frame bitfields from unsigned char to unsigned.
6288 * frame.h (struct frame): Change type of 'display_preempted',
6289 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6290 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6291 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6292 bitfields from unsigned char to unsigned.
6293
6294 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6295
6296 Remove unused member of struct x_output and struct w32_output.
6297 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6298 * w32term.h (struct w32_output): Likewise.
6299
6300 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6301
6302 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6303 does not become zero (Bug#12234).
6304
6305 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6306
6307 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6308 for GCC 4.7.1 x86-64.
6309
6310 2012-08-30 Glenn Morris <rgm@gnu.org>
6311
6312 * lread.c (init_lread): For out-of-tree builds, only add the
6313 source directory's site-lisp dir to the load-path if it exists,
6314 consistent with in-tree builds. (Bug#12302)
6315
6316 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6317
6318 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
6319 button_values to NULL. Call setStykeMask so dialogs get a close button.
6320 (windowShouldClose:): Set window_closed.
6321 (dealloc): New member, free button_values.
6322 (process_dialog:): Make member function. Remove window argument,
6323 replace window with self. Count buttons and allocate and store values
6324 in button_values.
6325 (addButton:value:row:): value is int with the name tag. Call setTag
6326 with tag. Remove return self, declare return value as void.
6327 (addString:row:): Remove return self, declare return value as void.
6328 (addSplit): Remove return self, declare return value as void.
6329 (clicked:): Remove return self, declare return value as void.
6330 Set dialog_return to button_values[seltag]. Code formatting change.
6331 (initFromContents:isQuestion:): Adjust call to process_dialog.
6332 Code formatting change.
6333 (timeout_handler:): Set timer_fired to YES.
6334 (runDialogAt:): Set timer_fired to NO.
6335 Handle click on close button as quit.
6336
6337 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6338 Add window_closed and button_values. Add void as return value for
6339 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6340 Add process_dialog as new member.
6341
6342 2012-08-28 Eli Zaretskii <eliz@gnu.org>
6343
6344 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6345 is not one of the heaps we manage. (Bug#12242)
6346
6347 2012-08-28 Glenn Morris <rgm@gnu.org>
6348
6349 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6350
6351 2012-08-28 Martin Rudalics <rudalics@gmx.at>
6352
6353 * window.c (Fset_window_configuration): Remove handling of
6354 auto-buffer-name window parameter. Install revision of reverted
6355 fix.
6356
6357 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6358
6359 Do not allow to set major mode for a dead buffer.
6360 * buffer.c (Fset_buffer_major_mode): Signal an error
6361 if the buffer is dead.
6362 (Fother_buffer, other_buffer_safely): Remove redundant
6363 nested declaration.
6364
6365 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6366
6367 Always use set_buffer_if_live to restore original buffer at unwind.
6368 * buffer.h (record_unwind_current_buffer): New function.
6369 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6370 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6371 * undo.c, window.c: Adjust users.
6372 * buffer.c (set_buffer_if_live): Fix comment.
6373
6374 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6375
6376 Fix usage of set_buffer_internal.
6377 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6378 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6379 * coding.c (decode_coding): Omit redundant test.
6380 * fileio.c (decide_coding_unwind): Likewise.
6381 * fns.c (secure_hash): Likewise.
6382 * insdel.c (modify_region): Likewise.
6383 * keyboard.c (command_loop_1): Likewise.
6384 * print.c (PRINTFINISH): Likewise.
6385 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6386
6387 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6388
6389 * dispnew.c: Use bool for boolean.
6390 (frame_garbaged, display_completed, delayed_size_change)
6391 (fonts_changed_p, add_window_display_history)
6392 (add_frame_display_history, verify_row_hash)
6393 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6394 (row_equal_p, realloc_glyph_pool)
6395 (allocate_matrices_for_frame_redisplay)
6396 (showing_window_margins_p)
6397 (adjust_frame_glyphs_for_frame_redisplay)
6398 (build_frame_matrix_from_leaf_window, make_current)
6399 (mirrored_line_dance, mirror_line_dance, update_frame)
6400 (update_window_tree, update_single_window)
6401 (check_current_matrix_flags, update_window, update_text_area)
6402 (update_window_line, set_window_update_flags, scrolling_window)
6403 (update_frame_1, scrolling, buffer_posn_from_coords)
6404 (do_pending_window_change, change_frame_size)
6405 (change_frame_size_1, sit_for):
6406 Use bool for boolean.
6407 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6408 and remove last int (actually boolean) argument, which was always 0.
6409 All callers changed.
6410 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6411 * dispextern.h (struct composition_it): Use bool for boolean.
6412 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6413 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6414 * dired.c (file_name_completion):
6415 Use bool for boolean. (This was missed in an earlier change.)
6416
6417 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6418
6419 * window.c (Fset_window_configuration): Revert first part of
6420 last change.
6421
6422 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6423
6424 * nsterm.h (NSPanel): New class variable dialog_return.
6425
6426 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6427 Initialize dialog_return.
6428 (windowShouldClose:): Use stop instead of stopModalWithCode.
6429 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6430 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6431 event.
6432 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6433 modal loop returns.
6434
6435 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6436
6437 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6438 * composite.c (find_composition, composition_gstring_p)
6439 (composition_reseat_it, find_automatic_composition):
6440 * data.c (let_shadows_buffer_binding_p)
6441 (let_shadows_global_binding_p, set_internal, make_blv)
6442 (Fmake_variable_buffer_local, Fmake_local_variable)
6443 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6444 (cons_to_signed, arith_driver):
6445 * dbusbind.c (xd_in_read_queued_messages):
6446 * dired.c (directory_files_internal, file_name_completion):
6447 Use bool for booleans.
6448 * dired.c (file_name_completion):
6449 * process.h (fd_callback):
6450 Omit int (actually boolean) argument. It wasn't being used.
6451 All uses changed.
6452 * composite.h, lisp.h: Reflect above API changes.
6453
6454 * cmds.c, coding.c: Use bool for booleans.
6455 * cmds.c (move_point, Fself_insert_command):
6456 * coding.h (struct composition status, struct coding_system):
6457 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6458 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6459 (emacs_mule_char, decode_coding_emacs_mule)
6460 (encode_coding_emacs_mule, detect_coding_iso_2022)
6461 (decode_coding_iso_2022, encode_invocation_designation)
6462 (encode_designation_at_bol, encode_coding_iso_2022)
6463 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6464 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6465 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6466 (encode_coding_raw_text, detect_coding_charset)
6467 (decode_coding_charset, encode_coding_charset, detect_eol)
6468 (detect_coding, get_translation_table, produce_chars)
6469 (consume_chars, reused_workbuf_in_use)
6470 (make_conversion_work_buffer, code_conversion_save)
6471 (decode_coding_object, encode_coding_object)
6472 (detect_coding_system, char_encodable_p)
6473 (Funencodable_char_position, code_convert_region)
6474 (code_convert_string, code_convert_string_norecord)
6475 (Fset_coding_system_priority):
6476 * fileio.c (Finsert_file_contents):
6477 Use bool for booleans.
6478 * coding.h, lisp.h: Reflect above API changes.
6479 * coding.c: Remove unnecessary static function decls.
6480 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6481 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6482 not a boolean 'int', since callers never look at the return value.
6483 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6484 * coding.h (decoding_buffer_size, encoding_buffer_size)
6485 (emacs_mule_string_char): Remove unused extern decls.
6486 (struct iso_2022_spec, struct coding_system):
6487 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6488 (struct emacs_mule_spec): Remove unused field 'full_support'.
6489 All initializations removed.
6490 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6491
6492 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6493
6494 Fix spare memory change (Bug#12286).
6495 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6496 (valid_lisp_object_p): Likewise.
6497
6498 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6499
6500 * window.c (Fset_window_configuration): Record any window's old
6501 buffer if it's replaced (see Bug#8789). If the new current
6502 buffer doesn't appear in the selected window, go to its old
6503 point (Bug#12208).
6504
6505 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6506
6507 Special MEM_TYPE_SPARE to denote reserved memory.
6508 * alloc.c (enum mem_type): New memory type.
6509 (refill_memory_reserve): Use new type for spare memory.
6510 This prevents live_cons_p and live_string_p from incorrect
6511 detection of uninitialized objects from spare memory as live.
6512
6513 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6514
6515 Spelling fixes.
6516 * Makefile.in (.PHONY): versioclean -> versionclean.
6517
6518 Remove unused external symbols.
6519 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6520 * window.c (Qwindow_valid_p, decode_valid_window):
6521 Now static, not extern.
6522 * data.c (Qinterval): Remove; unused.
6523 (syms_of_data): Do not define 'interval'.
6524 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6525 * window.h (decode_valid_window):
6526 Remove decls.
6527
6528 * character.c, charset.c, chartab.c: Use bool for booleans.
6529 * character.c (lisp_string_width, string_count_byte8)
6530 (string_escape_byte8):
6531 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6532 (load_charset_map_from_file, map_charset_chars)
6533 (Fdefine_charset_internal, define_charset_internal)
6534 (Fdeclare_equiv_charset, find_charsets_in_text)
6535 (Ffind_charset_region, char_charset, Fiso_charset):
6536 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6537 (sub_char_table_set, sub_char_table_set_range)
6538 (char_table_set_range, optimize_sub_char_table)
6539 (map_sub_char_table):
6540 Use bool for boolean.
6541 * character.c (str_to_unibyte): Omit last boolean argument; it was
6542 always 0. All callers changed.
6543 * character.h, charset.h: Adjust to match previous changes.
6544 * character.h (char_printable_p): Remove decl of nonexistent function.
6545 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6546 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6547 are all boolean, so make them single-bit bitfields.
6548
6549 * lisp.h (ASET): Remove attempt to detect side effects.
6550 It was meant to be temporary and it often doesn't work,
6551 because when IDX has side effects the behavior of IDX==IDX
6552 is undefined. See Stefan Monnier in
6553 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6554
6555 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6556
6557 * lisp.h (functionp): New function (extracted from Ffunctionp).
6558 (FUNCTIONP): Use it.
6559 * eval.c (Ffunctionp): Use it.
6560
6561 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6562
6563 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6564 as that's faster and simpler than static storage. Don't bother
6565 with the g_main_context_query overhead if g_main_context_pending
6566 says no events are pending.
6567 (gfds, gfds_size): Remove these static vars.
6568 (xgselect_initialize): Remove; no longer needed.
6569 All uses and decls removed.
6570
6571 * emacs.c (fatal_error_signal_hook): Remove.
6572 All uses removed. This leftover from old code was always 0.
6573
6574 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6575 * casefiddle.c (casify_object, casify_region):
6576 * casetab.c (set_case_table):
6577 * category.c, category.h (word_boundary_p):
6578 * category.h (CHAR_HAS_CATEGORY):
6579 Use bool for booleans, instead of int.
6580
6581 2012-08-25 Eli Zaretskii <eliz@gnu.org>
6582
6583 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6584
6585 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6586
6587 On assertion failure, print backtrace if available.
6588 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6589 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6590 * Makefile.in (LIB_EXECINFO): New macro.
6591 (LIBES): Use it.
6592
6593 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6594 * bytecode.c (exec_byte_code):
6595 * callint.c (check_mark, Fcall_interactively):
6596 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6597 (getenv_internal, sync_process_alive, call_process_exited):
6598 * lisp.h (USE_SAFE_ALLOCA):
6599 Use bool for booleans, instead of int.
6600 * lisp.h, process.h: Adjust prototypes to match above changes.
6601 * callint.c (Fcall_interactively): Don't assume the mark's
6602 offset fits in 'int'.
6603
6604 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6605
6606 * buffer.c, buffer.h: Use bool for boolean.
6607 * buffer.c (reset_buffer_local_variables)
6608 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6609 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6610 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6611 (overlay_touches_p, overlay_strings, Foverlay_put)
6612 (report_overlay_modification, call_overlay_mod_hooks):
6613 (mmap_enlarge, mmap_set_vars):
6614 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6615 Use bool for booleans, instead of int.
6616 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6617 since the 1-or-0 return value is always ignored anyway.
6618 (mmap_initialized_p):
6619 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6620 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6621
6622 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6623
6624 * bidi.c: Use bool for boolean.
6625 This is a bit more readable, and makes the text segment of bidi.o
6626 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6627 Presumably it's faster too.
6628 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6629 Now bool.
6630 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6631 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6632 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6633 (bidi_explicit_dir_char, bidi_level_of_next_char)
6634 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6635 Use bool for booleans, instead of int.
6636 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6637 (bidi_unshelve_cache): Adjust decls to match code.
6638
6639 2012-08-23 Martin Rudalics <rudalics@gmx.at>
6640
6641 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6642 argument.
6643
6644 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6647 * atimer.h: Include <stdbool.h>.
6648
6649 2012-08-22 Dan Nicolaescu <dann@gnu.org>
6650
6651 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6652 compile time tests instead of run time tests on systems that do
6653 not use them.
6654 (FRAME_MAC_P): Remove leftover from deleted code.
6655 * frame.c (syms_of_frame): Remove leftover from deleted code.
6656
6657 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6658
6659 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6660
6661 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6662
6663 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6664 Otherwise, the compiler complains about (A?B:C) where B is void
6665 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
6666 (fontset_add): Return void, for FONTSET_ADD.
6667
6668 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 * alloc.c: Use bool for booleans.
6671 (gc_in_progress, abort_on_gc)
6672 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6673 (dont_register_blocks) [GC_MALLOC_CHECK]:
6674 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6675 (check_string_bytes, make_specified_string, memory_full)
6676 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6677 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6678 (mark_stack, valid_pointer_p, make_pure_string)
6679 (Fgarbage_collect, survives_gc_p, gc_sweep):
6680 Use bool for booleans, instead of int.
6681 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6682 Remove unused local.
6683 * alloc.c (PURE_POINTER_P):
6684 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6685 * editfns.c (Fformat):
6686 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6687 (Fdo_auto_save):
6688 * fns.c (sweep_weak_table):
6689 * lisp.h (suppress_checking, push_message, survives_gc_p)
6690 (make_pure_string, gc_in_progress, abort_on_gc):
6691 * lread.c (readchar, read1):
6692 * print.c (Fprin1_to_string):
6693 * xdisp.c (push_message):
6694 Use bool for booleans affected directly or indirectly by
6695 alloc.c's changes.
6696
6697 Make recently-introduced setters macros.
6698 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6699 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6700 (set_fontset_default, set_fontset_fallback): Rename from their
6701 upper-case counterparts, and make them functions rather than macros.
6702 This is more consistent with the other recently-introduced setters.
6703 These don't need to be inline, since they're local.
6704
6705 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6706
6707 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6708 the loop (Bug#12247).
6709
6710 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 * lisp.h (vcopy): Use memcpy rather than our own loop.
6713 This fixes a performance regression introduced by the recent
6714 addition of vcopy. This means 'vcopy' will need to be modified
6715 for a copying collector, but that's OK. Also, tighten the
6716 checking in the assertion.
6717
6718 2012-08-21 Eli Zaretskii <eliz@gnu.org>
6719
6720 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6721 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6722 non-base glyph for the width of the base character, according to
6723 what x_draw_composite_glyph_string_foreground expects.
6724 Generate WADJUST value according to composition_gstring_width's
6725 expectations, to produce correct width of the composed character.
6726 Reverse the sign of the DU offset produced by ScriptPlace.
6727
6728 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6729
6730 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6731
6732 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6733
6734 Avoid direct writes to contents member of struct Lisp_Vector.
6735 * lisp.h (vcopy): New function to copy data into vector.
6736 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6737 * fns.c (Ffillarray): Use ASET.
6738 * keyboard.c (timer_check_2): Use AREF and ASET.
6739 (append_tool_bar_item, Frecent_keys): Use vcopy.
6740 * lread.c (read_vector): Use ASET.
6741 * msdos.c (Frecent_doskeys): Use vcopy.
6742 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6743 (Finternal_merge_in_global_face): Use ASET and vcopy.
6744 * xfont.c (xfont_list_pattern): Likewise.
6745
6746 2012-08-21 Martin Rudalics <rudalics@gmx.at>
6747
6748 * window.c (Fwindow_point): For the selected window always return
6749 the position of its buffer's point.
6750 (Fset_window_point): For the selected window always go in its
6751 buffer to the specified position.
6752
6753 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6754
6755 Setter macros for fontsets.
6756 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6757 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6758 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6759 Adjust users.
6760
6761 2012-08-20 Glenn Morris <rgm@gnu.org>
6762
6763 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6764 Don't assume that `ln -f' works.
6765
6766 2012-08-20 Eli Zaretskii <eliz@gnu.org>
6767
6768 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6769 and later about non-assignments with no effect. See discussion at
6770 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6771 details.
6772
6773 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6774
6775 Inline setter functions for Lisp_Objects slots of struct specbinding.
6776 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6777 Adjust users.
6778
6779 2012-08-20 Martin Rudalics <rudalics@gmx.at>
6780
6781 * window.c (select_window): Always make selected window's buffer
6782 current.
6783
6784 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6785
6786 Use AREF and ASET for docstrings of category tables.
6787 * category.h (CATEGORY_DOCSTRING): Use AREF.
6788 (SET_CATEGORY_DOCSTRING): Use ASET.
6789 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6790
6791 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6792
6793 Inline setter functions for hash table members.
6794 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6795 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6796 (set_hash_key_and_value, set_hash_index, set_hash_next)
6797 (set_hash_hash): New functions.
6798 * charset.c, fns.c: Adjust users.
6799
6800 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6801
6802 Inline getter and setter functions for per-buffer values.
6803 * buffer.h (per_buffer_default, set_per_buffer_default)
6804 (per_buffer_value, set_per_buffer_value): New functions.
6805 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6806 * buffer.c, data.c: Adjust users.
6807
6808 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
6809
6810 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6811
6812 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6813
6814 Rely on <config.h> + <unistd.h> to declare 'environ',
6815 as gnulib does this if the system doesn't.
6816 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
6817 Remove declaration. MS-Windows declares it on stdlib.h which is
6818 included by conf_post.h.
6819 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6820 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6821 * vm-limit.c: Include <unistd.h>, for 'environ'.
6822
6823 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6824 (start_of_data): Remove decl; mem-limits.h provides it.
6825
6826 * xdisp.c (handle_invisible_prop): Make it a bit faster
6827 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6828
6829 2012-08-19 Chong Yidong <cyd@gnu.org>
6830
6831 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6832 ends (Bug#3874).
6833
6834 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6835
6836 * .gdbinit: Use call instead of set when calling a function in the
6837 inferior.
6838
6839 * data.c (set_internal): Don't use set_blv_found.
6840 (Fkill_local_variable): Likewise.
6841
6842 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6843
6844 * nsfont.m (ns_ascii_average_width): Ensure the string
6845 ascii_printable is initialized with a null-terminated character
6846 array. Otherwise, it can contain undesired extra characters.
6847
6848 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6849
6850 port new setting code to Sun C 5.8 2005/10/13
6851 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6852 Return void, not Lisp_Object. Otherwise, the compiler
6853 complains about (A?B:C) where B is void and C is Lisp_Object
6854 when compiling CHAR_TABLE_SET, due to the recent change to
6855 the API of sub_char_table_set_contents.
6856
6857 2012-08-18 Chong Yidong <cyd@gnu.org>
6858
6859 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6860 for the string case (Bug#3874).
6861
6862 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6863
6864 * buffer.h (BSET): Remove (Bug#12215).
6865 Replace all uses with calls to new setter functions.
6866 (bset_bidi_paragraph_direction, bset_case_canon_table)
6867 (bset_case_eqv_table, bset_directory, bset_display_count)
6868 (bset_display_time, bset_downcase_table)
6869 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6870 (bset_last_selected_window, bset_local_var_alist)
6871 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6872 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6873 (bset_width_table):
6874 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6875 (bset_auto_fill_function, bset_auto_save_file_format)
6876 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6877 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6878 (bset_cache_long_line_scans, bset_case_fold_search)
6879 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6880 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6881 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6882 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6883 (bset_header_line_format, bset_indicate_buffer_boundaries)
6884 (bset_indicate_empty_lines, bset_invisibility_spec)
6885 (bset_left_fringe_width, bset_major_mode, bset_mark)
6886 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6887 (bset_name, bset_overwrite_mode, bset_pt_marker)
6888 (bset_right_fringe_width, bset_save_length)
6889 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6890 (bset_scroll_up_aggressively, bset_selective_display)
6891 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6892 (bset_word_wrap, bset_zv_marker):
6893 * category.c (bset_category_table):
6894 * syntax.c (bset_syntax_table):
6895 New setter functions.
6896
6897 * process.h (PSET): Remove (Bug#12215).
6898 Replace all uses with calls to new setter functions.
6899 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6900 (PROCESS_INLINE): New macro.
6901 (pset_childp): New setter function.
6902 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6903 * process.c (PROCESS_INLINE):
6904 Define to EXTERN_INLINE, so that the corresponding functions
6905 are compiled into code.
6906 (pset_buffer, pset_command, pset_decode_coding_system)
6907 (pset_decoding_buf, pset_encode_coding_system)
6908 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6909 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6910 (pset_type, pset_write_queue): New setter functions.
6911
6912 * window.h (WSET): Remove (Bug#12215).
6913 Replace all uses with calls to new setter functions.
6914 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6915 (WINDOW_INLINE): New macro.
6916 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6917 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6918 (wset_total_lines, wset_vertical_scroll_bar)
6919 (wset_window_end_pos, wset_window_end_valid)
6920 (wset_window_end_vpos): New setter functions.
6921 * window.c (WINDOW_INLINE):
6922 Define to EXTERN_INLINE, so that the corresponding functions
6923 are compiled into code.
6924 (wset_combination_limit, wset_dedicated, wset_display_table)
6925 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6926 (wset_new_normal, wset_new_total, wset_next_buffers)
6927 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6928 (wset_prev_buffers, wset_right_fringe_width)
6929 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6930 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6931 (wset_window_parameters):
6932 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6933 (wset_column_number_displayed, wset_region_showing):
6934 New setter functions.
6935
6936 * termhooks.h (TSET): Remove (Bug#12215).
6937 Replace all uses with calls to new setter functions.
6938 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6939 (TERMHOOKS_INLINE): New macro.
6940 (tset_charset_list, tset_selection_alist): New setter functions.
6941 * terminal.c (TERMHOOKS_INLINE):
6942 Define to EXTERN_INLINE, so that the corresponding functions
6943 are compiled into code.
6944 (tset_param_alist): New setter function.
6945
6946 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6947
6948 * keyboard.h (KSET): Remove (Bug#12215).
6949 Replace all uses with calls to new setter functions.
6950 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6951 (KEYBOARD_INLINE): New macro.
6952 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6953 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6954 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6955 New setter functions.
6956 * keyboard.c (KEYBOARD_INLINE):
6957 Define to EXTERN_INLINE, so that the corresponding functions
6958 are compiled into code.
6959 (kset_echo_string, kset_kbd_queue)
6960 (kset_keyboard_translate_table, kset_last_prefix_arg)
6961 (kset_last_repeatable_command, kset_local_function_key_map)
6962 (kset_overriding_terminal_local_map, kset_real_last_command)
6963 (kset_system_key_syms): New setter functions.
6964
6965 * frame.h (FSET): Remove (Bug#12215).
6966 Replace all uses with calls to new setter functions.
6967 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6968 (FRAME_INLINE): New macro.
6969 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6970 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6971 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6972 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6973 (fset_param_alist, fset_root_window, fset_scroll_bars)
6974 (fset_selected_window, fset_title, fset_tool_bar_items)
6975 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6976 * frame.c (FRAME_INLINE):
6977 Define to EXTERN_INLINE, so that the corresponding functions
6978 are compiled into code.
6979 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6980
6981 A few more naming-convention fixes for getters and setters.
6982 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
6983 and rename from buffer_overlays_set_before.
6984 (set_buffer_overlays_after): Move here from buffer.h, and rename
6985 from buffer_overlays_set_after.
6986 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
6987 All uses changed.
6988 (set_buffer_intervals): Rename from buffer_set_intervals.
6989 * intervals.c (set_interval_object): Move here from intervals.h,
6990 and rename from interval_set_object.
6991 (set_interval_left): Move here from intervals.h, and rename from
6992 interval_set_left.
6993 (set_interval_right): Move here from intervals.h, and rename from
6994 interval_set_right.
6995 (copy_interval_parent): Move here from intervals.h, and rename from
6996 interval_copy_parent.
6997 * intervals.h (set_interval_parent): Rename from interval_set_parent.
6998 (set_interval_plist): Rename from interval_set_plist.
6999 Return void, not Lisp_Object, since no caller uses the result.
7000 * lisp.h (string_intervals): Rename from string_get_intervals.
7001 (set_string_intervals): Rename from string_set_intervals.
7002
7003 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7004 (set_char_table_contents): Rename from char_table_set_contents.
7005 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7006 All uses changed. See the end of
7007 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7008
7009 * lisp.h (CSET): Remove (Bug#12215).
7010 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7011 (set_char_table_purpose): New functions,
7012 replacing CSET. All uses changed. For example, replace
7013 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7014 "set_char_table_parent (char_table, parent);".
7015 The old version was confusing because it used the same name
7016 'parent' for two different things.
7017
7018 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7019
7020 Functions to get and set Lisp_Object fields of buffer-local variables.
7021 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7022 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7023 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7024 * data.c, eval.c, frame.c: Adjust users.
7025
7026 2012-08-17 Chong Yidong <cyd@gnu.org>
7027
7028 * xfaces.c (merge_face_vectors): If the target font specfies a
7029 font spec, make the font's attributes take precedence over
7030 directly-specified attributes.
7031 (merge_face_ref): Recognize :font.
7032
7033 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7034
7035 Do not use memcpy for copying intervals.
7036 * intervals.c (reproduce_interval): New function.
7037 (reproduce_tree, reproduce_tree_obj): Use it.
7038 (reproduce_tree_obj): Remove prototype.
7039
7040 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7041
7042 * lisp.h (duration_to_sec_usec): Remove unused decl.
7043
7044 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7045
7046 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7047 to an allocated instance of NSString, not to the class itself.
7048
7049 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
7050
7051 * makefile.w32-in (C_CTYPE_H): New macro.
7052 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7053 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7054 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7055
7056 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7057
7058 Use ASCII tests for character types.
7059 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7060 * xfns.c, xterm.c:
7061 Don't include <ctype.h>; was not needed.
7062 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7063 * sysdep.c, xfaces.c:
7064 Include <c-ctype.h> instead of <ctype.h>.
7065 * nsterm.m: Include <c-ctype.h>.
7066 * charset.c (read_hex):
7067 * doc.c (Fsnarf_documentation):
7068 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7069 (DRIVE_LETTER) [DOS_NT]:
7070 (Ffile_name_directory, Fexpand_file_name)
7071 (Fsubstitute_in_file_name):
7072 * font.c (font_parse_xlfd, font_parse_fcname):
7073 * frame.c (x_set_font_backend):
7074 * gtkutil.c (xg_get_font):
7075 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7076 * nsimage.m (hexchar):
7077 * nsterm.m (ns_xlfd_to_fontname):
7078 * sysdep.c (system_process_attributes):
7079 * xfaces.c (hash_string_case_insensitive):
7080 Use C-locale tests instead of locale-specific tests for character
7081 types, since we want the ASCII interpretation here, not the
7082 interpretation suitable for whatever happens to be the current locale.
7083
7084 2012-08-16 Martin Rudalics <rudalics@gmx.at>
7085
7086 Consistently check windows for validity/liveness
7087 (Bug#11984, Bug#12025, Bug#12026).
7088 * lisp.h (CHECK_VALID_WINDOW): New macro.
7089 * window.c (decode_window): Rename to decode_live_window.
7090 (decode_valid_window, Fwindow_valid_p): New functions.
7091 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7092 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7093 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7094 (Fwindow_prev_sibling, Fwindow_combination_limit)
7095 (Fset_window_combination_limit, Fwindow_use_time)
7096 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7097 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7098 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7099 (Fwindow_hscroll, Fset_window_hscroll)
7100 (Fwindow_redisplay_end_trigger)
7101 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7102 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7103 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7104 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7105 (Fwindow_end, Fset_window_point, Fset_window_start)
7106 (Fpos_visible_in_window_p, Fwindow_line_height)
7107 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7108 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7109 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7110 (Fset_window_parameter, Fwindow_display_table)
7111 (Fset_window_display_table, Fdelete_other_windows_internal)
7112 (Fset_window_buffer, Fset_window_new_total)
7113 (Fset_window_new_normal, Fdelete_window_internal)
7114 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7115 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7116 (Fwindow_scroll_bars): Check whether argument window is a valid or
7117 live window. Update doc-strings.
7118 (syms_of_window): New symbol Qwindow_valid_p.
7119 * keyboard.c (Fposn_at_x_y): Check whether argument
7120 frame_or_window denotes a valid window.
7121
7122 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7123
7124 Fix previous char table change.
7125 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7126 * chartab.c (optimize_sub_char_table): Likewise.
7127
7128 2012-08-16 Chong Yidong <cyd@gnu.org>
7129
7130 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7131
7132 * xfont.c (xfont_open):
7133 * xftfont.c (xftfont_open): Set the font's max_width field.
7134
7135 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7136 min_width to space_width and average_width to the average over
7137 printable ASCII characters.
7138 (ns_char_width): Code cleanup.
7139 (ns_ascii_average_width): New utility function.
7140
7141 * font.h (struct font): Update comments.
7142
7143 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7144
7145 Simple interface to set Lisp_Object fields of character tables.
7146 * lisp.h (CSET): New macro.
7147 (char_table_set_extras, char_table_set_contents)
7148 (sub_char_table_set_contents): New function.
7149 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7150 * syntax.c: Adjust users.
7151
7152 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7153
7154 * eval.c (eval_sub): Bind lexical-binding.
7155 * lread.c (Qlexical_binding): Make non-static.
7156
7157 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7158
7159 * nsmenu.m (popupSession): Remove.
7160 (pop_down_menu): Remove endModalSession.
7161 (timeout_handler:): New method.
7162 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7163 Call runModalForWindow. Check timer_fired when it returns.
7164 If not set, cancel timer and break out of loop.
7165 Otherwise loop again, with a new timeout.
7166
7167 * nsterm.m: Include fcntl.h if present.
7168 (fd_entry, t_readfds, inNsSelect): Remove.
7169 (select_writefds, select_valid, select_timeout, selfds)
7170 (select_mutex, apploopnr): Add.
7171 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7172 Otherwise call kbd_buffer_store_event.
7173 (ns_send_appdefined): Remove release of fd_entry.
7174 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7175 Increment and decrement apploopnr.
7176 (ns_select): If no file descriptors, just do a NSTimer.
7177 Otherwise copy read/write masks and start select thread (fd_handler).
7178 Start main loop and wait for application defined event.
7179 Inform select thread to stop selecting after main loop is exited.
7180 (ns_term_init): Create selfds pipe and set non-blocking.
7181 Initialize select_mutex. Start the select thread (fd_handler).
7182 (fd_handler:): Loop forever, wait for info from the main thread
7183 to either start or stop selecting. When select returns, send
7184 and appdefined event.
7185 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7186 If not call kbd_buffer_store_event.
7187
7188 * nsterm.h (EmacsApp): fd_handler takes id argument.
7189 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7190
7191 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7192
7193 2012-08-15 Eli Zaretskii <eliz@gnu.org>
7194
7195 * region-cache.c (move_cache_gap): Update gap_len using the actual
7196 growth of the boundaries array. Do not change cache_len.
7197 (Bug#12196)
7198
7199 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7200
7201 Generalize and cleanup font subsystem checks.
7202 * font.h (FONT_DEBUG, font_assert): Remove.
7203 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7204 Change font_assert to eassert. Use eassert where appropriate.
7205
7206 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7207
7208 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7209
7210 2012-08-15 Chong Yidong <cyd@gnu.org>
7211
7212 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7213 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7214 extract the font descriptor instead of just the font name.
7215 In that case, return a font spec instead of a string.
7216 (x_last_font_name): Move to this file from xfns.c.
7217
7218 * xfns.c (Fx_select_font): The return value can also be a font
7219 spec. Move x_last_font_name management to gtkutil.c.
7220
7221 * xfaces.c: Make font weight and style symbols non-static.
7222
7223 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7224
7225 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7226 (bug#12117).
7227
7228 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7229
7230 * alloc.c (Fgarbage_collect): Use plural form consistently.
7231
7232 2012-08-14 Eli Zaretskii <eliz@gnu.org>
7233
7234 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7235 iteration through the command loop. Fixes a problem whereby mouse
7236 movements are ignored until the first mouse click.
7237
7238 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7239
7240 Use bool, not int, for Lisp booleans.
7241 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7242 makes Emacs a bit smaller and presumably a bit faster.
7243 * lisp.h: Include <stdbool.h>.
7244 (struct Lisp_Boolfwd, defvar_bool):
7245 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7246 * regex.c [!emacs]: Include <stdbool.h>.
7247 (false, true): Remove; <stdbool.h> does this for us now.
7248
7249 2012-08-14 Chong Yidong <cyd@gnu.org>
7250
7251 * character.c (Fcharacterp): Doc fix (Bug#12076).
7252
7253 * data.c (Findirect_variable): Doc fix (Bug#11040).
7254
7255 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7256
7257 * editfns.c (Fformat): Doc fix (Bug#12059).
7258 (Fsave_current_buffer): Doc fix (Bug#11542).
7259
7260 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7261
7262 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7263 (bug#12022).
7264
7265 2012-08-14 Martin Rudalics <rudalics@gmx.at>
7266
7267 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7268 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7269 * minibuf.c (choose_minibuf_frame, read_minibuf):
7270 * w32fns.c (x_create_tip_frame):
7271 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7272 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7273
7274 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7275
7276 * intervals.c (offset_intervals): Remove obsolete comment.
7277
7278 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7279
7280 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7281
7282 2012-08-14 Gergely Risko <gergely@risko.hu>
7283
7284 * coding.c (decode_coding): Record buffer modification before
7285 disabling undo_list (Bug#11773).
7286
7287 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7288
7289 Revert and cleanup some recent overlay changes.
7290 * buffer.h (enum overlay_type): Remove.
7291 (buffer_get_overlays, buffer_set_overlays): Likewise.
7292 (buffer_set_overlays_before, buffer_set_overlays_after):
7293 New function. Adjust users.
7294 (unchain_both): Add eassert.
7295
7296 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7297
7298 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7299
7300 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 * gtkutil.c (xg_mark_data): Don't assume C99.
7303
7304 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7305
7306 * gtkutil.c (xg_frame_tb_info): New struct.
7307 (TB_INFO_KEY): New define.
7308 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7309 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7310 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7311 if not present.
7312 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
7313 is up to date. Otherwise store new data.
7314 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7315
7316 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7317
7318 Use KSET for write access to Lisp_Object members of struct kboard.
7319 * keyboard.h (KSET): New macro.
7320 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7321 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7322 * xterm.c: Adjust users.
7323
7324 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7325
7326 Use BSET for write access to Lisp_Object members of struct buffer.
7327 * buffer.h (BSET): New macro.
7328 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7329 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7330 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7331 * window.c, xdisp.c, xfns.c: Adjust users.
7332
7333 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7334
7335 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7336
7337 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7338
7339 * nsterm.m (not_in_argv): New function.
7340 (application:openFile, application:openTempFile:):
7341 (application:openFileWithoutUI:, application:openFiles:): Open file
7342 if not_in_argv returns non-zero (bug#12171).
7343
7344 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
7345 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7346 Define for Gtk+ versions less than 3.2.
7347 (xg_get_font_name): Use those functions/macros here.
7348 Reported by Frans Oilinki <moilinki@gmail.com>.
7349
7350 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7351
7352 * unexmacosx.c (copy_data_segment): Copy initialized data in
7353 statically linked libraries from input file rather than memory.
7354
7355 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7356 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7357 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7358
7359 2012-08-10 Glenn Morris <rgm@gnu.org>
7360
7361 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7362 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7363
7364 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7365
7366 Fix last change to allow compilation with low optimization levels.
7367 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7368 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7369
7370 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7371
7372 Use common inline syntax in intervals.h.
7373 * intervals.h (INTERVALS_INLINE): New macro.
7374 Change all users from LISP_INLINE.
7375
7376 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7377
7378 Define Qnone once for all platforms.
7379 * frame.c (Qnone): Define here.
7380 (syms_of_frame): DEFSYM it.
7381 * lisp.h (Qnone): New declaration.
7382 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7383 * xfns.c: Remove duplication. Adjust users.
7384
7385 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7386
7387 Remove unused macros from intervals.h.
7388 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7389 * intervals.c: Adjust comment.
7390
7391 2012-08-10 Eli Zaretskii <eliz@gnu.org>
7392
7393 * w32fns.c <w32_unicode_gui>: New static variable.
7394 (globals_of_w32fns): Initialize it according to os_subtype.
7395 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7396 testing os_subtype.
7397
7398 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
7399 Eli Zaretskii <eliz@gnu.org>
7400
7401 Fix bug #10299 with Unicode characters sent by customized
7402 keyboards created by MSKLC.
7403 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7404 (w32_init_class): Use it to initialize the Emacs class with either
7405 ANSI or Unicode API calls.
7406 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7407 later.
7408 (w32_wnd_proc): If the character code sent by WM_CHAR or
7409 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7410 original message. Call DefWindowProcW on NT and later.
7411
7412 2012-08-10 Glenn Morris <rgm@gnu.org>
7413
7414 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7415
7416 * lisp.h (DIRECTORY_SEP): Let configure set it.
7417
7418 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7419
7420 Use TSET for write access to Lisp_Object slots of struct terminal.
7421 * termhooks.h (TSET): New macro.
7422 * coding.c, terminal.c, xselect.c: Adjust users.
7423
7424 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7425
7426 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7427 the failing expression, include them in the error message.
7428 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7429 * lisp.h (internal_condition_case_n): Update declaration.
7430
7431 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7432
7433 Inline functions to examine and change buffer overlays.
7434 * buffer.c (unchain_both): New function.
7435 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7436 (buffer_has_overlays): New function.
7437 (enum overlay_type): New enum.
7438 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7439 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7440
7441 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7442
7443 Inline functions to examine and change buffer intervals.
7444 * alloc.c (mark_interval_tree): Remove.
7445 (MARK_INTERVAL_TREE): Simplify.
7446 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7447 * intervals.c (buffer_balance_intervals): New function.
7448 (graft_intervals_into_buffer): Adjust indentation.
7449 (set_intervals_multibyte): Simplify.
7450 * buffer.h (BUF_INTERVALS): Remove.
7451 (buffer_get_intervals, buffer_set_intervals): New function.
7452 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7453 * intervals.c, textprop.c: Adjust users.
7454
7455 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7456
7457 Inline functions to examine and change string intervals.
7458 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7459 (string_get_intervals, string_set_intervals): New function.
7460 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7461 * lread.c, print.c, textprop.c: Adjust users.
7462
7463 2012-08-08 Glenn Morris <rgm@gnu.org>
7464
7465 * lisp.mk (lisp): Remove language/persian.elc.
7466
7467 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7468
7469 Cleanup intervals.
7470 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7471 (NULL_INTERVAL_P): Likewise. Adjust users.
7472 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7473 Adjust comment. Move under #if 0.
7474 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7475 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7476
7477 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7478
7479 Check total length of intervals with eassert.
7480 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7481 * intervals.c: Change all users to eassert.
7482
7483 2012-08-07 Eli Zaretskii <eliz@gnu.org>
7484
7485 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7486 Rename fields to match removal of FGET and WGET and disuse of
7487 INTERNAL_FIELD in Lisp_Cons.
7488
7489 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7490
7491 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7492 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7493 name since all xname users are fixed long time ago. Do not
7494 use INTERNAL_FIELD.
7495 (set_symbol_name, set_symbol_function, set_symbol_plist):
7496 (set_symbol_next, set_overlay_plist): New function.
7497 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7498 (struct Lisp_Overlay): Likewise.
7499 (CVAR, MVAR, SVAR): Remove.
7500 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7501 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7502 * xterm.c: Adjust users.
7503 * .gdbinit: Change to use name field of struct Lisp_Symbol
7504 where appropriate.
7505
7506 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7507
7508 Basic functions to set Lisp_Object and pointer slots of intervals.
7509 * intervals.h (interval_set_parent, interval_set_object):
7510 (interval_set_left, interval_set_right, interval_set_plist):
7511 (interval_copy_parent): New function.
7512 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7513 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7514 Adjust indentation.
7515 (INTERVAL_SIZE): Remove. Adjust users.
7516 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7517
7518 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7519
7520 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7521 * process.h (PGET): Remove.
7522 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7523 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7524
7525 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7526
7527 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7528 * window.h (WGET): Remove.
7529 (struct window): Do not use INTERNAL_FIELD.
7530 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7531 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7532 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7533 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7534 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7535 Adjust users.
7536
7537 2012-08-07 Chong Yidong <cyd@gnu.org>
7538
7539 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7540 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7541 (Fdelete_window_internal): Signal an error if the window is not on
7542 a live frame (Bug#12025).
7543
7544 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7545
7546 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7547 * frame.h (FGET): Remove.
7548 (struct frame): Do not use INTERNAL_FIELD.
7549 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7550 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7551 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7552 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7553
7554 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
7555
7556 * w32.c: Silence compiler warnings.
7557 (map_w32_filename): Remove unused variable `is_fat'.
7558 (chase_symlinks): Add parentheses around expression.
7559
7560 2012-08-06 Glenn Morris <rgm@gnu.org>
7561
7562 * sysdep.c: Respect BROKEN_GETWD.
7563
7564 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7565 Let configure handle it.
7566 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7567
7568 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7569
7570 Use GCALIGNMENT where appropriate.
7571 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7572 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7573 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7574
7575 2012-08-06 Eli Zaretskii <eliz@gnu.org>
7576
7577 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7578 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
7579
7580 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7581
7582 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7583 that should be sufficient for everyone.
7584
7585 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7586
7587 * keyboard.c (timer_check_2): Add break so timer_check returns next
7588 timeout.
7589
7590 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7591
7592 Fix Windows build errors introduced after converting to WGET and WSET.
7593 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7594 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7595
7596 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7597
7598 * nsterm.m (ns_frame_rehighlight): Use FSET.
7599
7600 * nsmenu.m (ns_update_menubar): Use FSET.
7601
7602 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7603
7604 Separate read and write access to Lisp_Object slots of Lisp_Process.
7605 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7606 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7607
7608 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7609
7610 Separate read and write access to Lisp_Object slots of struct window.
7611 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7612 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7613 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7614 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7615 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7616 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7617 Adjust users.
7618
7619 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7620
7621 Fix Windows build errors introduced after converting to FGET and FSET.
7622 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7623 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7624 (w32_judge_scroll_bars): Change to use FSET.
7625 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7626
7627 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7628
7629 Fix replacement typo.
7630 * window.c (replace_window): Set root_window instead of
7631 selected_window. This fixes a total window subsystem
7632 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7633
7634 2012-08-06 Glenn Morris <rgm@gnu.org>
7635
7636 * lisp.mk (lisp): Add language/persian.elc.
7637
7638 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7639
7640 Separate read and write access to Lisp_Object slots of struct frame.
7641 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7642 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7643 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7644 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7645 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7646
7647 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7648
7649 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7650
7651 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7652
7653 Generalize common compile-time constants.
7654 * lisp.h (header_size, bool_header_size, word_size): Now here.
7655 (struct Lisp_Vector): Add comment.
7656 (struct Lisp_Bool_Vector): Move up to define handy constants.
7657 (VECSIZE, PSEUDOVECSIZE): Simplify.
7658 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7659 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7660 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7661 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7662 * xfont.c, xmenu.c: Use word_size where appropriate.
7663
7664 2012-08-05 Lawrence Mitchell <wence@gmx.li>
7665
7666 * search.c (Freplace_match): Treat \? in the replacement text
7667 literally (Bug#8161).
7668
7669 2012-08-05 Chong Yidong <cyd@gnu.org>
7670
7671 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7672 * frame.c (Vdelete_frame_functions):
7673 * emacs.c (Vkill_emacs_hook): Doc fix.
7674
7675 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7676
7677 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7678 --with-x-toolkit=no builds.
7679 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7680
7681 2012-08-04 Chong Yidong <cyd@gnu.org>
7682
7683 * syntax.c (Fmodify_syntax_entry): Doc fix.
7684
7685 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7686
7687 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7688 * w32.c (init_environment): Change the default values of many
7689 environment variables in dflt_envvars[] to NULL, to avoid pushing
7690 them into environment when they were not already defined.
7691 Remove the code that deletes site-lisp subdirectories from the default
7692 value of EMACSLOADPATH, as it is no longer needed.
7693 (check_windows_init_file): Now external, not static.
7694 Use Vload_path as is, without adding anything, as this function is now
7695 called when Vload_path is already set up.
7696
7697 * w32.h (check_windows_init_file): Add prototype.
7698
7699 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7700 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7701 compatibility with Posix platforms.
7702 (main): Move the call to check_windows_init_file to here from
7703 w32.c.
7704 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7705 any, in the DEFALT argument into the root of the Emacs build or
7706 installation tree, as appropriate.
7707
7708 * callproc.c (init_callproc_1): Call decode_env_path instead of
7709 doing its equivalent by hand.
7710 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7711 the code that sets Vexec_path run on MS-Windows.
7712
7713 * lread.c (init_lread): Add comments to #ifdef's.
7714
7715 * msdos.c (dos_set_window_size, IT_update_begin)
7716 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7717 instead of direct references.
7718
7719 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7720
7721 Export DEFAULT_REHASH_* to GDB.
7722 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7723 Now constants, not macros.
7724
7725 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7726
7727 Remove unnecessary casts involving pointers.
7728 These casts are no longer needed now that we assume C89 or later,
7729 since they involve casting to or from void *.
7730 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7731 (make_pure_float, make_pure_vector):
7732 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7733 * macros.c (Fstart_kbd_macro):
7734 * menu.c (find_and_return_menu_selection):
7735 * minibuf.c (read_minibuf_noninteractive):
7736 * sysdep.c (closedir):
7737 * xdisp.c (x_produce_glyphs):
7738 * xfaces.c (compare_fonts_by_sort_order):
7739 * xfns.c (x_real_positions, select_visual):
7740 * xselect.c (x_stop_queuing_selection_requests)
7741 (x_get_window_property, x_get_window_property_as_lisp_data):
7742 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7743 Remove unnecessary pointer casts.
7744 * alloc.c (record_xmalloc): New function.
7745 * lisp.h (record_xmalloc): New decl.
7746 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7747 more like a function. This is because the pointer cast is not
7748 needed. All uses changed.
7749 * print.c (print_string, print_error_message): Avoid length recalc.
7750
7751 Improve fix for macroexp crash with debugging (Bug#12118).
7752 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7753 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7754 not supposed to be invoked from the garbage collector.
7755 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7756 (gc_aset): New function, which is like ASET but can be
7757 used in the garbage collector.
7758 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7759 (set_hash_index): Use it instead of ASET.
7760
7761 2012-08-03 Eli Zaretskii <eliz@gnu.org>
7762
7763 Support symlinks on latest versions of MS-Windows.
7764 * w32.c: Include winioctl.h and aclapi.h.
7765 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7766 (revert_to_self): Forward declarations of static functions.
7767 <static BOOL g_b_init_get_security_info>:
7768 <g_b_init_create_symbolic_link>: New static flags.
7769 (globals_of_w32): Initialize them to zero.
7770 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7771 (map_w32_filename): Improve commentary. Simplify switch.
7772 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7773 headers (most versions of MinGW w32api don't).
7774 (get_security_info, create_symbolic_link)
7775 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7776 New functions.
7777 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7778 in the argument file name.
7779 (sys_access): Call unc_volume_file_attributes only if
7780 GetFileAttributes fails with network-related error codes.
7781 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7782 have the required privileges.
7783 (get_file_security_desc_by_name): Rename from
7784 get_file_security_desc.
7785 (stat_worker): New function, with most of the guts of 'stat', and
7786 with addition of handling of symlinks and support for 'lstat'.
7787 If possible, get file's attributes and security information by
7788 handle, not by name. Produce S_IFLNK bit for symlinks, when
7789 called from 'lstat'.
7790 (stat, lstat): New functions, call 'stat_worker'.
7791 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7792 symlinks when the underlying filesystem supports them.
7793
7794 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7795
7796 Fix macroexp crash on Windows with debugging (Bug#12118).
7797 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7798 checking subscripts; problem introduced with the recent
7799 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7800 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7801 since it's used in non-static inline functions now.
7802
7803 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7804 Don't assume buffer size fits in 'int'. Remove unused local.
7805
7806 Use C99-style 'extern inline' if available.
7807 * buffer.h (BUFFER_INLINE):
7808 * category.h (CATEGORY_INLINE):
7809 * character.h (CHARACTER_INLINE):
7810 * charset.h (CHARSET_INLINE):
7811 * composite.h (COMPOSITE_INLINE):
7812 * dispextern.h (DISPEXTERN_INLINE):
7813 * lisp.h (LISP_INLINE):
7814 * systime.h (SYSTIME_INLINE):
7815 New macro, replacing 'static inline' in this header.
7816 * buffer.h, category.h, character.h, charset.h, composite.h:
7817 * dispextern.h, lisp.h, systime.h:
7818 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7819 * alloc.c (LISP_INLINE):
7820 * buffer.c (BUFFER_INLINE):
7821 * category.c (CATEGORY_INLINE):
7822 * character.c (CHARACTER_INLINE):
7823 * charset.c (CHARSET_INLINE):
7824 * composite.c (COMPOSITE_INLINE):
7825 * dispnew.c (DISPEXTERN_INLINE):
7826 * sysdep.c (SYSTIME_INLINE):
7827 Define to EXTERN_INLINE, so that the corresponding functions
7828 are compiled into code.
7829 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7830 (INLINE_HEADER_END): New macros.
7831 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7832 since it's used in non-static inline functions now.
7833 (VALMASK) [!USE_LSB_TAG]: Likewise.
7834
7835 2012-08-02 Glenn Morris <rgm@gnu.org>
7836
7837 * s/: Remove empty directory.
7838
7839 * s/ms-w32.h: Move to ../nt/inc.
7840 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7841 Update for new ms-w32.h location.
7842
7843 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7844
7845 Port to Solaris 8.
7846 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7847
7848 2012-08-02 Glenn Morris <rgm@gnu.org>
7849
7850 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7851 hard-coding the path separator.
7852
7853 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7854
7855 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7856 This how ASET and AREF are supposed to work, and makes
7857 it easier to think about future improvements. See
7858 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7859 * charset.h (set_charset_attr): New function.
7860 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7861 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7862 (aref_addr): New function. All uses of &AREF(...) changed.
7863 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7864 (set_hash_index): New functions. All lvalue-style uses of
7865 HASH_KEY etc. changed.
7866 * keyboard.c (set_prop): New function. All lvalue-style uses
7867 of PROP changed.
7868
7869 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7870
7871 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7872 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
7873 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
7874 * nsfns.m (ns_set_name_as_filename): Likewise.
7875 * nsmenu.m (ns_update_menubar): Likewise.
7876 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7877
7878 2012-08-01 Eli Zaretskii <eliz@gnu.org>
7879
7880 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7881 Adapt to latest changes in field names of the corresponding Lisp
7882 objects.
7883
7884 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7885
7886 2012-08-01 Glenn Morris <rgm@gnu.org>
7887
7888 * s/msdos.h: Remove file.
7889 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7890 * Makefile.in (S_FILE): Remove.
7891 (config_h): Remove S_FILE.
7892
7893 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7894
7895 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7896 Remove; moved to nt/config.nt.
7897
7898 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7899
7900 Use INTERNAL_FIELD for conses and overlays.
7901 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7902 Remove obsolete comment.
7903 (MVAR): New macro.
7904 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7905 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7906
7907 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7908
7909 Use INTERNAL_FIELD for symbols.
7910 * lisp.h (SVAR): New macro. Adjust users.
7911 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7912 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7913
7914 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7915
7916 Use INTERNAL_FIELD for processes.
7917 * process.h (PVAR): New macro. Adjust style.
7918 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7919 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7920
7921 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7922
7923 Use INTERNAL_FIELD for windows.
7924 * window.h (WVAR): New macro.
7925 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7926 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7927 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7928 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7929 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7930 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7931
7932 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7933
7934 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7935
7936 2012-08-01 Glenn Morris <rgm@gnu.org>
7937
7938 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7939 Move to configure.ac.
7940
7941 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7942
7943 * makefile.w32-in (CONFIG_H): Update dependencies.
7944 (CONF_POST_H): New macro.
7945
7946 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7947
7948 2012-07-31 Glenn Morris <rgm@gnu.org>
7949
7950 * Makefile.in (S_FILE): No longer set by configure.
7951
7952 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7953 is available.
7954 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7955
7956 * process.h (NULL_DEVICE):
7957 * emacs.c (SEPCHAR):
7958 * editfns.c (USER_FULL_NAME): Let configure set them.
7959
7960 * s/README, s/template.h: Remove files.
7961
7962 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7963
7964 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7965 Move to configure.ac.
7966
7967 2012-07-31 Eli Zaretskii <eliz@gnu.org>
7968
7969 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7970 resulting renaming of 'struct frame' members.
7971
7972 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7973
7974 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7975 after introduction of FVAR.
7976
7977 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7978
7979 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7980
7981 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7982 instead of compositeToPoint.
7983 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
7984
7985 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
7986
7987 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7988
7989 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
7990 * lisp.h (INTERNAL_FIELD): New macro.
7991 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
7992 (BVAR): Change to use INTERNAL_FIELD.
7993 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
7994 (KVAR): Change to use INTERNAL_FIELD.
7995 * frame.h (FVAR): New macro.
7996 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
7997 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
7998 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
7999 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8000 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8001
8002 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8003
8004 Miscellaneous fixes for non-default X toolkits.
8005 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8006 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8007 Move under #ifdef USE_LUCID.
8008 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8009 definition and usage to avoid warnings.
8010
8011 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8012
8013 * nsterm.m (openFiles): Fix previous checkin.
8014
8015 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8016
8017 * indent.c (compute_motion): Remove unused local.
8018
8019 2012-07-31 Glenn Morris <rgm@gnu.org>
8020
8021 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8022
8023 * conf_post.h [USG5_4]:
8024 Move remaining contents of s/usg5-4-common.h here.
8025 * s/usg5-4-common.h: Remove file.
8026
8027 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8028 * s/irix6-5.h: Remove file.
8029
8030 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8031 * s/darwin.h: Remove file.
8032
8033 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8034 * s/hpux10-20.h: Remove file, which is now empty.
8035
8036 2012-07-30 Glenn Morris <rgm@gnu.org>
8037
8038 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8039 * Makefile.in (config_h): Add conf_post.h.
8040 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8041
8042 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8043
8044 * nsterm.m (ns_do_open_file): New variable.
8045 (ns_term_init): Set ns_do_open_file to YES after run returns.
8046 (openFile, openTempFile, openFileWithoutUI, openFiles):
8047 Open files only if ns_do_open_file.
8048
8049 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8052 This no-op macro hasn't been needed for many years.
8053 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8054
8055 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8056 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8057 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8058 gdb_make_enums_visible.
8059 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8060 (DIRECTORY_SEP): Now a constant, not a macro.
8061
8062 2012-07-30 Eli Zaretskii <eliz@gnu.org>
8063
8064 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8065 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8066
8067 * w32term.c <w32_keyboard_codepage>: Renamed from
8068 keyboard_codepage and now external. All users changed.
8069
8070 * w32term.h: Add declaration of w32_keyboard_codepage.
8071
8072 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8073 the codepage to translate keys to Unicode. If this argument is
8074 -1, use the value returned by GetConsoleCP. All callers changed.
8075
8076 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 Update .PHONY listings in makefiles.
8079 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8080 bootstrap-clean, distclean, maintainer-clean, versioclean,
8081 extraclean, frc.
8082
8083 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8084 This is a bit clearer. Fix some commentary typos.
8085
8086 2012-07-30 Glenn Morris <rgm@gnu.org>
8087
8088 * s/netbsd.h: Let configure include signal.h if needed.
8089 Remove file, which is now empty.
8090
8091 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8092 Let configure set them.
8093 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8094 No more need to undefine.
8095
8096 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8097
8098 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8099 non-single-byte char when adding meta modifier. (Bug#12090)
8100
8101 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8102
8103 Convert safe_call to use variable number of arguments.
8104 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8105 (safe_call2): Fix comment.
8106 * lisp.h (safe_call): Adjust prototype.
8107 * coding.c (encode_coding_object): Change to use safe_call2.
8108 * xfaces.c (merge_face_heights): Change to use safe_call1.
8109
8110 2012-07-30 Glenn Morris <rgm@gnu.org>
8111
8112 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8113 does that unconditionally. Remove file, which is now empty.
8114
8115 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8116 Remove empty files.
8117
8118 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8119
8120 Export to GDB most of lisp.h's remaining object-like macros.
8121 * lisp.h (min, max): Move earlier, because they're used earlier now.
8122 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8123 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8124 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8125 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8126 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8127 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8128 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8129 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8130 Now constants, for GDB. They need not be macros.
8131 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8132 Now constants, for GDB, as well as macros, for static initializers.
8133 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8134 Move to after the definition of struct Lisp_Char_Table,
8135 since the former now needs that type defined.
8136 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8137 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8138 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8139 New enums, for gdb_make_enums_visible.
8140 (GLYPH_MODE_LINE_FACE): Remove; unused.
8141 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8142 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8143 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8144 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8145 enum maxargs, enum MAX_ALLOCA.
8146 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8147 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8148 no longer needed, now that they are done in lisp.h.
8149
8150 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8151
8152 Cleanup string bytes checking.
8153 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8154 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8155 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8156 (check_sblock, compact_small_strings): Simplify.
8157
8158 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8159
8160 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8161 These macros are confusing and no longer need to be defined, as
8162 the enum values now suffice. All uses replaced with definiens.
8163 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8164
8165 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
8166
8167 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8168 ($(BLD)/w32console.$(O)): Update dependencies.
8169
8170 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8171
8172 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8173 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8174 time. Adjust users.
8175 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8176
8177 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8178
8179 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8180 setting sitelisp (Bug#12010).
8181
8182 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8183
8184 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8185
8186 * w32heap.c (cache_system_info):
8187 * w32.c (sys_rename):
8188 * w32proc.c (find_child_console, sys_kill): All users changed.
8189
8190 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8191
8192 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8193
8194 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8195
8196 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8197
8198 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8199
8200 Cleanup statistics calculation in Fgarbage_collect.
8201 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8202 Fix zombies percentage calculation. Simplify elapsed time calculation.
8203
8204 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8205
8206 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8207 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8208 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8209 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8210 (replace_range, replace_range_2, del_range_2): Change to eassert.
8211 * marker.c (byte_char_debug_check): Adjust style.
8212
8213 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8214
8215 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8216 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8217 long-ago-commented-out code that talks about "WIN32".
8218 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8219 All uses changed.
8220
8221 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8224 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8225 Simplify by using alignof.
8226 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8227 * lisp.h: Include <stdalign.h>.
8228 (GCALIGNMENT): New macro and constant.
8229 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8230 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8231 (stdalign): New macro, if not already defined.
8232
8233 2012-07-28 Eli Zaretskii <eliz@gnu.org>
8234
8235 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8236 * w32inevt.c: Include w32inevt.h.
8237 (w32_read_console_input): New inline function, calls either
8238 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8239 w32_console_unicode_input.
8240 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8241 (w32_kbd_patch_key, key_event): Use the codepage returned by
8242 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8243 (key_event): use uChar.UnicodeChar only if
8244 w32_console_unicode_input is non-zero.
8245
8246 * w32console.c: Include w32heap.h.
8247 <w32_console_unicode_input>: New global variable.
8248 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8249 family of Windows, zero otherwise.
8250
8251 * w32inevt.h: Declare w32_console_unicode_input.
8252
8253 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8254 --without-x. (Bug#11742)
8255
8256 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 Adjust GDB to reflect pvec_type changes (Bug#12036).
8259 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
8260 2012-07-04 changes to pseudovector representation.
8261 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
8262
8263 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
8264
8265 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8266 bus address.
8267 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8268
8269 2012-07-27 Eli Zaretskii <eliz@gnu.org>
8270
8271 * alloc.c (listn): Fix the order the arguments are consed onto the
8272 list.
8273
8274 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8275 enumeration constants, as PURE and HEAP are too general, and clash
8276 with other headers and sources, such as gmalloc.c and the
8277 MS-Windows system headers. All users changed.
8278
8279 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8280
8281 Revert last save_excursion_save and save_excursion_restore changes.
8282 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8283 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8284
8285 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8286
8287 Fix recently-introduced typos in Windows port.
8288 Reported by Martin Rudalics <rudalics@gmx.at>.
8289 * w32.c (init_environment): Replace comma with semicolon.
8290 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
8291
8292 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8293
8294 Improve GDB symbol export (Bug#12036).
8295 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8296 arms of an 'if', not using conditional expressions; otherwise GDB
8297 complains about the types in the unevaluated arm when the argument
8298 is an integer literal.
8299 (xgetint): Simplify expression.
8300 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8301 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8302 Zaretskii in <http://bugs.gnu.org/12036#13>.
8303 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8304 needed now that we have gdb_make_enums_visible.
8305 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8306 (enum enum_USE_LSB_TAG):
8307 New enum types, packaging up enums that need to be exported to GDB.
8308
8309 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8310
8311 Utility function to make a list from specified amount of objects.
8312 * lisp.h (enum constype): New datatype.
8313 (listn): New prototype.
8314 * alloc.c (listn): New function.
8315 (Fmemory_use_count, syms_of_alloc): Use it.
8316 * buffer.c (syms_of_buffer): Likewise.
8317 * callint.c (syms_of_callint): Likewise.
8318 * charset.c (define_charset_internal): Likewise.
8319 * coding.c (syms_of_coding): Likewise.
8320 * keymap.c (syms_of_keymap): Likewise.
8321 * search.c (syms_of_search): Likewise.
8322 * syntax.c (syms_of_syntax): Likewise.
8323 * w32.c (init_environment): Likewise.
8324 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8325 * xdisp.c (syms_of_xdisp): Likewise.
8326 * xfns.c (syms_of_xfns): Likewise.
8327
8328 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8329
8330 Fast save_excursion_save and save_excursion_restore.
8331 * lisp.h (struct Lisp_Excursion): New data type.
8332 (PVEC_EXCURSION): New pseudovector type.
8333 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8334 to deal with it. Adjust comments.
8335 (init_marker, attach_marker): New prototype.
8336 (unchain_marker): Adjust prototype.
8337 * marker.c (attach_marker): Change to global.
8338 (init_marker): New function.
8339 * alloc.c (Fmake_marker, build_marker): Use it.
8340 (build_marker): More easserts.
8341 (mark_object): Handle struct Lisp_Excursion.
8342 * editfns.c (save_excursion_save, save_excursion_restore):
8343 Reimplement to use struct Lisp_Excursion. Add comments.
8344
8345 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8346
8347 Fix export of symbols to GDB (Bug#12036).
8348 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8349 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8350 emacs.c, as this is a more-suitable home. Had this been done earlier
8351 the fix for 12036 would have avoided some of the problems noted in
8352 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8353 would have been more obvious.
8354 * emacs.c: Do not include <verify.h>; no longer needed.
8355 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
8356 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8357 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8358 Remove; now done in lisp.h.
8359 * lisp.h (PUBLISH_TO_GDB): New macro.
8360 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8361 (DATA_SEG_BITS): Use it.
8362 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8363 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8364 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8365 not be usable in #if. This simplifies things.
8366
8367 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
8368
8369 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8370
8371 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8372
8373 Simplify export of symbols to GDB (Bug#12036).
8374 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8375 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8376 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8377 Adjust to changes in lisp.h and emacs.c, by using
8378 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8379 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8380 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8381 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8382 instead of gdb_valbits.
8383 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8384 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8385 instead of gdb_array_mark_flag.
8386 (xboolvector): Get size from $->size, not $->header.size.
8387 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8388 (xreload, hook-run, hookpost-run): Remove.
8389 * emacs.c: Include <verify.h>.
8390 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8391 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8392 Remove.
8393 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8394 (gdb_USE_LSB_TAG): New enum constants.
8395 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8396 Also define these as enum constants, so they're visible to GDB.
8397 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8398 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8399 as constants, so they're visible to GDB.
8400 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8401 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8402 Now enum constants, not macros, so they're visible to GDB.
8403 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8404 more convenient now. All uses changed.
8405 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8406 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8407
8408 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8409
8410 Explicitly free restriction data that are not needed anymore.
8411 * editfns.c (save_restriction_restore): Free restriction data.
8412
8413 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8414
8415 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8416 add argument, tune behavior, and adjust all callers.
8417
8418 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8419
8420 Use typedef for EMACS_INT, EMACS_UINT.
8421 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8422 than macros. This simplifies debugging in the usual case, since
8423 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8424 and it allows expressions involving EMACS_INT casts.
8425 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8426
8427 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8428
8429 * nsterm.m (ns_read_socket): Return early if there is a modal
8430 window (Bug#12043).
8431
8432 2012-07-25 Martin Rudalics <rudalics@gmx.at>
8433
8434 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8435 that FOCUS-FRAME can be omitted.
8436
8437 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8438
8439 Adjust buffer text indirection counters at the end of Fkill_buffer.
8440 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8441 buffer is definitely dead. This should really fix an issue reported
8442 by Christoph Scholtes again. (Bug#12007).
8443 (init_buffer_once): Initialize indirection counters of
8444 buffer_defaults and buffer_local_symbols (for sanity and safety).
8445
8446 2012-07-24 Eli Zaretskii <eliz@gnu.org>
8447
8448 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8449 and continuation glyphs on tooltip frames, leave them at zero.
8450 Avoids continued lines in tooltips. (Bug#11832)
8451
8452 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8453
8454 Simplify copy_overlay.
8455 * buffer.c (copy_overlay): Simplify. Use build_marker.
8456 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8457
8458 2012-07-23 Eli Zaretskii <eliz@gnu.org>
8459
8460 * print.c (print_object): Don't crash when a frame's name is nil
8461 or invalid. (Bug#12025)
8462
8463 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8464 it signals an error when a tooltip frame is being created.
8465
8466 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8467
8468 Cleanup miscellaneous objects allocation and initialization.
8469 * alloc.c (allocate_misc): Change to static. Add argument to
8470 specify the subtype. Adjust comment and users.
8471 (build_overlay): New function.
8472 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8473 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8474 (allocate_misc): Remove prototype.
8475 (build_overlay): Add prototype.
8476
8477 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8478
8479 Swap buffer text indirection counters in Fbuffer_swap_text.
8480 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8481 This avoids crash reported by Christoph Scholtes at
8482 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8483
8484 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8485
8486 * nsmenu.m (Popdown_data): New struct.
8487 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8488 free Popdown_data.
8489 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8490 (initWithContentRect): Make imgView and contentView non-static
8491 and autorelease them. Also autorelease img and matrix (Bug#12005).
8492 (dealloc): Remove (Bug#12005).
8493
8494 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8495
8496 Adjust consing_since_gc when objects are explicitly freed.
8497 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8498 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8499 (free_cons, free_misc): Subtract object size from consing_since_gc.
8500
8501 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8502
8503 Simplify and cleanup markers positioning code.
8504 * marker.c (attach_marker): More useful eassert.
8505 (live_buffer, set_marker_internal): New function.
8506 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8507 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8508
8509 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8510
8511 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8512 as it's limited by the amount of memory, not by INT_MAX.
8513
8514 2012-07-21 Eli Zaretskii <eliz@gnu.org>
8515
8516 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8517 in special-event-map. See the discussion at
8518 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8519 for the reasons.
8520
8521 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8522 info.dwItemData. Fixes crashes on 64-bit Windows.
8523 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8524
8525 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8526
8527 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
8528 (conversationIdentifier): Return value is NSInteger.
8529 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8530
8531 2012-07-21 Chong Yidong <cyd@gnu.org>
8532
8533 * window.c (decode_any_window): Signal an error if the window is
8534 on a dead frame (Bug#11984).
8535
8536 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8537
8538 Add indirection counting to speed up Fkill_buffer.
8539 * buffer.h (struct buffer): New member.
8540 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8541 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8542 base buffer indirection counter.
8543 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8544 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8545 through buffer list if indirection counter is 0.
8546
8547 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8548
8549 Extend the value returned by Fgarbage_collect with heap statistics.
8550 * alloc.c (Qheap): New symbol.
8551 (syms_of_alloc): DEFSYM it.
8552 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8553 (Fmemory_free): Remove.
8554 (syms_of_alloc): Don't defsubr it.
8555 * buffer.c (Fcompact_buffer): Remove.
8556 (syms_of_buffer): Don't defsubr it.
8557
8558 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8559
8560 Make maybe_gc inline.
8561 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8562 * lisp.h (consing_since_gc, gc_relative_threshold)
8563 (memory_full_cons_threshold): Revert declaration.
8564 (maybe_gc): Remove prototype, define as inline.
8565 * alloc.c: Remove old commented-out code.
8566 (consing_since_gc, gc_relative_threshold)
8567 (memory_full_cons_threshold): Revert to global.
8568 (maybe_gc): Remove.
8569
8570 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8571
8572 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8573 * lisp.h (build_unibyte_string): New function.
8574 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8575 * sysdep.c, w32fns.c, xfns.c: Use it.
8576 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8577 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8578 Adjust users accordingly.
8579 * font.h (font_open_by_name): Adjust prototype.
8580
8581 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8582
8583 Cleanup calls to Fgarbage_collect.
8584 * lisp.h (maybe_gc): New prototype.
8585 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8586 Remove declarations.
8587 * alloc.c (maybe_gc): New function.
8588 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8589 Make them static.
8590 * bytecode.c (MAYBE_GC): Use maybe_gc.
8591 * eval.c (eval_sub, Ffuncall): Likewise.
8592 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8593 to avoid dependency from auto-save feature.
8594
8595 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8596
8597 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8598 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8599 'for_each_per_buffer_object_at'.
8600 All uses changed. It's better to use upper-case for macros that
8601 cannot be implemented as functions, to give the reader a clue
8602 that they're special.
8603
8604 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8605
8606 * alloc.c (Fgarbage_collect): Tweak docstring.
8607
8608 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8609
8610 Tweak the value returned from Fgarbage_collect again.
8611 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8612 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8613 Adjust documentation.
8614 (total_vector_bytes): Rename to total_vector_slots, adjust
8615 accounting.
8616 (total_free_vector_bytes): Rename to total_free_vector_slots,
8617 adjust accounting.
8618 (Qstring_bytes, Qvector_slots): New symbols.
8619 (syms_of_alloc): DEFSYM them.
8620
8621 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8622
8623 Buffer compaction primitive which may be used from Lisp.
8624 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8625 (syms_of_buffer): Register Fcompact_buffer.
8626 * alloc.c (Fgarbage_collect): Use compact_buffer.
8627 * buffer.h (compact_buffer): New prototype.
8628 (struct buffer_text): New member.
8629
8630 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8631
8632 New macro to iterate over all buffers, miscellaneous cleanups.
8633 * lisp.h (all_buffers): Remove declaration.
8634 * buffer.h (all_buffers): Add declaration, with comment.
8635 (for_each_buffer): New macro.
8636 * alloc.c (Fgarbage_collect, mark_object): Use it.
8637 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8638 (init_buffer): Likewise.
8639 * data.c (Fset_default): Likewise.
8640 * coding.c (code_conversion_restore): Remove redundant check
8641 for dead buffer.
8642 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8643
8644 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8645
8646 Fix bug that created negative-length intervals.
8647 * intervals.c (merge_interval_right, merge_interval_left):
8648 Do not zero out this interval if it is absorbed by its children,
8649 as this interval's total length doesn't change in that case. See
8650 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8651
8652 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8653
8654 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8655 when invoking (make-bool-vector N t) and N is a positive
8656 multiple of 8 -- the last 8 bits were mistakenly cleared.
8657
8658 Remove some struct layout assumptions in bool vectors.
8659 * alloc.c (bool_header_size): New constant.
8660 (header_size, word_size): Move earlier, as they're now used earlier.
8661 Use 'word_size' in a few more places, where it's appropriate.
8662 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8663 padding before the data member of a bool vector.
8664 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8665 than doing the check by hand with an abort ().
8666
8667 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8668
8669 * eval.c (Fdefvar): Don't check constants since we only set the var if
8670 it's not yet defined anyway (bug#11904).
8671
8672 * lisp.h (last_undo_boundary): Declare new var.
8673 * keyboard.c (command_loop_1): Set it.
8674 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8675 were auto-added by the command loop (bug#11774).
8676
8677 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8678
8679 * w32font.c (Qsymbol): Remove local definition.
8680 (syms_of_w32font): Don't DEFSYM it.
8681
8682 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8683
8684 Fix sweep_vectors to handle large bool vectors correctly.
8685 * alloc.c (sweep_vectors): Account total_vector_bytes for
8686 bool vectors larger than VBLOCK_BYTES_MAX.
8687
8688 2012-07-18 Chong Yidong <cyd@gnu.org>
8689
8690 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8691 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8692
8693 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8694
8695 Return more descriptive data from Fgarbage_collect.
8696 Suggested by Stefan Monnier in
8697 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8698 * alloc.c (bounded_number): New function.
8699 (total_buffers, total_vectors): New variable.
8700 (total_string_size): Rename to total_string_bytes, adjust users.
8701 (total_vector_size): Rename to total_vector_bytes, adjust users.
8702 (sweep_vectors): Account total_vectors and total_vector_bytes.
8703 (Fgarbage_collect): New return value. Adjust documentation.
8704 (gc_sweep): Account total_buffers.
8705 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8706 (VECTOR_SIZE): Remove.
8707 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8708 (Qinterval, Qmisc): New symbols.
8709 (syms_of_data): Initialize them.
8710 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8711 (Qcons, Qbuffer): New declarations.
8712
8713 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8714
8715 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8716 Round up, not down. Improve doc.
8717
8718 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8719
8720 Restore old code in allocate_string_data to avoid Faset breakage.
8721 Reported by Julien Danjou <julien@danjou.info> in
8722 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8723 * alloc.c (allocate_string_data): Restore old code with minor
8724 adjustments, fix comment to explain this subtle issue.
8725
8726 2012-07-17 Eli Zaretskii <eliz@gnu.org>
8727
8728 Remove FILE_SYSTEM_CASE.
8729 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8730
8731 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8732 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8733 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8734 call-process-region passes it through expand-file-name.
8735
8736 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8737
8738 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8739
8740 Fix crash when creating indirect buffer (Bug#11917)
8741 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8742 Don't handle unbound variables specially if non-zero.
8743 (Fbuffer_local_variables): Pass zero.
8744 (clone_per_buffer_values): Pass non-zero.
8745
8746 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8747
8748 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8749 to make the loop interruptible.
8750
8751 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8752
8753 * gnutls.c (emacs_gnutls_handshake): Only retry if
8754 GNUTLS_E_INTERRUPTED.
8755
8756 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8757
8758 Cleanup and convert miscellaneous checks to eassert.
8759 * alloc.c (mark_interval): Fix comment, partially rephrase
8760 old comment from intervals.h (see below).
8761 * intervals.c (find_interval, adjust_intervals_for_insertion)
8762 (delete_interval, adjust_intervals_for_deletion)
8763 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8764 Convert to eassert.
8765 (adjust_intervals_for_insertion, make_new_interval):
8766 Remove obsolete and unused code.
8767 * intervals.h (struct interval): Remove obsolete comment.
8768 * textprotp.c (erase_properties): Remove unused code.
8769 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8770 (Fremove_list_of_text_properties): Convert to eassert.
8771
8772 2012-07-17 Chong Yidong <cyd@gnu.org>
8773
8774 * editfns.c (Finsert_char): Doc fix.
8775
8776 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8777
8778 Fix previous change to make Fmemory_free always accurate.
8779 * alloc.c (make_interval): Update total_free_intervals.
8780 (make_float): Likewise for total_free_floats.
8781 (free_cons, Fcons): Likewise for total_free_conses.
8782 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8783 Likewise for total_free_vector_bytes.
8784 (Fmake_symbol): Likewise for total_free_symbols.
8785 (bytes_free): Remove.
8786
8787 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8788
8789 Simple free memory accounting feature.
8790 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8791 (sweep_vectors): Accumulate size of free vectors.
8792 (Fgarbage_collect): Setup bytes_free.
8793 (Fmemory_free): New function.
8794 (syms_of_alloc): Register it.
8795
8796 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8797
8798 Cleanup overlays checking.
8799 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8800 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8801 eassert and OVERLAYP.
8802 (sort_overlays): Change to use OVERLAYP.
8803
8804 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8805
8806 * editfns.c (Finsert_char): Make it interactive, and make the
8807 second arg optional. Copy interactive spec and docstring from
8808 ucs-insert.
8809
8810 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8811
8812 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8813 Unlike the other wrapped functions, fabs has an unspecified
8814 effect on errno.
8815
8816 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8817
8818 * nsterm.m (keyDown): Interpret flags without left/right bits
8819 as the left key (Bug#11670).
8820
8821 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8822
8823 Remove empty and useless init functions.
8824 * lisp.h (init_character_once, init_fns, init_image)
8825 (init_filelock, init_sound): Remove prototype.
8826 * character.c (init_character_once): Remove.
8827 * filelock.c (init_filelock): Likewise.
8828 * fns.c (init_fns): Likewise.
8829 * image.c (init_image): Likewise.
8830 * sound.c (init_sound): Likewise.
8831 * emacs.c (main): Adjust accordingly.
8832
8833 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8834
8835 * gtkutil.h: Tiny cleanups.
8836 (use_old_gtk_file_dialog): Remove useless declaration.
8837 (xg_uses_old_file_dialog): Add suggested const attribute.
8838
8839 2012-07-15 Eli Zaretskii <eliz@gnu.org>
8840
8841 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8842 (bidi_paragraph_init): Use it to limit search forward for a strong
8843 directional character in abnormally large paragraphs full of
8844 neutral or weak characters. (Bug#11943)
8845
8846 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8847
8848 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8849 the toolbar (Bug#9451).
8850 (xg_make_tool_item): Give the widget event box a transparent
8851 background.
8852
8853 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8854
8855 Cleanup basic allocation variables and functions.
8856 * alloc.c (ignore_warnings, init_intervals, init_float)
8857 (init_cons, init_symbol, init_marker): Remove.
8858 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8859 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8860 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8861 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8862 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8863 (staticidx, init_alloc_once, init_strings, free_ablock):
8864 Remove redundant initialization.
8865 * fns.c (init_weak_hash_tables): Remove.
8866 * lisp.h (init_weak_hash_tables): Remove prototype.
8867
8868 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8869
8870 Use zero_vector where appropriate.
8871 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8872 accordingly.
8873 * lisp.h (zero_vector): New declaration.
8874 * font.c (null_vector): Remove.
8875 (syms_of_font): Remove initialization and staticpro.
8876 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8877 * keymap.c (Faccessible_keymaps): Likewise.
8878
8879 2012-07-15 Leo Liu <sdl.web@gmail.com>
8880
8881 * fringe.c: Fix typo in comments.
8882
8883 2012-07-14 Leo Liu <sdl.web@gmail.com>
8884
8885 * fringe.c: Add a new bitmap exclamation-mark.
8886
8887 2012-07-14 Eli Zaretskii <eliz@gnu.org>
8888
8889 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8890
8891 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8892 (HAVE_MENUS): Don't define, defined by editing config.in with
8893 msdos/sed2v2.inp.
8894 (GMALLOC_INHIBIT_VALLOC): Don't define.
8895 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8896
8897 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
8898
8899 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8900
8901 2012-07-14 Glenn Morris <rgm@gnu.org>
8902
8903 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8904 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8905 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8906
8907 2012-07-13 Glenn Morris <rgm@gnu.org>
8908
8909 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8910
8911 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8912 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8913
8914 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8915
8916 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8917 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8918 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8919 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8920 where appropriate.
8921 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8922 as boolean expression.
8923 (x_set_window_size): Remove unused variable toolbar.
8924 (ns_get_color_default, ns_mod_to_lisp): Remove.
8925 (ns_mouse_position): Remove unused variables xchar and ychar.
8926 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8927 (ns_set_vertical_scroll_bar): Remove unused variable count.
8928 (ns_delete_terminal): Remove unused variable i.
8929 (ns_term_init): Remove unused variables r, g and b.
8930 (mouseDown): Remove unused variable window.
8931 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8932 (initFrameFromEmacs): Remove unused variable vbextra.
8933 (mouseEntered): Remove unused variables p and dpyinfo.
8934 (mouseExited): Remove unused variables p and r.
8935 (ns_define_frame_cursor, ns_clear_frame_area)
8936 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8937 (menuDown): Assign [sender tag] to variable and cast the variable.
8938
8939 * nsterm.h (menuDown): Add id as type to argument sender.
8940 (ns_display_info_for_name): Add Lisp_Object argument.
8941 (ns_term_init): Add Lisp_Object argument.
8942 (ns_map_event_to_object): Add void argument.
8943 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8944 prototype with arguments and only declare if __OBJC__.
8945 (nxatoms_of_nsselect): Add void argument.
8946 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8947 (ns_alloc_autorelease_pool): Add void argument.
8948 (ns_release_autorelease_pool): Add void* argument.
8949 (ns_get_defaults_value): Add const char* argument.
8950
8951 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8952 (initFromContents): Use SSDATA where appropriate.
8953 (ns_update_menubar): Add braces to ambigous if-else.
8954 (initWithTitle): Put () around assignment in if statement.
8955 (ns_menu_show): Remove unused variables window and keymap.
8956 (update_frame_tool_bar): Remove unused variable selected_p.
8957 (initWithContentRect): Remove unused variable this_cmd_name.
8958
8959 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8960 appropriate.
8961 (setXBMColor): Remove unused variable len.
8962 (setPixmapData): Put () around assignment in loop statement.
8963
8964 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8965 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8966 where appropriate.
8967 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8968 around assignment in loop statement.
8969 (nsfont_open): Remove unused variable i.
8970 (nsfont_open): Remove unused variable len.
8971 (nsfont_draw): Remove unused variable cs.
8972
8973 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8974 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8975 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8976 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8977 (Fns_font_name, Fns_perform_service)
8978 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8979 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8980 (ns_set_name): Remove unused variable view.
8981 (x_set_menu_bar_lines): Remove unused variable olines.
8982 (x_set_tool_bar_lines): Remove unused variable root_window.
8983 (Fns_list_colors): Put () around assignment in while statement.
8984 (Fns_perform_service): Remove unused variable len.
8985 (Fns_display_usable_bounds): Remove unused variable top.
8986 (syms_of_nsfns): Remove unused variable i.
8987
8988 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
8989 memcpy (Bug#11907).
8990
8991 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
8992
8993 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
8994 and free it with DestroyExceptionInfo (Bug#11558).
8995
8996 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
8997
8998 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
8999 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9000 Set here, not in nt/config.nt.
9001
9002 2012-07-13 Eli Zaretskii <eliz@gnu.org>
9003
9004 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9005 cursor overflow into the last glyph on display line when the right
9006 fringe is off. (Bug#11832)
9007
9008 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9009
9010 * xdisp.c (produce_special_glyphs): Now static.
9011 * dispextern.h (produce_special_glyphs): Remove decl.
9012
9013 2012-07-13 Glenn Morris <rgm@gnu.org>
9014
9015 * s/bsd-common.h, s/cygwin.h: Remove empty files.
9016 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9017
9018 * s/usg5-4-common.h (USG, USG5):
9019 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9020 * s/sol2-6.h (SOLARIS2):
9021 * s/irix6-5.h (IRIX6_5):
9022 * s/hpux10-20.h (USG, USG5, HPUX):
9023 * s/gnu-linux.h (USG, GNU_LINUX):
9024 * s/freebsd.h (BSD_SYSTEM):
9025 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9026 * s/cygwin.h (CYGWIN):
9027 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9028 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9029
9030 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
9031
9032 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9033
9034 2012-07-13 Glenn Morris <rgm@gnu.org>
9035
9036 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9037
9038 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9039
9040 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9041 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9042
9043 2012-07-12 Glenn Morris <rgm@gnu.org>
9044
9045 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9046
9047 * process.c (init_process_emacs): Rename from init_process.
9048 The old name is also the name of a Mach system call.
9049 * lisp.h, emacs.c: Update for this name change.
9050 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9051 longer needed.
9052
9053 2012-07-12 Eli Zaretskii <eliz@gnu.org>
9054
9055 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9056 memmove call that removes glyphs covered by the left truncation
9057 glyph. Improve commentary.
9058 (display_line): Fix display of continuation glyphs on GUI frames
9059 when the right fringe is turned off and variable-size fonts are
9060 used in the window. Move the code that appends a stretch glyph to
9061 produce_special_glyphs, so that it could be used for truncation
9062 and continuation glyphs alike.
9063 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9064 glyph of a suitably computed width, to align the special glyphs at
9065 the window margin. Code moved from display_line. (Bug#11832)
9066
9067 2012-07-12 Glenn Morris <rgm@gnu.org>
9068
9069 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9070
9071 * s/gnu-linux.h, s/hpux10-20.h:
9072 Do not unconditionally define HAVE_XRMSETDATABASE.
9073
9074 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9075
9076 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9077
9078 Fix typos that broke OS X build.
9079 Reported by Randal L. Schwartz in
9080 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9081 * nsterm.m (ns_timeout): Add missing local decl.
9082 (ns_get_color): snprintf -> sprintf, to fix typo.
9083
9084 2012-07-12 Glenn Morris <rgm@gnu.org>
9085
9086 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9087 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9088 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9089 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9090
9091 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9092 Move PTY_OPEN to configure.
9093
9094 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9095 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9096 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9097
9098 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9099
9100 Use empty_unibyte_string where applicable.
9101 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9102 * lread.c (read1): Likewise.
9103 * xsettings.c (syms_of_xsettings): Likewise.
9104
9105 2012-07-12 Glenn Morris <rgm@gnu.org>
9106
9107 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9108 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9109 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9110 * s/hpux10-20.h (RUN_TIME_REMAP):
9111 * s/bsd-common.h (TABDLY): Move to configure.
9112
9113 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9114
9115 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9116
9117 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9118 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9119
9120 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9121
9122 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9123 * s/template.h: Move NARROWPROTO to configure.
9124
9125 2012-07-11 Glenn Morris <rgm@gnu.org>
9126
9127 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9128 unused since 2011-01-17 change to systty.h.
9129
9130 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9131 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9132 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9133
9134 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9137
9138 2012-07-11 Glenn Morris <rgm@gnu.org>
9139
9140 * s/darwin.h, s/gnu-linux.h, s/template.h:
9141 Move INTERRUPT_INPUT to configure.
9142
9143 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9144
9145 Minor adjustments to interning code.
9146 * lisp.h (intern, intern_c_string): Redefine as static inline
9147 wrappers for intern_1 and intern_c_string_1, respectively.
9148 (intern_1, intern_c_string_1): Rename prototypes.
9149 * lread.c (intern_1, intern_c_string_1, oblookup):
9150 Simplify Vobarray checking.
9151 * font.c (font_intern_prop): Likewise. Adjust comment.
9152 * w32font.c (intern_font_name): Likewise.
9153
9154 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9155
9156 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9157
9158 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9159 of Fcar/Fcdr if possible.
9160 * font.c (check_otf_features): Likewise.
9161 * fontset.c (Fnew_fontset): Likewise.
9162 * gnutls.c (Fgnutls_boot): Likewise.
9163 * minibuf.c (read_minibuf): Likewise.
9164 * msdos.c (IT_set_frame_parameters): Likewise.
9165 * xmenu.c (Fx_popup_dialog): Likewise.
9166 * w32menu.c (Fx_popup_dialog): Likewise.
9167
9168 2012-07-11 Glenn Morris <rgm@gnu.org>
9169
9170 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9171 since nothing has defined it on these platforms.
9172
9173 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9174 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9175
9176 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9177 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9178 Move CLASH_DETECTION to configure.
9179
9180 * s/gnu.h: Remove file, which is now empty.
9181
9182 * s/gnu.h, s/gnu-linux.h:
9183 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9184
9185 2012-07-11 John Wiegley <johnw@newartisans.com>
9186
9187 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9188 function attribute, so we only use it if it exists in the
9189 compiler.
9190
9191 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9192
9193 Avoid call to strlen in fast_c_string_match_ignore_case.
9194 * search.c (fast_c_string_match_ignore_case): Change to use
9195 length argument. Adjust users accordingly.
9196 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9197
9198 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9199
9200 Assume mkdir, rmdir.
9201 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9202 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9203
9204 Assume rename.
9205 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9206
9207 Assume perror.
9208 * s/hpux10-20.h (HAVE_PERROR): Remove.
9209 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9210 Remove dummy definition, as this problem was obsolete long ago.
9211
9212 Assume strerror.
9213 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9214
9215 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9216
9217 Avoid calls to strlen in font processing functions.
9218 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
9219 (font_open_by_name): Change to use length argument.
9220 Adjust users accordingly.
9221 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9222 Adjust prototypes.
9223 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9224 Change to return ptrdiff_t.
9225 (xfont_list_pattern, xfont_match): Use length returned by
9226 xfont_decode_coding_xlfd.
9227 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9228
9229 2012-07-11 Glenn Morris <rgm@gnu.org>
9230
9231 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9232 Move DONT_REOPEN_PTY to configure.
9233
9234 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9235 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9236
9237 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9238
9239 Remove "#define unix" that is no longer needed (Bug#11905).
9240 * s/aix4-2.h (unix): Remove; no longer needed.
9241
9242 EMACS_TIME simplification (Bug#11875).
9243 This replaces macros (which typically do not work in GDB)
9244 with functions, typedefs and enums, making the code easier to debug.
9245 The functional style also makes code easier to read and maintain.
9246 * systime.h: Include <sys/time.h> on all hosts, not just if
9247 WINDOWSNT, since 'struct timeval' is needed in general.
9248 (EMACS_TIME): Now a typedef, not a macro.
9249 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9250 not macros.
9251 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9252 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9253 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9254 (EMACS_TIME_LE): Now functions, not macros.
9255 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9256 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9257 which are not functions. All uses rewritten to use:
9258 (make_emacs_time): New function.
9259 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9260 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9261 not functions. All uses rewritten to use the following, respectively:
9262 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9263 (add_emacs_time, sub_emacs_time): New functions.
9264 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
9265 * fileio.c (Fcopy_file):
9266 * xterm.c (XTflash): Get the current time closer to when it's used.
9267 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9268
9269 * bytecode.c (targets): Suppress -Woverride-init warnings.
9270
9271 Simplify by avoiding confusing use of strncpy etc.
9272 * doc.c (Fsnarf_documentation):
9273 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9274 * frame.c (Fmake_terminal_frame):
9275 * gtkutil.c (get_utf8_string):
9276 * lread.c (openp):
9277 * nsmenu.m (ns_update_menubar):
9278 * regex.c (regerror):
9279 Prefer memcpy to strncpy and strncat when either will do.
9280 * fileio.c (Fsubstitute_in_file_name):
9281 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9282 (menu_separator_name_p):
9283 * nsmenu.m (ns_update_menubar):
9284 Prefer memcmp to strncmp when either will do.
9285 * nsterm.m: Include <ftoastr.h>.
9286 (ns_get_color):
9287 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9288 Prefer snprintf to strncpy.
9289 * nsterm.m (ns_term_init):
9290 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9291 * nsterm.m (ns_term_init):
9292 Avoid the need for strncpy, by using build_string or
9293 make_unibyte_string directly. Use dtoastr, not snprintf.
9294 * process.c (Fmake_network_process): Diagnose service names that
9295 are too long, rather than silently truncating them or creating
9296 non-null-terminated names.
9297 (Fnetwork_interface_info): Likewise, for interface names.
9298 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9299 Prefer sprintf to strncat.
9300 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9301 Prefer vsnprintf to vsprintf + strncpy.
9302
9303 2012-07-10 Glenn Morris <rgm@gnu.org>
9304
9305 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9306 Clarify fallback case.
9307
9308 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9309
9310 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9311 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9312 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
9313 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
9314 where argument type is known to be a Lisp_Cons.
9315
9316 2012-07-10 Tom Tromey <tromey@redhat.com>
9317
9318 * bytecode.c (BYTE_CODE_THREADED): New macro.
9319 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9320 (enum byte_code_op): New type.
9321 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9322 (exec_byte_code): Use them. Use token threading when applicable.
9323
9324 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9325
9326 Optimize pure C strings initialization.
9327 * lisp.h (make_pure_string): Fix prototype.
9328 (build_pure_c_string): New function, defined as static inline. This
9329 provides a better opportunity to optimize away calls to strlen when
9330 the function is called with compile-time constant argument.
9331 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9332 argument, adjust users accordingly. Use build_pure_c_string where
9333 appropriate.
9334 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9335 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9336 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9337
9338 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9339
9340 Avoid calls to strlen in miscellaneous functions.
9341 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9342 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9343 * lread.c (openp): Likewise.
9344
9345 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9346
9347 Avoid calls to strlen in path processing functions.
9348 * fileio.c (file_name_as_directory): Add comment. Change to add
9349 srclen argument and return the length of result. Adjust users
9350 accordingly.
9351 (directory_file_name): Fix comment. Change to add srclen argument,
9352 swap 1st and 2nd arguments to obey the common convention.
9353 Adjust users accordingly.
9354 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9355
9356 2012-07-10 Glenn Morris <rgm@gnu.org>
9357
9358 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9359 Move PENDING_OUTPUT_COUNT definition to configure.
9360
9361 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9362 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9363 * s/gnu.h (DATA_START): Move definitions to configure.
9364
9365 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9366 We include usg5-4-common.h, which defines them both.
9367
9368 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9369 O_RDONLY already includes it).
9370
9371 Stop ns builds setting the EMACSLOADPATH environment variable.
9372 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9373 Now it does not set EMACSLOADPATH, just returns the load-path string.
9374 * nsterm.h: Update accordingly.
9375 * lread.c [HAVE_NS]: Include nsterm.h.
9376 (init_lread) [HAVE_NS]: Use ns_load_path.
9377 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9378
9379 2012-07-09 Glenn Morris <rgm@gnu.org>
9380
9381 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9382 since the included bsd-common.h does so.
9383
9384 Stop ns builds setting the EMACSPATH environment variable.
9385 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9386 (ns_init_paths): Do not set EMACSPATH.
9387 * nsterm.h (ns_exec_path): Add it.
9388 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9389 Use ns_exec_path.
9390
9391 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9392
9393 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9394
9395 * process.c (wait_reading_process_output): 'waitchannels' was unset
9396 when read_kbd || !NILP (wait_for_cell); fix this.
9397
9398 Add GCC-style 'const' attribute to functions that can use it.
9399 * character.h (char_resolve_modifier_mask):
9400 * keyboard.h (make_ctrl_char):
9401 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9402 (init_character_once, next_almost_prime, init_fns, init_image)
9403 (flush_pending_output, init_sound):
9404 * mem-limits.h (start_of_data):
9405 * menu.h (finish_menu_items):
9406 Add ATTRIBUTE_CONST.
9407 * emacs.c (DEFINE_DUMMY_FUNCTION):
9408 Declare the dummy function with ATTRIBUTE_CONST.
9409 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9410 Add decls with ATTRIBUTE_CONST.
9411
9412 Minor improvements to make_formatted_string.
9413 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9414 where int is good enough, as vsprintf returns an int.
9415 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9416
9417 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9418
9419 Use make_formatted_string to avoid double length calculation.
9420 * lisp.h (make_formatted_string): New prototype.
9421 * alloc.c (make_formatted_string): New function.
9422 * buffer.c (Fgenerate_new_buffer_name): Use it.
9423 * dbusbind.c (syms_of_dbusbind): Likewise.
9424 * editfns.c (Fcurrent_time_zone): Likewise.
9425 * filelock.c (get_boot_time): Likewise.
9426 * frame.c (make_terminal_frame, set_term_frame_name)
9427 (x_report_frame_params): Likewise.
9428 * image.c (gs_load): Likewise.
9429 * minibuf.c (get_minibuffer): Likewise.
9430 * msdos.c (dos_set_window_size): Likewise.
9431 * process.c (make_process): Likewise.
9432 * xdisp.c (ensure_echo_area_buffers): Likewise.
9433 * xsettings.c (apply_xft_settings): Likewise.
9434
9435 2012-07-09 Glenn Morris <rgm@gnu.org>
9436
9437 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9438 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9439 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9440 * nsterm.h (ns_etc_directory): Add it.
9441 * callproc.c [HAVE_NS]: Include nsterm.h.
9442 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9443
9444 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9445
9446 Move marker debugging code under MARKER_DEBUG.
9447 * marker.c (MARKER_DEBUG): Move marker debugging code under
9448 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9449 for bootstrap with --enable-checking (~3x slowdown reported
9450 by Juanma Barranquero <lekktu@gmail.com>).
9451 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9452
9453 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9454
9455 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9456 See <http://bugs.gnu.org/11825#29>.
9457
9458 2012-07-08 Eli Zaretskii <eliz@gnu.org>
9459
9460 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9461 has no font, use the frame's font. (Bug#11813)
9462 (display_line): Add commentary about displaying truncation glyphs
9463 on GUI frames.
9464 (produce_special_glyphs): Move here from term.c.
9465
9466 * term.c (produce_special_glyphs): Move to xdisp.c.
9467
9468 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9469 section.
9470
9471 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9472
9473 * xdisp.c (display_line): Avoid warning about implicit declaration
9474 of FRAME_FONT.
9475
9476 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9477
9478 * lisp.h: Remove empty conditional.
9479
9480 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9481
9482 * lread.c (load_path_check): Now static.
9483
9484 Fix some minor --with-ns problems found by static checking.
9485 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9486 (x_set_font) [!HAVE_X_WINDOWS]:
9487 * image.c (xpm_load_image) [HAVE_NS]:
9488 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9489 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9490 Remove unused local.
9491 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9492 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9493 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9494 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9495 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9496 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9497 Fix pointer signedness problem.
9498 * xfaces.c (FRAME_X_FONT_TABLE):
9499 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9500
9501 2012-07-07 Glenn Morris <rgm@gnu.org>
9502
9503 * lread.c (load_path_check): New function, split from init_lread.
9504 (init_lread): Reorganize. Motivation:
9505 If EMACSLOADPATH is set, check/warn about that rather than the
9506 defaults, which we are not going to use. Hence we can remove
9507 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9508 Don't warn if site-lisp directories are missing.
9509 If not installed, start from a blank load-path, since
9510 PATH_LOADSEARCH refers to the eventual installation directories.
9511
9512 2012-07-07 Eli Zaretskii <eliz@gnu.org>
9513
9514 Support truncation and continuation glyphs on GUI frames, when
9515 fringes are disabled. (Bug#11832)
9516 * xdisp.c (init_iterator): Get dimensions of truncation and
9517 continuation glyphs even if on GUI frames.
9518 Adjust it->last_visible_x on GUI frames when the left or right fringes,
9519 or both, are absent.
9520 (start_display, move_it_in_display_line_to): Handle the case of a
9521 GUI frame without a fringe to display continuation or truncation
9522 glyphs.
9523 (insert_left_trunc_glyphs): Support GUI frames: make sure
9524 truncation glyphs overwrite enough glyphs from the current line to
9525 have sufficient space in pixels.
9526 (display_line): Support truncation and continuation glyphs on GUI
9527 frames. If some spare pixels are left on the line after inserting
9528 the truncation glyphs, fill that space with a stretch glyph of a
9529 suitably computed width.
9530
9531 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9532 produce_glyphs, to support GUI sessions.
9533
9534 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9535
9536 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9537
9538 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9539
9540 Do not require float-time's arg to fit in time_t (Bug#11825).
9541 This works better on hosts where time_t is unsigned, and where
9542 float-time is applied to the (negative) difference between two times.
9543 * editfns.c (decode_time_components): Last arg is now double *,
9544 not int *, and means to store all the result as a double, without
9545 worrying about whether the seconds part fits in time_t.
9546 All callers changed.
9547 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9548 All callers changed.
9549 (Ffloat_time): Do not fail merely because the specified time falls
9550 outside of time_t range.
9551
9552 2012-07-07 Glenn Morris <rgm@gnu.org>
9553
9554 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9555 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9556 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9557
9558 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
9559
9560 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9561 Update dependencies.
9562
9563 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9564
9565 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9566
9567 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9568 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9569 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9570 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9571 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9572 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9573
9574 * xfont.c (compare_font_names): Redo to omit the need for casts.
9575
9576 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9577
9578 * xfns.c (Fx_change_window_property): Doc fix.
9579 * w32fns.c (Fx_change_window_property): Doc fix.
9580
9581 * w32fns.c (Fx_window_property): Accept the same arguments as the
9582 X Windows version. Doc fix.
9583 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9584
9585 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
9586 Eli Zaretskii <eliz@gnu.org>
9587
9588 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9589 Windows-specific code from nt/config.nt moved here.
9590 Obsolete settings removed.
9591
9592 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9593
9594 * process.c: Avoid unnecessary calls to gettime.
9595 (wait_reading_process_output): Don't get the time of day
9596 when gobbling data immediately and not waiting, as there's no need
9597 for it in that case. This removes a FIXME.
9598
9599 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9600
9601 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9602 is defined (Bug#11768).
9603
9604 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9605
9606 Fix marker debugging code.
9607 * marker.c (byte_char_debug_check): Do not perform the check
9608 if buffer is not multibyte.
9609 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9610 Call byte_char_debug_check with correct arguments.
9611
9612 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9613
9614 Compile marker debugging code only if ENABLE_CHECKING is defined.
9615 * marker.c (byte_char_debug_check, count_markers):
9616 Use only if ENABLE_CHECKING is defined.
9617 (byte_debug_flag): Remove.
9618 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9619 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9620
9621 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9622
9623 Avoid code repetition in marker-related functions.
9624 * marker.c (attach_marker): New function.
9625 (Fset_marker, set_marker_restricted, set_marker_both)
9626 (set_marker_restricted_both): Use it.
9627 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9628 Consistently rename charno to charpos.
9629 (marker_position): Add eassert.
9630 (marker_byte_position): Convert to eassert.
9631
9632 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9633
9634 Simplify list operations in unchain_overlay and unchain_marker.
9635 * buffer.c (unchain_overlay): Simplify. Add comment.
9636 * marker.c (unchain_marker): Simplify. Fix comments.
9637
9638 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9639
9640 Introduce fast path for the widely used marker operation.
9641 * alloc.c (build_marker): New function.
9642 * lisp.h (build_marker): New prototype.
9643 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9644 * composite.c (autocmp_chars): Likewise.
9645 * editfns.c (buildmark): Remove.
9646 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9647 (save_restriction_save): Use build_marker.
9648 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9649 * window.c (save_window_save): Likewise.
9650
9651 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9652
9653 Do not use Fdelete_overlay in delete_all_overlays
9654 to avoid redundant calls to unchain_overlay.
9655 * buffer.c (drop_overlay): New function.
9656 (delete_all_overlays, Fdelete_overlay): Use it.
9657 * minibuf.c (get_minibuffer): Fix comment.
9658
9659 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9660
9661 Port to OpenBSD 5.1 amd64.
9662 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9663 This is needed for OpenBSD, and should be harmless on all BSD systems.
9664 Also, include <sys/sysctl.h>, as it should be available on all
9665 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9666 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9667 use p_pid member, not kp_proc.pid.
9668
9669 2012-07-06 Glenn Morris <rgm@gnu.org>
9670
9671 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9672
9673 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9674
9675 More xmalloc and related cleanup.
9676 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9677 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9678 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9679 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9680 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9681 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9682 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9683 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9684 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9685 * xterm.c:
9686 Omit needless casts involving void * pointers and allocation.
9687 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9688 as the former is more robust if P's type is changed.
9689 Prefer xzalloc to xmalloc + memset 0.
9690 Simplify malloc-or-realloc to realloc.
9691 Don't worry about xmalloc returning a null pointer.
9692 Prefer xstrdup to xmalloc + strcpy.
9693 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9694 growing it.
9695 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9696 alloca of a constant.
9697
9698 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9699
9700 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9701 hscroll is larger than the line width. Fixes long and futile
9702 looping inside extend_face_to_end_of_line (on a TTY) producing
9703 glyphs that are not needed and thrown away.
9704
9705 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9706
9707 * marker.c (set_marker_restricted_both): Simplify by using
9708 clip_to_bounds.
9709
9710 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9713
9714 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9715
9716 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9717 not defined (Bug#11768).
9718 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9719 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9720 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9721 followed by gtk_box_set_homogeneous (Bug#11768).
9722 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
9723 (update_theme_scrollbar_width, xg_create_scroll_bar):
9724 Use gtk_scrollbar_new (Bug#11768).
9725 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9726 (is_box_type): New function (Bug#11768).
9727 (xg_tool_item_stale_p): Call is_box_type.
9728 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
9729 with default display (Bug#11768).
9730
9731 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9732
9733 * xdisp.c (window_hscroll_limited): New function.
9734 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9735 coordinates when window's hscroll is set to insanely large
9736 values. (Bug#11857)
9737
9738 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
9739
9740 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9741 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9742
9743 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9744
9745 Cleanup xmalloc.
9746 * lisp.h (xzalloc): New prototype. Omit needless casts.
9747 * alloc.c (xzalloc): New function. Omit needless casts.
9748 * charset.c: Omit needless casts. Convert all calls to
9749 xmalloc with following memset to xzalloc.
9750 * dispnew.c: Likewise.
9751 * fringe.c: Likewise.
9752 * image.c: Likewise.
9753 * sound.c: Likewise.
9754 * term.c: Likewise.
9755 * w32fns.c: Likewise.
9756 * w32font.c: Likewise.
9757 * w32term.c: Likewise.
9758 * xfaces.c: Likewise.
9759 * xfns.c: Likewise.
9760 * xterm.c: Likewise.
9761 * atimer.c: Omit needless casts.
9762 * buffer.c: Likewise.
9763 * callproc.c: Likewise.
9764 * ccl.c: Likewise.
9765 * coding.c: Likewise.
9766 * composite.c: Likewise.
9767 * doc.c: Likewise.
9768 * doprnt.c: Likewise.
9769 * editfns.c: Likewise.
9770 * emacs.c: Likewise.
9771 * eval.c: Likewise.
9772 * filelock.c: Likewise.
9773 * fns.c: Likewise.
9774 * gtkutil.c: Likewise.
9775 * keyboard.c: Likewise.
9776 * lisp.h: Likewise.
9777 * lread.c: Likewise.
9778 * minibuf.c: Likewise.
9779 * msdos.c: Likewise.
9780 * print.c: Likewise.
9781 * process.c: Likewise.
9782 * region-cache.c: Likewise.
9783 * search.c: Likewise.
9784 * sysdep.c: Likewise.
9785 * termcap.c: Likewise.
9786 * terminal.c: Likewise.
9787 * tparam.c: Likewise.
9788 * w16select.c: Likewise.
9789 * w32.c: Likewise.
9790 * w32reg.c: Likewise.
9791 * w32select.c: Likewise.
9792 * w32uniscribe.c: Likewise.
9793 * widget.c: Likewise.
9794 * xdisp.c: Likewise.
9795 * xmenu.c: Likewise.
9796 * xrdb.c: Likewise.
9797 * xselect.c: Likewise.
9798
9799 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9800
9801 * fileio.c (time_error_value): Check the right error number.
9802 Problem reported by Troels Nielsen in
9803 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9804
9805 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9808 This should be fixed in a better way; see Eli Zaretskii in
9809 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9810 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9811
9812 * fileio.c (time_error_value): Rename from special_mtime.
9813 The old name's problems were noted by Eli Zaretskii in
9814 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9815
9816 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9817 This variable's comment says Emacs needs at least one GDB-visible
9818 symbol of type enum pvec_type, to work around GDB problems.
9819 The symbol's value doesn't matter.
9820
9821 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9822 that causes compilation to fail on pre-C99 compilers.
9823
9824 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
9825
9826 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9827 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9828
9829 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9830
9831 * buffer.c (init_buffer_once): Fix initialization of
9832 headers for buffer_defaults and buffer_local_symbols.
9833 Reported by Juanma Barranquero <lekktu@gmail.com>.
9834
9835 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9836
9837 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9838 * lisp.h (enum pvec_type): Use fewer bits.
9839 (PSEUDOVECTOR_SIZE_BITS): New constant.
9840 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9841 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9842 change in pvec_type.
9843 (PSEUDOVECTOR_TYPEP): New macro.
9844 (TYPED_PSEUDOVECTORP): Use it.
9845 * fns.c (internal_equal): Adapt code to extract pvectype.
9846 * emacs.c (gdb_pvec_type): Update type.
9847 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9848 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9849 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9850 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9851 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9852 abusing vector->header.next.nbytes.
9853 (live_vector_p): Use PVEC_TYPE.
9854 (mark_object): Adapt code to extract pvectype. Use switch.
9855
9856 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9857
9858 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9859 Tighten new eassert a bit.
9860
9861 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9862
9863 Fix compilation with --enable-gcc-warnings and -O1
9864 optimization level.
9865 * doprnt.c (doprnt): Change type of tem to int, initialize
9866 to avoid compiler warning. Add eassert.
9867 * search.c (simple_search): Initialize match_byte to avoid
9868 compiler warning. Add eassert.
9869
9870 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9871
9872 Avoid weird behavior with large horizontal scrolls.
9873 Without this change, for example, large hscroll values would
9874 mess up Emacs's display on Fedora 15 x86, presumably due to
9875 overflows in int calculations in the display code.
9876 Also, if buffers had long lines, Emacs would freeze.
9877 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9878 (set_window_hscroll): New function, containing the old guts of
9879 Fset_window_hscroll. Return the clipped value.
9880 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9881 This avoids the need to check against PTRDIFF_MAX.
9882
9883 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9884
9885 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9886
9887 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9888
9889 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9890
9891 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9892 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9893 since GCC 4.4.6 issues a bogus warning for them.
9894
9895 Fix bugs in file timestamp newness comparisons.
9896 * fileio.c (Ffile_newer_than_file_p):
9897 * lread.c (Fload): Use full timestamp resolution of files,
9898 not just the 1-second resolution, so that files that are only
9899 slightly newer still count as newer.
9900 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9901 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9902
9903 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9904
9905 * fileio.c: Improve handling of file time marker. (Bug#11852)
9906 (special_mtime): New function.
9907 (Finsert_file_contents, Fverify_visited_file_modtime):
9908 Use it to set special mtime values consistently.
9909
9910 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9911
9912 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9913 marker for non-existing file. (Bug#11852)
9914
9915 2012-07-03 Glenn Morris <rgm@gnu.org>
9916
9917 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9918 and did not make it into globals.h).
9919
9920 2012-07-03 Tom Tromey <tromey@redhat.com>
9921
9922 * window.c (Fset_window_margins, Fset_window_fringes)
9923 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9924 * textprop.c (Fprevious_property_change): No longer static.
9925 * syntax.c (Fsyntax_table_p): No longer static.
9926 * process.c (Fget_process, Fprocess_datagram_address): No longer
9927 static.
9928 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9929 * keyboard.c (Fcommand_execute): No longer static.
9930 Remove EXFUN.
9931 * insdel.c (Fcombine_after_change_execute): No longer static.
9932 * image.c (Finit_image_library): No longer static.
9933 * fileio.c (Fmake_symbolic_link): No longer static.
9934 * eval.c (Ffetch_bytecode): No longer static.
9935 * editfns.c (Fuser_full_name): No longer static.
9936 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9937 No longer static.
9938 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9939 static.
9940 * dired.c (Ffile_attributes): No longer static.
9941 * composite.c (Fcomposition_get_gstring): No longer static.
9942 * callproc.c (Fgetenv_internal): No longer static.
9943
9944 * ccl.h: Remove EXFUNs.
9945 * buffer.h: Remove EXFUNs.
9946 * dispextern.h: Remove EXFUNs.
9947 * intervals.h: Remove EXFUNs.
9948 * fontset.h: Remove EXFUN.
9949 * font.h: Remove EXFUNs.
9950 * dosfns.c (system_process_attributes): Remove EXFUN.
9951 * keymap.h: Remove EXFUNs.
9952 * lisp.h: Remove EXFUNs.
9953 * w32term.h: Remove EXFUNs.
9954 * window.h: Remove EXFUNs.
9955 * xsettings.h: Remove EXFUN.
9956 * xterm.h: Remove EXFUN.
9957
9958 2012-07-03 Glenn Morris <rgm@gnu.org>
9959
9960 * lisp.h (Frandom): Make it visible to C.
9961 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9962 buffer for invisible buffers. (Bug#1229)
9963
9964 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9965
9966 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9967 values which aren't power of 2.
9968 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
9969 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
9970 accordingly.
9971
9972 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9973
9974 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9975
9976 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9977
9978 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9979
9980 * alloc.c (allocate_vector_block): Remove redundant
9981 calls to mallopt if DOUG_LEA_MALLOC is defined.
9982 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
9983 avoid calls to mallopt if zero_vector is returned.
9984
9985 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9986
9987 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
9988 is enabled, avoid dereferencing NULL current_sblock if
9989 running undumped.
9990
9991 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9992
9993 Cleanup basic buffer management.
9994 * buffer.h (struct buffer): Change layout to use generic vector
9995 marking code. Fix some comments. Change type of 'clip_changed'
9996 to bitfield. Remove unused #ifndef old.
9997 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
9998 (GET_OVERLAYS_AT): Fix indentation.
9999 (for_each_per_buffer_object_at): New macro.
10000 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10001 (Fbuffer_local_variables): Use it.
10002 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10003 * alloc.c (allocate_buffer): Adjust to match new layout of
10004 struct buffer. Fix comment.
10005 (mark_overlay): New function.
10006 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10007 Lisp area of struct buffer.
10008 (mark_object): Use it. Adjust marking of misc objects
10009 and related comments.
10010
10011 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10012
10013 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10014 wrapper that is not needed because the wrapped code is a no-op (zero
10015 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10016 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10017
10018 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10019
10020 * alloc.c (mark_buffer): Simplify. Remove prototype.
10021 (mark_object): Add comment. Reorganize marking of vector-like
10022 objects. Use CHECK_LIVE for all vector-like objects except buffers
10023 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10024 Avoid redundant calls to mark_vectorlike for bool vectors.
10025
10026 2012-06-30 Glenn Morris <rgm@gnu.org>
10027
10028 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10029
10030 * epaths.in (PATH_SITELOADSEARCH): New.
10031 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10032 This is rather than relying on --enable-locallisppath elements
10033 having "site-lisp" in their names. (Bug#10208#25, 11658)
10034
10035 2012-06-30 Eli Zaretskii <eliz@gnu.org>
10036
10037 * w32proc.c (sys_select): Accept and ignore one more argument.
10038
10039 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10040
10041 * sysselect.h [DOS_NT]: Don't include sys/select.h.
10042 (pselect) [!MS_DOS]: Redirect to sys_select.
10043
10044 * sysdep.c: Don't include dos.h and dosfns.h.
10045
10046 * process.c (sys_select):
10047 * msdos.c (sys_select): Accept one more argument and ignore it.
10048
10049 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10050 adapt data types and code to that.
10051
10052 * dosfns.c:
10053 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10054 which clashes with the gnulib function of the same name.
10055
10056 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10057
10058 * font.c (font_style_to_value, font_style_symbolic)
10059 (font_prop_validate_style): Add type checks for values in
10060 font_style_table.
10061
10062 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10063 argument.
10064 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10065 uses.
10066
10067 2012-06-29 Eli Zaretskii <eliz@gnu.org>
10068
10069 * xdisp.c (try_window_id): Undo last change.
10070
10071 * w32.c (getwd): Adjust commentary about startup_dir.
10072 (init_environment): Always call sys_access, even in non-MSVC
10073 builds. Don't chdir to the directory of the Emacs executable.
10074 This undoes code from 1997 which was justified by the need to
10075 "avoid conflicts when removing and renaming directories". But its
10076 downside was that every relative file name was being interpreted
10077 relative to the directory of the Emacs executable, which can never
10078 be TRT. In particular, it broke sys_access when called with
10079 relative file names.
10080 (sys_access): Map GetLastError to errno.
10081
10082 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10083
10084 * window.h (struct window): Change type of 'fringes_outside_margins'
10085 to bitfield. Fix comment. Adjust users accordingly.
10086 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10087 Adjust comment.
10088 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10089 to ptrdiff_t.
10090
10091 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
10092
10093 * gnutls.c (emacs_gnutls_handshake):
10094 Add QUIT to make the loop interruptible.
10095
10096 2012-06-29 Glenn Morris <rgm@gnu.org>
10097
10098 * charset.c (init_charset): Make lack of etc/charsets fatal.
10099
10100 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10101
10102 * editfns.c (region_limit): Fix type mismatch.
10103
10104 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10105
10106 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10107 undefined. Convert from xassert to eassert.
10108 * nsmenu.m: Convert from xassert to eassert.
10109 * nsterm.m: Likewise.
10110
10111 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10112
10113 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10114
10115 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 Avoid integer overflow on scroll-left and scroll-right.
10118 * window.c (HSCROLL_MAX): New macro.
10119 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10120 overflow when requested scroll falls outside ptrdiff_t range.
10121
10122 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10123
10124 * window.h (struct window): Change type of 'hscroll',
10125 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10126 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10127 Adjust users accordingly.
10128 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10129 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10130 from EMACS_INT to ptrdiff_t.
10131 (make_window): Omit redundant initialization.
10132
10133 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
10134
10135 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10136
10137 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10138
10139 * window.h (struct window): Change type of 'use_time' and
10140 'sequence_number' from Lisp_Object to int.
10141 * frame.c (make_frame): Adjust users accordingly.
10142 * print.c (print_object): Likewise.
10143 * window.c (select_window, Fwindow_use_time, make_parent_window)
10144 (make_window): Likewise.
10145
10146 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10147
10148 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10149 enabled with --enable-checking=[all,glyphs] configure option.
10150 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10151 adjust comments accordingly.
10152 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10153 undefined, adjust comments accordingly.
10154 * image.c: Likewise.
10155 * scroll.c: Likewise.
10156 * w32fns.c: Likewise.
10157 * w32term.c: Likewise.
10158 * xdisp.c: Likewise.
10159 * xfaces.c: Likewise.
10160 * xfns.c: Likewise.
10161 * xterm.c: Likewise.
10162
10163 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10164
10165 Generalize run-time debugging checks.
10166 * dispextern.h (XASSERTS): Remove.
10167 * fontset.c (xassert): Remove.
10168 Convert from xassert to eassert.
10169 * alloc.c: Convert from xassert to eassert.
10170 * bidi.c: Likewise.
10171 * dispnew.c: Likewise.
10172 * fns.c: Likewise.
10173 * fringe.c: Likewise.
10174 * ftfont.c: Likewise.
10175 * gtkutil.c: Likewise.
10176 * image.c: Likewise.
10177 * keyboard.c: Likewise.
10178 * menu.c: Likewise.
10179 * process.c: Likewise.
10180 * scroll.c: Likewise.
10181 * sound.c: Likewise.
10182 * term.c: Likewise.
10183 * w32console.c: Likewise.
10184 * w32fns.c: Likewise.
10185 * w32term.c: Likewise.
10186 * window.c: Likewise.
10187 * xdisp.c: Likewise.
10188 * xfaces.c: Likewise.
10189 * xfns.c: Likewise.
10190 * xselect.c: Likewise.
10191 * xterm.c: Likewise.
10192
10193 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10194
10195 * fns.c (maybe_resize_hash_table): Output message when growing the
10196 purify-hashtable.
10197
10198 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10199
10200 * alloc.c (allocate_string_data): Remove dead code.
10201 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10202 avoid GCC warning about unused macro.
10203
10204 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10205
10206 * alloc.c (allocate_string): Omit intervals initialization.
10207 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10208 as in make_pure_string and make_pure_c_string.
10209
10210 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10211
10212 * alloc.c (allocate_string): Fix last change.
10213
10214 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10215
10216 * alloc.c (allocate_string): Remove two redundant calls
10217 to memset, add explicit initialization where appropriate.
10218
10219 2012-06-27 Glenn Morris <rgm@gnu.org>
10220
10221 * lisp.mk (lisp): Remove paths.elc.
10222
10223 2012-06-27 Chong Yidong <cyd@gnu.org>
10224
10225 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10226
10227 2012-06-26 John Wiegley <johnw@newartisans.com>
10228
10229 * unexmacosx.c (copy_data_segment): Add two section names used
10230 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10231
10232 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10233 when building with Clang.
10234
10235 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10236
10237 * eval.c (Fapply): Allow calling it with a single argument.
10238
10239 2012-06-26 Eli Zaretskii <eliz@gnu.org>
10240
10241 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10242 _stricmp and _strnicmp.
10243 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10244
10245 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10246
10247 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10248 allocated window.
10249 (allocate_process): Likewise for new process.
10250 (allocate_terminal): Change to use offsetof.
10251 (allocate_frame): Likewise.
10252 * frame.c (make_frame): Omit redundant initialization.
10253 * window.c (make_parent_window): Use memset.
10254 (make_window): Omit redundant initialization.
10255 * process.c (make_process): Omit redundant initialization.
10256 * terminal.c (create_terminal): Likewise.
10257
10258 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10259
10260 * term.c (delete_tty): Remove redundant call to memset.
10261
10262 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10263
10264 * alloc.c: Remove build_string.
10265 * lisp.h: Define build_string as static inline. This provides
10266 a better opportunity to optimize away calls to strlen when the
10267 function is called with compile-time constant argument.
10268 * image.c (imagemagick_error): Convert to build_string.
10269 * w32proc.c (sys_spawnve): Likewise.
10270 * xterm.c (x_term_init): Likewise.
10271
10272 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10273
10274 Use sprintf return value instead of invoking strlen on result.
10275 In the old days this wasn't portable, since some sprintf
10276 implementations returned char *. But they died out years ago and
10277 Emacs already assumes sprintf returns int.
10278 Similarly for float_to_string.
10279 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10280 * ccl.c (ccl_driver):
10281 * character.c (string_escape_byte8):
10282 * data.c (Fnumber_to_string):
10283 * doprnt.c (doprnt):
10284 * print.c (print_object):
10285 * xdisp.c (message_dolog):
10286 * xfns.c (syms_of_xfns):
10287 Use sprintf or float_to_string result to avoid need to call strlen.
10288 * data.c (Fnumber_to_string):
10289 Use make_unibyte_string, since the string must be ASCII.
10290 * lisp.h, print.c (float_to_string): Now returns int length.
10291 * term.c (produce_glyphless_glyph):
10292 Use sprintf result rather than recomputing it.
10293
10294 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10295 * Makefile.in (ALL_CFLAGS):
10296 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10297 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10298
10299 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10300
10301 * dispextern.h (xstrcasecmp): Define to library function
10302 strcasecmp if available.
10303 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10304
10305 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10306
10307 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10308 Avoid comma operator.
10309 * menu.c (push_submenu_start, push_submenu_end)
10310 (push_left_right_boundary, push_menu_pane): Likewise.
10311 * msdos.c (dos_rawgetc): Likewise.
10312
10313 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10314
10315 * xfns.c (xic_create_fontsetname): Remove redundant calls
10316 to memset.
10317
10318 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10319
10320 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10321 sprintf already null-terminates its output.
10322
10323 * xfns.c (x_window): Remove redundant cast.
10324
10325 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10326
10327 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10328 `const char *' to `char *' to avoid compiler warning.
10329
10330 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10331
10332 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10333 instead of truncating it to 63 (admittedly a generous limit).
10334
10335 * process.c: Fix spelling and caps in comments.
10336
10337 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10338
10339 * emacs.c (setpgrp): Remove definition, unused.
10340 * sysdep.c (setpgrp): Remove definition, not used in this file.
10341
10342 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
10343
10344 * makefile.w32-in: Update dependencies.
10345
10346 2012-06-24 Eli Zaretskii <eliz@gnu.org>
10347
10348 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10349 (SYSTIME_H): Add nt/inc/sys/time.h.
10350
10351 * systime.h [WINDOWSNT]: Include sys/time.h.
10352
10353 * s/ms-w32.h (struct timespec): Definition moved from
10354 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10355
10356 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10359 * buffer.h (buffer_slot_type_mismatch):
10360 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10361 * eval.c (unwind_to_catch):
10362 * image.c (my_png_error, my_error_exit):
10363 * keyboard.c (quit_throw_to_read_char, user_error)
10364 (Fexit_recursive_edit, Fabort_recursive_edit):
10365 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10366 (wrong_type_argument, buffer_overflow, __executable_start)
10367 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10368 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10369 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10370 (fatal):
10371 (child_setup) [!DOS_NT]:
10372 * lread.c (end_of_file_error, invalid_syntax):
10373 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10374 * puresize.h (pure_write_error):
10375 * search.c (matcher_overflow):
10376 * sound.c (sound_perror, alsa_sound_perror):
10377 * sysdep.c, syssignal.h (croak):
10378 * term.c (maybe_fatal, vfatal):
10379 * textprop.c (text_read_only):
10380 * undo.c (user_error):
10381 * unexmacosx.c (unexec_error):
10382 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10383 Use _Noreturn rather than NO_RETURN.
10384 No need for separate decl merely because of _Noreturn.
10385 * sound.c (sound_warning, parse_sound):
10386 Remove unnecessary forward decls.
10387
10388 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10389
10390 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10391 * lisp.h (WAIT_READING_MAX): New macro.
10392 * dispnew.c (Fsleep_for, sit_for):
10393 * keyboard.c (kbd_buffer_get_event):
10394 * process.c (Faccept_process_output):
10395 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10396 This improves on the previous patch, which introduced a bug
10397 when time_t is unsigned and as wide as intmax_t.
10398 See <http://bugs.gnu.org/9000#51>.
10399
10400 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10401
10402 * dispnew.c (sit_for, Fsleep_for):
10403 * keyboard.c (kbd_buffer_get_event):
10404 * process.c (Faccept_process_output): Avoid compiler warnings when
10405 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10406
10407 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
10408
10409 * makefile.w32-in: Update dependencies.
10410
10411 * w32.c (ltime): Add return type and declare static.
10412 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10413
10414 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10415
10416 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10417 Privately reported by Herbert J. Skuhra.
10418 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10419 All uses changed.
10420 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10421 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10422
10423 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10424
10425 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10426 last argument of make_unibyte_string.
10427
10428 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10429 language ID in the event parameters.
10430
10431 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10432 event.code, not the obscure "character set ID".
10433
10434 2012-06-23 Chong Yidong <cyd@gnu.org>
10435
10436 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10437
10438 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10439
10440 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10441 * w32.c (fdutimens): New function.
10442
10443 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10444
10445 * s/ms-w32.h (pselect): Redirect to sys_select.
10446
10447 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10448
10449 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10450 in the logic of incrementing and decrementing the value of
10451 use_relocatable_buffers.
10452
10453 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10454
10455 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10456 Privately reported by Herbert J. Skuhra.
10457 [__FreeBSD__]: Remove "*/" typo after "#include".
10458 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10459 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10460 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10461 Don't assume EMACS_TIME and struct timeval are the same type.
10462
10463 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10464
10465 Support higher-resolution time stamps (Bug#9000).
10466 The time stamps are only nanosecond-resolution at the C level,
10467 since that's the best that any real-world system supports now.
10468 But they are picosecond-resolution at the Lisp level, as that's
10469 easy, and leaves room for future OS improvements.
10470
10471 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10472 (LIBES): Use it.
10473
10474 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10475 Don't get current time unless it's needed.
10476
10477 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10478 now provides it if it's absent.
10479 (start_atimer): Port to higher-res time stamps.
10480 Check for time stamp overflow. Don't get current time more
10481 often than is needed.
10482
10483 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10484 Include systime.h, not time.h.
10485 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10486
10487 * dired.c: Include stat-time.h.
10488 (Ffile-attributes): File times now have higher resolution.
10489
10490 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10491 (struct image): Timestamp now has higher resolution.
10492
10493 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10494 has at least microseconds now. All uses removed.
10495 (update_frame, update_single_window, update_window, update_frame_1)
10496 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10497 (duration_to_sec_usec): Remove; no longer needed.
10498
10499 * editfns.c (time_overflow): Now extern.
10500 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10501 (float-time, Fformat_time_string, Fcurrent_time_string)
10502 (Fcurrent_time_zone): Accept and generate higher-resolution
10503 time stamps.
10504 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10505 (decode_time_components, lisp_seconds_argument): New functions.
10506 (make_time): Now static.
10507 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10508 Report an error if the time is invalid, rather than having the caller
10509 do that.
10510
10511 * fileio.c: Include <stat-time.h>
10512 (Fcopy_file): Copy higher-resolution time stamps.
10513 Prefer to set the time stamp via a file descriptor if that works.
10514 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10515 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10516 (Fvisited_file_modtime, Fset_visited_file_modtime):
10517 Support higher-resolution time stamps.
10518
10519 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10520
10521 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10522
10523 * image.c (prepare_image_for_display, clear_image_cache)
10524 (lookup_image): Port to higer-resolution time stamps.
10525
10526 * keyboard.c (start_polling, bind_polling_period):
10527 Check for time stamp overflow.
10528 (read_char, kbd_buffer_get_event, timer_start_idle)
10529 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10530 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10531 Port to higher-resolution time stamps. Do not assume time_t is signed.
10532 (decode_timer): New function. Timers are now vectors of length 9,
10533 not 8, to accommodate the picosecond component.
10534 (timer_check_2): Use it.
10535
10536 * nsterm.m (select_timeout, timeval_subtract): Remove.
10537 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10538 as they're a bit more accurate and handle overflow better.
10539 (ns_select): Change prototype to be compatible with pselect.
10540 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10541 * nsterm.h (ns_select): Adjust prototype.
10542
10543 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10544 us-resolution time stamps.
10545 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10546
10547 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10548
10549 * lisp.h (time_overflow): New decl.
10550 (wait_reading_process_output): First arg is now intmax_t, not int,
10551 to accommodate larger waits.
10552
10553 * process.h (struct Lisp_Process.read_output_delay):
10554 Now counts nanoseconds, not microseconds.
10555 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10556 EMACS_HAS_USECS.
10557 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10558 (wait_reading_process_output):
10559 Port to ns-resolution time stamps.
10560 (Faccept_process_output, wait_reading_process_output):
10561 Check for time stamp overflow. Do not assume time_t is signed.
10562 (select_wrapper): Remove; we now use pselect.
10563 (Fprocess_attributes): Now generates ns-resolution time stamps.
10564
10565 * sysdep.c: Include utimens.h. Don't include utime.h
10566 or worry about struct utimbuf; gnulib does that for us now.
10567 (gettimeofday): Remove; gnulib provides a substitute.
10568 (make_timeval): New function.
10569 (set_file_times): Now sets ns-resolution time stamps.
10570 New arg FD; all uses changed.
10571 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10572 (system_process_attributes):
10573 Now returns ns-resolution time stamp. All uses changed.
10574 Check for time stamp overflow.
10575
10576 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10577 provides a substitute now.
10578
10579 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10580 since it guarantees struct timespec.
10581 (EMACS_TIME): Now struct timespec, so that we can support
10582 ns-resolution time stamps.
10583 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10584 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10585 (EMACS_USECS): Remove.
10586 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10587 so multiply the arg by 1000 before storing it.
10588 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10589 New macros.
10590 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10591 Port to ns-resolution time stamps.
10592 (EMACS_TIME_NEG_P): Remove; replaced by....
10593 (EMACS_TIME_SIGN): New macro.
10594 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10595 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10596 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10597 (make_timeval, make_lisp_time, decode_time_components): New decls.
10598 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10599 that it mishandled time_t overflow. You can't compare by subtracting!
10600 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10601 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10602
10603 * term.c: Include <sys/time.h>.
10604 (timeval_to_Time): New function, for proper overflow wraparound.
10605 (term_mouse_position, term_mouse_click): Use it.
10606
10607 * undo.c (record_first_change): Support higher-resolution time stamps
10608 in the undo buffer.
10609 (Fprimitive_undo): Use them when restoring time stamps.
10610
10611 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10612 (w32_get_internal_run_time):
10613 Port to higher-resolution Emacs time stamps.
10614 (ltime): Now accepts single 64-bit integer, as that's more convenient
10615 for callers.
10616
10617 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10618
10619 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10620 for compatibility with pselect. Support ns-resolution time stamps.
10621
10622 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10623
10624 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10625 Check for time stamp overflow, and support ns-resolution time stamps.
10626
10627 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10628 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10629 (timeval_subtract): Remove; no longer needed.
10630 (XTflash, XTring_bell, x_wait_for_event):
10631 Port to ns-resolution time stamps. Don't assume time_t is signed.
10632
10633 2012-06-22 Chong Yidong <cyd@gnu.org>
10634
10635 * xdisp.c (x_consider_frame_title): Revert last change.
10636
10637 2012-06-22 Eli Zaretskii <eliz@gnu.org>
10638
10639 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10640 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10641 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10642 staticidx goes up to 1597 out of 1600 = 0x640.)
10643
10644 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10647 Otherwise, the umask might be mistakenly 0 while handling input signals.
10648
10649 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10650
10651 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10652
10653 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10654
10655 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10656 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10657 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10658 access to `contents' member of Lisp_Vector objects with AREF and ASET
10659 where appropriate.
10660
10661 2012-06-19 Chong Yidong <cyd@gnu.org>
10662
10663 * frame.c (delete_frame): When selecting a frame on a different
10664 text terminal, do not alter the terminal's top-frame.
10665
10666 * xdisp.c (format_mode_line_unwind_data): Record the target
10667 frame's selected window and its terminal's top-frame.
10668 (unwind_format_mode_line): Restore them.
10669 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10670 Callers changed.
10671 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10672 since tty frames can be explicitly named.
10673 (prepare_menu_bars): Likewise.
10674
10675 * term.c (Ftty_top_frame): New function.
10676
10677 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10678
10679 Port byte-code-meter to modern targets.
10680 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10681 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
10682 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
10683 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10684 (METER_1, METER_2): Simplify.
10685
10686 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10687
10688 * data.c (Fdefalias): Return `symbol' (bug#11686).
10689
10690 2012-06-18 Martin Rudalics <rudalics@gmx.at>
10691
10692 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
10693 gets killed during executing of this function (Bug#11665).
10694 Try to always return Qt when the buffer has been actually killed.
10695 (Vkill_buffer_query_functions): In doc-string say that functions
10696 run by this hook should not change the current buffer.
10697
10698 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10699
10700 Fix recently-introduced process.c problems found by static checking.
10701 * process.c (write_queue_push, write_queue_pop, send_process):
10702 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10703 (write_queue_pop): Fix pointer signedness problem.
10704 (send_process): Remove unused local.
10705
10706 2012-06-17 Chong Yidong <cyd@gnu.org>
10707
10708 * xdisp.c (redisplay_internal): No need to redisplay terminal
10709 frames that are not on top.
10710
10711 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
10712
10713 * process.c (make_process): Initialize write_queue.
10714 (write_queue_push, write_queue_pop): New functions.
10715 (send_process): Use them to maintain correct ordering of process
10716 writes (Bug#10815).
10717
10718 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10719
10720 * lisp.h (eassert): Assume C89 or later.
10721 This removes the need for CHECK.
10722 (CHECK): Remove. Its comments about always evaluating its
10723 argument were confusing, as 'eassert' typically does not evaluate
10724 its argument.
10725
10726 * coding.c (produce_chars): Use ptrdiff_t, not int.
10727
10728 * xterm.c (x_draw_underwave): Check for integer overflow.
10729 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10730
10731 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
10732
10733 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10734 referenced (Bug#11583).
10735
10736 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10737
10738 Implement wave-style variant of underlining.
10739 * dispextern.h (face_underline_type): New enum.
10740 (face): Add field for underline type.
10741 * nsterm.m (ns_draw_underwave): New function.
10742 (ns_draw_text_decoration): Use it.
10743 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10744 New functions.
10745 (x_draw_glyph_string): Use them.
10746 * xfaces.c (Qline, Qwave): New Lisp objects.
10747 (check_lface_attrs, merge_face_ref)
10748 (Finternal_set_lisp_face_attribute, realize_x_face):
10749 Handle wave-style underline face attributes.
10750 * xterm.c (x_draw_underwave): New function.
10751 (x_draw_glyph_string): Use it.
10752
10753 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
10754
10755 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10756 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10757 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10758 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10759 ($(BLD)/w32select.$(O)): Update dependencies.
10760
10761 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10762
10763 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10764 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10765 * character.c (_fetch_multibyte_char_p): Remove.
10766 * alloc.c: Include "character.h" before "buffer.h".
10767 * bidi.c: Likewise.
10768 * buffer.c: Likewise.
10769 * bytecode.c: Likewise.
10770 * callint.c: Likewise.
10771 * callproc.c: Likewise.
10772 * casefiddle.c: Likewise.
10773 * casetab.c: Likewise.
10774 * category.c: Likewise.
10775 * cmds.c: Likewise.
10776 * coding.c: Likewise.
10777 * composite.c: Likewise.
10778 * dired.c: Likewise.
10779 * dispnew.c: Likewise.
10780 * doc.c: Likewise.
10781 * dosfns.c: Likewise.
10782 * editfns.c: Likewise.
10783 * emacs.c: Likewise.
10784 * fileio.c: Likewise.
10785 * filelock.c: Likewise.
10786 * font.c: Likewise.
10787 * fontset.c: Likewise.
10788 * fringe.c: Likewise.
10789 * indent.c: Likewise.
10790 * insdel.c: Likewise.
10791 * intervals.c: Likewise.
10792 * keyboard.c: Likewise.
10793 * keymap.c: Likewise.
10794 * lread.c: Likewise.
10795 * macros.c: Likewise.
10796 * marker.c: Likewise.
10797 * minibuf.c: Likewise.
10798 * nsfns.m: Likewise.
10799 * nsmenu.m: Likewise.
10800 * print.c: Likewise.
10801 * process.c: Likewise.
10802 * regex.c: Likewise.
10803 * region-cache.c: Likewise.
10804 * search.c: Likewise.
10805 * syntax.c: Likewise.
10806 * term.c: Likewise.
10807 * textprop.c: Likewise.
10808 * undo.c: Likewise.
10809 * unexsol.c: Likewise.
10810 * w16select.c: Likewise.
10811 * w32fns.c: Likewise.
10812 * w32menu.c: Likewise.
10813 * window.c: Likewise.
10814 * xdisp.c: Likewise.
10815 * xfns.c: Likewise.
10816 * xmenu.c: Likewise.
10817 * xml.c: Likewise.
10818 * xselect.c: Likewise.
10819
10820 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10821
10822 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10823 If all the glyphs of the glyph row came from strings, and we have no
10824 cursor positioning clues, put the cursor on the first glyph of the
10825 row.
10826 (handle_face_prop): Use chunk-relative overlay string index when
10827 indexing into it->string_overlays array. (Bug#11653)
10828 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10829 the rightmost. (Bug#11720)
10830
10831 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10832
10833 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10834 (CATEGORY_MEMBER): Enforce 1/0 value.
10835 * category.c (_temp_category_set): Remove.
10836
10837 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10838
10839 * window.c (Fdelete_other_windows_internal)
10840 (Fdelete_window_internal): Don't access frame's mouse highlight
10841 info of the initial frame. (Bug#11677)
10842
10843 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10844
10845 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10846 Assume USE_2_TAGS_FOR_INTS.
10847 (xreload): Adjust $tagmask width to match recent lisp.h change.
10848
10849 Simplify lisp.h in minor ways that should not affect code.
10850 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10851 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10852 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10853 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10854 (INTTYPEBITS): New macro, for clarity.
10855 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
10856 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10857 Simplify now that USE_LSB_TAG is always defined.
10858 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10859 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10860
10861 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
10862
10863 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10864
10865 2012-06-13 Glenn Morris <rgm@gnu.org>
10866
10867 * s/bsd-common.h (BSD4_3):
10868 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10869
10870 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10871
10872 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10873 instead of union.
10874 (XLI, XIL): Define.
10875 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10876 Use them.
10877 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
10878 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
10879 * alloc.c (widen_to_Lisp_Object): Remove.
10880 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10881 * frame.c (delete_frame): Remove outdated comment.
10882 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10883 USE_LISP_UNION_TYPE.
10884 (Fw32_unregister_hot_key): Likewise.
10885 (Fw32_toggle_lock_key): Likewise.
10886 * w32menu.c (add_menu_item): Likewise.
10887 (w32_menu_display_help): Use XIL instead of checking
10888 USE_LISP_UNION_TYPE.
10889 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10890 (init_heap): Likewise.
10891 * w32term.c (w32_read_socket): Update comment.
10892
10893 2012-06-13 Glenn Morris <rgm@gnu.org>
10894
10895 * s/usg5-4-common.h, src/s/unixware.h:
10896 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10897
10898 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10899
10900 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10901
10902 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10903 * alloc.c (make_number) [!defined make_number]:
10904 Remove, as lisp.h always defines this now.
10905 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10906 (roundup_size): Verify that it is a power of 2.
10907 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10908 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10909 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10910 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10911 USE_LSB_TAG now is always defined to be either 0 or 1.
10912 All uses changed.
10913 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10914 code works fine either way, and efficiency is not a concern here,
10915 as the union type is for debugging, not for production.
10916 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10917 Use an inline function on all platforms when using the union type,
10918 since this is simpler and 'static inline' can be used portably
10919 within Emacs now.
10920 (LISP_INITIALLY_ZERO): New macro.
10921 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10922 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10923
10924 2012-06-12 Glenn Morris <rgm@gnu.org>
10925
10926 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10927
10928 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
10929
10930 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10931 Move BROKEN_SIGIO to configure.
10932
10933 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10934 Move NO_TERMIO to configure.
10935
10936 2012-06-12 Chong Yidong <cyd@gnu.org>
10937
10938 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10939 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10940 MagickExportImagePixels is undefined.
10941
10942 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10943
10944 * image.c (imagemagick_load_image): Remove unused label.
10945
10946 2012-06-11 Glenn Morris <rgm@gnu.org>
10947
10948 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10949 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10950 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10951 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10952
10953 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10954
10955 * alloc.c (make_byte_code): New function.
10956 (Fmake_byte_code): Use it. Don't purify here.
10957 * lread.c (read1): Use it as well to avoid extra allocation.
10958
10959 2012-06-11 Chong Yidong <cyd@gnu.org>
10960
10961 * image.c (imagemagick_load_image): Implement transparency.
10962
10963 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10964
10965 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10966 account for preceding backslashes. (Bug#11663)
10967
10968 2012-06-09 Chong Yidong <cyd@gnu.org>
10969
10970 * term.c: Support italics in capable terminals (Bug#9652).
10971 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10972 (turn_on_face): Output using TS_enter_italic_mode if available.
10973 Don't handle unused blinking and alt-charset cases.
10974 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10975 and tty_alt_charset_p cases.
10976 (tty_capable_p, init_tty): Support italics.
10977
10978 * termchar.h (struct tty_display_info): Add field for italics.
10979 Remove unused blink field.
10980
10981 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10982 Handle slant.
10983
10984 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
10985 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
10986 tty_alt_charset_p. Add tty_italic_p.
10987
10988 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
10989
10990 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
10991 dbus_type_is_basic if available.
10992 (xd_extract_signed, xd_extract_unsigned): Rename from
10993 extract_signed and extract_unsigned, respectively. Adapt callers.
10994
10995 2012-06-09 Chong Yidong <cyd@gnu.org>
10996
10997 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
10998
10999 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11000 case (Bug#9752).
11001
11002 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11003
11004 * xdisp.c (vmessage): Treat frame message as multibyte.
11005 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11006 would generate the diagnostic "Making \302\247 buffer-local while
11007 let-bound!".
11008
11009 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11010
11011 * dispnew.c (showing_window_margins_p): Undo last change, which
11012 was done due to an inadvertent commit.
11013 (adjust_frame_glyphs_for_frame_redisplay): Do call
11014 showing_window_margins_p.
11015
11016 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11017
11018 * eval.c (Fmake_var_non_special): New primitive.
11019 (syms_of_eval): Defsubr it.
11020 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11021
11022 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
11023
11024 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11025 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11026
11027 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11028
11029 * alloc.c (allocate_vectorlike): Fix last change.
11030
11031 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11032
11033 Block-based vector allocation of small vectors.
11034 * lisp.h (struct vectorlike_header): New field `nbytes',
11035 adjust comment accordingly.
11036 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11037 to denote vector blocks. Adjust users (live_vector_p,
11038 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11039 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11040 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11041 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11042 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11043 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11044 (roundup_size): New constant.
11045 (struct vector_block): New data type.
11046 (vector_blocks, vector_free_lists, zero_vector): New variables.
11047 (all_vectors): Rename to `large_vectors'.
11048 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11049 (sweep_vectors): New functions.
11050 (allocate_vectorlike): Return `zero_vector' as the only vector of
11051 0 items. Allocate new vector from block if vector size is less than
11052 or equal to VBLOCK_BYTES_MAX.
11053 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11054 (init_alloc_once): Add call to init_vectors.
11055
11056 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11057
11058 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11059
11060 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11061
11062 * doprnt.c (doprnt): Truncate multibyte char correctly.
11063 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11064 would mishandle a string argument "Xc" if X was a multibyte
11065 character of length 2: it would truncate after X's first byte
11066 rather than including all of X.
11067
11068 2012-06-06 Chong Yidong <cyd@gnu.org>
11069
11070 * buffer.c (word_wrap): Doc fix.
11071
11072 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11073
11074 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11075
11076 2012-06-03 Glenn Morris <rgm@gnu.org>
11077
11078 * xdisp.c (tool-bar-style): Doc fix.
11079
11080 2012-06-03 Ulrich Müller <ulm@gentoo.org>
11081
11082 * Makefile.in (PAXCTL): Define.
11083 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11084 binary via PaX flags if the paxctl utility is available.
11085 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11086 Restore PaX flags to their default. (Bug#11398)
11087
11088 2012-06-03 Chong Yidong <cyd@gnu.org>
11089
11090 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11091 buffer (Bug#11226).
11092
11093 2012-06-03 Chong Yidong <cyd@gnu.org>
11094
11095 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11096 (note_mode_line_or_margin_highlight): If there is no help echo,
11097 use mode-line-default-help-echo. Handle the case where the mouse
11098 position is past the end of the mode line string.
11099
11100 * buffer.c (buffer_local_value_1): New function, split from
11101 Fbuffer_local_value; can return Qunbound.
11102 (Fbuffer_local_value): Use it.
11103 (Vmode_line_format): Docstring tweaks.
11104
11105 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11106
11107 * sysdep.c (system_process_attributes): Improve comment.
11108
11109 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11110
11111 * keyboard.c: Export real-this-command to Elisp.
11112 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11113 and DEFVAR it. Update all users.
11114
11115 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11116
11117 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11118
11119 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11120 Convert pctcpu and pctmem to Lisp float properly.
11121 Let the compiler fold better, as 100.0/0x8000 is exact.
11122
11123 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11124
11125 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11126 cons_block.
11127
11128 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11129
11130 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11131
11132 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11133
11134 For a 'struct window', replace some Lisp_Object fields to
11135 bitfields where appropriate, remove unused fields.
11136 * window.h (struct window): Remove unused 'last_mark_x' and
11137 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
11138 change its type from Lisp_Object to bitfield.
11139 Change type of 'force_start', 'optional_new_start',
11140 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11141 fields from Lisp_Object to bitfield. Adjust users accordingly.
11142
11143 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11144
11145 Pacify gcc -Wdouble-precision when using Xaw.
11146 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11147 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11148 Use 'float' consistently, rather than 'float' in most places
11149 and 'double' in a couple of places.
11150
11151 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11152
11153 * xdisp.c (handle_stop): Detect whether we have overlay strings
11154 loaded by testing it->current.overlay_string_index to be
11155 non-negative, instead of checking whether n_overlay_strings is
11156 positive. (Bug#11587)
11157
11158 2012-05-31 Chong Yidong <cyd@gnu.org>
11159
11160 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11161
11162 * doc.c (Fsubstitute_command_keys): Doc fix.
11163
11164 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11165
11166 * search.c (search_buffer): Remove calls to
11167 r_alloc_inhibit_buffer_relocation, as it is now called by
11168 maybe_unify_char, which was the cause of relocation of buffer text
11169 in bug#11519.
11170
11171 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11172
11173 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11174 for the duration of call to load_charset, to avoid problems with
11175 callers of maybe_unify_char that access buffer text through C
11176 pointers.
11177
11178 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11179 decrement the inhibition flag, instead of just setting or
11180 resetting it.
11181
11182 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11183
11184 Remove obsolete '#define static' cruft.
11185 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11186 This #undef was "temporary" in 2000; it is no longer needed
11187 now that '#define static' has gone away.
11188 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11189 (gray_bitmap_bits): Remove; no longer needed.
11190 All uses replaced with definiens.
11191 * xterm.c: Include "bitmaps/gray.xbm".
11192
11193 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11194
11195 Clean up __executable_start, monstartup when --enable-profiling.
11196 The following changes affect the code only when profiling.
11197 * dispnew.c (__executable_start): Rename from safe_bcopy.
11198 Define only on platforms that need it.
11199 * emacs.c: Include <sys/gmon.h> when profiling.
11200 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11201 (__executable_start): Remove decl, since lisp.h does it now.
11202 (safe_bcopy): Remove decl; no longer has that name.
11203 (main): Coalesce #if into single bit of code, for simplicity.
11204 Cast pointers to uintptr_t, since standard libraries want integers
11205 and not pointers.
11206 * lisp.h (__executable_start): New decl.
11207
11208 2012-05-31 Glenn Morris <rgm@gnu.org>
11209
11210 * image.c (Fimagemagick_types): Doc fix.
11211
11212 2012-05-30 Jim Meyering <meyering@redhat.com>
11213
11214 * callproc.c (Fcall_process_region): Include directory component
11215 in mkstemp error message (Bug#11586).
11216
11217 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11218
11219 * alloc.c, lisp.h (make_pure_vector): Now static.
11220
11221 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11222
11223 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11224 Move to byte-run.el.
11225 (Fautoload): Do the hash-doc more carefully.
11226 * data.c (Fdefalias): Purify definition, except for keymaps.
11227 (Qdefun): Move from eval.c.
11228 * lisp.h (Qdefun): Remove.
11229 * lread.c (read1): Tiny simplification.
11230
11231 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
11232
11233 Do not create empty overlays with the evaporate property (Bug#9642).
11234 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11235 Bug#9642, but explicitly check that the buffer the overlay would
11236 be moved to is live and rearrange lines to make sure that errors
11237 will not put the overlay in an inconsistent state.
11238 (Fdelete_overlay): Cosmetics.
11239
11240 2012-05-28 Eli Zaretskii <eliz@gnu.org>
11241
11242 * w32term.c (my_bring_window_to_top): New function.
11243 (x_raise_frame): Use handle returned by DeferWindowPos, which
11244 could be different from the original one.
11245 Call my_bring_window_to_top instead of my_set_foreground_window.
11246 (Bug#11513)
11247
11248 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11249 by calling BringWindowToTop.
11250
11251 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11252 (WM_EMACS_END): Increase by one.
11253
11254 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11255
11256 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11257 This avoids undefined behavior that might cause the eassert
11258 to not catch an out-of-range value.
11259
11260 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
11261
11262 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11263 Update dependencies.
11264
11265 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11266
11267 * bidi.c (bidi_mirror_char): Fix last change.
11268
11269 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11270
11271 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11272 when referring to sectname field in printf format.
11273
11274 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11275
11276 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11277 Only r_alloc_inhibit_buffer_relocation needed to be added;
11278 the others were already declared.
11279
11280 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11281 before checking whether it's out of range. Put the check inside
11282 eassert. See
11283 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11284
11285 2012-05-27 Ken Brown <kbrown@cornell.edu>
11286
11287 * callproc.c (Fcall_process): Restore a line that was accidentally
11288 commented out in the 2011-02-13 change (bug#11547).
11289
11290 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11291
11292 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11293 defined on ralloc.c.
11294
11295 * buffer.c [REL_ALLOC]: Remove prototypes of
11296 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11297 they are now on lisp.h.
11298
11299 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11300
11301 * search.c (search_buffer): Use it to inhibit relocation of buffer
11302 text while re_search_2 is doing its job, because re_search_2 is
11303 passed C pointers to buffer text. (Bug#11519)
11304
11305 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11306 Update value to 24.
11307
11308 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11309 state after an additional call to move_it_in_display_line_to, keep
11310 the values of it->max_ascent and it->max_descent found for the
11311 entire line.
11312 (pos_visible_p): Revert the comparison against bottom_y to what it
11313 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11314 (Bug#11464)
11315
11316 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11317
11318 Fix coding-related core dumps with gcc -ftrapv.
11319 The code was computing A - B, where A and B are pointers, and B is
11320 random garbage. This can lead to core dumps on platforms that
11321 have special pointer registers, and it also leads to core dumps on
11322 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11323 A - B only when B is initialized properly.
11324 * coding.c (coding_set_source, coding_set_destination): Return void.
11325 (coding_change_source, coding_change_destinations): New functions,
11326 with the old behaviors of coding_set_source and coding_set_destination.
11327 All callers that need an offset changed to use these new functions.
11328
11329 2012-05-26 Glenn Morris <rgm@gnu.org>
11330
11331 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11332
11333 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11334
11335 Extend mouse support on W32 text-mode console.
11336 * xdisp.c (draw_row_with_mouse_face):
11337 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
11338
11339 * w32console.c: Include window.h.
11340 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11341 New functions.
11342 (initialize_w32_display): Initialize mouse-highlight data.
11343
11344 * w32inevt.c: Include termchar.h and window.h.
11345 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11346 moves, call note_mouse_highlight. If help_echo changed, call
11347 gen_help_event to produce help-echo message in the echo area.
11348 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11349 highlight info.
11350
11351 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11352
11353 * lread.c (read1): Simplify slightly to avoid an overflow warning
11354 with GCC 4.7.0 on x86-64.
11355
11356 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11357
11358 * bidi.c (bidi_mirror_char): Revert last change: an int is
11359 definitely wide enough here.
11360
11361 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
11362
11363 Fix integer width and related bugs (Bug#9874).
11364 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
11365 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11366 (string_bytes, check_sblock, allocate_string_data):
11367 (compact_small_strings, Fmake_bool_vector, make_string)
11368 (make_unibyte_string, make_multibyte_string)
11369 (make_string_from_bytes, make_specified_string)
11370 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11371 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11372 (mark_vectorlike):
11373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11374 (allocate_pseudovector):
11375 Use int, not EMACS_INT, where int is wide enough.
11376 (inhibit_garbage_collection, Fgarbage_collect):
11377 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11378 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11379 int might not be wide enough.
11380 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11381 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11382 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11383 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11384 (bidi_level_of_next_char, bidi_move_to_visually_next):
11385 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11386 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11387 (Fkill_buffer, Fset_buffer_major_mode)
11388 (advance_to_char_boundary, Fbuffer_swap_text)
11389 (Fset_buffer_multibyte, overlays_at, overlays_in)
11390 (overlay_touches_p, struct sortvec, record_overlay_string)
11391 (overlay_strings, recenter_overlay_lists)
11392 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11393 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11394 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11395 (Foverlay_recenter, last_overlay_modification_hooks_used)
11396 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11398 (validate_region): Omit unnecessary test for b <= e,
11399 since that's guaranteed by the previous test.
11400 (adjust_overlays_for_delete): Avoid pos + length overflow.
11401 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11402 (report_overlay_modification):
11403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11404 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11405 Omit pointer cast, which isn't needed anyway, and doesn't work
11406 after the EMACS_INT -> ptrdiff_t change.
11407 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
11408 * buffer.h: Adjust decls to match defn changes elsewhere.
11409 (struct buffer_text, struct buffer):
11410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11411 Use EMACS_INT, not int, where int might not be wide enough.
11412 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11413 not int, to avoid needless 32-bit limit on 64-bit hosts.
11414 (exec_byte_code): Use tighter memory-full test, one that checks
11415 for alloca overflow. Don't compute the address of the object just
11416 before an array, as that's not portable. Use EMACS_INT, not
11417 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
11418 * callint.c (Fcall_interactively):
11419 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11420 * callproc.c (call_process_kill, Fcall_process):
11421 Don't assume pid_t fits into an Emacs fixnum.
11422 (call_process_cleanup, Fcall_process, child_setup):
11423 Don't assume pid_t fits into int.
11424 (call_process_cleanup, Fcall_process, delete_temp_file)
11425 (Fcall_process_region):
11426 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11427 (Fcall_process): Simplify handling of volatile integers.
11428 Use int, not EMACS_INT, where int will do.
11429 * casefiddle.c (casify_object, casify_region, operate_on_word)
11430 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11432 (casify_object): Avoid integer overflow when overallocating buffer.
11433 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
11434 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
11435 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11436 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11437 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11438 integers are now checked earlier. All uses replaced with XINT.
11439 (ccl_driver):
11440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11441 For CCL_MapSingle, check that content and value are in int range.
11442 (ccl_driver, Fregister_code_conversion_map):
11443 Check that Vcode_version_map_vector is a vector.
11444 (resolve_symbol_ccl_program): Check that vector header is in range.
11445 Always copy the vector, so that we can check its contents reliably
11446 now rather than having to recheck each instruction as it's being
11447 executed. Check that vector words fit in 'int'.
11448 (ccl_get_compiled_code, Fregister_ccl_program)
11449 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11450 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11451 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11452 contents are in range.
11453 (Fccl_execute_on_string): Check that status is in range.
11454 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11455 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11456 Accept and return EMACS_INT, not int, because callers can pass values
11457 out of 'int' range.
11458 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11459 (multibyte_chars_in_text, parse_str_as_multibyte)
11460 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11461 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11462 (string_escape_byte8, Fget_byte):
11463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11464 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
11465 avoid mishandling large integers.
11466 * character.h: Adjust decls to match defn changes elsewhere.
11467 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11468 (Ffind_charset_region):
11469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11470 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11471 (load_charset_map_from_vector, Fdefine_charset_internal):
11472 Don't assume fixnum fits in int.
11473 (load_charset_map_from_vector, Fmap_charset_chars):
11474 Remove now-unnecessary CHECK_NATNUMs.
11475 (Fdefine_charset_internal): Check ranges here, more carefully.
11476 Don't rely on undefined behavior with signed left shift overflow.
11477 Don't assume unsigned int fits into fixnum, or that fixnum fits
11478 into unsigned int. Don't require max_code to be a valid fixnum;
11479 that's not true for gb10830 4-byte on a 32-bit host. Allow
11480 invalid_code to be a cons, for the same reason. Require code_offset
11481 to be a character. Avoid int overflow if max_char is close
11482 to INT_MAX.
11483 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11484 this is intended anyway and avoids some undefined behavior.
11485 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11486 INDEX_TO_CODE_POINT, as that's what it expects.
11487 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11488 * charset.h (DECODE_CHAR): Return int, not unsigned;
11489 this is what was intended anyway, and it avoids undefined behavior.
11490 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11491 integer-overflow issues.
11492 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11493 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11494 where the argument is EMACS_INT, and this behavior is not intended.
11495 * chartab.c (Fmake_char_table, Fset_char_table_range)
11496 (uniprop_get_decoder, uniprop_get_encoder):
11497 Don't assume fixnum fits in int.
11498 * cmds.c (move_point): New function, that does the gist of
11499 Fforward_char and Fbackward_char, but does so while checking
11500 for integer overflow more accurately.
11501 (Fforward_char, Fbackward_char): Use it.
11502 (Fforward_line, Fend_of_line, internal_self_insert)
11503 (internal_self_insert):
11504 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11505 Fix a FIXME, by checking for integer overflow when calculating
11506 target_clm and actual_clm.
11507 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11508 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11509 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11510 (coding_alloc_by_making_gap, alloc_destination)
11511 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11512 (encode_coding_utf_16, detect_coding_emacs_mule)
11513 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11514 (detect_coding_iso_2022, decode_coding_iso_2022)
11515 (encode_invocation_designation, encode_designation_at_bol)
11516 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11517 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11518 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11519 (encode_coding_ccl, encode_coding_raw_text)
11520 (detect_coding_charset, decode_coding_charset)
11521 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11522 (produce_composition, produce_charset, produce_annotation)
11523 (decode_coding, handle_composition_annotation)
11524 (handle_charset_annotation, consume_chars, decode_coding_gap)
11525 (decode_coding_object, encode_coding_object, detect_coding_system)
11526 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11527 (code_convert_region, code_convert_string)
11528 (Fdefine_coding_system_internal)
11529 (coding_set_source, coding_set_destination):
11530 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11531 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11532 (Fdefine_coding_system_internal):
11533 Don't assume fixnums fit in int.
11534 (decode_coding_gap, decode_coding_object, encode_coding_object)
11535 (Fread_coding_system, Fdetect_coding_region)
11536 (Funencodable_char_position, Fcheck_coding_systems_region)
11537 (get_translation, handle_composition_annotation, consume_chars):
11538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11539 (consume_chars): Rewrite to not calculate an address outside buffer.
11540 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
11541 Don't access memory outside of the args array.
11542 (Fdefine_coding_system_internal): Check for charset-id overflow.
11543 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11544 result of ENCODE_CHAR.
11545 * coding.h: Adjust decls to match defn changes elsewhere.
11546 (struct coding_system):
11547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11548 * composite.c (get_composition_id, find_composition)
11549 (run_composition_function, update_compositions)
11550 (compose_text, composition_gstring_put_cache)
11551 (composition_gstring_p, composition_gstring_width)
11552 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11553 (composition_compute_stop_pos, composition_reseat_it)
11554 (composition_update_it, struct position_record)
11555 (find_automatic_composition, composition_adjust_point)
11556 (Fcomposition_get_gstring, Ffind_composition_internal):
11557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11558 (update_compositions):
11559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11560 * composite.h: Adjust decls to match defn changes elsewhere.
11561 (struct composition):
11562 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11563 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11564 Do not attempt to compute the address of the object just before a
11565 buffer; this is not portable.
11566 (Faref, Faset):
11567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11568 (Faset): Use int, not EMACS_INT, where int is wide enough.
11569 (Fstring_to_number): Don't assume fixnums fit in int.
11570 (Frem): Don't assume arg is nonnegative.
11571 * dbusbind.c (xd_append_arg): Check for integers out of range.
11572 (Fdbus_call_method): Don't overflow the timeout int.
11573 (extract_signed, extract_unsigned): New functions.
11574 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11575 (xd_get_connection_references): Return ptrdiff_t, not int.
11576 All uses changed.
11577 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11578 (xd_read_message_1):
11579 Use int, not unsigned, where the dbus API uses int.
11580 (Fdbus_message_internal): Don't overflow mtype.
11581 (syms_of_dbusbind): Allocate right-sized buffer for integers.
11582 * dired.c (directory_files_internal, file_name_completion, scmp)
11583 (file_name_completion_stat):
11584 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11585 (file_name_completion): Don't overflow matchcount.
11586 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11587 * dispextern.h: Adjust decls to match defn changes elsewhere.
11588 (struct text_pos, struct glyph, struct bidi_saved_info)
11589 (struct bidi_string_data, struct bidi_it, struct composition_it)
11590 (struct it):
11591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11592 (struct display_pos, struct composition_it, struct it):
11593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11594 * dispnew.c (increment_matrix_positions)
11595 (increment_row_positions, mode_line_string)
11596 (marginal_area_string):
11597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11598 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
11599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11600 (duration_to_sec_usec): New function, to check for overflow better.
11601 (Fsleep_for, sit_for): Use it.
11602 * doc.c (get_doc_string, store_function_docstring):
11603 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11604 (get_doc_string, Fsnarf_documentation):
11605 Use int, not EMACS_INT, where int is wide enough.
11606 (get_doc_string):
11607 Use SAFE_ALLOCA, not alloca.
11608 Check for overflow when converting EMACS_INT to off_t.
11609 * doprnt.c (doprnt):
11610 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11611 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11612 Don't assume uid_t fits into fixnum.
11613 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11614 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11615 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11616 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11617 (general_insert_function)
11618 (Finsert_char, make_buffer_string, make_buffer_string_both)
11619 (update_buffer_properties, Fbuffer_substring)
11620 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11621 (Fsubst_char_in_region, check_translation)
11622 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11623 (transpose_markers, Ftranspose_regions):
11624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11625 (clip_to_bounds): Move to lisp.h as an inline function).
11626 (Fconstrain_to_field): Don't assume integers are nonnegative.
11627 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11628 (Fsubst_char_in_region, Fsave_restriction):
11629 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11630 (Femacs_pid): Don't assume pid_t fits into fixnum.
11631 (lo_time): Use int, not EMACS_INT, when int suffices.
11632 (lisp_time_argument): Check for usec out of range.
11633 (Fencode_time): Don't assume fixnum fits in int.
11634 (Fuser_login_name, Fuser_full_name): Signal an error
11635 if a uid argument is out of range, rather than relying on
11636 undefined behavior.
11637 (Fformat_time_string): Remove now-unnecessary check.
11638 lisp_time_argument checks for out-of-range usec now.
11639 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
11640 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11641 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11642 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11643 (init_cmdargs, Fdump_emacs):
11644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11645 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11646 the bottom (typically) 32 bits of the fixnum.
11647 * eval.c (specpdl_size, call_debugger):
11648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11649 (when_entered_debugger, Fbacktrace_debug):
11650 Don't assume fixnum can fit in int.
11651 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11652 the object just before a buffer; this is not portable.
11653 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11654 (grow_specpdl, unbind_to):
11655 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11656 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11657 (grow_specpdl): Simplify allocation by using xpalloc.
11658 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
11659 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11660 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11661 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11662 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11663 (a_write, e_write):
11664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11665 (Fcopy_file, non_regular_nbytes, read_non_regular)
11666 (Finsert_file_contents):
11667 Use int, not EMACS_INT, where int is wide enough.
11668 (READ_BUF_SIZE): Verify that it fits in int.
11669 (Finsert_file_contents): Check that counts are in proper range,
11670 rather than assuming fixnums fit into ptrdiff_t etc.
11671 Don't assume fixnums fit into int.
11672 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
11673 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11674 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
11675 (string_char_to_byte, string_byte_to_char)
11676 (string_make_multibyte, string_to_multibyte)
11677 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11678 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11679 (substring_both, Fdelete, internal_equal, Ffillarray)
11680 (Fclear_string, mapcar1)
11681 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11682 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11683 (larger_vector, make_hash_table, maybe_resize_hash_table)
11684 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11685 (Fmaphash, secure_hash):
11686 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11687 (concat): Check for string index and length overflow.
11688 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11689 (Frequire):
11690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11691 (larger_vector): New API (vec, incr_min, size_max) replaces old
11692 one (vec, new_size, init). This catches size overflow.
11693 INIT was removed because it was always Qnil.
11694 All callers changed.
11695 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11696 the upper bound on a hash table index size.
11697 (make_hash_table, maybe_resize_hash_table): Use it.
11698 (secure_hash): Computer start_byte and end_byte only after
11699 they're known to be in ptrdiff_t range.
11700 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11701 (Ffont_get_glyphs, Ffont_at):
11702 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11703 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11704 (Flist_fonts, Fopen_font):
11705 Don't assume fixnum can fit in int.
11706 (check_gstring): Don't assume index can fit in int.
11707 (font_match_p): Check that fixnum is a character, not a nonnegative
11708 fixnum, since the later code needs to stuff it into an int.
11709 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11710 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11711 conversion overflow issues.
11712 (Fopen_font): Check for integer out of range.
11713 (Ffont_get_glyphs): Don't assume index can fit in int.
11714 * font.h: Adjust decls to match defn changes elsewhere.
11715 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11716 integer overflow.
11717 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11718 printmax_t, where ptrdiff_t is wide enough.
11719 (Finternal_char_font):
11720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11721 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11722 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11723 (Fset_frame_position, x_set_frame_parameters)
11724 (x_set_line_spacing, x_set_border_width)
11725 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11726 Check that fixnums are in proper range for system types.
11727 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11729 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11730 Use SAFE_ALLOCA_LISP, not alloca.
11731 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11732 intptr_t is wide enough.
11733 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11734 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11735 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11736 Check for fixnum out of range.
11737 * ftfont.c (ftfont_list): Don't assume index fits in int.
11738 Check that fixnums are in proper range for system types.
11739 (ftfont_shape_by_flt):
11740 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11741 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11743 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11744 Check that fixnums are in proper range for system types.
11745 * gnutls.h: Adjust decls to match defn changes elsewhere.
11746 * gtkutil.c (xg_dialog_run):
11747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11748 (update_frame_tool_bar):
11749 Check that fixnums are in proper range for system types.
11750 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
11751 (lookup_image): Check that fixnums are in range for system types.
11752 * indent.c (last_known_column, last_known_column_point):
11753 (current_column_bol_cache):
11754 (skip_invisible, current_column, check_display_width):
11755 (check_display_width, scan_for_column, current_column_1)
11756 (Findent_to, Fcurrent_indentation, position_indentation)
11757 (indented_beyond_p, Fmove_to_column, compute_motion):
11758 (Fcompute_motion, Fvertical_motion):
11759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11760 (last_known_column_modified): Use EMACS_INT, not int.
11761 (check_display_width):
11762 (Fcompute_motion):
11763 Check that fixnums and floats are in proper range for system types.
11764 (compute_motion): Don't assume index or fixnum fits in int.
11765 (compute_motion, Fcompute_motion):
11766 Use int, not EMACS_INT, when it is wide enough.
11767 (vmotion): Omit local var start_hpos that is always 0; that way
11768 we don't need to worry about overflow in expressions involving it.
11769 * indent.h: Adjust decls to match defn changes elsewhere.
11770 (struct position):
11771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11772 Use int, not EMACS_INT, where int is wide enough.
11773 Remove unused members ovstring_chars_done and tab_offset;
11774 all uses removed.
11775 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11776 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11777 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11778 (make_gap, copy_text, insert, insert_and_inherit)
11779 (insert_before_markers, insert_before_markers_and_inherit)
11780 (insert_1, count_combining_before, count_combining_after)
11781 (insert_1_both, insert_from_string)
11782 (insert_from_string_before_markers, insert_from_string_1)
11783 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11784 (adjust_after_replace, adjust_after_insert, replace_range)
11785 (replace_range_2, del_range, del_range_1, del_range_byte)
11786 (del_range_both, del_range_2, modify_region)
11787 (prepare_to_modify_buffer, signal_before_change)
11788 (signal_after_change, Fcombine_after_change_execute):
11789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11790 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11791 (balance_an_interval, split_interval_right, split_interval_left)
11792 (find_interval, next_interval, update_interval)
11793 (adjust_intervals_for_insertion, delete_node, delete_interval)
11794 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11795 (static_offset_intervals, offset_intervals)
11796 (merge_interval_right, merge_interval_left, make_new_interval)
11797 (graft_intervals_into_buffer, temp_set_point_both)
11798 (temp_set_point, set_point, adjust_for_invis_intang)
11799 (set_point_both, move_if_not_intangible, get_property_and_range)
11800 (get_local_map, copy_intervals, copy_intervals_to_string)
11801 (compare_string_intervals, set_intervals_multibyte_1):
11802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11803 * intervals.h: Adjust decls to match defn changes elsewhere.
11804 (struct interval):
11805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11806 * keyboard.c (this_command_key_count, this_single_command_key_start)
11807 (before_command_key_count, before_command_echo_length, echo_now)
11808 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11809 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11810 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11811 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11813 (last_non_minibuf_size, last_point_position, echo_truncate)
11814 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11815 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11816 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11817 (stuff_buffered_input):
11818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11819 (last_auto_save, command_loop_1, read_char):
11820 Use EMACS_INT, not int, to avoid integer overflow.
11821 (record_char): Avoid overflow in total_keys computation.
11822 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11823 * keyboard.h: Adjust decls to match defn changes elsewhere.
11824 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11825 (Fkey_description, Fdescribe_vector, Flookup_key):
11826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11827 (click_position): New function, to check that positions are in range.
11828 (Fcurrent_active_maps):
11829 (describe_command):
11830 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11831 (Faccessible_keymaps, Fkey_description):
11832 (preferred_sequence_p):
11833 Don't assume fixnum can fit into int.
11834 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11835 Check for integer overflow in size calculations.
11836 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11837 avoid mishandling large integers.
11838 * lisp.h: Adjust decls to match defn changes elsewhere.
11839 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11840 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11841 (struct Lisp_Marker):
11842 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11843 (clip_to_bounds): Now an inline function, moved here from editfns.c.
11844 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11845 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11846 All callers changed.
11847 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11848 Assume the arg has valid form, since it always does.
11849 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11850 unsigned integer system type.
11851 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11852 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11854 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11855 (duration_to_sec_usec): New decl.
11856 * lread.c (read_from_string_index, read_from_string_index_byte)
11857 (read_from_string_limit, readchar, unreadchar, openp)
11858 (read_internal_start, read1, oblookup):
11859 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11860 (Fload, readevalloop, Feval_buffer, Feval_region):
11861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11862 (openp): Check for out-of-range argument to 'access'.
11863 (read1): Use int, not EMACS_INT, where int is wide enough.
11864 Don't assume fixnum fits into int.
11865 Fix off-by-one error that can read outside a buffer.
11866 (read_filtered_event): Use duration_to_sec_usec
11867 to do proper overflow checking on durations.
11868 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11869 in size calculation.
11870 (Fexecute_kbd_macro):
11871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11872 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11873 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11874 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11875 (set_marker_both, set_marker_restricted_both, marker_position)
11876 (marker_byte_position, Fbuffer_has_markers_at):
11877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11878 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
11879 * menu.c (ensure_menu_items): Rename from grow_menu_items.
11880 It now merely ensures that the menu is large enough, without
11881 necessarily growing it, as this avoids some integer overflow issues.
11882 All callers changed.
11883 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11885 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11886 Use SAFE_ALLOCA_LISP, not alloca.
11887 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11888 to EMACS_INT. Check that fixnums are in proper range for system types.
11889 * minibuf.c (minibuf_prompt_width, string_to_object)
11890 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11891 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11893 (get_minibuffer, read_minibuf_unwind):
11894 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11895 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11896 this simplifies overflow checking. All callers changed.
11897 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11898 (Ftest_completion):
11899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11900 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11901 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11902 Check that fixnums are in proper range for system types.
11903 (Fx_create_frame, Fx_show_tip):
11904 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11905 * nsfont.m (ns_findfonts, nsfont_list_family):
11906 Don't assume fixnum fits in long.
11907 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11909 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11910 wide enough.
11911 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
11912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11913 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11914 (PRINTDECLARE, PRINTPREPARE):
11915 (strout, print_string):
11916 (print, print_preprocess, print_check_string_charset_prop)
11917 (print_object):
11918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11919 (PRINTDECLARE):
11920 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11922 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
11923 (printchar, strout): Use xpalloc to catch size calculation overflow.
11924 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
11925 (print_error_message): Use SAFE_ALLOCA, not alloca.
11926 (print_object): Use int, not EMACS_INT, where int is wide enough.
11927 (print_depth, new_backquote_output, print_number_index):
11928 Use ptrdiff_t, not int, where int might not be wide enough.
11929 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11930 (Fset_process_window_size, Fformat_network_address)
11931 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
11932 (sigchld_handler):
11933 Check that fixnums are in proper range for system types.
11934 (Fsignal_process): Simplify by avoiding a goto.
11935 Check for process-ids out of pid_t range rather than relying on
11936 undefined behavior.
11937 (process_tick, update_tick): Use EMACS_INT, not int.
11938 (Fformat_network_address, read_process_output, send_process)
11939 (Fprocess_send_region, status_notify):
11940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11941 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11942 (wait_reading_process_output, read_process_output, exec_sentinel):
11943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11944 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11945 (Faccept_process_output): Use duration_to_sec_usec to do proper
11946 overflow checking on durations.
11947 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11948 Don't assume pid_t fits in int.
11949 * process.h (struct Lisp_Process): Members tick and update_tick
11950 are now of type EMACS_INT, not int.
11951 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11952 configured --with-wide-int.
11953 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11954 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11955 * search.c (looking_at_1, string_match_1):
11956 (fast_string_match, fast_c_string_match_ignore_case)
11957 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11958 (scan_newline, find_before_next_newline, search_command)
11959 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11960 (set_search_regs, wordify):
11961 (Freplace_match):
11962 (Fmatch_data):
11963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11964 (string_match_1, search_buffer, set_search_regs):
11965 (Fmatch_data):
11966 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11967 (wordify): Check for overflow in size calculation.
11968 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11969 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11970 Check that fixnums are in proper range for system types.
11971 * sound.c (struct sound_device)
11972 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11974 (Fplay_sound_internal):
11975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11976 * syntax.c (struct lisp_parse_state, find_start_modiff)
11977 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11978 (Fparse_partial_sexp):
11979 Don't assume fixnums can fit in int.
11980 (struct lisp_parse_state, find_start_pos, find_start_value)
11981 (find_start_value_byte, find_start_begv)
11982 (update_syntax_table, char_quoted, dec_bytepos)
11983 (find_defun_start, prev_char_comend_first, back_comment):
11984 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
11985 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
11986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11987 (Finternal_describe_syntax_value): Check that match_lisp is a
11988 character, not an integer, since the code stuffs it into int.
11989 (scan_words, scan_sexps_forward):
11990 Check that fixnums are in proper range for system types.
11991 (Fforward_word):
11992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11993 (scan_sexps_forward):
11994 Use CHARACTERP, not INTEGERP, since the value must fit into int.
11995 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
11996 * syntax.h: Adjust decls to match defn changes elsewhere.
11997 (struct gl_state_s):
11998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11999 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12000 MOST_POSITIVE_FIXNUM.
12001 * sysdep.c (wait_for_termination_1, wait_for_termination)
12002 (interruptible_wait_for_termination, mkdir):
12003 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12004 (emacs_read, emacs_write):
12005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12006 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12007 and double all fit in int.
12008 * term.c (set_tty_color_mode):
12009 Check that fixnums are in proper range for system types.
12010 * termhooks.h (struct input_event):
12011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12012 * textprop.c (validate_interval_range, interval_of)
12013 (Fadd_text_properties, set_text_properties_1)
12014 (Fremove_text_properties, Fremove_list_of_text_properties)
12015 (Ftext_property_any, Ftext_property_not_all)
12016 (copy_text_properties, text_property_list, extend_property_ranges)
12017 (verify_interval_modification):
12018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12019 (Fnext_single_char_property_change)
12020 (Fprevious_single_char_property_change):
12021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12022 (copy_text_properties):
12023 Check for integer overflow in index calculation.
12024 * undo.c (last_boundary_position, record_point, record_insert)
12025 (record_delete, record_marker_adjustment, record_change)
12026 (record_property_change):
12027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12028 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12029 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12030 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12031 (Fx_hide_tip, Fx_file_dialog):
12032 * w32menu.c (set_frame_menubar):
12033 Use ptrdiff_t, not int, for consistency with rest of code.
12034 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12035 (select_window, Fdelete_other_windows_internal)
12036 (window_scroll_pixel_based, window_scroll_line_based)
12037 (Frecenter, Fset_window_configuration):
12038 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12039 (Fset_window_hscroll, run_window_configuration_change_hook)
12040 (set_window_buffer, temp_output_buffer_show, scroll_command)
12041 (Fscroll_other_window, Frecenter):
12042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12043 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12044 Don't assume fixnum fits in int.
12045 (Fset_window_scroll_bars):
12046 Check that fixnums are in proper range for system types.
12047 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12048 (string_pos, c_string_pos, number_of_chars, init_iterator)
12049 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12050 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12051 (compute_display_string_end, handle_face_prop)
12052 (face_before_or_after_it_pos, handle_invisible_prop)
12053 (handle_display_prop, handle_display_spec, handle_single_display_spec)
12054 (display_prop_intangible_p, string_buffer_position_lim)
12055 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12056 (get_overlay_strings_1, get_overlay_strings)
12057 (iterate_out_of_display_property, forward_to_next_line_start)
12058 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12059 (get_next_display_element, set_iterator_to_next)
12060 (get_visually_first_element, compute_stop_pos_backwards)
12061 (handle_stop_backwards, next_element_from_buffer)
12062 (move_it_in_display_line_to, move_it_in_display_line)
12063 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12064 (add_to_log, message_dolog, message_log_check_duplicate)
12065 (message2, message2_nolog, message3, message3_nolog
12066 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12067 (current_message_1, truncate_echo_area, truncate_message_1)
12068 (set_message, set_message_1, store_mode_line_noprop)
12069 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12070 (text_outside_line_unchanged_p, check_point_in_composition)
12071 (reconsider_clip_changes)
12072 (redisplay_internal, set_cursor_from_row, try_scrolling)
12073 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12074 (redisplay_window, find_last_unchanged_at_beg_row)
12075 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12076 (trailing_whitespace_p, find_row_edges, display_line)
12077 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12078 (display_mode_element, store_mode_line_string)
12079 (pint2str, pint2hrstr, decode_mode_spec)
12080 (display_count_lines, display_string, draw_glyphs)
12081 (x_produce_glyphs, x_insert_glyphs)
12082 (rows_from_pos_range, mouse_face_from_buffer_pos)
12083 (fast_find_string_pos, mouse_face_from_string_pos)
12084 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12086 (safe_call, init_from_display_pos, handle_fontified_prop)
12087 (handle_single_display_spec, load_overlay_strings)
12088 (with_echo_area_buffer, setup_echo_area_for_printing)
12089 (display_echo_area, echo_area_display)
12090 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12091 (update_tool_bar, hscroll_window_tree, redisplay_internal)
12092 (redisplay_window, dump_glyph_row, display_mode_line)
12093 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12094 (handle_display_spec, display_prop_string_p):
12095 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12096 (handle_single_display_spec, build_desired_tool_bar_string)
12097 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12098 (get_specified_cursor_type):
12099 Check that fixnums are in proper range for system types.
12100 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12101 (Flookup_image_map):
12102 Don't assume fixnums fit in int.
12103 (compare_overlay_entries):
12104 Avoid mishandling comparisons due to subtraction overflow.
12105 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12106 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12107 (handle_tool_bar_click):
12108 Use int, not unsigned, since we prefer signed and the signedness
12109 doesn't matter here.
12110 (get_next_display_element, next_element_from_display_vector):
12111 Use int, not EMACS_INT, when int is wide enough.
12112 (start_hourglass): Use duration_to_sec_usec to do proper
12113 overflow checking on durations.
12114 * xfaces.c (Fbitmap_spec_p):
12115 Check that fixnums are in proper range for system types.
12116 (compare_fonts_by_sort_order):
12117 Avoid mishandling comparisons due to subtraction overflow.
12118 (Fx_family_fonts, realize_basic_faces):
12119 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12120 (Fx_family_fonts):
12121 Don't assume fixnum fits in int.
12122 Use SAFE_ALLOCA_LISP, not alloca.
12123 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12124 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12125 (face_at_buffer_position, face_for_overlay_string)
12126 (face_at_string_position):
12127 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12128 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12129 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12130 (Fx_show_tip):
12131 Check that fixnums are in proper range for system types.
12132 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12133 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12134 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12135 (Fx_change_window_property): Don't assume fixnums fit in int.
12136 * xfont.c (xfont_chars_supported):
12137 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12138 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12139 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12140 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12141 * xml.c (parse_region):
12142 * xrdb.c (magic_file_p):
12143 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12144 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12145 (x_get_local_selection, x_reply_selection_request)
12146 (x_handle_selection_request, wait_for_property_change):
12147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12148 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12149 short is wide enough.
12150 (x_send_client_event): Don't assume fixnum fits in int.
12151 * xterm.c (x_x_to_emacs_modifiers):
12152 Don't assume EMACS_INT overflows nicely into int.
12153 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12154 may come from Lisp.
12155 (handle_one_xevent): NATNUMP can eval its arg twice.
12156 (x_connection_closed):
12157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12158 * xterm.h: Adjust decls to match defn changes elsewhere.
12159 (struct scroll_bar): Use struct vectorlike_header
12160 rather than rolling our own approximation.
12161 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12162
12163 2012-05-25 Glenn Morris <rgm@gnu.org>
12164
12165 * lisp.mk (lisp): Update for more files being compiled now.
12166
12167 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12168
12169 * lread.c: Remove `read_pure' which makes no difference.
12170 (read_pure): Remove var.
12171 (unreadpure): Remove function.
12172 (readevalloop): Don't call read_list with -1 flag.
12173 (read1, read_vector): Don't test read_pure any more.
12174 (read_list): Simplify.
12175
12176 * fileio.c, character.h: Minor style tweaks.
12177
12178 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12179
12180 * window.h (clip_changed): Remove useless declaration.
12181
12182 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
12183
12184 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12185 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12186
12187 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12188
12189 Remove src/m/*.
12190 This directory predates autoconf and is no longer needed nowadays.
12191 Move its few remaining bits of functionality to where they're needed.
12192 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12193 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12194 * m/template.h: Remove.
12195 * Makefile.in (M_FILE): Remove. All uses removed.
12196 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12197 * lisp.h (USE_LSB_TAG):
12198 * mem-limits.h (EXCEEDS_LISP_PTR):
12199 Use VAL_MAX, not VALBITS, in #if.
12200 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12201 (EMACS_UINT): Define unconditionally now.
12202 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12203 (BITS_PER_EMACS_INT): New constants, replacing
12204 what used to be in config.h, but not useful in #if.
12205 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12206 define them any more.
12207 (VAL_MAX): New macro.
12208 (VALMASK): Use it.
12209 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12210 BITS_PER_EMACS_INT, in #if.
12211 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12212 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12213 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12214 * s/ms-w32.h (DATA_START):
12215 Move here from removed file m/intel386.h.
12216 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12217 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12218
12219 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12220
12221 Assume C89 or later.
12222 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12223 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12224 (xrealloc):
12225 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12226 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12227 * textprop.c, tparam.c (NULL): Remove.
12228 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12229 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12230 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12231 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12232 * xterm.c (input_signal_count): Assume volatile works.
12233
12234 2012-05-21 Ken Brown <kbrown@cornell.edu>
12235
12236 * xgselect.c (xg_select): Fix first argument in call to 'select'
12237 (bug#11508).
12238
12239 2012-05-20 Ken Brown <kbrown@cornell.edu>
12240
12241 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
12242 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
12243
12244 2012-05-19 Ken Brown <kbrown@cornell.edu>
12245
12246 * xfns.c (x_in_use): Remove `static' qualifier.
12247 * xterm.h (x_in_use): Declare.
12248 * xgselect.c: Include xterm.h.
12249 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12250 and `display_arg' (bug#9754).
12251
12252 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12253
12254 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12255
12256 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12257 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12258
12259 2012-05-18 Eli Zaretskii <eliz@gnu.org>
12260
12261 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12262
12263 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
12264 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
12265
12266 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12267 reference to image_cache->refcount.
12268 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12269
12270 2012-05-17 Juri Linkov <juri@jurta.org>
12271
12272 * search.c (Fword_search_regexp, Fword_search_backward)
12273 (Fword_search_forward, Fword_search_backward_lax)
12274 (Fword_search_forward_lax): Move functions to isearch.el
12275 (bug#10145, bug#11381).
12276
12277 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12278
12279 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12280
12281 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12282
12283 * lread.c (init_obarray): Declare Qt and Qnil as special.
12284
12285 2012-05-14 Glenn Morris <rgm@gnu.org>
12286
12287 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12288 Put "libexec" before "bin", for the sake of init_callproc_1.
12289
12290 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12291
12292 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12293
12294 * unexaix.c: Port to more-recent AIX compilers.
12295 (report_error, report_error_1, make_hdr, copy_sym)
12296 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12297 Make arguments const char *, not char *, to avoid violations of C
12298 standard and to fix some AIX warnings reported by Gilles Pion.
12299
12300 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12301
12302 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12303 already have overlays loaded.
12304 (handle_single_display_spec): Before returning without displaying
12305 fringe bitmap, synchronize the bidi iterator with the main display
12306 iterator, by calling iterate_out_of_display_property.
12307 (iterate_out_of_display_property): Detect buffer iteration by
12308 testing that it->string is a Lisp string.
12309 (get_next_display_element): When the current object is exhausted,
12310 and there's something on it->stack, call set_iterator_to_next to
12311 proceed with what's on the stack, instead of returning zero.
12312 (set_iterator_to_next): If called at the end of a Lisp string,
12313 proceed to consider_string_end without incrementing string
12314 position. Don't increment display vector index past the end of
12315 the display vector. (Bug#11417)
12316 (pos_visible_p): Don't report a position visible when move_it_to
12317 stopped at the last line of window, which happens to be scanned
12318 backwards by the bidi iteration. (Bug#11464)
12319
12320 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12321
12322 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12323 and right-margin display specs even if the spec is invalid or we
12324 are on a TTY, and thus unable to display on the fringes.
12325 That's because the text with the property will not be displayed anyway,
12326 so we need to signal to the caller that this is a "replacing"
12327 display spec. This fixes display when the spec is invalid or we
12328 are on a TTY.
12329
12330 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12331
12332 * unexaix.c (make_hdr): Fix typo in prototype.
12333 This bug broke the build on AIX. Problem reported by Gilles Pion.
12334
12335 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
12336
12337 * keyboard.c (kbd_buffer_get_event): Read special events also in
12338 batch mode. (Bug#11415)
12339
12340 2012-05-12 Glenn Morris <rgm@gnu.org>
12341
12342 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12343
12344 2012-05-12 Eli Zaretskii <eliz@gnu.org>
12345
12346 * lisp.mk (lisp): Add newcomment.elc.
12347
12348 2012-05-12 Glenn Morris <rgm@gnu.org>
12349
12350 * Makefile.in (MKDIR_P): New, set by configure.
12351 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12352
12353 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12354
12355 Remove unused function hourglass_started.
12356 * dispextern.h (hourglass_started):
12357 * w32fns.c (hourglass_started):
12358 * xdisp.c (hourglass_started): Remove.
12359
12360 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
12361
12362 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12363 Update dependencies.
12364
12365 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12366
12367 * xgselect.c (xg_select): Put maxfds+1 into a var.
12368 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12369
12370 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12371
12372 2012-05-10 Dave Abrahams <dave@boostpro.com>
12373
12374 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12375 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12376
12377 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
12378
12379 * dbusbind.c (xd_registered_buses): New internal Lisp object.
12380 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
12381 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12382 Initialize xd_registered_buses.
12383
12384 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12385
12386 Untag more efficiently if USE_LSB_TAG.
12387 This is based on a proposal by YAMAMOTO Mitsuharu in
12388 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12389 For an admittedly artificial (nth 8000 longlist) benchmark on
12390 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12391 Emacs's overall text size by 1%.
12392 * lisp.h (XUNTAG): New macro.
12393 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12394 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12395 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12396 * eval.c (Fautoload):
12397 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12398 * frame.h (XFRAME): Use XUNTAG.
12399
12400 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12401 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12402 Remove unportable assumptions about print widths of types like
12403 dbus_uint32_t.
12404 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12405 intptr_t when converting between pointer and integer, to avoid GCC
12406 warnings about wrong width.
12407
12408 2012-05-09 Eli Zaretskii <eliz@gnu.org>
12409
12410 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12411 stack for each reader_thread, instead of defaulting to 8MB
12412 determined by the linker. This avoids failures in creating
12413 subprocesses on Windows 7, see the discussion in this thread:
12414 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12415
12416 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12417
12418 Fix up display of the *Minibuf-0* buffer in the mini window.
12419 * keyboard.c (read_char): Don't clear the echo area if there's no
12420 message to clear.
12421 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
12422 contents of *Minibuf-0*) if there's no message displayed in its stead.
12423
12424 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
12425
12426 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12427 batch mode.
12428
12429 2012-05-06 Chong Yidong <cyd@gnu.org>
12430
12431 * lisp.mk (lisp): Update.
12432
12433 2012-05-05 Jim Meyering <meyering@redhat.com>
12434
12435 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12436
12437 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12438
12439 * data.c (PUT_ERROR): New macro.
12440 (syms_of_data): Use it. Add new error type `user-error'.
12441 * undo.c (user_error): New function.
12442 (Fprimitive_undo): Use it.
12443 * print.c (print_error_message): Adjust print style for `user-error'.
12444 * keyboard.c (user_error): New function.
12445 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12446
12447 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12448
12449 Do not limit current-time-string to years 1000..9999.
12450 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12451 (Fcurrent_time_string): Support any year that is supported by the
12452 underlying localtime representation. Don't use asctime, as it
12453 has undefined behavior for years outside the range -999..9999.
12454
12455 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12456
12457 Fix race conditions involving setenv, gmtime, localtime, asctime.
12458 Without this fix, interrupts could mess up code that uses these
12459 nonreentrant functions, since setting TZ invalidates existing
12460 tm_zone or tzname values, and since most of these functions return
12461 pointers to static storage.
12462 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12463 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12464 Grow the critical sections to include not just invoking
12465 localtime/gmtime, but also accessing these functions' results
12466 including their tm_zone values if any, and any related TZ setting.
12467 (format_time_string): Last arg is now struct tm *, not struct tm **,
12468 so that the struct tm is saved in the critical section.
12469 All callers changed. Simplify allocation of initial buffer, partly
12470 motivated by the fact that memory allocation needs to be outside
12471 the critical section.
12472
12473 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12474
12475 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12476 with RESET_INTERVAL.
12477
12478 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12479 Remove duplicated buffer name initialization.
12480
12481 2012-05-02 Jim Meyering <jim@meyering.net>
12482
12483 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12484
12485 * xfns.c (x_window): Use xstrdup (Bug#11375).
12486
12487 2012-05-02 Eli Zaretskii <eliz@gnu.org>
12488
12489 * xdisp.c (pos_visible_p): If already at a newline from the
12490 display string before the 'while' loop, don't walk back the glyphs
12491 from it3.glyph_row. Solves assertion violation when the display
12492 string begins with a newline (egg.el). (Bug#11367)
12493
12494 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12495
12496 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12497 Move to simple.el.
12498
12499 2012-05-01 Glenn Morris <rgm@gnu.org>
12500
12501 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12502 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12503 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12504 All were removed before 23.1.
12505
12506 * dispnew.c: Remove HAVE_LIBNCURSES test;
12507 it is always true on relevant platforms.
12508
12509 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12510 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12511
12512 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12513
12514 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12515
12516 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12517 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12518 Remove.
12519
12520 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12521
12522 Do not avoid creating empty evaporating overlays (Bug#9642).
12523 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12524 That is, do not delete an evaporating overlay if it becomes
12525 empty after its bounds are adjusted to fit within its buffer.
12526 This fix caused other problems, and I'm reverting it until we get
12527 to the bottom of them.
12528
12529 2012-04-27 Chong Yidong <cyd@gnu.org>
12530
12531 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12532
12533 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12534
12535 * xdisp.c (pos_visible_p): If the window start position is beyond
12536 ZV, start the display from buffer beginning. Prevents assertion
12537 violation in init_iterator when the minibuffer window is scrolled
12538 via the scroll bar.
12539
12540 * window.c (window_scroll_pixel_based): Likewise.
12541
12542 2012-04-27 Chong Yidong <cyd@gnu.org>
12543
12544 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12545
12546 2012-04-27 Glenn Morris <rgm@gnu.org>
12547
12548 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12549 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12550
12551 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12552
12553 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12554 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
12555
12556 2012-04-26 Eli Zaretskii <eliz@gnu.org>
12557
12558 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12559 display element, check also the underlying string or buffer
12560 character. (Bug#11341)
12561
12562 * w32menu.c: Include w32heap.h.
12563 (add_menu_item): If the call to AppendMenuW (via
12564 unicode_append_menu) fails, disable Unicode menus only if we are
12565 running on Windows 9X/Me.
12566
12567 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12568
12569 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12570 (xgetint): Add missing shift for LSB tags.
12571
12572 2012-04-24 Martin Rudalics <rudalics@gmx.at>
12573
12574 * keyboard.c (read_char): Don't wipe echo area for select window
12575 events: These might get delayed via `mouse-autoselect-window'
12576 (Bug#11304).
12577
12578 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
12579
12580 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12581 manipulation of :loaded-from data.
12582
12583 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
12584
12585 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12586 now a cons (bug#11311).
12587
12588 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12589
12590 Do not create empty overlays with the evaporate property (Bug#9642).
12591 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12592 if it becomes empty after its bounds are adjusted to fit within
12593 its buffer. Without this fix, in a nonempty buffer (let ((o
12594 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12595 yields an empty overlay that has the evaporate property, which is
12596 not supposed to happen.
12597
12598 Fix minor GTK3 problems found by static checking.
12599 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12600 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12601 (struct _EmacsFixedClass, emacs_fixed_get_type):
12602 Move decls here from emacsgtkfixed.h, since they needn't be public.
12603 (emacs_fixed_get_type): Now static.
12604 (emacs_fixed_class_init): Omit unused local.
12605 (emacs_fixed_child_type): Remove; unused.
12606 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12607 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12608 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12609 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12610 (EMACS_FIXED_GET_CLASS): Remove; unused.
12611 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12612
12613 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12614 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12615
12616 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12617
12618 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
12619 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
12620 (__malloc_size_t, __malloc_ptrdiff_t):
12621 Remove. All uses removed, replaced by the definiens if needed,
12622 since we can assume C89 or better now.
12623 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12624 (protect_malloc_state, align, get_contiguous_space)
12625 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12626 (malloc_atfork_handler_child, malloc_enable_thread)
12627 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12628 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12629 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12630 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12631 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12632 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12633 Define using prototypes, not old style.
12634 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12635 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12636 (align): Don't assume that signed integer overflow wraps around.
12637 Omit unused local var.
12638 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12639 (_free_internal_nolock, memalign, mallochook, reallochook):
12640 Omit no-longer-needed casts.
12641 (valloc): Use getpagesize, not __getpagesize.
12642 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12643 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12644
12645 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12646
12647 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
12648
12649 Move functions from C to Lisp. Make non-blocking method calls
12650 the default. Implement further D-Bus standard interfaces.
12651
12652 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12653 (QCdbus_request_name_allow_replacement)
12654 (QCdbus_request_name_replace_existing)
12655 (QCdbus_request_name_do_not_queue)
12656 (QCdbus_request_name_reply_primary_owner)
12657 (QCdbus_request_name_reply_in_queue)
12658 (QCdbus_request_name_reply_exists)
12659 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12660 (QCdbus_registered_serial, QCdbus_registered_method)
12661 (QCdbus_registered_signal): New Lisp objects.
12662 (XD_DEBUG_MESSAGE): Use sizeof.
12663 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12664 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12665 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12666 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12667 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12668 (xd_signature, xd_append_arg): Allow float for integer types.
12669 (xd_get_connection_references): New function.
12670 (xd_get_connection_address): Rename from xd_initialize.
12671 Return cached address.
12672 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12673 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12674 level.
12675 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
12676 Return number of refcounts.
12677 (Fdbus_get_unique_name): Make stronger parameter check.
12678 (Fdbus_message_internal): New defun.
12679 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12680 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12681 (Fdbus_send_signal, Fdbus_register_service)
12682 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12683 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12684 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12685 (Vdbus_compiled_version, Vdbus_runtime_version)
12686 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12687 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12688 (Vdbus_message_type_signal): New defvars.
12689 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12690 Adapt docstring.
12691
12692 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12693
12694 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12695 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12696 Do not assume ptrdiff_t is the same width as 'int'.
12697
12698 * alloc.c: Handle unusual debugging option combinations.
12699 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12700 since the two debugging options are incompatible.
12701 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12702 is defined.
12703 (mem_init, mem_insert, mem_insert_fixup):
12704 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12705 (NEED_MEM_INSERT): Remove; no longer needed.
12706
12707 2012-04-22 Leo Liu <sdl.web@gmail.com>
12708
12709 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12710
12711 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12712
12713 * sysdep.c [__FreeBSD__]: Minor cleanups.
12714 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12715 Use Emacs indenting style more consistently. Avoid some casts.
12716 Use 'double' consistently rather than mixing 'float' and 'double'.
12717
12718 2012-04-21 Eduard Wiebe <usenet@pusto.de>
12719
12720 * sysdep.c (list_system_processes, system_process_attributes):
12721 Add implementation for FreeBSD (Bug#5243).
12722
12723 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12724
12725 * lisp.mk (lisp): Update.
12726
12727 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12730 It is never used otherwise.
12731
12732 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12733
12734 * print.c (print_preprocess): Only check print_depth if print-circle
12735 is nil.
12736 (print_object): Check for cycles even when print-circle is nil and
12737 print-gensym is t, but only check print_depth if print-circle is nil.
12738
12739 2012-04-20 Chong Yidong <cyd@gnu.org>
12740
12741 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12742 set the status to "failed" and ensure that sentinel is run.
12743
12744 2012-04-20 Glenn Morris <rgm@gnu.org>
12745
12746 * process.c (Fset_process_inherit_coding_system_flag)
12747 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
12748 (Fmake_network_process, Fmake_serial_process): Doc fix.
12749
12750 2012-04-20 Eli Zaretskii <eliz@gnu.org>
12751
12752 * xdisp.c (string_buffer_position_lim): Limit starting position to
12753 BEGV.
12754 (set_cursor_from_row): If called for a mode-line or header-line
12755 row, return zero immediately.
12756 (try_cursor_movement): If inside continuation line, don't back up
12757 farther than the first row after the header line, if any.
12758 Don't consider the header-line row as "partially visible", even if
12759 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12760
12761 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12762
12763 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12764 (bug#11238).
12765
12766 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
12767 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
12768
12769 configure: new option --enable-gcc-warnings (Bug#11207)
12770 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12771 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12772 (ALL_CFLAGS): Use new macros rather than old.
12773 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12774 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12775 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12776 -Wunused-result, -Wunused-variable. This should go away once
12777 the Emacs and Gnulib regex code is merged.
12778 (xmalloc, xrealloc): Now static.
12779
12780 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12781
12782 * dired.c (Fsystem_groups): Remove unused local.
12783
12784 2012-04-17 Glenn Morris <rgm@gnu.org>
12785
12786 * dired.c (Fsystem_users): Doc fix.
12787
12788 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12789
12790 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12791 (syms_of_dired): Add them.
12792
12793 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12794
12795 Fix minor alloc.c problems found by static checking.
12796 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12797 New extern decls, to avoid calling undeclared functions.
12798 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12799 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12800 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12801 (NEED_MEM_INSERT): New macro.
12802 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
12803 Remove one incorrect comment and fix another.
12804
12805 Fix minor ralloc.c problems found by static checking.
12806 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12807 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12808 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12809 (r_alloc_sbrk): Now static.
12810
12811 Improve ralloc.c interface checking.
12812 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12813 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12814 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12815 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12816 [REL_ALLOC]: ... to here, to check interface.
12817 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12818 Remove decls. This fixes an "It stinks!".
12819
12820 * alloc.c (which_symbols): Fix alignment issue / type clash.
12821
12822 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12823
12824 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12825 (struct Lisp_Misc_Any): Likewise.
12826 (struct Lisp_Free): Likewise.
12827 * alloc.c (union aligned_Lisp_Symbol): Define.
12828 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12829 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12830 (union aligned_Lisp_Misc): Define.
12831 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12832 aligned_Lisp_Misc instead of union Lisp_Misc.
12833 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
12834
12835 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12836
12837 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12838 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12839 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12840 * s/netbsd.h, s/sol2-6.h:
12841 Remove definition of GC_MARK_STACK, since the default now works.
12842 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12843 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12844 no longer the default.
12845 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12846
12847 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12848
12849 * lread.c (lisp_file_lexically_bound_p):
12850 Fix hang at ";-*-\n" (bug#11238).
12851
12852 2012-04-14 Eli Zaretskii <eliz@gnu.org>
12853
12854 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12855 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12856
12857 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12858
12859 * nsterm.m (constrainFrameRect): Always constrain when there is only
12860 one screen (Bug#10962).
12861
12862 2012-04-13 Ken Brown <kbrown@cornell.edu>
12863
12864 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12865
12866 2012-04-13 Reuben Thomas <rrt@sc3d.org>
12867
12868 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12869
12870 2012-04-11 Daniel Colascione <dancol@dancol.org>
12871
12872 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12873 against is gone. It's better to use vfork now so that when Cygwin
12874 gains a new, working vfork, we use it automatically (bug#10398).
12875
12876 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12877
12878 * window.c (save_window_save): Obey window-point-insertion-type.
12879
12880 2012-04-11 Glenn Morris <rgm@gnu.org>
12881
12882 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12883
12884 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12885
12886 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12887
12888 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
12889
12890 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12891 (force_quit_count): New var.
12892 (handle_interrupt): Use it.
12893
12894 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
12895
12896 * w32.c (w32_delayed_load): Record the full path of the library
12897 being loaded (bug#10424).
12898
12899 2012-04-09 Glenn Morris <rgm@gnu.org>
12900
12901 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12902 not just in the obarray, before snarfing them. (Bug#11036)
12903
12904 * Makefile.in ($(leimdir)/leim-list.el):
12905 Pass EMACS rather than BUILT_EMACS.
12906
12907 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12908
12909 * process.c (make_process):
12910 * process.h: Add integer `gnutls_handshakes_tried' member to
12911 process struct.
12912
12913 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12914 Add convenience `GNUTLS_LOG2i' macro.
12915
12916 * gnutls.c (gnutls_log_function2i): Convenience log function.
12917 (emacs_gnutls_read): Use new log functions,
12918 `gnutls_handshakes_tried' process member, and
12919 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12920 attempts per process (connection).
12921
12922 2012-04-09 Chong Yidong <cyd@gnu.org>
12923
12924 * eval.c (Fuser_variable_p, user_variable_p_eh)
12925 (lisp_indirect_variable): Functions deleted.
12926 (Fdefvar): Caller changed.
12927
12928 * callint.c (Finteractive, Fcall_interactively):
12929 * minibuf.c (Fread_variable): Callers changed.
12930
12931 2012-04-09 Eli Zaretskii <eliz@gnu.org>
12932
12933 * xdisp.c (set_cursor_from_row): If the display string appears in
12934 the buffer at position that is closer to point than the position
12935 after the display string, display the cursor on the first glyph of
12936 the display string. Fixes cursor display when a 'display' text
12937 property immediately follows invisible text. (Bug#11094)
12938
12939 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12940
12941 composite.c: use 'double' consistently
12942 * composite.c (get_composition_id): Use 'double' consistently
12943 instead of converting 'float' to 'double' and vice versa; this is
12944 easier to understand and avoids a GCC warning.
12945
12946 2012-04-09 Glenn Morris <rgm@gnu.org>
12947
12948 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12949 preparation for dumping it with emacs. (Bug#4789)
12950 (leimdir): New variable.
12951 ($(leimdir)/leim-list.el): New rule.
12952 (emacs$(EXEEXT)): Depend on leim-list.el.
12953
12954 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12955 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12956 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12957
12958 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12959
12960 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12961 proper alignment.
12962
12963 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
12964
12965 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12966 Remove unused local variable.
12967
12968 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12969
12970 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12971 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12972 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12973 objects, as mark_maybe_pointer will catch them otherwise.
12974 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12975 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12976
12977 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12978
12979 Fix typo that broke non-Windows builds.
12980 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12981
12982 2012-04-07 Eli Zaretskii <eliz@gnu.org>
12983
12984 Support building on MS-Windows with libxml2.
12985
12986 * makefile.w32-in (OBJ2): Add xml.$(O).
12987 (GLOBAL_SOURCES): Add xml.c.
12988 ($(BLD)/xml.$(O)): New dependency list.
12989
12990 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
12991 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
12992 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
12993 [!WINDOWSNT]: New macros.
12994 (init_libxml2_functions, libxml2_loaded_p): New functions.
12995 (parse_region): Call fn_xmlCheckVersion instead of using the macro
12996 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
12997 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
12998 Calls xmlCleanupParser only if libxml2 was loaded (or statically
12999 linked in).
13000 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13001 Call init_libxml2_functions before calling libxml2 functions.
13002 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13003
13004 * emacs.c: Don't include libxml/parser.h.
13005 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13006 xmlCleanupParser directly.
13007
13008 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13009
13010 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13011
13012 * indent.c (Fvertical_motion): If there is a display string at
13013 point, use it.vpos to compute how many lines to backtrack after
13014 move_it_to point. (Bug#11133)
13015
13016 2012-04-06 Eli Zaretskii <eliz@gnu.org>
13017
13018 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13019 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13020 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13021 macros related to unification of CJK characters. For the details,
13022 see the discussion following the message here:
13023 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13024
13025 2012-04-04 Chong Yidong <cyd@gnu.org>
13026
13027 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13028
13029 2012-04-01 Eli Zaretskii <eliz@gnu.org>
13030
13031 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13032 instead of alloca. (Bug#11138)
13033
13034 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13035
13036 * w32menu.c (is_simple_dialog): Properly check lisp types.
13037 (Bug#11141)
13038
13039 2012-03-31 Eli Zaretskii <eliz@gnu.org>
13040
13041 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13042 position we get to after a call to move_it_to fails the
13043 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13044 only if we wind up in a string from display property. (Bug#11063)
13045
13046 * window.c (Fdelete_other_windows_internal): Invalidate the row
13047 and column information about mouse highlight, so that redisplay
13048 restores it after reallocating the glyph matrices. (Bug#7464)
13049
13050 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13051 string comes from a `display' text property, use the buffer
13052 position of that property as if we actually saw that position in
13053 the row's glyphs.
13054 (move_it_by_lines): Remove the assertion that
13055 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13056 violated when there's a before-string at the beginning of a line.
13057 (Bug#11063)
13058
13059 2012-03-30 Eli Zaretskii <eliz@gnu.org>
13060
13061 * xdisp.c (append_space_for_newline): If the default face was
13062 remapped, use the remapped face for the appended newline.
13063 (extend_face_to_end_of_line): Use the remapped default face for
13064 extending the face to the end of the line.
13065 (display_line): Call extend_face_to_end_of_line when the default
13066 face was remapped. (Bug#11068)
13067
13068 2012-03-29 Eli Zaretskii <eliz@gnu.org>
13069
13070 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13071
13072 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13073
13074 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13075
13076 2012-03-27 Glenn Morris <rgm@gnu.org>
13077
13078 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13079 Doc fixes.
13080
13081 2012-03-26 Kenichi Handa <handa@m17n.org>
13082
13083 * dispextern.h (struct glyph): Fix previous change. Change the
13084 bit length of glyphless.ch to 25 (Bug#11082).
13085
13086 2012-03-26 Chong Yidong <cyd@gnu.org>
13087
13088 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13089 (command_loop_1): Use it; inhibit selection update for
13090 handle-select-window too (Bug#8996).
13091
13092 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13093
13094 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13095
13096 2012-03-25 Kenichi Handa <handa@m17n.org>
13097
13098 * dispextern.h (struct glyph): Change the bit length of
13099 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13100
13101 2012-03-24 Eli Zaretskii <eliz@gnu.org>
13102
13103 * s/ms-w32.h (tzname): Include time.h before redirecting to
13104 _tzname. Fixes the MSVC build. (Bug#9960)
13105
13106 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13107
13108 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13109 characters.
13110
13111 * xterm.c (XTread_socket): Only modify handling_signal if
13112 !SYNC_INPUT. (Bug#11080)
13113
13114 2012-03-23 Eli Zaretskii <eliz@gnu.org>
13115
13116 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13117 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13118 when fetching a multibyte character consumes more bytes than
13119 CHAR_BYTES returns, due to unification of CJK characters in
13120 string_char. (Bug#11073)
13121
13122 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13123
13124 * process.c (wait_reading_process_output): Handle pty disconnect
13125 by refraining from sending oneself a SIGCHLD (bug#10933).
13126
13127 2012-03-22 Chong Yidong <cyd@gnu.org>
13128
13129 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13130
13131 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13132 Mark string as coming from a prefix property.
13133 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13134 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13135
13136 2012-03-21 Chong Yidong <cyd@gnu.org>
13137
13138 * xfaces.c (Vface_remapping_alist): Doc fix.
13139
13140 2012-03-20 Eli Zaretskii <eliz@gnu.org>
13141
13142 * w32proc.c (Fw32_set_console_codepage)
13143 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13144 Doc fixes.
13145
13146 2012-03-20 Chong Yidong <cyd@gnu.org>
13147
13148 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13149 to reflect default non-nil value of redisplay-dont-pause.
13150
13151 2012-03-19 Kenichi Handa <handa@m17n.org>
13152
13153 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13154 it fit in a valid range (Bug#11003).
13155
13156 2012-03-18 Eli Zaretskii <eliz@gnu.org>
13157
13158 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13159 that is not from display property, accept the row as a "cursor
13160 row" if one of the string's character has a non-nil `cursor'
13161 property. Fixes cursor positioning when there are newlines in
13162 overlay strings, e.g. in icomplete.el. (Bug#11035)
13163
13164 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13165
13166 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13167
13168 2012-03-12 Chong Yidong <cyd@gnu.org>
13169
13170 * eval.c (inhibit_lisp_code): Rename from
13171 inhibit_window_configuration_change_hook; move from window.c.
13172
13173 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13174 * window.c (run_window_configuration_change_hook)
13175 (syms_of_window): Callers changed.
13176
13177 2012-03-11 Chong Yidong <cyd@gnu.org>
13178
13179 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13180
13181 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13182
13183 2012-03-10 Chong Yidong <cyd@gnu.org>
13184
13185 * frame.c (other_visible_frames): Don't assume the selected frame
13186 is visible (Bug#10955).
13187
13188 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13189
13190 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13191
13192 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13193
13194 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13195 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13196 zero (Bug#10954).
13197
13198 2012-03-03 Glenn Morris <rgm@gnu.org>
13199
13200 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13201
13202 2012-03-02 Eli Zaretskii <eliz@gnu.org>
13203
13204 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13205 position past the first glyph_row that ends at ZV. (Bug#10902)
13206 (redisplay_window, next_element_from_string): Fix typos in
13207 comments.
13208 (redisplay_window): Pass to move_it_vertically the margin in
13209 pixels, not in screen lines.
13210
13211 2012-03-02 Glenn Morris <rgm@gnu.org>
13212
13213 * buffer.c (buffer-list-update-hook): Doc fix.
13214
13215 2012-02-29 Eli Zaretskii <eliz@gnu.org>
13216
13217 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13218 push_it before setting up the iterator for the first overlay
13219 string, even if we have an empty string loaded.
13220 (next_overlay_string): If there's an empty string on the iterator
13221 stack, pop the stack. (Bug#10903)
13222
13223 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13224
13225 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13226 Suggested by Stefan Monnier in
13227 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13228 * alloc.c (widen_to_Lisp_Object): New static function.
13229 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13230 and widening them to Lisp_Objects. This would work even if
13231 USE_LSB_TAG is defined and wide integers are used, which might
13232 happen in a future version of Emacs.
13233
13234 2012-02-25 Chong Yidong <cyd@gnu.org>
13235
13236 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13237 Doc fix.
13238
13239 * xselect.c (Fx_selection_exists_p): Doc fix.
13240 (x_clipboard_manager_save_all): Print an informative message
13241 before saving to clipboard manager.
13242
13243 2012-02-24 Chong Yidong <cyd@gnu.org>
13244
13245 * keyboard.c (process_special_events): Handle all X selection
13246 requests in kbd_buffer, not just the next one (Bug#8869).
13247
13248 2012-02-23 Chong Yidong <cyd@gnu.org>
13249
13250 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13251 call when setting menu-bar-lines and tool-bar-lines parameters.
13252 (unwind_create_frame_1): New helper function.
13253
13254 * window.c (inhibit_window_configuration_change_hook): New var.
13255 (run_window_configuration_change_hook): Obey it.
13256 (syms_of_window): Initialize it.
13257
13258 2012-02-22 Chong Yidong <cyd@gnu.org>
13259
13260 * xterm.c (x_draw_image_relief): Add missing type check for
13261 Vtool_bar_button_margin (Bug#10743).
13262
13263 2012-02-21 Chong Yidong <cyd@gnu.org>
13264
13265 * fileio.c (Vfile_name_handler_alist): Doc fix.
13266
13267 * buffer.c (Fget_file_buffer): Protect against invalid file
13268 handler return value.
13269
13270 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13271
13272 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13273 when computing $valmask.
13274
13275 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13276 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13277 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13278 It's useless in that case, and it can cause problems on hosts
13279 that allocate halves of EMACS_INT values separately.
13280 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13281 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13282 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13283 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13284 it avoids undefined behavior on hosts where shifting right by more
13285 than the word width has undefined behavior.
13286
13287 2012-02-19 Chong Yidong <cyd@gnu.org>
13288
13289 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13290 (Funhandled_file_name_directory, Ffile_name_as_directory)
13291 (Fdirectory_file_name, Fexpand_file_name)
13292 (Fsubstitute_in_file_name): Protect against invalid file handler
13293 return values (Bug#10845).
13294
13295 2012-02-18 Eli Zaretskii <eliz@gnu.org>
13296
13297 * .gdbinit (pitx): Fix incorrect references to fields of the
13298 iterator stack.
13299
13300 2012-02-17 Chong Yidong <cyd@gnu.org>
13301
13302 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13303
13304 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13305
13306 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13307 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13308
13309 2012-02-15 Chong Yidong <cyd@gnu.org>
13310
13311 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13312 marked as special. Also, starting docstrings with * is obsolete.
13313
13314 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13315
13316 * gnutls.c (emacs_gnutls_write): Fix last change.
13317
13318 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13319
13320 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13321 send_process.
13322
13323 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13324
13325 * keymap.c (Fsingle_key_description): Handle char ranges.
13326
13327 2012-02-12 Chong Yidong <cyd@gnu.org>
13328
13329 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13330 as that creates a dangerous corner case.
13331
13332 * window.c (Fdelete_window_internal): Invalidate the mouse
13333 highlight (Bug#9904).
13334
13335 2012-02-12 Glenn Morris <rgm@gnu.org>
13336
13337 * xselect.c (Fx_own_selection_internal)
13338 (Fx_get_selection_internal, Fx_disown_selection_internal)
13339 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13340 * nsselect.m (Fx_own_selection_internal)
13341 (Fx_disown_selection_internal, Fx_selection_exists_p)
13342 (Fx_selection_owner_p, Fx_get_selection_internal):
13343 Sync docs and argument specs with the xselect.c versions.
13344
13345 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13346
13347 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13348
13349 2012-02-11 Eli Zaretskii <eliz@gnu.org>
13350
13351 * w32select.c (Fx_selection_exists_p): Sync doc string and
13352 argument list with xselect.c. (Bug#10783)
13353
13354 * w16select.c (Fx_selection_exists_p): Sync doc string and
13355 argument list with xselect.c. (Bug#10783)
13356
13357 2012-02-10 Glenn Morris <rgm@gnu.org>
13358
13359 * fns.c (Fsecure_hash): Doc fix.
13360
13361 2012-02-09 Kenichi Handa <handa@m17n.org>
13362
13363 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13364
13365 2012-02-07 Chong Yidong <cyd@gnu.org>
13366
13367 * buffer.c (Fbuffer_local_variables)
13368 (buffer_lisp_local_variables): Handle unbound vars correctly;
13369 don't let Qunbound leak into Lisp.
13370
13371 2012-02-07 Glenn Morris <rgm@gnu.org>
13372
13373 * image.c (Fimagemagick_types): Doc fix.
13374
13375 * image.c (imagemagick-render-type): Change it from a lisp object
13376 to an integer. Move the doc here from the lisp manual.
13377 Treat all values not equal to 0 the same.
13378
13379 2012-02-06 Chong Yidong <cyd@gnu.org>
13380
13381 * doc.c (store_function_docstring): Avoid applying docstring of
13382 alias to base function (Bug#2603).
13383
13384 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13385
13386 * .gdbinit (pp1, pv1): Remove redundant defines.
13387 (pr): Use pp.
13388
13389 2012-02-04 Chong Yidong <cyd@gnu.org>
13390
13391 * nsterm.m: Declare a global (Bug#10694).
13392
13393 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13394
13395 * w32.c (get_emacs_configuration_options):
13396 Include --enable-checking, if specified, in the return value.
13397
13398 2012-02-04 Martin Rudalics <rudalics@gmx.at>
13399
13400 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13401 after rounding frame sizes. (Bug#9723)
13402
13403 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13404
13405 * keyboard.c (adjust_point_for_property): Don't position point
13406 before BEGV. (Bug#10696)
13407
13408 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13409
13410 Handle overflow when computing char display width (Bug#9496).
13411 * character.c (char_width): Return EMACS_INT, not int.
13412 (char_width, c_string_width): Check for overflow when
13413 computing the width; this is possible now that individual
13414 characters can have unbounded width. Problem introduced
13415 by merge from Emacs 23 on 2012-01-19.
13416
13417 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
13418
13419 * dbusbind.c (Fdbus_register_method): Mention the return value
13420 :ignore in the docstring.
13421
13422 2012-02-02 Glenn Morris <rgm@gnu.org>
13423
13424 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13425
13426 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13427 Unconditionally set to t. (Bug#10673)
13428 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13429 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13430 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13431
13432 2012-02-02 Kenichi Handa <handa@m17n.org>
13433
13434 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13435 0, do not call append_composite_glyph.
13436
13437 2012-02-02 Kenichi Handa <handa@m17n.org>
13438
13439 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13440 NULL (Bug#6988).
13441 (x_produce_glyphs): If the component of a composition is a null
13442 string, set it->pixel_width to 1 to avoid zero-width glyph.
13443
13444 2012-02-01 Eli Zaretskii <eliz@gnu.org>
13445
13446 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13447 first 2 arguments are identical. This makes inserting large
13448 output from a subprocess an order of magnitude faster on
13449 MS-Windows, where all sbrk'ed memory is always contiguous.
13450
13451 2012-01-31 Glenn Morris <rgm@gnu.org>
13452
13453 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13454 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13455 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13456
13457 2012-01-29 Glenn Morris <rgm@gnu.org>
13458
13459 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13460
13461 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13462
13463 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13464
13465 2012-01-28 Chong Yidong <cyd@gnu.org>
13466
13467 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13468
13469 2012-01-26 Chong Yidong <cyd@gnu.org>
13470
13471 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13472
13473 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13474 repeat counts (Bug#10507).
13475
13476 2012-01-26 Glenn Morris <rgm@gnu.org>
13477
13478 * lread.c (syms_of_lread): Doc fix.
13479
13480 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13481
13482 * coding.c (encode_designation_at_bol): Change return value to
13483 EMACS_INT.
13484
13485 2012-01-25 Chong Yidong <cyd@gnu.org>
13486
13487 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13488
13489 2012-01-21 Chong Yidong <cyd@gnu.org>
13490
13491 * floatfns.c (Fcopysign): Make the second argument non-optional,
13492 since nil is not allowed anyway.
13493
13494 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13495
13496 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13497 (send_process): Likewise.
13498
13499 2012-01-19 Martin Rudalics <rudalics@gmx.at>
13500
13501 * window.c (save_window_save, Fcurrent_window_configuration)
13502 (Vwindow_persistent_parameters): Do not use Qstate.
13503 Rewrite doc-strings.
13504
13505 2012-01-19 Kenichi Handa <handa@m17n.org>
13506
13507 * character.c (char_width): New function.
13508 (Fchar_width, c_string_width, lisp_string_width):
13509 Use char_width (Bug#9496).
13510
13511 2012-01-16 Martin Rudalics <rudalics@gmx.at>
13512
13513 * window.c (Vwindow_persistent_parameters): New variable.
13514 (Fset_window_configuration, save_window_save): Handle persistent
13515 window parameters.
13516
13517 2012-01-14 Eli Zaretskii <eliz@gnu.org>
13518
13519 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13520 thrashing the stack of the thread. (Bug#9087)
13521
13522 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13523
13524 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13525
13526 2012-01-11 Eli Zaretskii <eliz@gnu.org>
13527
13528 * xdisp.c (rows_from_pos_range): Handle the case where the
13529 highlight ends on a newline. (Bug#10464)
13530 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13531 he end column for display of highlight that ends on a newline
13532 before a R2L line.
13533
13534 2012-01-11 Glenn Morris <rgm@gnu.org>
13535
13536 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13537 from load-path also when installation-directory is nil. (Bug#10208)
13538
13539 2012-01-10 Glenn Morris <rgm@gnu.org>
13540
13541 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13542
13543 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13544 Update template values to be closer to their typical values these days.
13545
13546 2012-01-09 Eli Zaretskii <eliz@gnu.org>
13547
13548 * xdisp.c (rows_from_pos_range): Accept additional argument
13549 DISP_STRING, and accept any glyph in a row whose object is that
13550 string as eligible for mouse highlight. Fixes mouse highlight of
13551 display strings from overlays. (Bug#10464)
13552
13553 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
13554
13555 emacs: fix an auto-save permissions race condition (Bug#10400)
13556 * fileio.c (auto_saving_dir_umask): New static var.
13557 (Fmake_directory_internal): Use it.
13558 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13559 creating the directory. The old code temporarily assigns
13560 too-generous permissions to the directory.
13561 (do_auto_save_eh): Clear it.
13562 (Fdo_auto_save): Catch all errors, not just file errors, so
13563 that the var is always cleared.
13564
13565 2012-01-07 Eli Zaretskii <eliz@gnu.org>
13566
13567 * search.c (scan_buffer): Pass character positions to
13568 know_region_cache, not byte positions. (Bug#6540)
13569
13570 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
13571
13572 * w32.c (sys_rename): Report EXDEV when rename of a directory
13573 fails because the target is on another logical disk. (Bug#10284)
13574
13575 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13576
13577 * xterm.c (x_embed_request_focus): New function.
13578
13579 * xterm.h: Add prototype.
13580
13581 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13582
13583 2012-01-05 Glenn Morris <rgm@gnu.org>
13584
13585 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13586
13587 2012-01-01 Eli Zaretskii <eliz@gnu.org>
13588
13589 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13590 Load gnutls_transport_set_lowat only if GnuTLS version is below
13591 2.11.1.
13592 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13593 GnuTLS versions below 2.11.1.
13594
13595 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13596
13597 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13598 to the doc string advising against its use for altering the way
13599 windows are scrolled.
13600
13601 2011-12-28 Kenichi Handa <handa@m17n.org>
13602
13603 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13604 coding-system ASCII compatible only when it does not produce BOM
13605 on encoding (Bug#10383).
13606
13607 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13608
13609 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13610 can scroll.
13611 (create_and_show_popup_menu): Always use menu_position_func for
13612 Gtk3 (Bug#10361).
13613
13614 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13615
13616 * callint.c (Fcall_interactively): Don't truncate prompt string.
13617
13618 2011-12-23 Eli Zaretskii <eliz@gnu.org>
13619
13620 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13621 property that ends at ZV, so that the bidi iteration could be
13622 resumed from there (after widening). (Bug#10360)
13623
13624 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13625
13626 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13627
13628 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13629
13630 * nsterm.m (x_free_frame_resources):
13631 Release f->output_data.ns->miniimage.
13632 (ns_index_color): Fix indentation. Do not retain
13633 color_table->colors[i].
13634
13635 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13636 before returning.
13637
13638 * nsfns.m (x_set_background_color): Assign return value from
13639 ns_index_color to face-background instead of NSColor*.
13640 (ns_implicitly_set_icon_type): Fix indentation.
13641 Change assignment in for loop to comparison.
13642
13643 * emacs.c (ns_pool): New variable.
13644 (main): Assign ns_pool.
13645 (Fkill_emacs): Call ns_release_autorelease_pool.
13646
13647 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13648 autorelease fdesc, release fdAttrs and tdict.
13649 (ns_get_covering_families): Release charset.
13650 (ns_findfonts): Release NSFontDescriptor created with new.
13651 (ns_uni_to_glyphs): Fix indentation.
13652 (setString): Release attrStr before assigning new value.
13653
13654 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13655
13656 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13657 and NS_IMPL_COCOA.
13658 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13659 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13660
13661 2011-12-18 David Reitter <reitter@cmu.edu>
13662
13663 * nsterm.m (ns_term_init): Subscribe for notifications
13664 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13665 to method trackingNotification in EmacsMenu.
13666
13667 * nsmenu.m (trackingMenu): New variable.
13668 (trackingNotification): New method (from Aquamacs).
13669 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
13670 from Aquamacs (Bug#7030).
13671
13672 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13673
13674 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13675 (symbol_to_nsstring): Fix indentation.
13676 (ns_symbol_to_pb): New function.
13677 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13678 (Fns_rotate_cut_buffers_internal): Remove.
13679 (Fns_store_selection_internal): Rename from
13680 Fns_store_cut_buffer_internal.
13681 (ns_get_foreign_selection, Fx_own_selection_internal)
13682 (Fx_disown_selection_internal, Fx_selection_exists_p)
13683 (Fns_get_selection_internal, Fns_store_selection_internal):
13684 Use ns_symbol_to_pb and check if return value is nil.
13685 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13686 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
13687 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13688 renamed to Sns_store_selection_internal.
13689 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13690 and remove this function.
13691 (ns_handle_selection_clear): Remove, never used.
13692 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13693 here.
13694
13695 2011-12-17 Ken Brown <kbrown@cornell.edu>
13696
13697 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13698 GID is unknown (Bug#10257).
13699
13700 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13701
13702 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13703 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13704 which caused a build failure on GNU/Linux IA-64. This problem was
13705 introduced by my 2011-10-07 patch.
13706
13707 2011-12-15 Juri Linkov <juri@jurta.org>
13708
13709 * image.c (imagemagick_error): New function. (Bug#10112)
13710 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13711 Use `imagemagick_error' where ImageMagick functions return
13712 `MagickFalse'.
13713 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13714 proper order.
13715
13716 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13717
13718 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13719 fill background (Bug#8992).
13720
13721 2011-12-13 Martin Rudalics <rudalics@gmx.at>
13722
13723 * window.c (Vwindow_combination_resize)
13724 (Vwindow_combination_limit): Use t instead of non-nil in
13725 doc-strings.
13726 (Vrecenter_redisplay): Add first sentence of doc-string on
13727 separate line.
13728 (Frecenter): Fix doc-string typo.
13729
13730 2011-12-11 Kenichi Handa <handa@m17n.org>
13731
13732 * coding.c (Funencodable_char_position): Pay attention to the
13733 buffer text relocation (Bug#9389).
13734
13735 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13736
13737 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13738 gtk_init (Bug#10100).
13739
13740 2011-12-10 Eli Zaretskii <eliz@gnu.org>
13741
13742 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13743 IT->string is nil. (Bug#10263)
13744
13745 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13746
13747 * nsterm.h (x_free_frame_resources): Declare.
13748
13749 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13750 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13751
13752 * nsterm.h (ns_get_defaults_value): Declare.
13753
13754 * nsterm.m (ns_default): Call ns_get_defaults_value.
13755
13756 2011-12-09 Eli Zaretskii <eliz@gnu.org>
13757
13758 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13759 (Bug#10170)
13760
13761 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13762
13763 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13764 that where the value of an _OBJC_* symbol points to is in the .bss
13765 section (Bug#10240).
13766
13767 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13768
13769 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
13770 after the loop to call ccl_driver at least once (Bug#8619).
13771
13772 2011-12-08 Kenichi Handa <handa@m17n.org>
13773
13774 * ftfont.c (get_adstyle_property): Fix previous change
13775 (Bug#10233).
13776
13777 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
13778
13779 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13780 dirs from the default value of EMACSLOADPATH (bug#10208).
13781
13782 2011-12-07 Glenn Morris <rgm@gnu.org>
13783
13784 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13785 installation and source directories as well. (Bug#10208)
13786
13787 2011-12-06 Chong Yidong <cyd@gnu.org>
13788
13789 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13790
13791 2011-12-06 Glenn Morris <rgm@gnu.org>
13792
13793 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13794 as an error, not just -1. (Bug#10217)
13795
13796 2011-12-05 Chong Yidong <cyd@gnu.org>
13797
13798 * keyboard.c (process_special_events): New function.
13799 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13800
13801 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13802
13803 * coding.c (encode_designation_at_bol): Don't use uninitialized
13804 local variable (Bug#9318).
13805
13806 2011-12-05 Kenichi Handa <handa@m17n.org>
13807
13808 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13809 return Qnil (Bug#8046, Bug#10193).
13810
13811 2011-12-05 Kenichi Handa <handa@m17n.org>
13812
13813 * coding.c (encode_designation_at_bol): New args charbuf_end and
13814 dst. Return the number of produced bytes. Callers changed.
13815 (coding_set_source): Return how many bytes coding->source was
13816 relocated.
13817 (coding_set_destination): Return how many bytes
13818 coding->destination was relocated.
13819 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
13820 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
13821
13822 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13823
13824 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13825 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13826 macro (Bug#9318).
13827
13828 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13829
13830 The following changes are to fix Bug#9318.
13831
13832 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
13833 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13834 (encode_coding_iso_2022, encode_coding_sjis)
13835 (encode_coding_big5, encode_coding_charset): Use the above macros.
13836
13837 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
13838
13839 * lisp.h (process_quit_flag): Fix external declaration.
13840
13841 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13842
13843 Don't macro-inline non-performance-critical code.
13844 * eval.c (process_quit_flag): New function.
13845 * lisp.h (QUIT): Use it.
13846
13847 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13848
13849 * nsfns.m (get_geometry_from_preferences): New function.
13850 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13851
13852 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13853
13854 * emacs.c (Qkill_emacs): Define.
13855 (syms_of_emacs): Initialize it.
13856 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13857 Qquit_flag to `kill-emacs' instead.
13858 (quit_throw_to_read_char): Add parameter `from_signal'.
13859 All callers changed. Call Fkill_emacs if requested and safe.
13860 * lisp.h (QUIT): Call Fkill_emacs if requested.
13861
13862 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13863
13864 * widget.c (update_wm_hints): Return if wmshell is null.
13865 (widget_update_wm_size_hints): New function.
13866
13867 * widget.h (widget_update_wm_size_hints): Declare.
13868
13869 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13870 widget_update_wm_size_hints (Bug#10104).
13871
13872 2011-12-03 Eli Zaretskii <eliz@gnu.org>
13873
13874 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13875 before a newline, prepare the bidi iterator for consuming the
13876 newline, and keep the current paragraph direction. (Bug#10183)
13877 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
13878
13879 2011-12-02 Juri Linkov <juri@jurta.org>
13880
13881 * search.c (Fword_search_regexp): New Lisp function created from
13882 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13883 (Fword_search_backward, Fword_search_forward)
13884 (Fword_search_backward_lax, Fword_search_forward_lax):
13885 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13886 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13887
13888 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13889
13890 * fileio.c (Finsert_file_contents): Move after-change-function call
13891 to before the "handled:" label, since all "goto handled" appear in
13892 cases where the *-change-functions have already been properly called
13893 (bug#10117).
13894
13895 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13896
13897 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13898 waiting for input. (Bug#10169)
13899
13900 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13901
13902 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13903 verifies glyph row's hash code--we have just reallocated the
13904 glyphs, so their contents can be complete garbage. (Bug#10164)
13905
13906 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
13907
13908 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13909
13910 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13911
13912 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13913 attributes are tested _before_ calling verify_row_hash, to protect
13914 against GCC re-ordering of the tests. (Bug#10164)
13915
13916 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13917
13918 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13919
13920 * xterm.c (handle_one_xevent): Only set async_visible and friends
13921 if net_wm_state_hidden_seen is non-zero (Bug#10002)
13922 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
13923 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13924
13925 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13926
13927 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13928 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13929 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13930 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13931 All uses changed to use GCPRO1 etc.
13932 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13933 Revert to old implementation (i.e., before 2011-03-11).
13934
13935 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13936
13937 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13938 of scroll runs so as to avoid assigning disabled bogus rows and
13939 unnecessary graphics copy operations.
13940
13941 2011-11-27 Eli Zaretskii <eliz@gnu.org>
13942
13943 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13944 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13945 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13946 (malloc, free, realloc, calloc): Redirect to e_* only when
13947 compiling Emacs.
13948
13949 * lisp.h (GCTYPEBITS): Move before first use.
13950 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13951 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13952 this macro definition.
13953
13954 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13955 _MSC_VER.
13956
13957 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13958
13959 * gtkutil.c (xg_create_frame_widgets):
13960 Call gtk_window_set_has_resize_grip (FALSE) if that function is
13961 present with Gtk+ 2.0.
13962
13963 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13964
13965 * fileio.c (Finsert_file_contents): Undo previous change; see
13966 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13967
13968 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13969
13970 Rename locals to avoid shadowing.
13971 * fileio.c (Finsert_file_contents):
13972 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13973 * process.c (wait_reading_process_output):
13974 Rename inner 'proc' to 'p' to avoid shadowing.
13975 Indent for consistency with usual Emacs style.
13976
13977 2011-11-25 Eli Zaretskii <eliz@gnu.org>
13978
13979 * xdisp.c (redisplay_window): If cursor row is not fully visible
13980 after recentering, and scroll-conservatively is set to a large
13981 number, scroll window by a few more lines to make the cursor fully
13982 visible and out of scroll-margin. (Bug#10105)
13983 (start_display): Don't move to the next line if the display should
13984 start at a newline that is part of a display vector or an overlay
13985 string. (Bug#10119)
13986
13987 2011-11-24 Juri Linkov <juri@jurta.org>
13988
13989 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
13990 after the `MagickPingImage' call. (Bug#10112)
13991
13992 2011-11-23 Chong Yidong <cyd@gnu.org>
13993
13994 * window.c (Fcoordinates_in_window_p): Accept only live windows.
13995
13996 2011-11-23 Martin Rudalics <rudalics@gmx.at>
13997
13998 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
13999 making another buffer current. (Bug#10114)
14000
14001 2011-11-23 Glenn Morris <rgm@gnu.org>
14002
14003 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14004
14005 2011-11-23 Chong Yidong <cyd@gnu.org>
14006
14007 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14008 using it (Bug#5984).
14009
14010 2011-11-22 Eli Zaretskii <eliz@gnu.org>
14011
14012 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14013 and header-lines, as they don't have one computed for them.
14014 (Bug#10098)
14015
14016 * .gdbinit (prow): Make displayed values more self-explaining.
14017 Add row's hash code.
14018
14019 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14020
14021 * process.c (wait_reading_process_output): Fix asynchrounous
14022 GnuTLS socket handling on some versions of the GnuTLS library.
14023 (wait_reading_process_output): Add comment and URL.
14024
14025 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14026
14027 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14028
14029 2011-11-21 Chong Yidong <cyd@gnu.org>
14030
14031 * window.c (Fnext_window, Fprevious_window): Doc fix.
14032
14033 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14034
14035 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14036
14037 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14038
14039 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14040
14041 2011-11-20 Martin Rudalics <rudalics@gmx.at>
14042
14043 * window.c (Fset_window_combination_limit): Rename argument
14044 STATUS to LIMIT.
14045 (Vwindow_combination_limit): Remove "status" from doc-string.
14046
14047 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14048
14049 * m/ibms390.h: Remove.
14050 * m/ibms390x.h: Don't include "ibms390.h".
14051
14052 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14053
14054 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14055 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14056
14057 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14058
14059 * casetab.c (Fset_case_table):
14060 * charset.c (Fcharset_after): Fix typos.
14061
14062 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
14063
14064 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14065 Otherwise, valgrind does not work on some platforms.
14066 Problem reported by Andreas Schwab in
14067 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14068 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14069 is set, removing the need for VIRT_ADDRESS_VARIES.
14070 (PURE_P): Use a more-efficient implementation that needs just one
14071 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14072 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14073 to 4 (xorl, subq, cmpq, setbe).
14074 * alloc.c (pure): Always extern now, since that's the
14075 VIRT_ADDR_VARIES behavior.
14076 (PURE_POINTER_P): Use a single comparison, not two, for
14077 consistency with the new puresize.h.
14078 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14079 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14080 Remove VIRT_ADDR_VARIES no longer needed.
14081
14082 2011-11-19 Eli Zaretskii <eliz@gnu.org>
14083
14084 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14085 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14086 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14087 behave as if the cursor position were at the window margin.
14088
14089 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14090 and the cursor position is out of bounds, behave as if the cursor
14091 position were at the window margin. (Bug#10075)
14092
14093 2011-11-18 Chong Yidong <cyd@gnu.org>
14094
14095 * window.c (Fwindow_combination_limit): Make first argument
14096 non-optional, since it is meaningless for live windows like the
14097 selected window.
14098
14099 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14100
14101 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14102
14103 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14104
14105 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14106 (graft_intervals_into_buffer): Simplify.
14107
14108 2011-11-18 Eli Zaretskii <eliz@gnu.org>
14109
14110 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14111 hash values of the two rows.
14112 (copy_row_except_pointers): Preserve the used[] arrays and the
14113 hash values of the two rows. (Bug#10035)
14114 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14115
14116 * xdisp.c (row_hash): New function, body extracted from
14117 compute_line_metrics.
14118 (compute_line_metrics): Call row_hash, instead of computing the
14119 hash code inline.
14120
14121 * dispnew.c (verify_row_hash): Call row_hash for computing the
14122 hash code of a row, instead of duplicating code from xdisp.c.
14123
14124 * dispextern.h (row_hash): Add prototype.
14125
14126 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14127
14128 * frame.c (delete_frame): Don't delete the terminal when the last
14129 X frame is closed if emacs is built with GTK toolkit.
14130
14131 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
14132
14133 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14134
14135 2011-11-17 Martin Rudalics <rudalics@gmx.at>
14136
14137 * window.c (Vwindow_splits): Rename to
14138 Vwindow_combination_resize. Suggested by Juri Linkov.
14139 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14140 of Vwindow_splits.
14141
14142 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
14143
14144 * nsfns.m (Fns_font_name):
14145 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14146
14147 2011-11-16 Martin Rudalics <rudalics@gmx.at>
14148
14149 * window.h (window): Rename slot "nest" to "combination_limit".
14150 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14151 (Fset_window_nest): Rename to Fset_window_combination_limit.
14152 (Vwindow_nest): Rename to Vwindow_combination_limit.
14153 (recombine_windows, make_parent_window, make_window)
14154 (Fsplit_window_internal, saved_window)
14155 (Fset_window_configuration, save_window_save): Rename all
14156 occurrences of window_nest to window_combination_limit.
14157
14158 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
14159
14160 * image.c (imagemagick_load_image): Fix typo.
14161
14162 2011-11-14 Eli Zaretskii <eliz@gnu.org>
14163
14164 * xdisp.c (display_line): Move the call to
14165 highlight_trailing_whitespace before the call to
14166 compute_line_metrics, since the latter needs to see the final
14167 faces of all the glyphs to compute ROW's hash value.
14168 Fixes assertion violations in row_equal_p. (Bug#10035)
14169
14170 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
14171
14172 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14173 just return (bug#10044).
14174
14175 2011-11-12 Eli Zaretskii <eliz@gnu.org>
14176
14177 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14178 with user-defined heap size. Bump the default size of the temacs
14179 heap to 27MB, to avoid memory warning when running temacs.
14180 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14181
14182 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14183 current_matrix and desired_matrix. (Bug#9990)
14184 (verify_row_hash) [XASSERTS]: New function.
14185 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14186 that the hash value of glyph rows is correct.
14187
14188 2011-11-12 Martin Rudalics <rudalics@gmx.at>
14189
14190 * window.h (window): Remove splits slot.
14191 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14192 (Fdelete_other_windows_internal, make_parent_window)
14193 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14194 (Fset_window_configuration, save_window_save): Don't deal with
14195 split status of windows.
14196 (saved_window): Remove splits slot.
14197 (Vwindow_splits): Rewrite doc-string.
14198
14199 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14200
14201 * xfns.c (unwind_create_frame):
14202 * nsfns.m (unwind_create_frame):
14203 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14204 Vframe_list (Bug#9999).
14205
14206 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14207
14208 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
14209
14210 2011-11-11 Kenichi Handa <handa@m17n.org>
14211
14212 * callproc.c (Fcall_process): Set the member dst_multibyte of
14213 process_coding.
14214
14215 2011-11-11 Johan Bockgård <bojohan@gnu.org>
14216
14217 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14218 avoid a crash (bug#9496).
14219
14220 2011-11-09 Chong Yidong <cyd@gnu.org>
14221
14222 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14223 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14224
14225 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14226
14227 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14228
14229 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14230
14231 Avoid some portability problems by eschewing 'extern inline' functions.
14232 The trivial performance wins aren't worth the portability hassles; see
14233 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14234 et seq.
14235 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14236 (window_box_width, window_box_left, window_box_left_offset)
14237 (window_box_right, window_box_right_offset): Undo previous change,
14238 by removing the "extern"s.
14239 * intervals.c (adjust_intervals_for_insertion)
14240 (adjust_intervals_for_deletion): Undo previous change,
14241 making these static again.
14242 (offset_intervals, temp_set_point_both, temp_set_point)
14243 (copy_intervals_to_string): No longer inline.
14244 * xdisp.c (window_text_bottom_y, window_box_width)
14245 (window_box_height, window_box_left_offset)
14246 (window_box_right_offset, window_box_left, window_box_right)
14247 (window_box): No longer inline.
14248
14249 2011-11-08 Chong Yidong <cyd@gnu.org>
14250
14251 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
14252 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14253 Signal an error if not a live window.
14254 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14255 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14256
14257 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
14258
14259 * lisp.h (syms_of_abbrev): Remove declaration.
14260 Reported by CHENG Gao <chenggao@royau.me>.
14261
14262 2011-11-07 Eli Zaretskii <eliz@gnu.org>
14263
14264 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14265 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14266 of temacs in GUI mode.
14267
14268 2011-11-07 Martin Rudalics <rudalics@gmx.at>
14269
14270 * window.h: Declare delete_all_child_windows instead of
14271 delete_all_subwindows.
14272 * window.c (Fwindow_nest, Fset_window_nest)
14273 (Fset_window_new_total, Fset_window_new_normal)
14274 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14275 (delete_all_subwindows): Rename to delete_all_child_windows.
14276 (Fdelete_other_windows_internal, Fset_window_configuration):
14277 Call delete_all_child_windows instead of delete_all_subwindows.
14278 * frame.c (delete_frame): Call delete_all_child_windows instead
14279 of delete_all_subwindows.
14280
14281 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14282
14283 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14284 This is also needed for porting to any host where GC_MARK_STACK is
14285 not GC_MAKE_GCPROS_NOOPS.
14286 (which_symbols): Use it.
14287
14288 2011-11-07 Kenichi Handa <handa@m17n.org>
14289
14290 * coding.c (coding_set_destination): Check coding->src_pos only
14291 when coding->src_object is a buffer (bug#9910).
14292
14293 * process.c (send_process): Set the member src_multibyte of coding
14294 to 0 (bug#9911) when sending a unibyte text.
14295
14296 * callproc.c (Fcall_process): Set the member src_multibyte of
14297 process_coding to 0 (bug#9912).
14298
14299 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14300
14301 * xmenu.c (cleanup_widget_value_tree): New function.
14302 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14303 calling free_menubar_widget_value_tree directly (Bug#9830).
14304
14305 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14306
14307 Fix some portability problems with 'inline'.
14308 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14309 (window_box_width, window_box_left, window_box_left_offset)
14310 (window_box_right, window_box_right_offset): Declare extern.
14311 Otherwise, these inline functions do not conform to C99 and
14312 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14313 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14314 * intervals.c (adjust_intervals_for_insertion)
14315 (adjust_intervals_for_deletion): Now extern, because otherwise the
14316 extern inline functions 'offset_intervals' couldn't refer to it.
14317 (static_offset_intervals): Remove.
14318 (offset_intervals): Rewrite using the old contents of
14319 static_offset_intervals. The old version didn't conform to C99
14320 because an extern inline function contained a reference to an
14321 identifier with static linkage.
14322
14323 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14324
14325 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14326 GC.
14327
14328 2011-11-06 Eli Zaretskii <eliz@gnu.org>
14329
14330 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14331 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14332 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14333 return Qleft_to_right.
14334
14335 2011-11-06 Chong Yidong <cyd@gnu.org>
14336
14337 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14338 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14339 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14340 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14341 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14342 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14343 (Fwindow_vscroll): Doc fix.
14344 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14345 argument, since it makes no sense to pass a live window and for
14346 consistency with window-child.
14347
14348 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14349
14350 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14351 support MSVC.
14352
14353 2011-11-05 Jason Rumney <jasonr@gnu.org>
14354
14355 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14356 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14357 fonts (Bug#6029).
14358 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14359 bitwise arithmetic preventing use of unicode-sip and non-truetype
14360 opentype fonts.
14361
14362 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14363
14364 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14365 "emacs"-only part.
14366
14367 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14368 initialization code to keep similarity to xfns.c after changes
14369 from 2011-11-05.
14370
14371 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14372
14373 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14374 (unwind_create_frame): New function (Bug#9943).
14375 (Fx_create_frame): Restructure code to be more similar to the one in
14376 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14377 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14378 Move terminal->reference_count++ just before making the frame official
14379 (Bug#9943).
14380
14381 * nsterm.m (x_free_frame_resources): New function.
14382 (x_destroy_window): Move code to x_free_frame_resources.
14383
14384 * xfns.c (unwind_create_frame): Fix comment.
14385 (Fx_create_frame, x_create_tip_frame):
14386 Move terminal->reference_count++ just before making the frame
14387 official. Move initialization of image_cache_refcount and
14388 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14389
14390 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14391
14392 Support MSVC build with newer versions of Visual Studio.
14393 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14394 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14395 nt/gmake.defs.
14396
14397 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14398 which are not supported by MSVC.
14399 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14400 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14401 bitfields.
14402 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14403 types in bitfields.
14404 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14405
14406 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14407
14408 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
14409
14410 Support MSVC build with newer versions of Visual Studio.
14411 * w32.c: Don't include w32api.h for MSVC.
14412 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14413
14414 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14415 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14416 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14417 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14418 e_* cousins.
14419 (alloca) [_MSC_VER]: Define to _alloca.
14420
14421 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14422
14423 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14424
14425 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14426
14427 * xdisp.c (note_mouse_highlight): If either of
14428 previous/next-single-property-change returns nil, treat that as
14429 the beginning or the end of the buffer. (Bug#9955)
14430
14431 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14432
14433 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
14434 label is not null (Bug#9951).
14435 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14436 may be NULL.
14437
14438 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14439
14440 * window.c (Fwindow_body_size): Mention in the doc string that the
14441 return value is in frame's canonical units. (Bug#9949)
14442
14443 2011-11-03 Eli Zaretskii <eliz@gnu.org>
14444
14445 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14446
14447 * w32fns.c (unwind_create_frame): If needed, free the glyph
14448 matrices of the partially constructed frame. (Bug#9943)
14449 * xfns.c (unwind_create_frame): Likewise.
14450
14451 2011-11-01 Eli Zaretskii <eliz@gnu.org>
14452
14453 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14454 Don't stop backward scan on the continuation glyph, even though
14455 its CHARPOS is positive.
14456 (mouse_face_from_buffer_pos, note_mouse_highlight):
14457 Rename cover_string to disp_string.
14458
14459 2011-11-01 Martin Rudalics <rudalics@gmx.at>
14460
14461 * window.c (temp_output_buffer_show): Don't use
14462 Vtemp_buffer_show_specifiers.
14463 (Vtemp_buffer_show_specifiers): Remove unused variable.
14464
14465 2011-10-30 Eli Zaretskii <eliz@gnu.org>
14466
14467 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14468 past the beginning of the current glyph matrix.
14469
14470 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
14471
14472 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14473 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14474 HAVE_GTK3 (Bug#9869).
14475
14476 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14477 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14478
14479 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14480
14481 * xterm.c: Declare x_handle_net_wm_state to return int.
14482 (handle_one_xevent): Check if we are iconified but don't have
14483 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14484 (get_current_wm_state): Return non-zero if not hidden,
14485 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14486 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14487 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14488 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14489
14490 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14491
14492 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14493 so that this new function doesn't get optimized away by a
14494 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14495
14496 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14497
14498 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14499
14500 2011-10-29 Eli Zaretskii <eliz@gnu.org>
14501
14502 Fix the `xbytecode' command.
14503 * .gdbinit (xprintbytestr): New command.
14504 (xwhichsymbols): Rename from `which'; all callers changed.
14505 (xbytecode): Print the byte-code string as well.
14506
14507 2011-10-29 Kim Storm <storm@cua.dk>
14508
14509 * alloc.c (which_symbols): New function.
14510
14511 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14512
14513 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14514 line. (Bug#9903)
14515
14516 2011-10-29 Glenn Morris <rgm@gnu.org>
14517
14518 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14519 Not clear what it was for, and it causes various bugs. (Bug#9839)
14520
14521 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14522
14523 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14524 possible random value that matches one of those tested as
14525 condition to clear the mouse face.
14526
14527 2011-10-28 Chong Yidong <cyd@gnu.org>
14528
14529 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14530
14531 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14532
14533 * window.c (make_window): Initialize phys_cursor_on_p.
14534
14535 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14536
14537 * lisp.h (struct Lisp_Symbol): Update comments.
14538
14539 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
14540
14541 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14542
14543 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14544
14545 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14546 <oslsachem@gmail.com> for helping to debug this.
14547
14548 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14549 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14550 (g_b_init_get_glyph_outline_w): New static variables.
14551 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14552 (GetGlyphOutlineW_Proc): New typedefs.
14553 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
14554 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14555 New functions.
14556 (w32font_open_internal, compute_metrics):
14557 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
14558 instead of calling the "wide" APIs directly.
14559
14560 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14561
14562 * w32.h (syms_of_w32font): Add prototype.
14563
14564 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14565
14566 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14567 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14568 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14569 (Fmove_to_window_line): Doc fix.
14570
14571 2011-10-27 Chong Yidong <cyd@gnu.org>
14572
14573 * process.c (make_process): Set gnutls_state to NULL.
14574
14575 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14576 non-NULL, regardless of GNUTLS_INITSTAGE.
14577 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14578 an error. Set process slots as soon as we allocate them.
14579
14580 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14581
14582 2011-10-27 Chong Yidong <cyd@gnu.org>
14583
14584 * gnutls.c (emacs_gnutls_deinit): New function.
14585 Deallocate credentials structures as well as calling gnutls_deinit.
14586 (Fgnutls_deinit, Fgnutls_boot): Use it.
14587
14588 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14589 (deactivate_process): Call emacs_gnutls_deinit.
14590
14591 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14592
14593 * image.c (x_create_x_image_and_pixmap):
14594 * w32.c (sys_rename, w32_delayed_load):
14595 * w32font.c (fill_in_logfont):
14596 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14597
14598 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
14599
14600 * w32fns.c (w32_default_color_map): New function,
14601 extracted from Fw32_default_color_map.
14602 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
14603
14604 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14605
14606 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14607
14608 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14609
14610 * keyboard.c (test_undefined): New function (bug#9751).
14611 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14612
14613 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14614
14615 * sysdep.c (init_sys_modes): Fix the check for the controlling
14616 terminal (Bug#6649).
14617
14618 2011-10-20 Eli Zaretskii <eliz@gnu.org>
14619
14620 * dispextern.h (struct bidi_it): New member next_en_type.
14621
14622 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14623 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14624 current character, check also for next_en_type being WEAK_EN.
14625 (bidi_resolve_weak): Don't enter the expensive loop if the current
14626 position is before next_en_pos. Record the bidi type of the first
14627 non-ET, non-BN character we find, in addition to its position.
14628 (bidi_level_of_next_char): Invalidate next_en_type when
14629 next_en_pos is over-stepped.
14630
14631 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14632
14633 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14634 * editfns.c: Rewrite current-time-zone so that it invokes
14635 the equivalent of (format-time-string "%Z") to get the time zone name.
14636 This fixes a bug when the time zone name contains characters that
14637 need converting from the system time locale to Emacs internal format.
14638 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14639 that patch fixed format-time-string to do the conversion, but
14640 I forgot to fix current-time-zone.
14641 (format_time_string): New function, containing most of
14642 what Fformat_time_string used to contain.
14643 (Fformat_time_string): Rewrite in terms of format_time_string.
14644 This doesn't change this function's behavior.
14645 (current-time-zone): Rewrite to use format_time_string.
14646 This fixes the bug reported by Michael Schierl in
14647 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14648 Jason Rumney's 2007-06-07 change worked around this bug, but
14649 didn't fix it.
14650 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14651
14652 2011-10-19 Eli Zaretskii <eliz@gnu.org>
14653
14654 * xdisp.c (start_display): If the character at POS is displayed
14655 via a display vector, reset IT->current.dpvec_index to zero.
14656 (try_window_reusing_current_matrix): If a line ends in a display
14657 vector or the next line starts in a display vector, continue
14658 redrawing the window even though the character position of
14659 start_row was reached.
14660 (Bug#9771, part 2)
14661
14662 2011-10-18 Chong Yidong <cyd@gnu.org>
14663
14664 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14665 with nobreak-char-display too.
14666
14667 2011-10-18 Eli Zaretskii <eliz@gnu.org>
14668
14669 Fix part 3 of bug#9771.
14670 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14671 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14672 non-neutral characters if the current character is a paragraph
14673 separator (a.k.a. Newline). This avoids running the same
14674 expensive loop twice, once when we consume the preceding newline
14675 and the other time when the line actually needs to be displayed.
14676 Avoid the loop when we see neutrals on the base embedding level
14677 following a character whose directionality is the same as the
14678 paragraph's. This avoids running the expensive loop when a line
14679 ends in a long sequence of neutrals, like control characters.
14680 Add assertion against STRONG_AL type. Slightly rearrange code
14681 that determines the type of a neutral given the first non-neutral
14682 that follows it.
14683 (bidi_level_of_next_char): Set next_en_pos to zero when
14684 invalidating its info.
14685
14686 2011-10-17 Eli Zaretskii <eliz@gnu.org>
14687
14688 * xdisp.c (push_display_prop): Determine whether to record string
14689 or buffer position by IT->string, not by IT->method. Allow
14690 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
14691 (move_it_vertically_backward): Don't look for character position
14692 immediately after the newline when in a continuation line.
14693 (Bug#9771, part 1)
14694
14695 2011-10-15 Martin Rudalics <rudalics@gmx.at>
14696
14697 * window.c (coordinates_in_window): Rewrite and delabelize
14698 vertical border check. (Bug#5357) (Bug#9618)
14699
14700 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14701
14702 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14703 errors in XSetWindowBorder (bug#9310).
14704
14705 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14706
14707 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14708 avoid crash when xmalloc overrun checking is enabled.
14709
14710 2011-10-13 Eli Zaretskii <eliz@gnu.org>
14711
14712 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14713 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14714 cursor motion with <left> and <right> arrow keys.
14715
14716 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14717 some callers set that themselves.
14718
14719 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14720
14721 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14722 display string and the previous row comes from the same string and
14723 is empty. (Bug#9739) (Bug#9738)
14724
14725 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14726
14727 * doc.c (get_doc_string): Encode file name (bug#9735).
14728
14729 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14730
14731 * bidi.c (bidi_level_of_next_char):
14732 * xdisp.c (get_visually_first_element): Remove old incorrect
14733 comments regarding the Unicode Line Separator character.
14734
14735 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14736
14737 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14738
14739 * alloc.c (Fgc_status): Do not access beyond zombies array
14740 boundary if nzombies > MAX_ZOMBIES.
14741 * alloc.c (dump_zombies): Add missing format specifier.
14742
14743 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14744
14745 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14746 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14747
14748 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14749 Some packages use them to denote characters with modifiers.
14750
14751 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14752
14753 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14754 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14755 matching a pp-number. Rename parameter var to var1.
14756
14757 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14758
14759 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14760
14761 2011-10-08 Glenn Morris <rgm@gnu.org>
14762
14763 * callint.c (Fcall_interactively): Give a more explicit error for the
14764 'c' case with a non-character input. (Bug#8479)
14765
14766 2011-10-08 Eli Zaretskii <eliz@gnu.org>
14767
14768 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14769 lines.
14770 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14771 lines that are hscrolled on the left.
14772
14773 * dispnew.c (buffer_posn_from_coords): Account for a possible
14774 presence of header-line. (Bug#4426)
14775
14776 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14777
14778 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14779 Don't advertise functionality which we discourage or doesn't work.
14780
14781 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14782
14783 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14784 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14785 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14786 this makes Emacs dump core during garbage collection on rare
14787 occasions. sizeof is obviously inferior to offsetof here, so
14788 stick with offsetof.
14789 (GC_POINTER_ALIGNMENT): New macro.
14790 (mark_memory): Omit 3rd (offset) arg; caller changed.
14791 Don't assume EMACS_INT alignment is the same as pointer alignment.
14792
14793 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14794
14795 * keyboard.c (read_key_sequence_remapped): New var.
14796 (read_key_sequence): Compute remapping in the right buffer.
14797 (command_loop_1): Use read_key_sequence's remapping directly.
14798
14799 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14800
14801 * dired.c (file_name_completion): Don't expand file name.
14802 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14803 before checking file name handler.
14804
14805 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14806 they've been requested explicitly (bug#9591).
14807
14808 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
14809
14810 * keymap.c (Fsingle_key_description): Use make_specified_string
14811 instead of build_string to build string from push_key_description.
14812 (Bug#5193)
14813
14814 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14815
14816 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14817 This fixes a Y2038 bug on 64-bit hosts.
14818 * buffer.c (reset_buffer):
14819 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14820 (Fclear_buffer_auto_save_failure):
14821 Use 0, not -1, to represent an unset failure time, since time_t
14822 might not be signed.
14823
14824 Remove dependency on glibc malloc internals.
14825 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14826 Move back here from lisp.h, but with their new implementations.
14827 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14828 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14829 * charset.c (charset_table_init): New static var.
14830 (syms_of_charset): Use it instead of xmalloc. This removes a
14831 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14832 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14833 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14834 Move back to alloc.c.
14835 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14836 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14837
14838 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14839
14840 * nsterm.m (windowDidResize): Call x_set_window_size only when
14841 ns_in_resize is true. Otherwise set pixelwidth/height and
14842 call change_frame_size (Bug#9628).
14843
14844 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14845
14846 Port --enable-checking=all to Fedora 14 x86-64.
14847 * charset.c (syms_of_charset): Also account for glibc malloc's
14848 internal overhead when calculating the initial malloc maximum.
14849
14850 Port --enable-checking=all to Fedora 14 x86.
14851 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14852 Move to lisp.h.
14853 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14854 (overrun_check_realloc, overrun_check_free):
14855 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14856 That way, xmalloc returns a properly-aligned pointer even if
14857 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14858 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14859 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14860 into account when calculating the initial malloc maximum.
14861 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14862 Move here from alloc.c, so that charset.c can use it too.
14863 Properly align; the old code wasn't right for common 32-bit hosts
14864 when configured with --enable-checking=all.
14865 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14866 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14867
14868 2011-09-29 Eli Zaretskii <eliz@gnu.org>
14869
14870 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
14871 use EDOM.
14872
14873 2011-09-28 Eli Zaretskii <eliz@gnu.org>
14874
14875 * xdisp.c (compute_display_string_end): If there's no display
14876 string at CHARPOS, return -1.
14877
14878 * bidi.c (bidi_fetch_char): When compute_display_string_end
14879 returns a negative value, treat the character as a normal
14880 character not covered by a display string. (Bug#9624)
14881
14882 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
14883
14884 * lread.c (Fread_from_string): Fix typo in docstring.
14885
14886 2011-09-27 Eli Zaretskii <eliz@gnu.org>
14887
14888 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14889 newline, reseat the iterator instead of bidi-iterating there one
14890 character at a time. (Bug#9610)
14891 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14892 TO_CHARPOS if the bidi iterator is at base embedding level.
14893
14894 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14895
14896 * lread.c (readevalloop): Use correct code for NBSP.
14897 (read1): Likewise. (Bug#9608)
14898
14899 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
14900
14901 * dbusbind.c (Fdbus_register_signal): When service is not
14902 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14903
14904 2011-09-25 Glenn Morris <rgm@gnu.org>
14905
14906 * buffer.c (truncate-lines): Doc fix.
14907
14908 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
14909
14910 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14911 (Fset_window_next_buffers): Doc fix.
14912
14913 2011-09-24 Glenn Morris <rgm@gnu.org>
14914
14915 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14916
14917 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14918
14919 Fix minor problems found by static checking.
14920 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
14921 * indent.c (Fvertical_motion): Fix == vs = typo.
14922
14923 2011-09-24 Eli Zaretskii <eliz@gnu.org>
14924
14925 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14926 Default value is now t. Doc fix.
14927
14928 * indent.c (Fvertical_motion): Compute and apply the overshoot
14929 logic when moving up, not only when moving down. Fix the
14930 confusing name and values of the it_overshoot_expected variable;
14931 logic changes accordingly. (Bug#9254) (Bug#9549)
14932
14933 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14934 CHARPOS is covered by a display string which includes newlines.
14935 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14936 is covered by a display string with embedded newlines.
14937
14938 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
14939
14940 * dbusbind.c (Fdbus_register_signal): Add match rule to
14941 Vdbus_registered_objects_table. (Bug#9581)
14942 (Fdbus_register_method, Vdbus_registered_objects_table):
14943 Fix docstring.
14944
14945 2011-09-24 Jim Meyering <meyering@redhat.com>
14946
14947 do not ignore write error for any output size
14948 The previous change was incomplete.
14949 While it makes emacs --batch detect the vast majority of stdout
14950 write failures, errors were still ignored whenever the output size is
14951 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14952 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14953 && echo FAIL: ignored write error
14954 FAIL: ignored write error
14955 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14956 && echo FAIL: ignored write error
14957 FAIL: ignored write error
14958 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14959
14960 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14961
14962 * emacs.c (Fkill_emacs): In noninteractive mode exit
14963 non-successfully if a write error occurred on stdout. (Bug#9574)
14964
14965 2011-09-21 Eli Zaretskii <eliz@gnu.org>
14966
14967 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14968 the xassert test.
14969
14970 * dispextern.h (struct it): Update the comment documenting what
14971 can it->OBJECT be.
14972
14973 2011-09-20 Eli Zaretskii <eliz@gnu.org>
14974
14975 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14976 a display string, extend search for cursor position to end of row.
14977 (find_row_edges): If the row ends in a newline from a display
14978 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14979 Handle the case of a display string with multiple newlines.
14980 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14981 non-empty line. Fixes confusing cursor motion with arrow keys at
14982 the beginning of a line that starts with whitespace.
14983
14984 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14985
14986 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
14987 (bug#9493).
14988
14989 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
14990
14991 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
14992 boolean (Bug#9154).
14993
14994 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14995
14996 * xdisp.c (display_line): Record maximum and minimum buffer
14997 positions even if no glyphs were produced (e.g., by a zero-width
14998 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
14999 buffer positions that will be removed from the glyph row because
15000 they don't fit.
15001 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15002 column is beyond frame width: don't subtract 1 "pixel" when
15003 computing width of the stretch.
15004 (reseat_at_next_visible_line_start): Undo the change made on
15005 2011-09-17 that saved paragraph information and restored it after
15006 the call to `reseat'. (Bug#9545)
15007
15008 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15009
15010 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15011 and turn window cursor on if cleared (Bug#9415).
15012
15013 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
15014
15015 * search.c (boyer_moore): Take unibyte characters from pattern
15016 literally. (Bug#9458)
15017
15018 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15019
15020 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15021
15022 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15023
15024 Fix minor problem found by static checking.
15025 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15026 initialized, to pacify gcc -Wuninitialized.
15027
15028 * fileio.c: Report proper errno when syscall falls.
15029 (Finsert_file_contents): Save and restore errno,
15030 so that report_file_error outputs the correct diagnostic.
15031 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15032
15033 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15034
15035 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15036
15037 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15038
15039 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15040 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15041
15042 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15043
15044 * xdisp.c (reseat_at_next_visible_line_start): Keep information
15045 about the current paragraph and restore it after the call to reseat.
15046
15047 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15048 (bidi_find_paragraph_start): Search back for paragraph beginning
15049 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15050 (bidi_move_to_visually_next): Only trigger paragraph-related
15051 computations when the last character is a newline or at EOB, not
15052 just any NEUTRAL_B. (Bug#9470)
15053
15054 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15055 truncated lines if point is covered by a display string. (Bug#9524)
15056
15057 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15058
15059 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15060 (cons_to_x_long): New function.
15061 (lisp_data_to_selection_data): Use it. Correct the test for
15062 short-versus-long data; it was negated. Break out of vector
15063 loop, for efficiency, when a long datum is discovered.
15064
15065 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15066
15067 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15068
15069 2011-09-16 Eli Zaretskii <eliz@gnu.org>
15070
15071 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15072 GCC PR/17406) by declaring this function with external scope.
15073
15074 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15075
15076 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15077 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15078
15079 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15080
15081 * editfns.c (Fformat): Correctly handle text properties on "%%".
15082
15083 2011-09-15 Eli Zaretskii <eliz@gnu.org>
15084
15085 * xterm.c (x_draw_composite_glyph_string_foreground):
15086 * w32term.c (x_draw_composite_glyph_string_foreground):
15087 * term.c (encode_terminal_code):
15088 * composite.c (composition_update_it, get_composition_id):
15089 * xdisp.c (get_next_display_element)
15090 (fill_composite_glyph_string): Add comments about special meaning
15091 of TAB characters in a composition.
15092
15093 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15094
15095 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15096 This occurs when processing a multibyte format.
15097 Problem reported by Wolfgang Jenker.
15098
15099 2011-09-15 Johan Bockgård <bojohan@gnu.org>
15100
15101 * xdisp.c (try_cursor_movement): Only check for exact match if
15102 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15103
15104 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15105
15106 Remove unused external symbols.
15107 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15108 * xdisp.c (calc_pixel_width_or_height): Now static.
15109 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15110 * indent.c (check_display_width):
15111 * w32term.c: Fix comment to match code.
15112 * xterm.c, xterm.h (x_catching_errors): Remove.
15113
15114 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15115
15116 * xselect.c: Use signed conversions more consistently (Bug#9498).
15117 (selection_data_to_lisp_data): Assume incoming selection data are
15118 signed integers, not unsigned. This is to be consistent with
15119 outgoing selection data, which was modified to use signed integers
15120 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15121 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15122 expects long, not unsigned long.
15123
15124 2011-09-14 Eli Zaretskii <eliz@gnu.org>
15125
15126 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15127 computation of loop end. Reported by Johan Bockgård
15128 <bojohan@gnu.org>.
15129
15130 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
15131
15132 * frame.c (Fother_visible_frames_p): Function deleted.
15133
15134 2011-09-12 Eli Zaretskii <eliz@gnu.org>
15135
15136 * indent.c (compute_motion): Process display vector front to back
15137 rather than the other way around. (Bug#2496)
15138
15139 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15140
15141 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15142
15143 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
15144
15145 * minibuf.c (Fread_from_minibuffer): Doc fix.
15146
15147 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15148
15149 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15150 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15151
15152 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15153
15154 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15155 value for non-existent files.
15156
15157 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15158
15159 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15160 set its "size" to -1. This will set the modtime_size field of
15161 the corresponding buffer to -1, which is what
15162 verify-visited-file-modtime expects for files that do not exist.
15163 (Bug#9139)
15164
15165 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15166
15167 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15168 here ...
15169 * lisp.h: ... from here. push_key_description is no longer
15170 defined in keyboard.c, so its declaration should not be in
15171 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15172 logically belongs with push_key_description.
15173
15174 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15175
15176 * buffer.h: Include <sys/types.h> instead of <time.h>.
15177 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15178 Problem reported by Herbert J. Skuhra.
15179
15180 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15181
15182 * xml.c (parse_region): Make the parsing work for
15183 non-comment-starting XML files again (bug#9144).
15184
15185 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15186
15187 * image.c (gif_load): Fix calculation of bottom and right corner.
15188 (Bug#9468)
15189
15190 2011-09-10 Eli Zaretskii <eliz@gnu.org>
15191
15192 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15193 redisplay in small windows.
15194
15195 2011-09-09 Eli Zaretskii <eliz@gnu.org>
15196
15197 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15198
15199 2011-09-08 Martin Rudalics <rudalics@gmx.at>
15200
15201 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15202 Operate on live windows only.
15203
15204 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
15205
15206 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15207
15208 2011-09-07 Eli Zaretskii <eliz@gnu.org>
15209
15210 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15211 only under bidi iteration.
15212
15213 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15214
15215 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15216
15217 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15218
15219 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15220 Without this fix, the command to link temacs failed due to an
15221 undefined symbol __builtin_isnan. This is because
15222 /usr/include/iso/math_c99.h #defines isnan(x) to
15223 __builtin_isnan(x), but the bundled gcc, which identifies itself
15224 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15225 a __builtin_isnan.
15226 * floatfns.c (isnan): #undef, and then #define to a clone of
15227 what's in data.c.
15228 (Fisnan): Always define, since it's always available now.
15229 (syms_of_floatfns): Always define isnan at the Lisp level.
15230
15231 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15232
15233 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15234
15235 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15236
15237 * fileio.c: Fix bugs with large file offsets (Bug#9428).
15238 The previous code assumed that file offsets (off_t values) fit in
15239 EMACS_INT variables, which is not true on typical 32-bit hosts.
15240 The code messed up by falsely reporting buffer overflow in cases
15241 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15242 when "big" contains more than 2**29 bytes, even though this
15243 inserts just one byte and does not overflow the buffer.
15244 (Finsert_file_contents): Store file offsets as off_t
15245 values, not as EMACS_INT values. Check for overflow when
15246 converting between EMACS_INT and off_t. When checking for
15247 buffer overflow or for overlap, take the offsets into account.
15248 Don't use EMACS_INT for small values where int suffices.
15249 When checking for overlap, fix a typo: ZV was used where
15250 ZV_BYTE was intended.
15251 (Fwrite_region): Don't assume off_t fits into 'long'.
15252 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15253
15254 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
15255
15256 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15257
15258 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15259
15260 sprintf-related integer and memory overflow issues (Bug#9412).
15261
15262 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
15263 (esprintf, exprintf, evxprintf): New functions.
15264 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
15265 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
15266 (modify_event_symbol): Do not assume that the length of
15267 name_alist_or_stem is safe to alloca and fits in int.
15268 (Fexecute_extended_command): Likewise for function name and binding.
15269 (Frecursion_depth): Wrap around reliably on integer overflow.
15270 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15271 since some callers pass EMACS_INT values.
15272 (Fsingle_key_description): Don't crash if symbol name contains more
15273 than MAX_ALLOCA bytes.
15274 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15275 (get_minibuffer): Arg is now EMACS_INT, not int.
15276 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
15277 (esprintf, exprintf, evxprintf): New decls.
15278 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15279
15280 * dbusbind.c (signature_cat): New function.
15281 (xd_signature, Fdbus_register_signal):
15282 Do not overrun buffer; instead, report string overflow.
15283
15284 * dispnew.c (add_window_display_history): Don't overrun buffer.
15285 Truncate instead; this is OK since it's just a log.
15286
15287 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15288 even if the time zone offset is outlandishly large.
15289 Don't mishandle offset == INT_MIN.
15290
15291 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15292 when creating daemon; the previous buffer-overflow check was incorrect.
15293
15294 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15295 which has the guts of the old verror function.
15296
15297 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15298 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15299
15300 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15301 (font_unparse_xlfd): Don't blindly alloca long strings.
15302 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
15303 fits in int, when using sprintf. Use single snprintf to count
15304 length of string rather than counting it via multiple sprintfs;
15305 that's simpler and more reliable.
15306 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15307 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15308 sprintf, in case result does not fit in int.
15309
15310 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15311 (fontset_from_font): Print it.
15312
15313 * frame.c (tty_frame_count): Now printmax_t, not int.
15314 (make_terminal_frame, set_term_frame_name): Print it.
15315 (x_report_frame_params): In X, window IDs are unsigned long,
15316 not signed long, so print them as unsigned.
15317 (validate_x_resource_name): Check for implausibly long names,
15318 and don't assume name length fits in 'int'.
15319 (x_get_resource_string): Don't blindly alloca invocation name;
15320 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15321 not fit in int.
15322
15323 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15324 (xg_check_special_colors, xg_set_geometry):
15325 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15326
15327 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15328 Use esprintf, not sprintf, in case result does not fit in int.
15329
15330 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15331 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15332 it as a large positive number.
15333 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15334 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15335
15336 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15337 in case result does not fit in int.
15338
15339 * print.c (float_to_string): Detect width overflow more reliably.
15340 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15341 buffer overrun. Don't assume list length fits in 'int'. Treat
15342 print length of 0 as 0, not as infinity; to be consistent with other
15343 uses of print length in this function. Don't overflow print length
15344 index. Don't assume hash table size fits in 'long', or that
15345 vectorlike size fits in 'unsigned long'.
15346
15347 * process.c (make_process): Use printmax_t, not int, to format
15348 process-name gensyms.
15349
15350 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15351
15352 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15353 to avoid potential buffer overrun.
15354
15355 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15356 if X resource line is longer than 512 bytes.
15357
15358 * xfns.c (x_window): Make sprintf buffer a bit bigger
15359 to avoid potential buffer overrun.
15360
15361 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15362
15363 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15364
15365 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15366
15367 Integer overflow fixes for scrolling, etc.
15368 Without these, Emacs silently mishandles large integers sometimes.
15369 For example, "C-u 4294967297 M-x recenter" was treated as if
15370 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15371
15372 * xdisp.c (try_window_id): Check Emacs fixnum range before
15373 converting to 'int'.
15374
15375 * window.c (window_scroll_line_based, Frecenter):
15376 Check that an Emacs fixnum is in range before assigning it to 'int'.
15377 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15378 values converted from Emacs fixnums.
15379 (Frecenter): Don't wrap around a line count if it is out of 'int'
15380 range; instead, treat it as an extreme value.
15381 (Fset_window_configuration, compare_window_configurations):
15382 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15383
15384 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15385 that can exceed INT_MAX. Check that EMACS_INT value is in range
15386 before assigning it to the (possibly-narrower) index.
15387 (match_limit): Don't assume that a fixnum can fit in 'int'.
15388
15389 * print.c (print_object): Use ptrdiff_t, not int, for index that can
15390 exceed INT_MAX.
15391
15392 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
15393 (Fvertical_motion): Don't wrap around LINES values that don't fit
15394 in 'int'. Instead, treat them as extreme values. This is good
15395 enough for windows, which can't have more than INT_MAX lines anyway.
15396
15397 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15398
15399 * Require libxml/parser.h to avoid compilation warning.
15400
15401 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15402
15403 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15404 since this reportedly can destroy thread storage.
15405
15406 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
15407
15408 * syntax.c (find_defun_start): Update all cache variables if
15409 exiting early (Bug#9401).
15410
15411 2011-08-30 Eli Zaretskii <eliz@gnu.org>
15412
15413 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15414
15415 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15416 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15417 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15418
15419 * term.c (tty_append_glyph): New function.
15420 (produce_stretch_glyph): Static function and its prototype deleted.
15421
15422 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15423 Add prototypes.
15424
15425 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15426
15427 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15428 when checking :margin (Bug#9390).
15429 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
15430 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
15431 so that the name doesn't mislead. All uses changed.
15432
15433 2011-08-28 Johan Bockgård <bojohan@gnu.org>
15434
15435 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15436 set_tty_hooks.
15437
15438 2011-08-27 Eli Zaretskii <eliz@gnu.org>
15439
15440 * xdisp.c (move_it_to): Don't bail out early when reaching
15441 position beyond to_charpos, if we are scanning backwards.
15442 (move_it_vertically_backward): When DY == 0, make sure we get to
15443 the first character in the line after the newline.
15444
15445 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15446
15447 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15448 (ccl_driver): Do not generate an out-of-range pointer.
15449 (Fccl_execute_on_string): Remove unnecessary check for
15450 integer overflow, noted by Stefan Monnier in
15451 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15452 Remove a FIXME that didn't need fixing.
15453 Simplify the newly-introduced buffer reallocation code.
15454
15455 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
15456
15457 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15458
15459 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
15460
15461 Integer and memory overflow issues (Bug#9196).
15462
15463 * doc.c (get_doc_string): Rework so that
15464 get_doc_string_buffer_size is the actual buffer size, rather than
15465 being 1 less than the actual buffer size; this makes xpalloc more
15466 convenient.
15467
15468 * image.c (x_allocate_bitmap_record, cache_image):
15469 * xselect.c (Fx_register_dnd_atom):
15470 Simplify previous changes by using xpalloc.
15471
15472 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15473 since either will do and ptrdiff_t is convenient with xpalloc.
15474
15475 * charset.c (charset_table_size)
15476 (struct charset_sort_data.priority): Now ptrdiff_t.
15477 (charset_compare): Don't overflow if priorities differ greatly.
15478 (Fsort_charsets): Don't assume list length fits in int.
15479 Check for size-calculation overflow when allocating sort data.
15480 (syms_of_charset): Allocate an initial charset table that is
15481 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15482
15483 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15484
15485 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15486 The actual value is always <= INT_MAX, and leaving it unsigned made
15487 overflow checking harder.
15488
15489 * dispextern.h (struct glyph_matrix.rows_allocated)
15490 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15491 with xpalloc. The values are still always <= INT_MAX.
15492
15493 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15494
15495 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15496 (SAFE_NALLOCA): New macro.
15497
15498 * region-cache.c (struct boundary.pos, find_cache_boundary)
15499 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15500 (set_cache_region, invalidate_region_cache)
15501 (revalidate_region_cache, know_region_cache, region_cache_forward)
15502 (region_cache_backward, pp_cache):
15503 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15504 so that ptrdiff_t * can be passed to xpalloc.
15505 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15506 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15507 (pp_cache): Don't assume cache_len fits in int.
15508 * region-cache.h: Adjust extern decls to match.
15509
15510 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15511 EMACS_INT, since either will do, for xpalloc.
15512
15513 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15514 (xnmalloc, xnrealloc, xpalloc): New functions.
15515
15516 * bidi.c (bidi_shelve_header_size): New constant.
15517 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15518 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15519
15520 * bidi.c (bidi_cache_shrink):
15521 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15522 (overlay_strings):
15523 Don't update size of array until after memory allocation succeeds,
15524 because xmalloc/xrealloc may not return.
15525 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15526 now that we have proper integer overflow checking.
15527 (record_overlay_string, overlay_strings): Catch overflows when
15528 calculating size of overlay_str_buf.
15529
15530 * callproc.c (Fcall_process): Check for size overflow when
15531 calculating size of args2.
15532 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15533 Normally we prefer signed values, but sticking with ptrdiff_t would
15534 require adding more-complicated checks.
15535
15536 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15537 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15538 Redo buffer-overflow calculations to avoid integer overflow.
15539 Add a FIXME comment where memory seems to be over-allocated.
15540
15541 * character.c (Fstring): Check for size-calculation overflow.
15542
15543 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15544 unnecessary integer overflow. Check for size overflow.
15545 (encode_coding_object): Don't update size until xmalloc succeeds.
15546
15547 * composite.c (get_composition_id): Check for overflow in glyph
15548 length calculations.
15549
15550 Integer and memory overflow fixes for display code.
15551 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15552 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15553 (scrolling_window): Check for overflow in size calculations.
15554 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15555 Don't assume glyph table len fits in int.
15556 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15557 (row_table_size): Now ptrdiff_t, not int.
15558 (scrolling_window): Avoid overflow in size calculations.
15559 Don't update size until allocation succeeds.
15560 * fns.c (concat): Check for overflow in size calculations.
15561 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15562 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15563 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15564
15565 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15566 (get_doc_string): Check for size calculation overflow.
15567 Don't update size until allocation succeeds.
15568 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15569 EMACS_INT, where ptrdiff_t will do.
15570 (Fsubstitute_command_keys): Check for string overflow.
15571
15572 * editfns.c (set_time_zone_rule): Don't assume environment length
15573 fits in int.
15574 (message_length): Now ptrdiff_t, not int.
15575 (Fmessage_box): Don't update size until allocation succeeds.
15576 Don't assume message length fits in int.
15577 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15578
15579 * emacs.c (main): Do not reallocate argv, since there is a null at
15580 the end that can be overwritten, and this way there's no need to
15581 worry about size-calculation overflow.
15582 (sort_args): Check for size-calculation overflow.
15583
15584 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15585 alloc succeeds.
15586 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15587
15588 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15589 (x_set_scroll_bar_width, x_figure_window_size):
15590 Check for integer overflow.
15591 (x_set_alpha): Do not assume XINT fits in int.
15592
15593 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15594 This is for the members text_lines, text_cols, total_lines, total_cols,
15595 where the system imposes an 'int' limit.
15596
15597 * fringe.c (Fdefine_fringe_bitmap):
15598 Don't update size until alloc works.
15599
15600 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15601 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15602
15603 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15604 Check for size-calculation overflow.
15605 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15606 do, as we prefer signed integers.
15607 (id_to_widget.max_size, id_to_widget.used)
15608 (xg_store_widget_in_map, xg_remove_widget_from_map)
15609 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15610 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15611 Use and return ptrdiff_t, not int.
15612 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15613 * gtkutil.h: Change prototypes to match the above.
15614
15615 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15616 are duplicate now that they've been promoted to lisp.h.
15617 (x_allocate_bitmap_record, x_alloc_image_color)
15618 (make_image_cache, cache_image, xpm_load):
15619 Don't update size until alloc is done.
15620 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15621 (x_detect_edges):
15622 Check for size calculation overflow.
15623 (ct_colors_allocated_max): New constant.
15624 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15625 overflow.
15626
15627 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15628 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15629 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15630 Use ptrdiff_t, not int, to count maps.
15631 (read_char_minibuf_menu_prompt): Check for overflow in size
15632 calculations. Don't update size until allocation succeeds.
15633 Redo calculations to avoid overflow.
15634 * keyboard.h: Change prototypes to match the above.
15635
15636 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15637 to count maps.
15638 (current_minor_maps): Check for size calculation overflow.
15639 * keymap.h: Change prototypes to match the above.
15640
15641 * lread.c (read1, init_obarray): Don't update size until alloc done.
15642
15643 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15644 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15645
15646 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15647 Now ptrdiff_t, not int.
15648 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15649 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15650
15651 * process.c (Fnetwork_interface_list): Check for overflow
15652 in size calculation.
15653
15654 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15655
15656 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15657 overflow. Don't bother calling xmalloc when xrealloc will do.
15658
15659 * search.c (Freplace_match): Check for size calculation overflow.
15660 (Fset_match_data): Don't assume list lengths fit in 'int'.
15661
15662 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15663 for command line length. Do not attempt to address one before the
15664 beginning of an array, as that's not portable.
15665
15666 * term.c (max_frame_lines): Remove; unused.
15667 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15668 not int.
15669 (encode_terminal_code, calculate_costs): Check for size
15670 calculation overflow.
15671 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15672 table lengths and related sizes. Don't update size until alloc
15673 done. Redo calculations to avoid overflow.
15674 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15675
15676 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15677 subtracting pointers.
15678 (gobble_line): Check for overflow more carefully. Don't update size
15679 until alloc done.
15680
15681 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15682 Don't update size until alloc done.
15683 Redo size calculations to avoid overflow.
15684 Check for size calculation overflow.
15685 (main) [DEBUG]: Fix typo in invoking tparam1.
15686
15687 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15688 Use ptrdiff_t, not int, for sizes.
15689 (store_mode_line_noprop_char): Don't update size until alloc done.
15690
15691 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15692 Use ptrdiff_t, not int, for sizes.
15693 (Finternal_make_lisp_face, cache_face):
15694 Check for size calculation overflow.
15695 (cache_face): Treat size calculation overflows as if they were
15696 memory exhaustion (the usual treatment), rather than aborting.
15697
15698 * xfns.c (x_encode_text, x_set_name_internal)
15699 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15700 sizes, since they can exceed INT_MAX in size. Check for size
15701 calculation overflow.
15702
15703 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15704 (xg_select): Check for size calculation overflow.
15705 Don't update size until alloc done.
15706
15707 * xrdb.c (get_environ_db): Don't assume path length fits in int,
15708 as sprintf is limited to int lengths.
15709
15710 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15711 (X_LONG_MIN): New macros.
15712 Use them to make the following changes clearer.
15713 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15714 This change doesn't affect the value now, but it may help remind
15715 future maintainers not to raise the value too much later.
15716 (SELECTION_QUANTUM): Remove, replacing with ...
15717 (selection_quantum): ... new function, which avoids overflow.
15718 All uses changed.
15719 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15720 assumption that selection length fits in 'int'.
15721 (x_reply_selection_request, x_handle_selection_request)
15722 (x_get_window_property, receive_incremental_selection)
15723 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15724 (lisp_data_to_selection_data, clean_local_selection_data):
15725 Use ptrdiff_t, not int, to record length of selection.
15726 (x_reply_selection_request, x_get_window_property)
15727 (receive_incremental_selection, x_property_data_to_lisp):
15728 Redo calculations to avoid overflow.
15729 (x_reply_selection_request): When sending hint, ceiling it at
15730 X_LONG_MAX rather than relying on wraparound overflow to send
15731 something.
15732 (x_get_window_property, receive_incremental_selection)
15733 (lisp_data_to_selection_data, x_property_data_to_lisp):
15734 Check for size-calculation overflow.
15735 (x_get_window_property, receive_incremental_selection)
15736 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15737 Don't store size until memory allocation succeeds.
15738 (x_get_window_property): Plug memory leak on memory exhaustion.
15739 Don't double-block input; malloc is safe here. Don't assume 2**34
15740 - 4 fits in unsigned long. Add an xassert to check
15741 XGetWindowProperty overflow. Be more careful about overflow
15742 calculations, and distinguish size from memory overflow better.
15743 (receive_incremental_selection): When tracing, don't assume
15744 unsigned int is less than INT_MAX.
15745 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15746 harmful) conversions of unsigned short to int.
15747 (lisp_data_to_selection_data): Don't assume that integers
15748 in the range -65535 through -1 fit in an X unsigned short.
15749 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15750 result parameters unless successful. Rely on cons_to_unsigned
15751 to report problems with elements; the old code wasn't right anyway.
15752 (x_check_property_data): Check for int overflow; we cannot use
15753 a wider type due to X limits.
15754 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15755
15756 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
15757
15758 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15759 (x_term_init): Check for size calculation overflow.
15760 (x_color_cells): Don't store size until memory allocation succeeds.
15761 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
15762 Don't assume alloca size is less than MAX_ALLOCA.
15763 (x_term_init): Don't assume length fits in int (sprintf is limited
15764 to int size).
15765
15766 Use ptrdiff_t for composition IDs.
15767 * character.c (lisp_string_width):
15768 * composite.c (composition_table_size, n_compositions)
15769 (get_composition_id, composition_gstring_from_id):
15770 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15771 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15772 * window.c (Frecenter):
15773 Use ptrdiff_t, not int, for composition IDs.
15774 * composite.c (get_composition_id): Check for integer overflow.
15775 * composite.h: Adjust prototypes to match the above changes.
15776
15777 Use ptrdiff_t for hash table indexes.
15778 * category.c (hash_get_category_set):
15779 * ccl.c (ccl_driver):
15780 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15781 * coding.c (coding_system_charset_list, detect_coding_system):
15782 * coding.h (struct coding_system.id):
15783 * composite.c (get_composition_id, gstring_lookup_cache):
15784 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15785 * image.c (xpm_get_color_table_h):
15786 * lisp.h (hash_lookup, hash_put):
15787 * minibuf.c (Ftest_completion):
15788 Use ptrdiff_t for hash table indexes, not int (which is too
15789 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15790 32-bit --with-wide-int hosts).
15791
15792 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15793 Add a FIXME comment about memory leaks.
15794 (syms_of_charset): Don't assume xmalloc returns.
15795
15796 Don't assume that stated character widths fit in int.
15797 * character.c (Fchar_width, c_string_width, lisp_string_width):
15798 * character.h (CHAR_WIDTH):
15799 * indent.c (MULTIBYTE_BYTES_WIDTH):
15800 Use sanitize_char_width to avoid undefined and/or bad behavior
15801 with outlandish widths.
15802 * character.h (sanitize_tab_width): Rename from sanitize_width,
15803 now that we have two such functions. All uses changed.
15804 (sanitize_char_width): New inline function.
15805
15806 Don't assume that tab-width fits in int.
15807 * character.h (sanitize_width): New inline function.
15808 (SANE_TAB_WIDTH): New macro.
15809 (ASCII_CHAR_WIDTH): Use it.
15810 * indent.c (sane_tab_width): Remove. All uses replaced by
15811 SANE_TAB_WIDTH (current_buffer).
15812 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15813
15814 * fileio.c: Integer overflow issues with file modes.
15815 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15816
15817 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15818 Remove unreachable code.
15819 (read_hex, load_charset_map_from_file): Check for integer overflow.
15820
15821 * xterm.c: Don't go over XClientMessageEvent limit.
15822 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15823 (x_send_scroll_bar_event): Likewise. Check that the size does not
15824 exceed limits imposed by XClientMessageEvent, as well as the usual
15825 ptrdiff_t and size_t limits.
15826
15827 * keyboard.c: Overflow, signedness and related fixes.
15828 (make_lispy_movement): Use same integer type in forward decl
15829 that is used in the definition.
15830 (read_key_sequence, keyremap_step):
15831 Change bufsize argument back to int, undoing my 2011-03-30 change.
15832 We prefer signed types, and int is wide enough here.
15833 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15834 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15835 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15836 length, not size_t. Use ptrdiff_t for index, not int.
15837 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15838 possibility of integer overflow.
15839
15840 Overflow, signedness and related fixes for images.
15841
15842 * dispextern.h (struct it.stack[0].u.image.image_id)
15843 (struct_it.image_id, struct image.id, struct image_cache.size)
15844 (struct image_cache.used, struct image_cache.ref_count):
15845 * gtkutil.c (update_frame_tool_bar):
15846 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15847 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15848 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15849 * nsmenu.m (update_frame_tool_bar):
15850 * xdisp.c (calc_pixel_width_or_height):
15851 * xfns.c (image_cache_refcount):
15852 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15853 on typical 64-bit hosts.
15854
15855 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15856 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15857 Omit unnecessary casts to int.
15858 (parse_image_spec): Check that integers fall into 'int' range
15859 when the callers expect that.
15860 (image_ascent): Redo ascent calculation to avoid int overflow.
15861 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15862 (lookup_image): Remove unnecessary tests.
15863 (xbm_image_p): Locals are now of int, not EMACS_INT,
15864 since parse_image_check makes sure they fit into int.
15865 (png_load, gif_load, svg_load_image):
15866 Prefer int to unsigned where either will do.
15867 (tiff_handler): New function, combining the cores of the
15868 old tiff_error_handler and tiff_warning_handler.
15869 This function is rewritten to use vsnprintf and thereby avoid
15870 stack buffer overflows. It uses only the features of vsnprintf
15871 that are common to both POSIX and native Microsoft.
15872 (tiff_error_handler, tiff_warning_handler): Use it.
15873 (tiff_load, gif_load, imagemagick_load_image):
15874 Don't assume :index value fits in 'int'.
15875 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15876 (imagemagick_load_image): Check that crop parameters fit into
15877 the integer types that MagickCropImage accepts. Don't assume
15878 Vimagemagick_render_type has a nonnegative value. Don't assume
15879 size_t fits in 'long'.
15880 (gs_load): Use printmax_t to print the widest integers possible.
15881 Check for integer overflow when computing image height and width.
15882
15883 2011-08-26 Eli Zaretskii <eliz@gnu.org>
15884
15885 * xdisp.c (redisplay_window): Don't force window start if point
15886 will be invisible in the resulting window. (Bug#9324)
15887
15888 2011-08-25 Eli Zaretskii <eliz@gnu.org>
15889
15890 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15891 the display spec is of the form `(space ...)'.
15892 (handle_display_spec): Return the value returned by
15893 handle_single_display_spec, not just 1 or zero.
15894 (handle_single_display_spec): If the display spec is of the form
15895 `(space ...)', and specifies display in the text area, return 2
15896 rather than 1.
15897 (try_cursor_movement): Check for the need to scroll more
15898 accurately, and prefer exact match for point under bidi.
15899 Don't advance `row' beyond the last row of the window.
15900
15901 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15902 into disp_prop; all users changed.
15903
15904 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15905 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15906 for the text covered by the display property.
15907
15908 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
15909
15910 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15911 Change return value to nil.
15912 (Frecord_buffer): Delete unused function.
15913
15914 2011-08-24 Eli Zaretskii <eliz@gnu.org>
15915
15916 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15917 buffers, return left-to-right.
15918 (set_cursor_from_row): Consider candidate row a win if its glyph
15919 represents a newline and point is on that newline. Fixes cursor
15920 positioning on the newline at EOL of R2L text within L2R
15921 paragraph, and vice versa.
15922 (try_cursor_movement): Check continued rows, in addition to
15923 continuation rows. Fixes unwarranted scroll when point enters a
15924 continued line of R2L text within an L2R paragraph, or vice versa.
15925 (cursor_row_p): Consider the case of point being equal to
15926 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15927 from the end of a short line to the beginning of a continued line
15928 of R2L text within L2R paragraph.
15929 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15930 composed characters.
15931
15932 * bidi.c (bidi_check_type): Use xassert.
15933 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15934 members.
15935
15936 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15937
15938 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15939 a character.
15940
15941 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
15942
15943 * nsfont.m (ns_otf_to_script): Fix typo.
15944
15945 2011-08-22 Kenichi Handa <handa@m17n.org>
15946
15947 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15948 extra slot even if the purpose is char-code-property-table.
15949
15950 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15951
15952 * xdisp.c (redisplay_window): When computing centering_position,
15953 account for the height of the header line. (Bug#8874)
15954
15955 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15956 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15957 candidate is selected by the mouse, and that candidate has a
15958 composed character under the mouse.
15959
15960 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15961 coordinates reported by pos-visible-in-window-p for a composed
15962 character in column zero.
15963
15964 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15965
15966 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15967
15968 2011-08-22 Eli Zaretskii <eliz@gnu.org>
15969
15970 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15971 consider it a hit if to_charpos is anywhere in the range of the
15972 composed buffer positions.
15973
15974 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
15975
15976 * image.c (gif_load): Don't assume that each subimage has the same
15977 dimensions as the base image. Handle disposal method that is
15978 "undefined" by the gif spec (Bug#9335).
15979
15980 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
15981
15982 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
15983 (Fcondition_case): Document `debug' symbol in error handler.
15984
15985 2011-08-19 Eli Zaretskii <eliz@gnu.org>
15986
15987 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
15988 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
15989 from an Org mode buffer to a Speedbar frame.
15990
15991 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
15992 a composition, take its buffer position from IT->cmp_it.charpos.
15993 Fixes cursor positioning at the beginning of a line that begins
15994 with a composed character.
15995
15996 2011-08-18 Eli Zaretskii <eliz@gnu.org>
15997
15998 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
15999 character bidirectional type, use STRONG_L instead. Fixes crashes
16000 in a buffer produced by `describe-categories'.
16001
16002 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16003 members before the level stack, so they would be saved and
16004 restored when copying iterator state. Fixes incorrect reordering
16005 around TABs covered by display properties.
16006
16007 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16008
16009 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16010
16011 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
16012
16013 * eval.c (internal_condition_case, internal_condition_case_1)
16014 (internal_condition_case_2, internal_condition_case_n):
16015 Remove unnecessary aborts (Bug#9081).
16016
16017 2011-08-17 Eli Zaretskii <eliz@gnu.org>
16018
16019 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16020 has no `load' handler, try opening the file locally. (Bug#9311)
16021
16022 2011-08-16 Ken Brown <kbrown@cornell.edu>
16023
16024 * gmalloc.c: Expand comment.
16025
16026 2011-08-16 Eli Zaretskii <eliz@gnu.org>
16027
16028 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16029 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16030
16031 2011-08-16 Ken Brown <kbrown@cornell.edu>
16032
16033 Fix memory allocation problems in Cygwin build (Bug#9273).
16034
16035 * unexcw.c ( __malloc_initialized): Declare external variable.
16036 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16037
16038 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16039 New variables.
16040 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16041 dumped emacs.
16042 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16043 in the static heap.
16044 [CYGWIN] (special_realloc): New function.
16045 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16046 requests to realloc storage in the static heap.
16047
16048 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16049
16050 * bidi.c (bidi_initialize): Remove unused local.
16051
16052 2011-08-15 Eli Zaretskii <eliz@gnu.org>
16053
16054 * bidimirror.h:
16055 * biditype.h: Remove file.
16056 * makefile.w32-in ($(BLD)/bidi.$(O)):
16057 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16058
16059 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16060
16061 * chartab.c: Improve commentary for the uniprop_table API.
16062
16063 * bidi.c (bidi_paragraph_init): Support zero value of
16064 bidi_ignore_explicit_marks_for_paragraph_level.
16065 (bidi_initialize): Use uniprop_table instead of including
16066 biditype.h and bidimirror.h.
16067
16068 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16069 coordinates of the iterator when restoring from ppos_it.
16070 (Bug#9296)
16071
16072 2011-08-14 Kenichi Handa <handa@m17n.org>
16073
16074 * process.c (create_process): Call setup_process_coding_systems
16075 after the pid of the process is set to -1 (Bug#8162).
16076
16077 2011-08-14 Eli Zaretskii <eliz@gnu.org>
16078
16079 * xdisp.c (move_it_in_display_line_to): Don't invoke
16080 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16081 ppos_it. Fixes vertical cursor motion when line beginning is
16082 covered by an image. (Bug#9296)
16083
16084 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16085
16086 * nsterm.h (ns_run_ascript): Declare.
16087 (NSAPP_DATA2_RUNASSCRIPT): Define.
16088
16089 * nsfns.m (as_script, as_result, as_status): New static variables.
16090 (ns_run_ascript): New function.
16091 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
16092 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16093 the event loop. Get status from as_status (Bug#7276).
16094
16095 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16096 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16097 the event loop (Bug#7276).
16098
16099 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16100
16101 * gnutls.c (QCgnutls_bootprop_priority)
16102 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16103 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16104 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16105 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16106 (QCgnutls_bootprop_verify_hostname_error)
16107 (QCgnutls_bootprop_callbacks_verify): Rename from
16108 Qgnutls_bootprop_..., all uses changed.
16109
16110 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16111 uses changed.
16112
16113 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16114
16115 * xfaces.c (Qframe_set_background_mode): Now static.
16116 * dispextern.h (Qframe_set_background_mode): Remove decl.
16117
16118 * process.c (Fnetwork_interface_info): Declare local only if needed.
16119
16120 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16121
16122 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16123 (Fnetwork_interface_list): Allocate in increments of bytes instead
16124 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16125 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16126 sockaddr.
16127 (struct ifflag_def): notrailers is smart on OSX.
16128 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16129 Get hardware address with getifaddrs if available.
16130
16131 2011-08-12 Eli Zaretskii <eliz@gnu.org>
16132
16133 * xdisp.c (iterate_out_of_display_property): xassert that
16134 IT->position is set to within IT->object's boundaries. Break from
16135 the loop as soon as EOB is reached; avoids infloops in redisplay
16136 when IT->position is set up wrongly due to some bug.
16137 Set IT->current to match the bidi iterator unconditionally.
16138 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16139 entry. Force push_it to save on the stack the current
16140 buffer/string position, to be restored by pop_it. Fix flags in
16141 the iterator structure wrt the object coming from a display
16142 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16143 properties. (Bug#9284)
16144
16145 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
16146
16147 * fontset.c (fontset_get_font_group): Add proper type checks.
16148 (Bug#9172)
16149
16150 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16151
16152 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16153 and LC_VERSION_MIN_MACOSX.
16154 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16155 (dump_it) [LC_FUNCTION_STARTS]: Use it.
16156
16157 2011-08-08 Eli Zaretskii <eliz@gnu.org>
16158
16159 * xdisp.c (forward_to_next_line_start): Allow to use the
16160 no-display-properties-and-no-overlays under bidi display.
16161 Set disp_pos in the bidi iterator to avoid searches for display
16162 properties and overlays.
16163
16164 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
16165
16166 * editfns.c (Fset_time_zone_rule): Document relationship with the
16167 setenv function.
16168
16169 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16170 the font entity extracted from the cache (Bug#8109).
16171
16172 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
16173
16174 * composite.c (autocmp_chars): Don't reset point. That is done by
16175 restore_point_unwind (Bug#5984).
16176
16177 2011-08-07 Juri Linkov <juri@jurta.org>
16178
16179 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16180 to show the arg `TIME' instead of `TIMEVAL'.
16181
16182 2011-08-06 Eli Zaretskii <eliz@gnu.org>
16183
16184 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16185 display property strides EOL and includes a newline, as in
16186 longlines-mode. (Bug#9254)
16187 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16188 word-wrap under bidirectional display. (Bug#9224)
16189
16190 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16191 is non-zero, even if the data buffer is NULL. Fixes a crash in
16192 vertical-motion with longlines-mode. (Bug#9254)
16193
16194 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16195
16196 * bidi.c <bidi_cache_total_alloc>: Now static.
16197 (bidi_initialize): Initialize bidi_cache_total_alloc.
16198
16199 * xdisp.c (display_line): Release buffer allocated for shelved bidi
16200 cache. (Bug#9221)
16201
16202 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16203 amount allocated this far in `bidi_cache_total_alloc'.
16204 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16205 non-zero, only free the data buffer without restoring the cache
16206 contents. All callers changed.
16207
16208 * dispextern.h (bidi_unshelve_cache): Update prototype.
16209
16210 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16211 (move_it_in_display_line, move_it_to)
16212 (move_it_vertically_backward, move_it_by_lines): Replace the call
16213 to xfree to an equivalent call to bidi_unshelve_cache.
16214 (move_it_in_display_line_to): Fix logic of returning
16215 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
16216
16217 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16218
16219 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16220 came from a string character with a `cursor' property. (Bug#9229)
16221
16222 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16223
16224 * Makefile.in (LIB_PTHREAD): New variable.
16225 (LIBES): Add LIB_PTHREAD (Bug#9216).
16226
16227 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16228 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16229
16230 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16231
16232 * regex.c (re_iswctype): Remove some redundant boolean conversions.
16233
16234 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16235
16236 * xterm.c (x_find_topmost_parent): New function.
16237 (x_set_frame_alpha): Find topmost parent window with
16238 x_find_topmost_parent and set the property there also (bug#9181).
16239 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16240
16241 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16242
16243 * callproc.c (Fcall_process): Avoid vfork clobbering
16244 the local vars buffer, coding_systems, current_dir.
16245
16246 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16247
16248 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16249
16250 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16251
16252 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16253 so that it is not optimized away.
16254
16255 * xdisp.c (compute_display_string_pos): Remove unused local.
16256
16257 2011-08-02 Eli Zaretskii <eliz@gnu.org>
16258
16259 Fix slow cursor motion and scrolling in large buffers with
16260 selective display, like Org Mode buffers. (Bug#9218)
16261
16262 * dispextern.h (struct bidi_it): New member disp_prop_p.
16263
16264 * xdisp.c: Remove one-slot cache of display string positions.
16265 (compute_display_string_pos): Accept an additional argument
16266 DISP_PROP_P; callers changed. Scan at most 5K characters forward
16267 for a display string or property. If found, set DISP_PROP_P
16268 non-zero.
16269
16270 * bidi.c (bidi_fetch_char): Accept an additional argument
16271 DISP_PROP_P, and pass it to compute_display_string_pos.
16272 Only handle text covered by a display string if DISP_PROP_P is returned
16273 non-zero. All callers of bidi_fetch_char changed.
16274
16275 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16276
16277 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16278
16279 2010-12-03 Don March <don@ohspite.net>
16280
16281 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16282 last character M-[char] is translated to ESC [char] (bug#7541).
16283
16284 2011-08-02 Kenichi Handa <handa@m17n.org>
16285
16286 * lisp.h (uniprop_table): Extern it.
16287
16288 * chartab.c (uniprop_table): Make it non-static.
16289
16290 2011-08-01 Eli Zaretskii <eliz@gnu.org>
16291
16292 * xdisp.c (forward_to_next_line_start): Accept additional argument
16293 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16294 on the newline.
16295 (reseat_at_next_visible_line_start): Use the bidi iterator state
16296 returned by forward_to_next_line_start to restore the state of
16297 it->bidi_it after backing up to previous newline. (Bug#9212)
16298
16299 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16300
16301 * regex.c (re_comp): Protoize.
16302 (re_exec): Fix return type.
16303 (regexec): Fix type of `ret'. (Bug#9203)
16304
16305 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16306
16307 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16308 This is needed if max-image-size is a floating-point number.
16309
16310 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16311
16312 * print.c (print_object): Print empty symbol as ##.
16313
16314 * lread.c (read1): Read ## as empty symbol.
16315
16316 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16317
16318 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16319 setting frame foreground color (Bug#9175).
16320 (x_set_background_color): Likewise.
16321
16322 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16323 contents (Bug#9176).
16324 (EmacsTooltip -init): Remove bezels and add shadows to
16325 tooltip windows.
16326
16327 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16328 or scroll bar (Bug#8470).
16329
16330 * nsfont.m (nsfont_open): Remove assignment to voffset and
16331 unnecessary vars hshink, expand, hd, full_height, min_height.
16332 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16333
16334 * nsterm.h (nsfont_info): Remove voffset field.
16335
16336 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16337
16338 Implement strike-through and overline on NextStep (Bug#8863).
16339
16340 * nsfont.m (nsfont_open): Use underline position provided by font,
16341 instead of hard-coded value of 2.
16342 (nsfont_draw): Call ns_draw_text_decoration instead.
16343
16344 * nsterm.h: Add declaration for ns_draw_text_decoration.
16345
16346 * nsterm.m (ns_draw_text_decoration): New function for drawing
16347 underline, overline, and strike-through.
16348 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16349 ns_draw_text_decoration. Change treatment of cursor drawing to
16350 accommodate underlining, etc.
16351
16352 2011-07-28 Eli Zaretskii <eliz@gnu.org>
16353
16354 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16355 default.
16356
16357 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16358
16359 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16360 Without this fix, if a signal arrives just after memory fills up,
16361 'malloc' might be invoked reentrantly.
16362
16363 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16364 In other words, assume that every image size is allowed, on non-X
16365 hosts. This assumption is probably wrong, but it lets Emacs compile.
16366
16367 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16368
16369 * regex.c (re_iswctype): Convert return values to boolean.
16370
16371 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16372
16373 * xdisp.c (compute_display_string_pos): Don't use cached display
16374 string position if the buffer had its restriction changed.
16375 (Bug#9184)
16376
16377 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16378
16379 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16380
16381 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16382
16383 Integer signedness and overflow and related fixes. (Bug#9079)
16384
16385 * bidi.c: Integer size and overflow fixes.
16386 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16387 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16388 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16389 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16390 (bidi_find_other_level_edge):
16391 Use ptrdiff_t instead of EMACS_INT where either will do.
16392 This works better on 32-bit hosts configured --with-wide-int.
16393 (bidi_cache_ensure_space): Check for size-calculation overflow.
16394 Use % rather than repeated addition, for better worst-case speed.
16395 Don't set bidi_cache_size until after xrealloc returns, because it
16396 might not return.
16397 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
16398 (bidi_cache_ensure_space): Also check that the bidi cache size
16399 does not exceed that of the largest Lisp string or buffer. See Eli
16400 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
16401
16402 * alloc.c (__malloc_size_t): Remove.
16403 All uses replaced by size_t. See Andreas Schwab's note
16404 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16405
16406 * image.c: Improve checking for integer overflow.
16407 (check_image_size): Assume that f is nonnull, since
16408 it is always nonnull in practice. This is one less thing to
16409 worry about when checking for integer overflow later.
16410 (x_check_image_size): New function, which checks for integer
16411 overflow issues inside X.
16412 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16413 This removes the need for a memory_full check.
16414 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16415 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16416 (xbm_read_bitmap_data): Change locals back to 'int', since
16417 their values must fit in 'int'.
16418 (xpm_load_image, png_load, tiff_load):
16419 Invoke x_create_x_image_and_pixmap earlier,
16420 to avoid much needless work if the image is too large.
16421 (tiff_load): Treat overly large images as if
16422 x_create_x_image_and_pixmap failed, not as malloc failures.
16423 (gs_load): Use x_check_image_size.
16424
16425 * gtkutil.c: Omit integer casts.
16426 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16427 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16428
16429 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16430
16431 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16432 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16433 would wrongly return t on a 64-bit host.
16434
16435 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16436 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16437 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16438 and therefore cause GCC to emit a bogus diagnostic in some cases.
16439
16440 * image.c: Integer signedness and overflow and related fixes.
16441 This is not an exhaustive set of fixes, but it's time to
16442 record what I've got.
16443 (lookup_pixel_color, check_image_size): Remove redundant decls.
16444 (check_image_size): Don't assume that arbitrary EMACS_INT values
16445 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16446 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16447 (tiff_load, imagemagick_load_image):
16448 Check for overflow in size calculations.
16449 (x_create_x_image_and_pixmap): Remove unnecessary test for
16450 xmalloc returning NULL; that can't happen.
16451 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16452 (xpm_color_bucket): Use better integer hashing function.
16453 (xpm_cache_color): Don't possibly over-allocate memory.
16454 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16455 (gif_memory_source):
16456 Use ptrdiff_t, not int or size_t, to record sizes.
16457 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16458 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16459 either works, as we prefer signed integers.
16460 (tiff_read_from_memory, tiff_write_from_memory):
16461 Return tsize_t, not size_t, since that's what the TIFF API wants.
16462 (tiff_read_from_memory): Don't fail simply because the read would
16463 go past EOF; instead, return a short read.
16464 (tiff_load): Omit no-longer-needed casts.
16465 (Fimagemagick_types): Don't assume size fits into 'int'.
16466
16467 Improve hashing quality when configured --with-wide-int.
16468 * fns.c (hash_string): New function, taken from sxhash_string.
16469 Do not discard information about ASCII character case; this
16470 discarding is no longer needed.
16471 (sxhash-string): Use it. Change sig to match it. Caller changed.
16472 * lisp.h: Declare it.
16473 * lread.c (hash_string): Remove, since we now use fns.c's version.
16474 The fns.c version returns a wider integer if --with-wide-int is
16475 specified, so this should help the quality of the hashing a bit.
16476
16477 * emacs.c: Integer overflow minor fix.
16478 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16479 Define only if GNU_LINUX.
16480 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16481
16482 * dispnew.c: Integer signedness and overflow fixes.
16483 Remove unnecessary forward decls, that were a maintenance hassle.
16484 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16485 All uses changed.
16486 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16487 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16488 (prepare_desired_row, line_draw_cost):
16489 Use int, not unsigned, where either works.
16490 (save_current_matrix, restore_current_matrix):
16491 Use ptrdiff_t, not size_t, where either works.
16492 (init_display): Check for overflow more accurately, and without
16493 relying on undefined behavior.
16494
16495 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16496 Remove, replacing with the new symbols in lisp.h. All uses changed.
16497 * fileio.c (make_temp_name):
16498 * filelock.c (lock_file_1, lock_file):
16499 * xdisp.c (message_dolog):
16500 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16501 Use pMd etc. instead.
16502 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16503 replacing the pWIDE etc. symbols removed from editfns.c.
16504
16505 * keyboard.h (num_input_events): Now uintmax_t.
16506 This is (very slightly) less likely to mess up due to wraparound.
16507 All uses changed.
16508
16509 * buffer.c: Integer signedness fixes.
16510 (alloc_buffer_text, enlarge_buffer_text):
16511 Use ptrdiff_t rather than size_t when either will do, as we prefer
16512 signed integers.
16513
16514 * alloc.c: Integer signedness and overflow fixes.
16515 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16516 (__malloc_size_t): Default to size_t, not to int.
16517 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16518 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16519 Prefer ptrdiff_t to size_t when either would do, as we prefer
16520 signed integers.
16521 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16522 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16523 Now const. Initialize with values that are in range even if char
16524 is signed.
16525 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16526 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16527 These functions do the right thing with sizes > 2**32.
16528 (check_depth): Now ptrdiff_t, not int.
16529 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16530 Adjust to new way of storing sizes. Check for size overflow bugs
16531 in rest of code.
16532 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16533 slightly wrong anyway, as it missed one instance of
16534 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16535 (refill_memory_reserve): Omit needless cast to size_t.
16536 (mark_object_loop_halt): Mark as externally visible.
16537
16538 * xselect.c: Integer signedness and overflow fixes.
16539 (Fx_register_dnd_atom, x_handle_dnd_message):
16540 Use ptrdiff_t, not size_t, since we prefer signed.
16541 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16542 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16543 x_dnd_atoms_size and x_dnd_atoms_length.
16544
16545 * doprnt.c: Prefer signed to unsigned when either works.
16546 * eval.c (verror):
16547 * doprnt.c (doprnt):
16548 * lisp.h (doprnt):
16549 * xdisp.c (vmessage):
16550 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16551 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16552 prefer signed arithmetic to avoid comparison confusion.
16553 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16554 but is a bit tricky.
16555
16556 Assume freestanding C89 headers, string.h, stdlib.h.
16557 * data.c, doprnt.c, floatfns.c, print.c:
16558 Include float.h unconditionally.
16559 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16560 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16561 * regex.c: Likewise for stddef.h, string.h.
16562 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16563 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16564 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16565 (STDC_HEADERS): Remove obsolete defines.
16566 * sysdep.c: Include limits.h unconditionally.
16567
16568 Assume support for memcmp, memcpy, memmove, memset.
16569 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16570 * regex.c (memcmp, memcpy):
16571 Remove; we assume C89 now.
16572
16573 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16574 (__malloc_safe_bcopy): Remove; no longer needed.
16575
16576 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
16577 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16578 well either way, and we prefer signed to unsigned.
16579
16580 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16581
16582 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16583 closes the connection while we're reading (bug#9182).
16584
16585 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
16586
16587 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16588 are specified (Bug#9168).
16589
16590 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16591
16592 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16593 Found by GCC static checking and --with-wide-int on a 32-bit host.
16594
16595 2011-07-25 Eli Zaretskii <eliz@gnu.org>
16596
16597 * xdisp.c (compute_display_string_pos): Fix logic of caching
16598 previous display string position. Initialize cached_prev_pos to
16599 -1. Fixes slow-down at the beginning of a buffer.
16600
16601 2011-07-24 Eli Zaretskii <eliz@gnu.org>
16602
16603 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16604 for attrs[LFACE_FONTSET_INDEX].
16605
16606 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16607
16608 * xml.c (parse_region): Remove unused local
16609 that was recently introduced.
16610
16611 2011-07-23 Eli Zaretskii <eliz@gnu.org>
16612
16613 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16614 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16615
16616 * xdisp.c (move_it_in_display_line_to): Record the best matching
16617 position for TO_CHARPOS while scanning the line, and restore it on
16618 exit if none of the characters scanned was an exact match.
16619 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
16620 when exact match is impossible due to invisible text, and the
16621 lines are truncated.
16622
16623 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16624
16625 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16626 for OSX >= 10.7.
16627
16628 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16629
16630 Fix a significant slow-down of cursor motion with C-n, C-p,
16631 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16632 auto-repeat under bidi redisplay in fontified buffers.
16633 * xdisp.c (compute_stop_pos_backwards): New function.
16634 (next_element_from_buffer): Call compute_stop_pos_backwards to
16635 find a suitable prev_stop when we find ourselves before
16636 base_level_stop.
16637 (reseat): Don't look for prev_stop, as that could mean a very long
16638 run.
16639 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16640 <cached_disp_overlay_modiff>: Cache for last found display string
16641 position.
16642 (compute_display_string_pos): Return the cached position if asked
16643 about the same buffer in the same area of character positions, and
16644 the buffer wasn't changed since the time the display string
16645 position was cached.
16646
16647 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16648
16649 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16650 is an integer, which is important for empty lines. (Bug#9149)
16651
16652 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
16653
16654 * frame.c (Fmodify_frame_parameters): In tty case, update the
16655 default face if necessary (Bug#4238).
16656
16657 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
16658
16659 * editfns.c (Fstring_to_char): No need to explain what a character
16660 is in the docstring (Bug#6576).
16661
16662 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16663
16664 * xml.c (parse_region): Make sure we always return a tree.
16665
16666 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16667
16668 * xml.c (parse_region): If a document contains only comments,
16669 return that, too.
16670
16671 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16672
16673 * xml.c (make_dom): Return comments, too.
16674
16675 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16676
16677 Port to OpenBSD.
16678 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16679 and the surrounding thread.
16680 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16681 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16682 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16683 timer goes off.
16684 * s/openbsd.h (BROKEN_SIGIO): Define.
16685 * unexelf.c (unexec) [__OpenBSD__]:
16686 Don't update the .mdebug section of the Alpha COFF symbol table.
16687
16688 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16689
16690 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16691 (bug#8460).
16692
16693 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16694
16695 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16696 This fixes some race conditions on the permissions of any newly
16697 created file.
16698
16699 * alloc.c (valid_pointer_p): Use pipe, not open.
16700 This fixes some permissions issues when debugging.
16701
16702 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16703 If fchown fails to set both uid and gid, try to set just gid,
16704 as that is sometimes allowed. Adjust the file's mode to eliminate
16705 setuid or setgid bits that are inappropriate if fchown fails.
16706
16707 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16708
16709 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16710 to compare Lisp_Objects.
16711 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16712 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16713 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16714
16715 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16716
16717 * lread.c (read_integer): Unread even EOF character.
16718 (read1): Likewise. Properly record start position of symbol.
16719
16720 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16721 symbol character follows.
16722
16723 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16724
16725 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16726 This works around a problem with the previous change to Fcopy_file.
16727 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16728 and without this change, GCC might complain about discarding
16729 fchown's return value.
16730
16731 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
16732
16733 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16734
16735 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16736
16737 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16738
16739 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16740
16741 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16742 it's used from the C level.
16743
16744 * process.c: Use the same condition for POLL_FOR_INPUT in both
16745 keyboard.c and process.c (bug#1858).
16746
16747 2011-07-09 Lawrence Mitchell <wence@gmx.li>
16748
16749 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16750 (Fgnutls_boot): Use it.
16751
16752 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16753
16754 * doc.c (Fsubstitute_command_keys): Revert last change.
16755
16756 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16757
16758 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16759 quotes the next character, and doesn't affect other longer
16760 sequences (bug#8935).
16761
16762 * lread.c (syms_of_lread): Clarify that is isn't only
16763 `eval-buffer' and `eval-defun' that's affected by
16764 `lexical-binding' (bug#8460).
16765
16766 2011-07-15 Eli Zaretskii <eliz@gnu.org>
16767
16768 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
16769 bidi redisplay when a line includes both an image and is truncated.
16770
16771 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16772
16773 Fix minor problems found by static checking.
16774 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16775 (elsz): Now a signed constant, not a size_t var. We prefer signed
16776 types to unsigned, to avoid integer comparison confusion. Without
16777 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16778 "cannot optimize loop, the loop counter may overflow", a symptom
16779 of the confusion.
16780 * indent.c (Fvertical_motion): Mark locals as initialized.
16781 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16782
16783 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16784
16785 * search.c (Fre_search_backward): Mention `case-fold-search' in
16786 all the re_search_* functions (bug#8138).
16787
16788 * keyboard.c (Fopen_dribble_file): Document when the file is
16789 closed (bug#8056).
16790
16791 2011-07-14 Eli Zaretskii <eliz@gnu.org>
16792
16793 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16794 bidi_cache_idx.
16795
16796 Support bidi reordering of display and overlay strings.
16797 * xdisp.c (compute_display_string_pos)
16798 (compute_display_string_end): Accept additional argument STRING.
16799 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16800 (reseat_to_string): Initialize bidi_it->string.s and
16801 bidi_it->string.schars.
16802 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
16803 NULL (avoids a crash in bidi_paragraph_init).
16804 Initialize itb.string.lstring.
16805 (init_iterator): Call bidi_init_it only of a valid
16806 buffer position was specified. Initialize paragraph_embedding to
16807 L2R.
16808 (reseat_to_string): Initialize the bidi iterator.
16809 (display_string): If we need to ignore text properties of
16810 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16811 original value of -1 will not work with bidi.)
16812 (compute_display_string_pos): First arg is now struct
16813 `text_pos *'; all callers changed. Support display properties on
16814 Lisp strings.
16815 (compute_display_string_end): Support display properties on Lisp
16816 strings.
16817 (init_iterator, reseat_1, reseat_to_string): Initialize the
16818 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16819 when iterating on a string not from display properties).
16820 (compute_display_string_pos, compute_display_string_end):
16821 Fix calculation of the object to scan. Fixes an error when using
16822 arrow keys.
16823 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
16824 base_level_stop; instead, set base_level_stop to BEGV.
16825 Fixes crashes in vertical-motion.
16826 (next_element_from_buffer): Improve commentary for when
16827 the iterator is before prev_stop.
16828 (init_iterator): Initialize bidi_p from the default value of
16829 bidi-display-reordering, not from buffer-local value. Use the
16830 buffer-local value only if initializing for buffer iteration.
16831 (handle_invisible_prop): Support invisible properties on strings
16832 that are being bidi-reordered.
16833 (set_iterator_to_next): Support bidi reordering of C strings and
16834 Lisp strings.
16835 (next_element_from_string): Support bidi reordering of Lisp
16836 strings.
16837 (handle_stop_backwards): Support Lisp strings as well.
16838 (display_string): Support display of R2L glyph rows.
16839 Use IT_STRING_CHARPOS when displaying from a Lisp string.
16840 (init_iterator): Don't initialize it->bidi_p for strings
16841 here.
16842 (reseat_to_string): Initialize it->bidi_p for strings here.
16843 (next_element_from_string, next_element_from_c_string)
16844 (next_element_from_buffer): Add xassert's for correspondence
16845 between IT's object being iterated and it->bidi_it.string
16846 structure.
16847 (face_before_or_after_it_pos): Support bidi iteration.
16848 (next_element_from_c_string): Handle the case of the first string
16849 character that is not the first one in the visual order.
16850 (get_visually_first_element): New function, refactored from common
16851 parts of next_element_from_buffer, next_element_from_string, and
16852 next_element_from_c_string.
16853 (tool_bar_lines_needed, redisplay_tool_bar)
16854 (display_menu_bar): Force left-to-right direction. Add a FIXME
16855 comment for making that be controlled by a user option.
16856 (push_it, pop_it): Save and restore the state of the
16857 bidi iterator. Save and restore the bidi_p flag.
16858 (pop_it): Iterate out of display property for string iteration as
16859 well.
16860 (iterate_out_of_display_property): Support iteration over strings.
16861 (handle_single_display_spec): Set up it->bidi_it for iteration
16862 over a display string, and call bidi_init_it.
16863 (handle_single_display_spec, next_overlay_string)
16864 (get_overlay_strings_1, push_display_prop): Set up the bidi
16865 iterator for displaying display or overlay strings.
16866 (forward_to_next_line_start): Don't use the shortcut if
16867 bidi-iterating.
16868 (back_to_previous_visible_line_start): If handle_display_prop
16869 pushed the iterator stack, restore the internal state of the bidi
16870 iterator by calling bidi_pop_it same number of times.
16871 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16872 and we are bidi-iterating, don't decrement the iterator position;
16873 instead, set the first_elt flag in the bidi iterator, to produce
16874 the same effect.
16875 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16876 (push_display_prop): xassert that we are iterating a buffer.
16877 (push_it, pop_it): Save and restore paragraph_embedding member.
16878 (handle_single_display_spec, next_overlay_string)
16879 (get_overlay_strings_1, reseat_1, reseat_to_string)
16880 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16881 correctly. Don't assume unibyte strings are not bidi-reordered.
16882 (compute_display_string_pos)
16883 (compute_display_string_end): Fix handling the case of C string.
16884 (push_it, pop_it): Save and restore from_disp_prop_p.
16885 (handle_single_display_spec, push_display_prop): Set the
16886 from_disp_prop_p flag.
16887 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16888 (pop_it): Call iterate_out_of_display_property only if we are
16889 popping after iteration over a string that came from a display
16890 property. Fix a typo in popping stretch info. Add an assertion
16891 for verifying that the iterator position is in sync with the bidi
16892 iterator.
16893 (handle_single_display_spec, get_overlay_strings_1)
16894 (push_display_prop): Fix initialization of paragraph direction for
16895 string when that of the parent object is not yet determined.
16896 (reseat_1): Call bidi_init_it to resync the bidi
16897 iterator with IT's position. (Bug#7616)
16898 (find_row_edges): If ROW->start.pos gives position
16899 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16900 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16901 Reset the from_disp_prop_p flag.
16902 (SAVE_IT, RESTORE_IT): New macros.
16903 (pos_visible_p, face_before_or_after_it_pos)
16904 (back_to_previous_visible_line_start)
16905 (move_it_in_display_line_to, move_it_in_display_line)
16906 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16907 (try_scrolling, redisplay_window, display_line): Use them when
16908 saving a temporary copy of the iterator and restoring it back.
16909 (back_to_previous_visible_line_start, reseat_1)
16910 (init_iterator): Empty the bidi cache "stack".
16911 (move_it_in_display_line_to): If iterator ended up at
16912 EOL, but we never saw any buffer positions smaller than
16913 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16914 motion in bidi-reordered lines.
16915 (move_it_in_display_line_to): Record prev_method and prev_pos
16916 immediately before the call to set_iterator_to_next. Fixes cursor
16917 motion in bidi-reordered lines with stretch glyphs and strings
16918 displayed in margins. (Bug#8133) (Bug#8867)
16919 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16920 TO_CHARPOS.
16921 (pos_visible_p): Support positions in bidi-reordered lines.
16922 Save and restore bidi cache.
16923
16924 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16925 (bidi_paragraph_info): Delete unused struct.
16926 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16927 (bidi_cache_start): New variable.
16928 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16929 to zero.
16930 (bidi_cache_fetch_state, bidi_cache_search)
16931 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16932 (bidi_cache_find, bidi_peek_at_next_level)
16933 (bidi_level_of_next_char, bidi_find_other_level_edge)
16934 (bidi_move_to_visually_next): Compare cache index with
16935 bidi_cache_start rather than with zero.
16936 (bidi_fetch_char): Accept new argument STRING; all callers
16937 changed. Support iteration over a string. Support strings with
16938 display properties. Support unibyte strings. Fix the type of
16939 `len' according to what STRING_CHAR_AND_LENGTH expects.
16940 (bidi_paragraph_init, bidi_resolve_explicit_1)
16941 (bidi_resolve_explicit, bidi_resolve_weak)
16942 (bidi_level_of_next_char, bidi_move_to_visually_next):
16943 Support iteration over a string.
16944 (bidi_set_sor_type, bidi_resolve_explicit_1)
16945 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16946 can now be zero (for strings); special values 0 and -1 were
16947 changed to -1 and -2, respectively.
16948 (bidi_char_at_pos): New function.
16949 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16950 Call it instead of FETCH_MULTIBYTE_CHAR.
16951 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16952 initialized to valid values.
16953 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16954 values.
16955 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16956 the test for valid cached positions. Fix the logic for looking up
16957 the sentinel state in the cache. GCPRO the Lisp string we are
16958 iterating.
16959 (bidi_push_it, bidi_pop_it): New functions.
16960 (bidi_initialize): Initialize the bidi cache start stack pointer.
16961 (bidi_cache_ensure_space): New function, refactored from part of
16962 bidi_cache_iterator_state. Don't assume the required size is just
16963 one BIDI_CACHE_CHUNK away.
16964 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16965 (bidi_count_bytes, bidi_char_at_pos): New functions.
16966 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16967 always valid if bidi_cache_idx is valid.
16968 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16969 is valid if it's going to be used.
16970 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16971 (bidi_cache_fetch_state, bidi_cache_search)
16972 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16973 (bidi_cache_iterator_state, bidi_cache_find)
16974 (bidi_find_other_level_edge, bidi_cache_start_stack):
16975 All variables related to cache indices are now EMACS_INT.
16976
16977 * dispextern.h (struct bidi_string_data): New structure.
16978 (struct bidi_it): New member `string'. Make flag members be 1-bit
16979 fields, and put them last in the struct.
16980 (compute_display_string_pos, compute_display_string_end):
16981 Update prototypes.
16982 (bidi_push_it, bidi_pop_it): Add prototypes.
16983 (struct iterator_stack_entry): New members bidi_p,
16984 paragraph_embedding, and from_disp_prop_p.
16985 (struct it): Member bidi_p is now a bit field 1 bit wide.
16986 (bidi_shelve_cache, bidi_unshelve_cache):
16987 Declare prototypes.
16988
16989 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
16990 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
16991 and vector-like objects.
16992
16993 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
16994 cache around display iteration.
16995
16996 * window.c (Fwindow_end, window_scroll_pixel_based)
16997 (displayed_window_lines, Frecenter): Save and restore the bidi
16998 cache around display iteration.
16999
17000 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17001
17002 * editfns.c (Fdelete_region): Clarify the use of the named
17003 parameters (bug#6788).
17004
17005 2011-07-14 Martin Rudalics <rudalics@gmx.at>
17006
17007 * indent.c (Fvertical_motion): Set and restore w->pointm when
17008 saving and restoring the window's buffer (Bug#9006).
17009
17010 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17011
17012 * editfns.c (Fstring_to_char): Clarify just what is returned
17013 (bug#6576). Text by Eli Zaretskii.
17014
17015 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
17016
17017 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17018
17019 2011-07-13 Eli Zaretskii <eliz@gnu.org>
17020
17021 * buffer.c (mmap_find): Fix a typo.
17022
17023 2011-07-13 Johan Bockgård <bojohan@gnu.org>
17024
17025 Fix execution of x selection hooks.
17026 * xselect.c (Qx_lost_selection_functions)
17027 (Qx_sent_selection_functions): New vars.
17028 (syms_of_xselect): DEFSYM them.
17029 (x_handle_selection_request): Pass Qx_sent_selection_functions
17030 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17031 (x_handle_selection_clear,x_clear_frame_selections):
17032 Pass Qx_lost_selection_functions rather than
17033 Vx_lost_selection_functions to Frun_hook_with_args.
17034
17035 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17036
17037 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17038 The old code sometimes used this field without initializing it.
17039
17040 * alloc.c (gc_sweep): Don't read past end of array.
17041 In theory, the old code could also have corrupted Emacs internals,
17042 though it'd be very unlikely.
17043
17044 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17045
17046 * character.c (Fcharacterp): Don't advertise optional ignored
17047 argument. (Bug#4026)
17048
17049 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17050
17051 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17052 key" (bug#4257).
17053
17054 * window.c (Fset_window_start): Doc fix (bug#4199).
17055 (Fset_window_hscroll): Ditto.
17056
17057 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17058
17059 Fix minor new problems caught by GCC 4.6.1.
17060 * term.c (init_tty): Remove unused local.
17061 * xsettings.c (store_monospaced_changed): Define this function only
17062 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17063 not used otherwise.
17064
17065 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
17066
17067 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17068
17069 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17070
17071 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17072 are the mini-buffer and the echo area (bug#3320).
17073
17074 * term.c (init_tty): Remove support for supdup, c10 and perq
17075 terminals, which are no longer supported (bug#1482).
17076
17077 2011-07-10 Johan Bockgård <bojohan@gnu.org>
17078
17079 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17080
17081 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17082
17083 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17084 for non-popups (Bug#3642).
17085
17086 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17087
17088 * alloc.c (reset_malloc_hooks): Protoize.
17089 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17090 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17091 * cm.c (losecursor): Likewise.
17092 * data.c (fmod): Likewise.
17093 * dispnew.c (swap_glyphs_in_rows): Likewise.
17094 * emacs.c (memory_warning_signal): Likewise.
17095 * floatfns.c (float_error): Likewise.
17096 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17097 (otf_open, font_otf_capability, generate_otf_features)
17098 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17099 Likewise.
17100 * image.c (pbm_read_file): Likewise.
17101 * indent.c (string_display_width): Likewise.
17102 * intervals.c (check_for_interval, search_for_interval)
17103 (inc_interval_count, count_intervals, root_interval)
17104 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17105 * lread.c (defalias): Likewise.
17106 * ralloc.c (r_alloc_check): Likewise.
17107 * regex.c (set_image_of_range_1, set_image_of_range)
17108 (regex_grow_registers): Likewise.
17109 * sysdep.c (strerror): Likewise.
17110 * termcap.c (valid_filename_p, tprint, main): Likewise.
17111 * tparam.c (main): Likewise.
17112 * unexhp9k800.c (run_time_remap, save_data_space)
17113 (update_file_ptrs, read_header, write_header, calculate_checksum)
17114 (copy_file, copy_rest, display_header): Likewise.
17115 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17116 Likewise.
17117 * xdisp.c (check_it): Likewise.
17118 * xfaces.c (register_color, unregister_color, unregister_colors):
17119 Likewise.
17120 * xfns.c (print_fontset_result): Likewise.
17121 * xrdb.c (member, fatal, main): Likewise.
17122
17123 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17124
17125 Fix minor problems found by static checking (Bug#9031).
17126 * chartab.c (char_table_set_range, map_sub_char_table):
17127 Remove unused locals.
17128 (uniprop_table): Now static.
17129 * composite.c (_work_char): Remove unused static var.
17130
17131 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
17132
17133 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17134
17135 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17136
17137 * gtkutil.c (qttip_cb): Remove code without function.
17138
17139 2011-07-09 Eli Zaretskii <eliz@gnu.org>
17140
17141 * w32.c (pthread_sigmask): New stub.
17142
17143 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
17144
17145 Use pthread_sigmask, not sigprocmask (Bug#9010).
17146 sigprocmask is portable only for single-threaded applications, and
17147 Emacs can be multi-threaded when it uses GTK.
17148 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17149 (LIBES): Use it.
17150 * callproc.c (Fcall_process):
17151 * process.c (create_process):
17152 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17153 Use pthread_sigmask, not sigprocmask.
17154
17155 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17156
17157 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17158 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17159 wrong (Bug#8591).
17160
17161 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17162
17163 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17164 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17165 (xg_hide_tooltip): Fix comment.
17166
17167 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17168 in registerServicesMenuSendTypes.
17169 (validRequestorForSendType): Don't check ns_return_types.
17170
17171 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17172 ns_return_type.
17173
17174 2011-07-08 Jason Rumney <jasonr@gnu.org>
17175
17176 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17177 SH_SHOW for hidden windows (Bug#5482).
17178
17179 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17180 frame struct members of non-existent frames (Bug#6284).
17181
17182 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17183
17184 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17185 variable firstTime not needed on OSX >= 10.6.
17186 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17187 >= 10.5. Use setKnobProportion, setDoubleValue.
17188
17189 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17190 (MAC_OS_X_VERSION_10_5): Define if not defined.
17191 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17192 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17193 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17194
17195 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17196 cString and lossyCString on OSX >= 10.4.
17197
17198 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17199 sizeToFit on OSX >= 10.2.
17200
17201 * nsimage.m (allocInitFromFile): Don't use deprecated method
17202 bestRepresentationForDevice on OSX >= 10.6.
17203
17204 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17205 to avoid warning.
17206
17207 * emacs.c: Declare unexec_init_emacs_zone.
17208
17209 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17210
17211 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17212
17213 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17214 on svcsMenu (Bug#8842).
17215
17216 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17217 ns_return_types.
17218 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17219
17220 * nsterm.m (QUTF8_STRING): Declare.
17221 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17222 (validRequestorForSendType): Return type is (id).
17223 Change indexOfObjectIdenticalTo to indexOfObject.
17224 Check if we have local selection before returning self (Bug#8842).
17225 (writeSelectionToPasteboard): Put local selection into paste board
17226 if we have a local selection (Bug#8842).
17227 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17228
17229 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17230 (ns_get_local_selection): Declare.
17231
17232 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17233
17234 * keymap.c (describe_map_tree): Don't insert a double newline at
17235 the end of the buffer (bug#1169) and return whether we inserted
17236 something.
17237
17238 * callint.c (Fcall_interactively): Change "reading args" to
17239 "providing args" to try to clarify what it does (bug#1010).
17240
17241 2011-07-07 Kenichi Handa <handa@m17n.org>
17242
17243 * composite.c (composition_compute_stop_pos): Ignore a static
17244 composition starting before CHARPOS (Bug#8915).
17245
17246 * xdisp.c (handle_composition_prop): Likewise.
17247
17248 2011-07-07 Eli Zaretskii <eliz@gnu.org>
17249
17250 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17251 (Bug#9015)
17252
17253 2011-07-07 Kenichi Handa <handa@m17n.org>
17254
17255 * character.h (unicode_category_t): New enum type.
17256
17257 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17258 (Qchar_code_property_table): New variable.
17259 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17260 (UNIPROP_COMPRESSED_FORM_P): New macros.
17261 (char_table_ascii): Uncompress the compressed values.
17262 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17263 Uncompress the compressed values.
17264 (sub_char_table_ref_and_range): Likewise.
17265 (char_table_ref_and_range): Uncompress the compressed values.
17266 (sub_char_table_set): New arg is_uniprop. Callers changed.
17267 Uncompress the compressed values.
17268 (sub_char_table_set_range): Args changed. Callers changed.
17269 (char_table_set_range): Adjuted for the above change.
17270 (map_sub_char_table): Delete args default_val and parent. Add arg
17271 top. Give decoded values to a Lisp function.
17272 (map_char_table): Adjust for the above change. Give decoded
17273 values to a Lisp function. Gcpro more variables.
17274 (uniprop_table_uncompress)
17275 (uniprop_decode_value_run_length): New functions.
17276 (uniprop_decoder, uniprop_decoder_count): New variables.
17277 (uniprop_get_decoder, uniprop_encode_value_character)
17278 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17279 New functions.
17280 (uniprop_encoder, uniprop_encoder_count): New variables.
17281 (uniprop_get_encoder, uniprop_table)
17282 (Funicode_property_table_internal, Fget_unicode_property_internal)
17283 (Fput_unicode_property_internal): New functions.
17284 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17285 Sunicode_property_table_internal, Sget_unicode_property_internal,
17286 and Sput_unicode_property_internal. Defvar_lisp
17287 char-code-property-alist.
17288
17289 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
17290 Vunicode_category_table.
17291
17292 * font.c (font_range): Adjust for the change of
17293 Vunicode_category_table.
17294
17295 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17296
17297 * m/iris4d.h: Remove file, move contents ...
17298 * s/irix6-5.h: ... here.
17299
17300 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17301
17302 Remove unportable assumption about struct layout (Bug#8884).
17303 * alloc.c (mark_buffer):
17304 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17305 (clone_per_buffer_values): Don't assume that
17306 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17307 This isn't true in general, and it's particularly not true
17308 if Emacs is configured with --with-wide-int.
17309 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17310 New macros, used in the buffer.c change.
17311
17312 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17313
17314 * xsettings.c: Use both GConf and GSettings if both are available.
17315 (store_config_changed_event): Add comment.
17316 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17317 (store_tool_bar_style_changed): New functions.
17318 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
17319 (struct xsettings): Move font inside HAVE_XFT.
17320 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
17321 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
17322 Move inside HAVE_XFT.
17323 (something_changed_gsettingsCB): Rename from something_changedCB.
17324 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17325 also.
17326 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
17327 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
17328 (something_changed_gconfCB): Rename from something_changedCB.
17329 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17330 (parse_settings): Move check for font inside HAVE_XFT.
17331 (read_settings, apply_xft_settings): Add comment.
17332 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17333 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17334 call store_font_name_changed.
17335 (xft_settings_event): Add comment.
17336 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17337 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17338 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17339 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17340 (xsettings_initialize): Call init_gsettings last.
17341 (xsettings_get_system_font, xsettings_get_system_normal_font):
17342 Add comment.
17343
17344 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17345
17346 Random fixes. E.g., (random) never returned negative values.
17347 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17348 subseconds part to the entropy, as that's a bit more random.
17349 Prefer signed to unsigned, since the signedness doesn't matter and
17350 in general we prefer signed. When given a limit, use a
17351 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17352 latter isn't right if USE_2_TAGS_FOR_INTS.
17353 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17354 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17355
17356 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17357
17358 * textprop.c (text_property_stickiness):
17359 Obey Vtext_property_default_nonsticky.
17360 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17361 * w32fns.c (syms_of_w32fns):
17362 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17363
17364 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17365
17366 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17367 This is more efficient than Ffile_directory_p and avoids a minor race.
17368
17369 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17370
17371 * buffer.c (Foverlay_put): Say what the return value is
17372 (bug#7835).
17373
17374 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17375 is a directory before asking whether to use the file name
17376 (bug#7564).
17377 (barf_or_query_if_file_exists): Make the "File is a directory"
17378 error be more correct.
17379
17380 * fns.c (Frequire): Remove the mention of the .gz files, since
17381 that's installation-specific, but keep the mention of
17382 `get-load-suffixes'.
17383
17384 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17385
17386 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17387 Report string overflow if the output is too long.
17388
17389 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
17390
17391 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17392 (syms_of_gnutls): Remove duplicate DEFSYM for
17393 Qgnutls_bootprop_verify_hostname_error, an error for
17394 Qgnutls_bootprop_verify_error (which is no longer used).
17395
17396 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17397 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17398 Also (re)move comments that are misplaced or no longer relevant.
17399
17400 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17401
17402 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17403
17404 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
17405
17406 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17407 and background color parameters if they have been changed.
17408
17409 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17410
17411 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17412
17413 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17414
17415 * xsettings.c (SYSTEM_FONT): Define only when used.
17416 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17417
17418 * keymap.c (access_keymap_1): Now static.
17419
17420 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
17421
17422 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17423 leave any prefix arg for the up event (Bug#1586).
17424
17425 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17426
17427 * lread.c (syms_of_lread): Mention single symbols defined by
17428 `defvar' or `defconst' (bug#7154).
17429
17430 * fns.c (Frequire): Mention .el.gz files (bug#7314).
17431 (Frequire): Mention get-load-suffixes.
17432
17433 2011-07-02 Martin Rudalics <rudalics@gmx.at>
17434
17435 * window.h (window): Remove clone_number slot.
17436 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17437 Remove.
17438 (make_parent_window, make_window, saved_window)
17439 (Fset_window_configuration, save_window_save): Don't deal with
17440 clone numbers.
17441 * buffer.c (Qclone_number): Remove declaration.
17442 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17443
17444 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17445
17446 Add multiple inheritance to keymaps.
17447 * keymap.c (Fmake_composed_keymap): New function.
17448 (Fset_keymap_parent): Simplify.
17449 (fix_submap_inheritance): Remove.
17450 (access_keymap_1): New function extracted from access_keymap to handle
17451 embedded parents and handle lists of maps.
17452 (access_keymap): Use it.
17453 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17454 (Fcopy_keymap): Handle embedded parents.
17455 (Fcommand_remapping, define_as_prefix): Simplify.
17456 (Fkey_binding): Simplify.
17457 (syms_of_keymap): Move minibuffer-local-completion-map,
17458 minibuffer-local-filename-completion-map,
17459 minibuffer-local-must-match-map, and
17460 minibuffer-local-filename-must-match-map to Elisp.
17461 (syms_of_keymap): Defsubr make-composed-keymap.
17462 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17463 (parse_menu_item): Trivial simplification.
17464
17465 2011-07-01 Glenn Morris <rgm@gnu.org>
17466
17467 * Makefile.in (SETTINGS_LIBS): Fix typo.
17468
17469 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
17470
17471 * coding.c (Fencode_coding_string): Record the last coding system
17472 used, as the function doc string says (bug#8738).
17473
17474 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17475
17476 * xsettings.c (store_monospaced_changed): Take new font as arg and
17477 check for change against current_mono_font.
17478 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17479 (emacs_settings_constructor, emacs_settings_get_property)
17480 (emacs_settings_set_property, emacs_settings_class_init)
17481 (emacs_settings_init, gsettings_obj): Remove.
17482 (something_changedCB): New function for HAVE_GSETTINGS.
17483 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17484 with value as argument.
17485 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17486 g_settings_new (Bug#8967). Do not create gsettings_obj.
17487 Remove calls to g_settings_bind. Connect something_changedCB to
17488 "changed".
17489
17490 * xgselect.c: Add defined (HAVE_GSETTINGS).
17491 (xgselect_initialize): Ditto.
17492
17493 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17494 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17495 xg_select.
17496
17497 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17498
17499 * eval.c (struct backtrace): Simplify and port the data structure.
17500 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17501 signed bit field, as this assumption is not portable and it makes
17502 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17503 "char debug_on_exit : 1" as this is not portable either; instead,
17504 use the portable "unsigned int debug_on_exit : 1". Remove unused
17505 member evalargs. Remove obsolete comments about cc bombing out.
17506
17507 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17508
17509 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17510 Let HAVE_GSETTINGS override HAVE_GCONF.
17511 (store_monospaced_changed): New function.
17512 (EMACS_SETTINGS): A new type derived from GObject to handle
17513 GSettings notifications.
17514 (emacs_settings_constructor, emacs_settings_get_property)
17515 (emacs_settings_set_property, emacs_settings_class_init):
17516 New functions.
17517 (gsettings_client, gsettings_obj): New variables.
17518 (GSETTINGS_SCHEMA): New define.
17519 (something_changedCB): Call store_monospaced_changed.
17520 (init_gsettings): New function.
17521 (xsettings_initialize): Call init_gsettings.
17522 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17523 to NULL.
17524
17525 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17526 GCONF_CFLAGS/LIBS.
17527
17528 2011-06-29 Martin Rudalics <rudalics@gmx.at>
17529
17530 * window.c (resize_root_window, grow_mini_window)
17531 (shrink_mini_window): Rename Qresize_root_window to
17532 Qwindow_resize_root_window and Qresize_root_window_vertically to
17533 Qwindow_resize_root_window_vertically.
17534
17535 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17536
17537 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17538
17539 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
17540
17541 * makefile.w32-in: Redesign dependencies so they reflect more
17542 clearly which files are directly included by each source file,
17543 and not through other includes.
17544
17545 2011-06-27 Martin Rudalics <rudalics@gmx.at>
17546
17547 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17548 (sort_overlays, overlay_strings): When an overlay's clone number
17549 matches the window's clone number process the overlay even if
17550 the overlay's window property doesn't match the current window.
17551
17552 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17553 (Fwindow_hchild): Rename to Fwindow_left_child.
17554 (Fwindow_next): Rename to Fwindow_next_sibling.
17555 (Fwindow_prev): Rename to Fwindow_prev_sibling.
17556 (resize_window_check): Rename to window_resize_check.
17557 (resize_window_apply): Rename to window_resize_apply.
17558 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17559 (Fdelete_other_windows_internal, resize_frame_windows)
17560 (Fsplit_window_internal, Fdelete_window_internal)
17561 (grow_mini_window, shrink_mini_window)
17562 (Fresize_mini_window_internal): Fix callers accordingly.
17563
17564 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17565
17566 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17567 (emacs_fixed_set_min_size): Remove.
17568 (emacs_fixed_new): Take frame as argument.
17569
17570 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17571 (_EmacsFixedPrivate): Remove minwidth/height.
17572 Add struct frame *f.
17573 (emacs_fixed_init): Initialize priv->f.
17574 (get_parent_class, emacs_fixed_set_min_size): Remove.
17575 (emacs_fixed_new): Set priv->f to argument.
17576 (emacs_fixed_get_preferred_width)
17577 (emacs_fixed_get_preferred_height): Use min_width/height from
17578 frames size_hint to set minimum and natural (Bug#8919).
17579 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17580 and use min_width/height from frames size_hint to set
17581 min_width/height (Bug#8919).
17582
17583 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
17584 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17585 Fix indentation.
17586
17587 2011-06-26 Eli Zaretskii <eliz@gnu.org>
17588
17589 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17590 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17591 called at ZV.
17592
17593 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
17594
17595 * process.c (wait_reading_process_output): Bypass select if
17596 waiting for a cell while ignoring keyboard input, and input is
17597 pending. Suggested by Jan Djärv (Bug#8869).
17598
17599 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17600
17601 Use gnulib's dup2 module instead of rolling our own.
17602 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17603
17604 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17605
17606 * dispnew.c (scrolling_window): Before scrolling, turn off a
17607 mouse-highlight in the window being scrolled.
17608
17609 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
17610
17611 Move DEFSYM to lisp.h and use everywhere.
17612
17613 * character.h (DEFSYM): Move declaration...
17614 * lisp.h (DEFSYM): ...here.
17615
17616 * gnutls.c:
17617 * minibuf.c:
17618 * w32menu.c:
17619 * w32proc.c:
17620 * w32select.c: Don't include character.h.
17621
17622 * alloc.c (syms_of_alloc):
17623 * buffer.c (syms_of_buffer):
17624 * bytecode.c (syms_of_bytecode):
17625 * callint.c (syms_of_callint):
17626 * casefiddle.c (syms_of_casefiddle):
17627 * casetab.c (init_casetab_once):
17628 * category.c (init_category_once, syms_of_category):
17629 * ccl.c (syms_of_ccl):
17630 * cmds.c (syms_of_cmds):
17631 * composite.c (syms_of_composite):
17632 * dbusbind.c (syms_of_dbusbind):
17633 * dired.c (syms_of_dired):
17634 * dispnew.c (syms_of_display):
17635 * doc.c (syms_of_doc):
17636 * editfns.c (syms_of_editfns):
17637 * emacs.c (syms_of_emacs):
17638 * eval.c (syms_of_eval):
17639 * fileio.c (syms_of_fileio):
17640 * fns.c (syms_of_fns):
17641 * frame.c (syms_of_frame):
17642 * fringe.c (syms_of_fringe):
17643 * insdel.c (syms_of_insdel):
17644 * keymap.c (syms_of_keymap):
17645 * lread.c (init_obarray, syms_of_lread):
17646 * macros.c (syms_of_macros):
17647 * msdos.c (syms_of_msdos):
17648 * print.c (syms_of_print):
17649 * process.c (syms_of_process):
17650 * search.c (syms_of_search):
17651 * sound.c (syms_of_sound):
17652 * syntax.c (init_syntax_once, syms_of_syntax):
17653 * terminal.c (syms_of_terminal):
17654 * textprop.c (syms_of_textprop):
17655 * undo.c (syms_of_undo):
17656 * w32.c (globals_of_w32):
17657 * window.c (syms_of_window):
17658 * xdisp.c (syms_of_xdisp):
17659 * xfaces.c (syms_of_xfaces):
17660 * xfns.c (syms_of_xfns):
17661 * xmenu.c (syms_of_xmenu):
17662 * xsettings.c (syms_of_xsettings):
17663 * xterm.c (syms_of_xterm): Use DEFSYM.
17664
17665 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17666
17667 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
17668
17669 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17670
17671 Integer and buffer overflow fixes (Bug#8873).
17672
17673 * print.c (printchar, strout): Check for string overflow.
17674 (PRINTPREPARE, printchar, strout):
17675 Don't set size unless allocation succeeds.
17676
17677 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17678 for sizes. Check for string overflow more accurately.
17679 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17680
17681 * macros.c: Integer and buffer overflow fixes.
17682 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17683 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17684 Use ptrdiff_t, not int, for sizes.
17685 Don't increment bufsize until after realloc succeeds.
17686 Check for size-calculation overflow.
17687 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17688
17689 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17690
17691 * lread.c: Integer overflow fixes.
17692 (read_integer): Radix is now EMACS_INT, not int,
17693 to improve quality of diagnostics for out-of-range radices.
17694 Calculate buffer size correctly for out-of-range radices.
17695 (read1): Check for integer overflow in radices, and in
17696 read-circle numbers.
17697 (read_escape): Avoid int overflow.
17698 (Fload, openp, read_buffer_size, read1)
17699 (substitute_object_recurse, read_vector, read_list, map_obarray):
17700 Use ptrdiff_t, not int, for sizes.
17701 (read1): Use EMACS_INT, not int, for sizes.
17702 Check for size overflow.
17703
17704 * image.c (cache_image): Check for size arithmetic overflow.
17705
17706 * lread.c: Integer overflow issues.
17707 (saved_doc_string_size, saved_doc_string_length)
17708 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17709 Now ptrdiff_t, not int.
17710 (read1): Don't assume doc string length fits in int. Check for
17711 out-of-range doc string lengths.
17712 (read_list): Don't assume file position fits in int.
17713 (read_escape): Check for hex character overflow.
17714
17715 2011-06-22 Leo Liu <sdl.web@gmail.com>
17716
17717 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17718 Move to minibuffer.el.
17719
17720 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17721
17722 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
17723 The following patches are for when GLYPH_DEBUG && !XASSERT.
17724 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17725 * dispnew.c (flush_stdout):
17726 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17727 Mark as externally visible.
17728 * dispnew.c (check_window_matrix_pointers): Now static.
17729 * dispnew.c (window_to_frame_vpos):
17730 * xfns.c (unwind_create_frame):
17731 * xterm.c (x_check_font): Remove unused local.
17732 * scroll.c (CHECK_BOUNDS):
17733 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17734 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17735 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17736 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17737 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17738 Now static.
17739 (debug_method_add): Use va_list and vsprintf rather than relying
17740 on undefined behavior with wrong number of arguments.
17741 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17742 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17743 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17744 since we're not interested in debugging glyphs with old libraries.
17745 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17746 GCC 4.6.0's static checking.
17747
17748 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17749
17750 Integer overflow and signedness fixes (Bug#8873).
17751 A few related buffer overrun fixes, too.
17752
17753 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17754
17755 * dispextern.h (struct face.stipple):
17756 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17757 (x_bitmap_mask, x_allocate_bitmap_record)
17758 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17759 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17760 (x_create_bitmap_from_xpm_data):
17761 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17762 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17763 (.bitmaps_last):
17764 * xfaces.c (load_pixmap):
17765 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17766 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17767 (.bitmaps_last, struct x_output.icon_bitmap):
17768 Use ptrdiff_t, not int, for bitmap indexes.
17769 (x_allocate_bitmap_record): Check for size overflow.
17770 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17771
17772 Use ptrdiff_t, not int, for overlay counts.
17773 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17774 * editfns.c (overlays_around, get_pos_property):
17775 * textprop.c (get_char_property_and_overlay):
17776 * xdisp.c (next_overlay_change, note_mouse_highlight):
17777 * xfaces.c (face_at_buffer_position):
17778 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17779 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17780 (Fnext_overlay_change, Fprevious_overlay_change)
17781 (mouse_face_overlay_overlaps, Foverlays_in):
17782 Use ptrdiff_t, not int, for sizes.
17783 (overlays_at, overlays_in): Check for size-calculation overflow.
17784
17785 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17786
17787 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17788 (x_session_initialize): Do not assume string length fits in int.
17789
17790 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17791 This is unlikely, but can occur if DPI is outlandish.
17792
17793 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
17794 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17795
17796 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17797 * xrdb.c (magic_file_p, search_magic_path):
17798 Omit last arg SUFFIX; it was always 0. All callers changed.
17799 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17800
17801 * xfont.c (xfont_match): Avoid need for strlen.
17802
17803 * xfns.c: Don't assume strlen fits in int.
17804 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17805
17806 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17807 not unsigned long, as we prefer signed integers. All callers changed.
17808 Detect integer overflow in repeat count.
17809 (message_dolog): Don't assume print length fits in 39 bytes.
17810 (display_mode_element): Don't assume strlen fits in int.
17811
17812 * termcap.c: Don't assume sizes fit in int and never overflow.
17813 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17814 (gobble_line): Check for size-calculation overflow.
17815
17816 * minibuf.c (Fread_buffer):
17817 * lread.c (intern, intern_c_string):
17818 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17819 Don't assume string length fits in int.
17820
17821 * keyboard.c (parse_tool_bar_item):
17822 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17823
17824 * font.c: Don't assume string length fits in int.
17825 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17826 Use ptrdiff_t, not int.
17827 (font_intern_prop): Don't assume string length fits in int.
17828 Don't assume integer property fits in fixnum.
17829 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
17830
17831 * filelock.c: Fix some buffer overrun and integer overflow issues.
17832 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
17833 Reformulate so as not to need the command string.
17834 Invoke gzip -cd rather than gunzip, as it's more portable.
17835 (lock_info_type, lock_file_1, lock_file):
17836 Don't assume pid_t and time_t fit in unsigned long.
17837 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17838 (current_lock_owner): Prefer signed type for sizes.
17839 Use memcpy, not strncpy, where memcpy is what is really wanted.
17840 Don't assume (via atoi) that time_t and pid_t fit in int.
17841 Check for time_t and/or pid_t out of range, e.g., via a network share.
17842 Don't alloca where an auto var works fine.
17843
17844 * fileio.c: Fix some integer overflow issues.
17845 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17846 Don't assume string length fits in int.
17847 (directory_file_name): Don't assume string length fits in long.
17848 (make_temp_name): Don't assume pid fits in int, or that its print
17849 length is less than 20.
17850
17851 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17852
17853 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17854
17855 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17856
17857 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17858 We prefer signed integers, even for size calculations.
17859
17860 * emacs.c: Don't assume string length fits in 'int'.
17861 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17862 (main): Don't invoke strlen when not needed.
17863
17864 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17865 (XD_DEBUG_MESSAGE): Don't waste a byte.
17866
17867 * callproc.c (getenv_internal_1, getenv_internal)
17868 (Fgetenv_internal):
17869 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17870
17871 * lread.c (invalid_syntax): Omit length argument.
17872 All uses changed. This doesn't fix a bug, but it simplifies the
17873 code away from its former Hollerith-constant appearance, and it's
17874 one less 'int' to worry about when looking at integer-overflow issues.
17875 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
17876
17877 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17878 This didn't break anything, but it didn't help either.
17879 It's confusing to put a bogus integer in a place where the actual
17880 value does not matter.
17881 (LIST_END_P): Remove unused macro and its bogus comment.
17882 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
17883
17884 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17885 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17886 implementation.
17887 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17888 We prefer signed types, and the value cannot exceed the EMACS_INT
17889 range anyway (because otherwise the length would not be representable).
17890 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17891 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17892 This avoids a GCC warning when WIDE_EMACS_INT.
17893
17894 * indent.c (sane_tab_width): New function.
17895 (current_column, scan_for_column, Findent_to, position_indentation)
17896 (compute_motion): Use it. This is just for clarity.
17897 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
17898
17899 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
17900
17901 * lisp.h (lint_assume): New macro.
17902 * composite.c (composition_gstring_put_cache):
17903 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17904
17905 * editfns.c, insdel.c:
17906 Omit unnecessary forward decls, to simplify future changes.
17907
17908 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17909
17910 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17911
17912 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
17913 Use much-faster test for byte-length change.
17914 Don't assume string byte-length fits in 'int'.
17915 Check that character arg fits in 'int'.
17916 (mapcar1): Declare byte as byte, for clarity.
17917
17918 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17919
17920 * fns.c (concat): Catch string overflow earlier.
17921 Do not rely on integer wraparound.
17922
17923 * dispextern.h (struct it.overlay_strings_charpos)
17924 (struct it.selective): Now EMACS_INT, not int.
17925 * xdisp.c (forward_to_next_line_start)
17926 (back_to_previous_visible_line_start)
17927 (reseat_at_next_visible_line_start, next_element_from_buffer):
17928 Don't arbitrarily truncate the value of 'selective' to int.
17929
17930 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17931
17932 * composite.c: Don't truncate sizes to 'int'.
17933 (composition_gstring_p, composition_reseat_it)
17934 (composition_adjust_point): Use EMACS_INT, not int.
17935 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17936 not EMACS_UINT, for indexes.
17937
17938 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17939
17940 * buffer.c: Include <verify.h>.
17941 (struct sortvec.priority, struct sortstr.priority):
17942 Now EMACS_INT, not int.
17943 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
17944 (struct sortstr.size, record_overlay_string)
17945 (struct sortstrlist.size, struct sortlist.used):
17946 Don't truncate size to int.
17947 (record_overlay_string): Check for size-calculation overflow.
17948 (init_buffer_once): Check at compile-time, not run-time.
17949
17950 2011-06-22 Jim Meyering <meyering@redhat.com>
17951
17952 Don't leak an XBM-image-sized buffer
17953 * image.c (xbm_load): Free the image buffer after using it.
17954
17955 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17956
17957 Port to Sun C.
17958 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17959 that Sun C diagnosed.
17960 * fns.c (secure_hash): Fix pointer signedness issue.
17961 * intervals.c (static_offset_intervals): New function.
17962 (offset_intervals): Use it.
17963
17964 2011-06-21 Leo Liu <sdl.web@gmail.com>
17965
17966 * deps.mk (fns.o):
17967 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17968 sha512.h.
17969
17970 * fns.c (secure_hash): Rename from crypto_hash_function and change
17971 the first arg to accept symbols.
17972 (Fsecure_hash): New primitive.
17973 (syms_of_fns): New symbols.
17974
17975 2011-06-20 Deniz Dogan <deniz@dogan.se>
17976
17977 * process.c (Fset_process_buffer): Clarify return value in
17978 docstring.
17979
17980 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
17981
17982 * dispnew.c (add_window_display_history): Use BVAR.
17983
17984 * xdisp.c (debug_method_add): Use BVAR.
17985 (check_window_end, dump_glyph_matrix, dump_glyph)
17986 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
17987
17988 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
17989 Likewise.
17990
17991 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
17992 check till after the cache is created in init_frame_faces.
17993
17994 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
17995
17996 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
17997
17998 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
17999
18000 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18001 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18002 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18003
18004 Improve buffer-overflow checking (Bug#8873).
18005 * fileio.c (Finsert_file_contents):
18006 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18007 Remove the old (too-loose) buffer overflow checks.
18008 They weren't needed, since make_gap checks for buffer overflow.
18009 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18010 The old code merely checked for Emacs fixnum overflow, and relied
18011 on undefined (wraparound) behavior. The new code avoids undefined
18012 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18013
18014 * editfns.c (Finsert_char): Don't dump core with very negative counts.
18015 Tune. Don't use wider integers than needed. Don't use alloca.
18016 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
18017
18018 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18019
18020 * insdel.c, lisp.h (buffer_overflow): New function.
18021 (insert_from_buffer_1, replace_range, replace_range_2):
18022 * insdel.c (make_gap_larger):
18023 * editfns.c (Finsert_char):
18024 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18025
18026 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18027
18028 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18029
18030 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18031
18032 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18033 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18034
18035 * fileio.c: Don't assume EMACS_INT fits in off_t.
18036 (emacs_lseek): New static function.
18037 (Finsert_file_contents, Fwrite_region): Use it.
18038 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18039
18040 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18041
18042 * fns.c: Don't overflow int when computing a list length.
18043 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18044 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18045 truncation on 64-bit hosts. Check for QUIT every
18046 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18047 faster and is responsive enough.
18048 (Flength): Report an error instead of overflowing an integer.
18049 (Fsafe_length): Return a float if the value is not representable
18050 as a fixnum. This shouldn't happen except in contrived situations.
18051 (Fnthcdr, Fsort): Don't assume list length fits in int.
18052 (Fcopy_sequence): Don't assume vector length fits in int.
18053
18054 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18055 (header_size, word_size): New constants.
18056 (allocate_vectorlike): Don't check size overflow here.
18057 (allocate_vector): Check it here instead, since this is the only
18058 caller of allocate_vectorlike that could cause overflow.
18059 Check that the new vector's length is representable as a fixnum.
18060
18061 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18062 The previous code was bogus. For example, next_almost_prime (32)
18063 returned 39, which is undesirable as it is a multiple of 3; and
18064 next_almost_prime (24) returned 25, which is a multiple of 5 so
18065 why was the code bothering to check for multiples of 7?
18066
18067 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18068
18069 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18070
18071 Variadic C functions now count arguments with ptrdiff_t.
18072 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18073 Back then I didn't know that the Emacs coding style prefers signed int.
18074 Also, in the meantime I found a few more instances where arguments
18075 were being counted with int, which may truncate counts on 64-bit
18076 machines, or EMACS_INT, which may be unnecessarily wide.
18077 * lisp.h (struct Lisp_Subr.function.aMANY)
18078 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18079 Arg counts are now ptrdiff_t, not size_t.
18080 All variadic functions and their callers changed accordingly.
18081 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18082 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18083 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18084 * callint.c (Fcall_interactively): Check arg count for overflow,
18085 to avoid potential buffer overrun. Use signed char, not 'int',
18086 for 'varies' array, so that we needn't bother to check its size
18087 calculation for overflow.
18088 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18089 * eval.c (apply_lambda):
18090 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18091 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18092 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18093
18094 * callint.c (Fcall_interactively): Don't use index var as event count.
18095
18096 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18097 * mem-limits.h (SIZE): Remove; no longer used.
18098
18099 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18100
18101 Remove unnecessary casts.
18102 * xterm.c (x_term_init):
18103 * xfns.c (x_set_border_pixel):
18104 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18105 These aren't needed now that we assume ANSI C.
18106
18107 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18108 It's more likely to cause problems (due to unsigned overflow)
18109 than to cure them.
18110
18111 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18112
18113 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18114
18115 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18116
18117 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18118
18119 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18120
18121 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18122
18123 GLYPH_CODE_FACE returns EMACS_INT, not int.
18124 * dispextern.h (merge_faces):
18125 * xfaces.c (merge_faces):
18126 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18127 Don't assume EMACS_INT fits in int.
18128
18129 * character.h (CHAR_VALID_P): Remove unused parameter.
18130 * fontset.c, lisp.h, xdisp.c: All uses changed.
18131
18132 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18133
18134 * fns.c (concat): Minor tuning based on overflow analysis.
18135 This doesn't fix any bugs. Use int to hold character, instead
18136 of constantly refetching from Emacs object. Use XFASTINT, not
18137 XINT, for value known to be a character. Don't bother comparing
18138 a single byte to 0400, as it's always less.
18139
18140 * floatfns.c (Fexpt):
18141 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18142
18143 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18144 for characters.
18145
18146 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18147
18148 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18149 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18150 incorrectly succeed when S was a string, because 4294967386 was
18151 truncated before it was used.
18152
18153 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18154 Otherwise, an out-of-range integer could cause undefined behavior
18155 on a 64-bit host.
18156
18157 * composite.c: Use int, not EMACS_INT, for characters.
18158 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18159 EMACS_INT, for values that are known to be in character range.
18160 This doesn't fix any bugs but is the usual style inside Emacs and
18161 may generate better code on 32-bit machines.
18162
18163 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18164 This is for reasons similar to the recent CHAR_STRING fix.
18165 * charset.c (Fencode_char): Check that character arg is actually
18166 a character. Pass an int to ENCODE_CHAR.
18167 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18168 wider than 'int', as a compile-time check to prevent future regressions
18169 in this area.
18170
18171 * character.c (char_string): Remove unnecessary casts.
18172
18173 Make sure a 64-bit char is never passed to CHAR_STRING.
18174 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18175 by silently ignoring the top 32 bits, allowing some values
18176 that were far too large to be valid characters.
18177 * character.h: Include <verify.h>.
18178 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18179 arguments are no wider than unsigned, as a compile-time check
18180 to prevent future regressions in this area.
18181 * data.c (Faset):
18182 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18183 (Fsubst_char_in_region):
18184 * fns.c (concat):
18185 * xdisp.c (decode_mode_spec_coding):
18186 Adjust to CHAR_STRING's new requirement.
18187 * editfns.c (Finsert_char, Fsubst_char_in_region):
18188 * fns.c (concat): Check that character args are actually
18189 characters. Without this test, these functions did the wrong
18190 thing with wildly out-of-range values on 64-bit hosts.
18191
18192 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18193 These casts should not be needed on 32-bit hosts, either.
18194 * keyboard.c (read_char):
18195 * lread.c (Fload): Remove casts to unsigned.
18196
18197 * lisp.h (UNSIGNED_CMP): New macro.
18198 This fixes comparison bugs on 64-bit hosts.
18199 (ASCII_CHAR_P): Use it.
18200 * casefiddle.c (casify_object):
18201 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18202 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18203 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18204 * dispextern.h (FACE_FROM_ID):
18205 * keyboard.c (read_char): Use UNSIGNED_CMP.
18206
18207 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18208 not to EMACS_INT, to avoid GCC warning.
18209
18210 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18211
18212 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18213 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18214 isn't needed on 32-bit machines.
18215
18216 * buffer.c (Fgenerate_new_buffer_name):
18217 Use EMACS_INT for count, not int.
18218 (advance_to_char_boundary): Return EMACS_INT, not int.
18219
18220 * data.c (Qcompiled_function): Now static.
18221
18222 * window.c (window_body_lines): Now static.
18223
18224 * image.c (gif_load): Rename local to avoid shadowing.
18225
18226 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18227 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18228 * alloc.c (make_save_value): Integer argument is now of type
18229 ptrdiff_t, not int.
18230 (mark_object): Use ptrdiff_t, not int.
18231 * lisp.h (pD): New macro.
18232 * print.c (print_object): Use it.
18233
18234 * alloc.c: Use EMACS_INT, not int, to count objects.
18235 (total_conses, total_markers, total_symbols, total_vector_size)
18236 (total_free_conses, total_free_markers, total_free_symbols)
18237 (total_free_floats, total_floats, total_free_intervals)
18238 (total_intervals, total_strings, total_free_strings):
18239 Now EMACS_INT, not int. All uses changed.
18240 (Fgarbage_collect): Compute overall total using a double, so that
18241 integer overflow is less likely to be a problem. Check for overflow
18242 when converting back to an integer.
18243 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18244 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18245 These were 'int' variables that could overflow on 64-bit hosts;
18246 they were never used, so remove them instead of repairing them.
18247 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
18248 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18249 Previously, this ceilinged at INT_MAX, but that doesn't work on
18250 64-bit machines.
18251 (allocate_pseudovector): Don't use EMACS_INT when int would do.
18252
18253 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18254 (allocate_vectorlike): Check for ptrdiff_t overflow.
18255 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18256 when a (possibly-narrower) signed value would do just as well.
18257 We prefer using signed arithmetic, to avoid comparison confusion.
18258
18259 * alloc.c: Catch some string size overflows that we were missing.
18260 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18261 for convenience in STRING_BYTES_MAX.
18262 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18263 The definition here is exact; the one in lisp.h was approximate.
18264 (allocate_string_data): Check for string overflow. This catches
18265 some instances we weren't catching before. Also, it catches
18266 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18267 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18268 and ptrdiff_t and EMACS_INT are both 64 bits.
18269
18270 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18271 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
18272 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
18273
18274 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18275
18276 * alloc.c (Fmake_string): Check for out-of-range init.
18277
18278 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18279
18280 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18281
18282 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18283
18284 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18285 xg_get_default_scrollbar_width.
18286
18287 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18288 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18289 (style_changed_cb): Call update_theme_scrollbar_width and call
18290 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18291 all frames (Bug#8505).
18292 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18293 Call gtk_window_set_resizable if HAVE_GTK3.
18294 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18295 and height if HAVE_GTK3 (Bug#8505).
18296 (scroll_bar_width_for_theme): New variable.
18297 (update_theme_scrollbar_width): New function.
18298 (xg_get_default_scrollbar_width): Move code to
18299 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18300 (xg_initialize): Call update_theme_scrollbar_width.
18301
18302 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18303
18304 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18305
18306 2011-06-12 Martin Rudalics <rudalics@gmx.at>
18307
18308 * frame.c (make_frame): Call other_buffer_safely instead of
18309 other_buffer.
18310
18311 * window.c (temp_output_buffer_show): Call display_buffer with
18312 second argument Vtemp_buffer_show_specifiers and reset latter
18313 immediately after the call.
18314 (Vtemp_buffer_show_specifiers): New variable.
18315 (auto_window_vscroll_p, next_screen_context_lines)
18316 (Vscroll_preserve_screen_position): Remove leading asterisks from
18317 doc-strings.
18318
18319 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
18320
18321 Fix minor problems found by GCC 4.6.0 static checking.
18322 * buffer.c (Qclone_number): Remove for now, as it's unused.
18323 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18324 (record_buffer): Remove unused local.
18325 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18326 (set_frame_buffer_list): Remove; unused.
18327 * frame.h (other_visible_frames): Remove decl.
18328 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18329 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18330 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18331 if HAVE_GPM.
18332 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18333 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18334 Define only if HAVE_GPM.
18335 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18336 (update_hints_inhibit): Remove; never set. All uses removed.
18337 * widgetprv.h (emacsFrameClassRec): Remove decl.
18338 * window.c (delete_deletable_window): Now returns void, since it
18339 wasn't returning anything.
18340 (compare_window_configurations): Remove unused locals.
18341 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18342 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
18343 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18344 the same widths as pointers. This follows up on the 2011-05-06 patch.
18345 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18346 * xterm.h: Likewise.
18347 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18348
18349 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
18350
18351 * makefile.w32-in: Update dependencies.
18352 (LISP_H): Add lib/intprops.h.
18353
18354 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18355
18356 * image.c (gif_load): Add animation frame delay to the metadata.
18357 (syms_of_image): Use DEFSYM. New symbol `delay'.
18358
18359 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18360
18361 * window.c (delete_deletable_window): Re-add.
18362 (Fset_window_configuration): Rewrite to handle dead buffers and
18363 consequently deletable windows.
18364 (window_tree, Fwindow_tree): Remove. Supply functionality in
18365 window.el.
18366 (compare_window_configurations): Simplify code.
18367
18368 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18369
18370 * image.c (imagemagick_load_image): Fix type mismatch.
18371 (Fimagemagick_types): Likewise.
18372
18373 * window.h (replace_buffer_in_windows): Declare.
18374
18375 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18376
18377 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18378 Qclone_number. Remove external declaration of Qdelete_window.
18379 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18380 code.
18381 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18382 Run Qbuffer_list_update_hook if allowed.
18383 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18384 buffer list implementation.
18385 (other_buffer_safely): New function.
18386 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18387 calls to replace_buffer_in_windows and
18388 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18389 if allowed.
18390 (record_buffer): Inhibit quitting and rewrite using quittable
18391 functions. Run Qbuffer_list_update_hook if allowed.
18392 (Frecord_buffer, Funrecord_buffer): New functions.
18393 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18394 Move switch-to-buffer to window.el.
18395 (bury-buffer): Move to window.el.
18396 (Vbuffer_list_update_hook): New variable.
18397
18398 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18399 section.
18400
18401 * window.h (resize_frame_windows): Move up in code.
18402 (Fwindow_frame): Remove EXFUN.
18403 (replace_buffer_in_all_windows): Remove prototype.
18404 (replace_buffer_in_windows_safely): Add prototype.
18405
18406 * window.c: Declare Qdelete_window static again. Move down
18407 declaration of select_count.
18408 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18409 (Fother_window): Move to window.el.
18410 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18411 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18412 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18413 window.el.
18414 (replace_buffer_in_windows): Implement by calling
18415 Qreplace_buffer_in_windows.
18416 (replace_buffer_in_all_windows): Remove with some functionality
18417 moved into replace_buffer_in_windows_safely.
18418 (replace_buffer_in_windows_safely): New function.
18419 (select_window_norecord, select_frame_norecord): Move in front
18420 of run_window_configuration_change_hook. Remove now obsolete
18421 declarations.
18422 (Fset_window_buffer): Rewrite doc-string.
18423 Call Qrecord_window_buffer.
18424 (keys_of_window): Move binding for other-window to window.el.
18425
18426 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18427
18428 * dispextern.h (struct image): Replace data member, whose int_val
18429 and ptr_val fields were not used by anything, with a single
18430 lisp_val object.
18431
18432 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18433 (gif_clear_image, gif_load, imagemagick_load_image)
18434 (gs_clear_image, gs_load): Callers changed.
18435
18436 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18437
18438 * buffer.h: Include <time.h>, for time_t.
18439 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18440
18441 Fix minor problems found by static checking.
18442
18443 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18444
18445 Make identifiers static if they are not used in other modules.
18446 * data.c (Qcompiled_function, Qframe, Qvector):
18447 * image.c (QimageMagick, Qsvg):
18448 * minibuf.c (Qmetadata):
18449 * window.c (resize_window_check, resize_root_window): Now static.
18450 * window.h (resize_window_check, resize_root_window): Remove decls.
18451
18452 * window.c (window_deletion_count, delete_deletable_window):
18453 Remove; unused.
18454 (window_body_lines): Now static.
18455 (Fdelete_other_windows_internal): Mark vars as initialized.
18456 Make sure 'resize_failed' is initialized.
18457 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18458 (resize_window_apply): Remove unused local.
18459 * window.h (delete_deletable_window): Remove decl.
18460
18461 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
18462 (imagemagick_load_image): Fix pointer signedness problem by changing
18463 last arg from unsigned char * to char *. All uses changed.
18464 Also, fix a local for similar reasons.
18465 Remove unused locals. Remove locals to avoid shadowing.
18466 (fn_rsvg_handle_free): Remove; unused.
18467 (svg_load, svg_load_image): Fix pointer signedness problem.
18468 (imagemagick_load_image): Don't use garbage pointer image_wand.
18469
18470 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18471
18472 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
18473
18474 * image.c (gif_load): Fix omitted cast error introduced by
18475 2011-06-06 change.
18476
18477 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18478
18479 * window.h (resize_proportionally, orig_total_lines)
18480 (orig_top_line): Remove from window structure.
18481 (set_window_height, set_window_width, change_window_heights)
18482 (Fdelete_window): Remove prototypes.
18483 (resize_frame_windows): Remove duplicate declaration.
18484
18485 2011-06-10 Eli Zaretskii <eliz@gnu.org>
18486
18487 * window.h (resize_frame_windows, resize_window_check)
18488 (delete_deletable_window, resize_root_window)
18489 (resize_frame_windows): Declare prototypes.
18490
18491 * window.c (resize_window_apply): Make definition be "static" to
18492 match the prototype.
18493
18494 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18495
18496 * window.c: Remove declarations of Qwindow_size_fixed,
18497 window_min_size_1, window_min_size_2, window_min_size,
18498 size_window, window_fixed_size_p, enlarge_window, delete_window.
18499 Remove static from declaration of Qdelete_window, it's
18500 temporarily needed by Fbury_buffer.
18501 (replace_window): Don't assign orig_top_line and
18502 orig_total_lines.
18503 (Fdelete_window, delete_window): Remove. Window deletion is
18504 handled by window.el.
18505 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18506 Replace Fdelete_window calls with calls to Qdelete_window.
18507 (Fdelete_other_windows): Remove. Deleting other windows is
18508 handled by window.el.
18509 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18510 handled in window.el.
18511 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18512 Window minimum sizes are handled in window.el.
18513 (shrink_windows, size_window, set_window_height)
18514 (set_window_width, change_window_heights, window_height)
18515 (window_width, CURBEG, CURSIZE, enlarge_window)
18516 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18517 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18518 handled in window.el.
18519 (make_dummy_parent): Rename to make_parent_window and give it a
18520 second argument horflag.
18521 (make_window): Don't set resize_proportionally any more.
18522 (Fsplit_window): Remove. Windows are split in window.el.
18523 (save_restore_action, save_restore_orig_size)
18524 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18525 Resize mini windows in window.el.
18526 (grow_mini_window, shrink_mini_window): Implement by calling
18527 Qresize_root_window_vertically, resize_window_check and
18528 resize_window_apply.
18529 (saved_window, Fset_window_configuration, save_window_save):
18530 Do not handle orig_top_line, orig_total_lines, and
18531 resize_proportionally.
18532 (window_min_height, window_min_width): Move to window.el.
18533 (keys_of_window): Move bindings for delete-other-windows,
18534 split-window, delete-window and enlarge-window to window.el.
18535
18536 * buffer.c: Temporarily extern Qdelete_window.
18537 (Fbury_buffer): Temporarily call Qdelete_window instead of
18538 Fdelete_window (Fbury_buffer will move to window.el soon).
18539
18540 * frame.c (set_menu_bar_lines_1): Remove code handling
18541 orig_top_line and orig_total_lines.
18542
18543 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18544 set_window_height but set heights directly.
18545 (change_frame_size_1): Use resize_frame_windows.
18546
18547 * xdisp.c (init_xdisp): Don't use set_window_height but set
18548 heights directly.
18549
18550 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18551 Use resize_frame_windows instead of change_window_heights and run
18552 run_window_configuration_change_hook.
18553
18554 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18555 instead of change_window_heights and run
18556 run_window_configuration_change_hook.
18557
18558 2011-06-09 Martin Rudalics <rudalics@gmx.at>
18559
18560 * window.c (replace_window): Rename second argument REPLACEMENT to
18561 NEW. New third argument SETFLAG. Rewrite.
18562 (delete_window, make_dummy_parent): Call replace_window with
18563 third argument 1.
18564 (window_list_1): Move down in code.
18565 (run_window_configuration_change_hook): Move set_buffer part
18566 before select_frame_norecord part in order to unwind correctly.
18567 Rename count1 to count.
18568 (recombine_windows, delete_deletable_window, resize_root_window)
18569 (Fdelete_other_windows_internal)
18570 (Frun_window_configuration_change_hook, make_parent_window)
18571 (resize_window_check, resize_window_apply, Fresize_window_apply)
18572 (resize_frame_windows, Fsplit_window_internal)
18573 (Fdelete_window_internal, Fresize_mini_window_internal):
18574 New functions.
18575 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18576
18577 2011-06-08 Martin Rudalics <rudalics@gmx.at>
18578
18579 * window.h (window): Add some new members to window structure -
18580 normal_lines, normal_cols, new_total, new_normal, clone_number,
18581 splits, nest, prev_buffers, next_buffers.
18582 (WINDOW_TOTAL_SIZE): Move here from window.c.
18583 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
18584
18585 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18586 Remove.
18587 (make_dummy_parent): Set new members of windows structure.
18588 (make_window): Move down in code. Handle new members of window
18589 structure.
18590 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18591 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18592 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18593 (Fset_window_prev_buffers, Fwindow_next_buffers)
18594 (Fset_window_next_buffers, Fset_window_clone_number):
18595 New functions.
18596 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18597 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18598 Doc-string fixes.
18599 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18600 Argument WINDOW can be now internal window too.
18601 (Fwindow_use_time): Move up in code.
18602 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18603 Rewrite doc-string.
18604 (Fset_window_configuration, saved_window)
18605 (Fcurrent_window_configuration, save_window_save): Handle new
18606 members of window structure.
18607 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18608 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18609 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18610 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18611 Qget_mru_window, Qresize_root_window,
18612 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18613 Qauto_buffer_name; staticpro them.
18614
18615 2011-06-07 Martin Rudalics <rudalics@gmx.at>
18616
18617 * window.c (Fwindow_total_size, Fwindow_left_column)
18618 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18619 (Fwindow_list_1): New functions.
18620 (window_box_text_cols): Replace with window_body_cols.
18621 (Fwindow_width, Fscroll_left, Fscroll_right):
18622 Use window_body_cols instead of window_box_text_cols.
18623 (delete_window, Fset_window_configuration):
18624 Call delete_all_subwindows with window as argument.
18625 (delete_all_subwindows): Take a window as argument and not a
18626 structure. Rewrite.
18627 (window_loop): Remove handling of GET_LRU_WINDOW and
18628 GET_LARGEST_WINDOW.
18629 (Fget_lru_window, Fget_largest_window): Move to window.el.
18630
18631 * window.h: Extern window_body_cols instead of
18632 window_box_text_cols. delete_all_subwindows now takes a
18633 Lisp_Object as argument.
18634
18635 * indent.c (compute_motion, Fcompute_motion):
18636 Use window_body_cols instead of window_box_text_cols.
18637
18638 * frame.c (delete_frame): Call delete_all_subwindows with root
18639 window as argument.
18640
18641 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18642
18643 * fns.c (Fputhash): Document return value.
18644
18645 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
18646
18647 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18648
18649 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18650
18651 Cons<->int and similar integer overflow fixes (Bug#8794).
18652
18653 Check for overflow when converting integer to cons and back.
18654 * charset.c (Fdefine_charset_internal, Fdecode_char):
18655 Use cons_to_unsigned to catch overflow.
18656 (Fencode_char): Use INTEGER_TO_CONS.
18657 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18658 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18659 * data.c (long_to_cons, cons_to_long): Remove.
18660 (cons_to_unsigned, cons_to_signed): New functions.
18661 These signal an error for invalid or out-of-range values.
18662 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18663 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18664 * font.c (Ffont_variation_glyphs):
18665 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18666 * lisp.h: Include <intprops.h>.
18667 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18668 (cons_to_signed, cons_to_unsigned): New decls.
18669 (long_to_cons, cons_to_long): Remove decls.
18670 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18671 (Fprimitive_undo): Use CONS_TO_INTEGER.
18672 * xfns.c (Fx_window_property): Likewise.
18673 * xselect.c: Include <limits.h>.
18674 (x_own_selection, selection_data_to_lisp_data):
18675 Use INTEGER_TO_CONS.
18676 (x_handle_selection_request, x_handle_selection_clear)
18677 (x_get_foreign_selection, Fx_disown_selection_internal)
18678 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18679 (lisp_data_to_selection_data): Use cons_to_unsigned.
18680 (x_fill_property_data): Use cons_to_signed.
18681 Report values out of range.
18682
18683 Check for buffer and string overflow more precisely.
18684 * buffer.h (BUF_BYTES_MAX): New macro.
18685 * lisp.h (STRING_BYTES_MAX): New macro.
18686 * alloc.c (Fmake_string):
18687 * character.c (string_escape_byte8):
18688 * coding.c (coding_alloc_by_realloc):
18689 * doprnt.c (doprnt):
18690 * editfns.c (Fformat):
18691 * eval.c (verror):
18692 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18693 since they may not be the same number.
18694 * editfns.c (Finsert_char):
18695 * fileio.c (Finsert_file_contents):
18696 Likewise for BUF_BYTES_MAX.
18697
18698 * image.c: Use ptrdiff_t, not int, for sizes.
18699 (slurp_file): Switch from int to ptrdiff_t.
18700 All uses changed.
18701 (slurp_file): Check that file size fits in both size_t (for
18702 malloc) and ptrdiff_t (for sanity and safety).
18703
18704 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18705 if b->modtime has its maximal value.
18706
18707 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18708
18709 Don't assume time_t can fit into int.
18710 * buffer.h (struct buffer.modtime): Now time_t, not int.
18711 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18712 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18713
18714 Minor fixes for signed vs unsigned integers.
18715 * character.h (MAYBE_UNIFY_CHAR):
18716 * charset.c (maybe_unify_char):
18717 * keyboard.c (read_char, reorder_modifiers):
18718 XINT -> XFASTINT, since the integer must be nonnegative.
18719 * ftfont.c (ftfont_spec_pattern):
18720 * keymap.c (access_keymap, silly_event_symbol_error):
18721 XUINT -> XFASTINT, since the integer must be nonnegative.
18722 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18723 since it makes no difference and we prefer signed.
18724 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18725 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18726 nonnegative.
18727
18728 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18729
18730 * window.h (Fwindow_frame): Declare.
18731
18732 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18733
18734 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18735 (SPARE_MEMORY): Always define.
18736 (LARGE_REQUEST): Remove.
18737 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18738
18739 2011-06-06 Martin Rudalics <rudalics@gmx.at>
18740
18741 * lisp.h: Move EXFUNS for Fframe_root_window,
18742 Fframe_first_window and Fset_frame_selected_window to window.h.
18743
18744 * window.h: Move EXFUNS for Fframe_root_window,
18745 Fframe_first_window and Fset_frame_selected_window here from
18746 lisp.h.
18747
18748 * frame.c (Fwindow_frame, Fframe_first_window)
18749 (Fframe_root_window, Fframe_selected_window)
18750 (Fset_frame_selected_window): Move to window.c.
18751 (Factive_minibuffer_window): Move to minibuf.c.
18752 (Fother_visible_frames_p): New function.
18753
18754 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18755
18756 * window.c (decode_window, decode_any_window): Move up in code.
18757 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18758 (inhibit_frame_unsplittable): Remove unused variable.
18759 (Fwindow_buffer): Move up and rewrite doc-string.
18760 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18761 (Fwindow_prev): New functions.
18762 (Fwindow_frame): Move here from frame.c. Accept any window as
18763 argument.
18764 (Fframe_root_window, Fframe_first_window)
18765 (Fframe_selected_window): Move here from frame.c. Accept frame
18766 or arbitrary window as argument. Update doc-strings.
18767 (Fminibuffer_window): Move up in code.
18768 (Fwindow_minibuffer_p): Move up in code and simplify.
18769 (Fset_frame_selected_window): Move here from frame.c.
18770 Marginal rewrite.
18771 (Fselected_window, select_window, Fselect_window): Move up in
18772 code. Minor doc-string fixes.
18773
18774 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18775
18776 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18777 Do not assume that spare memory exists; that assumption is valid
18778 only if SYSTEM_MALLOC.
18779 (LARGE_REQUEST): New macro, so that the issue of large requests
18780 is separated from the issue of spare memory.
18781
18782 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18783
18784 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18785 format. (Bug#8806)
18786
18787 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18788
18789 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18790 before statements.
18791
18792 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18793
18794 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18795
18796 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18797
18798 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18799 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18800
18801 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
18802
18803 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18804
18805 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
18806
18807 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18808 (x_clipboard_manager_save): Add return value.
18809 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18810 New error handlers.
18811 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18812 Obey Vx_select_enable_clipboard_manager. Catch errors in
18813 x_clipboard_manager_save (Bug#8779).
18814 (Vx_select_enable_clipboard_manager): New variable.
18815 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
18816
18817 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
18818
18819 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18820
18821 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18822
18823 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18824 in the current matrix if keep_current_p is non-zero.
18825
18826 2011-06-04 Eli Zaretskii <eliz@gnu.org>
18827
18828 * bidi.c (bidi_level_of_next_char): Fix last change.
18829
18830 2011-06-03 Eli Zaretskii <eliz@gnu.org>
18831
18832 Support bidi reordering of text covered by display properties.
18833
18834 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18835 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18836 (bidi_cache_search, bidi_cache_iterator_state)
18837 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
18838 (bidi_level_of_next_char, bidi_move_to_visually_next):
18839 Support character positions inside a run of characters covered by a
18840 display string.
18841 (bidi_paragraph_init, bidi_resolve_explicit_1)
18842 (bidi_level_of_next_char): Call bidi_fetch_char and
18843 bidi_fetch_char_advance instead of FETCH_CHAR and
18844 FETCH_CHAR_ADVANCE.
18845 (bidi_init_it): Initialize new members.
18846 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18847 definitions.
18848 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18849 instead of using explicit *_CHAR codes.
18850 (bidi_resolve_explicit, bidi_resolve_weak):
18851 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
18852 bidirectional text is supported only in multibyte buffers.
18853 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18854 it to initialize the frame_window_p member of struct bidi_it.
18855 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18856 (bidi_resolve_explicit, bidi_resolve_weak)
18857 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18858 bidi_it->nchars is non-positive.
18859 (bidi_level_of_next_char): Don't try to lookup the cache for the
18860 next/previous character if nothing is cached there yet, or if we
18861 were just reseat()'ed to a new position.
18862
18863 * xdisp.c (set_cursor_from_row): Set start and stop points
18864 according to the row's direction when priming the loop that looks
18865 for the glyph on which to display cursor.
18866 (single_display_spec_intangible_p): Function deleted.
18867 (display_prop_intangible_p): Reimplement to call
18868 handle_display_spec instead of single_display_spec_intangible_p.
18869 Accept 3 additional arguments needed by handle_display_spec.
18870 This fixes incorrect cursor motion across display property with complex
18871 values: lists, `(when COND...)' forms, etc.
18872 (single_display_spec_string_p): Support property values that are
18873 lists with the argument STRING its top-level element.
18874 (display_prop_string_p): Fix the condition for processing a
18875 property that is a list to be consistent with handle_display_spec.
18876 (handle_display_spec): New function, refactored from the
18877 last portion of handle_display_prop.
18878 (compute_display_string_pos): Accept additional argument
18879 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18880 value of a `display' property is a "replacing spec".
18881 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18882 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18883 the display property, but just return a value indicating whether
18884 the display property will replace the characters it covers.
18885 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18886 frame_window_p members of struct bidi_it.
18887 (compute_display_string_pos, compute_display_string_end):
18888 New functions.
18889 (push_it): Accept second argument POSITION, where pop_it should
18890 jump to continue iteration.
18891 (reseat_1): Initialize bidi_it.disp_pos.
18892
18893 * keyboard.c (adjust_point_for_property): Adjust the call to
18894 display_prop_intangible_p to its new signature.
18895
18896 * dispextern.h (struct bidi_it): New member frame_window_p.
18897 (bidi_init_it): Update prototypes.
18898 (display_prop_intangible_p): Update prototype.
18899 (compute_display_string_pos, compute_display_string_end):
18900 Declare prototypes.
18901 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18902 EMACS_INT.
18903
18904 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
18905
18906 Malloc failure behavior now depends on size of allocation.
18907 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18908 * lisp.h: Change signatures accordingly.
18909 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18910 All callers changed. (Bug#8762)
18911
18912 * gnutls.c: Use Emacs's memory allocators.
18913 Without this change, the gnutls library would invoke malloc etc.
18914 directly, which causes problems on non-SYNC_INPUT hosts, and which
18915 runs afoul of improving memory_full behavior. (Bug#8761)
18916 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18917 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18918 xfree instead of the default malloc, realloc, free.
18919 (Fgnutls_boot): No need to check for memory allocation failure,
18920 since xmalloc does that for us.
18921
18922 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
18923 * category.c (hash_get_category_set):
18924 * ccl.c (ccl_driver):
18925 * charset.c (Fdefine_charset_internal):
18926 * charset.h (struct charset.hash_index):
18927 * composite.c (get_composition_id, gstring_lookup_cache)
18928 (composition_gstring_put_cache):
18929 * composite.h (struct composition.hash_index):
18930 * dispextern.h (struct image.hash):
18931 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18932 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18933 (hashfn_equal, hashfn_user_defined, make_hash_table)
18934 (maybe_resize_hash_table, hash_lookup, hash_put)
18935 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18936 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18937 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18938 * image.c (make_image, search_image_cache, lookup_image)
18939 (xpm_put_color_table_h):
18940 * lisp.h (struct Lisp_Hash_Table):
18941 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
18942 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
18943 for hashes and hash indexes, instead of 'unsigned' and 'int'.
18944 * alloc.c (allocate_vectorlike):
18945 Check for overflow in vector size calculations.
18946 * ccl.c (ccl_driver):
18947 Check for overflow when converting EMACS_INT to int.
18948 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18949 need to be updated by these changes.
18950 * fns.c (make_hash_table, maybe_resize_hash_table):
18951 Check for integer overflow with large hash tables.
18952 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18953 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18954 (SXHASH_REDUCE): New macro.
18955 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18956 Use it instead of discarding useful hash info with large hash values.
18957 (sxhash_float): New function.
18958 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18959 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
18960 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18961 Rewrite to use FIXNUM_BITS, as this simplifies things.
18962 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18963 Adjust signatures to match updated version of code.
18964 (consing_since_gc): Now EMACS_INT, since a single hash table can
18965 use more than INT_MAX bytes.
18966
18967 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18968
18969 Make it possible to build with GCC-4.6+ -O2 -flto.
18970
18971 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18972
18973 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18974
18975 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18976 Call minibuffer-inactive-mode.
18977
18978 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
18979
18980 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18981 Update dependencies.
18982
18983 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18984
18985 * data.c (init_data): Remove code for UTS, this system is not
18986 supported anymore.
18987
18988 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18989
18990 Don't force ./temacs to start in terminal mode.
18991
18992 * frame.c (make_initial_frame): Initialize faces in all cases, not
18993 only when CANNOT_DUMP is defined.
18994 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
18995
18996 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18997
18998 * dispnew.c (add_window_display_history): Use const for the string
18999 pointer. Remove declaration, not needed.
19000
19001 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19002
19003 Use 'inline', not 'INLINE'.
19004 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19005 * alloc.c, fontset.c (INLINE): Remove.
19006 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19007 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19008 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19009 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19010 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19011
19012 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19013
19014 Make it possible to run ./temacs.
19015
19016 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19017 syms_of_callproc does the same thing. Remove test for
19018 "initialized", do it in the caller.
19019 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19020
19021 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19022
19023 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19024 (read_minibuf): Use get_minibuffer.
19025 (syms_of_minibuf): Use DEFSYM.
19026 (Qmetadata): New var.
19027 * data.c (Qbuffer): Don't make it static.
19028 (syms_of_data): Use DEFSYM.
19029
19030 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19031
19032 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19033 (CCL_CODE_MIN): New macro.
19034
19035 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19036
19037 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19038
19039 * eval.c (Qdebug): Now static.
19040 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19041 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19042 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19043
19044 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19045
19046 * image.c: Various fixes to ImageMagick code comments.
19047 (Fimagemagick_types): Doc fix.
19048
19049 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19050
19051 Minor fixes prompted by GCC 4.6.0 warnings.
19052
19053 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19054
19055 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19056 (x_clipboard_manager_save_all): Move extern decl to ...
19057 * xterm.h: ... here, so that it can be checked for consistency.
19058
19059 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19060
19061 * xselect.c (x_clipboard_manager_save_frame)
19062 (x_clipboard_manager_save_all): New functions.
19063 (Fx_clipboard_manager_save): Lisp function deleted.
19064
19065 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19066 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19067
19068 * xterm.h: Update prototype.
19069
19070 2011-05-28 William Xu <william.xwl@gmail.com>
19071
19072 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19073 exiting (Bug#8239).
19074
19075 2011-05-28 Jim Meyering <meyering@redhat.com>
19076
19077 Avoid a sign-extension bug in crypto_hash_function.
19078 * fns.c (to_uchar): Define.
19079 (crypto_hash_function): Use it to convert some newly-signed
19080 variables to unsigned, to avoid sign-extension bugs. For example,
19081 without this change, (md5 "truc") would evaluate to
19082 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19083 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
19084 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19085
19086 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19087
19088 Integer overflow fixes.
19089
19090 * dbusbind.c: Serial number integer overflow fixes.
19091 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19092 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19093 to hold a serial number that is too large for a fixnum.
19094 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19095 Check for serial numbers out of range. Decode any serial number
19096 that was so large that it became a float. (Bug#8722)
19097
19098 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19099 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19100 Use XFASTINT rather than XUINT when numbers are nonnegative.
19101 (xd_append_arg, Fdbus_method_return_internal):
19102 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19103 arguments, check that Lisp number is nonnegative, rather than
19104 silently wrapping negative numbers around. (Bug#8722)
19105 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19106 (Bug#8722)
19107
19108 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19109
19110 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19111
19112 ccl: Add integer overflow checks.
19113 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19114 (IN_INT_RANGE): New macros.
19115 (ccl_driver): Use them to check for integer overflow when
19116 decoding a CCL program. Many of the new checks are whether XINT (x)
19117 fits in int; it doesn't always, on 64-bit hosts. The new version
19118 doesn't catch all possible integer overflows, but it's an
19119 improvement. (Bug#8719)
19120
19121 * alloc.c (make_event_array): Use XINT, not XUINT.
19122 There's no need for unsigned here.
19123
19124 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19125 This follows up to the 2011-05-06 change that substituted uintptr_t
19126 for EMACS_INT. This case wasn't caught back then.
19127
19128 Rework Fformat to avoid integer overflow issues.
19129 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19130 now (part of C89). Include <verify.h>.
19131 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19132 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19133 (Fformat): Avoid the prepass trying to compute sizes; it was only
19134 approximate and thus did not catch overflow reliably. Instead, walk
19135 through the format just once, formatting and computing sizes as we go,
19136 checking for integer overflow at every step, and allocating a larger
19137 buffer as needed. Keep track separately whether the format is
19138 multibyte. Keep only the most-recently calculated precision, rather
19139 than them all. Record whether each argument has been converted to
19140 string. Use EMACS_INT, not int, for byte and char and arg counts.
19141 Support field widths and precisions larger than INT_MAX. Avoid
19142 sprintf's undefined behavior with conversion specifications such as %#d
19143 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19144 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19145 formatting out-of-range floating point numbers with int
19146 formats. (Bug#8668)
19147
19148 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19149
19150 * data.c: Avoid integer truncation in expressions involving floats.
19151 * data.c: Include <intprops.h>.
19152 (arith_driver): When there's an integer overflow in an expression
19153 involving floating point, convert the integers to floating point
19154 so that the resulting value does not suffer from catastrophic
19155 integer truncation. For example, on a 64-bit host (* 4
19156 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19157 Do not rely on undefined behavior after integer overflow.
19158
19159 merge count_size_as_multibyte, parse_str_to_multibyte
19160 * character.c, character.h (count_size_as_multibyte):
19161 Rename from parse_str_to_multibyte; all uses changed.
19162 Check for integer overflow.
19163 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19164 since it's now a duplicate of the other. This is more of
19165 a character than a buffer op, so better that it's in character.c.
19166 * fns.c, print.c: Adjust to above changes.
19167
19168 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19169
19170 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19171
19172 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19173
19174 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19175 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19176 (x_clipboard_manager_save): Now static.
19177 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19178
19179 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19180 (crypto_hash_function): Now static.
19181 Fix pointer signedness problems. Avoid unnecessary initializations.
19182
19183 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
19184
19185 * termhooks.h (Vselection_alist): Make it terminal-local.
19186
19187 * terminal.c (create_terminal): Initialize it.
19188
19189 * xselect.c: Support for clipboard managers.
19190 (Vselection_alist): Move to termhooks.h as terminal-local var.
19191 (LOCAL_SELECTION): New macro.
19192 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19193 (symbol_to_x_atom): Remove gratuitous arg.
19194 (x_handle_selection_request, lisp_data_to_selection_data)
19195 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19196 (x_own_selection, x_get_local_selection, x_convert_selection):
19197 New arg, specifying work frame. Use terminal-local Vselection_alist.
19198 (some_frame_on_display): Delete unused function.
19199 (Fx_own_selection_internal, Fx_get_selection_internal)
19200 (Fx_disown_selection_internal, Fx_selection_owner_p)
19201 (Fx_selection_exists_p): New optional frame arg.
19202 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19203 (x_handle_selection_clear): Don't treat other terminals with the
19204 same keyboard specially. Use the terminal-local Vselection_alist.
19205 (x_clear_frame_selections): Use Frun_hook_with_args.
19206
19207 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19208
19209 * xterm.h: Add support for those atoms.
19210
19211 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
19212
19213 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19214 (converted_selections, conversion_fail_tag): New global variables.
19215 (x_selection_request_lisp_error): Free the above.
19216 (x_get_local_selection): Remove unnecessary code.
19217 (x_reply_selection_request): Args changed; handle arbitrary array
19218 of converted selections stored in converted_selections.
19219 Separate the XChangeProperty and SelectionNotify steps.
19220 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19221 (x_convert_selection): New function.
19222 (x_handle_selection_event): Simplify.
19223 (x_get_foreign_selection): Don't ignore incoming requests while
19224 waiting for an answer; this will fail when we implement
19225 SAVE_TARGETS, and seems unnecessary anyway.
19226 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19227 (Vx_sent_selection_functions): Doc fix.
19228
19229 2011-05-26 Leo Liu <sdl.web@gmail.com>
19230
19231 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19232
19233 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19234
19235 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19236
19237 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19238 for fringe update if it has periodic bitmap.
19239 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
19240 and fringe_bitmap_periodic_p.
19241
19242 * fringe.c (get_fringe_bitmap_data): New function.
19243 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19244 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19245 row. Mark glyph row for fringe update if periodicity changed.
19246
19247 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19248 for fringe update unless it has periodic bitmap.
19249
19250 2011-05-25 Kenichi Handa <handa@m17n.org>
19251
19252 * xdisp.c (get_next_display_element): Set correct it->face_id for
19253 a static composition.
19254
19255 2011-05-24 Leo Liu <sdl.web@gmail.com>
19256
19257 * deps.mk (fns.o):
19258 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19259
19260 * fns.c (crypto_hash_function, Fsha1): New function.
19261 (Fmd5): Use crypto_hash_function.
19262 (syms_of_fns): Add Ssha1.
19263
19264 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19265
19266 * gnutls.c: Remove unused macros.
19267 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19268 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19269 Remove macros that are defined and never used.
19270 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19271
19272 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19273
19274 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19275 (Fx_get_selection_internal): Minor cleanup.
19276 (Fx_own_selection_internal): Rename arguments for consistency with
19277 select.el.
19278
19279 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19280
19281 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19282
19283 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19284
19285 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19286
19287 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19288
19289 * dispnew.c (scrolling_window): Don't exclude the case that the
19290 last enabled row in the desired matrix touches the bottom boundary.
19291
19292 2011-05-21 Glenn Morris <rgm@gnu.org>
19293
19294 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
19295 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19296 and add some more files.
19297
19298 2011-05-20 Eli Zaretskii <eliz@gnu.org>
19299
19300 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19301 report_file_error introduced by the change from 2011-05-07.
19302
19303 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19304
19305 * systime.h (Time): Define only if emacs is defined.
19306 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19307 where the include path doesn't have X11/X.h by default. See
19308 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19309
19310 2011-05-20 Kenichi Handa <handa@m17n.org>
19311
19312 * composite.c (find_automatic_composition): Fix previous change.
19313
19314 2011-05-20 Glenn Morris <rgm@gnu.org>
19315
19316 * lisp.mk: New file, split from Makefile.in.
19317 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19318 (shortlisp): Remove.
19319 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19320
19321 2011-05-19 Glenn Morris <rgm@gnu.org>
19322
19323 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19324 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19325 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19326 (lisp): Set the order to that of loadup.el.
19327 (shortlisp): Make it a copy of $lisp.
19328 (SOME_MACHINE_LISP): Remove.
19329 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19330 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19331
19332 2011-05-18 Kenichi Handa <handa@m17n.org>
19333
19334 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19335 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19336 (find_automatic_composition): Mostly rewrite for efficiency.
19337
19338 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
19339
19340 * makefile.w32-in: Update dependencies.
19341
19342 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19343
19344 * menu.c: Include limits.h (fixes the MS-Windows build broken by
19345 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
19346
19347 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
19348
19349 Fix some integer overflow issues, such as string length overflow.
19350
19351 * insdel.c (count_size_as_multibyte): Check for string overflow.
19352
19353 * character.c (lisp_string_width): Check for string overflow.
19354 Use EMACS_INT, not int, for string indexes and lengths; in
19355 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19356 the resulting string length overflows an EMACS_INT; instead,
19357 report a string overflow if no precision given. When checking for
19358 precision exhaustion, use a check that cannot possibly have
19359 integer overflow. (Bug#8675)
19360 * character.h (lisp_string_width): Adjust to new signature.
19361
19362 * alloc.c (string_overflow): New function.
19363 (Fmake_string): Use it. This doesn't change behavior, but saves
19364 a few bytes and will simplify future changes.
19365 * character.c (string_escape_byte8): Likewise.
19366 * lisp.h (string_overflow): New decl.
19367
19368 Fixups, following up to the user-interface timestamp change.
19369 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19370 for UI timestamps, instead of unsigned long.
19371 * msdos.c (mouse_get_pos): Likewise.
19372 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
19373 * w32gui.h (Time): Define by including "systime.h" rather than by
19374 declaring it ourselves. (Bug#8664)
19375
19376 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19377 * image.c (clear_image_cache): Likewise.
19378
19379 * term.c (term_mouse_position): Don't assume time_t wraparound.
19380
19381 Be more systematic about user-interface timestamps.
19382 Before, the code sometimes used 'Time', sometimes 'unsigned long',
19383 and sometimes 'EMACS_UINT', to represent these timestamps.
19384 This change causes it to use 'Time' uniformly, as that's what X uses.
19385 This makes the code easier to follow, and makes it easier to catch
19386 integer overflow bugs such as Bug#8664.
19387 * frame.c (Fmouse_position, Fmouse_pixel_position):
19388 Use Time, not unsigned long, for user-interface timestamps.
19389 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19390 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19391 * keyboard.h (last_event_timestamp): Likewise.
19392 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19393 * menu.h (xmenu_show): Likewise.
19394 * term.c (term_mouse_position): Likewise.
19395 * termhooks.h (struct input_event.timestamp): Likewise.
19396 (struct terminal.mouse_position_hook): Likewise.
19397 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19398 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19399 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19400 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19401 what it was before.
19402 * menu.h, termhooks.h: Include "systime.h", for Time.
19403
19404 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19405 Don't assume that the difference between two unsigned long values
19406 can fit into an integer. At this point, we know button_down_time
19407 <= event->timestamp, so the difference must be nonnegative, so
19408 there's no need to cast the result if double-click-time is
19409 nonnegative, as it should be; check that it's nonnegative, just in
19410 case. This bug is triggered when events are more than 2**31 ms
19411 apart (about 25 days). (Bug#8664)
19412
19413 * xselect.c (last_event_timestamp): Remove duplicate decl.
19414 (x_own_selection): Remove needless cast to unsigned long.
19415
19416 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19417 that always fit in int. Use a sentinel instead of a counter, to
19418 avoid a temp and to allay GCC's concerns about possible int overflow.
19419 * frame.h (struct frame): Use int for menu_bar_items_used
19420 instead of EMACS_INT, since it always fits in int.
19421
19422 * menu.c (grow_menu_items): Check for int overflow.
19423
19424 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19425
19426 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19427 Before, the code was not consistent. These values cannot exceed
19428 2**31 - 1 so there's no need to make them unsigned.
19429 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19430 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19431 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19432 as modifiers.
19433 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19434
19435 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19436 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19437 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19438 presumably because the widths might not match.
19439
19440 * window.c (size_window): Avoid needless test at loop start.
19441
19442 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19443
19444 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19445
19446 2011-05-12 Drew Adams <drew.adams@oracle.com>
19447
19448 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19449
19450 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19451
19452 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19453 `width' to `bar_area_x' and `bar_area_width', respectively.
19454 (x_scroll_run): Take account of fringe background extension.
19455
19456 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19457 Rename local vars `left' and `width' to `bar_area_x' and
19458 `bar_area_width', respectively.
19459 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19460 background extension.
19461
19462 2011-05-10 Jim Meyering <meyering@redhat.com>
19463
19464 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19465
19466 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
19467
19468 * image.c (Finit_image_library): Return t for built-in image types,
19469 like pbm and xbm. (Bug#8640)
19470
19471 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19472
19473 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19474
19475 2011-05-07 Eli Zaretskii <eliz@gnu.org>
19476
19477 * w32console.c (Fset_screen_color): Doc fix.
19478 (Fget_screen_color): New function.
19479 (syms_of_ntterm): Defsubr it.
19480
19481 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19482 unlink the temporary file if Fcall_process didn't create it in the
19483 first place.
19484 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19485 child process will be redirected to a file specified with `:file'.
19486 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19487 cue to call_process_cleanup not to close that handle.
19488
19489 2011-05-07 Ben Key <bkey76@gmail.com>
19490
19491 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19492 one of two shell specific rules, either bootstrap-temacs-CMD or
19493 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19494 to the previous implementation of the bootstrap-temacs rule.
19495 The bootstrap-temacs-CMD rule is similar to the previous
19496 implementation of the bootstrap-temacs rule except that it
19497 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19498 variable.
19499
19500 These changes, along with some changes to nt/configure.bat,
19501 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19502 earlier fix to add support for --cflags and --ldflags options
19503 that include quotes so that it works whether make uses cmd or
19504 sh as the shell.
19505
19506 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
19507
19508 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19509 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19510 is a constant.
19511 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19512 a string. Handle both cases.
19513 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19514 (Fdbus_register_method): Use Qinvalid_function.
19515
19516 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19517
19518 * makefile.w32-in: Update dependencies.
19519 (LISP_H): Add inttypes.h and stdin.h.
19520 (PROCESS_H): Add unistd.h.
19521
19522 2011-05-06 Eli Zaretskii <eliz@gnu.org>
19523
19524 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19525 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19526
19527 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
19528
19529 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19530
19531 * term.c (vfatal): Remove stray call to va_end.
19532 It's not needed and the C Standard doesn't allow it here anyway.
19533
19534 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19535 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19536
19537 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19538 bytes.
19539
19540 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19541
19542 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19543
19544 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19545
19546 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19547
19548 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19549
19550 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19551 * charset.c (Fdefine_charset_internal): Don't initialize
19552 charset.code_space[15]. The value was garbage, on hosts with
19553 32-bit int (Bug#8600).
19554
19555 * lread.c (read_integer): Be more consistent with string-to-number.
19556 Use string_to_number to do the actual conversion; this avoids
19557 rounding errors and fixes some other screwups. Without this fix,
19558 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19559 (digit_to_number): Move earlier, for benefit of read_integer.
19560 Return -1 if the digit is out of range for the base, -2 if it is
19561 not a digit in any supported base. (Bug#8602)
19562
19563 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19564
19565 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19566 to match comment at start of function. This also removes a
19567 GCC warning about overflow in a 32+64-bit port.
19568
19569 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19570
19571 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19572 Reported by Stefan Monnier in
19573 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
19574 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19575 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
19576
19577 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19578 (EMACS_UINTPTR): Likewise, with uintptr_t.
19579
19580 * lisp.h: Prefer 64-bit EMACS_INT if available.
19581 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19582 on 32-bit hosts that have 64-bit int, so that they can access
19583 large files.
19584 However, temporarily disable this change unless the temporary
19585 symbol WIDE_EMACS_INT is defined.
19586
19587 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19588
19589 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19590 This removes an assumption that EMACS_INT and long are the same
19591 width as pointers. The assumption is true for Emacs porting targets
19592 now, but we want to make other targets possible.
19593 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19594 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19595 In the rest of the code, change types of integers that hold casted
19596 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19597 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19598 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19599 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19600 No need to cast type when ORing.
19601 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19602 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19603 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19604 assume EMACS_INT is the same width as char *.
19605 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19606 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19607 Remove no-longer-needed casts.
19608 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19609 (xg_tool_bar_help_callback, xg_make_tool_item):
19610 Use EMACS_INTPTR to hold an integer
19611 that will be cast to void *; this can avoid a GCC warning
19612 if EMACS_INT is not the same width as void *.
19613 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19614 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19615 (current_message_1, set_message_1):
19616 Use a local to convert to proper width without a cast.
19617 * xmenu.c (dialog_selection_callback): Likewise.
19618
19619 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19620 Also, don't assume VALBITS / RAND_BITS is less than 5,
19621 and don't rely on undefined behavior when shifting a 1 left into
19622 the sign bit.
19623 * lisp.h (get_random): Change signature to match.
19624
19625 * lread.c (hash_string): Use size_t, not int, for hash computation.
19626 Normally we prefer signed values; but hashing is special, because
19627 it's better to use unsigned division on hash table sizes so that
19628 the remainder is nonnegative. Also, size_t is the natural width
19629 for hashing into memory. The previous code used 'int', which doesn't
19630 retain enough info to hash well into very large tables.
19631 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19632
19633 * dbusbind.c: Don't possibly lose pointer info when converting.
19634 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19635 Use XPNTR rather than XHASH, so that the high-order bits of
19636 the pointer aren't lost when converting through void *.
19637
19638 * eval.c (Fautoload): Don't double-shift a pointer.
19639
19640 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19641
19642 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19643
19644 * gnutls.c (DEF_GNUTLS_FN):
19645 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19646
19647 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19648
19649 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19650 marker. (Bug#8610)
19651
19652 2011-05-05 Eli Zaretskii <eliz@gnu.org>
19653
19654 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19655 New version that can reserve upto 2GB of heap space.
19656
19657 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
19658
19659 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19660
19661 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19662
19663 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19664 `gnutls_certificate_set_x509_key_file'.
19665
19666 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
19667
19668 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19669 Update dependencies.
19670
19671 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19672
19673 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19674 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19675 Remove unused parameter `fildes'.
19676 * process.c (read_process_output, send_process): Don't pass it.
19677
19678 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19679
19680 Fix previous change: the library cache is defined in w32.c.
19681 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19682 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19683
19684 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19685
19686 Implement dynamic loading of GnuTLS on Windows.
19687
19688 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19689 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19690 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19691 Declare.
19692
19693 * gnutls.c (Qgnutls_dll): Define.
19694 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19695 (gnutls_*): Declare function pointers.
19696 (init_gnutls_functions): New function to initialize function pointers.
19697 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19698 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19699 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19700 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19701 (emacs_gnutls_write, emacs_gnutls_read)
19702 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19703 (Fgnutls_available_p): New function.
19704 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19705 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19706 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19707
19708 * image.c: Include w32.h.
19709 (Vimage_type_cache): Delete.
19710 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19711 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19712 (w32_delayed_load): Move to w32.c.
19713
19714 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19715
19716 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19717 (w32_delayed_load): Move from image.c. When loading a library, record
19718 its filename in the :loaded-from property of the library id.
19719 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19720 Initialize and staticpro them.
19721 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19722
19723 * process.c: Include lisp.h before w32.h, not after.
19724 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19725 instead of gnutls_record_check_pending.
19726
19727 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19728
19729 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19730
19731 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19732 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19733 as passed in.
19734
19735 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19736
19737 * xterm.c (x_set_frame_alpha): Do not set property on anything
19738 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19739
19740 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19741
19742 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19743
19744 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19745
19746 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19747 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19748 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19749 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19750 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19751 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19752 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19753 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19754 (Qgnutls_bootprop_callbacks_verify): Make static.
19755
19756 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19757
19758 * callproc.c: Indentation fixup.
19759
19760 * sysdep.c (wait_for_termination_1): Make static.
19761 (wait_for_termination, interruptible_wait_for_termination):
19762 Move after wait_for_termination_1.
19763
19764 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19765
19766 * sysdep.c (interruptible_wait_for_termination): New function
19767 which is like wait_for_termination, but allows keyboard
19768 interruptions.
19769
19770 * callproc.c (Fcall_process): Add (:file "file") as an option for
19771 the STDOUT buffer.
19772 (Fcall_process_region): Ditto.
19773
19774 2011-04-30 Eli Zaretskii <eliz@gnu.org>
19775
19776 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19777 rather than `XVECTOR (FOO)->size'.
19778
19779 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19780 inttypes.h, as a gnulib replacement is used if it not available in
19781 system headers.
19782
19783 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19784
19785 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19786 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19787 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19788
19789 * coding.c (coding_alloc_by_realloc): Error out if destination
19790 will grow beyond MOST_POSITIVE_FIXNUM.
19791 (decode_coding_emacs_mule): Abort if there isn't enough place in
19792 charbuf for the composition carryover bytes. Reserve an extra
19793 space for up to 2 characters produced in a loop.
19794 (decode_coding_iso_2022): Abort if there isn't enough place in
19795 charbuf for the composition carryover bytes.
19796
19797 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19798
19799 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19800 aborting when %lld or %lll format is passed.
19801 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19802 %llo or %llx format is passed. (Bug#8545)
19803
19804 * window.c (window_scroll_line_based): Use a marker instead of
19805 simple variables to record original value of point. (Bug#7952)
19806
19807 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19808 produced by %s or %c overflows available buffer space. (Bug#8545)
19809
19810 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19811
19812 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
19813 (SIZE_MAX): Move defn after all includes, as they might #define it.
19814
19815 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19816
19817 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19818
19819 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19820
19821 * keyboard.c (Qdelayed_warnings_hook): Define.
19822 (command_loop_1): Run `delayed-warnings-hook'
19823 if Vdelayed_warnings_list is non-nil.
19824 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19825 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19826
19827 2011-04-28 Eli Zaretskii <eliz@gnu.org>
19828
19829 * doprnt.c (doprnt): Don't return value smaller than the buffer
19830 size if the message was truncated. (Bug#8545).
19831
19832 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19833
19834 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19835 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19836
19837 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19838
19839 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19840
19841 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
19842
19843 * makefile.w32-in: Update dependencies.
19844
19845 2011-04-27 Eli Zaretskii <eliz@gnu.org>
19846
19847 Improve `doprnt' and its usage. (Bug#8545)
19848 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19849 `format_end'. Remove support for %l as a conversion specifier.
19850 Don't use xrealloc. Improve diagnostics when the %l size modifier
19851 is used. Update the commentary.
19852
19853 * eval.c (verror): Simplify calculation of size_t.
19854
19855 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19856 messages.
19857
19858 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19859
19860 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19861 change.
19862
19863 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19864
19865 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19866 This makes this file independent of the recent pseudovector change.
19867
19868 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
19869
19870 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19871
19872 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
19873 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
19874 Remove unused local.
19875 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
19876
19877 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
19878 GCC 4.6.0 optimizes based on type-based alias analysis.
19879 For example, if b is of type struct buffer * and v of type struct
19880 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19881 != &v->size, and therefore "v->size = 1; b->size = 2; return
19882 v->size;" must therefore return 1. This assumption is incorrect
19883 for Emacs, since it type-puns struct Lisp_Vector * with many other
19884 types. To fix this problem, this patch adds a new type struct
19885 vectorlike_header that documents the constraints on layout of vectors
19886 and pseudovectors, and helps optimizing compilers not get fooled
19887 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19888 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
19889 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19890 the size member.
19891 (XSETPVECTYPE): Rewrite in terms of new macro.
19892 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19893 This is a bit clearer, and further avoids the possibility of
19894 undesirable aliasing.
19895 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
19896 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
19897 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19898 since Lisp_Subr is a special case (no "next" field).
19899 (ASIZE): Now uses header.size rather than size.
19900 All previous uses of XVECTOR (foo)->size replaced to use this macro,
19901 to avoid the hassle of writing XVECTOR (foo)->header.size.
19902 (struct vectorlike_header): New type.
19903 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19904 object, to help avoid aliasing.
19905 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19906 (SUBRP): Likewise, since Lisp_Subr is a special case.
19907 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19908 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19909 (struct Lisp_Hash_Table): Combine first two members into a single
19910 struct vectorlike_header member. All uses of "size" and "next" members
19911 changed to be "header.size" and "header.next".
19912 * buffer.h (struct buffer): Likewise.
19913 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19914 * frame.h (struct frame): Likewise.
19915 * process.h (struct Lisp_Process): Likewise.
19916 * termhooks.h (struct terminal): Likewise.
19917 * window.c (struct save_window_data, struct saved_window): Likewise.
19918 * window.h (struct window): Likewise.
19919 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19920 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19921 * buffer.c (init_buffer_once): Likewise.
19922 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19923 special case.
19924 * process.c (Fformat_network_address): Use local var for size,
19925 for brevity.
19926
19927 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19928
19929 Make the Lisp reader and string-to-float more consistent (Bug#8525)
19930 * data.c (atof): Remove decl; no longer used or needed.
19931 (digit_to_number): Move to lread.c.
19932 (Fstring_to_number): Use new string_to_number function, to be
19933 consistent with how the Lisp reader treats infinities and NaNs.
19934 Do not assume that floating-point numbers represent EMACS_INT
19935 without losing information; this is not true on most 64-bit hosts.
19936 Avoid double-rounding errors, by insisting on integers when
19937 parsing non-base-10 numbers, as the documentation specifies.
19938 * lisp.h (string_to_number): New decl, replacing ...
19939 (isfloat_string): Remove.
19940 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
19941 (read1): Do not accept +. and -. as integers; this
19942 appears to have been a coding error. Similarly, do not accept
19943 strings like +-1e0 as floating point numbers. Do not report
19944 overflow for integer overflows unless the base is not 10 which
19945 means we have no simple and reliable way to continue.
19946 Break out the floating-point parsing into a new
19947 function string_to_number, so that Fstring_to_number parses
19948 floating point numbers consistently with the Lisp reader.
19949 (digit_to_number): Move here from data.c. Make it static inline.
19950 (E_CHAR, EXP_INT): Remove, replacing with ...
19951 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19952 (string_to_number): New function, replacing isfloat_string.
19953 This function checks for valid syntax and produces the resulting
19954 Lisp float number too. Rework it so that string-to-number
19955 no longer mishandles examples like "1.0e+". Use strtoumax,
19956 so that overflow for non-base-10 numbers is reported only when
19957 there's no portable and simple way to convert to floating point.
19958
19959 * textprop.c (set_text_properties_1): Rewrite for clarity,
19960 and to avoid GCC warning about integer overflow.
19961
19962 * intervals.h (struct interval): Use EMACS_INT for members
19963 where EMACS_UINT might cause problems. See
19964 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19965 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19966 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19967 All uses changed.
19968 (offset_intervals): Tell GCC not to worry about length overflow
19969 when negating a negative length.
19970
19971 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19972 (overrun_check_free): Likewise.
19973
19974 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19975 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19976 word size.
19977
19978 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19979 (gnutls_make_error): Rename local to avoid shadowing.
19980 (gnutls_emacs_global_deinit): ifdef out; not used.
19981 (Fgnutls_boot): Use const for pointer to readonly storage.
19982 Comment out unused local. Fix pointer signedness problems.
19983
19984 * lread.c (openp): Don't stuff size_t into an 'int'.
19985 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
19986 about possible signed overflow.
19987
19988 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19989 (GDK_KEY_g): Don't define if already defined.
19990 (xg_prepare_tooltip): Avoid pointer signedness problem.
19991 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
19992
19993 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
19994 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
19995
19996 * xfns.c (Fx_window_property): Simplify a bit,
19997 to make a bit faster and to avoid GCC 4.6.0 warning.
19998 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
19999
20000 * fns.c (internal_equal): Don't assume size_t fits in int.
20001
20002 * alloc.c (compact_small_strings): Tighten assertion a little.
20003
20004 Replace pEd with more-general pI, and fix some printf arg casts.
20005 * lisp.h (pI): New macro, generalizing old pEd macro to other
20006 conversion specifiers. For example, use "...%"pI"d..." rather
20007 than "...%"pEd"...".
20008 (pEd): Remove. All uses replaced with similar uses of pI.
20009 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20010 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20011 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20012 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20013 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20014 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20015 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20016 64-bit hosts.
20017 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20018 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20019 * print.c (safe_debug_print, print_object): Likewise.
20020 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20021 to int.
20022 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20023 avoiding the 0 flag, which is not portable.
20024 * process.c (Fmake_network_process): Use pI to avoid cast.
20025 * region-cache.c (pp_cache): Likewise.
20026 * xdisp.c (decode_mode_spec): Likewise.
20027 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20028 behavior on 64-bit hosts with printf arg.
20029 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20030 (x_stop_queuing_selection_requests): Likewise.
20031 (x_get_window_property): Don't truncate byte count to an 'int'
20032 when tracing.
20033
20034 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20035 here, since it parses constructs like leading '-' and spaces,
20036 which are not wanted; and it overflows with large numbers.
20037 Instead, simply match F[0-9]+, which is what is wanted anyway.
20038
20039 * alloc.c: Remove unportable assumptions about struct layout.
20040 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20041 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20042 (allocate_vectorlike, make_pure_vector): Use the new macros,
20043 plus offsetof, to remove unportable assumptions about struct layout.
20044 These assumptions hold on all porting targets that I know of, but
20045 they are not guaranteed, they're easy to remove, and removing them
20046 makes further changes easier.
20047
20048 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20049 This doesn't fix a bug but makes the code clearer.
20050 (string_overrun_cookie): Now const. Use initializers that
20051 don't formally overflow signed char, to avoid warnings.
20052 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20053 can cause Emacs to crash when string overrun checking is enabled.
20054 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20055 multiple of sizeof (EMACS_INT); it need not be, if
20056 alignof(EMACS_INT) < sizeof (EMACS_INT).
20057 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20058
20059 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
20060
20061 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20062
20063 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20064
20065 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20066 supposed to be handshaking. (Bug#8556)
20067 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20068
20069 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
20070
20071 * lisp.h (Qdebug): List symbol.
20072 * eval.c (Qdebug): Restore global linkage.
20073 * keyboard.c (debug-on-event): New variable.
20074 (handle_user_signal): Break into debugger when debug-on-event
20075 matches the current signal symbol.
20076
20077 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20078
20079 * alloc.c (check_sblock, check_string_bytes)
20080 (check_string_free_list): Convert to standard C.
20081
20082 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20083
20084 * w32.c (emacs_gnutls_push): Fix typo.
20085
20086 2011-04-25 Eli Zaretskii <eliz@gnu.org>
20087
20088 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20089 "cast to pointer from integer of different size".
20090
20091 Improve doprnt and its use in verror. (Bug#8545)
20092 * doprnt.c (doprnt): Document the set of format control sequences
20093 supported by the function. Use SAFE_ALLOCA instead of always
20094 using `alloca'.
20095
20096 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20097 is one byte too soon. Don't use xrealloc; instead xfree and
20098 xmalloc anew.
20099
20100 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20101
20102 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20103 callbacks stage.
20104
20105 * gnutls.c: Renamed global_initialized to
20106 gnutls_global_initialized. Added internals for the
20107 :verify-hostname-error, :verify-error, and :verify-flags
20108 parameters of `gnutls-boot' and documented those parameters in the
20109 docstring. Start callback support.
20110 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20111 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20112 on error. Return error code.
20113 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20114 (emacs_gnutls_read): Likewise.
20115 (Fgnutls_boot): Return handshake error code.
20116 (emacs_gnutls_handle_error): New function.
20117 (wsaerror_to_errno): Likewise.
20118
20119 * w32.h (emacs_gnutls_pull): Add prototype.
20120 (emacs_gnutls_push): Likewise.
20121
20122 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20123 (emacs_gnutls_push): Likewise.
20124
20125 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20126
20127 * process.c (wait_reading_process_output): Check if GnuTLS
20128 buffered some data internally if no FDs are set for TLS
20129 connections.
20130
20131 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20132 (LIBS): Link to USER_LIBS.
20133 ($(BLD)/gnutls.$(0)): New target.
20134
20135 2011-04-24 Eli Zaretskii <eliz@gnu.org>
20136
20137 * xdisp.c (handle_single_display_spec): Rename the
20138 display_replaced_before_p argument into display_replaced_p, to
20139 make it consistent with the commentary. Fix typos in the
20140 commentary.
20141
20142 * textprop.c (syms_of_textprop): Remove dead code.
20143 (copy_text_properties): Delete obsolete commentary about an
20144 interface that was deleted long ago. Fix typos in the description
20145 of arguments.
20146
20147 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20148 to changes in oldXMenu/XMenu.h from 2011-04-16.
20149 <menu_help_message, prev_menu_help_message>: Constify.
20150 (IT_menu_make_room): menu->help_text is now `const char **';
20151 adjust.
20152
20153 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20154 to changes in oldXMenu/XMenu.h from 2011-04-16.
20155 (struct XMenu): Declare `help_text' `const char **'.
20156
20157 * xfaces.c <Qunspecified>: Make extern again.
20158
20159 * syntax.c: Include sys/types.h before including regex.h, as
20160 required by POSIX.
20161
20162 * doc.c (get_doc_string): Improve the format passed to `error'.
20163
20164 * doprnt.c (doprnt): Improve commentary.
20165
20166 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20167
20168 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20169 them with etags.
20170
20171 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20172 changes in globals.h immediately force recompilation.
20173 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20174 $(CURDIR)/s/ms-w32.h.
20175 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20176
20177 * character.c (Fchar_direction): Function deleted.
20178 (syms_of_character): Don't defsubr it.
20179 <char-direction-table>: Deleted.
20180
20181 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20182
20183 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20184 * doprnt.c: Include limits.h.
20185 (SIZE_MAX): New macro.
20186 (doprnt): Return a size_t value. 2nd arg is now size_t.
20187 Many local variables are now size_t instead of int or unsigned.
20188 Improve overflow protection. Support `l' modifier for integer
20189 conversions. Support %l conversion. Don't assume an EMACS_INT
20190 argument for integer conversions and for %c.
20191
20192 * lisp.h (doprnt): Restore prototype.
20193
20194 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20195 $(SRC)/character.h.
20196
20197 * Makefile.in (base_obj): Add back doprnt.o.
20198
20199 * deps.mk (doprnt.o): Add back prerequisites.
20200 (callint.o): Depend on character.h.
20201
20202 * eval.c (internal_lisp_condition_case): Include the handler
20203 representation in the error message.
20204 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20205 when breaking from the loop.
20206
20207 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20208
20209 * callint.c (Fcall_interactively): When displaying error message
20210 about invalid control letter, pass the character's codepoint, not
20211 a pointer to its multibyte form. Improve display of the character
20212 in octal and display also its hex code.
20213
20214 * character.c (char_string): Use %x to display the (unsigned)
20215 codepoint of an invalid character, to avoid displaying a bogus
20216 negative value.
20217
20218 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20219 `error', not SYMBOL_NAME itself.
20220
20221 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20222 character arguments to `error'.
20223
20224 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20225 to `error' in error message about FINAL_CHAR argument. Make sure
20226 FINAL_CHAR is a character, and use %c when it is passed as
20227 argument to `error'.
20228
20229 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20230
20231 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20232
20233 * w32.c: Include <time.h>.
20234 (sys_localtime): New function.
20235
20236 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
20237
20238 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20239
20240 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
20241
20242 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
20243
20244 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20245 zombies (Bug#8467).
20246
20247 2011-04-19 Eli Zaretskii <eliz@gnu.org>
20248
20249 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20250 gl_state.e_property when gl_state.object is Qt.
20251
20252 * insdel.c (make_gap_larger): Remove limitation of buffer size
20253 to <= INT_MAX.
20254
20255 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
20256
20257 * xdisp.c (lookup_glyphless_char_display)
20258 (produce_glyphless_glyph): Handle cons cell entry in
20259 glyphless-char-display.
20260 (Vglyphless_char_display): Document it.
20261
20262 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20263 glyphless-char-display.
20264
20265 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
20266
20267 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20268
20269 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20270
20271 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20272 definition for no-X builds.
20273
20274 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
20275
20276 Static checks with GCC 4.6.0 and non-default toolkits.
20277
20278 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20279
20280 * process.c (keyboard_bit_set): Define only if SIGIO.
20281 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20282 (send_process): Repair possible setjmp clobbering.
20283
20284 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20285
20286 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20287
20288 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20289
20290 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20291 Define only if needed.
20292
20293 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20294 by pacifying GCC about it. Maybe it's time to retire it?
20295 * xfaces.c (USG, __TIMEVAL__): Likewise.
20296
20297 * dispextern.h (struct redisplay_interface): Rename param
20298 to avoid shadowing.
20299 * termhooks.h (struct terminal): Likewise.
20300 * xterm.c (xembed_send_message): Likewise.
20301
20302 * insdel.c (make_gap_smaller): Define only if
20303 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20304
20305 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20306 it.
20307
20308 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20309 so that we aren't warned about unused symbols.
20310
20311 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20312
20313 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
20314
20315 * xfns.c (x_real_positions): Mark locals as initialized.
20316
20317 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20318
20319 * xterm.c: Fix problems found by static analysis with other toolkits.
20320 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
20321 (x_dispatch_event): Declare static if USE_GTK, and
20322 define if USE_GTK || USE_X_TOOLKIT.
20323 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
20324 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
20325 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20326 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
20327
20328 * xmenu.c (menu_help_callback): Pointer type fixes.
20329 Use const pointers when pointing at readonly data. Avoid pointer
20330 signedness clashes.
20331 (FALSE): Remove unused macro.
20332 (update_frame_menubar): Remove unused decl.
20333
20334 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20335
20336 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20337 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20338 (single_menu_item): Rename local to avoid shadowing.
20339
20340 * keyboard.c (make_lispy_event): Remove unused local var.
20341
20342 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20343 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20344
20345 * bitmaps: Change bitmaps from unsigned char back to the X11
20346 compatible char. Avoid the old compiler warnings about
20347 out-of-range initializers by using, for example, '\xab' rather
20348 than 0xab.
20349
20350 * xgselect.c (xgselect_initialize): Check vs interface
20351 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20352
20353 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20354
20355 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20356 to read-only memory.
20357
20358 * fns.c (vector): Remove; this old hack is no longer needed.
20359
20360 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
20361 Remove unused var.
20362 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
20363
20364 * xrdb.c (x_load_resources): Omit unused local.
20365
20366 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
20367 (x_window): Rename locals to avoid shadowing.
20368 (USG): Use the kludged USG macro, to pacify gcc.
20369
20370 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
20371 (x_term_init): Remove local to avoid shadowing.
20372
20373 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
20374
20375 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20376 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20377
20378 2011-04-16 Eli Zaretskii <eliz@gnu.org>
20379
20380 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20381
20382 Fix regex.c, syntax.c and friends for buffers > 2GB.
20383 * syntax.h (struct gl_state_s): Declare character position members
20384 EMACS_INT.
20385
20386 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20387
20388 * textprop.c (verify_interval_modification, interval_of):
20389 Declare arguments EMACS_INT.
20390
20391 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20392 EMACS_INT.
20393
20394 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20395
20396 * indent.c (Fvertical_motion): Local variable it_start is now
20397 EMACS_INT.
20398
20399 * regex.c (re_match, re_match_2, re_match_2_internal)
20400 (bcmp_translate, regcomp, regexec, print_double_string)
20401 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20402 (re_compile_pattern, re_exec): Declare arguments and local
20403 variables `size_t' and `ssize_t' and return values `regoff_t', as
20404 appropriate.
20405 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20406 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20407 <compile_stack_type>: `size' and `avail' are now `size_t'.
20408
20409 * regex.h <regoff_t>: Use ssize_t, not int.
20410 (re_search, re_search_2, re_match, re_match_2): Arguments that
20411 specify buffer/string position and length are now ssize_t and
20412 size_t. Return type is regoff_t.
20413
20414 2011-04-16 Ben Key <bkey76@gmail.com>
20415
20416 * nsfont.m: Fixed bugs in ns_get_family and
20417 ns_descriptor_to_entity that were caused by using free to
20418 deallocate memory blocks that were allocated by xmalloc (via
20419 xstrdup). This caused Emacs to crash when compiled with
20420 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20421 --enable-checking=xmallocoverrun). xfree is now used to
20422 deallocate these memory blocks.
20423
20424 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
20425
20426 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20427
20428 emacs_write: Accept and return EMACS_INT for sizes.
20429 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20430 et seq.
20431 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20432 Accept and return EMACS_INT.
20433 (emacs_gnutls_write): Return the number of bytes written on
20434 partial writes.
20435 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
20436 (emacs_read, emacs_write): Remove check for negative size, as the
20437 Emacs source code has been audited now.
20438 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20439 (emacs_read, emacs_write): Use it.
20440 * process.c (send_process): Adjust to the new signatures of
20441 emacs_write and emacs_gnutls_write. Do not attempt to store
20442 a byte offset into an 'int'; it might overflow.
20443 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
20444
20445 * sound.c: Don't assume sizes fit in 'int'.
20446 (struct sound_device.period_size, alsa_period_size):
20447 Return EMACS_INT, not int.
20448 (struct sound_device.write, vox_write, alsa_write):
20449 Accept EMACS_INT, not int.
20450 (wav_play, au_play): Use EMACS_INT to store sizes and to
20451 record read return values.
20452
20453 2011-04-15 Ben Key <bkey76@gmail.com>
20454
20455 * keyboard.c (Qundefined): Don't declare static since it is used
20456 in nsfns.m.
20457 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20458 static since they are used in nsfont.m.
20459
20460 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20461
20462 * process.c (Qprocessp): Don't declare static.
20463 * lisp.h (Qprocessp): Declare again.
20464
20465 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
20466
20467 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20468
20469 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20470
20471 Improve C-level modularity by making more things 'static'.
20472
20473 Don't publish debugger-only interfaces to other modules.
20474 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20475 (verify_bytepos, count_markers): Move decls to the only modules
20476 that need them.
20477 * region-cache.h (pp_cache): Likewise.
20478 * window.h (check_all_windows): Likewise.
20479 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20480
20481 * sysdep.c (croak): Now static, if
20482 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20483 * syssignal.h (croak): Declare only if not static.
20484
20485 * alloc.c (refill_memory_reserve): Now static if
20486 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20487 * lisp.h (refill_memory_reserve): Declare only if not static.
20488
20489 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20490 Define only if USE_LUCID.
20491
20492 * xrdb.c (x_customization_string, x_rm_string): Now static.
20493
20494 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20495 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20496
20497 * xdisp.c (draw_row_with_mouse_face): Now static.
20498 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20499
20500 * window.h (check_all_windows): Mark externally visible.
20501
20502 * window.c (window_deletion_count): Now static.
20503
20504 * undo.c: Make symbols static if they're not exported.
20505 (last_undo_buffer, last_boundary_position, pending_boundary):
20506 Now static.
20507
20508 * textprop.c (interval_insert_behind_hooks): Now static.
20509 (interval_insert_in_front_hooks): Likewise.
20510
20511 * term.c: Make symbols static if they're not exported.
20512 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20513 (max_frame_lines, tty_set_terminal_modes):
20514 (tty_reset_terminal_modes, tty_turn_off_highlight):
20515 (get_tty_terminal): Now static.
20516 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20517 * termhooks.h (term_mouse_moveto): Do not declare if
20518 HAVE_WINDOW_SYSTEM.
20519 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20520 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20521
20522 * sysdep.c: Make symbols static if they're not exported.
20523 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20524 Now static.
20525 (sigprocmask_set, full_mask): Remove; unused.
20526 (wait_debugging): Mark as visible.
20527 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20528 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20529
20530 * syntax.c (syntax_temp): Define only if !__GNUC__.
20531
20532 * sound.c (current_sound_device, current_sound): Now static.
20533
20534 * search.c (searchbufs, searchbuf_head): Now static.
20535
20536 * scroll.c (scroll_cost): Remove; unused.
20537 * dispextern.h (scroll_cost): Remove decl.
20538
20539 * region-cache.h (pp_cache): Mark as externally visible.
20540
20541 * process.c: Make symbols static if they're not exported.
20542 (process_tick, update_tick, create_process, chan_process):
20543 (Vprocess_alist, proc_buffered_char, datagram_access):
20544 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20545 (deactivate_process): Mark defn as static, as well as decl.
20546 * lisp.h (create_process): Remove decl.
20547 * process.h (chan_process, Vprocess_alist): Remove decls.
20548
20549 * print.c: Make symbols static if they're not exported.
20550 (print_depth, new_backquote_output, being_printed, print_buffer):
20551 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20552 (print_interval, print_number_index, initial_stderr_stream):
20553 Now static.
20554 * lisp.h (Fprinc): Remove decl.
20555 (debug_output_compilation_hack): Mark as externally visible.
20556
20557 * sysdep.c (croak): Move decl from here to syssignal.h.
20558 * syssignal.h (croak): Put it here, so the API can be checked when
20559 'croak' is called from dissociate_if_controlling_tty.
20560
20561 * minibuf.c: Make symbols static if they're not exported.
20562 (minibuf_save_list, choose_minibuf_frame): Now static.
20563 * lisp.h (choose_minibuf_frame): Remove decl.
20564
20565 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20566
20567 * lread.c: Make symbols static if they're not exported.
20568 (read_objects, initial_obarray, oblookup_last_bucket_number):
20569 Now static.
20570 (make_symbol): Remove; unused.
20571 * lisp.h (initial_obarray, make_symbol): Remove decls.
20572
20573 * keyboard.c: Make symbols static if they're not exported.
20574 (single_kboard, recent_keys_index, total_keys, recent_keys):
20575 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20576 (this_single_command_key_start, echoing, last_auto_save):
20577 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20578 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20579 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20580 (Vlispy_mouse_stem, double_click_count):
20581 Now static.
20582 (force_auto_save_soon): Define only if SIGDANGER.
20583 (ignore_mouse_drag_p): Now static if
20584 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20585 (print_help): Remove; unused.
20586 (stop_character, last_timer_event): Mark as externally visible.
20587 * keyboard.h (ignore_mouse_drag_p): Declare only if
20588 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20589 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20590 * lisp.h (echoing): Remove decl.
20591 (force_auto_save_soon): Declare only if SIGDANGER.
20592 * xdisp.c (redisplay_window): Simplify code, to make it more
20593 obvious that ignore_mouse_drag_p is not accessed if !defined
20594 USE_GTK && !defined HAVE_NS.
20595
20596 * intervals.c: Make symbols static if they're not exported.
20597 (merge_properties_sticky, merge_interval_right, delete_interval):
20598 Now static.
20599 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20600
20601 * insdel.c: Make symbols static if they're not exported.
20602 However, leave prepare_to_modify_buffer alone. It's never
20603 called from outside this function, but that appears to be a bug.
20604 (combine_after_change_list, combine_after_change_buffer):
20605 (adjust_after_replace, signal_before_change): Now static.
20606 (adjust_after_replace_noundo): Remove; unused.
20607 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
20608 (signal_before_change): Remove decls.
20609
20610 * indent.c (val_compute_motion, val_vmotion): Now static.
20611
20612 * image.c: Make symbols static if they're not exported.
20613 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20614 if USE_GTK.
20615 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20616 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20617
20618 * fringe.c (standard_bitmaps): Now static.
20619 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20620
20621 * frame.c: Make symbols static if they're not exported.
20622 (x_report_frame_params, make_terminal_frame): Now static.
20623 (get_frame_param): Now static, unless HAVE_NS.
20624 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20625 (x_get_resource_string): Remove; not used.
20626 * frame.h (make_terminal_frame, x_report_frame_params):
20627 (x_get_resource_string); Remove decls.
20628 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20629 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20630
20631 * font.c, fontset.c: Make symbols static if they're not exported.
20632 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20633 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20634 * font.c (font_close_object): Now static.
20635 * font.h (font_close_object): Remove.
20636 * fontset.c (FONTSET_OBJLIST): Remove.
20637 (free_realized_fontset) #if-0 the body, which does nothing.
20638 (face_suitable_for_char_p): #if-0, as it's never called.
20639 * fontset.h (face_suitable_for_char_p): Remove decl.
20640 * xfaces.c (face_at_string_position):
20641 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
20642 since 0 is always ASCII.
20643
20644 * fns.c (weak_hash_tables): Now static.
20645
20646 * fileio.c: Make symbols static if they're not exported.
20647 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20648 (Vwrite_region_annotation_buffers): Now static.
20649
20650 * eval.c: Make symbols static if they're not exported.
20651 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20652 * lisp.h (backtrace_list): Remove decl.
20653
20654 * emacs.c: Make symbols static if they're not exported.
20655 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20656 (fatal_error_code, fatal_error_signal_hook, standard_args):
20657 Now static.
20658 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20659 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20660 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20661 * lisp.h (fatal_error_signal_hook): Remove decl.
20662 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20663
20664 * editfns.c: Move a (normally-unused) function to its only use.
20665 * editfns.c, lisp.h (get_operating_system_release): Remove.
20666 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20667 worth the hassle of breaking this out.
20668
20669 * xterm.c: Make symbols static if they're not exported.
20670 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20671 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20672 (x_destroy_window, x_delete_display):
20673 Now static.
20674 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20675 (x_mouse_leave): Remove; unused.
20676 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20677 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20678 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20679 Remove decls.
20680 (x_mouse_leave): Declare only if WINDOWSNT.
20681 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20682 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20683 USE_X_TOOLKIT.
20684
20685 * ftxfont.c: Make symbols static if they're not exported.
20686 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20687 HAVE_FREETYPE.
20688 * font.h (ftxfont_driver): Likewise.
20689
20690 * xfns.c: Make symbols static if they're not exported.
20691 (x_last_font_name, x_display_info_for_name):
20692 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20693 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20694 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20695 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20696 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20697 (last_show_tip_args): Now static.
20698 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20699 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20700 (x_screen_planes): Remove; unused.
20701 * dispextern.h (x_screen_planes): Remove decl.
20702
20703 * dispnew.c: Make symbols static if they're not exported.
20704 * dispextern.h (redraw_garbaged_frames, scrolling):
20705 (increment_row_positions): Remove.
20706 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20707 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20708 Now static.
20709 (redraw_garbaged_frames): Remove; unused.
20710
20711 * xfaces.c: Make symbols static if they're not exported.
20712 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20713 Remove decls.
20714 * xterm.h (defined_color): Remove decls.
20715 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20716 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20717 (menu_face_changed_default, defined_color, free_realized_face):
20718 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20719 (ascii_face_of_lisp_face): Remove; unused.
20720
20721 * xdisp.c: Make symbols static if they're not exported.
20722 * dispextern.h (scratch_glyph_row, window_box_edges):
20723 (glyph_to_pixel_coords, set_cursor_from_row):
20724 (get_next_display_element, set_iterator_to_next):
20725 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20726 (show_mouse_face): Remove decls
20727 * frame.h (message_buf_print): Likewise.
20728 * lisp.h (pop_message, set_message, check_point_in_composition):
20729 Likewise.
20730 * xterm.h (set_vertical_scroll_bar): Likewise.
20731 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20732 (message_buf_print, scratch_glyph_row, displayed_buffer):
20733 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20734 (get_next_display_element, show_mouse_face, window_box_edges):
20735 (frame_to_window_pixel_xy, check_point_in_composition):
20736 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20737 (glyph_to_pixel_coords): Remove; unused.
20738
20739 * dired.c (file_name_completion): Now static.
20740
20741 * dbusbind.c (xd_in_read_queued_messages): Now static.
20742
20743 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20744 * data.c (circular_list_error): Remove.
20745
20746 * commands.h (last_point_position, last_point_position_buffer):
20747 (last_point_position_window): Remove decls.
20748 * keyboard.c: Make these variables static.
20749
20750 * coding.h (coding, code_convert_region, encode_coding_gap):
20751 Remove decls.
20752 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20753 (iso_code_class, detect_coding, code_convert_region): Now static.
20754 (encode_coding_gap): Remove; unused.
20755
20756 * chartab.c (chartab_chars, chartab_bits): Now static.
20757
20758 * charset.h (charset_iso_8859_1): Remove decl.
20759 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20760 Now static.
20761
20762 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20763 * ccl.c (Vccl_program_table): Now static.
20764 (check_ccl_update): Remove; unused.
20765
20766 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20767 * category.h: ... from here.
20768 * category.c (check_category_table, set_category_set): Now static.
20769
20770 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20771 * lisp.h: Remove these decls.
20772
20773 * buffer.c (buffer_count): Remove unused var.
20774
20775 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20776 so that it's not optimized away.
20777 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20778 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20779 exported only to the debugger.
20780
20781 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
20782 * atimer.h (run_all_atimers): Remove; not exported.
20783
20784 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20785 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20786 was inaccessible from Lisp.
20787 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20788 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20789
20790 alloc.c: Import and export fewer symbols, and remove unused items.
20791 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20792 is defined.
20793 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20794 it's not optimized away by whole-program optimization.
20795 (message_enable_multibyte, free_misc): Remove.
20796 (catchlist, handlerlist, mark_backtrace):
20797 Declare only if BYTE_MARK_STACK.
20798 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20799 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20800 (message_enable_multibyte): Remove decl.
20801 (free_misc, interval_free_list, float_block, float_block_index):
20802 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20803 (cons_free_list, last_marked_index):
20804 Now static.
20805 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20806 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20807 (mark_backtrace): Define only if BYTE_MARK_STACK.
20808 * xdisp.c (message_enable_multibyte): Now static.
20809
20810 Declare Lisp_Object Q* variables to be 'static' if not exported.
20811 This makes it easier for human readers (and static analyzers)
20812 to see whether these variables are used from other modules.
20813 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20814 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20815 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20816 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20817 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20818 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20819 * xmenu.c, xselect.c:
20820 Declare Q* vars static if they are not used in other modules.
20821 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20822 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20823 Remove decls of unexported vars.
20824 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20825
20826 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20827
20828 Make Emacs functions such as Fatom 'static' by default.
20829 This makes it easier for human readers (and static analyzers)
20830 to see whether these functions can be called from other modules.
20831 DEFUN now defines a static function. To make the function external
20832 so that it can be used in other C modules, use the new macro DEFUE.
20833 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20834 (Finit_image_library):
20835 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20836 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20837 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20838 Remove decls, since these functions are now static.
20839 (Funintern, Fget_internal_run_time): New decls, since these functions
20840 were already external.
20841
20842 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20843 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20844 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20845 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20846 * keyboard.c, keymap.c, lread.c:
20847 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20848 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20849 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20850 Mark functions with DEFUE instead of DEFUN,
20851 if they are used in other modules.
20852 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20853 decls for now-static functions.
20854 * buffer.h (Fdelete_overlay): Remove decl.
20855 * callproc.c (Fgetenv_internal): Mark as internal.
20856 * composite.c (Fremove_list_of_text_properties): Remove decl.
20857 (Fcomposition_get_gstring): New forward static decl.
20858 * composite.h (Fcomposite_get_gstring): Remove decl.
20859 * dired.c (Ffile_attributes): New forward static decl.
20860 * doc.c (Fdocumntation_property): New forward static decl.
20861 * eval.c (Ffetch_bytecode): New forward static decl.
20862 (Funintern): Remove extern decl; now in .h file where it belongs.
20863 * fileio.c (Fmake_symbolic_link): New forward static decl.
20864 * image.c (Finit_image_library): New forward static decl.
20865 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20866 * intervals.h (Fprevious_property_change):
20867 (Fremove_list_of_text_properties): Remove decls.
20868 * keyboard.c (Fthis_command_keys): Remove decl.
20869 (Fcommand_execute): New forward static decl.
20870 * keymap.c (Flookup_key): New forward static decl.
20871 (Fcopy_keymap): Now static.
20872 * keymap.h (Flookup_key): Remove decl.
20873 * process.c (Fget_process): New forward static decl.
20874 (Fprocess_datagram_address): Mark as internal.
20875 * syntax.c (Fsyntax_table_p): New forward static decl.
20876 (skip_chars): Remove duplicate decl.
20877 * textprop.c (Fprevious_property_change): New forward static decl.
20878 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20879 Now internal.
20880 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20881 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20882
20883 * editfns.c (Fformat): Remove unreachable code.
20884
20885 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20886
20887 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20888 change. (Bug#8496)
20889
20890 2011-04-13 Eli Zaretskii <eliz@gnu.org>
20891
20892 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20893 when at ZV. (Bug#8487)
20894
20895 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20896
20897 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20898 (Bug#8437)
20899 * keyboard.c (parse_tool_bar_item): Likewise.
20900 * sound.c (sound_cleanup, alsa_close): Likewise.
20901 * termcap.c (tgetent): Likewise.
20902 * xfns.c (x_default_font_parameter): Likewise.
20903 * xsettings.c (read_and_apply_settings): Likewise.
20904
20905 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20906 (overrun_check_free): Protoize.
20907
20908 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20909
20910 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20911 since callers should never pass a negative size.
20912 Change the signature to match that of plain 'read' and 'write'; see
20913 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20914 * lisp.h: Update prototypes of emacs_write and emacs_read.
20915
20916 2011-04-11 Eli Zaretskii <eliz@gnu.org>
20917
20918 * xdisp.c (redisplay_window): Don't try to determine the character
20919 position of the scroll margin if the window start point w->startp
20920 is outside the buffer's accessible region. (Bug#8468)
20921
20922 2011-04-10 Eli Zaretskii <eliz@gnu.org>
20923
20924 Fix write-region and its subroutines for buffers > 2GB.
20925 * fileio.c (a_write, e_write): Modify declaration of arguments and
20926 local variables to support buffers larger than 2GB.
20927 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20928
20929 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20930 argument, local variables, and return value.
20931
20932 * lisp.h: Update prototypes of emacs_write and emacs_read.
20933
20934 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20935
20936 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
20937
20938 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20939
20940 Fix more problems found by GCC 4.6.0's static checks.
20941
20942 * xdisp.c (vmessage): Use a better test for character truncation.
20943
20944 * charset.c (load_charset_map): <, not <=, for optimization,
20945 and to avoid potential problems with integer overflow.
20946 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
20947 * casetab.c (set_identity, shuffle): Likewise.
20948 * editfns.c (Fformat): Likewise.
20949 * syntax.c (skip_chars): Likewise.
20950
20951 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20952 This also lets GCC 4.6.0 generate slightly better loop code.
20953
20954 * callint.c (Fcall_interactively): <, not <=, for optimization.
20955 (Fcall_interactively): Count the number of arguments produced,
20956 not the number of arguments given. This is simpler and lets GCC
20957 4.6.0 generate slightly better code.
20958
20959 * ftfont.c: Distingish more carefully between FcChar8 and char.
20960 The previous code passed unsigned char * to a functions like
20961 strlen and xstrcasecmp that expect char *, which does not
20962 conform to the C standard.
20963 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20964 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20965 char * when the C standard requires it.
20966
20967 * keyboard.c (read_char): Remove unused var.
20968
20969 * eval.c: Port to Windows vsnprintf (Bug#8435).
20970 Include <limits.h>.
20971 (SIZE_MAX): Define if the headers do not.
20972 (verror): Do not give up if vsnprintf returns a negative count.
20973 Instead, grow the buffer. This ports to Windows vsnprintf, which
20974 does not conform to C99. Problem reported by Eli Zaretskii.
20975 Also, simplify the allocation scheme, by avoiding the need for
20976 calling realloc, and removing the ALLOCATED variable.
20977
20978 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20979
20980 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20981 But keep the doprint source code for now, as we might revamp it
20982 and use it again (Bug#8435).
20983 * lisp.h (doprnt): Remove.
20984 * Makefile.in (base_obj): Remove doprnt.o.
20985 * deps.mk (doprnt.o): Remove.
20986
20987 error: Print 32- and 64-bit integers portably (Bug#8435).
20988 Without this change, on typical 64-bit hosts error ("...%d...", N)
20989 was used to print both 32- and 64-bit integers N, which relied on
20990 undefined behavior.
20991 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
20992 * lisp.h (error, verror): Mark as printf-like functions.
20993 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
20994 Report overflow in size calculations when allocating printf buffer.
20995 Do not truncate output string at its first null byte.
20996 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
20997 Truncate the output at a character boundary, since vsnprintf does not
20998 do that.
20999 * charset.c (check_iso_charset_parameter): Convert internal
21000 character to string before calling 'error', since %c now has the
21001 printf meaning.
21002 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21003 overflow when computing char to be passed to 'error'. Do not
21004 pass Lisp_Object to 'error'; pass the integer instead.
21005 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21006 formatted with plain %d.
21007
21008 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21009
21010 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21011
21012 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21013
21014 * xterm.c (x_catch_errors): Remove duplicate declaration.
21015
21016 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21017
21018 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21019
21020 2011-04-10 Jim Meyering <meyering@redhat.com>
21021
21022 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21023 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21024 return ssize_t not "int", and use size_t as the buffer length.
21025 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21026 * gnutls.h: Update declarations.
21027 * process.c (read_process_output): Use ssize_t, to match.
21028 (send_process): Likewise.
21029
21030 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21031
21032 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21033
21034 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21035
21036 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21037 Use unsigned char, to match FcChar8 type definition.
21038
21039 * xterm.c (handle_one_xevent):
21040 * xmenu.c (create_and_show_popup_menu):
21041 * xselect.c (x_decline_selection_request)
21042 (x_reply_selection_request): Avoid type-punned deref of X events.
21043
21044 2011-04-09 Eli Zaretskii <eliz@gnu.org>
21045
21046 Fix some uses of `int' instead of EMACS_INT.
21047 * search.c (string_match_1, fast_string_match)
21048 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21049 (scan_buffer, find_next_newline_no_quit)
21050 (find_before_next_newline, search_command, Freplace_match)
21051 (Fmatch_data): Make some `int' variables be EMACS_INT.
21052
21053 * xdisp.c (display_count_lines): 3rd argument and return value now
21054 EMACS_INT. All callers changed.
21055 (pint2hrstr): Last argument is now EMACS_INT.
21056
21057 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21058 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21059 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21060 (decode_coding_utf_16, decode_coding_emacs_mule)
21061 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21062 (decode_coding_ccl, decode_coding_charset)
21063 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21064 (decode_coding_iso_2022, decode_coding_emacs_mule)
21065 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21066 <char_offset, last_offset>: Declare EMACS_INT.
21067 (encode_coding_utf_8, encode_coding_utf_16)
21068 (encode_coding_emacs_mule, encode_invocation_designation)
21069 (encode_designation_at_bol, encode_coding_iso_2022)
21070 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21071 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21072 Declare EMACS_INT.
21073 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21074 (encode_invocation_designation): Last argument P_NCHARS is now
21075 EMACS_INT.
21076 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21077 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21078
21079 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21080 All users changed.
21081
21082 * ccl.c (Fccl_execute_on_string): Declare some variables
21083 EMACS_INT.
21084
21085 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
21086
21087 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21088
21089 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21090
21091 * process.c (Fformat_network_address): Doc fix.
21092
21093 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21094
21095 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21096
21097 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
21098
21099 * keyboard.c (read_char): Call Lisp function help-form-show,
21100 instead of using internal_with_output_to_temp_buffer.
21101 (Qhelp_form_show): New var.
21102 (syms_of_keyboard): Use DEFSYM macro.
21103
21104 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21105
21106 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21107
21108 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
21109
21110 * process.c (Flist_processes): Remove to Lisp.
21111 (list_processes_1): Delete.
21112
21113 2011-04-06 Eli Zaretskii <eliz@gnu.org>
21114
21115 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21116
21117 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21118
21119 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
21120
21121 Fix more problems found by GCC 4.6.0's static checks.
21122
21123 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21124
21125 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21126
21127 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21128
21129 * xdisp.c (vmessage): Mark as a printf-like function.
21130
21131 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21132
21133 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21134
21135 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21136 printf-like functions.
21137 (tiff_load): Add casts to remove these marks before passing them
21138 to system-supplied API.
21139
21140 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21141
21142 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21143 This avoids several warnings with gcc -Wstrict-overflow.
21144 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21145 directly, rather than having caller test rule sign. This avoids
21146 some unnecessary tests.
21147 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21148 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21149 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21150
21151 * xfont.c (xfont_text_extents): Remove var that was set but not used.
21152 (xfont_open): Avoid unnecessary tests.
21153
21154 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21155
21156 * composite.h, composite.c (composition_gstring_put_cache):
21157 Use EMACS_INT, not int, for length.
21158
21159 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21160 breaking out part of COMPOSITION_DECODE_RULE.
21161 (COMPOSITION_DECODE_RULE): Use it.
21162 * composite.c (get_composition_id): Remove unused local vars,
21163 by using the new macro.
21164
21165 * textprop.c (set_text_properties_1): Change while to do-while,
21166 since the condition is always true at first.
21167
21168 * intervals.c (graft_intervals_into_buffer): Mark var as used.
21169 (interval_deletion_adjustment): Return unsigned value.
21170 All uses changed.
21171
21172 * process.c (list_processes_1, create_pty, read_process_output):
21173 (exec_sentinel): Remove vars that were set but not used.
21174 (create_pty): Remove unnecessary "volatile"s.
21175 (Fnetwork_interface_info): Avoid possibility of int overflow.
21176 (read_process_output): Do adaptive read buffering even if carryover.
21177 (read_process_output): Simplify nbytes computation if buffered.
21178
21179 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21180
21181 * syntax.c (scan_words): Remove var that was set but not used.
21182 (update_syntax_table): Use unsigned instead of int.
21183
21184 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21185 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21186 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21187
21188 * print.c (print_error_message): Avoid int overflow.
21189
21190 * font.c (font_list_entities): Redo for clarity,
21191 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21192
21193 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21194 (font_score): Avoid potential overflow in diff calculation.
21195
21196 * fns.c (substring_both): Remove var that is set but not used.
21197 (sxhash): Redo loop for clarity and to avoid wraparound warning.
21198
21199 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21200
21201 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21202 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21203 can always succeed if overflow has undefined behavior.
21204
21205 * search.c (boyer_moore, wordify): Remove vars set but not used.
21206 (wordify): Omit three unnecessary tests.
21207
21208 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21209 All callers changed. This avoids the need for an unused var.
21210
21211 * casefiddle.c (casify_region): Remove var that is set but not used.
21212
21213 * dired.c (file_name_completion): Remove var that is set but not used.
21214
21215 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21216
21217 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
21218 (Finsert_file_contents): Remove unnecessary code checking fd.
21219
21220 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21221 Check for integer overflow on size calculations.
21222
21223 * buffer.c (Fprevious_overlay_change): Remove var that is set
21224 but not used.
21225
21226 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21227 Remove vars that are set but not used.
21228 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
21229 (timer_check_2): Mark vars as initialized.
21230
21231 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21232
21233 * image.c (lookup_image): Remove var that is set but not used.
21234 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
21235
21236 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21237 that are set but not used.
21238
21239 * xfns.c (make_invisible_cursor): Don't return garbage
21240 if XCreateBitmapFromData fails (Bug#8410).
21241
21242 * xselect.c (x_get_local_selection, x_handle_property_notify):
21243 Remove vars that are set but not used.
21244
21245 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
21246 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
21247
21248 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21249 Remove var that is set but not used.
21250 (scroll_bar_windows_size): Now size_t, not int.
21251 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21252 Check for overflow.
21253
21254 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21255 (map_tty_color) [!defined MSDOS]: Likewise.
21256
21257 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21258
21259 * coding.c: Remove vars that are set but not used.
21260 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21261 All callers changed.
21262 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21263 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21264 (decode_coding_charset): Remove vars that are set but not used.
21265
21266 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21267 that is set but not used.
21268
21269 * print.c (print_object): Remove var that is set but not used.
21270
21271 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
21272 The gnulib version avoids calling malloc in the usual case,
21273 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21274 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21275 * filelock.c (current_lock_owner): Likewise.
21276 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21277 * sysdep.c: Include allocator.h, careadlinkat.h.
21278 (emacs_no_realloc_allocator): New static constant.
21279 (emacs_readlink): New function.
21280 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21281 ../lib/careadlinkat.h.
21282
21283 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21284
21285 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21286 first non-nil return value).
21287
21288 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21289
21290 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21291 if not defined (Bug#8403).
21292
21293 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21294
21295 * xdisp.c (display_count_lines): Remove parameter `start',
21296 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21297 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21298 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21299 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21300 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21301 and thereabouts. All callers changed.
21302 (get_per_char_metric): Remove parameter `f', unused since
21303 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21304
21305 2011-04-02 Jim Meyering <meyering@redhat.com>
21306
21307 do not dereference NULL upon failed strdup
21308 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21309 (ns_get_family): Likewise.
21310
21311 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21312
21313 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21314
21315 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21316
21317 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21318 later (Bug#8403).
21319
21320 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21321
21322 Add lexical binding.
21323
21324 * window.c (Ftemp_output_buffer_show): New fun.
21325 (Fsave_window_excursion):
21326 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21327
21328 * lread.c (lisp_file_lexically_bound_p): New function.
21329 (Fload): Bind Qlexical_binding.
21330 (readevalloop): Remove `evalfun' arg.
21331 Bind Qinternal_interpreter_environment.
21332 (Feval_buffer): Bind Qlexical_binding.
21333 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21334 Mark as dynamic.
21335 (syms_of_lread): Declare `lexical-binding'.
21336
21337 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21338
21339 * keyboard.c (eval_dyn): New fun.
21340 (menu_item_eval_property): Use it.
21341
21342 * image.c (parse_image_spec): Use Ffunctionp.
21343
21344 * fns.c (concat, mapcar1): Accept byte-code-functions.
21345
21346 * eval.c (Fsetq): Handle lexical vars.
21347 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21348 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21349 (FletX, Flet): Obey lexical binding.
21350 (Fcommandp): Handle closures.
21351 (Feval): New `lexical' arg.
21352 (eval_sub): New function extracted from Feval. Use it almost
21353 everywhere where Feval was used. Look up vars in lexical env.
21354 Handle closures.
21355 (Ffunctionp): Move from subr.el.
21356 (Ffuncall): Handle closures.
21357 (apply_lambda): Remove `eval_flags'.
21358 (funcall_lambda): Handle closures and new byte-code-functions.
21359 (Fspecial_variable_p): New function.
21360 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21361 but without exporting it to Lisp.
21362
21363 * doc.c (Fdocumentation, store_function_docstring):
21364 * data.c (Finteractive_form): Handle closures.
21365
21366 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21367 interactive spec.
21368
21369 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21370 New byte-codes.
21371 (exec_byte_code): New function extracted from Fbyte_code to handle new
21372 calling convention for byte-code-functions. Add new byte-codes.
21373
21374 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
21375
21376 * alloc.c (Fmake_symbol): Init new `declared_special' field.
21377
21378 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21379
21380 * xdisp.c (redisplay_internal): Fix prototype.
21381
21382 2011-03-31 Eli Zaretskii <eliz@gnu.org>
21383
21384 * xdisp.c (SCROLL_LIMIT): New macro.
21385 (try_scrolling): Use it when setting scroll_limit.
21386 Limit scrolling to 100 screen lines.
21387 (redisplay_window): Even when falling back on "recentering",
21388 position point in the window according to scroll-conservatively,
21389 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21390
21391 (try_scrolling): When point is above the window, allow searching
21392 as far as scroll_max, or one screenful, to compute vertical
21393 distance from PT to the scroll margin position. This prevents
21394 try_scrolling from unnecessarily failing when
21395 scroll-conservatively is set to a value slightly larger than the
21396 window height. Clean up the case of PT below the margin at bottom
21397 of window: scroll_max can no longer be INT_MAX. When aggressive
21398 scrolling is in use, don't let point enter the opposite scroll
21399 margin as result of the scroll.
21400 (syms_of_xdisp) <scroll-conservatively>: Document the
21401 threshold of 100 lines for never-recentering scrolling.
21402
21403 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21404
21405 * dispextern.h (move_it_by_lines):
21406 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21407 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21408 (message_log_check_duplicate): Remove parameters `prev_bol' and
21409 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21410 (redisplay_internal): Remove parameter `preserve_echo_area',
21411 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21412
21413 * indent.c (Fvertical_motion):
21414 * window.c (window_scroll_pixel_based, Frecenter):
21415 Don't pass `need_y_p' to `move_it_by_lines'.
21416
21417 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21418
21419 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21420 steal a few bits to be more compact.
21421 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21422 Remove unneeded casts.
21423
21424 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21425
21426 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21427
21428 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21429 binding" message (bug#7967).
21430
21431 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21432
21433 Fix more problems found by GCC 4.6.0's static checks.
21434
21435 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21436 Remove unused local var.
21437
21438 * editfns.c (Fmessage_box): Remove unused local var.
21439
21440 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21441 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21442 Omit unused local vars.
21443 * window.c (shrink_windows): Omit unused local var.
21444 * menu.c (digest_single_submenu): Omit unused local var.
21445 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21446 Omit unused local var.
21447
21448 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21449 Don't assume string length fits in int.
21450 (keyremap_step, read_key_sequence): Use size_t for sizes.
21451 (read_key_sequence): Don't check last_real_key_start redundantly.
21452
21453 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21454 instead of alloca (Bug#8344).
21455
21456 * eval.c (Fbacktrace): Don't assume nargs fits in int.
21457 (Fbacktrace_frame): Don't assume nframes fits in int.
21458
21459 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21460
21461 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21462 concerns.
21463
21464 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21465
21466 * cm.c (calccost): Turn while-do into do-while, for clarity.
21467
21468 * keyboard.c (syms_of_keyboard): Use the same style as later
21469 in this function when indexing through an array. This also
21470 works around GCC bug 48267.
21471
21472 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21473
21474 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21475
21476 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21477 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21478
21479 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21480 This avoids undefined behavior on integer overflow, and is a bit
21481 more convenient anyway since it is compared to a size_t variable.
21482
21483 Variadic C functions now count arguments with size_t, not int.
21484 This avoids an unnecessary limitation on 64-bit machines, which
21485 caused (substring ...) to crash on large vectors (Bug#8344).
21486 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21487 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21488 All variadic functions and their callers changed accordingly.
21489 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21490 * data.c (arith_driver, float_arith_driver): Likewise.
21491 * editfns.c (general_insert_function): Likewise.
21492 * eval.c (struct backtrace.nargs, interactive_p)
21493 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21494 (funcall_lambda, mark_backtrace): Likewise.
21495 * fns.c (concat): Likewise.
21496 * frame.c (x_set_frame_parameters): Likewise.
21497 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21498 0 if not found, not -1. All callers changed.
21499
21500 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21501 (stack_copy_size): Now size_t, not int.
21502 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21503
21504 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21505
21506 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21507 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21508 All callers changed.
21509
21510 * lisp.h (multibyte_char_to_unibyte):
21511 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21512 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21513 * character.h (CHAR_TO_BYTE8):
21514 * cmds.c (internal_self_insert):
21515 * editfns.c (general_insert_function):
21516 * keymap.c (push_key_description):
21517 * search.c (Freplace_match):
21518 * xdisp.c (message_dolog, set_message_1): All callers changed.
21519
21520 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21521
21522 * keyboard.c (safe_run_hook_funcall): New function.
21523 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21524 don't set the hook to nil, but remove the offending function instead.
21525 (Qcommand_hook_internal): Remove, unused.
21526 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21527 Vcommand_hook_internal.
21528
21529 * eval.c (enum run_hooks_condition): Remove.
21530 (funcall_nil, funcall_not): New functions.
21531 (run_hook_with_args): Call each function through a `funcall' argument.
21532 Remove `cond' argument, now redundant.
21533 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21534 (Frun_hook_with_args_until_failure): Adjust accordingly.
21535 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21536
21537 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21538
21539 * dispextern.h (string_buffer_position): Remove declaration.
21540
21541 * print.c (strout): Remove parameter `multibyte', unused since
21542 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21543
21544 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21545 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21546 All callers changed.
21547
21548 * w32.c (_wsa_errlist): Use braces for struct initializers.
21549
21550 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21551 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21552 All callers changed.
21553 (string_buffer_position): Likewise. Also, make static (it's never
21554 used outside xdisp.c).
21555 (cursor_row_p): Remove parameter `w', unused since
21556 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21557 (decode_mode_spec): Remove parameter `precision', introduced during
21558 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21559 All callers changed.
21560
21561 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21562
21563 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21564
21565 2011-03-27 Anders Lindgren <andlind@gmail.com>
21566
21567 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21568 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21569 (ns_update_auto_hide_menu_bar): New functions.
21570 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21571 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21572 ns_constrain_all_frames.
21573 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21574 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21575
21576 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21577
21578 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21579
21580 2011-03-27 Glenn Morris <rgm@gnu.org>
21581
21582 * syssignal.h: Replace RETSIGTYPE with void.
21583 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21584 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21585 Replace SIGTYPE with void everywhere.
21586 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21587 * s/template.h (SIGTYPE): Remove commented out definition.
21588
21589 2011-03-26 Eli Zaretskii <eliz@gnu.org>
21590
21591 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21592 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21593
21594 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
21595
21596 * w32.c (read_unc_volume): Use parameter `henum', instead of
21597 global variable `wget_enum_handle'.
21598
21599 * keymap.c (describe_vector): Remove parameters `indices' and
21600 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21601 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21602
21603 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21604
21605 * keyboard.c (timer_check): Remove parameter `do_it_now',
21606 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21607 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21608 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21609
21610 * keyboard.c (read_char):
21611 * w32menu.c (w32_menu_display_help):
21612 * xmenu.c (show_help_event, menu_help_callback):
21613 Adjust calls to `show_help_echo'.
21614
21615 * gtkutil.c (xg_maybe_add_timer):
21616 * keyboard.c (readable_events):
21617 * process.c (wait_reading_process_output):
21618 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21619
21620 * insdel.c (adjust_markers_gap_motion):
21621 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21622 (gap_left, gap_right): Don't call it.
21623
21624 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
21625
21626 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21627 incurred during fontification.
21628
21629 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21630
21631 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21632 (DEFVAR_PER_BUFFER): Don't pass it.
21633
21634 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21635 (scrolling_window): Don't pass it.
21636
21637 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21638
21639 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21640
21641 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21642 and `suffix'.
21643 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21644 of variables specific to SELinux and computation of `encoded_absname'.
21645
21646 * image.c (XPutPixel): Remove unused variable `height'.
21647
21648 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21649
21650 * unexw32.c (get_section_info): Remove unused variable `section'.
21651
21652 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21653 (system_process_attributes): Remove unused variable `sess'.
21654 (sys_read): Remove unused variable `err'.
21655
21656 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21657 (w32_wnd_proc): Remove unused variable `isdead'.
21658 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21659 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21660 (x_create_tip_frame): Remove unused variable `tem'.
21661
21662 * w32inevt.c (w32_console_read_socket):
21663 Remove unused variable `no_events'.
21664
21665 * w32term.c (x_draw_composite_glyph_string_foreground):
21666 Remove unused variable `width'.
21667
21668 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
21669
21670 * w32term.c (x_set_glyph_string_clipping):
21671 Don't pass uninitialized region to CombineRgn.
21672
21673 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
21674
21675 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21676 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21677 (Fx_close_connection): Remove unused variable `i'.
21678
21679 * w32font.c (w32font_draw): Return number of glyphs.
21680 (w32font_open_internal): Remove unused variable `i'.
21681 (w32font_driver): Add missing initializer.
21682
21683 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21684 (fill_in_menu): Remove unused variable `items_added'.
21685
21686 * w32term.c (last_mouse_press_frame): Remove static global variable.
21687 (w32_clip_to_row): Remove unused variable `f'.
21688 (x_delete_terminal): Remove unused variable `i'.
21689
21690 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21691 (NOTHING): Remove unused static global variable.
21692 (uniscribe_check_otf): Remove unused variable `table'.
21693 (uniscribe_font_driver): Add missing initializers.
21694
21695 2011-03-23 Julien Danjou <julien@danjou.info>
21696
21697 * term.c (Fsuspend_tty, Fresume_tty):
21698 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21699 * window.c (temp_output_buffer_show):
21700 * insdel.c (signal_before_change):
21701 * frame.c (Fhandle_switch_frame):
21702 * fileio.c (Fdo_auto_save):
21703 * emacs.c (Fkill_emacs):
21704 * editfns.c (save_excursion_restore):
21705 * cmds.c (internal_self_insert):
21706 * callint.c (Fcall_interactively):
21707 * buffer.c (Fkill_all_local_variables):
21708 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21709 Use Frun_hooks.
21710 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
21711 unconditionally since it does the check itself.
21712
21713 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
21714
21715 Fix more problems found by GCC 4.5.2's static checks.
21716
21717 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21718 the first time through the loop, since we know p0 < p1 then.
21719 This also avoids a gcc -Wstrict-overflow warning.
21720
21721 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21722 leading to a memory leak, possible in functions like
21723 load_charset_map_from_file that can allocate an unbounded number
21724 of objects (Bug#8318).
21725
21726 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21727 that could (at least in theory) be that large.
21728
21729 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21730 This is less likely to overflow, and avoids undefined behavior if
21731 overflow does occur. All callers changed. Use strtoul to scan
21732 for the unsigned long integer.
21733 (pint2hrstr): Simplify and tune code slightly.
21734 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
21735
21736 * scroll.c (do_scrolling): Work around GCC bug 48228.
21737 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21738
21739 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21740 This also avoids a warning with gcc -Wstrict-overflow.
21741 (validate_x_resource_name): Simplify count usage.
21742 This also avoids a warning with gcc -Wstrict-overflow.
21743
21744 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21745 fail (Bug#8306).
21746
21747 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
21748
21749 * process.c (Fmake_network_process): Use socklen_t, not int,
21750 where POSIX says socklen_t is required in portable programs.
21751 This fixes a porting bug on hosts like 64-bit HP-UX, where
21752 socklen_t is wider than int (Bug#8277).
21753 (Fmake_network_process, server_accept_connection):
21754 (wait_reading_process_output, read_process_output):
21755 Likewise.
21756
21757 * process.c: Rename or move locals to avoid shadowing.
21758 (list_processes_1, Fmake_network_process):
21759 (read_process_output_error_handler, exec_sentinel_error_handler):
21760 Rename or move locals.
21761 (Fmake_network_process): Define label "retry_connect" only if needed.
21762 (Fnetwork_interface_info): Fix pointer signedness.
21763 (process_send_signal): Add cast to avoid pointer signedness problem.
21764 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
21765 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
21766
21767 Make tparam.h and terminfo.c consistent.
21768 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21769 Include tparam.h instead, since it declares them.
21770 * cm.h (PC): Remove extern decl; tparam.h now does this.
21771 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21772 * terminfo.c: Include tparam.h, to check interfaces.
21773 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21774 (tparam): Adjust signature to match interface in tparam.h;
21775 this removes some undefined behavior. Check that outstring and len
21776 are zero, which they always are with Emacs.
21777 * tparam.h (PC, BC, UP): New extern decls.
21778
21779 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
21780 (xftfont_open): Rename locals to avoid shadowing.
21781
21782 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
21783 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21784 (OTF_TAG_SYM): Omit macro if not needed.
21785 (ftfont_list): Remove unused local.
21786 (get_adstyle_property, ftfont_pattern_entity):
21787 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21788 Rename locals to avoid shadowing.
21789
21790 * xfont.c (xfont_list_family): Mark var as initialized.
21791
21792 * xml.c (make_dom): Now static.
21793
21794 * composite.c (composition_compute_stop_pos): Rename local to
21795 avoid shadowing.
21796 (composition_reseat_it): Remove unused locals.
21797 (find_automatic_composition, composition_adjust_point): Likewise.
21798 (composition_update_it): Mark var as initialized.
21799 (find_automatic_composition): Mark vars as initialized,
21800 with a FIXME (Bug#8290).
21801
21802 character.h: Rename locals to avoid shadowing.
21803 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21804 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21805 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21806 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21807 to avoid shadowing.
21808
21809 * textprop.c (property_change_between_p): Remove; unused.
21810
21811 * intervals.c (interval_start_pos): Now static.
21812
21813 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21814
21815 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21816 Rename locals to avoid shadowing.
21817
21818 * sound.c (wav_play, au_play, Fplay_sound_internal):
21819 Fix pointer signedness.
21820 (alsa_choose_format): Remove unused local var.
21821 (wav_play): Initialize a variable to 0, to prevent undefined
21822 behavior (Bug#8278).
21823
21824 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21825
21826 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21827
21828 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21829 clobbering (Bug#8298).
21830 * sysdep.c (sys_subshell): Likewise.
21831 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
21832
21833 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21834 This should get cleaned up, so that child_setup has the
21835 same signature on all platforms.
21836
21837 * callproc.c (call_process_cleanup): Now static.
21838 (relocate_fd): Rename locals to avoid shadowing.
21839
21840 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
21841
21842 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21843 not to be necessary, and produces flickering.
21844
21845 2011-03-20 Glenn Morris <rgm@gnu.org>
21846
21847 * config.in: Remove file.
21848
21849 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
21850
21851 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21852 are now in src/globals.h.
21853 (syms_of_minibuf): Remove spurious & from previous change.
21854
21855 2011-03-20 Leo Liu <sdl.web@gmail.com>
21856
21857 * minibuf.c (completing-read-function): New variable.
21858 (completing-read-default): Rename from completing-read.
21859 (completing-read): Call completing-read-function.
21860
21861 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21862
21863 * xfaces.c (Fx_load_color_file):
21864 Read color file from absolute filename (bug#8250).
21865
21866 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21867
21868 * makefile.w32-in: Update dependencies.
21869
21870 2011-03-17 Eli Zaretskii <eliz@gnu.org>
21871
21872 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21873
21874 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21875
21876 Fix more problems found by GCC 4.5.2's static checks.
21877
21878 * process.c (make_serial_process_unwind, send_process_trap):
21879 (sigchld_handler): Now static.
21880
21881 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21882 That way, the code declares only the vars that it needs.
21883 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21884 * s/cygwin.h (PTY_ITERATION): Likewise.
21885 * s/darwin.h (PTY_ITERATION): Likewise.
21886 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21887
21888 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21889 * process.c (allocate_pty): Don't declare stb unless it's needed.
21890
21891 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
21892 (CONSTANTLIM): Remove; unused.
21893 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21894 Define only if needed.
21895
21896 * unexelf.c (unexec): Name an expression,
21897 to avoid gcc -Wbad-function-cast warning.
21898 Use a different way to cause a compilation error if anyone uses
21899 n rather than nn, a way that does not involve shadowing.
21900 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
21901
21902 * deps.mk (unexalpha.o): Remove; unused.
21903
21904 New file unexec.h, the (simple) interface for unexec (Bug#8267).
21905 * unexec.h: New file.
21906 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21907 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21908 Depend on unexec.h.
21909 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21910 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21911 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
21912 Change as necessary to match prototype in unexec.h.
21913
21914 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21915 shadowing.
21916 (back_comment, skip_chars): Mark vars as initialized.
21917
21918 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21919 Rename locals to avoid shadowing.
21920
21921 * lread.c (read1): Rewrite so as not to use empty "else".
21922 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
21923
21924 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21925
21926 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21927 warning when compiling print.c.
21928
21929 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21930 instead of using an uninitialized var.
21931 (font_sort_entities): Mark var as initialized.
21932
21933 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21934
21935 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21936 pointers to constants.
21937 (font_parse_fcname): Remove unused vars.
21938 (font_delete_unmatched): Now static.
21939 (font_get_spec): Remove; unused.
21940 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21941 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21942 Rename or move locals to avoid shadowing.
21943
21944 * fns.c (require_nesting_list, require_unwind): Now static.
21945 (Ffillarray): Rename locals to avoid shadowing.
21946
21947 * floatfns.c (domain_error2): Define only if needed.
21948 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
21949
21950 * alloc.c (mark_backtrace): Move decl from here ...
21951 * lisp.h: ... to here, so that it can be checked.
21952
21953 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
21954 (Fdefvar): Rewrite so as not to use empty "else".
21955 (lisp_indirect_variable): Name an expression,
21956 to avoid gcc -Wbad-function-cast warning.
21957 (Fdefvar): Rename locals to avoid shadowing.
21958
21959 * callint.c (quotify_arg, quotify_args): Now static.
21960 (Fcall_interactively): Rename locals to avoid shadowing.
21961 Use const pointer when appropriate.
21962
21963 * lisp.h (get_system_name, get_operating_system_release):
21964 Move decls here, to check interfaces.
21965 * process.c (get_operating_system_release): Move decl to lisp.h.
21966 * xrdb.c (get_system_name): Likewise.
21967 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21968 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21969 some of which prompt warnings from gcc -Wbad-function-cast.
21970 (Fformat_time_string, Fencode_time, Finsert_char):
21971 (Ftranslate_region_internal, Fformat):
21972 Rename or remove local vars to avoid shadowing.
21973 (Ftranslate_region_internal): Mark var as initialized.
21974
21975 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21976 avoid shadowing.
21977
21978 * lisp.h (eassert): Check that the argument compiles, even if
21979 ENABLE_CHECKING is not defined.
21980
21981 * data.c (Findirect_variable): Name an expression, to avoid
21982 gcc -Wbad-function-cast warning.
21983 (default_value, arithcompare, arith_driver, arith_error): Now static.
21984 (store_symval_forwarding): Rename local to avoid shadowing.
21985 (Fmake_variable_buffer_local, Fmake_local_variable):
21986 Mark variables as initialized.
21987 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
21988
21989 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
21990 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
21991 Rename locals to avoid shadowing.
21992 (mark_stack): Move local variables into the #ifdef region where
21993 they're used.
21994 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
21995 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
21996 needed otherwise.
21997 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
21998 (GC_STRING_CHARS): Remove; not used.
21999 (Fmemory_limit): Cast sbrk's returned value to char *.
22000
22001 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22002 avoids undefined behavior in theory.
22003
22004 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22005
22006 Use functions, not macros, for up- and down-casing (Bug#8254).
22007 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22008 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22009 to use the following functions instead of these macros.
22010 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22011 EMACS_INT, since callers assume the returned value fits in int.
22012 (upcase1): Likewise, for UPCASE_TABLE.
22013 (uppercasep, lowercasep, upcase): New static inline functions.
22014 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22015 the race-condition problem in the old DOWNCASE.
22016
22017 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22018 Rename locals to avoid shadowing.
22019 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22020 (regex_compile, re_search_2, re_match_2_internal):
22021 Remove unused local vars.
22022 (FREE_VAR): Rewrite so as not to use empty "else",
22023 which gcc can warn about.
22024 (regex_compile, re_match_2_internal): Mark locals as initialized.
22025 (RETALLOC_IF): Define only if needed.
22026 (WORDCHAR_P): Likewise. This one is never needed, but is used
22027 only in a comment talking about a compiler bug, so put inside
22028 the #if 0 of that comment.
22029 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22030 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22031 Remove; unused.
22032
22033 * search.c (boyer_moore): Rename locals to avoid shadowing.
22034 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22035 (PREV_CHAR_BOUNDARY): Likewise.
22036
22037 * search.c (simple_search): Remove unused var.
22038
22039 * dired.c (compile_pattern): Move decl from here ...
22040 * lisp.h: ... to here, so that it can be checked.
22041 (struct re_registers): New forward decl.
22042
22043 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22044
22045 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22046 All uses changed.
22047 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22048 Rename locals to avoid shadowing.
22049 (Fvertical_motion): Mark locals as initialized.
22050
22051 * casefiddle.c (casify_object, casify_region): Now static.
22052 (casify_region): Mark local as initialized.
22053
22054 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22055
22056 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22057 New macros, so that the caller can use some names other than
22058 gcpro1, gcpro2, etc.
22059 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22060 of the new macros.
22061 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22062 argument, for consistency with GCPRO2_VAR, etc: it is now the
22063 prefix of the variable, not the variable itself. All uses
22064 changed.
22065 * dired.c (directory_files_internal, file_name_completion):
22066 Rename locals to avoid shadowing.
22067
22068 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22069 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22070 dired.c's scmp function, had undefined behavior.
22071 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22072 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22073 * buffer.h: ... to here, because these macros use current_buffer,
22074 and the new implementation with inline functions needs to have
22075 current_buffer in scope now, rather than later when the macros
22076 are used.
22077 (downcase, upcase1): New static inline functions.
22078 (DOWNCASE, UPCASE1): Reimplement using these functions.
22079 This avoids undefined behavior in expressions like
22080 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22081 from race conditions in accessing the global variables
22082 case_temp1 and case_temp2.
22083 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22084 * lisp.h (case_temp1, case_temp2): Remove their decls.
22085 * character.h (ASCII_CHAR_P): Move from here ...
22086 * lisp.h: ... to here, so that the inline functions mentioned
22087 above can use them.
22088
22089 * dired.c (directory_files_internal_unwind): Now static.
22090
22091 * fileio.c (file_name_as_directory, directory_file_name):
22092 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22093 Now static.
22094 (file_name_as_directory): Use const pointers when appropriate.
22095 (Fexpand_file_name): Likewise. In particular, newdir might
22096 point at constant storage, so make it a const pointer.
22097 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22098 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22099 signedness issues.
22100 (Fset_file_times, Finsert_file_contents, auto_save_error):
22101 Rename locals to avoid shadowing.
22102
22103 * minibuf.c (choose_minibuf_frame_1): Now static.
22104 (Ftry_completion, Fall_completions): Rename or remove locals
22105 to avoid shadowing.
22106
22107 * marker.c (bytepos_to_charpos): Remove; unused.
22108
22109 * lisp.h (verify_bytepos, count_markers): New decls,
22110 so that gcc does not warn that these functions aren't declared.
22111
22112 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22113 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22114 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22115 (copy_text): Remove unused local var.
22116
22117 * filelock.c (within_one_second): Now static.
22118 (lock_file_1): Rename local to avoid shadowing.
22119
22120 * buffer.c (fix_overlays_before): Mark locals as initialized.
22121 (fix_start_end_in_overlays): Likewise. This function should be
22122 simplified by using pointers-to-pointers, but that's a different
22123 matter.
22124 (switch_to_buffer_1): Now static.
22125 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22126 (report_overlay_modification): Rename locals to avoid shadowing.
22127
22128 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22129 Fix pointer signedness issue.
22130 (sys_subshell): Mark local as volatile if checking for lint,
22131 to suppress a gcc -Wclobbered warning that does not seem to be right.
22132 (MAXPATHLEN): Define only if needed.
22133
22134 * process.c (serial_open, serial_configure): Move decls from here ...
22135 * systty.h: ... to here, so that they can be checked.
22136
22137 * fns.c (get_random, seed_random): Move extern decls from here ...
22138 * lisp.h: ... to here, so that they can be checked.
22139
22140 * sysdep.c (reset_io): Now static.
22141 (wait_for_termination_signal): Remove; unused.
22142
22143 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22144 (copy_keymap_item, append_key, push_text_char_description):
22145 Now static.
22146 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22147 (DENSE_TABLE_SIZE): Remove; unused.
22148 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22149 (describe_map_tree):
22150 Rename locals to avoid shadowing.
22151
22152 * keyboard.c: Declare functions static if they are not used elsewhere.
22153 (echo_char, echo_dash, cmd_error, top_level_2):
22154 (poll_for_input, handle_async_input): Now static.
22155 (read_char, kbd_buffer_get_event, make_lispy_position):
22156 (make_lispy_event, make_lispy_movement, apply_modifiers):
22157 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22158 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22159 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22160 (read_key_sequence, read_char): Mark locals as initialized.
22161 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22162
22163 * keyboard.h (make_ctrl_char): New decl.
22164 (mark_kboards): Move decl here ...
22165 * alloc.c (mark_kboards): ... from here.
22166
22167 * lisp.h (force_auto_save_soon): New decl.
22168
22169 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22170 (DEFINE_DUMMY_FUNCTION): New macro.
22171 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22172 Use it.
22173 (main): Add casts to avoid warnings
22174 if GCC considers string literals to be constants.
22175
22176 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22177
22178 * dbusbind.c: Pointer signedness fixes.
22179 (xd_signature, xd_append_arg, xd_initialize):
22180 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22181 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22182 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22183 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22184
22185 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22186 if GCC considers string literals to be constants.
22187 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22188
22189 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22190
22191 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22192 (print_preprocess, print_object): New macro to fix last change.
22193
22194 * print.c (print_preprocess): Don't forget font objects.
22195
22196 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
22197
22198 * emacs.c (USAGE3): Doc fixes.
22199
22200 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22201
22202 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22203 structure.
22204
22205 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
22206
22207 * lisp.h (VWindow_system, Qfile_name_history):
22208 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22209 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22210 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22211
22212 * w32select.c: Don't #include "keyboard.h".
22213 (run_protected): Add extern declaration for waiting_for_input.
22214
22215 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22216 * w32console.c (detect_input_pending, read_input_pending)
22217 (encode_terminal_code):
22218 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22219 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22220 (w32_system_caret_y, Qfile_name_history):
22221 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22222 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22223 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22224 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22225 * w32proc.c (Qlocal, report_file_error):
22226 * w32term.c (Vwindow_system, updating_frame):
22227 * w32uniscribe.c (initialized, uniscribe_font_driver):
22228 Remove unneeded extern declarations.
22229
22230 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
22231
22232 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
22233
22234 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
22235
22236 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22237 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22238 These macros can no longer be used for assignment.
22239
22240 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22241 Assign struct members directly, instead of using BUF_BEGV etc.
22242 (record_buffer_markers, fetch_buffer_markers): New functions for
22243 recording and fetching special buffer markers.
22244 (set_buffer_internal_1, set_buffer_temp): Use them.
22245
22246 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22247
22248 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22249
22250 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22251 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22252
22253 * xdisp.c (hscroll_window_tree):
22254 (reconsider_clip_changes): Use PT instead of BUF_PT.
22255
22256 2011-03-13 Eli Zaretskii <eliz@gnu.org>
22257
22258 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22259 $(EMACS_ROOT)/lib/intprops.h.
22260
22261 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22262
22263 Fix more problems found by GCC 4.5.2's static checks.
22264
22265 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22266 to unsigned char * to avoid compiler diagnostic.
22267 (xg_free_frame_widgets): Make it clear that a local variable is
22268 needed only if USE_GTK_TOOLTIP.
22269 (gdk_window_get_screen): Make it clear that this macro is needed
22270 only if USE_GTK_TOOLTIP.
22271 (int_gtk_range_get_value): New function, which avoids a diagnostic
22272 from gcc -Wbad-function-cast.
22273 (xg_set_toolkit_scroll_bar_thumb): Use it.
22274 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22275 diagnostic from gcc -Wbad-function-cast.
22276 (get_utf8_string, xg_get_file_with_chooser):
22277 Rename locals to avoid shadowing.
22278 (create_dialog): Move locals to avoid shadowing.
22279
22280 * xgselect.c (xg_select): Remove unused var.
22281
22282 * image.c (four_corners_best): Mark locals as initialized.
22283 (gif_load): Initialize transparent_p to zero (Bug#8238).
22284 Mark another local as initialized.
22285 (my_png_error, my_error_exit): Mark with NO_RETURN.
22286
22287 * image.c (clear_image_cache): Now static.
22288 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
22289 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
22290 (x_edge_detection): Remove unnecessary cast that
22291 gcc -Wbad-function-cast diagnoses.
22292 (gif_load): Fix pointer signedness.
22293 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22294 (jpeg_load, gif_load): Rename locals to avoid shadowing.
22295
22296 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
22297
22298 Improve quality of tests for time stamp overflow.
22299 For example, without this patch (encode-time 0 0 0 1 1
22300 1152921504606846976) returns the obviously-bogus value (-948597
22301 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22302 reports time overflow. See
22303 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
22304 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22305 * editfns.c: Include limits.h and intprops.h.
22306 (TIME_T_MIN, TIME_T_MAX): New macros.
22307 (time_overflow): Move earlier, to before first use.
22308 (hi_time, lo_time): New functions, for an accurate test for
22309 out-of-range times.
22310 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22311 (Fget_internal_run_time): Don't assume time_t fits in int.
22312 (make_time): Use list2 instead of Fcons twice.
22313 (Fdecode_time): More accurate test for out-of-range times.
22314 (check_tm_member): New function.
22315 (Fencode_time): Use it, to test for out-of-range times.
22316 (lisp_time_argument): Don't rely on undefined left-shift and
22317 right-shift behavior when checking for time stamp overflow.
22318
22319 * editfns.c (time_overflow): New function, refactoring common code.
22320 (Fformat_time_string, Fdecode_time, Fencode_time):
22321 (Fcurrent_time_string): Use it.
22322
22323 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22324 * dired.c (make_time): Move to ...
22325 * editfns.c (make_time): ... here.
22326 * systime.h: Note the move.
22327
22328 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
22329
22330 * fringe.c (update_window_fringes): Remove unused variables.
22331
22332 * unexmacosx.c (copy_data_segment): Also copy __got section.
22333 (Bug#8223)
22334
22335 2011-03-12 Eli Zaretskii <eliz@gnu.org>
22336
22337 * termcap.c [MSDOS]: Include "msdos.h".
22338 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22339 Constify `char *' arguments and their references according to
22340 prototypes in tparam.h.
22341
22342 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
22343
22344 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22345 Adapt all references accordingly.
22346
22347 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22348
22349 2011-03-11 Tom Tromey <tromey@redhat.com>
22350
22351 * buffer.c (syms_of_buffer): Remove obsolete comment.
22352
22353 2011-03-11 Eli Zaretskii <eliz@gnu.org>
22354
22355 * termhooks.h (encode_terminal_code): Declare prototype.
22356
22357 * msdos.c (encode_terminal_code): Don't declare prototype.
22358
22359 * term.c (encode_terminal_code): Now external again, used by
22360 w32console.c and msdos.c.
22361
22362 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22363 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
22364
22365 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
22366
22367 Fix some minor problems found by GCC 4.5.2's static checks.
22368
22369 * fringe.c (update_window_fringes): Mark locals as initialized
22370 (Bug#8227).
22371 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
22372
22373 * alloc.c (mark_fringe_data): Move decl from here ...
22374 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22375 to check its interface.
22376 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22377
22378 * fontset.c (free_realized_fontset): Now static.
22379 (Fset_fontset_font): Rename local to avoid shadowing.
22380 (fontset_font): Mark local as initialized.
22381 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
22382
22383 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22384
22385 * xselect.c (x_disown_buffer_selections): Remove; not used.
22386 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
22387 (x_own_selection, Fx_disown_selection_internal): Rename locals
22388 to avoid shadowing.
22389 (x_handle_dnd_message): Remove local to avoid shadowing.
22390
22391 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22392 so that the caller can use some name other than gcpro1.
22393 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
22394 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22395 (Fx_backspace_delete_keys_p):
22396 Use them to avoid shadowing, and rename vars to avoid shadowing.
22397 (x_decode_color, x_set_name, x_window): Now static.
22398 (Fx_create_frame): Add braces to silence GCC warning.
22399 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
22400 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22401 Remove unused locals.
22402 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22403 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22404 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22405 macros.
22406
22407 * xterm.h (x_mouse_leave): New decl.
22408
22409 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22410 Remove unused functions.
22411 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22412 (x_calc_absolute_position): Now static.
22413 (XTread_socket): Don't define label "out" unless it's used.
22414 Don't declare local "event" unless it's used.
22415 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22416 unless they are used.
22417 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22418 (x_fatal_error_signal): Remove; not used.
22419 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22420 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22421 (x_error_catcher, x_connection_closed, x_error_handler):
22422 (x_error_quitter, xembed_send_message, x_iconify_frame):
22423 (my_log_handler): Rename locals to avoid shadowing.
22424 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
22425 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
22426
22427 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22428 Rename or move locals to avoid shadowing.
22429 (tty_defined_color, merge_face_heights): Now static.
22430 (free_realized_faces_for_fontset): Remove; not used.
22431 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22432 does not deduce is never used uninitialized.
22433 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22434 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
22435
22436 * terminal.c (store_terminal_param): Now static.
22437
22438 * xmenu.c (menu_highlight_callback): Now static.
22439 (set_frame_menubar): Remove unused local.
22440 (xmenu_show): Rename parameter to avoid shadowing.
22441 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22442 since they might point to immutable storage.
22443 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22444 since it's unused otherwise.
22445
22446 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
22447 Add a FIXME, since the code still doesn't look right. (Bug#8215)
22448 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22449 avoids a gcc -Wuninitialized diagnostic.
22450 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
22451 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22452 does not deduce are never used uninitialized.
22453
22454 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22455
22456 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
22457 * window.c (window_loop, size_window):
22458 (run_window_configuration_change_hook, enlarge_window): Likewise.
22459
22460 * window.c (display_buffer): Now static.
22461 (size_window): Mark variables that gcc -Wuninitialized
22462 does not deduce are never used uninitialized.
22463 * window.h (check_all_windows): New decl, to forestall
22464 gcc -Wmissing-prototypes diagnostic.
22465 * dispextern.h (bidi_dump_cached_states): Likewise.
22466
22467 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22468 shadowing.
22469 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
22470 Include <limits.h>.
22471 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22472 and to avoid gcc -Wuninitialized warning.
22473 (load_charset_map): Mark variables that gcc -Wuninitialized
22474 does not deduce are never used uninitialized.
22475 (load_charset): Abort instead of using uninitialized var (Bug#8229).
22476
22477 * coding.c (coding_set_source, coding_set_destination):
22478 Use "else { /* comment */ }" rather than "else /* comment */;"
22479 for clarity, and to avoid gcc -Wempty-body warning.
22480 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22481 a block, when the outer 'i' will do.
22482 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22483 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22484 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22485 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22486 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22487 Rename locals to avoid shadowing.
22488 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22489 * coding.c (emacs_mule_char, encode_invocation_designation):
22490 Now static, since they're not used elsewhere.
22491 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22492 (decode_coding_object, encode_coding_object, detect_coding_system):
22493 (decode_coding_emacs_mule): Mark variables that gcc
22494 -Wuninitialized does not deduce are never used uninitialized.
22495 (detect_coding_iso_2022): Initialize a local variable that might
22496 be used uninitialized. Leave a FIXME because it's not clear that
22497 this initialization is needed. (Bug#8211)
22498 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22499 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22500 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22501 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22502 Remove unused macros.
22503
22504 * category.c (hash_get_category_set): Remove unused local var.
22505 (copy_category_table): Now static, since it's not used elsewhere.
22506 * character.c (string_count_byte8): Likewise.
22507
22508 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22509 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22510
22511 * chartab.c (copy_sub_char_table): Now static, since it's not used
22512 elsewhere.
22513 (sub_char_table_ref_and_range, char_table_ref_and_range):
22514 Rename locals to avoid shadowing.
22515 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22516
22517 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22518 (BIDI_BOB): Remove unused macro.
22519
22520 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22521 deduce are never used uninitialized.
22522 * term.c (encode_terminal_code): Likewise.
22523
22524 * term.c (encode_terminal_code): Now static. Remove unused local.
22525
22526 * tparam.h: New file.
22527 * term.c, tparam.h: Include it.
22528 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22529 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22530 Move these decls to tparam.h, and make them agree with what
22531 is actually in tparam.c. The previous trick of using incompatible
22532 decls in different modules does not conform to the C standard.
22533 All callers of tparam changed to use tparam's actual API.
22534 * tparam.c (tparam1, tparam, tgoto):
22535 Use const pointers where appropriate.
22536
22537 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22538 * cm.h (struct cm): Likewise.
22539 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22540 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22541 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22542 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22543 (turn_on_face, init_tty): Likewise.
22544 * termchar.h (struct tty_display_info): Likewise.
22545
22546 * term.c (term_mouse_position): Rename local to avoid shadowing.
22547
22548 * alloc.c (mark_ttys): Move decl from here ...
22549 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22550
22551 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22552
22553 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22554
22555 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
22556
22557 * search.c (compile_pattern_1): Remove argument regp, unused since
22558 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22559 (compile_pattern): Don't pass it.
22560
22561 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22562
22563 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22564 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22565 for ! HAVE_GTK3.
22566 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22567
22568 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22569
22570 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22571 gdk_window_get_screen, gdk_window_get_geometry,
22572 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22573 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22574 (xg_get_pixbuf_from_pixmap): New function.
22575 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22576 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22577 Call xg_get_pixbuf_from_pixmap instead of
22578 gdk_pixbuf_get_from_drawable.
22579 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22580 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22581 (xg_check_special_colors): Use GtkStyleContext and its functions
22582 for HAVE_GTK3.
22583 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22584 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22585 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
22586 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22587 Call gtk_widget_get_preferred_size.
22588 (xg_frame_resized): gdk_window_get_geometry only takes 5
22589 parameters.
22590 (xg_win_to_widget, xg_event_is_for_menubar):
22591 Call gdk_x11_window_lookup_for_display.
22592 (xg_set_widget_bg): New function.
22593 (delete_cb): New function.
22594 (xg_create_frame_widgets): Connect delete-event to delete_cb.
22595 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
22596 (xg_set_background_color): Call xg_set_widget_bg.
22597 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22598 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22599 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22600 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22601 if ! HAVE_GTK3.
22602 (update_frame_tool_bar): Call gtk_widget_hide.
22603 (xg_initialize): Use GDK_KEY_g.
22604
22605 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22606 if ! HAVE_GTK3
22607 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22608
22609 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22610 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22611 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22612
22613 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
22614
22615 * w32xfns.c (select_palette): Check success of RealizePalette against
22616 GDI_ERROR, not zero.
22617
22618 See ChangeLog.11 for earlier changes.
22619
22620 ;; Local Variables:
22621 ;; coding: utf-8
22622 ;; End:
22623
22624 Copyright (C) 2011-2013 Free Software Foundation, Inc.
22625
22626 This file is part of GNU Emacs.
22627
22628 GNU Emacs is free software: you can redistribute it and/or modify
22629 it under the terms of the GNU General Public License as published by
22630 the Free Software Foundation, either version 3 of the License, or
22631 (at your option) any later version.
22632
22633 GNU Emacs is distributed in the hope that it will be useful,
22634 but WITHOUT ANY WARRANTY; without even the implied warranty of
22635 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22636 GNU General Public License for more details.
22637
22638 You should have received a copy of the GNU General Public License
22639 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.