1 2013-03-14 Eli Zaretskii <eliz@gnu.org>
3 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
4 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
6 (w32fullscreen_hook): If the frame is visible, reset
7 f->want_fullscreen flag after changing the frame size. If the
8 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
11 2013-03-13 Daniel Colascione <dancol@dancol.org>
13 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
14 too so that these builds can use Cygwin's file conversion
15 functions. (We've been building and linking cygw32.o all along
16 and just not using it.)
18 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
20 File synchronization fixes (Bug#13944).
21 * Makefile.in (LIB_FDATASYNC): New macro.
23 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
24 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
25 Don't worry about HAVE_FSYNC, since a substitute fsync is
26 available if the system lacks one.
27 (Fwrite_regin): Retry fsync if interrupted.
29 2013-03-13 Eli Zaretskii <eliz@gnu.org>
31 * w32term.c (w32_read_socket): If we Emacs frame is being
32 activated, call w32fullscreen_hook, to make sure the new frame
33 dimensions are in effect. (Bug#13937)
35 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
37 * xdisp.c (init_iterator): Simplify because both character and byte
38 positions are either specified or -1. Add eassert. Adjust comment.
39 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
40 character and byte positions can be obtained from marker.
42 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
44 Static checking by Sun C 5.12.
45 * alloc.c (buffer_memory_full) [REL_ALLOC]:
46 * bytecode.c (exec_byte_code):
47 * dispnew.c (init_display):
49 * fileio.c (Fsubstitute_in_file_name):
50 * keyboard.c (Fevent_convert_list):
51 * keymap.c (Fsingle_key_description):
52 * term.c (maybe_fatal, fatal):
53 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
54 * xsmfns.c (Fhandle_save_session):
55 Omit unreachable code.
56 * keymap.c (map_keymap_char_table_item): Cast void * to
57 a function pointer type; the C Standard requires this.
59 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
60 Include <sys/param.h> unconditionally, as that works elsewhere and
61 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
62 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
65 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
67 * insdel.c (adjust_after_replace): Use bool for boolean.
69 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
71 * keyboard.c: Move keyboard decoding to read_key_sequence.
72 (decode_keyboard_code): Remove.
73 (tty_read_avail_input): Don't try to decode input.
74 (read_decoded_char): New function.
75 (read_key_sequence): Use it.
77 2013-03-10 Daniel Colascione <dancol@dancol.org>
79 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
80 (GUI_SDATA, guichar_t): Macros to abstract out differences between
81 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
84 * w32term.c (construct_drag_n_drop): Use the above macros to make
85 drag-and-drop work for non-ASCII filenames in cygw32 builds.
87 * w32fns.c (x_set_name, x_set_title): Use the above macros to
88 properly display non-ASCII frame titles in cygw32 builds.
90 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
91 call ShellExecute in cygw32 builds.
93 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
94 common file dialog code.
96 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
97 can just use du like other systems.
99 * coding.c (from_unicode_buffer): Declare.
100 * coding.c (from_unicode_buffer): Implement.
102 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
104 * lread.c: Minor cleanup.
105 (FROM_FILE_P): New macro.
106 (skip_dyn_bytes, unreadchar, read1): Use it.
107 (read_list): Consolidate duplicated code.
109 * bytecode.c (struct byte_stack): Remove `constants' when unused.
111 2013-03-10 Eli Zaretskii <eliz@gnu.org>
113 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
114 (redisplay_internal, set_cursor_from_row, try_window)
115 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
116 (display_line, notice_overwritten_cursor)
117 (mouse_face_from_buffer_pos, note_mouse_highlight):
118 Use MATRIX_ROW_DISPLAYS_TEXT_P.
119 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
120 (mouse_face_from_string_pos, fast_find_string_pos):
123 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
125 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
127 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
128 MATRIX_MODE_LINE_ROW.
130 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
132 2013-03-10 handa <handa@gnu.org>
134 * lisp.h (adjust_after_replace): Extern it.
136 * coding.c (detect_coding): Cound the heading ASCII bytes in the
137 case of detection for coding_category_utf_8_auto.
138 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
139 Skip decoding if all bytes are ASCII.
141 * insdel.c (adjust_after_replace): Make it public. New arg
143 (adjust_after_insert): Call adjust_after_replace with the new arg
146 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
148 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
149 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
150 from Elisp via unread-command-events.
152 * keyboard.c (access_keymap_keyremap): Accept nil return value from
153 functions to mean "no change".
155 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
157 region-cache.c, scroll.c, search.c: Use bool for booleans.
158 * lisp.h (compile_pattern):
159 * scroll.c (do_scrolling, do_direct_scrolling):
160 * search.c (struct regexp_cache, compile_pattern_1)
161 (compile_pattern, string_match_1, search_command)
162 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
163 (search_regs_saved, Fregexp_quote):
164 Use bool for boolean.
165 * region-cache.c (region_cache_forward, region_cache_backward):
166 Fix comments to match code: these functions return int, not boolean.
168 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
170 * search.c (find_newline): Accept start and end byte positions
171 as arguments and allow -1 if not known.
172 (find_newline_no_quit): Likewise for start position.
173 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
174 * bidi.c (bidi_find_paragraph_start): Pass byte position to
175 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
176 * editfns.c (Fconstrain_to_field): Break long line.
177 Adjust call to find_newline.
178 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
179 Use DEC_BOTH to start next search from the previous buffer
180 position, where appropriate.
181 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
182 (get_visually_first_element, move_it_vertically_backward): Likewise.
183 Obtain byte position from the display iterator, where appropriate.
185 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
187 print.c, process.c: Use bool for booleans.
188 * lisp.h (wait_reading_process_output):
189 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
190 (strout, debug_output_compilation_hack, float_to_string, print)
192 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
193 (decode_status, status_message, create_process, create_pty)
194 (Fmake_network_process, Fnetwork_interface_info)
195 (wait_reading_process_output, read_process_output)
196 (write_queue_push, write_queue_pop, process_send_signal)
197 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
198 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
199 Use bool for booleans.
200 * process.c (Fnetwork_interface_list): Remove unused local.
201 (connect_counter): Now EMACS_INT, not int.
203 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
205 * bidi.c (bidi_fetch_char): Swap first and second arguments
206 to match other functions accepting character and byte positions.
208 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
209 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
210 when you need just to move to the previous buffer position.
211 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
213 2013-03-07 Eli Zaretskii <eliz@gnu.org>
215 * .gdbinit (prowlims): Display the enabled_p flag of the row.
217 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
219 Avoid character to byte conversions in motion subroutines.
220 * indent.h (compute_motion, vmotion): Add byte position argument.
221 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
223 (Fcompute_motion): Break long line. Adjust call to compute_motion.
224 Use list5 for return value.
225 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
226 Adjust comments, style and calls to compute_motion.
227 (Fvertical_motion): Adjust call to vmotion.
228 * window.c (Fdelete_other_windows_internal): Record window start
229 byte position and adjust call to vmotion.
230 (window_scroll_line_based): Likewise with call to compute_motion.
232 (Frecenter): Adjust calls to vmotion.
234 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
236 * lisp.h (list2i, list3i): New functions.
237 (list4i): Move from window.c and make LISP_INLINE.
238 * editfns.c (make_lisp_time):
239 * fns.c (Flocale_info):
240 * keyboard.c (parse_modifiers):
241 * xterm.c (x_ewmh_activate_frame): Use list2i.
242 * instel.c (signal_after_change):
243 * nsfns.m (Fx_server_version, Fxw_color_values):
244 * w32fns.c (Fxw_color_values, Fx_server_version):
245 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
246 * fileio.c (Fvisited_file_modtime):
247 * nsfns.m (Fns_display_usable_bounds):
248 * w32.c (ltime): Use list4i.
250 2013-03-06 Eli Zaretskii <eliz@gnu.org>
252 * search.c (find_newline_no_quit): Rename from find_next_newline.
255 * lisp.h (find_newline_no_quit): Rename prototype.
257 * xdisp.c (back_to_previous_line_start)
258 (forward_to_next_line_start, get_visually_first_element)
259 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
260 * indent.c (vmotion): Callers of find_newline_no_quit changed.
261 * bidi.c (bidi_find_paragraph_start): Callers of
262 find_newline_no_quit changed.
264 * msdos.c: Change encoding to cp850. (Bug#13879)
265 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
267 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
269 Coding system support cleanup and minor refactoring.
270 * coding.h (enum coding_result_code): Remove
271 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
272 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
273 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
274 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
275 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
276 (decode_coding_region, encode_coding_region, decode_coding_string):
277 Remove unused compatibility macros.
278 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
279 (record_conversion_result): Adjust user.
280 (syms_of_coding): Likewise.
281 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
282 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
283 (decode_coding_object): Simplify since xrealloc never returns NULL.
286 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
288 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
289 * sysdep.c (list_system_processes)
290 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
291 Make it a stub in this case; otherwise the build might fail,
292 and this code hasn't been tested on such hosts anyway.
293 Problem reported by Nelson H. F. Beebe in
294 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
295 and analyzed by Jérémie Courrèges-Anglas in
296 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
298 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
300 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
301 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
302 (get_visually_first_element, move_it_vertically_backward): Ajust users.
303 * bidi.c (bidi_find_paragraph_start): Likewise.
304 * indent.c (vmotion): Likewise.
306 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
308 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
309 * filelock.c: Include <c-ctype.h>.
310 (MAX_LFINFO): New top-level constant.
311 (lock_info_type): Remove members pid, boot_time. Add members at,
312 dot, colon. Change user member to be the entire buffer, not a
313 pointer. This allows us to handle the case where a foreign
314 pid or boot time exceeds the local range. All uses changed.
315 (LINKS_MIGHT_NOT_WORK): New constant.
316 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
317 (defined_WINDOWSNT): Remove.
318 (MAKE_LOCK_NAME, file_in_lock_file_name):
319 Always use .#FILE (not .#-FILE) for the file lock,
320 even if it is a regular file.
321 (rename_lock_file): New function.
322 (create_lock_file): Use it.
323 (create_lock_file, read_lock_data):
324 Prefer a symbolic link for the lock file, falling back on a
325 regular file if symlinks don't work. Do not try to create
326 symlinks on MS-Windows, due to security hassles. Stick with
327 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
328 link, rename, unlink, mkstemp) when creating locks, as a GNUish
329 host may be using a Windowsish file system, and cannot use
330 MS-Windows-only system calls. Fall back on mktemp if mkstemp
331 doesn't work. Don't fail merely because of a symlink-contents
332 length limit in the current file system; fall back on regular
333 files. Increase the symlink contents length limit to 8 KiB, this
334 should be big enough for any real use and doesn't crunch the
336 (create_lock_file, lock_file_1, read_lock_data):
337 Simplify allocation of lock file buffers now that they fit in 8 KiB.
338 (lock_file_1): Return error number, not bool. All callers changed.
339 (ELOOP): New macro, if not already defined.
340 (read_lock_data): Return size of lock file contents, not Lisp object.
341 All callers changed. Handle a race condition if some other process
342 replaces a regular-file lock with a symlink lock or vice versa,
343 while we're trying to read the lock.
344 (current_lock_owner): Parse contents more carefully, to help avoid
345 confusing a regular-file lock with some other application's use
346 of the file. Check for lock file contents being too long, or
347 not parsing correctly.
348 (current_lock_owner, lock_file):
349 Allow foreign pid and boot times that exceed the local range.
350 (current_lock_owner, lock_if_free, lock_file):
351 Simplify allocation of lock file contents.
352 * w32.c (sys_rename_replace): New function, containing most of
353 the contents of the old sys_rename.
354 (sys_rename): Use it.
355 (fchmod): New dummy function.
356 * w32.h (sys_rename_replace, fchmod): New decls.
358 2013-03-05 Eli Zaretskii <eliz@gnu.org>
360 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
361 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
362 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
363 <dmantipov@yandex.ru>.
365 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
367 * composite.c (get_composition_id, fill_gstring_header):
368 Use make_uninit_vector where appropriate.
369 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
370 * xselect.c (clean_local_selection_data): Likewise.
372 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
374 Fix misuse of ImageMagick that caused core dump (Bug#13846).
375 * image.c (imagemagick_load_image): Calculate height and width
376 after flattening the image, not before.
378 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
380 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
381 * ftfont.c (ftfont_shape_by_flt): Likewise.
382 * w32uniscribe.c (uniscribe_shape): Likewise.
384 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
386 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
387 The old approach, which fell back on DIR/.#FILE.0 through
388 DIR/.#FILE.9, had race conditions that could not be easily fixed.
389 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
390 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
391 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
392 because the locking mechanism was never reliable in that case).
393 This patch fixes this and other bugs discovered by a code
394 inspection that was prompted by
395 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
396 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
397 to avoid interoperability problems between the MS-Windows and
398 non-MS-Windows implementations. MS-Windows and non-MS-Windows
399 instances of Emacs now ignore each others' locks.
400 * filelock.c (defined_WINDOWSNT): New constant.
401 (MAKE_LOCK_NAME, fill_in_lock_file_name):
402 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
403 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
404 regular files on MS-Windows hosts.
405 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
406 Use SAFE_ALLOCA to avoid problems with long file names.
407 (MAX_LFINFO): Now a local constant, not a global macro.
408 (IS_LOCK_FILE): Remove.
409 (lock_file_1): Don't inspect errno if symlink call succeeds;
411 (lock_file): Document that this function can return if lock
413 (lock_file): Don't access freed storage.
415 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
417 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
419 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
421 * textprop.c: Use bool for booleans.
422 (validate_interval_range, Fadd_text_properties)
423 (Fremove_text_properties): Prefer bool to int when either works.
425 2013-03-02 Eli Zaretskii <eliz@gnu.org>
427 * textprop.c (Fadd_text_properties, Fremove_text_properties):
428 If the interval tree changes as a side effect of calling
429 modify_region, re-do processing starting from the call to
430 validate_interval_range. (Bug#13743)
432 2013-02-28 Eli Zaretskii <eliz@gnu.org>
434 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
437 2013-02-27 Eli Zaretskii <eliz@gnu.org>
439 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
440 _SH_DENYRW flag, instead of emacs_open, to deny any other process
441 access to the lock file until it is written and closed.
444 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
446 * callint.c (Qcall_interactively):
447 * macros.c (Qexecute_kbd_macro):
450 2013-02-26 Bastien Guerry <bzg@gnu.org>
452 * window.c (Frecenter): Tiny docstring enhancement.
454 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
456 Minor textprop integer cleanup.
457 * intervals.h, textprop.c (add_text_properties_from_list):
458 Return void, not int, since nobody uses the return value.
459 * textprop.c (validate_plist, add_properties, remove_properties)
460 (Fadd_text_properties):
461 Don't assume list length fits in int.
462 (interval_has_all_properties, interval_has_some_properties)
463 (interval_has_some_properties_list, add_properties, remove_properties)
464 (Fadd_text_properties, Fremove_text_properties)
465 (Fremove_list_of_text_properties, text_property_stickiness):
466 Use bool for booleans.
467 (Fadd_text_properties, Fremove_text_properties):
468 (Fremove_list_of_text_properties):
469 Reindent do-while as per GNU style.
471 2013-02-25 Eli Zaretskii <eliz@gnu.org>
473 Implement CLASH_DETECTION for MS-Windows.
475 * filelock.c [WINDOWSNT]: Include w32.h.
476 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
477 function of that name. Up-case the macro arguments.
478 (IS_LOCK_FILE): New macro.
479 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
480 (create_lock_file): New function, with body extracted from
482 [WINDOWSNT]: Implement lock files by writing a regular file with
483 the lock information as its contents.
484 (read_lock_data): New function, on Posix platforms just calls
486 [WINDOWSNT]: Read the lock info from the file.
487 (current_lock_owner): Call read_lock_data instead of calling
488 emacs_readlinkat directly.
489 (lock_file) [WINDOWSNT]: Run the file name through
492 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
493 just check if the process by that PID exists.
495 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
496 also present, as doing so will fail to error out if the file
499 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
501 * textprop.c (Fadd_text_properties, Fremove_text_properties)
502 (Fremove_list_of_text_properties): Skip all of the intervals in
503 the region between START and END that already have resp. don't
504 have the requested properties, not just the first one.
505 Add assertions that the loop afterwards always modifies the
506 properties. (Bug#13743)
508 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
510 * callint.c (Fcall_interactively): Use the right lexical environment
511 for `interactive' specs (bug#13811).
512 * eval.c (Feval): Accept a lexical environment.
514 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
516 Simplify data_start configuration (Bug#13783).
517 This is a followon simplification to the fix for Bug#13650.
518 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
519 (START_FILES): Remove. All uses removed.
520 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
521 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
522 (buildobj.h): Use it.
523 ($(ALLOBJS)): Depend on globals.h.
524 (temacs$(EXEEXT)): Use $(ALLOBJS).
525 * autodeps.mk (ALLOBJS): Move to Makefile.in.
526 * deps.mk (vm-limit.o):
527 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
528 Do not depend on mem-limits.h.
529 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
530 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
531 [__GNUC__ && !ORDINARY_LINK]: Remove.
532 * mem-limits.h, pre-crt0.c: Remove.
533 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
534 * unexcoff.c (etext): New decl.
535 (make_hdr): Use DATA_START instead of start_of_data.
536 * vm-limit.c: Move most of mem-limits.h's contents here.
537 (data_start): New decl. It's OK if this is approximate,
538 so simplify-away some unnecessary exactness.
539 (POINTER): Remove; all uses removed.
540 (data_space_start): Now char *, to avoid casts.
541 (exceeds_lisp_ptr): New function, replacing the old
542 EXCEEDS_LISP_PTR macro. All uses changed.
543 (check_memory_limits): Simplify and remove casts.
544 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
545 (memory_warnings): Use data_start instead of start_of_data.
547 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
549 * xdisp.c (set_message): Only check for debug-on-message if STRING
550 is a string. (Bug#13797)
552 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
554 Fix regression introduced by July 10 filelock.c patch.
555 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
556 2012-07-10 patch to this file. Reported by Eli Zaretskii in
557 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
558 and diagnosed by Andreas Schwab in
559 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
561 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
563 Assume C89 or better.
564 * ralloc.c (SIZE, POINTER, NIL):
565 * vm-limit.c (POINTER):
566 Remove, replacing all uses with C89 equivalents. These old
567 symbols were present only for porting to pre-C89 platforms.
569 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
571 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
572 This avoids warning messages reported as part of Bug#13546.
574 2013-02-21 Ken Brown <kbrown@cornell.edu>
576 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
578 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
580 * sheap.c (report_sheap_usage): Prefer message1_nolog.
582 * keyboard.c (Qcommand_execute): New var.
583 (command_loop_1, read_char): Use it.
584 (Fcommand_execute): Remove, replace by an Elisp implementation.
585 (syms_of_keyboard): Adjust accordingly.
587 2013-02-19 Daniel Colascione <dancol@dancol.org>
589 * sheap.c (report_sheap_usage): Use message, not message1, so
590 that we don't try to create a buffer while we're in the middle
591 of dumping Emacs. Explain why.
593 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
595 * search.c (find_newline): Return byte position in bytepos.
597 (find_next_newline_no_quit, find_before_next_newline):
598 Add bytepos argument.
599 * lisp.h (find_newline, find_next_newline_no_quit)
600 (find_before_next_newline): Adjust prototypes.
601 * bidi.c (bidi_find_paragraph_start):
602 * editfns.c (Fconstrain_to_field, Fline_end_position):
603 * indent.c (compute_motion, vmotion):
604 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
605 (get_visually_first_element, move_it_vertically_backward):
606 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
608 2013-02-19 Eli Zaretskii <eliz@gnu.org>
610 * w32proc.c (new_child): Avoid leaking handles if the subprocess
611 resources were not orderly released.
613 2013-02-17 Eli Zaretskii <eliz@gnu.org>
615 * xdisp.c (x_draw_vertical_border): For a window that is neither
616 the leftmost nor the rightmost, redraw both the left and the right
617 vertical borders. (Bug#13723)
619 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
621 * xml.c (init_libxml2_functions):
622 * sound.c (sound_warning):
623 * sheap.c (report_sheap_usage):
624 * process.c (wait_reading_process_output):
625 * msdos.c (XMenuActivate):
626 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
627 * keyboard.c (top_level_1):
628 * editfns.c (Fmessage, Fmessage_box):
629 * callint.c (Fcall_interactively):
630 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
632 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
634 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
635 * frame.c (syms_of_frame): ... to here.
637 2013-02-16 Eli Zaretskii <eliz@gnu.org>
639 * w32.c (sys_chown): Remove unused function.
641 * w32term.c <input_signal_count>: Declare 'volatile'
642 unconditionally. (Bug#9066)
644 * w32.c (set_errno): Reset h_errno and don't set it to any other
645 value. Set errno instead.
646 (check_errno): Reset h_errno.
647 (sys_socket, socket_to_fd, sys_bind, sys_connect)
648 (sys_gethostname, sys_getservbyname, sys_getpeername)
649 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
650 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
652 (sys_gethostbyname): Set h_errno only errors detected.
654 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
656 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
658 2013-02-15 Eli Zaretskii <eliz@gnu.org>
660 * keyboard.c (read_char): Fix calculation of auto-save time out
661 when auto-save-timeout is less than 4. (Bug#13720)
663 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
664 time. Improve diagnostics in DebPrint. (Bug#13546)
666 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
667 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
668 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
669 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
670 make sure errno is set to an appropriate value. (Bug#13546)
671 (socket_to_fd): Add assertion against indexing fd_info[] with a
672 value that is out of bounds.
673 (sys_accept): If fd is negative, do not set up the child_process
674 structure for reading.
676 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
678 * composite.c (fill_gstring_header): Remove useless prototype.
680 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
681 * print.c (PRINTDECLARE, print_object):
682 * search.c (compile_pattern, fast_looking_at, search_buffer):
683 (simple_search, boyer_moore, Freplace_match):
684 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
685 (get_overlay_arrow_glyph_row, display_mode_element):
686 (decode_mode_spec_coding, message3):
687 * xfaces.c (face_at_string_position): Use bool for booleans.
690 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
692 Fix AIX port (Bug#13650).
693 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
694 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
695 was #undeffed earlier, so it cannot be used as a macro here.
696 Use the constant and not the macro.
698 2013-02-15 Eli Zaretskii <eliz@gnu.org>
700 * w32proc.c (new_child): If no vacant slots are found in
701 child_procs[], make another pass looking for slots whose process
702 has exited or died. (Bug#13546)
704 * w32.c (sys_pipe): When failing due to file descriptors above
705 MAXDESC, set errno to EMFILE.
706 (_sys_read_ahead): Update cp->status when failing to read serial
707 communications input, so that the status doesn't stay at
708 STATUS_READ_IN_PROGRESS. (Bug#13546)
710 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
712 * gtkutil.c (tb_size_cb): New function.
713 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
715 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
717 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
720 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
722 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
724 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
726 * font.c (font_range): Add pos_byte argument. Adjust comment
728 * font.h (font_range): Adjust prototype.
729 * composite.c (autocmp_chars): Pass byte position to font_range.
730 Break long line. Remove useless prototype and format comment.
732 2013-02-13 Glenn Morris <rgm@gnu.org>
734 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
736 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
738 Improve AIX port some more (Bug#13650).
739 With this, it should be as good as it was in 23.3, though it's
740 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
741 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
742 * unexaix.c (start_of_text): Remove.
743 (_data, _text): Declare as char[], not int, as AIX manual suggests.
744 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
745 (orig_load_scnptr, orig_data_scnptr):
746 Now off_t, not long, since they are file offsets.
747 (make_hdr): Use _data, not start_of_data ().
748 This is the key part of the fix.
749 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
750 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
752 * pre-crt0.c (data_start): Initialize to 1.
753 This ports to compilers that optimize the external declaration
754 'int x = 0;' as if it were 'int x;' to shrink the executable.
756 Improve AIX port (Bug#13650).
757 This doesn't fix the bug, but it makes progress: Emacs builds now.
758 * unexaix.c: Include inttypes.h, stdarg.h.
759 (report_error, report_error_1): Mark as _Noreturn.
760 (report_error): Don't report the wrong errno.
761 (report_error_1): Now varargs. All callers changed.
762 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
763 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
764 (write_ptr): Use %p to print address rather than %lx and a cast
765 to unsigned long. Grow buffer a bit, to be safer.
767 2013-02-13 Eli Zaretskii <eliz@gnu.org>
769 * bidi.c (bidi_resolve_neutral): After finding the next
770 non-neutral character, accept NEUTRAL_ON type as well, because
771 directional control characters, such as LRE and RLE, have their
772 type converted to that by bidi_resolve_weak. This avoids aborts
773 when LRE/RLE follows a run of neutrals.
774 (bidi_move_to_visually_next): Assert that return value of
775 bidi_peek_at_next_level is non-negative. Negative values will
778 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
780 Minor getenv-related fixes.
781 * callproc.c (Fcall_process_region) [!DOS_NT]:
782 Avoid unnecessary duplicate call to getenv.
783 * callproc.c (init_callproc):
784 * dispnew.c (init_display):
785 * sysdep.c (sys_subshell):
786 Omit unnecessary cast of getenv or egetenv.
788 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
790 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
793 2013-02-12 Eli Zaretskii <eliz@gnu.org>
795 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
797 (display_line): Set w->region_showing to the value of
798 it->region_beg_charpos, not to -1. This fixes redisplay
799 optimization when cursor is moved up after M->. (Bug#13623)
801 (try_scrolling): Scroll text up more if point is too close to ZV
802 and inside the scroll margin. This makes sure point is moved
803 outside the scroll margin in these cases.
805 * window.h (struct window): region_showing can no longer be
808 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
810 Tune by using memchr and memrchr.
811 * doc.c (Fsnarf_documentation):
812 * fileio.c (Fsubstitute_in_file_name):
813 * search.c (find_newline, scan_newline):
814 * xdisp.c (pos_visible_p, display_count_lines):
815 Use memchr and memrchr rather than scanning byte-by-byte.
816 * search.c (find_newline): Rename from scan_buffer.
817 Omit first arg TARGET, as it's always '\n'. All callers changed.
819 Clean up read_key_sequence a tiny bit more.
820 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
821 (read_key_sequence): Remove unused locals.
823 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
825 Clean up read_key_sequence a bit; reread active keymaps after first event.
826 * keyboard.c (read_char, read_char_x_menu_prompt)
827 (read_char_minibuf_menu_prompt):
828 Replace nmaps+maps with a single `map' arg.
829 (follow_key): Operate on a single map.
830 (active_maps): New function.
831 (test_undefined): Also return true for nil bindings.
832 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
833 a single (composed) keymap. Remember `first_event' to choose the right
834 set of active keymaps. Recompute the set of keymaps after receiving
835 the first event. Remove GOBBLE_FIRST_EVENT.
836 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
837 * keyboard.h (read_char): Update declaration.
838 * lread.c (read_filtered_event): Adjust call to read_char.
840 2013-02-11 Eli Zaretskii <eliz@gnu.org>
842 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
843 Don't use the limitation on backwards movement when lines are truncated
844 in the window. (Bug#13675)
846 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
848 * marker.c (set_marker_internal): If desired position is passed
849 as a marker, avoid call to buf_charpos_to_bytepos.
850 * window.c (Fset_window_point): Omit redundant type checking.
851 (Fset_window_start): Likewise. Format comment.
852 (window_scroll_pixel_based): Use set_marker_restricted_both
853 with character and byte positions obtained from an iterator.
854 (Fset_window_configuration): Use set_marker_restricted_both.
855 * xdisp.c (message_dolog): Likewise.
857 2013-02-10 Eli Zaretskii <eliz@gnu.org>
859 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
860 When text lines are longer than window's screen lines, don't move back
861 too far. This speeds up some redisplay operations. (Bug#13675)
863 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
865 * syntax.c (scan_sexps_forward): Fix byte position calculation
866 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
868 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
870 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
873 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
875 Minor hashing refactoring.
876 * fns.c (SXHASH_REDUCE): Move to lisp.h.
877 (sxhash_float): Return EMACS_UINT, for consistency with the other
879 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
880 non-static inline function and therefore can't use static vars.
881 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
882 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
883 with the other hash functions.
885 2013-02-09 Eli Zaretskii <eliz@gnu.org>
887 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
888 XXXXXX part of the temporary file pattern is not downcased even
889 when w32-downcase-file-names is non-nil. (Bug#13661)
891 * xdisp.c (decode_mode_spec): Remove handling of %t.
893 * msdos.c (careadlinkatcwd): Remove.
895 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
897 * lread.c (skip_dyn_bytes): New function (bug#12598).
898 (read1): Use it. Use getc instead of READCHAR to read bytes.
899 (load_each_byte): Remove. Update users.
901 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
903 * search.c (scan_buffer): Calculate end byte position just once.
904 (scan_newline): Do not recalculate start_byte.
905 (search_command): Use eassert.
906 * syntax.c (struct lisp_parse_state): New member location_byte.
907 (scan_sexps_forward): Record from_byte and avoid redundant
908 character to byte position calculation ...
909 (Fparse_partial_sexp): ... here. Break too long line.
911 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
913 * lisp.h (make_uninit_vector): New function.
914 * alloc.c (Fvector, Fmake_byte_code):
915 * ccl.c (Fregister_ccl_program):
916 * charset.c (Fdefine_charset_internal, define_charset_internal):
917 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
918 * composite.c (syms_of_composite):
919 * font.c (Fquery_font, Ffont_info, syms_of_font):
920 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
921 * ftfont.c (ftfont_shape_by_flt):
922 * indent.c (recompute_width_table):
923 * nsselect.m (clean_local_selection_data):
924 * syntax.c (init_syntax_once):
925 * w32unsubscribe.c (uniscribe_shape):
926 * window.c (Fcurrent_window_configuration):
927 * xfaces.c (Fx_family_fonts):
928 * xselect.c (selection_data_to_lisp_data): Use it.
930 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
932 * coding.c (Fdefine_coding_system_internal): Use AREF where
933 argument is known to be a vector.
934 * fns.c (Flocale_info): Likewise for ASET.
935 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
936 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
938 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
940 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
943 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
944 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
945 updateCollectionBehaviour.
947 * nsterm.m (NEW_STYLE_FS): Remove.
948 (ns_last_use_native_fullscreen): New variable.
949 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
950 (x_set_window_size): Do not take title bar and tool bar into account
951 if isFullscreen returns YES.
952 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
953 (check_native_fs): New function.
954 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
955 (ns_term_init): Remove NEW_STYLE_FS.
956 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
957 and tool bar if isFullscreen returns NO.
958 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
959 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
961 (window:willUseFullScreenPresentationOptions:): New method.
962 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
963 Hide toolbar if not enabled (Bug#13444).
964 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
965 Restore tool bar if enabled, hide it otherwise (Bug#13444).
966 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
967 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
968 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
969 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
970 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
971 (syms_of_nsterm): Add ns-use-native-fullscreen.
973 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
975 * fileio.c (Qchoose_write_coding_system): Now static.
977 2013-02-04 Eli Zaretskii <eliz@gnu.org>
979 * xdisp.c (window_buffer_changed): region_showing can be negative,
980 which still means region is being displayed.
981 (redisplay_internal): Resurrect code that forced redisplay of the
982 whole window when showing region and the mark has changed.
983 Record the new mark position to allow redisplay optimizations.
984 (display_line): If it->region_beg_charpos is non-zero, set the
985 window's region_showing member to -1. (Bug#13623) (Bug#13626)
987 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
988 not bitfield of 1 bit.
990 2013-02-03 Daniel Colascione <dancol@dancol.org>
992 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
993 daemon mode works on cygw32 when Emacs is installed and not just
996 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
998 Avoid file time stamp bug on MS-Windows (Bug#13149).
999 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1000 as FAT32 doesn't update time stamps when truncating them.
1001 Also, check that a file time stamp is not a multiple of 100 ns;
1002 this should catch all instances of the problem on MS-Windows,
1003 as its native file system resolution is 100 ns or worse, and
1004 checking for a non-multiple of 100 ns should impose only a small
1005 overhead on systems with ns resolution.
1007 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1009 Avoid encoding file names on MS-Windows when they need to be run
1010 through dostounix_filename.
1011 * w32.c (normalize_filename): Accept an additional argument
1012 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1013 downcase it even if w32-downcase-file-names is non-nil.
1014 (dostounix_filename): Accept an additional argument MULTIBYTE and
1015 pass it to normalize_filename.
1016 (emacs_root_dir): Adjust.
1018 * msdos.h (dostounix_filename): Adjust prototype.
1020 * w32.h (dostounix_filename): Adjust prototype.
1022 * msdos.c (dostounix_filename): Accept an additional argument and
1024 (init_environment): Adjust callers of dostounix_filename.
1026 * fileio.c (Ffile_name_directory, file_name_as_directory)
1027 (directory_file_name, Fexpand_file_name)
1028 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1030 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1032 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1033 variables, as egetenv is case-insensitive for DOS_NT.
1035 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1036 with an encoded file name.
1038 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1039 Adjust calls to dostounix_filename.
1041 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1043 * unexw32.c (unexec): Adjust call to dostounix_filename.
1045 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1047 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1050 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1053 * callproc.c (Fcall_process): Make sure program name in PATH and
1054 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1055 is passed to exec/spawnve, which fails unless the file-name
1058 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1059 even if w32-quote-process-args is nil.
1061 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1063 Fix timestamp bug when write-region appends nothing (Bug#13149).
1064 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1065 the file's time stamp doesn't change if Emacs happens to write nothing
1066 to the file, and on a buggy file system this could cause Emacs to
1067 incorrectly infer that the file system doesn't have the bug.
1068 Avoid this problem by inhibiting the inference in this case.
1070 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1072 * window.h (struct window): Convert base_line_number, base_line_pos
1073 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1074 Convert region_showing member from Lisp_Object to bitfield.
1075 Remove sequence_number member. Adjust comments.
1076 * window.c (sequence_number): Remove.
1077 (make_window): Initialize column_number_displayed.
1078 * print.c (print_object): Follow the printed representation of
1079 frames and print window pointer to distinguish between windows.
1080 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1081 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1082 (wset_column_number_displayed, wset_region_showing): Remove.
1083 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1084 (try_scrolling, try_cursor_movement, redisplay_window)
1085 (try_window_reusing_current_matrix, try_window_id, display_line)
1086 (display_mode_lines, decode_mode_spec): Adjust users.
1087 * .gdbinit (pwinx): Do not print sequence_number.
1089 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1091 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1092 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1093 * dired.c: Include <fcntl.h>.
1094 (open_directory): New function, which uses open and fdopendir
1095 rather than opendir. DOS_NT platforms still use opendir, though.
1096 (directory_files_internal, file_name_completion): Use it.
1097 (file_attributes): New function, with most of the old Ffile_attributes.
1098 (directory_files_internal, Ffile_attributes): Use it.
1099 (file_attributes, file_name_completion_stat): First arg is now fd,
1100 not dir name. All uses changed. Use fstatat rather than lstat +
1102 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1103 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1104 (emacs_readlinkat): New function, with much of the old
1105 Ffile_symlink_p, but with an fd argument for speed.
1106 It uses readlinkat rather than careadlinkatcwd, so that it
1107 need not assume the working directory.
1108 (Ffile_symlink_p): Use it.
1109 * filelock.c (current_lock_owner): Use emacs_readlinkat
1110 rather than emacs_readlink.
1111 * lisp.h (emacs_readlinkat): New decl.
1112 (READLINK_BUFSIZE, emacs_readlink): Remove.
1113 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1114 (emacs_norealloc_allocator, emacs_readlink): Remove.
1115 This stuff is moved to fileio.c.
1116 * w32.c (fstatat, readlinkat): New functions.
1117 (careadlinkat): Don't check that fd == AT_FDCWD.
1118 (careadlinkatcwd): Remove; no longer needed.
1120 2013-01-31 Glenn Morris <rgm@gnu.org>
1122 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1123 (Fwrite_region): Update for new choose_write_coding_system args.
1124 Move the last piece of choose_write_coding_system here. (Bug#13522)
1125 (syms_of_fileio): Add choose-write-coding-system.
1127 2013-01-30 Eli Zaretskii <eliz@gnu.org>
1129 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1130 (sys_close): Zero out the flags for the file descriptor before
1131 closing it. (Bug#13546)
1133 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1134 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1135 Use CharNextExA and CharPrevExA to iterate over file names encoded in
1138 * w32.c (w32_get_long_filename, init_environment, readlink):
1139 Support file names encoded in DBCS codepages.
1140 (readlink): Use the current file-name-coding-system, not the ANSI
1141 codepage, to decode and handle targets of symlinks.
1143 2013-01-28 Eli Zaretskii <eliz@gnu.org>
1145 * w32.c (opendir): Now accepts a 'const char *'.
1147 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1149 Remove obsolete redisplay code. See the discussion at
1150 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1151 * dispnew.c (preemption_period, preemption_next_check): Remove.
1152 (Vredisplay_preemption_period): Likewise.
1153 (update_frame, update_single_window, update_window, update_frame_1):
1154 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1155 used, following the 2012-06-22 change.
1157 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1159 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1161 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1163 * font.c (num_fonts): Remove the leftover from old
1164 debugging code. Adjust comment style here and there.
1165 * insdel.c (insert_1): Remove.
1166 * lisp.h (insert_1): Remove prototype.
1167 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1169 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1171 * w32.c (max_filename_mbslen): New function.
1172 (normalize_filename, readdir): Use it to detect locales where ANSI
1173 encoding of file names uses a double-byte character set (DBCS).
1174 If a DBCS encoding is used, advance by characters using
1175 CharNextExA, instead of incrementing a 'char *' pointer.
1176 Use _mbslwr instead of _strlwr. (Bug#13515)
1178 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1179 request of memory reservation to 1.7GB. (Bug#13065)
1181 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
1183 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1184 at check_extra_latin label. (Bug#13505)
1186 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1188 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1189 Avoid redundant calls to strlen.
1191 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1193 Drop async_visible and async_iconified fields of struct frame.
1194 This is possible because async input is gone; for details, see
1195 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1196 * frame.h (struct frame): Remove async_visible and async_iconified
1197 members, convert garbaged to unsigned bitfield. Adjust comments.
1198 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1199 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1200 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1201 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1202 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1204 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1205 properly. Likewise for obscured.
1207 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1210 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1212 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1214 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1215 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1217 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1219 * xdisp.c (message2, message2_nolog): Remove functions.
1220 (message3, message3_nolog): Extract nbytes and multibyteness directly
1221 from the string. Change all callers.
1222 (message3_nolog): Don't set message_enable_multibyte since set_message
1223 will reset it anyway.
1224 (message1, message1_nolog): Use message3.
1225 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1226 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1227 (set_message): Drop all but the second arg, which has to be a string.
1228 (set_message_1): Simplify now that we know that a1 is NULL and the
1229 second arg is a string.
1230 * frame.h (struct frame): Remove `message_buf' field.
1231 Use glyphs_initialized_p instead.
1232 (FRAME_MESSAGE_BUF): Remove macro.
1233 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1234 * lisp.h (message2, message2_nolog): Remove declarations.
1235 (message3, message3_nolog): Update declarations.
1236 * keyboard.c (read_char_minibuf_menu_text)
1237 (read_char_minibuf_menu_width): Remove vars.
1238 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1239 to correctly handle multibyte strings.
1240 * frame.c (delete_frame): Don't free message_buf any more.
1241 * editfns.c (message_text, message_length): Remove vars.
1242 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1243 * fileio.c (auto_save_error): Use message3 instead of message2.
1244 * dispnew.c (adjust_frame_message_buffer): Remove function.
1246 2013-01-23 Eli Zaretskii <eliz@gnu.org>
1248 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1249 real estate used for the tool bar and the menu bar.
1251 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1253 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1254 hidden buffer is prepared to modification (Bug#13164).
1256 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1258 * window.h (struct window): Change window_end_valid member from
1259 Lisp_Object to a bitfield. Adjust comments.
1260 (wset_window_end_valid): Remove.
1261 * window.c (adjust_window_count): Clear window_end_valid.
1262 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1263 (Fwindow_line_height, set_window_buffer, Frecenter)
1264 (Fsplit_window_internal, Fdelete_other_windows_internal)
1265 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1266 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1267 * xdisp.c (check_window_end, reconsider_clip_changes)
1268 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1269 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1270 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1272 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1274 * xdisp.c (mark_window_display_accurate): Simplify the loop
1275 assuming that the only one of vchild, hchild or buffer window
1276 slots is non-nil. Call mark_window_display_accurate_1 for
1277 the leaf windows only.
1278 (mark_window_display_accurate_1): Always assume leaf window.
1281 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1283 * emacs.c (Qkill_emacs_hook): Now static.
1285 * fileio.c (Finsert_file_contents): Simplify.
1286 Remove unnecessary assignments and tests.
1288 2013-01-21 Eli Zaretskii <eliz@gnu.org>
1290 * w32.c (acl_set_file): Don't test for errors unless
1291 set_file_security returns FALSE. Avoids spurious errors when
1294 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1296 * fileio.c (Finsert_file_contents): Revert code introduced at
1297 2013-01-18 in favor of the simpler and generally better fix.
1298 Save stack space by removing 'buffer' and reusing 'read_buf'
1301 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1303 * lisp.h (eabs): Define unconditionally (Bug#13419).
1304 The old "#if !defined (eabs)" was an unnecessary revenant of back
1305 when this macro was called "abs". Document 'eabs' better.
1307 2013-01-19 Glenn Morris <rgm@gnu.org>
1309 * fns.c (Frandom): Doc fix.
1311 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1313 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1314 segfault when there are lots of overlays.
1316 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
1317 when there are lots of overlays.
1318 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
1319 for the details and a way to reproduce.
1321 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1323 * fileio.c: Use O_APPEND to append.
1324 This corresponds better to the natural interpretation of "append",
1325 and avoids the need to open the output file twice, or to invoke
1326 lseek when APPEND is neither nil nor a number.
1327 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1328 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1329 file possibly twice, and lseeking to its end; this avoids the
1330 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1331 at the same time: the combination is never needed and apparently
1332 it doesn't work with DOS_NT.
1334 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1335 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1337 Allow floating-point file offsets.
1338 Problem reported by Vitalie Spinu in
1339 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1340 * fileio.c (emacs_lseek): Remove.
1341 (file_offset): New function.
1342 (Finsert_file_contents, Fwrite_region): Use it.
1344 2013-01-19 Chong Yidong <cyd@gnu.org>
1346 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1347 aborting on Fsignal (Bug#13289).
1349 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1351 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1352 set_file_security as failure due to insufficient privileges.
1353 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1354 (fstat): Return owner and group like 'stat' and 'lstat' do.
1356 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1358 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1359 The bug was observed on Ubuntu operating inside a virtual machine,
1360 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1361 The workaround introduces a race condition on non-buggy hosts,
1362 but it's an unlikely race and anyway there's a nearly identical
1363 nearby race that can't be fixed.
1364 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1366 (Fwrite_region): Test for file system time stamp bug.
1367 (init_fileio): New function.
1368 * lisp.h (init_fileio): Declare it.
1369 * emacs.c (main): Call it.
1371 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1372 and make it more consistent with other stat-failure diagnostics.
1374 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1376 Fix crash when inserting data from non-regular files.
1377 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1378 for the error description produced by valgrind.
1379 * fileio.c (read_non_regular): Rename to read_contents.
1380 Free Lisp_Save_Value object used to pass parameters.
1381 (read_non_regular_quit): Rename to read_contents_quit.
1382 (Finsert_file_contents): Redesign internal file reading loop to adjust
1383 gap and end positions after each read and so help make_gap to work
1384 properly. Do not signal an I/O error too early and so do not leave
1385 not yet decoded characters in a buffer, which was the reason of
1386 redisplay crash. Use list2 to build return value. Adjust comments.
1388 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1390 Close a race when statting and reading files (Bug#13149).
1391 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1392 This avoids a race if the file is renamed between stat and open.
1393 This race is not the problem originally noted in Bug#13149;
1394 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1396 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1398 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1399 objects, related functions and macros.
1400 (make_save_value): Adjust prototype.
1401 (make_save_pointer): New prototype.
1402 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1403 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1404 * alloc.c (format_save_value): Rename to make_save_value.
1405 (make_save_pointer): New function.
1406 (record_xmalloc): Use make_save_pointer.
1407 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1408 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1409 Change users of make_save_value to make_save_pointer.
1410 Likewise for format_save_value and make_save_value.
1412 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1414 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1415 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1416 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1419 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1421 * alloc.c (free_save_value): Now static.
1423 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1425 * keymap.c (map_keymap_internal): Use format_save_value.
1426 (map_keymap_char_table_item): Adjust accordingly.
1427 * fileio.c (non_regular_fd, non_regular_inserted)
1428 (non_regular_nbytes): Remove.
1429 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1430 Use format_save_value to pass parameters to read_non_regular.
1431 (read_non_regular): Use XSAVE_ macros to extract parameters.
1433 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1435 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1437 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1439 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1440 extraction from any Lisp_Save_Value slot. Add type checking.
1441 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1442 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1443 * xselect.c: All users changed.
1445 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1447 Some convenient bits to deal with Lisp_Save_Values.
1448 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1449 (allocate_misc): Remove prototype.
1450 (format_save_value): New prototype.
1451 * alloc.c (allocate_misc): Revert back to static.
1452 (format_save_value): New function to build Lisp_Save_Value
1453 object with the specified internal structure.
1454 (make_save_value): Reimplement using format_save_value.
1455 * editfns.c (save_excursion_save): Use format_save_value.
1456 (save_excursion_restore): Use XSAVE_OBJECT.
1458 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1460 Avoid needless casts with XSAVE_POINTER.
1461 * alloc.c (mark_object) [GC_MARK_STACK]:
1462 * dired.c (directory_files_internal_unwind):
1463 * fileio.c (do_auto_save_unwind):
1464 * gtkutil.c (pop_down_dialog):
1465 * keymap.c (map_keymap_char_table_item):
1466 * lread.c (load_unwind):
1467 * nsmenu.m (pop_down_menu):
1468 * print.c (print_object) [GC_MARK_STACK]:
1469 * xfns.c (clean_up_file_dialog):
1470 * xmenu.c (cleanup_widget_value_tree):
1471 Omit casts between XSAVE_POINTER and a pointer type.
1473 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1475 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1476 * eval.c (eval_sub): Protect `form' from being GCed before its
1477 car and cdr becomes protected with the backtrace entry.
1479 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1481 Make Lisp_Save_Value more versatile storage for up to four objects.
1482 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1483 (struct Lisp_Save_Value): New layout. Adjust comments.
1484 (XSAVE_POINTER): New macro.
1485 (XSAVE_INTEGER): Likewise.
1486 (allocate_misc): Add prototype.
1487 (free_misc): Likewise.
1488 * alloc.c (allocate_misc): Now global.
1489 (free_misc): Likewise. Adjust comment.
1490 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1491 (free_save_value): Likewise.
1492 (mark_object): Likewise.
1493 * editfns.c (save_excursion_save): Pack everything within
1494 Lisp_Save_Value and so avoid xmalloc.
1495 (save_excursion_restore): Adjust to match new layout. Use free_misc
1496 because we do not allocate extra memory any more. Add eassert.
1497 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1498 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1499 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1500 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1501 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1503 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1505 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1506 (nsfont_draw): Remove disabling of LCD smoothing.
1507 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1508 Bug#11484 with LCD smoothing on.
1510 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
1512 Fix SIGDANGER handlers, for AIX (Bug#13408).
1513 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1514 Move handlers here from emacs.c; they were out of place.
1516 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1518 * xterm.c (syms_of_xterm): Adjust documentation for
1519 scroll-bar-adjust-thumb-portion.
1521 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
1523 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1524 determine whether scroll bar thumb size should be adjusted or
1525 not. Use variable for MOTIF.
1527 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1530 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1532 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1534 (doCommandBySelector:): Set processingCompose to NO.
1536 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1537 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1538 (nsfont_list_family): Add block/unblock_input calls.
1539 (nsfont_open): Move block_input earlier. Add unblock_input before early
1541 (nsfont_draw): Add block/unblock_input calls.
1543 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1545 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1546 for old_charpos and old_bytepos.
1548 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1550 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1551 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1552 Clear tzvalbuf_in_environ if this workaround is in effect.
1553 Problem and fix reported by Kazuhiro Ito.
1555 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1557 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1558 Fix ambiguous doc string cross-reference(s).
1560 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1561 doc string cross-reference(s).
1563 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1564 string cross-reference(s).
1566 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1568 Avoid unnecessary byte position calculation for the gap movement.
1569 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1570 anyway, all of them should use move_gap_both instead.
1571 * lisp.h (move_gap): Remove prototype.
1572 * insdel.c (move_gap): Remove.
1573 (move_gap_both): Add eassert.
1574 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1575 * xml.c (parse_region): Likewise.
1577 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1579 emacsclient -t should not suspend Emacs server (Bug#13387)
1580 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1582 * term.c (init_tty): Use them instead of rolling our own code.
1583 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1584 switches from 'signal' to 'pthread_sigmask', which is safer in
1585 multithreaded applications.
1586 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1587 which has already arranged for that.
1588 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1589 This is the main part of the bug fix.
1591 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
1593 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1594 x_last_font_name (Bug#13403).
1596 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1598 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1599 the type of per-buffer values where appropriate.
1600 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1601 predicate, which is how it's really used now. Adjust comment.
1602 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1603 * buffer.c (buffer_slot_type_mismatch): Remove.
1604 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1605 predicate. Adjust comment.
1606 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1607 fill-column, left-margin, tab-width, buffer-saved-size,
1608 left-margin-width, right-margin-width, left-fringe-width,
1609 right-fringe-width, scroll-bar-width and buffer-display-count.
1610 Use Qstringp for default-directory, buffer-file-name,
1611 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1612 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1614 * data.c (store_symval_forwarding): Adjust to call the predicate.
1616 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
1618 * w32.c (get_name_and_id, acl_set_file):
1619 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1621 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1623 * lisp.h (make_gap_1): New prototype.
1624 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1626 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1628 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
1629 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
1630 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1631 (make_gap_1): New function to adjust the gap of any buffer.
1632 * coding.c (coding_alloc_by_making_gap): Use it.
1633 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1634 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1636 2013-01-08 Juri Linkov <juri@jurta.org>
1638 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1639 of (supports :underline (:style wave)). (Bug#13000)
1641 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1643 * undo.c (Fprimitive_undo): Move to simple.el.
1644 (syms_of_undo): Remove declarations for Sprimitive_undo.
1646 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1648 * keyboard.c (echo_add_key): Rename from echo_add_char.
1650 2013-01-06 Chong Yidong <cyd@gnu.org>
1652 * keyboard.c (echo_add_char): New function, factored out from
1653 echo_char. Don't add a space if the previous echo string was
1655 (echo_char): Use it.
1656 (read_key_sequence): When echoing mock input, ensure that the
1657 trailing dash is properly added.
1659 2013-01-05 Eli Zaretskii <eliz@gnu.org>
1661 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1662 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
1663 digits for buffer positions, before misalignment starts.
1664 Display "0" for integer "object" field.
1665 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1666 Display the newline glyph more unambiguously.
1668 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1670 * nsterm.m (ns_draw_underwave):
1671 * w32term.c (w32_draw_underwave):
1672 * xterm.c (x_draw_underwave): Make underwave look more triangular
1673 and also degrade gracefully for small fonts. (Bug#13000)
1675 * nsterm.m (ns_draw_text_decoration):
1676 * w32term.c (x_draw_glyph_string):
1677 * xterm.c (x_draw_glyph_string): Don't use previous underline
1678 thickness and position if previous underline type is underwave.
1680 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1682 * fileio.c (Ffile_acl): Undocument return format.
1684 2013-01-02 Glenn Morris <rgm@gnu.org>
1686 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1688 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1691 * dired.c (file_name_completion):
1692 * doc.c (get_doc_string):
1693 * floatfns.c (round2):
1694 * font.c (font_score, font_delete_unmatched):
1695 * fringe.c (compute_fringe_widths):
1696 * lread.c (read_list):
1697 * minibuf.c (Ftry_completion):
1698 * term.c (tty_ins_del_lines):
1699 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1700 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1702 2012-12-31 Eli Zaretskii <eliz@gnu.org>
1704 * w32.c (unsetenv): Set up the string passed to _putenv
1706 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
1707 for the bug this caused.
1709 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1711 * coding.c (Qmac): Now static.
1713 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1715 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1716 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1717 handlebox_widget. Set toolbar_in_hbox to false/true, set
1718 toolbar_is_packed to true.
1719 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1720 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1721 Show all on TOOLBAR_TOP_WIDGET.
1722 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1723 by TOOLBAR_TOP_WIDGET.
1724 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1725 Check toolbar_is_packed.
1726 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1727 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1728 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1730 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1731 (xg_update_menubar): Update title only if
1732 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1733 (xg_update_submenu): Skip tearoff only if
1734 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1735 (xg_initialize): Initialize xg_detached_menus only if
1736 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1738 * xterm.h (struct x_output): Surround handlebox_widget with
1739 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1740 toolbar_in_hbox is bool.
1742 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
1744 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1745 (LIBS_GNUSTEP): Define.
1746 (LIBES): Add $(LIBS_GNUSTEP).
1747 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1749 2012-12-30 Eli Zaretskii <eliz@gnu.org>
1751 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1752 continuation glyph on a TTY with an indication of an empty line.
1755 2012-12-29 Eli Zaretskii <eliz@gnu.org>
1757 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1758 file's SELinux context or ACLs successfully set, nil otherwise.
1760 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
1762 * w32proc.c (reader_thread): Avoid passing NULL handles to
1763 SetEvent and WaitForSingleObject.
1765 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1767 Port EXTERNALLY_VISIBLE to Clang 3.2.
1768 * conf_post.h (__has_attribute): New macro.
1769 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1771 2012-12-27 Glenn Morris <rgm@gnu.org>
1773 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1774 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1776 2012-12-27 Eli Zaretskii <eliz@gnu.org>
1778 * fileio.c (file_name_as_directory, directory_file_name):
1779 Accept an additional argument MULTIBYTE to indicate whether the input C
1780 came from a multibyte or a unibyte Lisp string; all callers
1781 adjusted. Don't assume the input string is always multibyte.
1783 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1784 don't ENCODE_FILE them, and return a unibyte string if the input
1786 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1787 don't assume the input strings will always be multibyte. If the
1788 input strings are multibyte, decode strings obtained from C
1791 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1793 * lisp.h (toplevel): Add two notices to the comment about
1794 defining a new Lisp data type.
1795 * print.c (print_object): If Lisp_Save_Value object's pointer
1796 is the address of a memory area containing Lisp_Objects, try
1798 * alloc.c (valid_lisp_object_p): Adjust comment.
1800 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1802 * keyboard.c (record_asynch_buffer_change): Initialize an event
1803 only if it's really needed.
1804 * frame.h (enum output_method): Remove output_mac member since
1805 it's a leftover from the deleted code.
1806 * frame.c (Fframep): Adjust user here ...
1807 * terminal.c (Fterminal_live_p): ... and here.
1808 * coding.c (Qmac): Now here because it's only used to denote
1809 end-of-line encoding type.
1810 (syms_of_coding): DEFSYM it.
1811 * frame.h (Qmac): Remove duplicated declaration.
1813 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1815 * window.c (select_window_1): Now static, since it's used only here.
1817 2012-12-25 Eli Zaretskii <eliz@gnu.org>
1819 * window.c (window_body_cols): Subtract display margins from the
1820 window body width on TTYs as well. See
1821 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1822 for the original report.
1824 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1826 * xdisp.c (redisplay_window): Remove inner local variable
1827 because the outer shadowed one has the same meaning.
1828 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1830 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1831 (xg_create_tool_bar): Adjust users.
1833 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1835 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1836 * buffer.c (Fget_buffer_create): Use it to set compact field of
1837 struct buffer_text to avoid accessing an uninitialized value
1838 when compact_buffer is called for the first time.
1839 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
1840 (Fset_buffer_modified_p): Use buffer_window_count to check
1841 whether the buffer is displayed in some window.
1842 * xdisp.c (message_dolog): Likewise.
1844 2012-12-23 Eli Zaretskii <eliz@gnu.org>
1846 * w32.c (acl_set_file): If setting the file security descriptor
1847 fails, and the new DACL is identical to the existing one, silently
1848 return success. This fixes problems for users backing up their
1849 own files without having the necessary privileges for setting
1850 security descriptors.
1852 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1854 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1855 after WaitForSingleObject returns normally. This expedites reader
1856 thread shutdown when delete_child triggers it.
1857 (reap_subprocess): More accurate commentary for why we call
1858 delete_child only when cp->fd is negative.
1860 * w32.c (sys_close): Do not call delete_child on a subprocess
1861 whose handle is not yet closed. Instead, set its file descriptor
1862 to a negative value, so that reap_subprocess will call
1863 delete_child on that subprocess when its SIGCHLD arrives.
1864 This avoids closing handles used for communications between sys_select
1865 and reader_thread, which doesn't give sys_select a chance to
1866 notice that the process exited and invoke the SIGCHLD handler for
1869 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1871 * nsfns.m (Fns_do_applescript): Run event loop until script has
1872 been executed (Bug#12969).
1873 (ns_run_ascript): Chech as_script for nil, set to nil after
1876 2012-12-22 Martin Rudalics <rudalics@gmx.at>
1878 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1880 2012-12-22 Eli Zaretskii <eliz@gnu.org>
1882 * w32term.c (w32fullscreen_hook): New function.
1883 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1885 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1887 * fileio.c (Finsert_file_contents): Doc fix.
1889 * w32proc.c (new_child, delete_child, find_child_pid): For a
1890 subprocess, consider its slot being in use as long as its process
1891 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1892 slot when a new process is started immediately after killing
1893 another one, without waiting enough time for the first process to
1894 be reaped and resources allocated for it be orderly freed.
1896 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1898 2012-12-21 Chong Yidong <cyd@gnu.org>
1900 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1902 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1904 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1906 * w32.c (get_name_and_id): Always pass NULL as the first argument
1907 of lookup_account_sid. Avoids crashes with UNC file names that
1908 refer to DFS domains, not to specific machine names. (Bug#12621)
1909 Remove now unused argument FNAME; all callers changed.
1910 (get_file_owner_and_group): Remove now unused argument FNAME; all
1913 2012-12-21 Chong Yidong <cyd@gnu.org>
1915 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1916 error for invalid chars, don't check for a nil return value.
1918 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1920 Avoid calls to CHAR_TO_BYTE if byte position is known.
1921 * editfns.c (make_buffer_string_both): Use move_gap_both.
1922 (Fbuffer_string): Use make_buffer_string_both.
1923 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1925 (buf_bytepos_to_charpos): Likewise.
1926 (charpos_to_bytepos): Remove.
1927 * fileio.c (Finsert_file_contents): Use move_gap_both.
1928 * search.c (Freplace_match): Likewise.
1929 * process.c (process_send_region): Likewise. Use convenient
1930 names for byte positions.
1931 * lisp.h (charpos_to_bytepos): Remove prototype.
1932 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1933 * insdel.c (move_gap): Likewise.
1935 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1937 * xdisp.c (redisplay_internal): Remove now-unused local.
1939 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1941 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1942 (redisplay_internal): Don't bother selecting the frame to get the
1943 proper value of frame-local variables (bug#13225).
1945 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1947 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1948 Rename 4th argument since it may be buffer or string. Adjust comment.
1949 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1951 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1953 * coding.c (Fdetect_coding_region): Do not check start and end with
1954 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1955 (code_convert_region): Likewise.
1957 2012-12-18 Eli Zaretskii <eliz@gnu.org>
1959 * w32.c (acl_get_file, acl_set_file): Run the file name through
1960 map_w32_filename, and resolve any symlinks in the file name, like
1962 (acl_set_file): Call revert_to_self, if any privileges were
1965 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
1967 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1968 ($(BLD)/w32.$(O)): Update dependencies.
1970 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1972 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1973 propagate redisplay's scrolling (if any) to the right window.
1974 (redisplay_internal): Use ensure_selected_frame.
1975 (display_mode_lines): Complete last fix.
1976 * window.c (select_window_1): New func, extracted from select_window.
1977 (select_window): Use it.
1978 * window.h (select_window_1): Declare.
1980 2012-12-17 Eli Zaretskii <eliz@gnu.org>
1982 Emulate Posix ACL APIs on MS-Windows.
1983 * w32.c: Include sddl.h and sys/acl.h.
1984 (SDDL_REVISION_1): Define if not already defined.
1985 (g_b_init_get_security_descriptor_dacl)
1986 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1987 (g_b_init_is_valid_security_descriptor)
1988 (g_b_init_set_file_security): New static flags.
1989 (globals_of_w32): Initialize them to zero.
1990 (SetFileSecurity_Name): New string constant.
1991 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1992 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1993 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1994 (IsValidSecurityDescriptor_Proc): New typedefs.
1995 (get_file_security, get_security_descriptor_owner)
1996 (get_security_descriptor_group): Set errno to ENOTSUP.
1997 (set_file_security, get_security_descriptor_dacl)
1998 (is_valid_security_descriptor, convert_sd_to_sddl)
1999 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2000 (acl_free, acl_get_file, acl_set_file): New functions.
2002 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2004 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2006 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2007 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2008 for some of that bug's symptoms can now cause Emacs to abort.
2009 Remove the workaround.
2010 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2011 The bug that caused SIGCHLD to get lost has been fixed, and the
2012 workaround for it can now cause Emacs to abort.
2014 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2016 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2017 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2018 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2020 2012-12-16 Romain Francoise <romain@orebokech.com>
2022 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2023 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2024 and copy ACL entries of file in addition to SELinux context if set.
2025 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2027 * Makefile.in (LIBACL_LIBS): New macro.
2030 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2032 * fileio.c (internal_delete_file): Use bool for boolean.
2034 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2036 Fix bug #13079 on MS-Windows with temp files not being deleted.
2037 * w32.h (_child_process): New members input_file and
2039 (register_child): First argument is now pid_t.
2040 (record_infile, record_pending_deletion): New prototypes.
2042 * w32proc.c (new_child): Initialize input_file and
2043 pending_deletion members of the child.
2044 (delete_child): Delete the child's temporary input file, if any,
2045 that is pending deletion.
2046 (register_child): First argument is now pid_t.
2047 (record_infile, record_pending_deletion): New functions.
2048 (reap_subprocess): Fix a typo in DebPrint string.
2049 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2051 * fileio.c (internal_delete_file): Return an int again: non-zero
2052 if delete-file succeeds, zero otherwise.
2054 * lisp.h (internal_delete_file): Adjust prototype.
2056 * callproc.c (Fcall_process): Don't overwrite infile with result
2058 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2059 asynchronous subprocess, record the name of the input file name,
2061 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2062 delete the file, record it as pending deletion when the subprocess
2065 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2067 * editfns.c [HAVE_PWD_H]: Include grp.h.
2069 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2071 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2073 Fix permissions bugs with setgid directories etc. (Bug#13125)
2074 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2075 to mark it as a placeholder. The old value was often wrong.
2076 The only user of this attribute has been changed to use
2077 file-ownership-preserved-p instead, with its new group arg.
2078 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2080 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2082 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2083 Keep selected_window and selected_frame in sync.
2085 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2087 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2088 try to get accurate owner and group information from NT file
2089 security APIs. This is to make most callers of 'stat' and
2090 'lstat', which don't need that information, much faster.
2092 * dired.c (Ffile_attributes) [WINDOWSNT]:
2093 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2094 owner and group information from 'lstat'.
2096 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2098 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2099 as that confuses set-auto-coding, so insist on the head-read
2100 returning the full 1024 bytes. Let lseek compute the tail offset;
2101 less work for us. Do not ignore I/O errors when reading the tail.
2103 * xdisp.c: Minor style fixes.
2104 (init_iterator): Hoist assignment out of if-expression.
2105 (markpos_of_region): Callers now test for sign, not for -1.
2107 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2109 Minor redisplay optimization when the region length is zero.
2110 * xdisp.c (markpos_of_region): New function.
2111 (init_iterator): Do not highlight the region of zero length.
2112 (redisplay_window): Check whether the region is of non-zero length.
2113 (try_cursor_movement): Allow if the region length is zero.
2114 (try_window_reusing_current_matrix, try_window_id): Likewise.
2116 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2118 * search.c (search_buffer): Check the inverse translations of each
2119 character in pattern when the buffer being searched is unibyte.
2122 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2124 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2125 files, fixing a regression from 24.2.
2126 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2128 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2130 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2131 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2132 Remove unnecessary S_ISLNK test, as (contra the comments) this
2133 function can't copy symlinks. Improve quality of error message
2134 when attempting to copy files that are neither regular files nor
2137 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2139 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2140 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2141 * window.c (Frecenter):
2142 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2143 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2145 2012-12-12 Daniel Colascione <dancol@dancol.org>
2147 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2148 the dumped Emacs is not a sparse file, greatly improving Cygwin
2149 "make bootstrap" performance.
2151 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
2153 * inotify.c (inotify_callback): Generate an Emacs event for every
2154 incoming inotify event.
2156 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2158 * xdisp.c (handle_face_prop): Fix logic of computing
2159 it->start_of_box_run_p.
2160 (append_space_for_newline): If the glyph row is R2L, reset the
2161 iterator's end_of_box_run_p flag before prepending the space glyph.
2162 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2163 iterator's start_of_box_run_p flag before prepending the stretch.
2164 (append_glyph, produce_image_glyph, append_composite_glyph)
2165 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2166 left_box_line_p and right_box_line_p flags of the glyph for R2L
2167 glyph rows. (Bug#13011)
2169 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2171 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2172 if changed buffer is not shown in a window.
2173 * insdel.c (prepare_to_modify_buffer): Likewise.
2174 * window.c (replace_buffer_in_windows_safely): Do nothing
2175 if buffer is not shown in a window.
2176 (Fforce_window_update): Likewise if string or buffer argument
2179 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2181 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2182 encoded_file_name, which is what it is.
2184 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2186 Consistently use marker_position and marker_byte_position.
2187 * fringe.c (Ffringe_bitmaps_at_pos):
2188 * indent.c (Fvertical_motion):
2189 * insdel.c (prepare_to_modify_buffer):
2190 * keyboard.c (make_lispy_position):
2191 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2192 (window_scroll_pixel_based, displayed_window_lines)
2193 (Fset_window_configuration):
2194 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2195 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2196 Replace direct access to marker fields with calls
2197 to marker_position and/or marker_byte_position.
2199 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
2201 * makefile.w32-in (SIG2STR_H): New macro.
2202 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2203 ($(BLD)/w32notify.$(O)): Update dependencies.
2205 2012-12-10 Daniel Colascione <dancol@dancol.org>
2207 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2208 Windows file notification functionality unless WINDOWSNT.
2210 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2213 * w32fns.c (cache_system_info): Initialize the global hinst
2214 variable here so various initialization calls DTRT.
2216 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2217 (hinst): Remove unneeded extern declaration.
2218 (_start): Remove initialization of above variables; remove
2219 initialization of hinst, as cache_system_info now does that.
2221 * emacs.c (main): Call cache_system_info early in startup; we
2222 previously weren't calling it in Cygwin builds.
2224 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2225 Teach the autoconf build system how to compile a Windows resource file
2226 and link it to Emacs.
2228 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2230 Per-buffer window counters.
2231 * buffer.h (struct buffer): New member window_count.
2232 (buffer_window_count): New function.
2233 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2234 Initialize window_count.
2235 (Fkill_buffer): Verify window_count for the buffer being killed.
2236 (modify_overlay): Do not force redisplay if buffer is not shown
2238 (init_buffer_once): Initialize window_count for buffer_defaults
2239 and buffer_local_symbols.
2240 * window.h (buffer_shared): Remove declaration.
2241 (wset_buffer): Convert from inline ...
2242 * window.c (wset_buffer): ... to an ordinary function.
2243 (adjust_window_count): New function.
2244 (make_parent_window): Use it.
2245 * xdisp.c (buffer_shared): Remove.
2246 (redisplay_internal, redisplay_window): Adjust users.
2247 (buffer_shared_and_changed): Use per-buffer window counter.
2249 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2251 Support for filesystem notifications on MS-Windows.
2252 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2253 and this is a TTY frame, signal the caller that keyboard input is
2256 * w32xfns.c (drain_message_queue): Now returns an int: an
2257 indication whether any WM_EMACS_FILENOTIFY messages were found in
2260 * w32inevt.c (handle_file_notifications): New function.
2261 (w32_console_read_socket): Call it to process file notifications.
2263 * w32console.c (initialize_w32_display): Record the main thread ID
2266 * deps.mk (inotify.o): New dependency list.
2268 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2270 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2271 (WM_EMACS_END): Bump value by 1.
2272 (notification_buffer_in_use, file_notifications)
2273 (notifications_size, notifications_desc): Declare.
2274 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2277 * w32term.c (lispy_file_action, queue_notifications): New functions.
2278 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2279 <Qrenamed_to>: New symbols.
2280 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2282 * w32notify.c: New file, implements file event notifications for
2285 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2286 by posting it to the w32_read_socket queue.
2288 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2290 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2291 (GLOBAL_SOURCES): Add w32notify.c
2292 ($(BLD)/w32notify.$(O)): New set of dependencies.
2294 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2296 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2297 Handle FILE_NOTIFY_EVENT.
2298 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2299 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2300 w32notify-handle-event by default.
2302 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2305 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2307 Support for filesystem notifications on GNU/Linux via inotify.
2308 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
2310 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2312 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2313 (syms_of_keyboard): DEFSYM it.
2314 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2315 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2316 Qfile_inotify events.
2317 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2318 special-event-map to inotify-handle-event.
2320 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2322 * Makefile.in (base_obj): Add inotify.o.
2324 * inotify.c: New file.
2326 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
2328 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2330 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
2332 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2333 DWORD_PTR, for compatibility with 64-bit builds.
2335 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
2336 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2337 (system_process_attributes): Use SIZE_T rather than DWORD, for
2338 compatibility with 64-bit builds.
2340 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
2342 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2344 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2346 * indent.c (Fvertical_motion): If a display string will be
2347 displayed on the left or the right margin, don't consider it as a
2348 factor in cursor positioning. (Bug#13108)
2350 2012-12-10 Martin Rudalics <rudalics@gmx.at>
2352 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2354 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2356 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2359 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2361 * w32.c (unsetenv): Return 0 if the input string is too long.
2363 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2365 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2366 * alloc.c (xputenv): New function.
2367 * dbusbind.c (Fdbus_init_bus):
2369 * xterm.c (x_term_init):
2370 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2371 * editfns.c (initial_tz): Move static var decl up.
2372 (tzvalbuf_in_environ): New static var.
2373 (init_editfns): Initialize these two static vars.
2374 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2375 Save old TZ value on stack, if it's small.
2376 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2377 instead, use xputenv+unsetenv to set and restore TZ.
2378 (environbuf): Remove static var. All uses removed.
2379 (Fset_time_zone_rule): Do not save TZ and environ;
2380 no longer needed here.
2381 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2382 Move to inside set_time_zone_rule; they don't need file scope any more.
2383 (set_time_zone_rule): Maintain the TZ=value string separately.
2384 (syms_of_editfns): Don't initialize initial_tz;
2385 init_editfns now does it.
2386 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2387 * lisp.h (xputenv): New decl.
2389 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2391 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2393 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2395 * w32.c (unsetenv, sys_putenv): New functions.
2397 2012-12-08 Chong Yidong <cyd@gnu.org>
2399 * editfns.c (Finsert_char): Make the error message more
2400 informative (Bug#12992).
2402 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2404 Simplify get_lim_data.
2405 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2406 Remove USG and vlimit methods; no longer used these days.
2407 Add #error catchall just in case.
2409 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2410 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2411 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2412 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2413 (deleted_pid_list, Fdelete_process, create_process)
2414 (record_child_status_change, handle_child_signal, deliver_child_signal)
2415 (init_process_emacs, syms_of_process):
2416 Assume SIGCHLD is defined.
2417 (parse_signal): Remove. All uses removed.
2418 (abbr_to_signal): New static function.
2419 (Fsignal_process): Use it to convert signal names to ints.
2420 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2421 kill (getpgrp (), ...).
2422 (emacs_sigaction_init): Assume SIGCHLD is defined.
2423 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2424 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2425 * syssignal.h (EMACS_KILLPG): Remove.
2426 All uses replaced by 'kill' with a negative pid.
2427 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2428 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2430 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2432 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2433 This will cause a production Emacs to dump core instead of
2436 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2438 * frame.c (make_frame): Do not set window's buffer to t.
2439 * window.c (Fsplit_window_internal): Likewise. Previously it was
2440 used to indicate that the window is being set up. Now we use
2441 set_window_buffer for all new windows, so the condition in ...
2442 (Fset_window_buffer): ... is always true and can be removed.
2444 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2446 Convenient macro to check whether the buffer is hidden.
2447 * buffer.h (BUFFER_HIDDEN_P): New macro.
2448 * frame.c (make_frame): Use it. Adjust comment.
2449 * buffer.c (candidate_buffer): New function.
2450 (Fother_buffer, other_buffer_safely): Use it.
2452 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2454 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2455 if the child process is still running. Instead, exit the wait
2456 loop and return zero. (Bug#13086)
2458 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2460 * frame.h (x_char_width, x_char_height): Remove prototypes.
2461 * w32term.h (x_char_width, x_char_height): Likewise.
2462 * xfns.c (x_char_width, x_char_height): Remove.
2463 * w32fns.c (x_char_width, x_char_height): Likewise.
2464 * nsfns.c (x_char_width, x_char_height): Likewise.
2465 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2467 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2468 * keyboard.c (command_loop_1): Remove prototype.
2469 (command_loop_2, top_level_1): Add static to match prototype.
2471 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2473 Fix a recently-introduced delete-process race condition.
2474 * callproc.c, process.h (record_kill_process):
2475 New function, containing part of the old call_process_kill.
2476 (call_process_kill): Use it.
2477 This does not change call_process_kill's behavior.
2478 * process.c (Fdelete_process): Use record_kill_process to fix a
2479 race condition that could cause Emacs to lose track of a child.
2481 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2483 Avoid code duplication between prev_frame and next_frame.
2484 * frame.c (candidate_frame): New function. Add comment.
2485 (prev_frame, next_frame): Use it. Adjust comment.
2487 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2489 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2490 fails, signal an error instead of continuing with an empty
2492 Encode expanded temp file pattern before passing it to mkstemp or
2495 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2496 Encode the file name before passing it to dostounix_filename, in
2497 case it will downcase it (under w32-downcase-file-names).
2500 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2502 Minor call-process cleanups.
2503 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2504 at the same time as other platforms, to simplify analysis.
2505 No need for fd0_volatile since we have synch_process_fd.
2506 Avoid needless emacs_close; arg is always negative.
2508 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2510 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2513 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2515 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2516 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2517 and mouse_face_hidden members to a bitfields.
2518 * frame.h (struct frame): Remove set-but-not-used space_width member.
2519 (FRAME_SPACE_WIDTH): Remove.
2520 * nsterm.m, w32term.c, xterm.c: Adjust users.
2521 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2522 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2523 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2524 members to a bitfields.
2526 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2528 Don't let call-process be a zombie factory (Bug#12980).
2529 Fixing this bug required some cleanup of the signal-handling code.
2530 As a side effect, this change also fixes a longstanding rare race
2531 condition whereby Emacs could mistakenly kill unrelated processes,
2532 and it fixes a bug where a second C-g does not kill a recalcitrant
2533 synchronous process in GNU/Linux and similar platforms.
2534 The patch should also fix the last vestiges of Bug#9488,
2535 a bug which has mostly been fixed on the trunk by other changes.
2536 * callproc.c, process.h (synch_process_alive, synch_process_death)
2537 (synch_process_termsig, sync_process_retcode):
2538 Remove. All uses removed, to simplify analysis and so that
2539 less consing is done inside critical sections.
2540 * callproc.c (call_process_exited): Remove. All uses replaced
2541 with !synch_process_pid.
2542 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2543 These take the role of what used to be in unwind-protect arg.
2545 (block_child_signal, unblock_child_signal):
2546 New functions, to avoid races that could kill innocent-victim processes.
2547 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2548 (call_process_kill): Record killed processes as deleted, so that
2549 zombies do not clutter up the system. Do this inside a critical
2550 section, to avoid a race that would allow the clutter.
2551 (call_process_cleanup): Fix code so that the second C-g works again
2552 on common platforms such as GNU/Linux.
2553 (Fcall_process): Create the child process in a critical section,
2554 to fix a race condition. If creating an asynchronous process,
2555 record it as deleted so that zombies do not clutter up the system.
2556 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2557 light of these changes. Omit unnecessary call to emacs_close
2558 before failure, as the unwind-protect code does that.
2559 * callproc.c (call_process_cleanup):
2560 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2561 * process.c (record_deleted_pid): New function, containing
2562 code refactored out of Fdelete_process.
2563 (Fdelete_process): Use it.
2564 (process_status_retrieved): Remove. All callers changed to use
2565 child_status_change.
2566 (record_child_status_change): Remove, folding its contents into ...
2567 (handle_child_signal): ... this signal handler. Now, this
2568 function is purely a handler for SIGCHLD, and is not called after
2569 a synchronous waitpid returns; the synchronous code is moved to
2570 wait_for_termination. There is no need to worry about reaping
2571 more than one child now.
2572 * sysdep.c (get_child_status, child_status_changed): New functions.
2573 (wait_for_termination): Now takes int * status and bool
2574 interruptible arguments, too. Do not record child status change;
2575 that's now the caller's responsibility. All callers changed.
2576 Reimplement in terms of get_child_status.
2577 (wait_for_termination_1, interruptible_wait_for_termination):
2578 Remove. All callers changed to use wait_for_termination.
2579 * syswait.h: Include <stdbool.h>, for bool.
2580 (record_child_status_change, interruptible_wait_for_termination):
2582 (record_deleted_pid, child_status_changed): New decls.
2583 (wait_for_termination): Adjust to API changes noted above.
2585 * bytecode.c, lisp.h (Qbytecode): Remove.
2586 No longer needed after 2012-11-20 interactive-p changes.
2588 2012-12-03 Eli Zaretskii <eliz@gnu.org>
2590 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2591 the scroll margin, move point outside the margin. (Bug#13055)
2593 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2595 * gtkutil.c (my_log_handler): New function.
2596 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2598 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2600 * lisp.h (modify_region): Rename to...
2601 (modify_region_1): ...new prototype.
2602 * textprop.c (modify_region): Now static. Adjust users.
2603 * insdel.c (modify_region): Rename to...
2604 (modify_region_1): ...new function to work with current buffer.
2605 Adjust comment and users. Use true and false for booleans.
2607 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2609 * alloc.c (free_save_value): New function.
2610 (safe_alloca_unwind): Use it.
2611 * lisp.h (free_save_value): New prototype.
2612 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2614 (save_excursion_restore): Adjust to match saved data structure.
2615 Use free_save_value to offload some work from GC. Drop obsolete
2618 2012-12-03 Chong Yidong <cyd@gnu.org>
2620 * fileio.c (Vauto_save_list_file_name): Doc fix.
2622 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
2624 * w32fns.c: Remove prototype of atof.
2625 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
2627 (file_dialog_callback): Make it UINT_PTR.
2629 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2632 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2633 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2636 2012-12-03 Glenn Morris <rgm@gnu.org>
2638 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
2640 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2642 Fix xpalloc confusion after memory is exhausted.
2643 * alloc.c (xpalloc): Comment fix.
2644 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2645 and signals an error, do not clear charset_table_size, as
2646 charset_table is still valid.
2647 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2649 Use execve to avoid need to munge environ (Bug#13054).
2650 * callproc.c (Fcall_process):
2651 * process.c (create_process):
2652 Don't save and restore environ; no longer needed.
2653 * callproc.c (child_setup):
2654 Use execve, not execvp, to preserve environ.
2656 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2658 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2660 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2662 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2663 display for sliced images (Bug#10500).
2665 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2667 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
2669 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2670 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2672 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2674 * xdisp.c (window_outdated): Remove eassert since it hits
2675 some suspicious corner cases (see Bug#13007 and Bug#13012).
2676 (mode_line_update_needed): New function.
2677 (redisplay_internal, redisplay_window): Use it.
2678 (ensure_selected_frame): New function.
2679 (redisplay_internal, unwind_redisplay): Use it.
2680 (redisplay_internal): Move comment about buffer_shared...
2681 (buffer_shared_and_changed): ...near to its real use.
2683 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2685 * callproc.c (Fcall_process): Don't misreport vfork failure.
2687 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2689 * callproc.c (Fcall_process): Fix vfork portability problems.
2690 Do not assume that fd[0], count, filefd, and save_environ survive
2691 vfork. Fix bug whereby wrong errno value could be reported for
2692 pipe failure. Some minor cleanups, too, as follows. Move buf and
2693 bufsize to the context where they're needed. Change new_argv to
2694 be of type char **, as this is more convenient and avoids casts.
2695 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2696 Now local constants, not macros.
2698 2012-11-18 Kenichi Handa <handa@gnu.org>
2700 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2701 for the variable "f".
2703 2012-11-13 Kenichi Handa <handa@gnu.org>
2705 * font.c (font_unparse_xlfd): Exclude special characters from the
2706 generating XLFD name.
2708 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2710 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2711 * dired.c (stat_uname, stat_gname):
2712 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2714 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2715 * dired.c (directory_files_internal, file_name_completion):
2716 Assume EAGAIN and EINTR are defined.
2718 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2719 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2720 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2721 * lread.c (readbyte_from_file): Assume EINTR is defined.
2722 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2723 Assume EIO and EAGAIN are defined.
2724 * unexcoff.c (write_segment): Assume EFAULT is defined.
2726 2012-11-27 Eli Zaretskii <eliz@gnu.org>
2728 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2731 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2732 highlighting on the frame was cleared. Prevents assertion
2733 violations when repeatedly clicking on the "Top" link of the
2734 "bread-crumbs" in Info buffers.
2736 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2738 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2740 2012-11-24 Ken Brown <kbrown@cornell.edu>
2742 * keyboard.c (HAVE_MOUSE):
2743 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2744 were always defined.
2746 2012-11-24 Eli Zaretskii <eliz@gnu.org>
2748 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2749 between bpos_covered and bpos_max. This fixes cursor display when
2750 several display strings follow each other.
2752 * .gdbinit (pgx): If the glyph's object is a string, display the
2753 pointer to string data, rather than the value of the string object
2754 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2756 * indent.c (Fvertical_motion): If the starting position is covered
2757 by a display string, return to one position before that, to avoid
2758 overshooting it inside move_it_to. (Bug#12930)
2760 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2762 * frame.h (struct frame): Remove display_preempted member
2763 since all users are dead long ago.
2764 * nsterm.h (struct x_output): Use the only dummy member.
2765 * w32menu.c (pending_menu_activation): Remove since not
2767 (set_frame_menubar): Adjust user.
2768 * w32term.h (struct x_output): Drop outdated #if 0 code.
2769 (struct w32_output): Use bitfields for explicit_parent,
2770 asked_for_visible and menubar_active members.
2771 Drop unused pending_menu_activation member.
2772 * xterm.h (struct x_output): Drop outdated #if 0 code.
2773 Use bitfields for explicit_parent, asked_for_visible,
2774 has_been_visible and net_wm_state_hidden_seen members.
2776 2012-11-23 Eli Zaretskii <eliz@gnu.org>
2778 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2779 of a literal "/". (Bug#12955)
2780 (gl-stamp): Invoke fc.exe directly, not through cmd.
2782 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2784 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2785 * dired.c: Assume HAVE_DIRENT_H.
2786 (NAMLEN): Remove, replacing with ...
2787 (dirent_namelen): New function. All uses changed. Use the GNU macro
2788 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2789 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2790 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2791 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2793 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2794 * ndir.h: Rename to ../nt/inc/dirent.h.
2795 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2796 Do not include <dirent.h>; no longer needed.
2797 * w32.c: Include <dirent.h> rather than "ndir.h".
2799 2012-11-23 Chong Yidong <cyd@gnu.org>
2801 * xftfont.c (xftfont_open): Remove duplicate assignment.
2803 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2805 * alloc.c (Fgarbage_collect): Unblock input after clearing
2806 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2807 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2808 * msdos.c (IT_frame_up_to_date): Use it here...
2809 * w32term.c (w32_frame_up_to_date): ...here...
2810 * xterm.c (XTframe_up_to_date): ...and here...
2811 * nsterm.m (ns_frame_up_to_date): ...but not here.
2812 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2814 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2815 Do not check whether GC is in progress.
2817 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2819 * xdisp.c (window_buffer_changed): New function.
2820 (update_menu_bar, update_tool_bar): Use it to
2821 simplify large 'if' statements.
2822 (redisplay_internal): Generalize commonly used
2823 'tail' and 'frame' local variables.
2825 2012-11-22 Eli Zaretskii <eliz@gnu.org>
2827 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2828 with Windows system header.
2830 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2832 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2833 * alloc.c: Assume unistd.h exists.
2834 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2835 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2836 (getwd) [USG]: Remove; no longer needed.
2837 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2838 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2839 * w32.h (getcwd): Remove decl.
2841 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2843 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2844 Make it set selected_window as well.
2845 (update_tool_bar): Use it.
2847 2012-11-21 Ken Brown <kbrown@cornell.edu>
2849 * emacs.c (main): Set the G_SLICE environment variable for all
2850 Cygwin builds, not just GTK builds. See
2851 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2853 2012-11-21 Eli Zaretskii <eliz@gnu.org>
2855 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2856 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2857 Define for the MSVC compiler.
2859 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2861 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2862 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2863 dostounix_filename. Prevents crashes down the road, because
2864 dostounix_filename assumes it gets a unibyte string.
2865 Reported by Michel de Ruiter <michel@sentient.nl>, see
2866 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2868 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2870 Conflate Qnil and Qunbound for `symbol-function'.
2871 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2872 * lread.c (init_obarray): Set `function' fields to Qnil.
2873 * eval.c (Fcommandp): Ignore Qunbound.
2874 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2875 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2876 Test NILP rather than Qunbound.
2877 (Ffmakunbound): Set to Qnil.
2878 (Fsymbol_function): Never signal an error.
2879 (Finteractive_form): Ignore Qunbound.
2881 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2883 * eval.c (interactive_p): Remove no-longer-used decl.
2885 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2887 * xdisp.c (buffer_shared): Adjust comment.
2888 (buffer_shared_and_changed): New function.
2889 (prepare_menu_bars, redisplay_internal): Use it to
2890 decide whether all windows or frames should be updated.
2891 (window_outdated): New function.
2892 (text_outside_line_unchanged_p, redisplay_window): Use it.
2893 (redisplay_internal): Likewise. Fix indentation.
2895 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2897 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2898 (syms_of_eval): Remove corresponding defsubr.
2899 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2901 2012-11-19 Daniel Colascione <dancol@dancol.org>
2903 * w32fns.c (Fx_file_dialog):
2904 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2905 cygwin_convert_file_name*.
2907 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2908 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2910 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2912 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2914 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2916 * w32select.c: Include w32common.h before w32term.h, so that
2917 windows.h gets included before w32term.h uses some of its
2918 features, see below.
2920 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2922 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2924 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2926 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
2928 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2929 (ns_select): Return at once if events are held (Bug#12834).
2931 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
2933 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2934 Needed following 2012-10-20 change. (Bug#12902)
2936 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
2938 * w32proc.c (waitpid): Remove unused label get_result.
2940 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
2942 * makefile.w32-in (SYSWAIT_H): New macro.
2943 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2944 ($(BLD)/sysdep.$(O)): Update dependencies.
2946 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2948 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2949 * callproc.c (relocate_fd): Assume F_DUPFD.
2950 * emacs.c, term.c (O_RDWR): Remove.
2951 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2952 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2953 * nsterm.m: Assume <fcntl.h> exists.
2954 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2955 (create_pty, Fmake_network_process, server_accept_connection)
2956 (wait_reading_process_output, init_process_emacs):
2958 (wait_reading_process_output): Put in a special case for WINDOWSNT
2959 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2960 It's not clear this is needed, but it's a more-conservative change.
2961 (create_process): Assume FD_CLOEXEC.
2962 (create_process, create_pty): Assume O_NOCTTY.
2963 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2964 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2965 Omit if not DOS_NT, since F_GETFL is not defined there.
2966 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2967 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2969 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2970 lack it, since gnulib guarantees this.
2971 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2973 2012-11-17 Eli Zaretskii <eliz@gnu.org>
2975 * w32.c (faccessat): Pretend that directories have the execute bit
2976 set. Emacs expects that, e.g., in files.el:cd-absolute.
2978 * w32proc.c (create_child): Don't clip the PID of the child
2979 process to fit into an Emacs integer, as this is no longer a
2981 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2982 reaping only the process specified by PID argument, if that is
2983 positive. Use PID instead of dead_child to know which process to
2984 reap. Wait for the child to die only if WNOHANG is not in
2986 (sys_select): Don't set dead_child.
2988 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2989 as it is no longer needed.
2991 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2993 (record_child_status_change): Remove the setting of
2994 record_at_most_one_child for the !WNOHANG case.
2996 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2998 Fix problems in ns port found by static checking.
2999 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3000 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3001 not to process group.
3002 (ns_select): Use emacs_write, not write, as that's more robust
3003 in the presence of signals.
3004 (fd_handler:): Check for read errors.
3006 2012-11-16 Glenn Morris <rgm@gnu.org>
3008 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3010 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3012 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3014 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3016 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3017 use the same value of thread handle.
3018 (start_timer_thread): If the timer thread exited (due to error),
3019 clean up by closing the two handles it used. Duplicate the caller
3020 thread's handle here, so it gets duplicated only once, when
3021 launching the timer thread. Set priority of the timer thread, not
3023 (getitimer): Don't duplicate the caller thread's handle here.
3026 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3028 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3031 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3033 Remove no-longer-used pty_max_bytes variable.
3034 * process.c (pty_max_bytes): Remove; unused.
3035 (send_process): Do not set it.
3037 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3039 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3040 Update dependencies.
3042 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3044 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3045 This follows up on the 2012-09-29 patch that removed indirection
3046 for the 'function' field. Reported by Sergey Vinokurov in
3047 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3049 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3051 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3052 different name, as the MS runtime does not have such a function,
3053 and probably never will.) All callers changed. Ignore DIRFD
3054 value if PATH is an absolute file name, to match Posix spec
3055 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3058 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3060 * xdisp.c (echo_area_display, redisplay_internal):
3061 Omit redundant check whether frame_garbaged is set.
3063 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3065 Use faccessat, not access, when checking file permissions (Bug#12632).
3066 This fixes a bug that has been present in Emacs since its creation.
3067 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3068 which must set some sort of record. (Torek's bug report was against
3069 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3070 same common flaw.) See Torek's Usenet posting
3071 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3072 Posted: Fri Apr 8 14:18:56 1983.
3073 * Makefile.in (LIB_EACCESS): New macro.
3075 * callproc.c (init_callproc):
3076 * charset.c (init_charset):
3077 * fileio.c (check_existing, check_executable, check_writable)
3079 * lread.c (openp, load_path_check):
3080 * process.c (allocate_pty):
3082 Use effective UID when checking permissions, not real UID.
3083 * callproc.c (init_callproc):
3084 * charset.c (init_charset):
3085 * lread.c (load_path_check, init_lread):
3086 Test whether directories are accessible, not merely whether they exist.
3087 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3088 * fileio.c (check_existing, check_executable, check_writable)
3090 Use symbolic names instead of integers for the flags, as they're
3092 (check_writable): New arg AMODE. All uses changed.
3093 Set errno on failure.
3094 (Ffile_readable_p): Use faccessat, not stat + open + close.
3095 (Ffile_writable_p): No need to call check_existing + check_writable.
3096 Just call check_writable and then look at errno. This saves a syscall.
3097 dir should never be nil; replace an unnecessary runtime check
3098 with an eassert. When checking the parent directory of a nonexistent
3099 file, check that the directory is searchable as well as writable, as
3100 we can't create files in unsearchable directories.
3101 (file_directory_p): New function, which uses 'stat' on most platforms
3102 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3103 (Ffile_directory_p, Fset_file_times): Use it.
3104 (file_accessible_directory_p): New function, which uses a single
3105 syscall for efficiency.
3106 (Ffile_accessible_directory_p): Use it.
3107 * xrdb.c (file_p): Use file_directory_p.
3108 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3109 * lread.c (openp): When opening a file, use fstat rather than
3110 stat, as that avoids a permissions race. When not opening a file,
3111 use file_directory_p rather than stat.
3112 (dir_warning): First arg is now a usage string, not a format.
3113 Use errno. All uses changed.
3114 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3115 that merely introduced a race.
3116 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3117 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3118 and similarly for the other O_* flags.
3119 * w32.c (sys_faccessat): Rename from sys_access and switch to
3120 faccessat's API. All uses changed.
3121 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3122 (magic_db): Rename from magic_file_p.
3123 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3124 char *, so that we don't have to test for file existence
3125 separately from opening the file for reading. This removes a race
3126 fixes a permission-checking problem, and simplifies the code.
3128 (file_p): Remove; no longer needed.
3130 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3132 Omit glyphs initialization at startup.
3133 * dispnew.c (glyphs_initialized_initially_p): Remove.
3134 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3135 (Fredraw_frame): Move actual code from here...
3136 (redraw_frame): ...to here. Add eassert. Adjust comment.
3137 (Fredraw_display): Use redraw_frame.
3138 * xdisp.c (clear_garbaged_frames): Likewise.
3140 2012-11-13 Eli Zaretskii <eliz@gnu.org>
3142 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3143 passed to pint2str and pint2hrstr to be at most the size of the
3144 frame's decode_mode_spec_buffer. This avoids crashes with very
3145 large values of FIELD_WIDTH argument to decode_mode_spec.
3148 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3150 Fix a race with verify-visited-file-modtime (Bug#12863).
3151 Since at least 1991 Emacs has ignored an mtime difference of no
3152 more than one second, but my guess is that this was to work around
3153 file system bugs that were fixed long ago. Since the race is
3154 causing problems now, let's remove that code.
3155 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3156 whose time stamp is off by no more than a second. Insist that the
3157 file time stamps match exactly.
3159 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3161 * frame.h (struct frame): Convert external_tool_bar member to
3162 1-bit unsigned bitfield.
3163 * termhooks.h (struct terminal): Remove mouse_moved member since
3164 all users are long dead. Adjust comment on mouse_position_hook.
3166 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3168 Simplify by using FOR_EACH_FRAME here and there.
3169 * frame.c (next_frame, prev_frame, other_visible_frames)
3170 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3171 * w32term.c (x_window_to_scroll_bar): Likewise.
3172 * window.c (window_list): Likewise.
3173 * xdisp.c (x_consider_frame_title): Likewise.
3174 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3175 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3176 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3177 * xmenu.c (menubar_id_to_frame): Likewise.
3178 * xselect.c (frame_for_x_selection): Likewise.
3179 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3180 (x_window_to_menu_bar): Likewise.
3181 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3183 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3185 * data.c (Qdefalias_fset_function): Now static.
3187 Another tweak to vectorlike_header change.
3188 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3189 Remove, and replace all uses with ...
3190 (next_in_free_list, set_next_in_free_list):
3191 New functions, which respect C's aliasing rules better.
3193 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3195 * window.c (list4i): Rename from 'quad'. All uses changed.
3196 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3198 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
3200 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3201 warning about mixing declarations and code in ISO C90.
3203 2012-11-10 Martin Rudalics <rudalics@gmx.at>
3205 * window.c (Fsplit_window_internal): Set combination limit of
3206 new parent window to t iff Vwindow_combination_limit is t;
3207 fixing a regression introduced with the change from 2012-09-22.
3208 (Fset_window_combination_limit): Fix doc-string.
3210 2012-11-10 Eli Zaretskii <eliz@gnu.org>
3212 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3213 amount when the scroll margins are too large. When scrolling
3214 backwards in the buffer, give up if cannot reach point or the
3215 scroll margin within a reasonable number of screen lines.
3216 Fixes point position in window under scroll-up/down-aggressively when
3217 point is positioned many lines beyond the window top/bottom.
3220 * ralloc.c (relinquish): If real_morecore fails to return memory
3221 to the system, don't crash; instead, leave the last heap
3222 unchanged and return. (Bug#12774)
3224 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3226 * lisp.h (AUTOLOADP): New macro.
3227 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3228 * data.c (Ffset): Remove special ad-advice-info handling.
3229 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3231 (Finteractive_form): Simplify.
3232 (Fquo): Don't insist on having at least 2 arguments.
3233 (Qdefalias_fset_function): New var.
3235 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3237 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3239 * nsfont.m (Qcondensed, Qexpanded): New variables.
3240 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3241 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3243 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3245 Fix recently introduced crash on MS-Windows (Bug#12839).
3246 * w32term.h (struct scroll_bar): Use convenient header.
3247 (SCROLL_BAR_VEC_SIZE): Remove.
3248 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3250 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3252 Tweak last vectorlike_header change.
3253 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3254 vectorlike object on the free list. This is introduced to avoid
3255 some (but not all) pointer casting and aliasing problems, see
3256 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3257 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3259 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3261 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3263 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3264 been removed, so remove them here also.
3266 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3268 * doc.c (Fdocumentation): Handle new property
3269 dynamic-docstring-function to replace the old ad-advice-info.
3271 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3273 * fns.c (Qeql, hashtest_eq): Now static.
3275 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3277 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3278 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3279 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3280 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3282 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3284 Use same hash function for hashfn_profiler as for hash_string etc.
3285 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3286 * lisp.h (sxhash_combine): New inline function, with the contents
3287 of the old SXHASH_COMBINE.
3288 * profiler.c (hashfn_profiler): Use it, instead of having a
3289 special hash function containing a comparison that always yields 1.
3291 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3293 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3294 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3295 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3298 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3300 * image.c (xpm_make_color_table_h): Fix compiler error because
3301 make_hash_table changed.
3303 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
3305 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3307 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3309 Use ad-hoc comparison function for the profiler's hash-tables.
3310 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3311 (make_log): Use them.
3312 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3313 call Fequal any more.
3314 (Ffunction_equal): New function.
3315 (cmpfn_profiler, hashfn_profiler): New functions.
3316 (syms_of_profiler): Initialize them.
3317 * lisp.h (struct hash_table_test): New struct.
3318 (struct Lisp_Hash_Table): Use it.
3319 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3320 * fns.c (make_hash_table): Take a struct to describe the test.
3321 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3322 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3323 (hash_lookup, hash_remove_from_table): Move assertion checking of
3324 hashfn result here. Check hash-equality before calling cmpfn.
3325 (Fmake_hash_table): Adjust call to make_hash_table.
3326 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3327 (syms_of_fns): Initialize them.
3328 * emacs.c (main): Move syms_of_fns earlier.
3329 * xterm.c (syms_of_xterm):
3330 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3331 * print.c (print_object): Adjust to new hash-table struct.
3332 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3334 2012-11-08 Eli Zaretskii <eliz@gnu.org>
3336 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3337 value of w32-scroll-lock-modifier is neither nil nor one of the
3338 known key modifiers. (Bug#12806)
3340 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3342 Shrink struct vectorlike_header to the only size field.
3343 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3345 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3346 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3347 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3348 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3349 information from the vector header. Adjust comment.
3350 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3351 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3353 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3354 (struct vectorlike_header): Remove next member. Adjust comment.
3355 (struct Lisp_Subr): Add convenient header. Adjust comment.
3356 (allocate_pseudovector): Adjust prototype.
3357 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3358 (sweep_string, lisp_malloc): Remove useless prototypes.
3359 (enum mem_type): Adjust comment.
3360 (NEXT_IN_FREE_LIST): New macro.
3361 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3362 (Fmake_bool_vector): Likewise.
3363 (struct large_vector): New type to represent allocation unit for
3364 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3365 (large_vectors): Change type to struct large_vector.
3366 (allocate_vector_from_block): Simplify.
3367 (PSEUDOVECTOR_NBYTES): Replace with...
3368 (vector_nbytes): ...new function. Adjust users.
3369 (sweep_vectors): Adjust processing of large vectors.
3370 (allocate_vectorlike): Likewise.
3371 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3372 Add easserts. Adjust XSETPVECTYPESIZE usage.
3373 (allocate_buffer): Use BUFFER_PVEC_INIT.
3374 (live_vector_p): Adjust to match large vector.
3375 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3376 * buffer.h (struct buffer): Add next member.
3377 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3379 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3380 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3381 (copy_hash_table): Adjust to match vector header change.
3382 * lread.c (defsubr): Use XSETPVECTYPE.
3383 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3384 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3385 (xvecsize): New command.
3387 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3389 * keyboard.c (event_to_kboard): Do not dereference
3390 frame_or_window field of SELECTION_REQUEST_EVENT
3391 and SELECTION_CLEAR_EVENT events (Bug#12814).
3392 * xterm.h (struct selection_input_event): Adjust comment.
3394 2012-11-07 Eli Zaretskii <eliz@gnu.org>
3396 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3397 such as Scroll Lock, if the respective keys are treated as
3398 function keys, not as modifiers. This avoids destroying non-ASCII
3399 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
3401 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3403 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3405 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3407 Restore some duplicate definitions (Bug#12814).
3408 This undoes part of the 2012-11-03 changes. Some people build
3409 with plain -g rather than with -g3, and they need the duplicate
3410 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3411 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3412 Define as macros, as well as as enums or as constants.
3414 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3416 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3417 to keypad keys (Bug#12816).
3419 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3421 Minor adjustments of recently-changed frame functions.
3422 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3423 known to be a frame (we're in the FRAMEP branch).
3424 * lisp.h (Qframep): Remove decl. frame.h declares this.
3425 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3426 since they're meant for Lisp fixnum values.
3428 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3430 * window.c (Fwindow_combination_limit): Revert to the only
3431 required argument and adjust docstring as suggested in
3432 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3433 by Martin Rudalics <rudalics@gmx.at>.
3435 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3437 Widely used frame validity and checking functions.
3438 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3439 * frame.c (decode_live_frame, decode_any_frame): New functions.
3440 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3441 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3442 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3443 (Fframe_pointer_visible_p): Use decode_any_frame.
3444 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3445 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3446 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3447 (Fframe_focus): Likewise. Allow zero number of arguments.
3449 (frame_buffer_list, frame_buffer_predicate): Remove.
3450 * lisp.h (frame_buffer_predicate): Remove prototype.
3451 * buffer.c (Fother_buffer): Use decode_any_frame.
3452 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3453 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3454 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3455 (Fclose_font, Ffont_info): Use decode_live_frame.
3456 * fontset.c (check_fontset_name): Likewise.
3457 * terminal.c (Fframe_terminal): Likewise.
3458 * w32fns.c (check_x_frame): Likewise.
3459 * window.c (Fminibuffer_window, Fwindow_at)
3460 (Fcurrent_window_configuration): Likewise.
3461 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3462 Likewise. Allow zero number of arguments. Adjust docstring.
3463 * dispnew.c (Fredraw_frame): Likewise.
3464 * xfaces.c (frame_or_selected_frame): Remove.
3465 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3466 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3467 (Fframe_face_alist): Use decode_live_frame.
3468 * xfns.c (check_x_frame): Likewise.
3470 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3472 * window.c (quad): New function.
3473 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3474 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3475 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3476 (Fwindow_line_height): Use it.
3477 (Fwindow_fringes): Use list3.
3478 (Fwindow_scroll_bars): Use list4.
3479 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3480 (Fwindow_combination_limit): Allow zero number of arguments.
3482 2012-11-05 Eli Zaretskii <eliz@gnu.org>
3484 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3486 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3487 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3488 file descriptor 2 for standard error. (Bug#12805)
3490 2012-11-05 Chong Yidong <cyd@gnu.org>
3492 * process.c (wait_reading_process_output): Revert previous change.
3494 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3496 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3497 This removes code that has been obsolete since around 1990.
3498 * callproc.c (Fcall_process):
3500 * process.c (create_process):
3501 * term.c (dissociate_if_controlling_tty):
3502 Assume setsid exists.
3503 * callproc.c (child_setup): Assume setpgid exists and behaves as
3504 per POSIX.1-1988 or later.
3505 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3506 * emacs.c (shut_down_emacs):
3507 * sysdep.c (sys_suspend, init_foreground_group):
3508 Assume getpgrp behaves as per POSIX.1-1998 or later.
3509 * msdos.c (setpgrp): Remove.
3510 (tcgetpgrp, setpgid, setsid): New functions.
3511 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3512 * term.c (no_controlling_tty): Remove; unused.
3513 * w32proc.c (setpgrp): Remove.
3514 (setsid, tcgetpgrp): New functions.
3516 Simplify by assuming __fpending.
3517 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3518 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3519 Do not assume that __fpending's result fits in int.
3521 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3523 Remove EMACS_OUTQSIZE+sleep hack.
3524 * dispnew.c (update_frame_1): Remove hack for terminals slower
3525 than 2400 bps, which throttled Emacs by having it sleep.
3526 This code hasn't worked since at least 2007, when the multi-tty stuff
3527 was added, and anyway those old terminals are long dead.
3528 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3529 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3531 Fix data-loss with --version (Bug#9574).
3532 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3533 as we can't assume that emacs_strerror is initialized, and strerror
3534 is good enough here.
3535 (main): Invoke atexit earlier, to catch earlier instances of
3536 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3538 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3540 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3541 (keyDown): Remap keypad keys to X11 virtual key codes.
3543 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3545 Fix data-loss with --batch (Bug#9574).
3546 * emacs.c: Include <close-stream.h>.
3547 (close_output_streams): New function.
3548 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3549 and handles errors appropriately.
3550 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3553 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3554 The symptom is a diagnostic "GLib-WARNING **: In call to
3555 g_spawn_sync(), exit status of a child process was requested but
3556 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3557 waitpid(), so exit status can't be returned." The diagnostic
3558 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3559 The real bug is a race condition between Emacs and glib: Emacs
3560 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3561 so that glib can't find it. Work around the bug by invoking
3562 waitpid only on subprocesses that Emacs itself creates.
3563 * process.c (create_process, record_child_status_change):
3564 Don't use special value -1 in pid field, as the caller now must
3565 know the pid rather than having the callee infer it.
3566 The inference was sometimes incorrect anyway, due to another race.
3567 (create_process): Set new 'alive' member if child is created.
3568 (process_status_retrieved): New function.
3569 (record_child_status_change): Use it.
3570 Accept negative 1st argument, which means to wait for the
3571 processes that Emacs already knows about. Move special-case code
3572 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3573 processes that have already been waited for, by testing and
3574 clearing new 'alive' member.
3575 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3576 now does this internally.
3577 (handle_child_signal): Let record_child_status_change do all
3578 the work, since we do not want to reap all exited child processes,
3579 only the child processes that Emacs itself created.
3580 * process.h (Lisp_Process): New boolean member 'alive'.
3582 Omit duplicate definitions no longer needed with gcc -g3.
3583 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3584 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3585 Define only as macros. There's no longer any need to also define
3586 these symbols as enums or as constants, since we now assume
3587 gcc -g3 when debugging.
3589 2012-11-03 Eli Zaretskii <eliz@gnu.org>
3591 * lisp.mk: Adjust comments to the fact that term/internal is now
3592 loaded from loadup.el.
3594 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3595 (msdos_fatal_signal): New function.
3596 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3599 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3600 for GCC versions before 4.
3601 (emacs_raise): Define to call msdos_fatal_signal.
3603 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3604 iterator when starting in the middle of a display or overlay
3607 2012-11-03 Chong Yidong <cyd@gnu.org>
3609 * process.c (wait_reading_process_output): Clean up the last
3612 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3614 * process.c (wait_reading_process_output): Avoid a race condition
3615 with SIGIO delivery (Bug#11536).
3617 2012-11-03 Chong Yidong <cyd@gnu.org>
3619 * buffer.c (cursor_type): Untabify docstring.
3621 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3623 * frame.h (struct frame): Drop can_have_scroll_bars member
3624 which is meaningless for a long time. Adjust comments.
3625 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3626 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3628 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3630 * window.c (decode_next_window_args): Update window arg after
3631 calling decode_live_window and so fix crash reported at
3632 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3633 by Juanma Barranquero <lekktu@gmail.com>.
3634 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3635 * font.c (Ffont_at): Likewise.
3637 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3639 * widget.c (resize_cb): New function.
3640 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3641 (EmacsFrameResize): Check if all is up to date before changing frame
3644 2012-11-02 Eli Zaretskii <eliz@gnu.org>
3646 Implement backtrace output for fatal errors on MS-Windows.
3647 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3648 (BACKTRACE_LIMIT_MAX): New macro.
3649 (w32_backtrace): New function.
3650 (emacs_abort): Use w32_backtrace when the user chooses not to
3651 attach a debugger. Update the text of the abort dialog.
3653 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3655 Window-related stuff cleanup here and there.
3656 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3657 Use decode_any_window.
3658 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3659 * xdisp.c (Fformat_mode_line): Likewise.
3660 * font.c (Ffont_at): Use decode_live_window.
3661 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3662 * window.c (decode_next_window_args): Likewise.
3663 (decode_any_window): Remove static.
3664 * window.h (decode_any_window): Add prototype.
3665 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3666 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3669 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3671 Remove pad from struct input_event.
3672 * termhooks.h (struct input_event): Remove padding field.
3674 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3675 member is never cons for a long time. Adjust comment.
3676 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3677 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3678 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3679 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3681 2012-11-01 Eli Zaretskii <eliz@gnu.org>
3683 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3685 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3687 Fix crash when using Emacs as commit editor for git (Bug#12697).
3688 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3689 and it is configured in conf_post.h.
3690 (Fcall_process): Don't invoke both setsid and setpgid; the former
3691 is enough, if it exists.
3692 * callproc.c (Fcall_process, child_setup):
3693 * process.c (create_process): Use setpgid.
3694 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3696 * dispnew.c (init_display): Initialize the foreground group
3697 if we are running a tty display.
3698 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3699 * lisp.h (init_foreground_group): New decl.
3700 * sysdep.c (inherited_pgroup): New static var.
3701 (init_foreground_group, tcsetpgrp_without_stopping)
3702 (narrow_foreground_group, widen_foreground_group): New functions.
3703 (init_sys_modes): Narrow foreground group.
3704 (reset_sys_modes): Widen foreground group.
3706 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
3708 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3710 2012-10-31 Martin Rudalics <rudalics@gmx.at>
3712 * minibuf.c (read_minibuf): Restore current buffer since
3713 choose_minibuf_frame calling Fset_frame_selected_window may
3714 change it (Bug#12766).
3716 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3718 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3720 2012-10-30 Kenichi Handa <handa@gnu.org>
3722 * font.c (Ffont_at): If WINDOW is specified and it is not
3723 displaying the current buffer, signal an error.
3725 2012-10-29 Daniel Colascione <dancol@dancol.org>
3727 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3728 In preparation for fixing bug#12739, move these functions from
3731 * coding.h, coding.c: ... to here, and compile them only when
3732 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3733 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
3735 2012-10-28 Eli Zaretskii <eliz@gnu.org>
3737 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3738 (timer_loop, getitimer, setitimer): Use it instead of
3739 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3741 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3744 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3746 * nsterm.m (NO_APPDEFINED_DATA): New define.
3747 (last_appdefined_event_data): New variable
3748 (last_appdefined_event): Remove.
3749 (ns_select): Initialize t from last_appdefined_event_data instead
3750 of [last_appdefined_event data1].
3751 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3752 remove last_appdefined_event (Bug#12698).
3754 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3756 * frame.c (x_set_font): Catch internal error.
3758 2012-10-27 Eli Zaretskii <eliz@gnu.org>
3760 Avoid overflow in w32 implementation of interval timers.
3761 When possible, for ITIMER_PROF count only times the main thread
3763 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
3764 'volatile ULONGLONG' types. All the other data which was
3765 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
3766 (GetThreadTimes_Proc): New typedef.
3767 (w32_get_timer_time): New function, returns a suitable time value
3769 (timer_loop): Enter critical section when accessing ULONGLONG
3770 values of the itimer_data struct, as these accesses are no longer
3771 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3772 Remove unused variable.
3773 (init_timers): Initialize s_pfn_Get_Thread_Times.
3774 (start_timer_thread): Don't assign itimer->caller_thread here.
3775 (getitimer): Assign itimer->caller_thread here.
3776 (setitimer): Always call getitimer to get the value of ticks_now.
3777 (sys_spawnve): Avoid compiler warning about format mismatch.
3779 2012-10-26 Eli Zaretskii <eliz@gnu.org>
3781 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3782 mouse movement events if the menu bar is active. This avoids
3783 producing a busy "hour-glass" cursor by Windows if the mouse
3784 pointer is positioned over a tooltip shown for some menu item.
3786 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3788 Don't assume process IDs fit in int.
3789 * emacs.c (shut_down_emacs) [!DOS_NT]:
3790 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3791 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3792 Use pid_t, not int, to store process IDs, as 'int'
3793 is not wide enough on a few platforms (e.g., AIX and IRIX).
3795 2012-10-23 Kenichi Handa <handa@gnu.org>
3797 The following change is to make face-font-rescale-alist work
3798 correctly for non-ASCII fonts.
3800 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3801 (font_open_for_lface): Handle Vface_font_rescale_alist.
3803 2012-10-23 Chong Yidong <cyd@gnu.org>
3805 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3807 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3809 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3811 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3813 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3816 2012-10-21 Glenn Morris <rgm@gnu.org>
3818 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3820 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3822 Port to OpenBSD 5.1.
3823 * frame.c (Fmouse_position, Fmouse_pixel_position):
3824 * xdisp.c (produce_stretch_glyph):
3825 Declare local vars only when they're needed.
3826 This is clearer and avoids a warning on OpenBSD about unused vars.
3827 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3828 This is safer, and avoids OpenBSD warnings about unused vars.
3829 * keyboard.c (record_menu_key): Remove unnecessary decl.
3830 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3831 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3832 as our definition clashes with OpenBSD's.
3833 * xfaces.c (load_face_colors, check_lface_attrs)
3834 (get_lface_attributes_no_remap, get_lface_attributes)
3835 (lface_fully_specified_p, x_supports_face_attributes_p)
3836 (tty_supports_face_attributes_p, face_fontset, realize_face)
3837 (realize_x_face, realize_tty_face):
3838 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3839 merely Lisp_Object *. This is more informative and avoids
3840 a warning on OpenBSD about accessing beyond an object's size.
3842 2012-10-20 Chong Yidong <cyd@gnu.org>
3844 * lread.c (Fload): Doc fix (Bug#12592).
3846 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3848 * font.c (Ffont_at): Fix previous change.
3850 2012-10-19 Eli Zaretskii <eliz@gnu.org>
3852 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3853 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3856 * alloc.c (NSTATICS): Decrease to 0x800.
3858 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3860 * fns.c (Fnreverse): Include the problem element when signaling an
3863 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3865 * nsterm.m (ns_select): Check writefds before call to
3866 FD_ISSET (Bug#12668).
3868 2012-10-18 Daniel Colascione <dancol@dancol.org>
3870 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3871 (staticpro): If we run out of staticpro slots, die with an
3872 informative error instead of just calling emacs_abort.
3874 2012-10-18 Martin Rudalics <rudalics@gmx.at>
3876 Fix two flaws reported by Dmitry Antipov.
3877 * window.c (Ftemp_output_buffer_show): Remove.
3878 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3879 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3881 2012-10-17 Eli Zaretskii <eliz@gnu.org>
3883 * makefile.w32-in ($(BLD)/w32.$(O)):
3884 ($(BLD)/vm-limit.$(O)):
3886 ($(BLD)/unexw32.$(O)):
3887 ($(BLD)/fileio.$(O)):
3888 ($(BLD)/dispnew.$(O)): Update dependencies.
3890 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3893 * w32proc.c: Include ctype.h.
3895 * w32.h (init_environment, check_windows_init_file)
3896 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3897 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3898 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3899 (sys_link): Add prototypes.
3901 * w32.c: Include w32select.h.
3902 (sys_access, e_malloc, sys_select): Add prototypes.
3903 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3905 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3907 * unexw32.c: Include lisp.h and w32.h.
3909 * term.c [WINDOWSNT]: Include w32term.h.
3911 * process.c [WINDOWSNT]: Add prototype of sys_select.
3913 * fileio.c [WINDOWSNT]: Include w32.h.
3915 * dispnew.c [WINDOWSNT]: Include w32.h.
3917 * cygw32.c (Fcygwin_convert_path_to_windows)
3918 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3919 Lisp_Object values. (Bug#12661)
3921 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3922 to Lisp_Object. (Bug#12661)
3924 2012-10-17 Kenichi Handa <handa@gnu.org>
3926 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3929 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3931 * buffer.c (Fkill_buffer): When unchaining the marker,
3932 reset its buffer pointer to NULL (Bug#12652).
3934 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3936 Do not verify indirection counters of killed buffers (Bug#12579).
3937 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3938 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3940 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3942 * alloc.c (Fmake_byte_code): Fix typo in comment.
3943 * print.c (print_interval): Define as static to match prototype.
3944 * indent.c (disptab_matches_widthtab, recompute_width_table):
3947 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3949 * editfns.c (get_system_name): Remove.
3950 * lisp.h (get_system_name): Remove prototype.
3951 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3952 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3954 2012-10-15 Daniel Colascione <dancol@dancol.org>
3956 * dbusbind.c: Add comment explaining reason for previous change.
3958 2012-10-15 Martin Rudalics <rudalics@gmx.at>
3960 * window.c (Fwindow_end): Rewrite check whether cached position
3961 can be used (Bug#12600).
3962 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3963 Set windows_or_buffers_changed.
3965 2012-10-15 Daniel Colascione <dancol@dancol.org>
3967 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3968 enabled by undefining the symbol "interface", which the platform
3969 headers define to something incompatible.
3971 2012-10-14 Daniel Colascione <dancol@dancol.org>
3973 * image.c (init_tiff_functions, init_imagemagick_functions)
3974 (init_svg_functions): Fix cygw32 build break by using these
3975 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3977 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3979 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3981 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3983 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3985 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3987 * coding.c (detect_coding): Set coding->id before calling
3990 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3992 * fileio.c: Formatting fixes.
3994 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3996 Fix some stat-related races.
3997 * fileio.c (Fwrite_region): Avoid race condition if a file is
3998 removed or renamed by some other process immediately after Emacs
3999 writes it but before Emacs stats it. Do not assume that stat (or
4001 * image.c (slurp_file): Resolve the file name with fopen + fstat
4002 rather than stat + fopen.
4003 (pbm_read_file) [0]: Remove unused code with stat race.
4004 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4005 Remove ineffective code with stat race.
4007 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4009 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4011 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4013 * nsterm.m (hold_event_q): New static variable.
4014 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4016 (hold_event): New function.
4017 (ns_read_socket): If hold_event_q have events, store them and
4019 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4020 is zero (Bug#12384).
4022 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4024 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4026 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4028 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4030 * fileio.c (check_existing): New function.
4031 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4032 instead of calling 'stat', when what's needed is to check whether
4033 a file exists. This avoids expensive system calls on MS-Windows.
4036 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4038 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4039 determine whether a file exists and is not a directory.
4041 * lisp.h (check_existing): Add prototype.
4043 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4045 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4047 2012-10-12 Glenn Morris <rgm@gnu.org>
4049 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4051 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4053 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4055 * eval.c (Fautoload): Remember previous autoload status in load-history.
4057 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4059 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4060 * lread.c (load_each_byte, new_backquote_flag, readchar)
4061 (read_filtered_event, lisp_file_lexically_bound_p)
4062 (safe_to_load_version, Fload, complete_filename_p, openp)
4063 (build_load_history, readevalloop, read_escape, read1)
4064 (string_to_number, read_vector, read_list):
4065 * macros.c (Fstart_kbd_macro):
4066 * marker.c (CONSIDER):
4067 * menu.c (parse_single_submenu, digest_single_submenu)
4068 (find_and_return_menu_selection, Fx_popup_menu):
4069 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4071 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4073 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4074 (xmenu_show, xdialog_show):
4075 Use bool for booleans.
4076 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4077 as it's not a predicate. All uses changed. Omit unnecessary
4080 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4082 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4083 (save_excursion_restore): Do not restore mark if it was not saved.
4085 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4087 * marker.c (cached_modiff): EMACS_INT, not int.
4089 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4090 instead of having a wrong decl.
4091 * nsmenu.m (waiting_for_input): Remove wrong decl.
4093 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4095 keyboard.c, keymap.c: Use bool for booleans.
4096 * dispnew.c (sit_for): Distinguish between 3-way display_option
4097 and boolean do_display.
4098 * keyboard.c (single_kboard, this_command_key_count_reset)
4099 (waiting_for_input, echoing, immediate_quit, input_pending)
4100 (interrupt_input, interrupts_deferred, pop_kboard)
4101 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4102 (command_loop_1, adjust_point_for_property)
4103 (safe_run_hooks_error, input_polling_used, read_char):
4104 (help_char_p, readable_events, kbd_buffer_events_waiting)
4105 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4106 (lucid_event_type_list_p, get_input_pending):
4107 (gobble_input, menu_separator_name_p, menu_bar_item)
4108 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4109 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4110 (keyremap_step, test_undefined, read_key_sequence)
4111 (detect_input_pending, detect_input_pending_ignore_squeezables)
4112 (detect_input_pending_run_timers, requeued_events_pending_p)
4113 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4114 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4115 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4116 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4117 (accessible_keymaps_1, Fkey_description, push_key_description):
4118 (shadow_lookup, struct where_is_internal_data)
4119 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4120 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4121 (describe_map, describe_vector):
4122 * menu.c (single_menu_item):
4123 * nsmenu.m (ns_update_menubar):
4124 * process.c (wait_reading_process_output):
4125 * search.c (scan_buffer, scan_newline):
4126 Use bool for boolean.
4127 * keyboard.c (timers_run, swallow_events)
4128 (detect_input_pending_run_timers):
4129 * process.c (wait_reading_process_output):
4130 Use unsigned for counter where wraparound-on-overflow is desired,
4131 since unsigned is guaranteed to have that behavior and signed is not.
4132 (read_char): Use ptrdiff_t for string length.
4133 (get_input_pending): Remove first argument, since it was always
4134 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4135 and behave as if it had that value. Return new value of
4136 input_pending. All callers changed.
4137 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4138 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4140 * keymap.c (push_key_description): Omit last arg, which was always 1.
4141 All callers changed.
4143 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4145 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
4147 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4148 ($(BLD)/term.$(O)): Update dependencies.
4150 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4152 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4153 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4154 initializer for PVEC_NORMAL_VECTOR.
4156 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4158 Clean out old termopts cruft.
4159 * termopts.h (flow_control, meta_key): Remove unused decls.
4160 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4161 Don't include termopts.h.
4163 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4165 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4167 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4169 * commands.h (immediate_quit): Remove duplicate decl.
4171 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4173 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4175 (nsfont_open): Remove setting of Vfonts_in_cache.
4176 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4178 2012-10-09 Eli Zaretskii <eliz@gnu.org>
4180 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4181 match what GetLastError returns. Explain why the function is
4184 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4185 'is_tooltip_frame', to avoid confusion with its global namesake.
4187 2012-10-08 Daniel Colascione <dancol@dancol.org>
4189 * xdisp.c (start_hourglass): Call w32_note_current_window when
4190 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4191 build that caused Emacs to display the hourglass cursor forever.
4193 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4194 which is broken under remote desktop, calculate the number of
4195 colors available for a display based on the display's number of
4196 planes and number of bits per pixel per plane. (bug#10397).
4198 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
4200 * nsfont.m (Vfonts_in_cache): New variable.
4201 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4202 are used. Add cached fonts to Vfonts_in_cache.
4203 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4205 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
4207 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4209 (FONT_H): Define after FRAME_H.
4210 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4211 Update dependencies.
4213 * w32term.c: Remove leftover declaration of keyboard_codepage.
4215 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4217 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4218 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4219 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4220 (GLOBAL_SOURCES): Add cygw32.c.
4221 ($(BLD)/unexw32.$(O)):
4223 ($(BLD)/w32console.$(O)):
4224 ($(BLD)/w32fns.$(O)):
4225 ($(BLD)/w32heap.$(O)):
4226 ($(BLD)/w32menu.$(O)):
4227 ($(BLD)/w32proc.$(O)): Add w32common.h.
4229 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4231 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4233 2012-10-08 Daniel Colascione <dancol@dancol.org>
4235 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4236 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4237 accidental message numbering hole. Change other messages to
4240 * w32select.h (HAVE_W32SELECT): Remove.
4242 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4243 w32common.h instead of w32heap.h.
4245 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4246 (get_allocation_unit, get_processor_type, get_w32_major_version)
4247 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4248 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4249 (OS_NT, os_subtype, cache_system_info): Move declarations to
4252 * w32heap.c: Include w32common.h.
4253 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4254 (w32_minor_version, w32_build_number, w32_subtype):
4255 Remove duplicate definitions.
4257 * w32fns.c: Include w32common.h; include w32heap.h only in
4260 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4261 Use `report_file_error' instead of `error' in order to better
4262 inform users of what went wrong. Increase NTGUI_UNICODE file
4263 dialog box file name length to 32k, the maximum allowed by the NT
4266 * w32common.h: New file.
4267 (ROUND_UP, ROUND_DOWN, get_page_size)
4268 (get_allocation_unit, get_processor_type, get_w32_major_version)
4269 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4270 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4271 (OS_NT, os_subtype, cache_system_info): Move here.
4273 * unexw32.c, unexcw.c: Include w32common.h.
4275 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4276 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4277 to call syms_of_w32select.
4279 * cygw32.h: Remove obsolete EXFUN declarations.
4281 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4283 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4284 of w32inevt.o from SOME_MACHINE_OBJECTS.
4286 2012-10-08 Daniel Colascione <dancol@dancol.org>
4288 * image.c: Permanent fix for JPEG compilation issue --- limit
4289 jpeglib `boolean' redefinition to Cygwin builds.
4291 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4293 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4295 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4298 2012-10-08 Daniel Colascione <dancol@dancol.org>
4300 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4301 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4302 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4303 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4304 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4305 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4306 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4307 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4308 now a supported configuration.
4310 * Makefile.in: consolidate image variables into LIBIMAGE; add
4311 W32_OBJ and W32_LIBS. Compile new files.
4314 (_DebPrint) declare tracing facility for W32 debugging. We need
4315 to unify tracing later.
4317 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4318 unconditional use of W32 Unicode functions. Cygwin runs only on
4319 100% Unicode operating systems.
4321 * cygw32.c: New file. Define Cygwin-specific facilities.
4322 (Fcygwin_convert_path_to_windows)
4323 (Fcygwin_convert_path_from_windows): New user functions for
4324 accessing Cygwin path-munging routines.
4326 * cygw32.h: New file.
4327 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4328 UTF-16LE strings temporarily inside non-Lisp-visible string
4331 (w32_strerror): Just what it says on the tin.
4333 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4334 also run for Cygwin; both systems have the same problem with using
4335 GUI facilities in a forked child. Also call syms_of_cygw32,
4336 syms_of_w32select in correct places.
4338 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4339 needs fork-then-exec for daemon launching.
4341 * font.h: Include frame.h.
4343 * image.c: Use the image library cache machinery only when we're
4344 compiling for native WINDOWSNT; Cygwin can use shared libraries
4345 like any other Unixlike system.
4347 * keyboard.c: Clarify a comment regarding the input loop.
4349 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4350 functions directly instead of trying to detect at runtime that our
4351 host operating system supports them. We make this change for two
4352 reasons: Cygwin lacks support for the multibyte character
4353 conversion functions used by the legacy menu code, and Cygwin
4354 never needs to rely on non-Unicode APIs.
4356 * unexw32.c (hinst): Declare extern.
4358 * w32.c: Change header order;
4359 (w32_strerror): Move to w32fns.c because we need it for
4360 non-WINDOWSNT builds.
4362 * w32.h: Add #error macro to make sure we don't include w32.h for
4363 Cygwin builds. Remove w32select declarations.
4365 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
4366 w32fns.c. w32console.c is WINDOWSNT-only.
4368 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4369 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4371 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4372 (w32_major_version, w32_minor_version, w32_build_number)
4373 (os_subtype, sound_type): Define here
4374 (w32_defined_color): Make color parameter const for consistency
4375 with other _defined_color functions.
4376 (w32_createwindow): Unconditionally call w32_init_class instead of
4377 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4378 through the code is complex and unnecessary because class
4379 registration is practically free.
4380 (w32_name_of_message): New EMACSDEBUG-only function.
4381 (Fset_message_beep): Move here
4382 (Fx_open_connection): Require that the display name for Windows be
4383 "w32" for consistency, emacsclient disambiguation, and maybe, one
4384 day, multi-window-system support.
4385 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4386 Cygwin files for W32 GUI facilities, since these clearly don't
4387 expect Cygwin names.
4388 (_DebPrint): Define.
4389 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4390 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4391 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4392 (w32_last_error): Remove.
4394 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4396 * w32heap.c (syspage_mask): Declare here.
4397 (cache_system_info): Remove.
4399 * w32inevt.c (faked_key): Define globally, not statically.
4400 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4401 (w32_console_toggle_lock_key): Move to w32fns.c.
4403 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4405 * w32proc.c (_DebPrint): Move to w32fns.c.
4406 * w32select.c: Include string.h, stdio.h for Cygwin.
4407 * w32select.h: New File.
4409 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4411 (w32_message_fd): New variable. Under Cygwin, holds the file
4412 descriptor the system used to tell us about pending thread
4415 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4416 that prevented compilation under non-WINDOWSNT systems.
4418 (w32_initialize): Open /dev/windows and assign it to
4419 w32_message_fd. Provide w32 feature.
4421 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4422 (WM_EMACS_INPUT_READY): add.
4423 (prepend_msg, w32_message_fd): Declare globally.
4426 (keyboard_handle): Use only when WINDOWSNT.
4427 (notify_msg_ready): New function. Posts a message to the main
4428 thread's message queue under CYGWIN, which wakes up the main
4429 thread from select(2) by making the /dev/windows file descriptor
4430 ready. Under WINDOWSNT, it sets an event the same way the old
4433 (post, prepend_msg): Actually call notify_msg_ready instead of
4434 setting the input event directly.
4436 2012-10-07 Eli Zaretskii <eliz@gnu.org>
4438 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4439 but it still has blocs in it, don't return it to the system,
4440 instead of aborting. (Bug#12402)
4442 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4444 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4446 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4447 MAC_OS_X_VERSION_10_6.
4448 (syms_of_nsterm): Remove comment about Panther and above for
4450 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4451 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4452 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4454 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4455 MAC_OS_X_VERSION_10_4.
4457 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4458 MAC_OS_X_VERSION_10_2.
4460 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4462 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4463 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4465 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4466 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4467 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4468 Remove ns_in_resize check.
4469 (ns_clear_frame_area): Remove resize handle code.
4471 * nsfns.m (ns_in_resize): Remove.
4472 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4473 Remove ns_in_resize check.
4475 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4477 Improve sys_siglist detection.
4478 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4479 defined as a macro, as is done in Solaris.
4480 (sys_siglist_entries): New macro.
4481 (save_strsignal): Use it.
4482 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4483 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4485 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4487 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4488 fullscreen/Fullscreen.
4490 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4491 tobar_height is new.
4493 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4494 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4495 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4496 (windowDidResize:): Check for correct window if old style fullscreen.
4497 Capitalize word in comment. Remove incorrect comment.
4498 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4499 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4500 error in drawing background.
4501 (toggleFullScreen:): Remove comment. Rearrange calls.
4502 Set toolbar values to zero, save old height in tobar_height.
4503 Restore tool bar height when leaving fullscreen.
4504 (canBecomeMainWindow): New function.
4506 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4508 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4510 2012-10-05 Eli Zaretskii <eliz@gnu.org>
4512 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4514 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4515 that time stamps of directories could also be changed.
4516 Don't request the too broad GENERIC_WRITE, only the more restrictive
4517 FILE_WRITE_ATTRIBUTES access rights.
4519 * fileio.c (Fset_file_times): Special-case ignoring errors for
4520 directories only on MSDOS, not on MS-Windows.
4522 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
4524 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4526 2012-10-04 Eli Zaretskii <eliz@gnu.org>
4528 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4529 see whether CreateFile failed.
4531 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4533 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4534 to avoid similar races.
4535 * keyboard.c (pending_signals): Now bool, not int.
4537 Port timers to OpenBSD, plus check for timer failures.
4538 OpenBSD problem reported by Han Boetes.
4539 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4541 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4542 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4543 like OpenBSD, which has timer_settime but does not declare it.
4544 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4545 whether to use itimerspec-related primitives. All uses of
4546 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4548 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4550 * profiler.c (handle_profiler_signal): Fix a malloc race
4551 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4553 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4555 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4557 2012-10-02 Eli Zaretskii <eliz@gnu.org>
4559 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4560 consistent with the change in return value of 'safe_strsignal'.
4562 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4564 Prefer plain 'static' to 'static inline' (Bug#12541).
4565 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4566 (bidi_set_sor_type, bidi_push_embedding_level)
4567 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4568 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4569 (bidi_cache_search, bidi_cache_ensure_space)
4570 (bidi_cache_iterator_state, bidi_cache_find)
4571 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4572 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4573 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4574 Now 'static', not 'static inline'.
4576 Count overruns when profiling; change units to ns.
4577 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4578 Give extra weight to samples after overruns, to attempt to count
4579 the time more accurately.
4580 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4581 the underlying primitives nominally do ns.
4582 (Fprofiler_cpu_start): Document the change. Mention that
4583 the sampling intervals are only approximate.
4585 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4587 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4589 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4590 case for the special 0 coding-system.
4592 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4593 (Fmake_overlay): Remove redundant tests.
4594 (fix_start_end_in_overlays): Remove redundant recentering.
4596 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
4598 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4599 Update dependencies.
4601 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4603 Fix a malloc race condition involving strsignal.
4604 A signal can arrive in the middle of a malloc, and Emacs's signal
4605 handler can invoke strsignal, which can invoke malloc, which is
4606 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4607 Fix it by altering the signal handler so that it does not invoke
4609 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4610 * process.c (status_message): Use const pointer, in case strsignal
4611 is #defined to safe_strsignal.
4612 * sysdep.c (sys_siglist, init_signals): Always define and
4613 initialize a substitute sys_siglist if the system does not define
4614 one, even if HAVE_STRSIGNAL.
4615 (safe_strsignal): Rename from strsignal. Always define,
4616 using sys_siglist. Return a const pointer.
4617 * syssignal.h (safe_strsignal): New decl.
4618 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4620 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4622 * w32proc.c (timer_loop): Fix code that waits for timer
4623 expiration, to avoid high CPU usage.
4625 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4627 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4628 (sweep_weak_table): Remove redundant prototypes.
4630 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4632 * emacs.c: Move the inclusion of TERM_HEADER after including
4633 windows.h on WINDOWSNT. This avoids compilation problems with
4636 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4638 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4639 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4640 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4641 as the previous version used 'void *'.
4643 * ralloc.c (ROUNDUP): Fix last change.
4644 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4647 * w32proc.c <disable_itimers>: New static flag.
4648 (init_timers): Initialize it to zero, after creating the critical
4649 sections used by the timer threads.
4650 (term_timers): Set to 1 before deleting the critical sections.
4651 (getitimer, setitimer): If disable_itimers is non-zero, return an
4652 error indication without doing anything. Reported by Fabrice
4653 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4654 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4656 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4659 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4660 term_ntproc after all the other bookkeeping, to get timers working
4661 as long as possible.
4663 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4665 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4666 Suggested by Juri Linkov in
4667 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4669 Prefer plain 'static' to 'static inline' (Bug#12541).
4670 With static functions, modern compilers inline pretty well by
4671 themselves; advice from programmers often hurts as much as it helps.
4672 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4673 this change shrinks the text size of the Emacs executable by 1.1%
4674 without affecting CPU significantly in my benchmark.
4675 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4676 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4677 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4678 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4679 (bset_auto_fill_function, bset_auto_save_file_format)
4680 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4681 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4682 (bset_cache_long_line_scans, bset_case_fold_search)
4683 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4684 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4685 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4686 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4687 (bset_header_line_format, bset_indicate_buffer_boundaries)
4688 (bset_indicate_empty_lines, bset_invisibility_spec)
4689 (bset_left_fringe_width, bset_major_mode, bset_mark)
4690 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4691 (bset_name, bset_overwrite_mode, bset_pt_marker)
4692 (bset_right_fringe_width, bset_save_length)
4693 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4694 (bset_scroll_up_aggressively, bset_selective_display)
4695 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4696 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4697 (set_buffer_overlays_after):
4698 * category.c (bset_category_table):
4699 * charset.c (read_hex):
4700 * coding.c (produce_composition, produce_charset)
4701 (handle_composition_annotation, handle_charset_annotation)
4703 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4704 (assign_row, set_frame_matrix_frame, make_current)
4706 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4707 * fns.c (maybe_resize_hash_table):
4708 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4709 * gmalloc.c (register_heapinfo):
4710 * image.c (lookup_image_type):
4711 * intervals.c (set_interval_object, set_interval_left)
4712 (set_interval_right, copy_interval_parent, rotate_right)
4713 (rotate_left, balance_possible_root_interval):
4714 * keyboard.c (kset_echo_string, kset_kbd_queue)
4715 (kset_keyboard_translate_table, kset_last_prefix_arg)
4716 (kset_last_repeatable_command, kset_local_function_key_map)
4717 (kset_overriding_terminal_local_map, kset_real_last_command)
4718 (kset_system_key_syms, clear_event, set_prop):
4719 * lread.c (digit_to_number):
4720 * marker.c (attach_marker, live_buffer, set_marker_internal):
4721 * nsterm.m (ns_compute_glyph_string_overhangs):
4722 * process.c (pset_buffer, pset_command)
4723 (pset_decode_coding_system, pset_decoding_buf)
4724 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4725 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4726 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4727 * syntax.c (bset_syntax_table, dec_bytepos):
4728 * terminal.c (tset_param_alist):
4729 * textprop.c (interval_has_some_properties)
4730 (interval_has_some_properties_list):
4731 * window.c (wset_combination_limit, wset_dedicated)
4732 (wset_display_table, wset_hchild, wset_left_fringe_width)
4733 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4734 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4735 (wset_right_fringe_width, wset_right_margin_cols)
4736 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4737 (wset_vertical_scroll_bar_type, wset_window_parameters):
4738 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4739 (wset_column_number_displayed, wset_region_showing)
4740 (window_box_edges, run_window_scroll_functions)
4741 (append_glyph_string_lists, prepend_glyph_string_lists)
4742 (append_glyph_string, set_glyph_string_background_width)
4743 (append_glyph, append_composite_glyph)
4744 (take_vertical_position_into_account):
4745 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4746 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4747 (lface_hash, lface_same_font_attributes_p, lookup_face):
4748 * xml.c (libxml2_loaded_p):
4749 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4750 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4751 Now 'static', not 'static inline'.
4754 (bidi_copy_it): Do the whole copy with a single memcpy.
4755 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4757 Revert the FOLLOW-SYMLINKS change for file-attributes.
4758 Doing it right would require several changes to Tramp, and there's
4759 not enough time to get that tested before the freeze today.
4760 * dired.c (directory_files_internal, Ffile_attributes):
4763 * frame.c (x_report_frame_params): Port better to wider ints.
4764 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4765 or that pointers can be printed in 15 decimal digits.
4766 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4768 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4770 Support x64 build on MS-Windows.
4771 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4772 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4773 compatibility with x64.
4774 (x_get_focus_frame): Add prototype.
4776 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4777 defining an XRectangle structure.
4779 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4780 arithmetics for compatibility with x64.
4782 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4783 compatibility with x64.
4785 * w32heap.h: Adjust prototypes and declarations.
4787 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4788 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4789 DWORD, long, and unsigned long, for compatibility with x64.
4790 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4791 (sbrk): Argument is now of type ptrdiff_t.
4793 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4795 (w32_msg_pump): Use WPARAM type for 'result'.
4797 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4799 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4800 compatibility with x64.
4802 * vm-limit.c (lim_data): Now size_t.
4803 (check_memory_limits): Adjust prototypes of real_morecore and
4804 __morecore to receive argument of type ptrdiff_t. Use size_t for
4805 five_percent and data_size.
4807 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4808 variables, for compatibility with x64.
4809 (rva_to_section, offset_to_section, relocate_offset)
4810 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4811 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4812 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4813 for compatibility with x64.
4815 * sysdep.c (STDERR_FILENO): Define if not already defined.
4817 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4818 (__morecore): Argument type is now ptrdiff_t.
4819 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4820 (relinquish): Use ptrdiff_t type for 'excess'.
4821 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4823 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4824 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4825 instead of a literal number.
4827 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4828 (min): Define only if not already defined.
4830 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4831 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4834 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4835 'bitmaps' is a pointer.
4837 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4839 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4841 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4843 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4844 * dired.c (directory_files_internal, Ffile_attributes):
4845 New arg follow_symlinks. All uses changed.
4847 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4849 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4851 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4853 Support atimers and CPU profiler via profile.c on MS-Windows.
4854 * w32proc.c (sig_mask, crit_sig): New static variables.
4855 (sys_signal): Support SIGALRM and SIGPROF.
4856 (sigemptyset, sigaddset, sigfillset, sigprocmask)
4857 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
4858 sigfillset, and sigprocmask are no longer no-ops.
4859 (sigismember): New function.
4860 (struct itimer_data): New definition.
4861 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4862 (crit_prof): New static variables.
4863 (MAX_SINGLE_SLEEP): New definition.
4864 (timer_loop, stop_timer_thread, term_timers, init_timers)
4865 (start_timer_thread, getitimer, setitimer): New functions.
4866 (alarm): No longer a no-op, calls setitimer.
4868 * w32.c (term_ntproc): Call term_timers.
4869 (init_ntproc): Make sure all signals are unblocked at startup, to
4870 erase any traces of dumping. Call init_timers.
4872 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4873 Windows-specific code to display the hourglass mouse pointer is no
4875 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4876 to hourglass timer expiration.
4877 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4878 Remove, no longer used.
4879 (w32_note_current_window, show_hourglass, hide_hourglass):
4880 New functions, in support of hourglass cursor display similar to other
4882 (syms_of_w32fns): Don't initialize hourglass_timer.
4884 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4886 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4888 * w32.h (init_timers, term_timers): Add prototypes.
4890 2012-09-30 Kenichi Handa <handa@gnu.org>
4892 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4893 to the buffer relocation which may be caused by ccl_driver.
4895 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4897 * xfns.c (Fx_file_dialog): Update comment.
4899 * w32fns.c (Fx_file_dialog): Update comment.
4901 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4902 Initialize panel name field if OSX >= 10.6.
4904 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4906 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4908 * nsterm.m (NEW_STYLE_FS): New define.
4909 (ns_fullscreen_hook, windowWillEnterFullScreen)
4910 (windowDidEnterFullScreen, windowWillExitFullScreen)
4911 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4912 (setFSValue): New functions.
4913 (EmacsFSWindow): New implementation.
4914 (canBecomeKeyWindow): New function for EmacsFSWindow.
4915 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4916 (dealloc): Release nonfs_window if in fullscreen.
4917 (updateFrameSize:): Call windowDidMove to update top/left.
4918 (windowWillResize:toSize:): Check if frame is still maximized.
4919 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4920 next_maximized, maximized_width, maximized_height and nonfs_window.
4921 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4923 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
4924 fullscreen. Set maximized_width/height. Act on next_maximized.
4926 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4927 (EmacsView): Add variables for fullscreen.
4928 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4929 (EmacsFSWindow): New interface for fullscreen.
4931 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
4933 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4935 2012-09-30 Chong Yidong <cyd@gnu.org>
4937 * fns.c (Frandom): Doc fix.
4939 2012-09-30 Martin Rudalics <rudalics@gmx.at>
4941 * window.c (Vwindow_combination_limit): New default value.
4942 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4944 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4946 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4947 Suggested by Eli Zaretskii in
4948 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4950 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4952 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4953 HAVE_TIMER_SETTIME is defined.
4955 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4957 Profiler improvements: more-accurate timers, overflow checks.
4958 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4959 signal.h, setjmp.h. Include systime.h instead.
4960 (saturated_add): New function.
4961 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4962 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4963 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4965 (enum profiler_cpu_running): New enum.
4966 (profiler_cpu_running): Now of that enum type, not bool.
4967 All uses changed to store the new value.
4968 (handle_profiler_signal): Rename from sigprof_handler_1,
4969 for consistency with other handlers. Do not check whether
4970 cpu_log is a hash-table if garbage collecting, since it
4971 doesn't matter in that case.
4972 (deliver_profiler_signal): Rename from sigprof_handler,
4973 for consistency with other handlers.
4974 (setup_cpu_timer): New function, with much of what used to be in
4975 Fprofiler_cpu_start. Check for out-of-range argument.
4976 Prefer timer_settime if available, and prefer
4977 thread cputime clocks, then process cputime clocks, then
4978 monotonic clocks, to the old realtime clock. Use make_timeval
4979 to round more-correctly when falling back to setitimer.
4980 (Fprofiler_cpu_start): Use it.
4981 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4982 Don't assume that passing NULL as the 2nd argument of setitimer
4983 is the same as passing a pointer to all-zero storage.
4984 Ignore SIGPROF afterwards.
4985 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4986 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4987 non-fatal signal handlers. Ignore SIGPROF on startup.
4988 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4989 in profiler.c, since sysdep.c now uses it.
4991 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4992 Suggested by Eli Zaretskii in
4993 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4995 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
4997 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4999 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5001 * lisp.h (struct backtrace): Remove indirection for `function' field.
5002 * xdisp.c (redisplay_internal):
5003 * profiler.c (record_backtrace, sigprof_handler_1):
5004 * alloc.c (Fgarbage_collect):
5005 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5006 (Fbacktrace_frame): Adjust accordingly.
5008 2012-09-28 Glenn Morris <rgm@gnu.org>
5010 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5011 (Frun_hook_with_args_until_failure): Doc fixes.
5013 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5015 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5016 Qautomatic_redisplay and change the symbol name. All users changed.
5018 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5020 * profiler.c (sigprof_handler): Fix race condition.
5022 2012-09-28 Glenn Morris <rgm@gnu.org>
5024 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5026 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5028 Check more robustly for timer_settime.
5029 * Makefile.in (LIB_TIMER_TIME): New macro.
5031 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5032 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5035 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5037 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5039 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5041 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5043 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5045 * character.h (MAYBE_UNIFY_CHAR): Remove.
5046 * charset.c, charset.h (maybe_unify_char): Now static.
5047 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5048 Since this stuff is now private to charset.c, there's no need for
5049 a public macro and no need to inline by hand.
5051 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5052 Stefan Monnier <monnier@iro.umontreal.ca>
5053 Juanma Barranquero <lekktu@gmail.com>
5055 * profiler.c: New file.
5056 * Makefile.in (base_obj): Add profiler.o.
5057 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5058 ($(BLD)/profiler.$(O)): New target.
5059 * emacs.c (main): Call syms_of_profiler.
5060 * alloc.c (Qautomatic_gc): New constant.
5061 (MALLOC_PROBE): New macro.
5062 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5063 (total_bytes_of_live_objects): New function.
5064 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5065 Call malloc_probe for the memory profiler.
5066 (syms_of_alloc): Define Qautomatic_gc.
5067 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5069 (struct backtrace): Move definition...
5070 * lisp.h (struct backtrace): ..here.
5071 (Qautomatic_gc, profiler_memory_running): Declare vars.
5072 (malloc_probe, syms_of_profiler): Declare functions.
5073 * xdisp.c (Qautomatic_redisplay): New constant.
5074 (redisplay_internal): Record itself in backtrace_list.
5075 (syms_of_xdisp): Define Qautomatic_redisplay.
5077 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5078 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5080 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5082 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5084 Prefer POSIX timers if available.
5085 They avoid a race if the timer is too close to the current time.
5086 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5087 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5088 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5090 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5092 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5093 CHAR_STRING_ADVANCE.
5094 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5095 STRING_CHAR_ADVANCE.
5097 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5099 Move Vlibrary_cache to emacs.c and reset before dumping.
5101 * lisp.h (reset_image_types): Declare.
5102 [WINDOWSNT] (Vlibrary_cache): Declare.
5104 * image.c (reset_image_types): New function.
5106 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5107 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5108 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5110 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5111 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5113 * w32.h (Vlibrary_cache): Do not declare.
5115 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5117 * w32proc.c (sys_signal): Handle all signals defined by the
5118 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5119 handlers for signals supported by Windows. Don't override
5120 term_ntproc as the handler for SIGABRT.
5121 (sigaction): Rewrite to call sys_signal instead of duplicating its
5123 (sys_kill): Improve commentary.
5125 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5126 consistency with a signature of a signal handler. All callers
5128 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5129 install term_ntproc as a signal handler for SIGABRT, as that
5130 should be done by the dumped Emacs.
5132 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5134 * w32select.c (term_w32select): Protect against repeated
5135 invocation by setting clipboard_owner to NULL after calling
5138 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5139 and term_ntproc to their modified signatures.
5141 * character.c (char_string, string_char): Remove calls to
5142 MAYBE_UNIFY_CHAR. See the discussion starting at
5143 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5146 2012-09-25 Chong Yidong <cyd@gnu.org>
5148 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5150 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5152 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5153 when encountering an unknown bytecode.
5155 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5157 image.c, indent.c: Use bool for booleans.
5158 * dispextern.h (struct image_type): Members valid_p, load, init
5159 now return bool, not int. All uses changed.
5160 * image.c: Omit unnecessary static decls.
5161 (x_create_bitmap_mask, x_build_heuristic_mask):
5162 Return void, not int, since callers don't care about the return value.
5163 (x_create_bitmap_mask, define_image_type, valid_image_p)
5164 (struct image_keyword, parse_image_spec, image_spec_value)
5165 (check_image_size, image_background)
5166 (image_background_transparent, x_clear_image_1)
5167 (postprocess_image, lookup_image, x_check_image_size)
5168 (x_create_x_image_and_pixmap, xbm_image_p)
5169 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5170 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5171 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5172 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5173 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5174 (png_image_p, init_png_functions, png_load_body, png_load)
5175 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5176 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5177 (init_gif_functions, gif_load, imagemagick_image_p)
5178 (imagemagick_load_image, imagemagick_load, svg_image_p)
5179 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5181 * nsimage.m (ns_load_image):
5182 * nsterm.m (ns_defined_color):
5183 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5184 * xfns.c (x_defined_color):
5185 * xterm.c (x_alloc_lighter_color_for_widget)
5186 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5187 (x_alloc_lighter_color):
5188 * indent.c (disptab_matches_widthtab, current_column)
5189 (scan_for_column, string_display_width, indented_beyond_p)
5190 (compute_motion, vmotion, Fvertical_motion):
5191 Use bool for booleans.
5193 2012-09-24 Chong Yidong <cyd@gnu.org>
5195 * chartab.c (Fset_char_table_default): Obsolete function removed.
5197 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5199 Move pid_t related decls out of lisp.h.
5200 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5201 (interruptible_wait_for_termination):
5202 Move these decls from lisp.h to syswait.h, since they use pid_t.
5203 Needed on FreeBSD; see Herbert J. Skuhra in
5204 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5205 * callproc.c: Include syswait.h.
5207 gnutls.c, gtkutil.c: Use bool for boolean.
5208 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5209 (emacs_gnutls_handle_error):
5210 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5211 (xg_hide_tooltip, xg_create_frame_widgets)
5212 (create_dialog, xg_uses_old_file_dialog)
5213 (xg_get_file_with_chooser, xg_get_file_with_selection)
5214 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5215 (xg_item_label_same_p, xg_update_menubar)
5216 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5217 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5218 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5219 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5220 (update_frame_tool_bar, free_frame_tool_bar):
5221 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5222 * nsmenu.m (ns_update_menubar):
5223 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5224 * xfns.c (Fx_show_tip) [USE_GTK]:
5225 Use bool for boolean.
5226 * gtkutil.c (xg_update_frame_menubar):
5227 * xmenu.c (update_frame_menubar):
5228 Return void, not int, since caller ignores return value.
5229 * gtkutil.c (xg_change_toolbar_position):
5232 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5234 * makefile.w32-in (BLOCKINPUT_H): Remove.
5235 (SYSSIGNAL_H): New macro.
5236 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5237 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5238 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5239 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5240 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5241 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5242 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5243 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5244 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5245 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5246 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5247 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5248 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5249 ($(BLD)/w32xfns.$(O)): Update dependencies.
5251 2012-09-23 Eli Zaretskii <eliz@gnu.org>
5253 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5254 fatal_error_backtrace.
5256 * w32proc.c (sys_kill): Undo last change: don't do anything when
5257 invoked to deliver SIGABRT to our own process. This is now
5258 handled by emacs_raise.
5260 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5262 * w32term.c (w32_read_socket): Remove leftover reference to
5263 interrupt_input_pending.
5265 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5267 Do not use SA_NODEFER.
5268 Problem reported by Dani Moncayo in
5269 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5271 * sysdep.c (emacs_abort): Do not reset signal handler.
5272 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5273 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5274 wanted even on POSIXish hosts, and it doesn't work on Windows.
5276 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5278 * xterm.c (x_term_init): Call fixup_locale before and after calling
5279 gtk_init (Bug#12392).
5281 2012-09-23 Chong Yidong <cyd@gnu.org>
5283 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5284 Vdynamic_library_alist.
5286 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5287 (Fgnutls_available_p): Caller changed.
5289 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5290 (Flibxml_parse_xml_region): Likewise.
5292 * dispextern.h (struct image_type): Remove arg from init function.
5294 * image.c (Finit_image_library, lookup_image_type)
5295 (define_image_type): Remove now-unneeded second arg.
5296 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5297 (init_tiff_functions, init_gif_functions, init_svg_functions):
5298 Arglist and w32_delayed_load calling convention changed.
5299 (gs_type): Remove init_gs_functions; there is no such function.
5300 (valid_image_p, make_image): Fix caller to lookup_image_type.
5302 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5304 Simplify and avoid signal-handling races (Bug#12471).
5306 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5307 Avoid recursive loop if there's a fatal error in the function itself.
5308 * atimer.c (pending_atimers):
5309 * blockinput.h: Don't include "atimer.h"; no longer needed.
5310 (interrupt_input_pending): Remove. All uses removed.
5311 pending_signals now counts both atimers and ordinary interrupts.
5312 This is less racy than having three separate pending-signal flags.
5313 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5315 Rename from their upper-case counterparts BLOCK_INPUT,
5316 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5317 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5318 This makes it easier to access volatile variables more accurately.
5319 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5320 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5321 that's more reliable if the code is buggy and sets
5322 interrupt_input_blocked to a negative value. All uses changed.
5323 * atimer.c (deliver_alarm_signal):
5324 Remove. No need to deliver this to the parent; any thread can
5325 handle this signal now. All uses replaced by underlying handler.
5326 * atimer.c (turn_on_atimers):
5327 * dispnew.c (handle_window_change_signal):
5328 * emacs.c (handle_danger_signal):
5329 * keyboard.c (kbd_buffer_get_event):
5330 Don't reestablish signal handler; not needed with sigaction.
5331 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5333 Rework to avoid unnecessary accesses to volatile variables.
5334 (UNBLOCK_INPUT_TO): Now a function.
5335 (totally_unblock_input, unblock_input): New decls.
5336 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5337 (init_data): Remove. Necessary stuff now done in init_signal.
5338 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5339 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5340 (fatal_error_code): Remove; no longer needed.
5341 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5342 it doesn't always backtrace. All uses changed. No need to reset
5343 signal to default, since sigaction and/or die does that for us now.
5344 Use emacs_raise (FOO), not kill (getpid (), FOO).
5345 (main): Check more-accurately whether we're dumping.
5346 Move fatal-error setup to sysdep.c
5347 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5348 * gtkutil.c (xg_get_file_name, xg_get_font):
5349 Remove no-longer-needed signal-mask manipulation.
5350 * keyboard.c, process.c (POLL_FOR_INPUT):
5351 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5352 * keyboard.c (read_avail_input): Remove.
5353 All uses replaced by gobble_input.
5354 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5355 (kbd_buffer_store_event_hold, gobble_input):
5356 (record_asynch_buffer_change) [USABLE_SIGIO]:
5357 (store_user_signal_events):
5358 No need to mess with signal mask.
5359 (gobble_input): If blocking input and there are terminals, simply
5360 set pending_signals to 1 and return. All hooks changed to not
5361 worry about whether input is blocked.
5362 (process_pending_signals): Clear pending_signals before processing
5363 them, in case a signal comes in while we're processing.
5364 By convention callers now test pending_signals before calling us.
5365 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5366 New functions, to support changes to blockinput.h.
5367 (handle_input_available_signal): Now extern.
5368 (reinvoke_input_signal): Remove. All uses replaced by
5370 (quit_count): Now volatile, since a signal handler uses it.
5371 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5372 All callers changed. Block SIGINT only if not already blocked.
5373 Clear sigmask reliably, even if Fsignal returns, which it can.
5374 Omit unnecessary accesses to volatile var.
5375 (quit_throw_to_read_char): No need to restore sigmask.
5376 * keyboard.c (gobble_input, handle_user_signal):
5377 * process.c (wait_reading_process_output):
5378 Call signal-handling code rather than killing ourselves.
5379 * lisp.h: Include <float.h>, for...
5380 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5381 (pending_signals): Now volatile.
5382 (syms_of_data): Now const if IEEE floating point.
5383 (handle_input_available_signal) [USABLE_SIGIO]:
5384 (terminate_due_to_signal, record_child_status_change): New decls.
5385 * process.c (create_process): Avoid disaster if memory is exhausted
5386 while we're processing a vfork, by tightening the critical section
5388 (send_process_frame, process_sent_to, handle_pipe_signal)
5389 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5391 (send_process): No need for setjmp/longjmp any more, since the
5392 SIGPIPE stuff is now gone. Instead, report an error if errno
5394 (record_child_status_change): Now extern. PID and W are now args.
5395 Return void, not bool. All callers changed.
5396 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5397 Remove. All uses removed. This bug should be fixed now in a
5399 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5400 and record the child status change directly. This avoids the
5401 need to futz with the signal mask.
5402 (process_fatal_action): Move here from emacs.c.
5403 (emacs_sigaction_flags): New function, containing
5404 much of what used to be in emacs_sigaction_init.
5405 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5406 caught by emacs, to make races less likely.
5407 (deliver_process_signal): Rename from handle_on_main_thread.
5409 (BACKTRACE_LIMIT_MAX): Now at top level.
5410 (thread_backtrace_buffer, threadback_backtrace_pointers):
5412 (deliver_thread_signal, deliver_fatal_thread_signal):
5413 New functions, for more-accurate delivery of thread-specific signals.
5414 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5415 (deliver_arith_signal): Handle in this thread, not
5416 in the main thread, since it's triggered by this thread.
5417 (maybe_fatal_sig): New function.
5418 (init_signals): New arg DUMPING so that we can be more accurate
5419 about whether we're dumping. Caller changed.
5420 Treat thread-specific signals differently from process-general signals.
5421 Block all signals while handling fatal error; that's safer.
5422 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5424 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5425 Ignore SIGPIPE unless batch.
5426 (emacs_backtrace): Output backtrace for the appropriate thread,
5427 which is not necessarily the main thread.
5428 * syssignal.h: Include <stdbool.h>.
5429 (emacs_raise): New macro.
5430 * xterm.c (x_connection_signal): Remove; no longer needed
5431 now that we use sigaction.
5432 (x_connection_closed): No need to mess with sigmask now.
5433 (x_initialize): No need to reset SIGPIPE handler here, since
5434 init_signals does this for us now.
5436 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5438 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5439 background rect may be larger (Bug#12245).
5441 2012-09-23 Chong Yidong <cyd@gnu.org>
5443 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5445 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5447 * .gdbinit: Just stop at fatal_error_backtrace.
5448 See Stefan Monnier's request in
5449 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5450 Remove no-longer-used query of system type.
5452 2012-09-22 Chong Yidong <cyd@gnu.org>
5454 * search.c (Freplace_match): Doc fix (Bug#12325).
5456 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5458 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5459 (Fline_end_position): Doc fix.
5461 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5463 2012-09-22 Chong Yidong <cyd@gnu.org>
5465 * dispextern.h (struct image_type): Add new slot, storing a type
5466 initialization function.
5468 * image.c (define_image_type): Call the image initializer function
5469 if it is defined. Arguments and return value changed.
5470 (valid_image_p, make_image): Callers changed.
5471 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5472 (gif_type, imagemagick_type, svg_type, gs_type):
5473 Add initialization functions.
5474 (Finit_image_library): Call lookup_image_type.
5475 (CHECK_LIB_AVAILABLE): Macro deleted.
5476 (lookup_image_type): Call define_image_type here, rather than via
5477 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5478 (syms_of_image): Move define_image_type calls for xbm_type and
5479 pbm_type to lookup_image_type.
5481 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5483 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5484 'idle_timers' from here ...
5485 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5486 lists, to avoid infloops when the timer does something stupid,
5487 like reinvoke itself with the same or smaller time-out.
5490 2012-09-22 Martin Rudalics <rudalics@gmx.at>
5492 * window.c (Fsplit_window_internal): Handle only Qt value of
5493 Vwindow_combination_limit separately.
5494 (Qtemp_buffer_resize): New symbol.
5495 (Vwindow_combination_limit): New default value.
5498 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5500 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5501 the new overlay string. (Bug#10159)
5503 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5505 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5506 or that fprintf is async-signal-safe. POSIX doesn't require
5509 2012-09-22 Chong Yidong <cyd@gnu.org>
5511 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5514 2012-09-22 Kenichi Handa <handa@gnu.org>
5516 * composite.c (composition_reseat_it): Handle the case that a
5517 grapheme cluster is not covered by a single font (Bug#12352).
5519 2012-09-21 Chong Yidong <cyd@gnu.org>
5521 * image.c (define_image_type): Avoid adding duplicate types to
5522 image_types (Bug#12463). Suggested by Jörg Walter.
5524 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5526 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5527 (print_load_command_name): Add case LC_DATA_IN_CODE.
5528 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5530 2012-09-21 Glenn Morris <rgm@gnu.org>
5532 * eval.c (Frun_hook_with_args_until_success)
5533 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5535 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
5537 * fileio.c (Ffile_selinux_context): Only call freecon when
5538 lgetfilecon succeeded.
5539 (Fset_file_selinux_context): Likewise. (Bug#12444)
5541 2012-09-21 Eli Zaretskii <eliz@gnu.org>
5543 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5544 reordering, locate the cursor by calling set_cursor_from_row; if
5545 that fails, clear the desired glyph matrix before returning a
5546 failure indication to the caller. Fixes leaving garbled display
5547 when fast scrolling with a down-key. (Bug#12403)
5548 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5549 scrolling through multibyte text.
5551 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5553 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5554 calling mark_vectorlike since that's the one that marks the window.
5555 (mark_discard_killed_buffers): Mark the final cdr.
5556 * window.h (struct window): Move prev/next_buffers to the
5557 non-standard fields.
5558 * window.c (make_window): Initialize prev/next_buffers manually.
5560 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5562 Omit unused arg EXPECTED from socket hooks.
5563 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5564 * nsterm.m (ns_term_init):
5565 * termhooks.h (struct terminal.read_socket_hook):
5566 * w32inevt.c (w32_console_read_socket):
5567 * w32term.c (w32_read_socket):
5568 * xterm.c (XTread_socket):
5569 Omit unused arg EXPECTED. All callers changed.
5570 (store_user_signal_events): Return void, not int, since callers no
5571 longer care about the return value. All uses changed.
5573 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
5575 * w32gui.h (XParseGeometry): Do not declare.
5577 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5579 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
5580 Ignore 'expected'. See Eli Zaretskii in
5581 <http://bugs.gnu.org/12471#8> (last line).
5583 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5584 (XParseGeometry): Now static. Substitute extremal values for
5585 values that are out of range.
5587 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5589 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5591 * nsfns.m (XParseGeometry): Remove.
5592 (Fx_create_frame): Call x_set_offset to correctly interpret
5593 top_pos in geometry.
5595 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
5596 (Fx_parse_geometry): If there is a space in string, call
5597 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5599 2012-09-17 Eli Zaretskii <eliz@gnu.org>
5601 * search.c (scan_buffer): Use character positions in calls to
5602 region_cache_forward and region_cache_backward, not byte
5603 positions. (Bug#12196)
5605 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5606 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5608 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5609 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5610 emacs_blocked_malloc, now deleted.
5612 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5614 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5615 The workaround was for improving performance on Solaris 2.4, but
5616 is getting in the way now. Emacs will still work if someone is
5617 still running Solaris 2.4 in a museum somewhere; Sun dropped
5618 support for Solaris 2.4 in 2003.
5619 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5620 * process.c (create_process) [HAVE_WORKING_VFORK]:
5621 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5622 since Emacs no longer uses vfork on that platform.
5624 2012-09-17 Glenn Morris <rgm@gnu.org>
5626 * emacs.c: Use COPYRIGHT.
5628 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5630 Remove configure's --without-sync-input option (Bug#12450).
5631 When auditing signal-handling in preparation for cleaning it up,
5632 I found that SYNC_INPUT has race conditions and would be a real
5633 pain to fix. Since it's an undocumented and deprecated
5634 configure-time option, now seems like a good time to remove it.
5635 Also see <http://bugs.gnu.org/11080#16>.
5636 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5637 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5638 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5639 (malloc_hysteresis):
5640 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5641 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5642 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5643 (dont_register_blocks, bytes_used_when_reconsidered)
5644 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5645 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5646 [!SYSTEM_MALLOC && !SYNC_INPUT]:
5647 Remove. All uses removed.
5648 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5649 implementation, one that depends on whether the new macro
5650 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5652 * atimer.c (run_timers, handle_alarm_signal):
5653 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5654 (handle_async_input, process_pending_signals)
5655 (handle_input_available_signal, init_keyboard):
5656 * nsterm.m (ns_read_socket):
5657 * process.c (wait_reading_process_output):
5658 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5659 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5661 * xterm.c (XTread_socket):
5663 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5664 * eval.c (handling_signal): Remove. All uses removed.
5665 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5666 All uses replaced with the SYNC_INPUT version.
5667 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5669 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5672 * font.c (Ffont_shape_gstring): Remove unused local.
5674 2012-09-16 Glenn Morris <rgm@gnu.org>
5676 * Makefile.in (clean): No longer run nextstep's clean.
5678 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5680 (ns-app): Move here from ns.mk, and simplify.
5681 (clean): Simplify nextstep entry.
5682 * ns.mk: Remove file.
5684 2012-09-17 Kenichi Handa <handa@gnu.org>
5686 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5687 not covert the last few charactes.
5689 2012-09-16 Kenichi Handa <handa@gnu.org>
5691 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5692 here, but just check the validity of glyphs in the glyph-string.
5694 2012-09-16 Martin Rudalics <rudalics@gmx.at>
5696 * window.c (Fwindow_parameter, Fset_window_parameter):
5697 Accept any window as argument (Bug#12452).
5699 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5701 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5702 to ns_term_init to avoid memory leak.
5704 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5705 explicit retain/release.
5706 (ns_term_init): Only allow one display. Initialize outerpool and
5709 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5711 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5712 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5713 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5714 the Microsoft problem in a different way, by altering ../nt/config.nt.
5716 2012-09-15 Eli Zaretskii <eliz@gnu.org>
5731 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5732 by lisp.h. This completes removal of setjmp.h inclusion
5733 erroneously announced in the previous commit. (Bug#12446)
5735 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5738 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5739 not defined as a macro. The latter happens on MS-Windows.
5742 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5744 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5745 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
5746 Some instances of '#include <setjmp.h>' removed, if the
5747 only reason for the instance was because "lisp.h" was included.
5748 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5749 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5750 and _longjmp with the new symbols. Emacs already uses _setjmp if
5751 available, so this change affects only POSIXish hosts that have
5752 sigsetjmp but not _setjmp, such as some versions of Solaris and
5753 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5754 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5755 (png_load_body) [HAVE_PNG]:
5756 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5757 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5758 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5759 since PNG requires jmp_buf. This is the only exception to the
5760 general rule that we now use sys_setjmp and sys_longjmp.
5761 This exception is OK since this code does not change the signal
5762 mask or longjmp out of a signal handler.
5764 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5766 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5767 Include "syssignal.h", for 'main_thread'.
5769 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5771 Avoid out-of-range marker position (Bug#12426).
5772 * insdel.c (replace_range, replace_range_2):
5773 Adjust markers before overlays, as suggested by comments.
5774 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5775 Remove redundant check before calling offset_intervals.
5777 2012-09-14 Martin Rudalics <rudalics@gmx.at>
5779 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5780 current buffer (Bug#12387).
5782 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
5784 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5786 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5788 Use a more backwards-compatible timer format (Bug#12430).
5789 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5790 vector element, not from the 4th, since PSECS is now at the end.
5791 (Fcurrent_idle_time): Doc fix.
5793 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5795 Function to mark objects and remove killed buffers at once.
5796 * alloc.c (discard_killed_buffers): Rename to ...
5797 (mark_discard_killed buffers) ... new name. Add marking
5798 of remaining objects. Fix comment. Adjust users.
5799 (mark_object): Do not touch frame buffer lists here.
5800 * frame.c (delete_frame): Reset frame buffer lists here.
5802 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5804 Better workaround for GNOME bug when --enable-gcc-warnings.
5805 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5806 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5807 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5809 Simplify SIGIO usage (Bug#12408).
5810 The code that dealt with SIGIO was crufty and confusing, e.g., it
5811 played tricks like "#undef SIGIO" but these tricks were not used
5812 consistently. Simplify mostly by not #undeffing standard symbols,
5813 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5814 or not as we please) rather than "defined SIGIO" (standard symbol
5815 that we probably shouldn't #undef).
5816 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5817 Modules that need it can include it.
5818 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5819 * dispextern.h (ignore_sigio): New decl.
5820 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5821 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5822 * emacs.c (shut_down_emacs):
5823 * keyboard.c (kbd_buffer_store_event_hold):
5824 Use ignore_sigio rather than invoking 'signal' directly.
5825 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5827 (FIONREAD, SIGIO): Do not #undef.
5828 (tty_read_avail_input): Use #error rather than a syntax error.
5829 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5830 for I_PIPE, used by SETUP_SLAVE_PTY.
5831 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5832 * sysdep.c (croak): Remove; no longer needed. This bit of
5833 temporary code, with Fred N. Fish's comment that it's temporary,
5834 has been in Emacs since at least 1992!
5835 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5836 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5837 * syssignal.h (croak): Remove decl.
5838 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5839 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5840 now that we're termios-only.
5841 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5842 * term.c (dissociate_if_controlling_tty): Use #error rather than
5845 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5846 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5847 to work around GNOME bug 683906.
5848 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5849 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5850 This works around GCC bug 54561.
5852 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5854 More fixes for 'volatile' and setjmp/longjmp.
5855 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5856 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5857 (png_load_body) [HAVE_PNG]:
5858 (jpeg_load_body) [HAVE_JPEG]:
5859 New function, with most of the old parent function's body.
5860 (png_load) [HAVE_PNG]:
5861 (jpeg_load) [HAVE_JPEG]:
5862 Invoke the new function, to avoid longjmp munging our locals.
5863 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5864 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5865 longjmp is passed 2, as the C standard doesn't guarantee this.
5866 Instead, store the failure code into mgr->failure_code.
5868 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5870 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5871 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5872 (syms_of_keyboard): Remove support for unread-command-char.
5874 2012-09-12 Eli Zaretskii <eliz@gnu.org>
5876 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5877 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5878 violation. (Bug#12426)
5880 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5882 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5884 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5886 * eval.c: Add `inhibit-debugger'.
5887 (Qinhibit_debugger): New symbol.
5888 (call_debugger): Bind it instead of Qdebug_on_error.
5889 (maybe_call_debugger): Test Vinhibit_debugger.
5890 (syms_of_eval): Define inhibit-debugger.
5891 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5892 (syms_of_xdisp): Remove inhibit-debug-on-message.
5894 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5896 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5897 If a nonvolatile local variable is written before a _longjmp to
5898 the frame containing the variable, and is read after the _longjmp,
5899 the value read is indeterminate. Some local variables of type
5900 'struct handler' and 'struct catchtag' are used in this way, so
5901 mark each of their slots as volatile if the slot can be set before
5902 _longjmp and read afterwards.
5903 * lisp.h (struct handler): var and chosen_clause are now volatile.
5904 (struct catchtag): val, next, and pdlcount are now volatile.
5906 * bidi.c (bidi_push_it, bidi_pop_it):
5907 * fns.c (copy_hash_table):
5908 * image.c (define_image_type):
5909 * keyboard.c (kbd_buffer_store_event_hold):
5910 * process.c (Fprocess_send_eof):
5911 * xfaces.c (x_create_gc) [HAVE_NS]:
5912 * xgselect.c (xg_select):
5913 Prefer assignment to memcpy when either will do.
5915 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5916 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5917 time an item is removed. No need to mark this function 'inline';
5918 the compiler knows better than we do.
5920 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5922 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5923 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5924 to change_frame_size (Bug#12388).
5925 (windowDidResize:): Pass YES to updateFrameSize.
5927 * nsterm.h: Add delay parameter to updateFrameSize.
5929 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5931 Discard killed buffers from deleted window and frame objects.
5932 This reduces an amount of references to killed buffers and
5933 helps GC to reclaim them faster.
5934 * alloc.c (discard_killed_buffers): New function.
5935 (mark_object): Use it for deleted windows and frames.
5936 (mark_object): If symbol's value is set up for a killed buffer
5937 or deleted frame, restore its global binding.
5938 * data.c (swap_in_global_binding): Add GC notice.
5939 (swap_in_symval_forwarding): Use convenient set_blv_where.
5940 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5941 * window.h: ... to here.
5943 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5945 Convenient macro to check whether the buffer is live.
5946 * buffer.h (BUFFER_LIVE_P): New macro.
5947 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5948 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5950 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5952 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5953 composition cases (Bug#12364).
5955 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5956 overhang of succeeding glyphs overlapping box cursor.
5958 * w32term.c (x_draw_glyph_string): Likewise.
5960 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5962 Simplify, document, and port floating-point (Bug#12381).
5963 The porting part of this patch fixes bugs on non-IEEE platforms
5964 with frexp, ldexp, logb.
5965 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5967 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5968 support, by removing commented-out code and briefly listing the
5969 C89 functions excluded. The commented-out stuff was confusing
5970 maintenance, e.g., we thought we needed cbrt but it was commented out.
5971 (logb): Remove decl; no longer needed.
5972 (isfinite): New macro, if not already supplied.
5973 (isnan): Don't replace any existing macro.
5974 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5975 are present on all C89 platforms.
5976 (Ffrexp): Do not special-case zero, as frexp does the right thing
5978 (Flogb): Do not use logb, as it doesn't have the desired meaning
5979 on hosts that use non-base-2 floating point. Instead, stick with
5980 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5981 frexp, to avoid getting an unspecified result.
5983 * xdisp.c (Qinhibit_debug_on_message): Now static.
5985 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5987 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5988 NSBezierPath (Bug#12131).
5990 2012-09-10 Chong Yidong <cyd@gnu.org>
5992 * fns.c (Fdelq, Fdelete): Doc fix.
5994 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5996 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5997 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5999 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6001 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6002 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6005 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6007 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6008 left fringe if the window has a left margin. This avoids leaving
6009 traces of the cursor because its leftmost pixel is not drawn over.
6011 * dispnew.c (update_window_line): When the left margin area of a
6012 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6013 that screen line. (Bug#12277)
6015 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6017 Assume C89 or later for math functions (Bug#12381).
6018 This simplifies the code, and makes it a bit smaller and faster,
6019 and (most important) makes it easier to clean up signal handling
6020 since we can stop worring about floating-point exceptions in
6021 library code. That was a problem before C89, but the problem
6022 went away many years ago on all practical Emacs targets.
6023 * data.c, image.c, lread.c, print.c:
6024 Don't include <math.h>; no longer needed.
6025 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6026 might be autoconfigured, as that never happens.
6028 * doprnt.c (DBL_MAX_10_EXP):
6029 * print.c (DBL_DIG):
6030 Remove. C89 or later always defines these.
6031 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6032 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6033 (arith_error, domain_error, domain_error2):
6034 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6035 no longer needed -- we simply return what C returns. All uses removed.
6036 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6038 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6039 Remove. All uses expanded, as these macros are no longer used
6040 more than once and are now more trouble than they're worth.
6041 (Ftan): Use tan, not sin / cos.
6042 (Flogb): Assume C89 frexp.
6043 (fmod_float): Assume C89 fmod.
6044 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6045 (init_floatfns): Remove. All uses removed.
6047 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6049 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6050 compositeToPoint for OSX < 10.6 (Bug#12390).
6052 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6054 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6055 This produces more-accurate results.
6057 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6059 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6060 changes (Bug#12088).
6062 2012-09-08 Chong Yidong <cyd@gnu.org>
6064 * syntax.c (Fstring_to_syntax): Doc fix.
6066 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6068 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6069 in the internal border.
6070 (x_set_window_size): Remove static variables and their usage.
6071 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6072 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6073 Remove fringe/internal border adjustment (Bug#11052).
6074 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6075 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6076 (ns_fix_rect_ibw): Remove.
6077 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6078 (ns_dumpglyphs_box_or_relief): Ditto.
6079 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6081 (ns_dumpglyphs_image): Ditto.
6082 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6084 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6085 their usage. Add fringe_extended_p and its use as in other terms.
6086 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6087 scroll bar was removed.
6088 (updateFrameSize): New function.
6089 (windowDidResize): Move code to updateFrameSize and call it.
6091 * nsterm.h (EmacsView): Add updateFrameSize.
6093 2012-09-07 Chong Yidong <cyd@gnu.org>
6095 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6097 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6099 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6101 More signal-handler cleanup (Bug#12327).
6102 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6103 Problem introduced when merging patches. Noted by Eli Zaretskii in
6104 <http://bugs.gnu.org/12327#67>.
6105 * floatfns.c: Comment fix.
6106 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6107 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6108 and anyway the declaration is harmless even if SIGDANGER is not defined.
6109 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6110 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6111 source files not surprisingly expected syssignal.h to define, or
6112 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6113 Include <sys/ioctl.h>, for FIONREAD.
6114 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6115 This eliminates a problem whereby other files mysteriously had
6116 to include "syssignal.h" before including "systty.h" if they
6117 wanted to use "#ifdef SIGIO".
6119 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6121 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6123 * w32.c (sigemptyset): Empty the set.
6124 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6126 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6128 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6130 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6131 (mark_object): Likewise for frame objects.
6133 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6135 * syssignal.h (handle_on_main_thread): Always declare,
6136 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6137 This ports to platforms without HAVE_PTHREAD.
6139 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6141 Signal-handler cleanup (Bug#12327).
6142 Emacs's signal handlers were written in the old 4.2BSD style with
6143 sigblock and sigmask and so forth, and this led to some
6144 inefficiencies and confusion. Rewrite these to use
6145 pthread_sigmask etc. without copying signal sets around. Also,
6146 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6147 'signal', and instead use functions that do not attempt to take
6148 over the system name space. This patch causes Emacs's text
6149 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6150 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6151 Do not include <signal.h> or "syssignal.h", as these
6152 modules do not use signals.
6153 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6154 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6155 Do not include <signal.h>, as "syssignal.h" does that for us now.
6156 * atimer.c (sigmask_atimers): New function.
6157 (block_atimers, unblock_atimers): New functions,
6158 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6160 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6161 no longer needed here.
6162 * emacs.c (main): Inspect existing signal handler with sigaction,
6163 so that there's no need to block and unblock SIGHUP.
6164 * sysdep.c (struct save_signal): New member 'action', replacing
6165 old member 'handler'.
6166 (save_signal_handlers, restore_signal_handlers):
6167 Use sigaction instead of 'signal' to save and restore.
6168 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6169 New function. All users of 'signal' modified to use set_sighandler
6170 if they're writeonly, and to use sys_signal if they're read+write.
6171 (emacs_sigaction_init, forwarded_signal): New functions.
6172 (sys_signal): Remove. All uses replaced by calls to sigaction
6173 and emacs_sigaction_init, or by direct calls to 'signal'.
6174 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6175 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6176 all uses replaced by pthread_sigmask etc. calls.
6177 * syssignal.h: Include <signal.h>.
6178 (emacs_sigaction_init, forwarded_signal): New decls.
6179 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6180 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6181 (sigmask, sys_sigmask): Remove; no longer needed.
6182 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6183 (sigblock, sigunblock, sigfree):
6184 (sigsetmask) [!defined sigsetmask]:
6185 Remove. All uses replaced by pthread_sigmask.
6186 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6187 no longer need to be replaced, and its typical old uses
6188 are now done via emacs_sigaction_init and sigaction.
6189 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6190 (sys_sigdel): Remove; unused.
6191 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6193 2012-09-06 Eli Zaretskii <eliz@gnu.org>
6195 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6196 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6198 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6200 Explicitly mark buffer_defaults and buffer_local_symbols.
6201 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6202 mark_local_symbols here.
6203 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6204 since special buffers aren't marked here any more.
6205 (allocate_buffer): Chain new buffer with all_buffers here...
6206 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6208 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6209 (syms_of_buffer): Remove staticpro of the above.
6210 (init_buffer_once): Set names for buffer_defaults and
6211 buffer_local_symbols.
6213 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6215 Use bool for booleans in font-related modules.
6216 * font.c (font_intern_prop, font_style_to_value)
6217 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6218 (generate_otf_features, font_check_otf_features, font_check_otf)
6219 (font_match_p, font_list_entities, font_at):
6220 * fontset.c (fontset_id_valid_p, reorder_font_vector
6221 (fontset_find_font, Fset_fontset_font)
6222 (face_suitable_for_char_p) [0]:
6223 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6224 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6225 (m17n_flt_initialized, ftfont_shape_by_flt):
6226 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6227 * nsfont.m (nsfont_draw):
6228 * w32font.c (w32font_draw):
6229 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6230 Use bool for booleans.
6231 * font.h: Adjust to above API changes.
6232 (struct font, struct font_driver, struct font_driver_list):
6233 Use bool for booleans.
6234 (struct font): Remove useless member encoding_type.
6236 * fontset.c, xftfont.c: Omit unnecessary static decls.
6238 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6240 * alloc.c (mark_object): Revert window marking code
6241 since it's unsafe for the Fset_window_configuration.
6243 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6245 Fix race conditions with signal handlers and errno (Bug#12327).
6246 Be more systematic about preserving errno whenever a signal
6247 handler returns, even if it's not in the main thread. Do this by
6248 renaming signal handlers to distinguish between signal delivery
6249 and signal handling. All uses changed.
6250 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6251 * data.c (deliver_arith_signal): Rename from arith_error.
6252 * dispnew.c (deliver_window_change_signal): Rename from
6253 window_change_signal.
6254 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6255 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6256 * keyboard.c (deliver_input_available_signal): Rename from
6257 input_available_signal.
6258 (deliver_user_signal): Rename from handle_user_signal.
6259 (deliver_interrupt_signal): Rename from interrupt_signal.
6260 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6261 (deliver_child_signal): Rename from sigchld_handler.
6262 * atimer.c (handle_alarm_signal):
6263 * data.c (handle_arith_signal):
6264 * dispnew.c (handle_window_change_signal):
6265 * emacs.c (handle_fatal_signal, handle_danger_signal):
6266 * keyboard.c (handle_input_available_signal):
6267 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6268 * process.c (handle_pipe_signal, handle_child_signal):
6269 New functions, with the actual signal-handling code taken from the
6270 original respective signal handlers, sans the sporadic attempts to
6271 preserve errno, since that's now done by handle_on_main_thread.
6272 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6273 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6274 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6276 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6277 Move initialization of main_thread to sysdep.c's init_signals.
6278 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6279 our usage, and simplifies the mainline code.
6280 (record_child_status_change): New static function, as a helper
6281 for handle_child_signal, and with most of the old child handler's
6283 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6284 (handle_child_signal): Use the above.
6285 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6286 Moved here from emacs.c.
6287 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6288 code moved here from emacs.c's main function.
6289 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6290 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6291 This lets callers save and restore errno properly.
6293 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6295 Remove redundant or unused things here and there.
6296 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6297 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6298 * editfns.c (Fcompare_buffer_substrings): Likewise.
6299 * frame.h (struct terminal, struct font_driver_list):
6300 Remove redundant declarations.
6301 * window.h (Qleft, Qright): Likewise.
6303 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6305 Do not mark objects from deleted buffers, windows and frames.
6306 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6307 (mark_object): Likewise for windows and frames.
6309 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6311 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6312 buffer_defaults and buffer_local_symbols as valid objects.
6313 Return special value to denote them.
6315 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6317 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6318 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6319 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6320 (file_name_absolute_p, Fsubstitute_in_file_name):
6321 (check_executable, check_writable, Ffile_accessible_directory_p)
6322 (Fset_file_selinux_context, Fdefault_file_modes)
6323 (Finsert_file_contents, choose_write_coding_system)
6324 (Fwrite_region, build_annotations, a_write, e_write)
6326 * filelock.c (boot_time_initialized, get_boot_time)
6327 (get_boot_time_1, lock_file_1, within_one_second):
6328 * floatfns.c (in_float):
6329 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6330 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6331 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6332 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6333 * window.c (compare_window_configurations):
6334 Use bool for booleans.
6335 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6336 (Fdefault_file_modes): Now mode_t, not int, for modes.
6337 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6338 (internal_delete_file): Now returns void, not a (boolean) int,
6339 since nobody was looking at the return value.
6340 * lisp.h, window.h: Adjust to above API changes.
6342 * xdisp.c (set_message): Simplify and reindent last change.
6344 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
6346 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6348 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6350 * eval.c (call_debugger): Make the function non-static so that we
6351 can call it from set_message.
6353 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6354 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6356 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6358 Give more-useful info on a fatal error (Bug#12328).
6359 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6360 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6361 of doing the work ourselves.
6362 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6363 do most of the work.
6364 (fatal_error_backtrace): New function, taken from the guts
6365 of the old fatal_error_signal, but with a new option to output
6367 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6368 info about the signal than just its number.
6369 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6370 * sysdep.c: Include <execinfo.h>
6371 (emacs_backtrace): New function, taken partly from the previous
6372 code of the 'die' function.
6373 (emacs_abort): Call fatal_error_backtrace rather than abort.
6375 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6377 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6378 eager (load-time) macro-expansion.
6379 * lisp.mk (lisp): Add macroexp.
6381 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6383 Simplify redefinition of 'abort' (Bug#12316).
6384 Do not try to redefine the 'abort' function. Instead, redo
6385 the code so that it calls 'emacs_abort' rather than 'abort'.
6386 This removes the need for the NO_ABORT configure-time macro
6387 and makes it easier to change the abort code to do a backtrace.
6388 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6389 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6390 Remove; sysdep.c's emacs_abort now takes its place.
6391 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6392 'abort' changed to use 'emacs_abort'.
6393 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6394 (abort) [!defined abort]: Rename to ...
6395 (emacs_abort): ... new name.
6396 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6397 the place of the old 'abort' in emacs.c.
6398 * w32.c, w32fns.c (abort): Do not #undef.
6399 * w32.c (emacs_abort): Rename from w32_abort.
6401 2012-09-04 Eli Zaretskii <eliz@gnu.org>
6403 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6404 offsets[j].dv, since the y axis of the screen coordinates points
6405 down, while the y axis of the font definition coordinates points
6406 up. This fixes display of Arabic diacritics such as KASRA and
6407 KASRATAN. (Bug#11860)
6409 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6411 Be more systematic about _setjmp vs setjmp.
6412 * alloc.c (test_setjmp, mark_stack):
6413 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6414 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6415 (png_load, my_error_exit, jpeg_load):
6416 * process.c (send_process_trap, send_process):
6417 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6418 The underscored versions are up to 30x faster on some hosts.
6419 Formerly, the code used setjmp+longjmp sometimes and
6420 _setjmp+_longjmp at other times, with no particular reason to
6421 prefer setjmp+longjmp.
6423 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6425 Fix minor problem found by static checking.
6426 * buffer.c (Fdelete_all_overlays): Return nil.
6428 2012-09-03 Martin Rudalics <rudalics@gmx.at>
6430 * buffer.c (Fdelete_all_overlays): New function.
6432 2012-09-03 Chong Yidong <cyd@gnu.org>
6434 * gtkutil.c: Add extern decl for Qxft.
6436 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6438 * emacs.c, eval.c: Use bool for boolean.
6439 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6440 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6441 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6442 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6443 (main, decode_env_path, Fdaemon_initialized):
6444 * eval.c (call_debugger, Finteractive_p, interactive_p):
6445 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6446 (maybe_call_debugger, Fbacktrace):
6447 * process.c (read_process_output, exec_sentinel):
6448 Use bool for booleans.
6449 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6450 All callers changed.
6451 * eval.c (interactive_p): Omit always-true boolean argument
6452 EXCLUDE_SUBRS_P. All callers changed.
6453 * dispextern.h, lisp.h: Reflect above API changes.
6454 * firstfile.c (dummy): Use the address of 'main', whose signature
6455 won't change, instead of the address of 'initialize', whose
6456 signature just changed from int to bool.
6457 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6458 * msdos.c (fatal_error_in_progress): ... from here.
6459 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6461 (redisplay_internal, unwind_redisplay): Simply clear
6462 REDISPLAYING_P when unwinding, instead of saving its previous,
6463 always-false value and then restoring it.
6465 Clean up some extern decls.
6466 Mostly, this hoists extern decls out of .c files and into .h files.
6467 That way, we're more likely to catch errors if the interfaces change.
6468 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6469 declare xg_mark_data.
6470 * dispextern.h (x_frame_parm_handlers):
6472 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6473 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6474 (Qultra_bold, Qoblique, Qitalic):
6475 Move extern decl here from .c file.
6476 * alloc.c (xg_mark_data) [USE_GTK]:
6478 * eval.c (Qlexical_binding):
6479 * fns.c (time) [!HAVE_UNISTD_H]:
6480 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6481 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6482 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6483 * lread.c (Qinternal_interpreter_environment):
6484 * minibuf.c (Qbuffer):
6485 * process.c (QCfamily, QCfilter):
6486 * widget.c (free_frame_faces):
6487 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6488 * xfont.c (x_clear_errors):
6489 * xterm.c (x_frame_parm_handlers):
6490 Remove now-redundant extern decls.
6491 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6492 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6494 * xfaces.c: Remove unnecessary static decls.
6495 * xterm.c (updating_frame): Remove decl of nonexistent object.
6497 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6498 when building globals.h, as the objects that are not built on
6499 this host are not needed to compile C files on this host.
6501 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6503 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6505 * frame.h: Add missing prototype for x_wm_set_size_hint.
6507 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6509 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6510 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6511 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6512 (Fsubstitute_command_keys):
6513 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6514 (save_excursion_save, save_excursion_restore)
6515 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6516 (format_time_string, general_insert_function)
6517 (make_buffer_string, make_buffer_string_both)
6518 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6519 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6520 (copy_text, insert_1, insert_1_both, insert_from_string)
6521 (insert_from_string_before_markers, insert_from_string_1)
6522 (insert_from_buffer, insert_from_buffer_1, replace_range)
6523 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6524 (del_range_2, modify_region):
6525 * intervals.c (intervals_equal, balance_possible_root_interval)
6526 (adjust_intervals_for_insertion, merge_properties_sticky)
6527 (graft_intervals_into_buffer, lookup_char_property)
6528 (adjust_for_invis_intang, set_point_both)
6529 (get_property_and_range, compare_string_intervals)
6530 (set_intervals_multibyte_1, set_intervals_multibyte):
6531 * keyboard.c (decode_timer):
6532 Use bool for boolean.
6533 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6534 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6536 2012-09-02 Chong Yidong <cyd@gnu.org>
6538 * keymap.c (push_key_description): Print M-TAB as C-M-i
6541 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
6543 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6544 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6545 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6546 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6547 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6548 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6549 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6551 2012-09-01 Eli Zaretskii <eliz@gnu.org>
6553 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6554 more than one grapheme cluster passed to the shaper: compute the
6555 offset adjustment values separately for each cluster. (Bug#11860)
6557 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6558 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6559 about implicit conversions from integer to pointer.
6561 2012-09-01 Daniel Colascione <dancol@dancol.org>
6563 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6564 system used too early.
6566 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6568 Better seed support for (random).
6569 * emacs.c (main): Call init_random.
6570 * fns.c (Frandom): Set the seed from a string argument, if given.
6571 Remove long-obsolete Gentzel cruft.
6572 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6573 (init_random): New function.
6575 2012-09-01 Daniel Colascione <dancol@dancol.org>
6577 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6578 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6579 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6580 x_wm_set_size_hint, x_query_colors, x_real_positions,
6581 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6582 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6583 all of which have been moved to common code.
6585 * xfaces.c: Include TERM_HEADER instead of listing all possible
6586 window-system headers.
6588 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6591 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6592 directly accessing frame internals.
6594 * w32font.h: Include font.h. Define syms_of_w32font and
6597 * process.c: Include TERM_HEADER instead of listing all possible
6598 window-system headers.
6600 * nsterm.h: Remove declarations now in frame.h.
6601 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
6603 * menu.c: Include TERM_HEADER instead of listing all possible
6604 window-system headers.
6606 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6609 * keyboard.c: Include TERM_HEADER instead of listing all possible
6610 window-system headers.
6612 * image.c: Include TERM_HEADER instead of listing all possible
6613 window-system headers. Declare Vlibrary_cache when compiling for
6616 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6617 window system declarations.
6619 * frame.h: Move common functions here: set_frame_menubar,
6620 x_set_window_size, x_sync, x_get_focus_frame,
6621 x_set_mouse_position, x_set_mouse_pixel_position,
6622 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6623 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6624 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6625 x_activate_menubar, x_real_positions, x_bitmap_icon,
6626 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6629 * frame.c: Include TERM_HEADER instead of listing all possible
6630 window-system headers.
6632 * font.c: Include TERM_HEADER instead of listing all possible
6633 window-system headers.
6635 * emacs.c: Include TERM_HEADER.
6637 * dispnew.c: Include TERM_HEADER instead of listing all possible
6638 window-system headers.
6640 * ccl.h: Include character.h.
6642 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6643 the current window system; include in list of objects to link into
6646 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6648 Remove mark_ttys function and fix tty_display_info initialization.
6649 * lisp.h (mark_ttys): Remove prototype.
6650 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6651 to mark_ttys because all possible values of 'top_frame' slot are
6652 the frames which are reachable from Vframe_list.
6653 * term.c (mark_ttys): Remove.
6654 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6656 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6658 Change struct frame bitfields from unsigned char to unsigned.
6659 * frame.h (struct frame): Change type of 'display_preempted',
6660 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6661 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6662 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6663 bitfields from unsigned char to unsigned.
6665 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6667 Remove unused member of struct x_output and struct w32_output.
6668 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6669 * w32term.h (struct w32_output): Likewise.
6671 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6673 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6674 does not become zero (Bug#12234).
6676 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6678 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6679 for GCC 4.7.1 x86-64.
6681 2012-08-30 Glenn Morris <rgm@gnu.org>
6683 * lread.c (init_lread): For out-of-tree builds, only add the
6684 source directory's site-lisp dir to the load-path if it exists,
6685 consistent with in-tree builds. (Bug#12302)
6687 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6689 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
6690 button_values to NULL. Call setStykeMask so dialogs get a close button.
6691 (windowShouldClose:): Set window_closed.
6692 (dealloc): New member, free button_values.
6693 (process_dialog:): Make member function. Remove window argument,
6694 replace window with self. Count buttons and allocate and store values
6696 (addButton:value:row:): value is int with the name tag. Call setTag
6697 with tag. Remove return self, declare return value as void.
6698 (addString:row:): Remove return self, declare return value as void.
6699 (addSplit): Remove return self, declare return value as void.
6700 (clicked:): Remove return self, declare return value as void.
6701 Set dialog_return to button_values[seltag]. Code formatting change.
6702 (initFromContents:isQuestion:): Adjust call to process_dialog.
6703 Code formatting change.
6704 (timeout_handler:): Set timer_fired to YES.
6705 (runDialogAt:): Set timer_fired to NO.
6706 Handle click on close button as quit.
6708 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6709 Add window_closed and button_values. Add void as return value for
6710 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6711 Add process_dialog as new member.
6713 2012-08-28 Eli Zaretskii <eliz@gnu.org>
6715 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6716 is not one of the heaps we manage. (Bug#12242)
6718 2012-08-28 Glenn Morris <rgm@gnu.org>
6720 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6722 2012-08-28 Martin Rudalics <rudalics@gmx.at>
6724 * window.c (Fset_window_configuration): Remove handling of
6725 auto-buffer-name window parameter. Install revision of reverted
6728 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6730 Do not allow to set major mode for a dead buffer.
6731 * buffer.c (Fset_buffer_major_mode): Signal an error
6732 if the buffer is dead.
6733 (Fother_buffer, other_buffer_safely): Remove redundant
6736 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6738 Always use set_buffer_if_live to restore original buffer at unwind.
6739 * buffer.h (record_unwind_current_buffer): New function.
6740 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6741 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6742 * undo.c, window.c: Adjust users.
6743 * buffer.c (set_buffer_if_live): Fix comment.
6745 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6747 Fix usage of set_buffer_internal.
6748 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6749 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6750 * coding.c (decode_coding): Omit redundant test.
6751 * fileio.c (decide_coding_unwind): Likewise.
6752 * fns.c (secure_hash): Likewise.
6753 * insdel.c (modify_region): Likewise.
6754 * keyboard.c (command_loop_1): Likewise.
6755 * print.c (PRINTFINISH): Likewise.
6756 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6758 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6760 * dispnew.c: Use bool for boolean.
6761 (frame_garbaged, display_completed, delayed_size_change)
6762 (fonts_changed_p, add_window_display_history)
6763 (add_frame_display_history, verify_row_hash)
6764 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6765 (row_equal_p, realloc_glyph_pool)
6766 (allocate_matrices_for_frame_redisplay)
6767 (showing_window_margins_p)
6768 (adjust_frame_glyphs_for_frame_redisplay)
6769 (build_frame_matrix_from_leaf_window, make_current)
6770 (mirrored_line_dance, mirror_line_dance, update_frame)
6771 (update_window_tree, update_single_window)
6772 (check_current_matrix_flags, update_window, update_text_area)
6773 (update_window_line, set_window_update_flags, scrolling_window)
6774 (update_frame_1, scrolling, buffer_posn_from_coords)
6775 (do_pending_window_change, change_frame_size)
6776 (change_frame_size_1, sit_for):
6777 Use bool for boolean.
6778 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6779 and remove last int (actually boolean) argument, which was always 0.
6780 All callers changed.
6781 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6782 * dispextern.h (struct composition_it): Use bool for boolean.
6783 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6784 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6785 * dired.c (file_name_completion):
6786 Use bool for boolean. (This was missed in an earlier change.)
6788 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6790 * window.c (Fset_window_configuration): Revert first part of
6793 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6795 * nsterm.h (NSPanel): New class variable dialog_return.
6797 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6798 Initialize dialog_return.
6799 (windowShouldClose:): Use stop instead of stopModalWithCode.
6800 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6801 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6803 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6806 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6808 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6809 * composite.c (find_composition, composition_gstring_p)
6810 (composition_reseat_it, find_automatic_composition):
6811 * data.c (let_shadows_buffer_binding_p)
6812 (let_shadows_global_binding_p, set_internal, make_blv)
6813 (Fmake_variable_buffer_local, Fmake_local_variable)
6814 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6815 (cons_to_signed, arith_driver):
6816 * dbusbind.c (xd_in_read_queued_messages):
6817 * dired.c (directory_files_internal, file_name_completion):
6818 Use bool for booleans.
6819 * dired.c (file_name_completion):
6820 * process.h (fd_callback):
6821 Omit int (actually boolean) argument. It wasn't being used.
6823 * composite.h, lisp.h: Reflect above API changes.
6825 * cmds.c, coding.c: Use bool for booleans.
6826 * cmds.c (move_point, Fself_insert_command):
6827 * coding.h (struct composition status, struct coding_system):
6828 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6829 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6830 (emacs_mule_char, decode_coding_emacs_mule)
6831 (encode_coding_emacs_mule, detect_coding_iso_2022)
6832 (decode_coding_iso_2022, encode_invocation_designation)
6833 (encode_designation_at_bol, encode_coding_iso_2022)
6834 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6835 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6836 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6837 (encode_coding_raw_text, detect_coding_charset)
6838 (decode_coding_charset, encode_coding_charset, detect_eol)
6839 (detect_coding, get_translation_table, produce_chars)
6840 (consume_chars, reused_workbuf_in_use)
6841 (make_conversion_work_buffer, code_conversion_save)
6842 (decode_coding_object, encode_coding_object)
6843 (detect_coding_system, char_encodable_p)
6844 (Funencodable_char_position, code_convert_region)
6845 (code_convert_string, code_convert_string_norecord)
6846 (Fset_coding_system_priority):
6847 * fileio.c (Finsert_file_contents):
6848 Use bool for booleans.
6849 * coding.h, lisp.h: Reflect above API changes.
6850 * coding.c: Remove unnecessary static function decls.
6851 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6852 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6853 not a boolean 'int', since callers never look at the return value.
6854 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6855 * coding.h (decoding_buffer_size, encoding_buffer_size)
6856 (emacs_mule_string_char): Remove unused extern decls.
6857 (struct iso_2022_spec, struct coding_system):
6858 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6859 (struct emacs_mule_spec): Remove unused field 'full_support'.
6860 All initializations removed.
6861 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6863 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6865 Fix spare memory change (Bug#12286).
6866 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6867 (valid_lisp_object_p): Likewise.
6869 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6871 * window.c (Fset_window_configuration): Record any window's old
6872 buffer if it's replaced (see Bug#8789). If the new current
6873 buffer doesn't appear in the selected window, go to its old
6876 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6878 Special MEM_TYPE_SPARE to denote reserved memory.
6879 * alloc.c (enum mem_type): New memory type.
6880 (refill_memory_reserve): Use new type for spare memory.
6881 This prevents live_cons_p and live_string_p from incorrect
6882 detection of uninitialized objects from spare memory as live.
6884 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6887 * Makefile.in (.PHONY): versioclean -> versionclean.
6889 Remove unused external symbols.
6890 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6891 * window.c (Qwindow_valid_p, decode_valid_window):
6892 Now static, not extern.
6893 * data.c (Qinterval): Remove; unused.
6894 (syms_of_data): Do not define 'interval'.
6895 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6896 * window.h (decode_valid_window):
6899 * character.c, charset.c, chartab.c: Use bool for booleans.
6900 * character.c (lisp_string_width, string_count_byte8)
6901 (string_escape_byte8):
6902 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6903 (load_charset_map_from_file, map_charset_chars)
6904 (Fdefine_charset_internal, define_charset_internal)
6905 (Fdeclare_equiv_charset, find_charsets_in_text)
6906 (Ffind_charset_region, char_charset, Fiso_charset):
6907 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6908 (sub_char_table_set, sub_char_table_set_range)
6909 (char_table_set_range, optimize_sub_char_table)
6910 (map_sub_char_table):
6911 Use bool for boolean.
6912 * character.c (str_to_unibyte): Omit last boolean argument; it was
6913 always 0. All callers changed.
6914 * character.h, charset.h: Adjust to match previous changes.
6915 * character.h (char_printable_p): Remove decl of nonexistent function.
6916 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6917 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6918 are all boolean, so make them single-bit bitfields.
6920 * lisp.h (ASET): Remove attempt to detect side effects.
6921 It was meant to be temporary and it often doesn't work,
6922 because when IDX has side effects the behavior of IDX==IDX
6923 is undefined. See Stefan Monnier in
6924 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6926 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6928 * lisp.h (functionp): New function (extracted from Ffunctionp).
6929 (FUNCTIONP): Use it.
6930 * eval.c (Ffunctionp): Use it.
6932 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6934 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6935 as that's faster and simpler than static storage. Don't bother
6936 with the g_main_context_query overhead if g_main_context_pending
6937 says no events are pending.
6938 (gfds, gfds_size): Remove these static vars.
6939 (xgselect_initialize): Remove; no longer needed.
6940 All uses and decls removed.
6942 * emacs.c (fatal_error_signal_hook): Remove.
6943 All uses removed. This leftover from old code was always 0.
6945 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6946 * casefiddle.c (casify_object, casify_region):
6947 * casetab.c (set_case_table):
6948 * category.c, category.h (word_boundary_p):
6949 * category.h (CHAR_HAS_CATEGORY):
6950 Use bool for booleans, instead of int.
6952 2012-08-25 Eli Zaretskii <eliz@gnu.org>
6954 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6956 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6958 On assertion failure, print backtrace if available.
6959 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6960 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6961 * Makefile.in (LIB_EXECINFO): New macro.
6964 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6965 * bytecode.c (exec_byte_code):
6966 * callint.c (check_mark, Fcall_interactively):
6967 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6968 (getenv_internal, sync_process_alive, call_process_exited):
6969 * lisp.h (USE_SAFE_ALLOCA):
6970 Use bool for booleans, instead of int.
6971 * lisp.h, process.h: Adjust prototypes to match above changes.
6972 * callint.c (Fcall_interactively): Don't assume the mark's
6973 offset fits in 'int'.
6975 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6977 * buffer.c, buffer.h: Use bool for boolean.
6978 * buffer.c (reset_buffer_local_variables)
6979 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6980 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6981 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6982 (overlay_touches_p, overlay_strings, Foverlay_put)
6983 (report_overlay_modification, call_overlay_mod_hooks):
6984 (mmap_enlarge, mmap_set_vars):
6985 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6986 Use bool for booleans, instead of int.
6987 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6988 since the 1-or-0 return value is always ignored anyway.
6989 (mmap_initialized_p):
6990 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6991 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6993 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6995 * bidi.c: Use bool for boolean.
6996 This is a bit more readable, and makes the text segment of bidi.o
6997 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6998 Presumably it's faster too.
6999 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7001 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7002 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7003 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7004 (bidi_explicit_dir_char, bidi_level_of_next_char)
7005 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7006 Use bool for booleans, instead of int.
7007 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7008 (bidi_unshelve_cache): Adjust decls to match code.
7010 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7012 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7015 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7017 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7018 * atimer.h: Include <stdbool.h>.
7020 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7022 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7023 compile time tests instead of run time tests on systems that do
7025 (FRAME_MAC_P): Remove leftover from deleted code.
7026 * frame.c (syms_of_frame): Remove leftover from deleted code.
7028 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7030 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7032 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7034 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7035 Otherwise, the compiler complains about (A?B:C) where B is void
7036 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7037 (fontset_add): Return void, for FONTSET_ADD.
7039 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7041 * alloc.c: Use bool for booleans.
7042 (gc_in_progress, abort_on_gc)
7043 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7044 (dont_register_blocks) [GC_MALLOC_CHECK]:
7045 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7046 (check_string_bytes, make_specified_string, memory_full)
7047 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7048 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7049 (mark_stack, valid_pointer_p, make_pure_string)
7050 (Fgarbage_collect, survives_gc_p, gc_sweep):
7051 Use bool for booleans, instead of int.
7052 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7053 Remove unused local.
7054 * alloc.c (PURE_POINTER_P):
7055 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7056 * editfns.c (Fformat):
7057 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7059 * fns.c (sweep_weak_table):
7060 * lisp.h (suppress_checking, push_message, survives_gc_p)
7061 (make_pure_string, gc_in_progress, abort_on_gc):
7062 * lread.c (readchar, read1):
7063 * print.c (Fprin1_to_string):
7064 * xdisp.c (push_message):
7065 Use bool for booleans affected directly or indirectly by
7068 Make recently-introduced setters macros.
7069 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7070 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7071 (set_fontset_default, set_fontset_fallback): Rename from their
7072 upper-case counterparts, and make them functions rather than macros.
7073 This is more consistent with the other recently-introduced setters.
7074 These don't need to be inline, since they're local.
7076 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7078 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7079 the loop (Bug#12247).
7081 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7083 * lisp.h (vcopy): Use memcpy rather than our own loop.
7084 This fixes a performance regression introduced by the recent
7085 addition of vcopy. This means 'vcopy' will need to be modified
7086 for a copying collector, but that's OK. Also, tighten the
7087 checking in the assertion.
7089 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7091 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7092 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7093 non-base glyph for the width of the base character, according to
7094 what x_draw_composite_glyph_string_foreground expects.
7095 Generate WADJUST value according to composition_gstring_width's
7096 expectations, to produce correct width of the composed character.
7097 Reverse the sign of the DU offset produced by ScriptPlace.
7099 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7101 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7103 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7105 Avoid direct writes to contents member of struct Lisp_Vector.
7106 * lisp.h (vcopy): New function to copy data into vector.
7107 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7108 * fns.c (Ffillarray): Use ASET.
7109 * keyboard.c (timer_check_2): Use AREF and ASET.
7110 (append_tool_bar_item, Frecent_keys): Use vcopy.
7111 * lread.c (read_vector): Use ASET.
7112 * msdos.c (Frecent_doskeys): Use vcopy.
7113 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7114 (Finternal_merge_in_global_face): Use ASET and vcopy.
7115 * xfont.c (xfont_list_pattern): Likewise.
7117 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7119 * window.c (Fwindow_point): For the selected window always return
7120 the position of its buffer's point.
7121 (Fset_window_point): For the selected window always go in its
7122 buffer to the specified position.
7124 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7126 Setter macros for fontsets.
7127 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7128 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7129 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7132 2012-08-20 Glenn Morris <rgm@gnu.org>
7134 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7135 Don't assume that `ln -f' works.
7137 2012-08-20 Eli Zaretskii <eliz@gnu.org>
7139 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7140 and later about non-assignments with no effect. See discussion at
7141 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7144 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7146 Inline setter functions for Lisp_Objects slots of struct specbinding.
7147 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7150 2012-08-20 Martin Rudalics <rudalics@gmx.at>
7152 * window.c (select_window): Always make selected window's buffer
7155 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7157 Use AREF and ASET for docstrings of category tables.
7158 * category.h (CATEGORY_DOCSTRING): Use AREF.
7159 (SET_CATEGORY_DOCSTRING): Use ASET.
7160 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7162 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7164 Inline setter functions for hash table members.
7165 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7166 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7167 (set_hash_key_and_value, set_hash_index, set_hash_next)
7168 (set_hash_hash): New functions.
7169 * charset.c, fns.c: Adjust users.
7171 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7173 Inline getter and setter functions for per-buffer values.
7174 * buffer.h (per_buffer_default, set_per_buffer_default)
7175 (per_buffer_value, set_per_buffer_value): New functions.
7176 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7177 * buffer.c, data.c: Adjust users.
7179 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
7181 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7183 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7185 Rely on <config.h> + <unistd.h> to declare 'environ',
7186 as gnulib does this if the system doesn't.
7187 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7188 Remove declaration. MS-Windows declares it on stdlib.h which is
7189 included by conf_post.h.
7190 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7191 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7192 * vm-limit.c: Include <unistd.h>, for 'environ'.
7194 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7195 (start_of_data): Remove decl; mem-limits.h provides it.
7197 * xdisp.c (handle_invisible_prop): Make it a bit faster
7198 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7200 2012-08-19 Chong Yidong <cyd@gnu.org>
7202 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7205 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7207 * .gdbinit: Use call instead of set when calling a function in the
7210 * data.c (set_internal): Don't use set_blv_found.
7211 (Fkill_local_variable): Likewise.
7213 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7215 * nsfont.m (ns_ascii_average_width): Ensure the string
7216 ascii_printable is initialized with a null-terminated character
7217 array. Otherwise, it can contain undesired extra characters.
7219 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7221 port new setting code to Sun C 5.8 2005/10/13
7222 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7223 Return void, not Lisp_Object. Otherwise, the compiler
7224 complains about (A?B:C) where B is void and C is Lisp_Object
7225 when compiling CHAR_TABLE_SET, due to the recent change to
7226 the API of sub_char_table_set_contents.
7228 2012-08-18 Chong Yidong <cyd@gnu.org>
7230 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7231 for the string case (Bug#3874).
7233 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7235 * buffer.h (BSET): Remove (Bug#12215).
7236 Replace all uses with calls to new setter functions.
7237 (bset_bidi_paragraph_direction, bset_case_canon_table)
7238 (bset_case_eqv_table, bset_directory, bset_display_count)
7239 (bset_display_time, bset_downcase_table)
7240 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7241 (bset_last_selected_window, bset_local_var_alist)
7242 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7243 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7245 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7246 (bset_auto_fill_function, bset_auto_save_file_format)
7247 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7248 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7249 (bset_cache_long_line_scans, bset_case_fold_search)
7250 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7251 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7252 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7253 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7254 (bset_header_line_format, bset_indicate_buffer_boundaries)
7255 (bset_indicate_empty_lines, bset_invisibility_spec)
7256 (bset_left_fringe_width, bset_major_mode, bset_mark)
7257 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7258 (bset_name, bset_overwrite_mode, bset_pt_marker)
7259 (bset_right_fringe_width, bset_save_length)
7260 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7261 (bset_scroll_up_aggressively, bset_selective_display)
7262 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7263 (bset_word_wrap, bset_zv_marker):
7264 * category.c (bset_category_table):
7265 * syntax.c (bset_syntax_table):
7266 New setter functions.
7268 * process.h (PSET): Remove (Bug#12215).
7269 Replace all uses with calls to new setter functions.
7270 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7271 (PROCESS_INLINE): New macro.
7272 (pset_childp): New setter function.
7273 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7274 * process.c (PROCESS_INLINE):
7275 Define to EXTERN_INLINE, so that the corresponding functions
7276 are compiled into code.
7277 (pset_buffer, pset_command, pset_decode_coding_system)
7278 (pset_decoding_buf, pset_encode_coding_system)
7279 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7280 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7281 (pset_type, pset_write_queue): New setter functions.
7283 * window.h (WSET): Remove (Bug#12215).
7284 Replace all uses with calls to new setter functions.
7285 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7286 (WINDOW_INLINE): New macro.
7287 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7288 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7289 (wset_total_lines, wset_vertical_scroll_bar)
7290 (wset_window_end_pos, wset_window_end_valid)
7291 (wset_window_end_vpos): New setter functions.
7292 * window.c (WINDOW_INLINE):
7293 Define to EXTERN_INLINE, so that the corresponding functions
7294 are compiled into code.
7295 (wset_combination_limit, wset_dedicated, wset_display_table)
7296 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7297 (wset_new_normal, wset_new_total, wset_next_buffers)
7298 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7299 (wset_prev_buffers, wset_right_fringe_width)
7300 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7301 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7302 (wset_window_parameters):
7303 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7304 (wset_column_number_displayed, wset_region_showing):
7305 New setter functions.
7307 * termhooks.h (TSET): Remove (Bug#12215).
7308 Replace all uses with calls to new setter functions.
7309 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7310 (TERMHOOKS_INLINE): New macro.
7311 (tset_charset_list, tset_selection_alist): New setter functions.
7312 * terminal.c (TERMHOOKS_INLINE):
7313 Define to EXTERN_INLINE, so that the corresponding functions
7314 are compiled into code.
7315 (tset_param_alist): New setter function.
7317 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7319 * keyboard.h (KSET): Remove (Bug#12215).
7320 Replace all uses with calls to new setter functions.
7321 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7322 (KEYBOARD_INLINE): New macro.
7323 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7324 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7325 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7326 New setter functions.
7327 * keyboard.c (KEYBOARD_INLINE):
7328 Define to EXTERN_INLINE, so that the corresponding functions
7329 are compiled into code.
7330 (kset_echo_string, kset_kbd_queue)
7331 (kset_keyboard_translate_table, kset_last_prefix_arg)
7332 (kset_last_repeatable_command, kset_local_function_key_map)
7333 (kset_overriding_terminal_local_map, kset_real_last_command)
7334 (kset_system_key_syms): New setter functions.
7336 * frame.h (FSET): Remove (Bug#12215).
7337 Replace all uses with calls to new setter functions.
7338 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7339 (FRAME_INLINE): New macro.
7340 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7341 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7342 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7343 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7344 (fset_param_alist, fset_root_window, fset_scroll_bars)
7345 (fset_selected_window, fset_title, fset_tool_bar_items)
7346 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7347 * frame.c (FRAME_INLINE):
7348 Define to EXTERN_INLINE, so that the corresponding functions
7349 are compiled into code.
7350 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7352 A few more naming-convention fixes for getters and setters.
7353 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7354 and rename from buffer_overlays_set_before.
7355 (set_buffer_overlays_after): Move here from buffer.h, and rename
7356 from buffer_overlays_set_after.
7357 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7359 (set_buffer_intervals): Rename from buffer_set_intervals.
7360 * intervals.c (set_interval_object): Move here from intervals.h,
7361 and rename from interval_set_object.
7362 (set_interval_left): Move here from intervals.h, and rename from
7364 (set_interval_right): Move here from intervals.h, and rename from
7366 (copy_interval_parent): Move here from intervals.h, and rename from
7367 interval_copy_parent.
7368 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7369 (set_interval_plist): Rename from interval_set_plist.
7370 Return void, not Lisp_Object, since no caller uses the result.
7371 * lisp.h (string_intervals): Rename from string_get_intervals.
7372 (set_string_intervals): Rename from string_set_intervals.
7374 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7375 (set_char_table_contents): Rename from char_table_set_contents.
7376 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7377 All uses changed. See the end of
7378 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7380 * lisp.h (CSET): Remove (Bug#12215).
7381 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7382 (set_char_table_purpose): New functions,
7383 replacing CSET. All uses changed. For example, replace
7384 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7385 "set_char_table_parent (char_table, parent);".
7386 The old version was confusing because it used the same name
7387 'parent' for two different things.
7389 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7391 Functions to get and set Lisp_Object fields of buffer-local variables.
7392 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7393 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7394 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7395 * data.c, eval.c, frame.c: Adjust users.
7397 2012-08-17 Chong Yidong <cyd@gnu.org>
7399 * xfaces.c (merge_face_vectors): If the target font specfies a
7400 font spec, make the font's attributes take precedence over
7401 directly-specified attributes.
7402 (merge_face_ref): Recognize :font.
7404 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7406 Do not use memcpy for copying intervals.
7407 * intervals.c (reproduce_interval): New function.
7408 (reproduce_tree, reproduce_tree_obj): Use it.
7409 (reproduce_tree_obj): Remove prototype.
7411 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7413 * lisp.h (duration_to_sec_usec): Remove unused decl.
7415 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7417 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7418 to an allocated instance of NSString, not to the class itself.
7420 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
7422 * makefile.w32-in (C_CTYPE_H): New macro.
7423 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7424 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7425 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7427 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7429 Use ASCII tests for character types.
7430 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7432 Don't include <ctype.h>; was not needed.
7433 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7434 * sysdep.c, xfaces.c:
7435 Include <c-ctype.h> instead of <ctype.h>.
7436 * nsterm.m: Include <c-ctype.h>.
7437 * charset.c (read_hex):
7438 * doc.c (Fsnarf_documentation):
7439 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7440 (DRIVE_LETTER) [DOS_NT]:
7441 (Ffile_name_directory, Fexpand_file_name)
7442 (Fsubstitute_in_file_name):
7443 * font.c (font_parse_xlfd, font_parse_fcname):
7444 * frame.c (x_set_font_backend):
7445 * gtkutil.c (xg_get_font):
7446 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7447 * nsimage.m (hexchar):
7448 * nsterm.m (ns_xlfd_to_fontname):
7449 * sysdep.c (system_process_attributes):
7450 * xfaces.c (hash_string_case_insensitive):
7451 Use C-locale tests instead of locale-specific tests for character
7452 types, since we want the ASCII interpretation here, not the
7453 interpretation suitable for whatever happens to be the current locale.
7455 2012-08-16 Martin Rudalics <rudalics@gmx.at>
7457 Consistently check windows for validity/liveness
7458 (Bug#11984, Bug#12025, Bug#12026).
7459 * lisp.h (CHECK_VALID_WINDOW): New macro.
7460 * window.c (decode_window): Rename to decode_live_window.
7461 (decode_valid_window, Fwindow_valid_p): New functions.
7462 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7463 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7464 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7465 (Fwindow_prev_sibling, Fwindow_combination_limit)
7466 (Fset_window_combination_limit, Fwindow_use_time)
7467 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7468 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7469 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7470 (Fwindow_hscroll, Fset_window_hscroll)
7471 (Fwindow_redisplay_end_trigger)
7472 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7473 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7474 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7475 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7476 (Fwindow_end, Fset_window_point, Fset_window_start)
7477 (Fpos_visible_in_window_p, Fwindow_line_height)
7478 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7479 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7480 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7481 (Fset_window_parameter, Fwindow_display_table)
7482 (Fset_window_display_table, Fdelete_other_windows_internal)
7483 (Fset_window_buffer, Fset_window_new_total)
7484 (Fset_window_new_normal, Fdelete_window_internal)
7485 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7486 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7487 (Fwindow_scroll_bars): Check whether argument window is a valid or
7488 live window. Update doc-strings.
7489 (syms_of_window): New symbol Qwindow_valid_p.
7490 * keyboard.c (Fposn_at_x_y): Check whether argument
7491 frame_or_window denotes a valid window.
7493 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7495 Fix previous char table change.
7496 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7497 * chartab.c (optimize_sub_char_table): Likewise.
7499 2012-08-16 Chong Yidong <cyd@gnu.org>
7501 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7503 * xfont.c (xfont_open):
7504 * xftfont.c (xftfont_open): Set the font's max_width field.
7506 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7507 min_width to space_width and average_width to the average over
7508 printable ASCII characters.
7509 (ns_char_width): Code cleanup.
7510 (ns_ascii_average_width): New utility function.
7512 * font.h (struct font): Update comments.
7514 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7516 Simple interface to set Lisp_Object fields of character tables.
7517 * lisp.h (CSET): New macro.
7518 (char_table_set_extras, char_table_set_contents)
7519 (sub_char_table_set_contents): New function.
7520 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7521 * syntax.c: Adjust users.
7523 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7525 * eval.c (eval_sub): Bind lexical-binding.
7526 * lread.c (Qlexical_binding): Make non-static.
7528 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7530 * nsmenu.m (popupSession): Remove.
7531 (pop_down_menu): Remove endModalSession.
7532 (timeout_handler:): New method.
7533 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7534 Call runModalForWindow. Check timer_fired when it returns.
7535 If not set, cancel timer and break out of loop.
7536 Otherwise loop again, with a new timeout.
7538 * nsterm.m: Include fcntl.h if present.
7539 (fd_entry, t_readfds, inNsSelect): Remove.
7540 (select_writefds, select_valid, select_timeout, selfds)
7541 (select_mutex, apploopnr): Add.
7542 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7543 Otherwise call kbd_buffer_store_event.
7544 (ns_send_appdefined): Remove release of fd_entry.
7545 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7546 Increment and decrement apploopnr.
7547 (ns_select): If no file descriptors, just do a NSTimer.
7548 Otherwise copy read/write masks and start select thread (fd_handler).
7549 Start main loop and wait for application defined event.
7550 Inform select thread to stop selecting after main loop is exited.
7551 (ns_term_init): Create selfds pipe and set non-blocking.
7552 Initialize select_mutex. Start the select thread (fd_handler).
7553 (fd_handler:): Loop forever, wait for info from the main thread
7554 to either start or stop selecting. When select returns, send
7555 and appdefined event.
7556 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7557 If not call kbd_buffer_store_event.
7559 * nsterm.h (EmacsApp): fd_handler takes id argument.
7560 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7562 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7564 2012-08-15 Eli Zaretskii <eliz@gnu.org>
7566 * region-cache.c (move_cache_gap): Update gap_len using the actual
7567 growth of the boundaries array. Do not change cache_len.
7570 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7572 Generalize and cleanup font subsystem checks.
7573 * font.h (FONT_DEBUG, font_assert): Remove.
7574 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7575 Change font_assert to eassert. Use eassert where appropriate.
7577 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7579 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7581 2012-08-15 Chong Yidong <cyd@gnu.org>
7583 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7584 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7585 extract the font descriptor instead of just the font name.
7586 In that case, return a font spec instead of a string.
7587 (x_last_font_name): Move to this file from xfns.c.
7589 * xfns.c (Fx_select_font): The return value can also be a font
7590 spec. Move x_last_font_name management to gtkutil.c.
7592 * xfaces.c: Make font weight and style symbols non-static.
7594 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7596 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7599 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7601 * alloc.c (Fgarbage_collect): Use plural form consistently.
7603 2012-08-14 Eli Zaretskii <eliz@gnu.org>
7605 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7606 iteration through the command loop. Fixes a problem whereby mouse
7607 movements are ignored until the first mouse click.
7609 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7611 Use bool, not int, for Lisp booleans.
7612 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7613 makes Emacs a bit smaller and presumably a bit faster.
7614 * lisp.h: Include <stdbool.h>.
7615 (struct Lisp_Boolfwd, defvar_bool):
7616 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7617 * regex.c [!emacs]: Include <stdbool.h>.
7618 (false, true): Remove; <stdbool.h> does this for us now.
7620 2012-08-14 Chong Yidong <cyd@gnu.org>
7622 * character.c (Fcharacterp): Doc fix (Bug#12076).
7624 * data.c (Findirect_variable): Doc fix (Bug#11040).
7626 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7628 * editfns.c (Fformat): Doc fix (Bug#12059).
7629 (Fsave_current_buffer): Doc fix (Bug#11542).
7631 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7633 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7636 2012-08-14 Martin Rudalics <rudalics@gmx.at>
7638 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7639 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7640 * minibuf.c (choose_minibuf_frame, read_minibuf):
7641 * w32fns.c (x_create_tip_frame):
7642 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7643 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7645 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7647 * intervals.c (offset_intervals): Remove obsolete comment.
7649 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7651 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7653 2012-08-14 Gergely Risko <gergely@risko.hu>
7655 * coding.c (decode_coding): Record buffer modification before
7656 disabling undo_list (Bug#11773).
7658 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7660 Revert and cleanup some recent overlay changes.
7661 * buffer.h (enum overlay_type): Remove.
7662 (buffer_get_overlays, buffer_set_overlays): Likewise.
7663 (buffer_set_overlays_before, buffer_set_overlays_after):
7664 New function. Adjust users.
7665 (unchain_both): Add eassert.
7667 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7669 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7671 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7673 * gtkutil.c (xg_mark_data): Don't assume C99.
7675 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7677 * gtkutil.c (xg_frame_tb_info): New struct.
7678 (TB_INFO_KEY): New define.
7679 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7680 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7681 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7683 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
7684 is up to date. Otherwise store new data.
7685 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7687 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7689 Use KSET for write access to Lisp_Object members of struct kboard.
7690 * keyboard.h (KSET): New macro.
7691 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7692 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7693 * xterm.c: Adjust users.
7695 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7697 Use BSET for write access to Lisp_Object members of struct buffer.
7698 * buffer.h (BSET): New macro.
7699 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7700 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7701 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7702 * window.c, xdisp.c, xfns.c: Adjust users.
7704 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7706 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7708 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7710 * nsterm.m (not_in_argv): New function.
7711 (application:openFile, application:openTempFile:):
7712 (application:openFileWithoutUI:, application:openFiles:): Open file
7713 if not_in_argv returns non-zero (bug#12171).
7715 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
7716 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7717 Define for Gtk+ versions less than 3.2.
7718 (xg_get_font_name): Use those functions/macros here.
7719 Reported by Frans Oilinki <moilinki@gmail.com>.
7721 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7723 * unexmacosx.c (copy_data_segment): Copy initialized data in
7724 statically linked libraries from input file rather than memory.
7726 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7727 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7728 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7730 2012-08-10 Glenn Morris <rgm@gnu.org>
7732 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7733 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7735 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7737 Fix last change to allow compilation with low optimization levels.
7738 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7739 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7741 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7743 Use common inline syntax in intervals.h.
7744 * intervals.h (INTERVALS_INLINE): New macro.
7745 Change all users from LISP_INLINE.
7747 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7749 Define Qnone once for all platforms.
7750 * frame.c (Qnone): Define here.
7751 (syms_of_frame): DEFSYM it.
7752 * lisp.h (Qnone): New declaration.
7753 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7754 * xfns.c: Remove duplication. Adjust users.
7756 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7758 Remove unused macros from intervals.h.
7759 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7760 * intervals.c: Adjust comment.
7762 2012-08-10 Eli Zaretskii <eliz@gnu.org>
7764 * w32fns.c <w32_unicode_gui>: New static variable.
7765 (globals_of_w32fns): Initialize it according to os_subtype.
7766 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7769 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
7770 Eli Zaretskii <eliz@gnu.org>
7772 Fix bug #10299 with Unicode characters sent by customized
7773 keyboards created by MSKLC.
7774 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7775 (w32_init_class): Use it to initialize the Emacs class with either
7776 ANSI or Unicode API calls.
7777 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7779 (w32_wnd_proc): If the character code sent by WM_CHAR or
7780 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7781 original message. Call DefWindowProcW on NT and later.
7783 2012-08-10 Glenn Morris <rgm@gnu.org>
7785 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7787 * lisp.h (DIRECTORY_SEP): Let configure set it.
7789 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7791 Use TSET for write access to Lisp_Object slots of struct terminal.
7792 * termhooks.h (TSET): New macro.
7793 * coding.c, terminal.c, xselect.c: Adjust users.
7795 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7797 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7798 the failing expression, include them in the error message.
7799 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7800 * lisp.h (internal_condition_case_n): Update declaration.
7802 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7804 Inline functions to examine and change buffer overlays.
7805 * buffer.c (unchain_both): New function.
7806 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7807 (buffer_has_overlays): New function.
7808 (enum overlay_type): New enum.
7809 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7810 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7812 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7814 Inline functions to examine and change buffer intervals.
7815 * alloc.c (mark_interval_tree): Remove.
7816 (MARK_INTERVAL_TREE): Simplify.
7817 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7818 * intervals.c (buffer_balance_intervals): New function.
7819 (graft_intervals_into_buffer): Adjust indentation.
7820 (set_intervals_multibyte): Simplify.
7821 * buffer.h (BUF_INTERVALS): Remove.
7822 (buffer_get_intervals, buffer_set_intervals): New function.
7823 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7824 * intervals.c, textprop.c: Adjust users.
7826 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7828 Inline functions to examine and change string intervals.
7829 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7830 (string_get_intervals, string_set_intervals): New function.
7831 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7832 * lread.c, print.c, textprop.c: Adjust users.
7834 2012-08-08 Glenn Morris <rgm@gnu.org>
7836 * lisp.mk (lisp): Remove language/persian.elc.
7838 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7841 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7842 (NULL_INTERVAL_P): Likewise. Adjust users.
7843 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7844 Adjust comment. Move under #if 0.
7845 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7846 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7848 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7850 Check total length of intervals with eassert.
7851 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7852 * intervals.c: Change all users to eassert.
7854 2012-08-07 Eli Zaretskii <eliz@gnu.org>
7856 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7857 Rename fields to match removal of FGET and WGET and disuse of
7858 INTERNAL_FIELD in Lisp_Cons.
7860 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7862 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7863 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7864 name since all xname users are fixed long time ago. Do not
7866 (set_symbol_name, set_symbol_function, set_symbol_plist):
7867 (set_symbol_next, set_overlay_plist): New function.
7868 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7869 (struct Lisp_Overlay): Likewise.
7870 (CVAR, MVAR, SVAR): Remove.
7871 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7872 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7873 * xterm.c: Adjust users.
7874 * .gdbinit: Change to use name field of struct Lisp_Symbol
7877 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7879 Basic functions to set Lisp_Object and pointer slots of intervals.
7880 * intervals.h (interval_set_parent, interval_set_object):
7881 (interval_set_left, interval_set_right, interval_set_plist):
7882 (interval_copy_parent): New function.
7883 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7884 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7886 (INTERVAL_SIZE): Remove. Adjust users.
7887 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7889 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7891 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7892 * process.h (PGET): Remove.
7893 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7894 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7896 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7898 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7899 * window.h (WGET): Remove.
7900 (struct window): Do not use INTERNAL_FIELD.
7901 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7902 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7903 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7904 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7905 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7908 2012-08-07 Chong Yidong <cyd@gnu.org>
7910 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7911 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7912 (Fdelete_window_internal): Signal an error if the window is not on
7913 a live frame (Bug#12025).
7915 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7917 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7918 * frame.h (FGET): Remove.
7919 (struct frame): Do not use INTERNAL_FIELD.
7920 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7921 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7922 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7923 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7925 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
7927 * w32.c: Silence compiler warnings.
7928 (map_w32_filename): Remove unused variable `is_fat'.
7929 (chase_symlinks): Add parentheses around expression.
7931 2012-08-06 Glenn Morris <rgm@gnu.org>
7933 * sysdep.c: Respect BROKEN_GETWD.
7935 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7936 Let configure handle it.
7937 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7939 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7941 Use GCALIGNMENT where appropriate.
7942 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7943 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7944 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7946 2012-08-06 Eli Zaretskii <eliz@gnu.org>
7948 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7949 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
7951 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7953 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7954 that should be sufficient for everyone.
7956 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7958 * keyboard.c (timer_check_2): Add break so timer_check returns next
7961 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7963 Fix Windows build errors introduced after converting to WGET and WSET.
7964 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7965 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7967 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7969 * nsterm.m (ns_frame_rehighlight): Use FSET.
7971 * nsmenu.m (ns_update_menubar): Use FSET.
7973 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7975 Separate read and write access to Lisp_Object slots of Lisp_Process.
7976 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7977 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7979 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7981 Separate read and write access to Lisp_Object slots of struct window.
7982 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7983 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7984 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7985 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7986 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7987 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7990 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7992 Fix Windows build errors introduced after converting to FGET and FSET.
7993 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7994 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7995 (w32_judge_scroll_bars): Change to use FSET.
7996 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7998 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8000 Fix replacement typo.
8001 * window.c (replace_window): Set root_window instead of
8002 selected_window. This fixes a total window subsystem
8003 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8005 2012-08-06 Glenn Morris <rgm@gnu.org>
8007 * lisp.mk (lisp): Add language/persian.elc.
8009 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8011 Separate read and write access to Lisp_Object slots of struct frame.
8012 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8013 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8014 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8015 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8016 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8018 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8020 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8022 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8024 Generalize common compile-time constants.
8025 * lisp.h (header_size, bool_header_size, word_size): Now here.
8026 (struct Lisp_Vector): Add comment.
8027 (struct Lisp_Bool_Vector): Move up to define handy constants.
8028 (VECSIZE, PSEUDOVECSIZE): Simplify.
8029 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8030 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8031 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8032 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8033 * xfont.c, xmenu.c: Use word_size where appropriate.
8035 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8037 * search.c (Freplace_match): Treat \? in the replacement text
8038 literally (Bug#8161).
8040 2012-08-05 Chong Yidong <cyd@gnu.org>
8042 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8043 * frame.c (Vdelete_frame_functions):
8044 * emacs.c (Vkill_emacs_hook): Doc fix.
8046 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8048 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8049 --with-x-toolkit=no builds.
8050 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8052 2012-08-04 Chong Yidong <cyd@gnu.org>
8054 * syntax.c (Fmodify_syntax_entry): Doc fix.
8056 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8058 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8059 * w32.c (init_environment): Change the default values of many
8060 environment variables in dflt_envvars[] to NULL, to avoid pushing
8061 them into environment when they were not already defined.
8062 Remove the code that deletes site-lisp subdirectories from the default
8063 value of EMACSLOADPATH, as it is no longer needed.
8064 (check_windows_init_file): Now external, not static.
8065 Use Vload_path as is, without adding anything, as this function is now
8066 called when Vload_path is already set up.
8068 * w32.h (check_windows_init_file): Add prototype.
8070 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8071 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8072 compatibility with Posix platforms.
8073 (main): Move the call to check_windows_init_file to here from
8075 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8076 any, in the DEFALT argument into the root of the Emacs build or
8077 installation tree, as appropriate.
8079 * callproc.c (init_callproc_1): Call decode_env_path instead of
8080 doing its equivalent by hand.
8081 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8082 the code that sets Vexec_path run on MS-Windows.
8084 * lread.c (init_lread): Add comments to #ifdef's.
8086 * msdos.c (dos_set_window_size, IT_update_begin)
8087 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8088 instead of direct references.
8090 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8092 Export DEFAULT_REHASH_* to GDB.
8093 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8094 Now constants, not macros.
8096 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8098 Remove unnecessary casts involving pointers.
8099 These casts are no longer needed now that we assume C89 or later,
8100 since they involve casting to or from void *.
8101 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8102 (make_pure_float, make_pure_vector):
8103 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8104 * macros.c (Fstart_kbd_macro):
8105 * menu.c (find_and_return_menu_selection):
8106 * minibuf.c (read_minibuf_noninteractive):
8107 * sysdep.c (closedir):
8108 * xdisp.c (x_produce_glyphs):
8109 * xfaces.c (compare_fonts_by_sort_order):
8110 * xfns.c (x_real_positions, select_visual):
8111 * xselect.c (x_stop_queuing_selection_requests)
8112 (x_get_window_property, x_get_window_property_as_lisp_data):
8113 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8114 Remove unnecessary pointer casts.
8115 * alloc.c (record_xmalloc): New function.
8116 * lisp.h (record_xmalloc): New decl.
8117 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8118 more like a function. This is because the pointer cast is not
8119 needed. All uses changed.
8120 * print.c (print_string, print_error_message): Avoid length recalc.
8122 Improve fix for macroexp crash with debugging (Bug#12118).
8123 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8124 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8125 not supposed to be invoked from the garbage collector.
8126 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8127 (gc_aset): New function, which is like ASET but can be
8128 used in the garbage collector.
8129 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8130 (set_hash_index): Use it instead of ASET.
8132 2012-08-03 Eli Zaretskii <eliz@gnu.org>
8134 Support symlinks on latest versions of MS-Windows.
8135 * w32.c: Include winioctl.h and aclapi.h.
8136 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8137 (revert_to_self): Forward declarations of static functions.
8138 <static BOOL g_b_init_get_security_info>:
8139 <g_b_init_create_symbolic_link>: New static flags.
8140 (globals_of_w32): Initialize them to zero.
8141 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8142 (map_w32_filename): Improve commentary. Simplify switch.
8143 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8144 headers (most versions of MinGW w32api don't).
8145 (get_security_info, create_symbolic_link)
8146 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8148 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8149 in the argument file name.
8150 (sys_access): Call unc_volume_file_attributes only if
8151 GetFileAttributes fails with network-related error codes.
8152 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8153 have the required privileges.
8154 (get_file_security_desc_by_name): Rename from
8155 get_file_security_desc.
8156 (stat_worker): New function, with most of the guts of 'stat', and
8157 with addition of handling of symlinks and support for 'lstat'.
8158 If possible, get file's attributes and security information by
8159 handle, not by name. Produce S_IFLNK bit for symlinks, when
8160 called from 'lstat'.
8161 (stat, lstat): New functions, call 'stat_worker'.
8162 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8163 symlinks when the underlying filesystem supports them.
8165 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8167 Fix macroexp crash on Windows with debugging (Bug#12118).
8168 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8169 checking subscripts; problem introduced with the recent
8170 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8171 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8172 since it's used in non-static inline functions now.
8174 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8175 Don't assume buffer size fits in 'int'. Remove unused local.
8177 Use C99-style 'extern inline' if available.
8178 * buffer.h (BUFFER_INLINE):
8179 * category.h (CATEGORY_INLINE):
8180 * character.h (CHARACTER_INLINE):
8181 * charset.h (CHARSET_INLINE):
8182 * composite.h (COMPOSITE_INLINE):
8183 * dispextern.h (DISPEXTERN_INLINE):
8184 * lisp.h (LISP_INLINE):
8185 * systime.h (SYSTIME_INLINE):
8186 New macro, replacing 'static inline' in this header.
8187 * buffer.h, category.h, character.h, charset.h, composite.h:
8188 * dispextern.h, lisp.h, systime.h:
8189 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8190 * alloc.c (LISP_INLINE):
8191 * buffer.c (BUFFER_INLINE):
8192 * category.c (CATEGORY_INLINE):
8193 * character.c (CHARACTER_INLINE):
8194 * charset.c (CHARSET_INLINE):
8195 * composite.c (COMPOSITE_INLINE):
8196 * dispnew.c (DISPEXTERN_INLINE):
8197 * sysdep.c (SYSTIME_INLINE):
8198 Define to EXTERN_INLINE, so that the corresponding functions
8199 are compiled into code.
8200 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8201 (INLINE_HEADER_END): New macros.
8202 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8203 since it's used in non-static inline functions now.
8204 (VALMASK) [!USE_LSB_TAG]: Likewise.
8206 2012-08-02 Glenn Morris <rgm@gnu.org>
8208 * s/: Remove empty directory.
8210 * s/ms-w32.h: Move to ../nt/inc.
8211 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8212 Update for new ms-w32.h location.
8214 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8217 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8219 2012-08-02 Glenn Morris <rgm@gnu.org>
8221 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8222 hard-coding the path separator.
8224 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8226 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8227 This how ASET and AREF are supposed to work, and makes
8228 it easier to think about future improvements. See
8229 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8230 * charset.h (set_charset_attr): New function.
8231 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8232 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8233 (aref_addr): New function. All uses of &AREF(...) changed.
8234 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8235 (set_hash_index): New functions. All lvalue-style uses of
8236 HASH_KEY etc. changed.
8237 * keyboard.c (set_prop): New function. All lvalue-style uses
8240 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8242 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8243 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8244 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
8245 * nsfns.m (ns_set_name_as_filename): Likewise.
8246 * nsmenu.m (ns_update_menubar): Likewise.
8247 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8249 2012-08-01 Eli Zaretskii <eliz@gnu.org>
8251 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8252 Adapt to latest changes in field names of the corresponding Lisp
8255 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8257 2012-08-01 Glenn Morris <rgm@gnu.org>
8259 * s/msdos.h: Remove file.
8260 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8261 * Makefile.in (S_FILE): Remove.
8262 (config_h): Remove S_FILE.
8264 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8266 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8267 Remove; moved to nt/config.nt.
8269 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8271 Use INTERNAL_FIELD for conses and overlays.
8272 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8273 Remove obsolete comment.
8275 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8276 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8278 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8280 Use INTERNAL_FIELD for symbols.
8281 * lisp.h (SVAR): New macro. Adjust users.
8282 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8283 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8285 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8287 Use INTERNAL_FIELD for processes.
8288 * process.h (PVAR): New macro. Adjust style.
8289 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8290 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8292 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8294 Use INTERNAL_FIELD for windows.
8295 * window.h (WVAR): New macro.
8296 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8297 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8298 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8299 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8300 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8301 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8303 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8305 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8307 2012-08-01 Glenn Morris <rgm@gnu.org>
8309 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8310 Move to configure.ac.
8312 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8314 * makefile.w32-in (CONFIG_H): Update dependencies.
8315 (CONF_POST_H): New macro.
8317 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8319 2012-07-31 Glenn Morris <rgm@gnu.org>
8321 * Makefile.in (S_FILE): No longer set by configure.
8323 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8325 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8327 * process.h (NULL_DEVICE):
8328 * emacs.c (SEPCHAR):
8329 * editfns.c (USER_FULL_NAME): Let configure set them.
8331 * s/README, s/template.h: Remove files.
8333 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8335 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8336 Move to configure.ac.
8338 2012-07-31 Eli Zaretskii <eliz@gnu.org>
8340 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8341 resulting renaming of 'struct frame' members.
8343 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8345 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8346 after introduction of FVAR.
8348 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8350 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8352 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8353 instead of compositeToPoint.
8354 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8356 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
8358 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8360 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8361 * lisp.h (INTERNAL_FIELD): New macro.
8362 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
8363 (BVAR): Change to use INTERNAL_FIELD.
8364 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8365 (KVAR): Change to use INTERNAL_FIELD.
8366 * frame.h (FVAR): New macro.
8367 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
8368 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8369 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8370 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8371 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8373 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8375 Miscellaneous fixes for non-default X toolkits.
8376 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8377 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8378 Move under #ifdef USE_LUCID.
8379 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8380 definition and usage to avoid warnings.
8382 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8384 * nsterm.m (openFiles): Fix previous checkin.
8386 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8388 * indent.c (compute_motion): Remove unused local.
8390 2012-07-31 Glenn Morris <rgm@gnu.org>
8392 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8394 * conf_post.h [USG5_4]:
8395 Move remaining contents of s/usg5-4-common.h here.
8396 * s/usg5-4-common.h: Remove file.
8398 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8399 * s/irix6-5.h: Remove file.
8401 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8402 * s/darwin.h: Remove file.
8404 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8405 * s/hpux10-20.h: Remove file, which is now empty.
8407 2012-07-30 Glenn Morris <rgm@gnu.org>
8409 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8410 * Makefile.in (config_h): Add conf_post.h.
8411 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8413 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8415 * nsterm.m (ns_do_open_file): New variable.
8416 (ns_term_init): Set ns_do_open_file to YES after run returns.
8417 (openFile, openTempFile, openFileWithoutUI, openFiles):
8418 Open files only if ns_do_open_file.
8420 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8422 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8423 This no-op macro hasn't been needed for many years.
8424 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8426 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8427 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8428 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8429 gdb_make_enums_visible.
8430 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8431 (DIRECTORY_SEP): Now a constant, not a macro.
8433 2012-07-30 Eli Zaretskii <eliz@gnu.org>
8435 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8436 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8438 * w32term.c <w32_keyboard_codepage>: Renamed from
8439 keyboard_codepage and now external. All users changed.
8441 * w32term.h: Add declaration of w32_keyboard_codepage.
8443 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8444 the codepage to translate keys to Unicode. If this argument is
8445 -1, use the value returned by GetConsoleCP. All callers changed.
8447 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8449 Update .PHONY listings in makefiles.
8450 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8451 bootstrap-clean, distclean, maintainer-clean, versioclean,
8454 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8455 This is a bit clearer. Fix some commentary typos.
8457 2012-07-30 Glenn Morris <rgm@gnu.org>
8459 * s/netbsd.h: Let configure include signal.h if needed.
8460 Remove file, which is now empty.
8462 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8463 Let configure set them.
8464 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8465 No more need to undefine.
8467 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8469 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8470 non-single-byte char when adding meta modifier. (Bug#12090)
8472 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8474 Convert safe_call to use variable number of arguments.
8475 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8476 (safe_call2): Fix comment.
8477 * lisp.h (safe_call): Adjust prototype.
8478 * coding.c (encode_coding_object): Change to use safe_call2.
8479 * xfaces.c (merge_face_heights): Change to use safe_call1.
8481 2012-07-30 Glenn Morris <rgm@gnu.org>
8483 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8484 does that unconditionally. Remove file, which is now empty.
8486 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8489 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8491 Export to GDB most of lisp.h's remaining object-like macros.
8492 * lisp.h (min, max): Move earlier, because they're used earlier now.
8493 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8494 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8495 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8496 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8497 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8498 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8499 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8500 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8501 Now constants, for GDB. They need not be macros.
8502 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8503 Now constants, for GDB, as well as macros, for static initializers.
8504 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8505 Move to after the definition of struct Lisp_Char_Table,
8506 since the former now needs that type defined.
8507 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8508 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8509 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8510 New enums, for gdb_make_enums_visible.
8511 (GLYPH_MODE_LINE_FACE): Remove; unused.
8512 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8513 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8514 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8515 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8516 enum maxargs, enum MAX_ALLOCA.
8517 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8518 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8519 no longer needed, now that they are done in lisp.h.
8521 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8523 Cleanup string bytes checking.
8524 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8525 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8526 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8527 (check_sblock, compact_small_strings): Simplify.
8529 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8531 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8532 These macros are confusing and no longer need to be defined, as
8533 the enum values now suffice. All uses replaced with definiens.
8534 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8536 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
8538 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8539 ($(BLD)/w32console.$(O)): Update dependencies.
8541 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8543 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8544 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8546 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8548 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8550 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8551 setting sitelisp (Bug#12010).
8553 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8555 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8557 * w32heap.c (cache_system_info):
8558 * w32.c (sys_rename):
8559 * w32proc.c (find_child_console, sys_kill): All users changed.
8561 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8563 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8565 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8567 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8569 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8571 Cleanup statistics calculation in Fgarbage_collect.
8572 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8573 Fix zombies percentage calculation. Simplify elapsed time calculation.
8575 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8577 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8578 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8579 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8580 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8581 (replace_range, replace_range_2, del_range_2): Change to eassert.
8582 * marker.c (byte_char_debug_check): Adjust style.
8584 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8586 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8587 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8588 long-ago-commented-out code that talks about "WIN32".
8589 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8592 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8594 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8595 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8596 Simplify by using alignof.
8597 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8598 * lisp.h: Include <stdalign.h>.
8599 (GCALIGNMENT): New macro and constant.
8600 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8601 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8602 (stdalign): New macro, if not already defined.
8604 2012-07-28 Eli Zaretskii <eliz@gnu.org>
8606 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8607 * w32inevt.c: Include w32inevt.h.
8608 (w32_read_console_input): New inline function, calls either
8609 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8610 w32_console_unicode_input.
8611 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8612 (w32_kbd_patch_key, key_event): Use the codepage returned by
8613 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8614 (key_event): use uChar.UnicodeChar only if
8615 w32_console_unicode_input is non-zero.
8617 * w32console.c: Include w32heap.h.
8618 <w32_console_unicode_input>: New global variable.
8619 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8620 family of Windows, zero otherwise.
8622 * w32inevt.h: Declare w32_console_unicode_input.
8624 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8625 --without-x. (Bug#11742)
8627 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8629 Adjust GDB to reflect pvec_type changes (Bug#12036).
8630 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
8631 2012-07-04 changes to pseudovector representation.
8632 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
8634 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
8636 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8638 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8640 2012-07-27 Eli Zaretskii <eliz@gnu.org>
8642 * alloc.c (listn): Fix the order the arguments are consed onto the
8645 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8646 enumeration constants, as PURE and HEAP are too general, and clash
8647 with other headers and sources, such as gmalloc.c and the
8648 MS-Windows system headers. All users changed.
8650 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8652 Revert last save_excursion_save and save_excursion_restore changes.
8653 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8654 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8656 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8658 Fix recently-introduced typos in Windows port.
8659 Reported by Martin Rudalics <rudalics@gmx.at>.
8660 * w32.c (init_environment): Replace comma with semicolon.
8661 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
8663 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8665 Improve GDB symbol export (Bug#12036).
8666 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8667 arms of an 'if', not using conditional expressions; otherwise GDB
8668 complains about the types in the unevaluated arm when the argument
8669 is an integer literal.
8670 (xgetint): Simplify expression.
8671 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8672 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8673 Zaretskii in <http://bugs.gnu.org/12036#13>.
8674 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8675 needed now that we have gdb_make_enums_visible.
8676 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8677 (enum enum_USE_LSB_TAG):
8678 New enum types, packaging up enums that need to be exported to GDB.
8680 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8682 Utility function to make a list from specified amount of objects.
8683 * lisp.h (enum constype): New datatype.
8684 (listn): New prototype.
8685 * alloc.c (listn): New function.
8686 (Fmemory_use_count, syms_of_alloc): Use it.
8687 * buffer.c (syms_of_buffer): Likewise.
8688 * callint.c (syms_of_callint): Likewise.
8689 * charset.c (define_charset_internal): Likewise.
8690 * coding.c (syms_of_coding): Likewise.
8691 * keymap.c (syms_of_keymap): Likewise.
8692 * search.c (syms_of_search): Likewise.
8693 * syntax.c (syms_of_syntax): Likewise.
8694 * w32.c (init_environment): Likewise.
8695 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8696 * xdisp.c (syms_of_xdisp): Likewise.
8697 * xfns.c (syms_of_xfns): Likewise.
8699 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8701 Fast save_excursion_save and save_excursion_restore.
8702 * lisp.h (struct Lisp_Excursion): New data type.
8703 (PVEC_EXCURSION): New pseudovector type.
8704 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8705 to deal with it. Adjust comments.
8706 (init_marker, attach_marker): New prototype.
8707 (unchain_marker): Adjust prototype.
8708 * marker.c (attach_marker): Change to global.
8709 (init_marker): New function.
8710 * alloc.c (Fmake_marker, build_marker): Use it.
8711 (build_marker): More easserts.
8712 (mark_object): Handle struct Lisp_Excursion.
8713 * editfns.c (save_excursion_save, save_excursion_restore):
8714 Reimplement to use struct Lisp_Excursion. Add comments.
8716 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8718 Fix export of symbols to GDB (Bug#12036).
8719 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8720 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8721 emacs.c, as this is a more-suitable home. Had this been done earlier
8722 the fix for 12036 would have avoided some of the problems noted in
8723 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8724 would have been more obvious.
8725 * emacs.c: Do not include <verify.h>; no longer needed.
8726 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
8727 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8728 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8729 Remove; now done in lisp.h.
8730 * lisp.h (PUBLISH_TO_GDB): New macro.
8731 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8732 (DATA_SEG_BITS): Use it.
8733 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8734 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8735 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8736 not be usable in #if. This simplifies things.
8738 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
8740 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8742 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8744 Simplify export of symbols to GDB (Bug#12036).
8745 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8746 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8747 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8748 Adjust to changes in lisp.h and emacs.c, by using
8749 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8750 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8751 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8752 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8753 instead of gdb_valbits.
8754 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8755 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8756 instead of gdb_array_mark_flag.
8757 (xboolvector): Get size from $->size, not $->header.size.
8758 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8759 (xreload, hook-run, hookpost-run): Remove.
8760 * emacs.c: Include <verify.h>.
8761 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8762 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8764 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8765 (gdb_USE_LSB_TAG): New enum constants.
8766 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8767 Also define these as enum constants, so they're visible to GDB.
8768 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8769 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8770 as constants, so they're visible to GDB.
8771 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8772 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8773 Now enum constants, not macros, so they're visible to GDB.
8774 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8775 more convenient now. All uses changed.
8776 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8777 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8779 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8781 Explicitly free restriction data that are not needed anymore.
8782 * editfns.c (save_restriction_restore): Free restriction data.
8784 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8786 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8787 add argument, tune behavior, and adjust all callers.
8789 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8791 Use typedef for EMACS_INT, EMACS_UINT.
8792 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8793 than macros. This simplifies debugging in the usual case, since
8794 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8795 and it allows expressions involving EMACS_INT casts.
8796 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8798 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8800 * nsterm.m (ns_read_socket): Return early if there is a modal
8803 2012-07-25 Martin Rudalics <rudalics@gmx.at>
8805 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8806 that FOCUS-FRAME can be omitted.
8808 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8810 Adjust buffer text indirection counters at the end of Fkill_buffer.
8811 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8812 buffer is definitely dead. This should really fix an issue reported
8813 by Christoph Scholtes again. (Bug#12007).
8814 (init_buffer_once): Initialize indirection counters of
8815 buffer_defaults and buffer_local_symbols (for sanity and safety).
8817 2012-07-24 Eli Zaretskii <eliz@gnu.org>
8819 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8820 and continuation glyphs on tooltip frames, leave them at zero.
8821 Avoids continued lines in tooltips. (Bug#11832)
8823 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8825 Simplify copy_overlay.
8826 * buffer.c (copy_overlay): Simplify. Use build_marker.
8827 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8829 2012-07-23 Eli Zaretskii <eliz@gnu.org>
8831 * print.c (print_object): Don't crash when a frame's name is nil
8832 or invalid. (Bug#12025)
8834 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8835 it signals an error when a tooltip frame is being created.
8837 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8839 Cleanup miscellaneous objects allocation and initialization.
8840 * alloc.c (allocate_misc): Change to static. Add argument to
8841 specify the subtype. Adjust comment and users.
8842 (build_overlay): New function.
8843 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8844 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8845 (allocate_misc): Remove prototype.
8846 (build_overlay): Add prototype.
8848 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8850 Swap buffer text indirection counters in Fbuffer_swap_text.
8851 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8852 This avoids crash reported by Christoph Scholtes at
8853 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8855 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8857 * nsmenu.m (Popdown_data): New struct.
8858 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8860 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8861 (initWithContentRect): Make imgView and contentView non-static
8862 and autorelease them. Also autorelease img and matrix (Bug#12005).
8863 (dealloc): Remove (Bug#12005).
8865 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8867 Adjust consing_since_gc when objects are explicitly freed.
8868 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8869 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8870 (free_cons, free_misc): Subtract object size from consing_since_gc.
8872 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8874 Simplify and cleanup markers positioning code.
8875 * marker.c (attach_marker): More useful eassert.
8876 (live_buffer, set_marker_internal): New function.
8877 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8878 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8880 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8882 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8883 as it's limited by the amount of memory, not by INT_MAX.
8885 2012-07-21 Eli Zaretskii <eliz@gnu.org>
8887 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8888 in special-event-map. See the discussion at
8889 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8892 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8893 info.dwItemData. Fixes crashes on 64-bit Windows.
8894 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8896 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8898 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
8899 (conversationIdentifier): Return value is NSInteger.
8900 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8902 2012-07-21 Chong Yidong <cyd@gnu.org>
8904 * window.c (decode_any_window): Signal an error if the window is
8905 on a dead frame (Bug#11984).
8907 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8909 Add indirection counting to speed up Fkill_buffer.
8910 * buffer.h (struct buffer): New member.
8911 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8912 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8913 base buffer indirection counter.
8914 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8915 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8916 through buffer list if indirection counter is 0.
8918 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8920 Extend the value returned by Fgarbage_collect with heap statistics.
8921 * alloc.c (Qheap): New symbol.
8922 (syms_of_alloc): DEFSYM it.
8923 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8924 (Fmemory_free): Remove.
8925 (syms_of_alloc): Don't defsubr it.
8926 * buffer.c (Fcompact_buffer): Remove.
8927 (syms_of_buffer): Don't defsubr it.
8929 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8931 Make maybe_gc inline.
8932 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8933 * lisp.h (consing_since_gc, gc_relative_threshold)
8934 (memory_full_cons_threshold): Revert declaration.
8935 (maybe_gc): Remove prototype, define as inline.
8936 * alloc.c: Remove old commented-out code.
8937 (consing_since_gc, gc_relative_threshold)
8938 (memory_full_cons_threshold): Revert to global.
8941 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8943 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8944 * lisp.h (build_unibyte_string): New function.
8945 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8946 * sysdep.c, w32fns.c, xfns.c: Use it.
8947 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8948 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8949 Adjust users accordingly.
8950 * font.h (font_open_by_name): Adjust prototype.
8952 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8954 Cleanup calls to Fgarbage_collect.
8955 * lisp.h (maybe_gc): New prototype.
8956 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8957 Remove declarations.
8958 * alloc.c (maybe_gc): New function.
8959 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8961 * bytecode.c (MAYBE_GC): Use maybe_gc.
8962 * eval.c (eval_sub, Ffuncall): Likewise.
8963 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8964 to avoid dependency from auto-save feature.
8966 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8968 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8969 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8970 'for_each_per_buffer_object_at'.
8971 All uses changed. It's better to use upper-case for macros that
8972 cannot be implemented as functions, to give the reader a clue
8973 that they're special.
8975 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8977 * alloc.c (Fgarbage_collect): Tweak docstring.
8979 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8981 Tweak the value returned from Fgarbage_collect again.
8982 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8983 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8984 Adjust documentation.
8985 (total_vector_bytes): Rename to total_vector_slots, adjust
8987 (total_free_vector_bytes): Rename to total_free_vector_slots,
8989 (Qstring_bytes, Qvector_slots): New symbols.
8990 (syms_of_alloc): DEFSYM them.
8992 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8994 Buffer compaction primitive which may be used from Lisp.
8995 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8996 (syms_of_buffer): Register Fcompact_buffer.
8997 * alloc.c (Fgarbage_collect): Use compact_buffer.
8998 * buffer.h (compact_buffer): New prototype.
8999 (struct buffer_text): New member.
9001 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9003 New macro to iterate over all buffers, miscellaneous cleanups.
9004 * lisp.h (all_buffers): Remove declaration.
9005 * buffer.h (all_buffers): Add declaration, with comment.
9006 (for_each_buffer): New macro.
9007 * alloc.c (Fgarbage_collect, mark_object): Use it.
9008 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9009 (init_buffer): Likewise.
9010 * data.c (Fset_default): Likewise.
9011 * coding.c (code_conversion_restore): Remove redundant check
9013 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9015 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9017 Fix bug that created negative-length intervals.
9018 * intervals.c (merge_interval_right, merge_interval_left):
9019 Do not zero out this interval if it is absorbed by its children,
9020 as this interval's total length doesn't change in that case. See
9021 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9023 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9025 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9026 when invoking (make-bool-vector N t) and N is a positive
9027 multiple of 8 -- the last 8 bits were mistakenly cleared.
9029 Remove some struct layout assumptions in bool vectors.
9030 * alloc.c (bool_header_size): New constant.
9031 (header_size, word_size): Move earlier, as they're now used earlier.
9032 Use 'word_size' in a few more places, where it's appropriate.
9033 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9034 padding before the data member of a bool vector.
9035 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9036 than doing the check by hand with an abort ().
9038 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9040 * eval.c (Fdefvar): Don't check constants since we only set the var if
9041 it's not yet defined anyway (bug#11904).
9043 * lisp.h (last_undo_boundary): Declare new var.
9044 * keyboard.c (command_loop_1): Set it.
9045 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9046 were auto-added by the command loop (bug#11774).
9048 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9050 * w32font.c (Qsymbol): Remove local definition.
9051 (syms_of_w32font): Don't DEFSYM it.
9053 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9055 Fix sweep_vectors to handle large bool vectors correctly.
9056 * alloc.c (sweep_vectors): Account total_vector_bytes for
9057 bool vectors larger than VBLOCK_BYTES_MAX.
9059 2012-07-18 Chong Yidong <cyd@gnu.org>
9061 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9062 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9064 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9066 Return more descriptive data from Fgarbage_collect.
9067 Suggested by Stefan Monnier in
9068 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9069 * alloc.c (bounded_number): New function.
9070 (total_buffers, total_vectors): New variable.
9071 (total_string_size): Rename to total_string_bytes, adjust users.
9072 (total_vector_size): Rename to total_vector_bytes, adjust users.
9073 (sweep_vectors): Account total_vectors and total_vector_bytes.
9074 (Fgarbage_collect): New return value. Adjust documentation.
9075 (gc_sweep): Account total_buffers.
9076 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9077 (VECTOR_SIZE): Remove.
9078 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9079 (Qinterval, Qmisc): New symbols.
9080 (syms_of_data): Initialize them.
9081 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9082 (Qcons, Qbuffer): New declarations.
9084 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9086 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9087 Round up, not down. Improve doc.
9089 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9091 Restore old code in allocate_string_data to avoid Faset breakage.
9092 Reported by Julien Danjou <julien@danjou.info> in
9093 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9094 * alloc.c (allocate_string_data): Restore old code with minor
9095 adjustments, fix comment to explain this subtle issue.
9097 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9099 Remove FILE_SYSTEM_CASE.
9100 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9102 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9103 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9104 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9105 call-process-region passes it through expand-file-name.
9107 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9109 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9111 Fix crash when creating indirect buffer (Bug#11917)
9112 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9113 Don't handle unbound variables specially if non-zero.
9114 (Fbuffer_local_variables): Pass zero.
9115 (clone_per_buffer_values): Pass non-zero.
9117 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9119 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9120 to make the loop interruptible.
9122 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9124 * gnutls.c (emacs_gnutls_handshake): Only retry if
9125 GNUTLS_E_INTERRUPTED.
9127 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9129 Cleanup and convert miscellaneous checks to eassert.
9130 * alloc.c (mark_interval): Fix comment, partially rephrase
9131 old comment from intervals.h (see below).
9132 * intervals.c (find_interval, adjust_intervals_for_insertion)
9133 (delete_interval, adjust_intervals_for_deletion)
9134 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9136 (adjust_intervals_for_insertion, make_new_interval):
9137 Remove obsolete and unused code.
9138 * intervals.h (struct interval): Remove obsolete comment.
9139 * textprotp.c (erase_properties): Remove unused code.
9140 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9141 (Fremove_list_of_text_properties): Convert to eassert.
9143 2012-07-17 Chong Yidong <cyd@gnu.org>
9145 * editfns.c (Finsert_char): Doc fix.
9147 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9149 Fix previous change to make Fmemory_free always accurate.
9150 * alloc.c (make_interval): Update total_free_intervals.
9151 (make_float): Likewise for total_free_floats.
9152 (free_cons, Fcons): Likewise for total_free_conses.
9153 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9154 Likewise for total_free_vector_bytes.
9155 (Fmake_symbol): Likewise for total_free_symbols.
9156 (bytes_free): Remove.
9158 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9160 Simple free memory accounting feature.
9161 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9162 (sweep_vectors): Accumulate size of free vectors.
9163 (Fgarbage_collect): Setup bytes_free.
9164 (Fmemory_free): New function.
9165 (syms_of_alloc): Register it.
9167 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9169 Cleanup overlays checking.
9170 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9171 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9172 eassert and OVERLAYP.
9173 (sort_overlays): Change to use OVERLAYP.
9175 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9177 * editfns.c (Finsert_char): Make it interactive, and make the
9178 second arg optional. Copy interactive spec and docstring from
9181 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9183 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9184 Unlike the other wrapped functions, fabs has an unspecified
9187 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9189 * nsterm.m (keyDown): Interpret flags without left/right bits
9190 as the left key (Bug#11670).
9192 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9194 Remove empty and useless init functions.
9195 * lisp.h (init_character_once, init_fns, init_image)
9196 (init_filelock, init_sound): Remove prototype.
9197 * character.c (init_character_once): Remove.
9198 * filelock.c (init_filelock): Likewise.
9199 * fns.c (init_fns): Likewise.
9200 * image.c (init_image): Likewise.
9201 * sound.c (init_sound): Likewise.
9202 * emacs.c (main): Adjust accordingly.
9204 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9206 * gtkutil.h: Tiny cleanups.
9207 (use_old_gtk_file_dialog): Remove useless declaration.
9208 (xg_uses_old_file_dialog): Add suggested const attribute.
9210 2012-07-15 Eli Zaretskii <eliz@gnu.org>
9212 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9213 (bidi_paragraph_init): Use it to limit search forward for a strong
9214 directional character in abnormally large paragraphs full of
9215 neutral or weak characters. (Bug#11943)
9217 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9219 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9220 the toolbar (Bug#9451).
9221 (xg_make_tool_item): Give the widget event box a transparent
9224 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9226 Cleanup basic allocation variables and functions.
9227 * alloc.c (ignore_warnings, init_intervals, init_float)
9228 (init_cons, init_symbol, init_marker): Remove.
9229 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9230 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9231 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9232 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9233 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9234 (staticidx, init_alloc_once, init_strings, free_ablock):
9235 Remove redundant initialization.
9236 * fns.c (init_weak_hash_tables): Remove.
9237 * lisp.h (init_weak_hash_tables): Remove prototype.
9239 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9241 Use zero_vector where appropriate.
9242 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9244 * lisp.h (zero_vector): New declaration.
9245 * font.c (null_vector): Remove.
9246 (syms_of_font): Remove initialization and staticpro.
9247 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9248 * keymap.c (Faccessible_keymaps): Likewise.
9250 2012-07-15 Leo Liu <sdl.web@gmail.com>
9252 * fringe.c: Fix typo in comments.
9254 2012-07-14 Leo Liu <sdl.web@gmail.com>
9256 * fringe.c: Add a new bitmap exclamation-mark.
9258 2012-07-14 Eli Zaretskii <eliz@gnu.org>
9260 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9262 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9263 (HAVE_MENUS): Don't define, defined by editing config.in with
9265 (GMALLOC_INHIBIT_VALLOC): Don't define.
9266 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9268 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
9270 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9272 2012-07-14 Glenn Morris <rgm@gnu.org>
9274 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9275 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9276 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9278 2012-07-13 Glenn Morris <rgm@gnu.org>
9280 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9282 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9283 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9285 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9287 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9288 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9289 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9290 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9292 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9293 as boolean expression.
9294 (x_set_window_size): Remove unused variable toolbar.
9295 (ns_get_color_default, ns_mod_to_lisp): Remove.
9296 (ns_mouse_position): Remove unused variables xchar and ychar.
9297 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9298 (ns_set_vertical_scroll_bar): Remove unused variable count.
9299 (ns_delete_terminal): Remove unused variable i.
9300 (ns_term_init): Remove unused variables r, g and b.
9301 (mouseDown): Remove unused variable window.
9302 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9303 (initFrameFromEmacs): Remove unused variable vbextra.
9304 (mouseEntered): Remove unused variables p and dpyinfo.
9305 (mouseExited): Remove unused variables p and r.
9306 (ns_define_frame_cursor, ns_clear_frame_area)
9307 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9308 (menuDown): Assign [sender tag] to variable and cast the variable.
9310 * nsterm.h (menuDown): Add id as type to argument sender.
9311 (ns_display_info_for_name): Add Lisp_Object argument.
9312 (ns_term_init): Add Lisp_Object argument.
9313 (ns_map_event_to_object): Add void argument.
9314 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9315 prototype with arguments and only declare if __OBJC__.
9316 (nxatoms_of_nsselect): Add void argument.
9317 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9318 (ns_alloc_autorelease_pool): Add void argument.
9319 (ns_release_autorelease_pool): Add void* argument.
9320 (ns_get_defaults_value): Add const char* argument.
9322 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9323 (initFromContents): Use SSDATA where appropriate.
9324 (ns_update_menubar): Add braces to ambigous if-else.
9325 (initWithTitle): Put () around assignment in if statement.
9326 (ns_menu_show): Remove unused variables window and keymap.
9327 (update_frame_tool_bar): Remove unused variable selected_p.
9328 (initWithContentRect): Remove unused variable this_cmd_name.
9330 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9332 (setXBMColor): Remove unused variable len.
9333 (setPixmapData): Put () around assignment in loop statement.
9335 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9336 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9338 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9339 around assignment in loop statement.
9340 (nsfont_open): Remove unused variable i.
9341 (nsfont_open): Remove unused variable len.
9342 (nsfont_draw): Remove unused variable cs.
9344 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9345 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9346 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9347 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9348 (Fns_font_name, Fns_perform_service)
9349 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9350 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9351 (ns_set_name): Remove unused variable view.
9352 (x_set_menu_bar_lines): Remove unused variable olines.
9353 (x_set_tool_bar_lines): Remove unused variable root_window.
9354 (Fns_list_colors): Put () around assignment in while statement.
9355 (Fns_perform_service): Remove unused variable len.
9356 (Fns_display_usable_bounds): Remove unused variable top.
9357 (syms_of_nsfns): Remove unused variable i.
9359 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9362 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
9364 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9365 and free it with DestroyExceptionInfo (Bug#11558).
9367 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
9369 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9370 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9371 Set here, not in nt/config.nt.
9373 2012-07-13 Eli Zaretskii <eliz@gnu.org>
9375 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9376 cursor overflow into the last glyph on display line when the right
9377 fringe is off. (Bug#11832)
9379 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9381 * xdisp.c (produce_special_glyphs): Now static.
9382 * dispextern.h (produce_special_glyphs): Remove decl.
9384 2012-07-13 Glenn Morris <rgm@gnu.org>
9386 * s/bsd-common.h, s/cygwin.h: Remove empty files.
9387 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9389 * s/usg5-4-common.h (USG, USG5):
9390 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9391 * s/sol2-6.h (SOLARIS2):
9392 * s/irix6-5.h (IRIX6_5):
9393 * s/hpux10-20.h (USG, USG5, HPUX):
9394 * s/gnu-linux.h (USG, GNU_LINUX):
9395 * s/freebsd.h (BSD_SYSTEM):
9396 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9397 * s/cygwin.h (CYGWIN):
9398 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9399 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9401 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
9403 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9405 2012-07-13 Glenn Morris <rgm@gnu.org>
9407 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9409 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9411 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9412 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9414 2012-07-12 Glenn Morris <rgm@gnu.org>
9416 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9418 * process.c (init_process_emacs): Rename from init_process.
9419 The old name is also the name of a Mach system call.
9420 * lisp.h, emacs.c: Update for this name change.
9421 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9424 2012-07-12 Eli Zaretskii <eliz@gnu.org>
9426 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9427 memmove call that removes glyphs covered by the left truncation
9428 glyph. Improve commentary.
9429 (display_line): Fix display of continuation glyphs on GUI frames
9430 when the right fringe is turned off and variable-size fonts are
9431 used in the window. Move the code that appends a stretch glyph to
9432 produce_special_glyphs, so that it could be used for truncation
9433 and continuation glyphs alike.
9434 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9435 glyph of a suitably computed width, to align the special glyphs at
9436 the window margin. Code moved from display_line. (Bug#11832)
9438 2012-07-12 Glenn Morris <rgm@gnu.org>
9440 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9442 * s/gnu-linux.h, s/hpux10-20.h:
9443 Do not unconditionally define HAVE_XRMSETDATABASE.
9445 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9447 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9449 Fix typos that broke OS X build.
9450 Reported by Randal L. Schwartz in
9451 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9452 * nsterm.m (ns_timeout): Add missing local decl.
9453 (ns_get_color): snprintf -> sprintf, to fix typo.
9455 2012-07-12 Glenn Morris <rgm@gnu.org>
9457 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9458 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9459 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9460 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9462 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9463 Move PTY_OPEN to configure.
9465 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9466 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9467 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9469 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9471 Use empty_unibyte_string where applicable.
9472 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9473 * lread.c (read1): Likewise.
9474 * xsettings.c (syms_of_xsettings): Likewise.
9476 2012-07-12 Glenn Morris <rgm@gnu.org>
9478 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9479 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9480 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9481 * s/hpux10-20.h (RUN_TIME_REMAP):
9482 * s/bsd-common.h (TABDLY): Move to configure.
9484 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9486 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9488 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9489 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9491 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9493 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9494 * s/template.h: Move NARROWPROTO to configure.
9496 2012-07-11 Glenn Morris <rgm@gnu.org>
9498 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9499 unused since 2011-01-17 change to systty.h.
9501 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9502 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9503 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9505 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9507 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9509 2012-07-11 Glenn Morris <rgm@gnu.org>
9511 * s/darwin.h, s/gnu-linux.h, s/template.h:
9512 Move INTERRUPT_INPUT to configure.
9514 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9516 Minor adjustments to interning code.
9517 * lisp.h (intern, intern_c_string): Redefine as static inline
9518 wrappers for intern_1 and intern_c_string_1, respectively.
9519 (intern_1, intern_c_string_1): Rename prototypes.
9520 * lread.c (intern_1, intern_c_string_1, oblookup):
9521 Simplify Vobarray checking.
9522 * font.c (font_intern_prop): Likewise. Adjust comment.
9523 * w32font.c (intern_font_name): Likewise.
9525 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9527 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9529 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9530 of Fcar/Fcdr if possible.
9531 * font.c (check_otf_features): Likewise.
9532 * fontset.c (Fnew_fontset): Likewise.
9533 * gnutls.c (Fgnutls_boot): Likewise.
9534 * minibuf.c (read_minibuf): Likewise.
9535 * msdos.c (IT_set_frame_parameters): Likewise.
9536 * xmenu.c (Fx_popup_dialog): Likewise.
9537 * w32menu.c (Fx_popup_dialog): Likewise.
9539 2012-07-11 Glenn Morris <rgm@gnu.org>
9541 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9542 since nothing has defined it on these platforms.
9544 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9545 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9547 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9548 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9549 Move CLASH_DETECTION to configure.
9551 * s/gnu.h: Remove file, which is now empty.
9553 * s/gnu.h, s/gnu-linux.h:
9554 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9556 2012-07-11 John Wiegley <johnw@newartisans.com>
9558 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9559 function attribute, so we only use it if it exists in the
9562 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9564 Avoid call to strlen in fast_c_string_match_ignore_case.
9565 * search.c (fast_c_string_match_ignore_case): Change to use
9566 length argument. Adjust users accordingly.
9567 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9569 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9571 Assume mkdir, rmdir.
9572 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9573 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9576 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9579 * s/hpux10-20.h (HAVE_PERROR): Remove.
9580 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9581 Remove dummy definition, as this problem was obsolete long ago.
9584 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9586 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9588 Avoid calls to strlen in font processing functions.
9589 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
9590 (font_open_by_name): Change to use length argument.
9591 Adjust users accordingly.
9592 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9594 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9595 Change to return ptrdiff_t.
9596 (xfont_list_pattern, xfont_match): Use length returned by
9597 xfont_decode_coding_xlfd.
9598 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9600 2012-07-11 Glenn Morris <rgm@gnu.org>
9602 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9603 Move DONT_REOPEN_PTY to configure.
9605 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9606 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9608 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9610 Remove "#define unix" that is no longer needed (Bug#11905).
9611 * s/aix4-2.h (unix): Remove; no longer needed.
9613 EMACS_TIME simplification (Bug#11875).
9614 This replaces macros (which typically do not work in GDB)
9615 with functions, typedefs and enums, making the code easier to debug.
9616 The functional style also makes code easier to read and maintain.
9617 * systime.h: Include <sys/time.h> on all hosts, not just if
9618 WINDOWSNT, since 'struct timeval' is needed in general.
9619 (EMACS_TIME): Now a typedef, not a macro.
9620 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9622 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9623 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9624 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9625 (EMACS_TIME_LE): Now functions, not macros.
9626 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9627 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9628 which are not functions. All uses rewritten to use:
9629 (make_emacs_time): New function.
9630 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9631 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9632 not functions. All uses rewritten to use the following, respectively:
9633 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9634 (add_emacs_time, sub_emacs_time): New functions.
9635 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
9636 * fileio.c (Fcopy_file):
9637 * xterm.c (XTflash): Get the current time closer to when it's used.
9638 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9640 * bytecode.c (targets): Suppress -Woverride-init warnings.
9642 Simplify by avoiding confusing use of strncpy etc.
9643 * doc.c (Fsnarf_documentation):
9644 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9645 * frame.c (Fmake_terminal_frame):
9646 * gtkutil.c (get_utf8_string):
9648 * nsmenu.m (ns_update_menubar):
9649 * regex.c (regerror):
9650 Prefer memcpy to strncpy and strncat when either will do.
9651 * fileio.c (Fsubstitute_in_file_name):
9652 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9653 (menu_separator_name_p):
9654 * nsmenu.m (ns_update_menubar):
9655 Prefer memcmp to strncmp when either will do.
9656 * nsterm.m: Include <ftoastr.h>.
9658 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9659 Prefer snprintf to strncpy.
9660 * nsterm.m (ns_term_init):
9661 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9662 * nsterm.m (ns_term_init):
9663 Avoid the need for strncpy, by using build_string or
9664 make_unibyte_string directly. Use dtoastr, not snprintf.
9665 * process.c (Fmake_network_process): Diagnose service names that
9666 are too long, rather than silently truncating them or creating
9667 non-null-terminated names.
9668 (Fnetwork_interface_info): Likewise, for interface names.
9669 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9670 Prefer sprintf to strncat.
9671 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9672 Prefer vsnprintf to vsprintf + strncpy.
9674 2012-07-10 Glenn Morris <rgm@gnu.org>
9676 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9677 Clarify fallback case.
9679 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9681 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9682 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9683 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
9684 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
9685 where argument type is known to be a Lisp_Cons.
9687 2012-07-10 Tom Tromey <tromey@redhat.com>
9689 * bytecode.c (BYTE_CODE_THREADED): New macro.
9690 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9691 (enum byte_code_op): New type.
9692 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9693 (exec_byte_code): Use them. Use token threading when applicable.
9695 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9697 Optimize pure C strings initialization.
9698 * lisp.h (make_pure_string): Fix prototype.
9699 (build_pure_c_string): New function, defined as static inline. This
9700 provides a better opportunity to optimize away calls to strlen when
9701 the function is called with compile-time constant argument.
9702 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9703 argument, adjust users accordingly. Use build_pure_c_string where
9705 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9706 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9707 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9709 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9711 Avoid calls to strlen in miscellaneous functions.
9712 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9713 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9714 * lread.c (openp): Likewise.
9716 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9718 Avoid calls to strlen in path processing functions.
9719 * fileio.c (file_name_as_directory): Add comment. Change to add
9720 srclen argument and return the length of result. Adjust users
9722 (directory_file_name): Fix comment. Change to add srclen argument,
9723 swap 1st and 2nd arguments to obey the common convention.
9724 Adjust users accordingly.
9725 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9727 2012-07-10 Glenn Morris <rgm@gnu.org>
9729 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9730 Move PENDING_OUTPUT_COUNT definition to configure.
9732 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9733 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9734 * s/gnu.h (DATA_START): Move definitions to configure.
9736 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9737 We include usg5-4-common.h, which defines them both.
9739 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9740 O_RDONLY already includes it).
9742 Stop ns builds setting the EMACSLOADPATH environment variable.
9743 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9744 Now it does not set EMACSLOADPATH, just returns the load-path string.
9745 * nsterm.h: Update accordingly.
9746 * lread.c [HAVE_NS]: Include nsterm.h.
9747 (init_lread) [HAVE_NS]: Use ns_load_path.
9748 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9750 2012-07-09 Glenn Morris <rgm@gnu.org>
9752 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9753 since the included bsd-common.h does so.
9755 Stop ns builds setting the EMACSPATH environment variable.
9756 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9757 (ns_init_paths): Do not set EMACSPATH.
9758 * nsterm.h (ns_exec_path): Add it.
9759 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9762 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9764 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9766 * process.c (wait_reading_process_output): 'waitchannels' was unset
9767 when read_kbd || !NILP (wait_for_cell); fix this.
9769 Add GCC-style 'const' attribute to functions that can use it.
9770 * character.h (char_resolve_modifier_mask):
9771 * keyboard.h (make_ctrl_char):
9772 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9773 (init_character_once, next_almost_prime, init_fns, init_image)
9774 (flush_pending_output, init_sound):
9775 * mem-limits.h (start_of_data):
9776 * menu.h (finish_menu_items):
9777 Add ATTRIBUTE_CONST.
9778 * emacs.c (DEFINE_DUMMY_FUNCTION):
9779 Declare the dummy function with ATTRIBUTE_CONST.
9780 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9781 Add decls with ATTRIBUTE_CONST.
9783 Minor improvements to make_formatted_string.
9784 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9785 where int is good enough, as vsprintf returns an int.
9786 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9788 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9790 Use make_formatted_string to avoid double length calculation.
9791 * lisp.h (make_formatted_string): New prototype.
9792 * alloc.c (make_formatted_string): New function.
9793 * buffer.c (Fgenerate_new_buffer_name): Use it.
9794 * dbusbind.c (syms_of_dbusbind): Likewise.
9795 * editfns.c (Fcurrent_time_zone): Likewise.
9796 * filelock.c (get_boot_time): Likewise.
9797 * frame.c (make_terminal_frame, set_term_frame_name)
9798 (x_report_frame_params): Likewise.
9799 * image.c (gs_load): Likewise.
9800 * minibuf.c (get_minibuffer): Likewise.
9801 * msdos.c (dos_set_window_size): Likewise.
9802 * process.c (make_process): Likewise.
9803 * xdisp.c (ensure_echo_area_buffers): Likewise.
9804 * xsettings.c (apply_xft_settings): Likewise.
9806 2012-07-09 Glenn Morris <rgm@gnu.org>
9808 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9809 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9810 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9811 * nsterm.h (ns_etc_directory): Add it.
9812 * callproc.c [HAVE_NS]: Include nsterm.h.
9813 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9815 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9817 Move marker debugging code under MARKER_DEBUG.
9818 * marker.c (MARKER_DEBUG): Move marker debugging code under
9819 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9820 for bootstrap with --enable-checking (~3x slowdown reported
9821 by Juanma Barranquero <lekktu@gmail.com>).
9822 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9824 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9826 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9827 See <http://bugs.gnu.org/11825#29>.
9829 2012-07-08 Eli Zaretskii <eliz@gnu.org>
9831 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9832 has no font, use the frame's font. (Bug#11813)
9833 (display_line): Add commentary about displaying truncation glyphs
9835 (produce_special_glyphs): Move here from term.c.
9837 * term.c (produce_special_glyphs): Move to xdisp.c.
9839 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9842 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9844 * xdisp.c (display_line): Avoid warning about implicit declaration
9847 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9849 * lisp.h: Remove empty conditional.
9851 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9853 * lread.c (load_path_check): Now static.
9855 Fix some minor --with-ns problems found by static checking.
9856 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9857 (x_set_font) [!HAVE_X_WINDOWS]:
9858 * image.c (xpm_load_image) [HAVE_NS]:
9859 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9860 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9861 Remove unused local.
9862 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9863 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9864 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9865 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9866 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9867 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9868 Fix pointer signedness problem.
9869 * xfaces.c (FRAME_X_FONT_TABLE):
9870 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9872 2012-07-07 Glenn Morris <rgm@gnu.org>
9874 * lread.c (load_path_check): New function, split from init_lread.
9875 (init_lread): Reorganize. Motivation:
9876 If EMACSLOADPATH is set, check/warn about that rather than the
9877 defaults, which we are not going to use. Hence we can remove
9878 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9879 Don't warn if site-lisp directories are missing.
9880 If not installed, start from a blank load-path, since
9881 PATH_LOADSEARCH refers to the eventual installation directories.
9883 2012-07-07 Eli Zaretskii <eliz@gnu.org>
9885 Support truncation and continuation glyphs on GUI frames, when
9886 fringes are disabled. (Bug#11832)
9887 * xdisp.c (init_iterator): Get dimensions of truncation and
9888 continuation glyphs even if on GUI frames.
9889 Adjust it->last_visible_x on GUI frames when the left or right fringes,
9890 or both, are absent.
9891 (start_display, move_it_in_display_line_to): Handle the case of a
9892 GUI frame without a fringe to display continuation or truncation
9894 (insert_left_trunc_glyphs): Support GUI frames: make sure
9895 truncation glyphs overwrite enough glyphs from the current line to
9896 have sufficient space in pixels.
9897 (display_line): Support truncation and continuation glyphs on GUI
9898 frames. If some spare pixels are left on the line after inserting
9899 the truncation glyphs, fill that space with a stretch glyph of a
9900 suitably computed width.
9902 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9903 produce_glyphs, to support GUI sessions.
9905 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9907 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9909 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9911 Do not require float-time's arg to fit in time_t (Bug#11825).
9912 This works better on hosts where time_t is unsigned, and where
9913 float-time is applied to the (negative) difference between two times.
9914 * editfns.c (decode_time_components): Last arg is now double *,
9915 not int *, and means to store all the result as a double, without
9916 worrying about whether the seconds part fits in time_t.
9917 All callers changed.
9918 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9919 All callers changed.
9920 (Ffloat_time): Do not fail merely because the specified time falls
9921 outside of time_t range.
9923 2012-07-07 Glenn Morris <rgm@gnu.org>
9925 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9926 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9927 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9929 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
9931 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9932 Update dependencies.
9934 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9936 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9938 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9939 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9940 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9941 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9942 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9943 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9945 * xfont.c (compare_font_names): Redo to omit the need for casts.
9947 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9949 * xfns.c (Fx_change_window_property): Doc fix.
9950 * w32fns.c (Fx_change_window_property): Doc fix.
9952 * w32fns.c (Fx_window_property): Accept the same arguments as the
9953 X Windows version. Doc fix.
9954 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9956 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
9957 Eli Zaretskii <eliz@gnu.org>
9959 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9960 Windows-specific code from nt/config.nt moved here.
9961 Obsolete settings removed.
9963 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9965 * process.c: Avoid unnecessary calls to gettime.
9966 (wait_reading_process_output): Don't get the time of day
9967 when gobbling data immediately and not waiting, as there's no need
9968 for it in that case. This removes a FIXME.
9970 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9972 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9973 is defined (Bug#11768).
9975 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9977 Fix marker debugging code.
9978 * marker.c (byte_char_debug_check): Do not perform the check
9979 if buffer is not multibyte.
9980 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9981 Call byte_char_debug_check with correct arguments.
9983 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9985 Compile marker debugging code only if ENABLE_CHECKING is defined.
9986 * marker.c (byte_char_debug_check, count_markers):
9987 Use only if ENABLE_CHECKING is defined.
9988 (byte_debug_flag): Remove.
9989 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9990 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9992 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9994 Avoid code repetition in marker-related functions.
9995 * marker.c (attach_marker): New function.
9996 (Fset_marker, set_marker_restricted, set_marker_both)
9997 (set_marker_restricted_both): Use it.
9998 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9999 Consistently rename charno to charpos.
10000 (marker_position): Add eassert.
10001 (marker_byte_position): Convert to eassert.
10003 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10005 Simplify list operations in unchain_overlay and unchain_marker.
10006 * buffer.c (unchain_overlay): Simplify. Add comment.
10007 * marker.c (unchain_marker): Simplify. Fix comments.
10009 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10011 Introduce fast path for the widely used marker operation.
10012 * alloc.c (build_marker): New function.
10013 * lisp.h (build_marker): New prototype.
10014 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10015 * composite.c (autocmp_chars): Likewise.
10016 * editfns.c (buildmark): Remove.
10017 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10018 (save_restriction_save): Use build_marker.
10019 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10020 * window.c (save_window_save): Likewise.
10022 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10024 Do not use Fdelete_overlay in delete_all_overlays
10025 to avoid redundant calls to unchain_overlay.
10026 * buffer.c (drop_overlay): New function.
10027 (delete_all_overlays, Fdelete_overlay): Use it.
10028 * minibuf.c (get_minibuffer): Fix comment.
10030 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10032 Port to OpenBSD 5.1 amd64.
10033 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10034 This is needed for OpenBSD, and should be harmless on all BSD systems.
10035 Also, include <sys/sysctl.h>, as it should be available on all
10036 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10037 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10038 use p_pid member, not kp_proc.pid.
10040 2012-07-06 Glenn Morris <rgm@gnu.org>
10042 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10044 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10046 More xmalloc and related cleanup.
10047 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10048 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10049 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10050 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10051 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10052 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10053 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10054 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10055 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10057 Omit needless casts involving void * pointers and allocation.
10058 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10059 as the former is more robust if P's type is changed.
10060 Prefer xzalloc to xmalloc + memset 0.
10061 Simplify malloc-or-realloc to realloc.
10062 Don't worry about xmalloc returning a null pointer.
10063 Prefer xstrdup to xmalloc + strcpy.
10064 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10066 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10067 alloca of a constant.
10069 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10071 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10072 hscroll is larger than the line width. Fixes long and futile
10073 looping inside extend_face_to_end_of_line (on a TTY) producing
10074 glyphs that are not needed and thrown away.
10076 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10078 * marker.c (set_marker_restricted_both): Simplify by using
10081 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10083 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10085 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10087 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10088 not defined (Bug#11768).
10089 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10090 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10091 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10092 followed by gtk_box_set_homogeneous (Bug#11768).
10093 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10094 (update_theme_scrollbar_width, xg_create_scroll_bar):
10095 Use gtk_scrollbar_new (Bug#11768).
10096 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10097 (is_box_type): New function (Bug#11768).
10098 (xg_tool_item_stale_p): Call is_box_type.
10099 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10100 with default display (Bug#11768).
10102 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10104 * xdisp.c (window_hscroll_limited): New function.
10105 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10106 coordinates when window's hscroll is set to insanely large
10107 values. (Bug#11857)
10109 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10111 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10112 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10114 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10117 * lisp.h (xzalloc): New prototype. Omit needless casts.
10118 * alloc.c (xzalloc): New function. Omit needless casts.
10119 * charset.c: Omit needless casts. Convert all calls to
10120 xmalloc with following memset to xzalloc.
10121 * dispnew.c: Likewise.
10122 * fringe.c: Likewise.
10123 * image.c: Likewise.
10124 * sound.c: Likewise.
10125 * term.c: Likewise.
10126 * w32fns.c: Likewise.
10127 * w32font.c: Likewise.
10128 * w32term.c: Likewise.
10129 * xfaces.c: Likewise.
10130 * xfns.c: Likewise.
10131 * xterm.c: Likewise.
10132 * atimer.c: Omit needless casts.
10133 * buffer.c: Likewise.
10134 * callproc.c: Likewise.
10136 * coding.c: Likewise.
10137 * composite.c: Likewise.
10139 * doprnt.c: Likewise.
10140 * editfns.c: Likewise.
10141 * emacs.c: Likewise.
10142 * eval.c: Likewise.
10143 * filelock.c: Likewise.
10145 * gtkutil.c: Likewise.
10146 * keyboard.c: Likewise.
10147 * lisp.h: Likewise.
10148 * lread.c: Likewise.
10149 * minibuf.c: Likewise.
10150 * msdos.c: Likewise.
10151 * print.c: Likewise.
10152 * process.c: Likewise.
10153 * region-cache.c: Likewise.
10154 * search.c: Likewise.
10155 * sysdep.c: Likewise.
10156 * termcap.c: Likewise.
10157 * terminal.c: Likewise.
10158 * tparam.c: Likewise.
10159 * w16select.c: Likewise.
10161 * w32reg.c: Likewise.
10162 * w32select.c: Likewise.
10163 * w32uniscribe.c: Likewise.
10164 * widget.c: Likewise.
10165 * xdisp.c: Likewise.
10166 * xmenu.c: Likewise.
10167 * xrdb.c: Likewise.
10168 * xselect.c: Likewise.
10170 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10172 * fileio.c (time_error_value): Check the right error number.
10173 Problem reported by Troels Nielsen in
10174 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10176 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10178 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10179 This should be fixed in a better way; see Eli Zaretskii in
10180 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10181 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10183 * fileio.c (time_error_value): Rename from special_mtime.
10184 The old name's problems were noted by Eli Zaretskii in
10185 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10187 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10188 This variable's comment says Emacs needs at least one GDB-visible
10189 symbol of type enum pvec_type, to work around GDB problems.
10190 The symbol's value doesn't matter.
10192 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10193 that causes compilation to fail on pre-C99 compilers.
10195 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
10197 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10198 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10200 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10202 * buffer.c (init_buffer_once): Fix initialization of
10203 headers for buffer_defaults and buffer_local_symbols.
10204 Reported by Juanma Barranquero <lekktu@gmail.com>.
10206 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10208 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10209 * lisp.h (enum pvec_type): Use fewer bits.
10210 (PSEUDOVECTOR_SIZE_BITS): New constant.
10211 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10212 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10213 change in pvec_type.
10214 (PSEUDOVECTOR_TYPEP): New macro.
10215 (TYPED_PSEUDOVECTORP): Use it.
10216 * fns.c (internal_equal): Adapt code to extract pvectype.
10217 * emacs.c (gdb_pvec_type): Update type.
10218 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10219 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10220 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10221 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10222 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10223 abusing vector->header.next.nbytes.
10224 (live_vector_p): Use PVEC_TYPE.
10225 (mark_object): Adapt code to extract pvectype. Use switch.
10227 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10229 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10230 Tighten new eassert a bit.
10232 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10234 Fix compilation with --enable-gcc-warnings and -O1
10235 optimization level.
10236 * doprnt.c (doprnt): Change type of tem to int, initialize
10237 to avoid compiler warning. Add eassert.
10238 * search.c (simple_search): Initialize match_byte to avoid
10239 compiler warning. Add eassert.
10241 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10243 Avoid weird behavior with large horizontal scrolls.
10244 Without this change, for example, large hscroll values would
10245 mess up Emacs's display on Fedora 15 x86, presumably due to
10246 overflows in int calculations in the display code.
10247 Also, if buffers had long lines, Emacs would freeze.
10248 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10249 (set_window_hscroll): New function, containing the old guts of
10250 Fset_window_hscroll. Return the clipped value.
10251 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10252 This avoids the need to check against PTRDIFF_MAX.
10254 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10256 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10258 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10260 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10262 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10263 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10264 since GCC 4.4.6 issues a bogus warning for them.
10266 Fix bugs in file timestamp newness comparisons.
10267 * fileio.c (Ffile_newer_than_file_p):
10268 * lread.c (Fload): Use full timestamp resolution of files,
10269 not just the 1-second resolution, so that files that are only
10270 slightly newer still count as newer.
10271 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10272 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10274 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10276 * fileio.c: Improve handling of file time marker. (Bug#11852)
10277 (special_mtime): New function.
10278 (Finsert_file_contents, Fverify_visited_file_modtime):
10279 Use it to set special mtime values consistently.
10281 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10283 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10284 marker for non-existing file. (Bug#11852)
10286 2012-07-03 Glenn Morris <rgm@gnu.org>
10288 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10289 and did not make it into globals.h).
10291 2012-07-03 Tom Tromey <tromey@redhat.com>
10293 * window.c (Fset_window_margins, Fset_window_fringes)
10294 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10295 * textprop.c (Fprevious_property_change): No longer static.
10296 * syntax.c (Fsyntax_table_p): No longer static.
10297 * process.c (Fget_process, Fprocess_datagram_address): No longer
10299 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10300 * keyboard.c (Fcommand_execute): No longer static.
10302 * insdel.c (Fcombine_after_change_execute): No longer static.
10303 * image.c (Finit_image_library): No longer static.
10304 * fileio.c (Fmake_symbolic_link): No longer static.
10305 * eval.c (Ffetch_bytecode): No longer static.
10306 * editfns.c (Fuser_full_name): No longer static.
10307 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10309 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10311 * dired.c (Ffile_attributes): No longer static.
10312 * composite.c (Fcomposition_get_gstring): No longer static.
10313 * callproc.c (Fgetenv_internal): No longer static.
10315 * ccl.h: Remove EXFUNs.
10316 * buffer.h: Remove EXFUNs.
10317 * dispextern.h: Remove EXFUNs.
10318 * intervals.h: Remove EXFUNs.
10319 * fontset.h: Remove EXFUN.
10320 * font.h: Remove EXFUNs.
10321 * dosfns.c (system_process_attributes): Remove EXFUN.
10322 * keymap.h: Remove EXFUNs.
10323 * lisp.h: Remove EXFUNs.
10324 * w32term.h: Remove EXFUNs.
10325 * window.h: Remove EXFUNs.
10326 * xsettings.h: Remove EXFUN.
10327 * xterm.h: Remove EXFUN.
10329 2012-07-03 Glenn Morris <rgm@gnu.org>
10331 * lisp.h (Frandom): Make it visible to C.
10332 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10333 buffer for invisible buffers. (Bug#1229)
10335 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10337 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10338 values which aren't power of 2.
10339 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
10340 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
10343 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10345 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10347 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10349 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10351 * alloc.c (allocate_vector_block): Remove redundant
10352 calls to mallopt if DOUG_LEA_MALLOC is defined.
10353 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10354 avoid calls to mallopt if zero_vector is returned.
10356 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10358 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10359 is enabled, avoid dereferencing NULL current_sblock if
10362 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10364 Cleanup basic buffer management.
10365 * buffer.h (struct buffer): Change layout to use generic vector
10366 marking code. Fix some comments. Change type of 'clip_changed'
10367 to bitfield. Remove unused #ifndef old.
10368 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10369 (GET_OVERLAYS_AT): Fix indentation.
10370 (for_each_per_buffer_object_at): New macro.
10371 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10372 (Fbuffer_local_variables): Use it.
10373 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10374 * alloc.c (allocate_buffer): Adjust to match new layout of
10375 struct buffer. Fix comment.
10376 (mark_overlay): New function.
10377 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10378 Lisp area of struct buffer.
10379 (mark_object): Use it. Adjust marking of misc objects
10380 and related comments.
10382 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10384 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10385 wrapper that is not needed because the wrapped code is a no-op (zero
10386 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10387 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10389 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10391 * alloc.c (mark_buffer): Simplify. Remove prototype.
10392 (mark_object): Add comment. Reorganize marking of vector-like
10393 objects. Use CHECK_LIVE for all vector-like objects except buffers
10394 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10395 Avoid redundant calls to mark_vectorlike for bool vectors.
10397 2012-06-30 Glenn Morris <rgm@gnu.org>
10399 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10401 * epaths.in (PATH_SITELOADSEARCH): New.
10402 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10403 This is rather than relying on --enable-locallisppath elements
10404 having "site-lisp" in their names. (Bug#10208#25, 11658)
10406 2012-06-30 Eli Zaretskii <eliz@gnu.org>
10408 * w32proc.c (sys_select): Accept and ignore one more argument.
10410 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10412 * sysselect.h [DOS_NT]: Don't include sys/select.h.
10413 (pselect) [!MS_DOS]: Redirect to sys_select.
10415 * sysdep.c: Don't include dos.h and dosfns.h.
10417 * process.c (sys_select):
10418 * msdos.c (sys_select): Accept one more argument and ignore it.
10420 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10421 adapt data types and code to that.
10424 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10425 which clashes with the gnulib function of the same name.
10427 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10429 * font.c (font_style_to_value, font_style_symbolic)
10430 (font_prop_validate_style): Add type checks for values in
10433 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10435 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10438 2012-06-29 Eli Zaretskii <eliz@gnu.org>
10440 * xdisp.c (try_window_id): Undo last change.
10442 * w32.c (getwd): Adjust commentary about startup_dir.
10443 (init_environment): Always call sys_access, even in non-MSVC
10444 builds. Don't chdir to the directory of the Emacs executable.
10445 This undoes code from 1997 which was justified by the need to
10446 "avoid conflicts when removing and renaming directories". But its
10447 downside was that every relative file name was being interpreted
10448 relative to the directory of the Emacs executable, which can never
10449 be TRT. In particular, it broke sys_access when called with
10450 relative file names.
10451 (sys_access): Map GetLastError to errno.
10453 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10455 * window.h (struct window): Change type of 'fringes_outside_margins'
10456 to bitfield. Fix comment. Adjust users accordingly.
10457 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10459 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10462 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
10464 * gnutls.c (emacs_gnutls_handshake):
10465 Add QUIT to make the loop interruptible.
10467 2012-06-29 Glenn Morris <rgm@gnu.org>
10469 * charset.c (init_charset): Make lack of etc/charsets fatal.
10471 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10473 * editfns.c (region_limit): Fix type mismatch.
10475 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10477 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10478 undefined. Convert from xassert to eassert.
10479 * nsmenu.m: Convert from xassert to eassert.
10480 * nsterm.m: Likewise.
10482 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10484 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10486 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10488 Avoid integer overflow on scroll-left and scroll-right.
10489 * window.c (HSCROLL_MAX): New macro.
10490 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10491 overflow when requested scroll falls outside ptrdiff_t range.
10493 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10495 * window.h (struct window): Change type of 'hscroll',
10496 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10497 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10498 Adjust users accordingly.
10499 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10500 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10501 from EMACS_INT to ptrdiff_t.
10502 (make_window): Omit redundant initialization.
10504 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
10506 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10508 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10510 * window.h (struct window): Change type of 'use_time' and
10511 'sequence_number' from Lisp_Object to int.
10512 * frame.c (make_frame): Adjust users accordingly.
10513 * print.c (print_object): Likewise.
10514 * window.c (select_window, Fwindow_use_time, make_parent_window)
10515 (make_window): Likewise.
10517 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10519 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10520 enabled with --enable-checking=[all,glyphs] configure option.
10521 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10522 adjust comments accordingly.
10523 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10524 undefined, adjust comments accordingly.
10525 * image.c: Likewise.
10526 * scroll.c: Likewise.
10527 * w32fns.c: Likewise.
10528 * w32term.c: Likewise.
10529 * xdisp.c: Likewise.
10530 * xfaces.c: Likewise.
10531 * xfns.c: Likewise.
10532 * xterm.c: Likewise.
10534 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10536 Generalize run-time debugging checks.
10537 * dispextern.h (XASSERTS): Remove.
10538 * fontset.c (xassert): Remove.
10539 Convert from xassert to eassert.
10540 * alloc.c: Convert from xassert to eassert.
10541 * bidi.c: Likewise.
10542 * dispnew.c: Likewise.
10544 * fringe.c: Likewise.
10545 * ftfont.c: Likewise.
10546 * gtkutil.c: Likewise.
10547 * image.c: Likewise.
10548 * keyboard.c: Likewise.
10549 * menu.c: Likewise.
10550 * process.c: Likewise.
10551 * scroll.c: Likewise.
10552 * sound.c: Likewise.
10553 * term.c: Likewise.
10554 * w32console.c: Likewise.
10555 * w32fns.c: Likewise.
10556 * w32term.c: Likewise.
10557 * window.c: Likewise.
10558 * xdisp.c: Likewise.
10559 * xfaces.c: Likewise.
10560 * xfns.c: Likewise.
10561 * xselect.c: Likewise.
10562 * xterm.c: Likewise.
10564 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10566 * fns.c (maybe_resize_hash_table): Output message when growing the
10569 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10571 * alloc.c (allocate_string_data): Remove dead code.
10572 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10573 avoid GCC warning about unused macro.
10575 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10577 * alloc.c (allocate_string): Omit intervals initialization.
10578 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10579 as in make_pure_string and make_pure_c_string.
10581 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10583 * alloc.c (allocate_string): Fix last change.
10585 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10587 * alloc.c (allocate_string): Remove two redundant calls
10588 to memset, add explicit initialization where appropriate.
10590 2012-06-27 Glenn Morris <rgm@gnu.org>
10592 * lisp.mk (lisp): Remove paths.elc.
10594 2012-06-27 Chong Yidong <cyd@gnu.org>
10596 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10598 2012-06-26 John Wiegley <johnw@newartisans.com>
10600 * unexmacosx.c (copy_data_segment): Add two section names used
10601 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10603 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10604 when building with Clang.
10606 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10608 * eval.c (Fapply): Allow calling it with a single argument.
10610 2012-06-26 Eli Zaretskii <eliz@gnu.org>
10612 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10613 _stricmp and _strnicmp.
10614 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10616 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10618 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10620 (allocate_process): Likewise for new process.
10621 (allocate_terminal): Change to use offsetof.
10622 (allocate_frame): Likewise.
10623 * frame.c (make_frame): Omit redundant initialization.
10624 * window.c (make_parent_window): Use memset.
10625 (make_window): Omit redundant initialization.
10626 * process.c (make_process): Omit redundant initialization.
10627 * terminal.c (create_terminal): Likewise.
10629 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10631 * term.c (delete_tty): Remove redundant call to memset.
10633 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10635 * alloc.c: Remove build_string.
10636 * lisp.h: Define build_string as static inline. This provides
10637 a better opportunity to optimize away calls to strlen when the
10638 function is called with compile-time constant argument.
10639 * image.c (imagemagick_error): Convert to build_string.
10640 * w32proc.c (sys_spawnve): Likewise.
10641 * xterm.c (x_term_init): Likewise.
10643 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10645 Use sprintf return value instead of invoking strlen on result.
10646 In the old days this wasn't portable, since some sprintf
10647 implementations returned char *. But they died out years ago and
10648 Emacs already assumes sprintf returns int.
10649 Similarly for float_to_string.
10650 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10651 * ccl.c (ccl_driver):
10652 * character.c (string_escape_byte8):
10653 * data.c (Fnumber_to_string):
10654 * doprnt.c (doprnt):
10655 * print.c (print_object):
10656 * xdisp.c (message_dolog):
10657 * xfns.c (syms_of_xfns):
10658 Use sprintf or float_to_string result to avoid need to call strlen.
10659 * data.c (Fnumber_to_string):
10660 Use make_unibyte_string, since the string must be ASCII.
10661 * lisp.h, print.c (float_to_string): Now returns int length.
10662 * term.c (produce_glyphless_glyph):
10663 Use sprintf result rather than recomputing it.
10665 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10666 * Makefile.in (ALL_CFLAGS):
10667 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10668 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10670 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10672 * dispextern.h (xstrcasecmp): Define to library function
10673 strcasecmp if available.
10674 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10676 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10678 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10679 Avoid comma operator.
10680 * menu.c (push_submenu_start, push_submenu_end)
10681 (push_left_right_boundary, push_menu_pane): Likewise.
10682 * msdos.c (dos_rawgetc): Likewise.
10684 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10686 * xfns.c (xic_create_fontsetname): Remove redundant calls
10689 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10691 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10692 sprintf already null-terminates its output.
10694 * xfns.c (x_window): Remove redundant cast.
10696 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10698 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10699 `const char *' to `char *' to avoid compiler warning.
10701 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10703 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10704 instead of truncating it to 63 (admittedly a generous limit).
10706 * process.c: Fix spelling and caps in comments.
10708 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10710 * emacs.c (setpgrp): Remove definition, unused.
10711 * sysdep.c (setpgrp): Remove definition, not used in this file.
10713 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
10715 * makefile.w32-in: Update dependencies.
10717 2012-06-24 Eli Zaretskii <eliz@gnu.org>
10719 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10720 (SYSTIME_H): Add nt/inc/sys/time.h.
10722 * systime.h [WINDOWSNT]: Include sys/time.h.
10724 * s/ms-w32.h (struct timespec): Definition moved from
10725 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10727 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10729 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10730 * buffer.h (buffer_slot_type_mismatch):
10731 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10732 * eval.c (unwind_to_catch):
10733 * image.c (my_png_error, my_error_exit):
10734 * keyboard.c (quit_throw_to_read_char, user_error)
10735 (Fexit_recursive_edit, Fabort_recursive_edit):
10736 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10737 (wrong_type_argument, buffer_overflow, __executable_start)
10738 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10739 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10740 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10742 (child_setup) [!DOS_NT]:
10743 * lread.c (end_of_file_error, invalid_syntax):
10744 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10745 * puresize.h (pure_write_error):
10746 * search.c (matcher_overflow):
10747 * sound.c (sound_perror, alsa_sound_perror):
10748 * sysdep.c, syssignal.h (croak):
10749 * term.c (maybe_fatal, vfatal):
10750 * textprop.c (text_read_only):
10751 * undo.c (user_error):
10752 * unexmacosx.c (unexec_error):
10753 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10754 Use _Noreturn rather than NO_RETURN.
10755 No need for separate decl merely because of _Noreturn.
10756 * sound.c (sound_warning, parse_sound):
10757 Remove unnecessary forward decls.
10759 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10761 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10762 * lisp.h (WAIT_READING_MAX): New macro.
10763 * dispnew.c (Fsleep_for, sit_for):
10764 * keyboard.c (kbd_buffer_get_event):
10765 * process.c (Faccept_process_output):
10766 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10767 This improves on the previous patch, which introduced a bug
10768 when time_t is unsigned and as wide as intmax_t.
10769 See <http://bugs.gnu.org/9000#51>.
10771 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10773 * dispnew.c (sit_for, Fsleep_for):
10774 * keyboard.c (kbd_buffer_get_event):
10775 * process.c (Faccept_process_output): Avoid compiler warnings when
10776 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10778 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
10780 * makefile.w32-in: Update dependencies.
10782 * w32.c (ltime): Add return type and declare static.
10783 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10785 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10787 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10788 Privately reported by Herbert J. Skuhra.
10789 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10791 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10792 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10794 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10796 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10797 last argument of make_unibyte_string.
10799 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10800 language ID in the event parameters.
10802 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10803 event.code, not the obscure "character set ID".
10805 2012-06-23 Chong Yidong <cyd@gnu.org>
10807 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10809 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10811 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10812 * w32.c (fdutimens): New function.
10814 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10816 * s/ms-w32.h (pselect): Redirect to sys_select.
10818 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10820 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10821 in the logic of incrementing and decrementing the value of
10822 use_relocatable_buffers.
10824 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10826 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10827 Privately reported by Herbert J. Skuhra.
10828 [__FreeBSD__]: Remove "*/" typo after "#include".
10829 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10830 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10831 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10832 Don't assume EMACS_TIME and struct timeval are the same type.
10834 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10836 Support higher-resolution time stamps (Bug#9000).
10837 The time stamps are only nanosecond-resolution at the C level,
10838 since that's the best that any real-world system supports now.
10839 But they are picosecond-resolution at the Lisp level, as that's
10840 easy, and leaves room for future OS improvements.
10842 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10845 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10846 Don't get current time unless it's needed.
10848 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10849 now provides it if it's absent.
10850 (start_atimer): Port to higher-res time stamps.
10851 Check for time stamp overflow. Don't get current time more
10852 often than is needed.
10854 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10855 Include systime.h, not time.h.
10856 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10858 * dired.c: Include stat-time.h.
10859 (Ffile-attributes): File times now have higher resolution.
10861 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10862 (struct image): Timestamp now has higher resolution.
10864 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10865 has at least microseconds now. All uses removed.
10866 (update_frame, update_single_window, update_window, update_frame_1)
10867 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10868 (duration_to_sec_usec): Remove; no longer needed.
10870 * editfns.c (time_overflow): Now extern.
10871 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10872 (float-time, Fformat_time_string, Fcurrent_time_string)
10873 (Fcurrent_time_zone): Accept and generate higher-resolution
10875 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10876 (decode_time_components, lisp_seconds_argument): New functions.
10877 (make_time): Now static.
10878 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10879 Report an error if the time is invalid, rather than having the caller
10882 * fileio.c: Include <stat-time.h>
10883 (Fcopy_file): Copy higher-resolution time stamps.
10884 Prefer to set the time stamp via a file descriptor if that works.
10885 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10886 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10887 (Fvisited_file_modtime, Fset_visited_file_modtime):
10888 Support higher-resolution time stamps.
10890 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10892 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10894 * image.c (prepare_image_for_display, clear_image_cache)
10895 (lookup_image): Port to higer-resolution time stamps.
10897 * keyboard.c (start_polling, bind_polling_period):
10898 Check for time stamp overflow.
10899 (read_char, kbd_buffer_get_event, timer_start_idle)
10900 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10901 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10902 Port to higher-resolution time stamps. Do not assume time_t is signed.
10903 (decode_timer): New function. Timers are now vectors of length 9,
10904 not 8, to accommodate the picosecond component.
10905 (timer_check_2): Use it.
10907 * nsterm.m (select_timeout, timeval_subtract): Remove.
10908 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10909 as they're a bit more accurate and handle overflow better.
10910 (ns_select): Change prototype to be compatible with pselect.
10911 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10912 * nsterm.h (ns_select): Adjust prototype.
10914 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10915 us-resolution time stamps.
10916 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10918 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10920 * lisp.h (time_overflow): New decl.
10921 (wait_reading_process_output): First arg is now intmax_t, not int,
10922 to accommodate larger waits.
10924 * process.h (struct Lisp_Process.read_output_delay):
10925 Now counts nanoseconds, not microseconds.
10926 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10928 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10929 (wait_reading_process_output):
10930 Port to ns-resolution time stamps.
10931 (Faccept_process_output, wait_reading_process_output):
10932 Check for time stamp overflow. Do not assume time_t is signed.
10933 (select_wrapper): Remove; we now use pselect.
10934 (Fprocess_attributes): Now generates ns-resolution time stamps.
10936 * sysdep.c: Include utimens.h. Don't include utime.h
10937 or worry about struct utimbuf; gnulib does that for us now.
10938 (gettimeofday): Remove; gnulib provides a substitute.
10939 (make_timeval): New function.
10940 (set_file_times): Now sets ns-resolution time stamps.
10941 New arg FD; all uses changed.
10942 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10943 (system_process_attributes):
10944 Now returns ns-resolution time stamp. All uses changed.
10945 Check for time stamp overflow.
10947 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10948 provides a substitute now.
10950 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10951 since it guarantees struct timespec.
10952 (EMACS_TIME): Now struct timespec, so that we can support
10953 ns-resolution time stamps.
10954 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10955 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10956 (EMACS_USECS): Remove.
10957 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10958 so multiply the arg by 1000 before storing it.
10959 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10961 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10962 Port to ns-resolution time stamps.
10963 (EMACS_TIME_NEG_P): Remove; replaced by....
10964 (EMACS_TIME_SIGN): New macro.
10965 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10966 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10967 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10968 (make_timeval, make_lisp_time, decode_time_components): New decls.
10969 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10970 that it mishandled time_t overflow. You can't compare by subtracting!
10971 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10972 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10974 * term.c: Include <sys/time.h>.
10975 (timeval_to_Time): New function, for proper overflow wraparound.
10976 (term_mouse_position, term_mouse_click): Use it.
10978 * undo.c (record_first_change): Support higher-resolution time stamps
10979 in the undo buffer.
10980 (Fprimitive_undo): Use them when restoring time stamps.
10982 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10983 (w32_get_internal_run_time):
10984 Port to higher-resolution Emacs time stamps.
10985 (ltime): Now accepts single 64-bit integer, as that's more convenient
10988 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10990 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10991 for compatibility with pselect. Support ns-resolution time stamps.
10993 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10995 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10996 Check for time stamp overflow, and support ns-resolution time stamps.
10998 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10999 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11000 (timeval_subtract): Remove; no longer needed.
11001 (XTflash, XTring_bell, x_wait_for_event):
11002 Port to ns-resolution time stamps. Don't assume time_t is signed.
11004 2012-06-22 Chong Yidong <cyd@gnu.org>
11006 * xdisp.c (x_consider_frame_title): Revert last change.
11008 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11010 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11011 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11012 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11013 staticidx goes up to 1597 out of 1600 = 0x640.)
11015 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11017 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11018 Otherwise, the umask might be mistakenly 0 while handling input signals.
11020 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11022 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11024 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11026 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11027 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11028 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11029 access to `contents' member of Lisp_Vector objects with AREF and ASET
11032 2012-06-19 Chong Yidong <cyd@gnu.org>
11034 * frame.c (delete_frame): When selecting a frame on a different
11035 text terminal, do not alter the terminal's top-frame.
11037 * xdisp.c (format_mode_line_unwind_data): Record the target
11038 frame's selected window and its terminal's top-frame.
11039 (unwind_format_mode_line): Restore them.
11040 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11042 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11043 since tty frames can be explicitly named.
11044 (prepare_menu_bars): Likewise.
11046 * term.c (Ftty_top_frame): New function.
11048 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11050 Port byte-code-meter to modern targets.
11051 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11052 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11053 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11054 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11055 (METER_1, METER_2): Simplify.
11057 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11059 * data.c (Fdefalias): Return `symbol' (bug#11686).
11061 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11063 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11064 gets killed during executing of this function (Bug#11665).
11065 Try to always return Qt when the buffer has been actually killed.
11066 (Vkill_buffer_query_functions): In doc-string say that functions
11067 run by this hook should not change the current buffer.
11069 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11071 Fix recently-introduced process.c problems found by static checking.
11072 * process.c (write_queue_push, write_queue_pop, send_process):
11073 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11074 (write_queue_pop): Fix pointer signedness problem.
11075 (send_process): Remove unused local.
11077 2012-06-17 Chong Yidong <cyd@gnu.org>
11079 * xdisp.c (redisplay_internal): No need to redisplay terminal
11080 frames that are not on top.
11082 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11084 * process.c (make_process): Initialize write_queue.
11085 (write_queue_push, write_queue_pop): New functions.
11086 (send_process): Use them to maintain correct ordering of process
11087 writes (Bug#10815).
11089 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11091 * lisp.h (eassert): Assume C89 or later.
11092 This removes the need for CHECK.
11093 (CHECK): Remove. Its comments about always evaluating its
11094 argument were confusing, as 'eassert' typically does not evaluate
11097 * coding.c (produce_chars): Use ptrdiff_t, not int.
11099 * xterm.c (x_draw_underwave): Check for integer overflow.
11100 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11102 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11104 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11105 referenced (Bug#11583).
11107 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11109 Implement wave-style variant of underlining.
11110 * dispextern.h (face_underline_type): New enum.
11111 (face): Add field for underline type.
11112 * nsterm.m (ns_draw_underwave): New function.
11113 (ns_draw_text_decoration): Use it.
11114 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11116 (x_draw_glyph_string): Use them.
11117 * xfaces.c (Qline, Qwave): New Lisp objects.
11118 (check_lface_attrs, merge_face_ref)
11119 (Finternal_set_lisp_face_attribute, realize_x_face):
11120 Handle wave-style underline face attributes.
11121 * xterm.c (x_draw_underwave): New function.
11122 (x_draw_glyph_string): Use it.
11124 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
11126 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11127 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11128 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11129 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11130 ($(BLD)/w32select.$(O)): Update dependencies.
11132 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11134 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11135 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11136 * character.c (_fetch_multibyte_char_p): Remove.
11137 * alloc.c: Include "character.h" before "buffer.h".
11138 * bidi.c: Likewise.
11139 * buffer.c: Likewise.
11140 * bytecode.c: Likewise.
11141 * callint.c: Likewise.
11142 * callproc.c: Likewise.
11143 * casefiddle.c: Likewise.
11144 * casetab.c: Likewise.
11145 * category.c: Likewise.
11146 * cmds.c: Likewise.
11147 * coding.c: Likewise.
11148 * composite.c: Likewise.
11149 * dired.c: Likewise.
11150 * dispnew.c: Likewise.
11152 * dosfns.c: Likewise.
11153 * editfns.c: Likewise.
11154 * emacs.c: Likewise.
11155 * fileio.c: Likewise.
11156 * filelock.c: Likewise.
11157 * font.c: Likewise.
11158 * fontset.c: Likewise.
11159 * fringe.c: Likewise.
11160 * indent.c: Likewise.
11161 * insdel.c: Likewise.
11162 * intervals.c: Likewise.
11163 * keyboard.c: Likewise.
11164 * keymap.c: Likewise.
11165 * lread.c: Likewise.
11166 * macros.c: Likewise.
11167 * marker.c: Likewise.
11168 * minibuf.c: Likewise.
11169 * nsfns.m: Likewise.
11170 * nsmenu.m: Likewise.
11171 * print.c: Likewise.
11172 * process.c: Likewise.
11173 * regex.c: Likewise.
11174 * region-cache.c: Likewise.
11175 * search.c: Likewise.
11176 * syntax.c: Likewise.
11177 * term.c: Likewise.
11178 * textprop.c: Likewise.
11179 * undo.c: Likewise.
11180 * unexsol.c: Likewise.
11181 * w16select.c: Likewise.
11182 * w32fns.c: Likewise.
11183 * w32menu.c: Likewise.
11184 * window.c: Likewise.
11185 * xdisp.c: Likewise.
11186 * xfns.c: Likewise.
11187 * xmenu.c: Likewise.
11189 * xselect.c: Likewise.
11191 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11193 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11194 If all the glyphs of the glyph row came from strings, and we have no
11195 cursor positioning clues, put the cursor on the first glyph of the
11197 (handle_face_prop): Use chunk-relative overlay string index when
11198 indexing into it->string_overlays array. (Bug#11653)
11199 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11200 the rightmost. (Bug#11720)
11202 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11204 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11205 (CATEGORY_MEMBER): Enforce 1/0 value.
11206 * category.c (_temp_category_set): Remove.
11208 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11210 * window.c (Fdelete_other_windows_internal)
11211 (Fdelete_window_internal): Don't access frame's mouse highlight
11212 info of the initial frame. (Bug#11677)
11214 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11216 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11217 Assume USE_2_TAGS_FOR_INTS.
11218 (xreload): Adjust $tagmask width to match recent lisp.h change.
11220 Simplify lisp.h in minor ways that should not affect code.
11221 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11222 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11223 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11224 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11225 (INTTYPEBITS): New macro, for clarity.
11226 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11227 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11228 Simplify now that USE_LSB_TAG is always defined.
11229 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11230 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11232 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
11234 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11236 2012-06-13 Glenn Morris <rgm@gnu.org>
11238 * s/bsd-common.h (BSD4_3):
11239 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11241 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11243 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11245 (XLI, XIL): Define.
11246 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11248 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11249 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11250 * alloc.c (widen_to_Lisp_Object): Remove.
11251 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11252 * frame.c (delete_frame): Remove outdated comment.
11253 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11254 USE_LISP_UNION_TYPE.
11255 (Fw32_unregister_hot_key): Likewise.
11256 (Fw32_toggle_lock_key): Likewise.
11257 * w32menu.c (add_menu_item): Likewise.
11258 (w32_menu_display_help): Use XIL instead of checking
11259 USE_LISP_UNION_TYPE.
11260 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11261 (init_heap): Likewise.
11262 * w32term.c (w32_read_socket): Update comment.
11264 2012-06-13 Glenn Morris <rgm@gnu.org>
11266 * s/usg5-4-common.h, src/s/unixware.h:
11267 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11269 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11271 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11273 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11274 * alloc.c (make_number) [!defined make_number]:
11275 Remove, as lisp.h always defines this now.
11276 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11277 (roundup_size): Verify that it is a power of 2.
11278 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11279 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11280 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11281 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11282 USE_LSB_TAG now is always defined to be either 0 or 1.
11284 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11285 code works fine either way, and efficiency is not a concern here,
11286 as the union type is for debugging, not for production.
11287 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11288 Use an inline function on all platforms when using the union type,
11289 since this is simpler and 'static inline' can be used portably
11291 (LISP_INITIALLY_ZERO): New macro.
11292 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11293 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11295 2012-06-12 Glenn Morris <rgm@gnu.org>
11297 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11299 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
11301 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11302 Move BROKEN_SIGIO to configure.
11304 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11305 Move NO_TERMIO to configure.
11307 2012-06-12 Chong Yidong <cyd@gnu.org>
11309 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11310 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11311 MagickExportImagePixels is undefined.
11313 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11315 * image.c (imagemagick_load_image): Remove unused label.
11317 2012-06-11 Glenn Morris <rgm@gnu.org>
11319 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11320 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11321 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11322 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11324 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11326 * alloc.c (make_byte_code): New function.
11327 (Fmake_byte_code): Use it. Don't purify here.
11328 * lread.c (read1): Use it as well to avoid extra allocation.
11330 2012-06-11 Chong Yidong <cyd@gnu.org>
11332 * image.c (imagemagick_load_image): Implement transparency.
11334 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11336 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11337 account for preceding backslashes. (Bug#11663)
11339 2012-06-09 Chong Yidong <cyd@gnu.org>
11341 * term.c: Support italics in capable terminals (Bug#9652).
11342 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11343 (turn_on_face): Output using TS_enter_italic_mode if available.
11344 Don't handle unused blinking and alt-charset cases.
11345 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11346 and tty_alt_charset_p cases.
11347 (tty_capable_p, init_tty): Support italics.
11349 * termchar.h (struct tty_display_info): Add field for italics.
11350 Remove unused blink field.
11352 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11355 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11356 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11357 tty_alt_charset_p. Add tty_italic_p.
11359 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
11361 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11362 dbus_type_is_basic if available.
11363 (xd_extract_signed, xd_extract_unsigned): Rename from
11364 extract_signed and extract_unsigned, respectively. Adapt callers.
11366 2012-06-09 Chong Yidong <cyd@gnu.org>
11368 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11370 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11373 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11375 * xdisp.c (vmessage): Treat frame message as multibyte.
11376 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11377 would generate the diagnostic "Making \302\247 buffer-local while
11380 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11382 * dispnew.c (showing_window_margins_p): Undo last change, which
11383 was done due to an inadvertent commit.
11384 (adjust_frame_glyphs_for_frame_redisplay): Do call
11385 showing_window_margins_p.
11387 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11389 * eval.c (Fmake_var_non_special): New primitive.
11390 (syms_of_eval): Defsubr it.
11391 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11393 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
11395 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11396 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11398 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11400 * alloc.c (allocate_vectorlike): Fix last change.
11402 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11404 Block-based vector allocation of small vectors.
11405 * lisp.h (struct vectorlike_header): New field `nbytes',
11406 adjust comment accordingly.
11407 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11408 to denote vector blocks. Adjust users (live_vector_p,
11409 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11410 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11411 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11412 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11413 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11414 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11415 (roundup_size): New constant.
11416 (struct vector_block): New data type.
11417 (vector_blocks, vector_free_lists, zero_vector): New variables.
11418 (all_vectors): Rename to `large_vectors'.
11419 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11420 (sweep_vectors): New functions.
11421 (allocate_vectorlike): Return `zero_vector' as the only vector of
11422 0 items. Allocate new vector from block if vector size is less than
11423 or equal to VBLOCK_BYTES_MAX.
11424 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11425 (init_alloc_once): Add call to init_vectors.
11427 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11429 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11431 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11433 * doprnt.c (doprnt): Truncate multibyte char correctly.
11434 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11435 would mishandle a string argument "Xc" if X was a multibyte
11436 character of length 2: it would truncate after X's first byte
11437 rather than including all of X.
11439 2012-06-06 Chong Yidong <cyd@gnu.org>
11441 * buffer.c (word_wrap): Doc fix.
11443 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11445 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11447 2012-06-03 Glenn Morris <rgm@gnu.org>
11449 * xdisp.c (tool-bar-style): Doc fix.
11451 2012-06-03 Ulrich Müller <ulm@gentoo.org>
11453 * Makefile.in (PAXCTL): Define.
11454 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11455 binary via PaX flags if the paxctl utility is available.
11456 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11457 Restore PaX flags to their default. (Bug#11398)
11459 2012-06-03 Chong Yidong <cyd@gnu.org>
11461 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11462 buffer (Bug#11226).
11464 2012-06-03 Chong Yidong <cyd@gnu.org>
11466 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11467 (note_mode_line_or_margin_highlight): If there is no help echo,
11468 use mode-line-default-help-echo. Handle the case where the mouse
11469 position is past the end of the mode line string.
11471 * buffer.c (buffer_local_value_1): New function, split from
11472 Fbuffer_local_value; can return Qunbound.
11473 (Fbuffer_local_value): Use it.
11474 (Vmode_line_format): Docstring tweaks.
11476 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11478 * sysdep.c (system_process_attributes): Improve comment.
11480 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11482 * keyboard.c: Export real-this-command to Elisp.
11483 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11484 and DEFVAR it. Update all users.
11486 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11488 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11490 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11491 Convert pctcpu and pctmem to Lisp float properly.
11492 Let the compiler fold better, as 100.0/0x8000 is exact.
11494 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11496 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11499 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11501 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11503 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11505 For a 'struct window', replace some Lisp_Object fields to
11506 bitfields where appropriate, remove unused fields.
11507 * window.h (struct window): Remove unused 'last_mark_x' and
11508 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
11509 change its type from Lisp_Object to bitfield.
11510 Change type of 'force_start', 'optional_new_start',
11511 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11512 fields from Lisp_Object to bitfield. Adjust users accordingly.
11514 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11516 Pacify gcc -Wdouble-precision when using Xaw.
11517 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11518 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11519 Use 'float' consistently, rather than 'float' in most places
11520 and 'double' in a couple of places.
11522 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11524 * xdisp.c (handle_stop): Detect whether we have overlay strings
11525 loaded by testing it->current.overlay_string_index to be
11526 non-negative, instead of checking whether n_overlay_strings is
11527 positive. (Bug#11587)
11529 2012-05-31 Chong Yidong <cyd@gnu.org>
11531 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11533 * doc.c (Fsubstitute_command_keys): Doc fix.
11535 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11537 * search.c (search_buffer): Remove calls to
11538 r_alloc_inhibit_buffer_relocation, as it is now called by
11539 maybe_unify_char, which was the cause of relocation of buffer text
11542 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11544 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11545 for the duration of call to load_charset, to avoid problems with
11546 callers of maybe_unify_char that access buffer text through C
11549 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11550 decrement the inhibition flag, instead of just setting or
11553 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11555 Remove obsolete '#define static' cruft.
11556 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11557 This #undef was "temporary" in 2000; it is no longer needed
11558 now that '#define static' has gone away.
11559 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11560 (gray_bitmap_bits): Remove; no longer needed.
11561 All uses replaced with definiens.
11562 * xterm.c: Include "bitmaps/gray.xbm".
11564 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11566 Clean up __executable_start, monstartup when --enable-profiling.
11567 The following changes affect the code only when profiling.
11568 * dispnew.c (__executable_start): Rename from safe_bcopy.
11569 Define only on platforms that need it.
11570 * emacs.c: Include <sys/gmon.h> when profiling.
11571 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11572 (__executable_start): Remove decl, since lisp.h does it now.
11573 (safe_bcopy): Remove decl; no longer has that name.
11574 (main): Coalesce #if into single bit of code, for simplicity.
11575 Cast pointers to uintptr_t, since standard libraries want integers
11577 * lisp.h (__executable_start): New decl.
11579 2012-05-31 Glenn Morris <rgm@gnu.org>
11581 * image.c (Fimagemagick_types): Doc fix.
11583 2012-05-30 Jim Meyering <meyering@redhat.com>
11585 * callproc.c (Fcall_process_region): Include directory component
11586 in mkstemp error message (Bug#11586).
11588 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11590 * alloc.c, lisp.h (make_pure_vector): Now static.
11592 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11594 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11595 Move to byte-run.el.
11596 (Fautoload): Do the hash-doc more carefully.
11597 * data.c (Fdefalias): Purify definition, except for keymaps.
11598 (Qdefun): Move from eval.c.
11599 * lisp.h (Qdefun): Remove.
11600 * lread.c (read1): Tiny simplification.
11602 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
11604 Do not create empty overlays with the evaporate property (Bug#9642).
11605 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11606 Bug#9642, but explicitly check that the buffer the overlay would
11607 be moved to is live and rearrange lines to make sure that errors
11608 will not put the overlay in an inconsistent state.
11609 (Fdelete_overlay): Cosmetics.
11611 2012-05-28 Eli Zaretskii <eliz@gnu.org>
11613 * w32term.c (my_bring_window_to_top): New function.
11614 (x_raise_frame): Use handle returned by DeferWindowPos, which
11615 could be different from the original one.
11616 Call my_bring_window_to_top instead of my_set_foreground_window.
11619 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11620 by calling BringWindowToTop.
11622 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11623 (WM_EMACS_END): Increase by one.
11625 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11627 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11628 This avoids undefined behavior that might cause the eassert
11629 to not catch an out-of-range value.
11631 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
11633 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11634 Update dependencies.
11636 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11638 * bidi.c (bidi_mirror_char): Fix last change.
11640 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11642 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11643 when referring to sectname field in printf format.
11645 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11647 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11648 Only r_alloc_inhibit_buffer_relocation needed to be added;
11649 the others were already declared.
11651 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11652 before checking whether it's out of range. Put the check inside
11654 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11656 2012-05-27 Ken Brown <kbrown@cornell.edu>
11658 * callproc.c (Fcall_process): Restore a line that was accidentally
11659 commented out in the 2011-02-13 change (bug#11547).
11661 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11663 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11664 defined on ralloc.c.
11666 * buffer.c [REL_ALLOC]: Remove prototypes of
11667 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11668 they are now on lisp.h.
11670 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11672 * search.c (search_buffer): Use it to inhibit relocation of buffer
11673 text while re_search_2 is doing its job, because re_search_2 is
11674 passed C pointers to buffer text. (Bug#11519)
11676 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11677 Update value to 24.
11679 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11680 state after an additional call to move_it_in_display_line_to, keep
11681 the values of it->max_ascent and it->max_descent found for the
11683 (pos_visible_p): Revert the comparison against bottom_y to what it
11684 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11687 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11689 Fix coding-related core dumps with gcc -ftrapv.
11690 The code was computing A - B, where A and B are pointers, and B is
11691 random garbage. This can lead to core dumps on platforms that
11692 have special pointer registers, and it also leads to core dumps on
11693 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11694 A - B only when B is initialized properly.
11695 * coding.c (coding_set_source, coding_set_destination): Return void.
11696 (coding_change_source, coding_change_destinations): New functions,
11697 with the old behaviors of coding_set_source and coding_set_destination.
11698 All callers that need an offset changed to use these new functions.
11700 2012-05-26 Glenn Morris <rgm@gnu.org>
11702 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11704 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11706 Extend mouse support on W32 text-mode console.
11707 * xdisp.c (draw_row_with_mouse_face):
11708 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
11710 * w32console.c: Include window.h.
11711 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11713 (initialize_w32_display): Initialize mouse-highlight data.
11715 * w32inevt.c: Include termchar.h and window.h.
11716 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11717 moves, call note_mouse_highlight. If help_echo changed, call
11718 gen_help_event to produce help-echo message in the echo area.
11719 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11722 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11724 * lread.c (read1): Simplify slightly to avoid an overflow warning
11725 with GCC 4.7.0 on x86-64.
11727 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11729 * bidi.c (bidi_mirror_char): Revert last change: an int is
11730 definitely wide enough here.
11732 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
11734 Fix integer width and related bugs (Bug#9874).
11735 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
11736 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11737 (string_bytes, check_sblock, allocate_string_data):
11738 (compact_small_strings, Fmake_bool_vector, make_string)
11739 (make_unibyte_string, make_multibyte_string)
11740 (make_string_from_bytes, make_specified_string)
11741 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11742 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11745 (allocate_pseudovector):
11746 Use int, not EMACS_INT, where int is wide enough.
11747 (inhibit_garbage_collection, Fgarbage_collect):
11748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11749 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11750 int might not be wide enough.
11751 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11752 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11753 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11754 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11755 (bidi_level_of_next_char, bidi_move_to_visually_next):
11756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11757 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11758 (Fkill_buffer, Fset_buffer_major_mode)
11759 (advance_to_char_boundary, Fbuffer_swap_text)
11760 (Fset_buffer_multibyte, overlays_at, overlays_in)
11761 (overlay_touches_p, struct sortvec, record_overlay_string)
11762 (overlay_strings, recenter_overlay_lists)
11763 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11764 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11765 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11766 (Foverlay_recenter, last_overlay_modification_hooks_used)
11767 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11769 (validate_region): Omit unnecessary test for b <= e,
11770 since that's guaranteed by the previous test.
11771 (adjust_overlays_for_delete): Avoid pos + length overflow.
11772 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11773 (report_overlay_modification):
11774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11775 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11776 Omit pointer cast, which isn't needed anyway, and doesn't work
11777 after the EMACS_INT -> ptrdiff_t change.
11778 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
11779 * buffer.h: Adjust decls to match defn changes elsewhere.
11780 (struct buffer_text, struct buffer):
11781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11782 Use EMACS_INT, not int, where int might not be wide enough.
11783 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11784 not int, to avoid needless 32-bit limit on 64-bit hosts.
11785 (exec_byte_code): Use tighter memory-full test, one that checks
11786 for alloca overflow. Don't compute the address of the object just
11787 before an array, as that's not portable. Use EMACS_INT, not
11788 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
11789 * callint.c (Fcall_interactively):
11790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11791 * callproc.c (call_process_kill, Fcall_process):
11792 Don't assume pid_t fits into an Emacs fixnum.
11793 (call_process_cleanup, Fcall_process, child_setup):
11794 Don't assume pid_t fits into int.
11795 (call_process_cleanup, Fcall_process, delete_temp_file)
11796 (Fcall_process_region):
11797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11798 (Fcall_process): Simplify handling of volatile integers.
11799 Use int, not EMACS_INT, where int will do.
11800 * casefiddle.c (casify_object, casify_region, operate_on_word)
11801 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11803 (casify_object): Avoid integer overflow when overallocating buffer.
11804 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
11805 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
11806 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11807 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11808 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11809 integers are now checked earlier. All uses replaced with XINT.
11811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11812 For CCL_MapSingle, check that content and value are in int range.
11813 (ccl_driver, Fregister_code_conversion_map):
11814 Check that Vcode_version_map_vector is a vector.
11815 (resolve_symbol_ccl_program): Check that vector header is in range.
11816 Always copy the vector, so that we can check its contents reliably
11817 now rather than having to recheck each instruction as it's being
11818 executed. Check that vector words fit in 'int'.
11819 (ccl_get_compiled_code, Fregister_ccl_program)
11820 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11821 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11822 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11823 contents are in range.
11824 (Fccl_execute_on_string): Check that status is in range.
11825 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11826 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11827 Accept and return EMACS_INT, not int, because callers can pass values
11828 out of 'int' range.
11829 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11830 (multibyte_chars_in_text, parse_str_as_multibyte)
11831 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11832 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11833 (string_escape_byte8, Fget_byte):
11834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11835 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
11836 avoid mishandling large integers.
11837 * character.h: Adjust decls to match defn changes elsewhere.
11838 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11839 (Ffind_charset_region):
11840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11841 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11842 (load_charset_map_from_vector, Fdefine_charset_internal):
11843 Don't assume fixnum fits in int.
11844 (load_charset_map_from_vector, Fmap_charset_chars):
11845 Remove now-unnecessary CHECK_NATNUMs.
11846 (Fdefine_charset_internal): Check ranges here, more carefully.
11847 Don't rely on undefined behavior with signed left shift overflow.
11848 Don't assume unsigned int fits into fixnum, or that fixnum fits
11849 into unsigned int. Don't require max_code to be a valid fixnum;
11850 that's not true for gb10830 4-byte on a 32-bit host. Allow
11851 invalid_code to be a cons, for the same reason. Require code_offset
11852 to be a character. Avoid int overflow if max_char is close
11854 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11855 this is intended anyway and avoids some undefined behavior.
11856 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11857 INDEX_TO_CODE_POINT, as that's what it expects.
11858 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11859 * charset.h (DECODE_CHAR): Return int, not unsigned;
11860 this is what was intended anyway, and it avoids undefined behavior.
11861 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11862 integer-overflow issues.
11863 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11864 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11865 where the argument is EMACS_INT, and this behavior is not intended.
11866 * chartab.c (Fmake_char_table, Fset_char_table_range)
11867 (uniprop_get_decoder, uniprop_get_encoder):
11868 Don't assume fixnum fits in int.
11869 * cmds.c (move_point): New function, that does the gist of
11870 Fforward_char and Fbackward_char, but does so while checking
11871 for integer overflow more accurately.
11872 (Fforward_char, Fbackward_char): Use it.
11873 (Fforward_line, Fend_of_line, internal_self_insert)
11874 (internal_self_insert):
11875 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11876 Fix a FIXME, by checking for integer overflow when calculating
11877 target_clm and actual_clm.
11878 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11879 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11880 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11881 (coding_alloc_by_making_gap, alloc_destination)
11882 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11883 (encode_coding_utf_16, detect_coding_emacs_mule)
11884 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11885 (detect_coding_iso_2022, decode_coding_iso_2022)
11886 (encode_invocation_designation, encode_designation_at_bol)
11887 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11888 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11889 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11890 (encode_coding_ccl, encode_coding_raw_text)
11891 (detect_coding_charset, decode_coding_charset)
11892 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11893 (produce_composition, produce_charset, produce_annotation)
11894 (decode_coding, handle_composition_annotation)
11895 (handle_charset_annotation, consume_chars, decode_coding_gap)
11896 (decode_coding_object, encode_coding_object, detect_coding_system)
11897 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11898 (code_convert_region, code_convert_string)
11899 (Fdefine_coding_system_internal)
11900 (coding_set_source, coding_set_destination):
11901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11902 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11903 (Fdefine_coding_system_internal):
11904 Don't assume fixnums fit in int.
11905 (decode_coding_gap, decode_coding_object, encode_coding_object)
11906 (Fread_coding_system, Fdetect_coding_region)
11907 (Funencodable_char_position, Fcheck_coding_systems_region)
11908 (get_translation, handle_composition_annotation, consume_chars):
11909 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11910 (consume_chars): Rewrite to not calculate an address outside buffer.
11911 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
11912 Don't access memory outside of the args array.
11913 (Fdefine_coding_system_internal): Check for charset-id overflow.
11914 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11915 result of ENCODE_CHAR.
11916 * coding.h: Adjust decls to match defn changes elsewhere.
11917 (struct coding_system):
11918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11919 * composite.c (get_composition_id, find_composition)
11920 (run_composition_function, update_compositions)
11921 (compose_text, composition_gstring_put_cache)
11922 (composition_gstring_p, composition_gstring_width)
11923 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11924 (composition_compute_stop_pos, composition_reseat_it)
11925 (composition_update_it, struct position_record)
11926 (find_automatic_composition, composition_adjust_point)
11927 (Fcomposition_get_gstring, Ffind_composition_internal):
11928 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11929 (update_compositions):
11930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11931 * composite.h: Adjust decls to match defn changes elsewhere.
11932 (struct composition):
11933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11934 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11935 Do not attempt to compute the address of the object just before a
11936 buffer; this is not portable.
11938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11939 (Faset): Use int, not EMACS_INT, where int is wide enough.
11940 (Fstring_to_number): Don't assume fixnums fit in int.
11941 (Frem): Don't assume arg is nonnegative.
11942 * dbusbind.c (xd_append_arg): Check for integers out of range.
11943 (Fdbus_call_method): Don't overflow the timeout int.
11944 (extract_signed, extract_unsigned): New functions.
11945 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11946 (xd_get_connection_references): Return ptrdiff_t, not int.
11948 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11949 (xd_read_message_1):
11950 Use int, not unsigned, where the dbus API uses int.
11951 (Fdbus_message_internal): Don't overflow mtype.
11952 (syms_of_dbusbind): Allocate right-sized buffer for integers.
11953 * dired.c (directory_files_internal, file_name_completion, scmp)
11954 (file_name_completion_stat):
11955 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11956 (file_name_completion): Don't overflow matchcount.
11957 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11958 * dispextern.h: Adjust decls to match defn changes elsewhere.
11959 (struct text_pos, struct glyph, struct bidi_saved_info)
11960 (struct bidi_string_data, struct bidi_it, struct composition_it)
11962 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11963 (struct display_pos, struct composition_it, struct it):
11964 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11965 * dispnew.c (increment_matrix_positions)
11966 (increment_row_positions, mode_line_string)
11967 (marginal_area_string):
11968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11969 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
11970 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11971 (duration_to_sec_usec): New function, to check for overflow better.
11972 (Fsleep_for, sit_for): Use it.
11973 * doc.c (get_doc_string, store_function_docstring):
11974 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11975 (get_doc_string, Fsnarf_documentation):
11976 Use int, not EMACS_INT, where int is wide enough.
11978 Use SAFE_ALLOCA, not alloca.
11979 Check for overflow when converting EMACS_INT to off_t.
11980 * doprnt.c (doprnt):
11981 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11982 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11983 Don't assume uid_t fits into fixnum.
11984 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11985 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11986 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11987 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11988 (general_insert_function)
11989 (Finsert_char, make_buffer_string, make_buffer_string_both)
11990 (update_buffer_properties, Fbuffer_substring)
11991 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11992 (Fsubst_char_in_region, check_translation)
11993 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11994 (transpose_markers, Ftranspose_regions):
11995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11996 (clip_to_bounds): Move to lisp.h as an inline function).
11997 (Fconstrain_to_field): Don't assume integers are nonnegative.
11998 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11999 (Fsubst_char_in_region, Fsave_restriction):
12000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12001 (Femacs_pid): Don't assume pid_t fits into fixnum.
12002 (lo_time): Use int, not EMACS_INT, when int suffices.
12003 (lisp_time_argument): Check for usec out of range.
12004 (Fencode_time): Don't assume fixnum fits in int.
12005 (Fuser_login_name, Fuser_full_name): Signal an error
12006 if a uid argument is out of range, rather than relying on
12007 undefined behavior.
12008 (Fformat_time_string): Remove now-unnecessary check.
12009 lisp_time_argument checks for out-of-range usec now.
12010 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12011 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12012 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12013 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12014 (init_cmdargs, Fdump_emacs):
12015 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12016 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12017 the bottom (typically) 32 bits of the fixnum.
12018 * eval.c (specpdl_size, call_debugger):
12019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12020 (when_entered_debugger, Fbacktrace_debug):
12021 Don't assume fixnum can fit in int.
12022 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12023 the object just before a buffer; this is not portable.
12024 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12025 (grow_specpdl, unbind_to):
12026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12027 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12028 (grow_specpdl): Simplify allocation by using xpalloc.
12029 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12030 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12031 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12033 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12034 (a_write, e_write):
12035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12036 (Fcopy_file, non_regular_nbytes, read_non_regular)
12037 (Finsert_file_contents):
12038 Use int, not EMACS_INT, where int is wide enough.
12039 (READ_BUF_SIZE): Verify that it fits in int.
12040 (Finsert_file_contents): Check that counts are in proper range,
12041 rather than assuming fixnums fit into ptrdiff_t etc.
12042 Don't assume fixnums fit into int.
12043 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12044 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12045 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12046 (string_char_to_byte, string_byte_to_char)
12047 (string_make_multibyte, string_to_multibyte)
12048 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12049 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12050 (substring_both, Fdelete, internal_equal, Ffillarray)
12051 (Fclear_string, mapcar1)
12052 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12053 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12054 (larger_vector, make_hash_table, maybe_resize_hash_table)
12055 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12056 (Fmaphash, secure_hash):
12057 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12058 (concat): Check for string index and length overflow.
12059 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12062 (larger_vector): New API (vec, incr_min, size_max) replaces old
12063 one (vec, new_size, init). This catches size overflow.
12064 INIT was removed because it was always Qnil.
12065 All callers changed.
12066 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12067 the upper bound on a hash table index size.
12068 (make_hash_table, maybe_resize_hash_table): Use it.
12069 (secure_hash): Computer start_byte and end_byte only after
12070 they're known to be in ptrdiff_t range.
12071 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12072 (Ffont_get_glyphs, Ffont_at):
12073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12074 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12075 (Flist_fonts, Fopen_font):
12076 Don't assume fixnum can fit in int.
12077 (check_gstring): Don't assume index can fit in int.
12078 (font_match_p): Check that fixnum is a character, not a nonnegative
12079 fixnum, since the later code needs to stuff it into an int.
12080 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12081 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12082 conversion overflow issues.
12083 (Fopen_font): Check for integer out of range.
12084 (Ffont_get_glyphs): Don't assume index can fit in int.
12085 * font.h: Adjust decls to match defn changes elsewhere.
12086 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12088 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12089 printmax_t, where ptrdiff_t is wide enough.
12090 (Finternal_char_font):
12091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12092 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12093 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12094 (Fset_frame_position, x_set_frame_parameters)
12095 (x_set_line_spacing, x_set_border_width)
12096 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12097 Check that fixnums are in proper range for system types.
12098 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12099 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12100 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12101 Use SAFE_ALLOCA_LISP, not alloca.
12102 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12103 intptr_t is wide enough.
12104 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12105 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12106 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12107 Check for fixnum out of range.
12108 * ftfont.c (ftfont_list): Don't assume index fits in int.
12109 Check that fixnums are in proper range for system types.
12110 (ftfont_shape_by_flt):
12111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12112 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12114 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12115 Check that fixnums are in proper range for system types.
12116 * gnutls.h: Adjust decls to match defn changes elsewhere.
12117 * gtkutil.c (xg_dialog_run):
12118 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12119 (update_frame_tool_bar):
12120 Check that fixnums are in proper range for system types.
12121 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12122 (lookup_image): Check that fixnums are in range for system types.
12123 * indent.c (last_known_column, last_known_column_point):
12124 (current_column_bol_cache):
12125 (skip_invisible, current_column, check_display_width):
12126 (check_display_width, scan_for_column, current_column_1)
12127 (Findent_to, Fcurrent_indentation, position_indentation)
12128 (indented_beyond_p, Fmove_to_column, compute_motion):
12129 (Fcompute_motion, Fvertical_motion):
12130 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12131 (last_known_column_modified): Use EMACS_INT, not int.
12132 (check_display_width):
12134 Check that fixnums and floats are in proper range for system types.
12135 (compute_motion): Don't assume index or fixnum fits in int.
12136 (compute_motion, Fcompute_motion):
12137 Use int, not EMACS_INT, when it is wide enough.
12138 (vmotion): Omit local var start_hpos that is always 0; that way
12139 we don't need to worry about overflow in expressions involving it.
12140 * indent.h: Adjust decls to match defn changes elsewhere.
12142 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12143 Use int, not EMACS_INT, where int is wide enough.
12144 Remove unused members ovstring_chars_done and tab_offset;
12146 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12147 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12148 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12149 (make_gap, copy_text, insert, insert_and_inherit)
12150 (insert_before_markers, insert_before_markers_and_inherit)
12151 (insert_1, count_combining_before, count_combining_after)
12152 (insert_1_both, insert_from_string)
12153 (insert_from_string_before_markers, insert_from_string_1)
12154 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12155 (adjust_after_replace, adjust_after_insert, replace_range)
12156 (replace_range_2, del_range, del_range_1, del_range_byte)
12157 (del_range_both, del_range_2, modify_region)
12158 (prepare_to_modify_buffer, signal_before_change)
12159 (signal_after_change, Fcombine_after_change_execute):
12160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12161 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12162 (balance_an_interval, split_interval_right, split_interval_left)
12163 (find_interval, next_interval, update_interval)
12164 (adjust_intervals_for_insertion, delete_node, delete_interval)
12165 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12166 (static_offset_intervals, offset_intervals)
12167 (merge_interval_right, merge_interval_left, make_new_interval)
12168 (graft_intervals_into_buffer, temp_set_point_both)
12169 (temp_set_point, set_point, adjust_for_invis_intang)
12170 (set_point_both, move_if_not_intangible, get_property_and_range)
12171 (get_local_map, copy_intervals, copy_intervals_to_string)
12172 (compare_string_intervals, set_intervals_multibyte_1):
12173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12174 * intervals.h: Adjust decls to match defn changes elsewhere.
12176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12177 * keyboard.c (this_command_key_count, this_single_command_key_start)
12178 (before_command_key_count, before_command_echo_length, echo_now)
12179 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12180 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12181 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12182 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12184 (last_non_minibuf_size, last_point_position, echo_truncate)
12185 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12186 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12187 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12188 (stuff_buffered_input):
12189 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12190 (last_auto_save, command_loop_1, read_char):
12191 Use EMACS_INT, not int, to avoid integer overflow.
12192 (record_char): Avoid overflow in total_keys computation.
12193 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12194 * keyboard.h: Adjust decls to match defn changes elsewhere.
12195 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12196 (Fkey_description, Fdescribe_vector, Flookup_key):
12197 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12198 (click_position): New function, to check that positions are in range.
12199 (Fcurrent_active_maps):
12200 (describe_command):
12201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12202 (Faccessible_keymaps, Fkey_description):
12203 (preferred_sequence_p):
12204 Don't assume fixnum can fit into int.
12205 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12206 Check for integer overflow in size calculations.
12207 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12208 avoid mishandling large integers.
12209 * lisp.h: Adjust decls to match defn changes elsewhere.
12210 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12211 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12212 (struct Lisp_Marker):
12213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12214 (clip_to_bounds): Now an inline function, moved here from editfns.c.
12215 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12216 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12217 All callers changed.
12218 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12219 Assume the arg has valid form, since it always does.
12220 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12221 unsigned integer system type.
12222 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12223 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12225 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12226 (duration_to_sec_usec): New decl.
12227 * lread.c (read_from_string_index, read_from_string_index_byte)
12228 (read_from_string_limit, readchar, unreadchar, openp)
12229 (read_internal_start, read1, oblookup):
12230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12231 (Fload, readevalloop, Feval_buffer, Feval_region):
12232 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12233 (openp): Check for out-of-range argument to 'access'.
12234 (read1): Use int, not EMACS_INT, where int is wide enough.
12235 Don't assume fixnum fits into int.
12236 Fix off-by-one error that can read outside a buffer.
12237 (read_filtered_event): Use duration_to_sec_usec
12238 to do proper overflow checking on durations.
12239 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12240 in size calculation.
12241 (Fexecute_kbd_macro):
12242 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12243 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12244 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12245 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12246 (set_marker_both, set_marker_restricted_both, marker_position)
12247 (marker_byte_position, Fbuffer_has_markers_at):
12248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12249 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12250 * menu.c (ensure_menu_items): Rename from grow_menu_items.
12251 It now merely ensures that the menu is large enough, without
12252 necessarily growing it, as this avoids some integer overflow issues.
12253 All callers changed.
12254 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12256 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12257 Use SAFE_ALLOCA_LISP, not alloca.
12258 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12259 to EMACS_INT. Check that fixnums are in proper range for system types.
12260 * minibuf.c (minibuf_prompt_width, string_to_object)
12261 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12262 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12264 (get_minibuffer, read_minibuf_unwind):
12265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12266 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12267 this simplifies overflow checking. All callers changed.
12268 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12269 (Ftest_completion):
12270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12271 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12272 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12273 Check that fixnums are in proper range for system types.
12274 (Fx_create_frame, Fx_show_tip):
12275 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12276 * nsfont.m (ns_findfonts, nsfont_list_family):
12277 Don't assume fixnum fits in long.
12278 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12280 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12282 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12283 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12284 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12285 (PRINTDECLARE, PRINTPREPARE):
12286 (strout, print_string):
12287 (print, print_preprocess, print_check_string_charset_prop)
12289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12291 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12293 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12294 (printchar, strout): Use xpalloc to catch size calculation overflow.
12295 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12296 (print_error_message): Use SAFE_ALLOCA, not alloca.
12297 (print_object): Use int, not EMACS_INT, where int is wide enough.
12298 (print_depth, new_backquote_output, print_number_index):
12299 Use ptrdiff_t, not int, where int might not be wide enough.
12300 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12301 (Fset_process_window_size, Fformat_network_address)
12302 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
12304 Check that fixnums are in proper range for system types.
12305 (Fsignal_process): Simplify by avoiding a goto.
12306 Check for process-ids out of pid_t range rather than relying on
12307 undefined behavior.
12308 (process_tick, update_tick): Use EMACS_INT, not int.
12309 (Fformat_network_address, read_process_output, send_process)
12310 (Fprocess_send_region, status_notify):
12311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12312 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12313 (wait_reading_process_output, read_process_output, exec_sentinel):
12314 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12315 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12316 (Faccept_process_output): Use duration_to_sec_usec to do proper
12317 overflow checking on durations.
12318 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12319 Don't assume pid_t fits in int.
12320 * process.h (struct Lisp_Process): Members tick and update_tick
12321 are now of type EMACS_INT, not int.
12322 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12323 configured --with-wide-int.
12324 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12325 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12326 * search.c (looking_at_1, string_match_1):
12327 (fast_string_match, fast_c_string_match_ignore_case)
12328 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12329 (scan_newline, find_before_next_newline, search_command)
12330 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12331 (set_search_regs, wordify):
12334 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12335 (string_match_1, search_buffer, set_search_regs):
12337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12338 (wordify): Check for overflow in size calculation.
12339 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12340 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12341 Check that fixnums are in proper range for system types.
12342 * sound.c (struct sound_device)
12343 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12345 (Fplay_sound_internal):
12346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12347 * syntax.c (struct lisp_parse_state, find_start_modiff)
12348 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12349 (Fparse_partial_sexp):
12350 Don't assume fixnums can fit in int.
12351 (struct lisp_parse_state, find_start_pos, find_start_value)
12352 (find_start_value_byte, find_start_begv)
12353 (update_syntax_table, char_quoted, dec_bytepos)
12354 (find_defun_start, prev_char_comend_first, back_comment):
12355 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12356 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12358 (Finternal_describe_syntax_value): Check that match_lisp is a
12359 character, not an integer, since the code stuffs it into int.
12360 (scan_words, scan_sexps_forward):
12361 Check that fixnums are in proper range for system types.
12363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12364 (scan_sexps_forward):
12365 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12366 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12367 * syntax.h: Adjust decls to match defn changes elsewhere.
12368 (struct gl_state_s):
12369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12370 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12371 MOST_POSITIVE_FIXNUM.
12372 * sysdep.c (wait_for_termination_1, wait_for_termination)
12373 (interruptible_wait_for_termination, mkdir):
12374 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12375 (emacs_read, emacs_write):
12376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12377 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12378 and double all fit in int.
12379 * term.c (set_tty_color_mode):
12380 Check that fixnums are in proper range for system types.
12381 * termhooks.h (struct input_event):
12382 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12383 * textprop.c (validate_interval_range, interval_of)
12384 (Fadd_text_properties, set_text_properties_1)
12385 (Fremove_text_properties, Fremove_list_of_text_properties)
12386 (Ftext_property_any, Ftext_property_not_all)
12387 (copy_text_properties, text_property_list, extend_property_ranges)
12388 (verify_interval_modification):
12389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12390 (Fnext_single_char_property_change)
12391 (Fprevious_single_char_property_change):
12392 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12393 (copy_text_properties):
12394 Check for integer overflow in index calculation.
12395 * undo.c (last_boundary_position, record_point, record_insert)
12396 (record_delete, record_marker_adjustment, record_change)
12397 (record_property_change):
12398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12399 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12400 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12401 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12402 (Fx_hide_tip, Fx_file_dialog):
12403 * w32menu.c (set_frame_menubar):
12404 Use ptrdiff_t, not int, for consistency with rest of code.
12405 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12406 (select_window, Fdelete_other_windows_internal)
12407 (window_scroll_pixel_based, window_scroll_line_based)
12408 (Frecenter, Fset_window_configuration):
12409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12410 (Fset_window_hscroll, run_window_configuration_change_hook)
12411 (set_window_buffer, temp_output_buffer_show, scroll_command)
12412 (Fscroll_other_window, Frecenter):
12413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12414 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12415 Don't assume fixnum fits in int.
12416 (Fset_window_scroll_bars):
12417 Check that fixnums are in proper range for system types.
12418 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12419 (string_pos, c_string_pos, number_of_chars, init_iterator)
12420 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12421 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12422 (compute_display_string_end, handle_face_prop)
12423 (face_before_or_after_it_pos, handle_invisible_prop)
12424 (handle_display_prop, handle_display_spec, handle_single_display_spec)
12425 (display_prop_intangible_p, string_buffer_position_lim)
12426 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12427 (get_overlay_strings_1, get_overlay_strings)
12428 (iterate_out_of_display_property, forward_to_next_line_start)
12429 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12430 (get_next_display_element, set_iterator_to_next)
12431 (get_visually_first_element, compute_stop_pos_backwards)
12432 (handle_stop_backwards, next_element_from_buffer)
12433 (move_it_in_display_line_to, move_it_in_display_line)
12434 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12435 (add_to_log, message_dolog, message_log_check_duplicate)
12436 (message2, message2_nolog, message3, message3_nolog
12437 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12438 (current_message_1, truncate_echo_area, truncate_message_1)
12439 (set_message, set_message_1, store_mode_line_noprop)
12440 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12441 (text_outside_line_unchanged_p, check_point_in_composition)
12442 (reconsider_clip_changes)
12443 (redisplay_internal, set_cursor_from_row, try_scrolling)
12444 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12445 (redisplay_window, find_last_unchanged_at_beg_row)
12446 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12447 (trailing_whitespace_p, find_row_edges, display_line)
12448 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12449 (display_mode_element, store_mode_line_string)
12450 (pint2str, pint2hrstr, decode_mode_spec)
12451 (display_count_lines, display_string, draw_glyphs)
12452 (x_produce_glyphs, x_insert_glyphs)
12453 (rows_from_pos_range, mouse_face_from_buffer_pos)
12454 (fast_find_string_pos, mouse_face_from_string_pos)
12455 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12456 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12457 (safe_call, init_from_display_pos, handle_fontified_prop)
12458 (handle_single_display_spec, load_overlay_strings)
12459 (with_echo_area_buffer, setup_echo_area_for_printing)
12460 (display_echo_area, echo_area_display)
12461 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12462 (update_tool_bar, hscroll_window_tree, redisplay_internal)
12463 (redisplay_window, dump_glyph_row, display_mode_line)
12464 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12465 (handle_display_spec, display_prop_string_p):
12466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12467 (handle_single_display_spec, build_desired_tool_bar_string)
12468 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12469 (get_specified_cursor_type):
12470 Check that fixnums are in proper range for system types.
12471 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12472 (Flookup_image_map):
12473 Don't assume fixnums fit in int.
12474 (compare_overlay_entries):
12475 Avoid mishandling comparisons due to subtraction overflow.
12476 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12477 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12478 (handle_tool_bar_click):
12479 Use int, not unsigned, since we prefer signed and the signedness
12480 doesn't matter here.
12481 (get_next_display_element, next_element_from_display_vector):
12482 Use int, not EMACS_INT, when int is wide enough.
12483 (start_hourglass): Use duration_to_sec_usec to do proper
12484 overflow checking on durations.
12485 * xfaces.c (Fbitmap_spec_p):
12486 Check that fixnums are in proper range for system types.
12487 (compare_fonts_by_sort_order):
12488 Avoid mishandling comparisons due to subtraction overflow.
12489 (Fx_family_fonts, realize_basic_faces):
12490 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12492 Don't assume fixnum fits in int.
12493 Use SAFE_ALLOCA_LISP, not alloca.
12494 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12495 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12496 (face_at_buffer_position, face_for_overlay_string)
12497 (face_at_string_position):
12498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12499 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12500 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12502 Check that fixnums are in proper range for system types.
12503 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12504 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12506 (Fx_change_window_property): Don't assume fixnums fit in int.
12507 * xfont.c (xfont_chars_supported):
12508 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12509 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12510 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12512 * xml.c (parse_region):
12513 * xrdb.c (magic_file_p):
12514 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12515 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12516 (x_get_local_selection, x_reply_selection_request)
12517 (x_handle_selection_request, wait_for_property_change):
12518 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12519 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12520 short is wide enough.
12521 (x_send_client_event): Don't assume fixnum fits in int.
12522 * xterm.c (x_x_to_emacs_modifiers):
12523 Don't assume EMACS_INT overflows nicely into int.
12524 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12525 may come from Lisp.
12526 (handle_one_xevent): NATNUMP can eval its arg twice.
12527 (x_connection_closed):
12528 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12529 * xterm.h: Adjust decls to match defn changes elsewhere.
12530 (struct scroll_bar): Use struct vectorlike_header
12531 rather than rolling our own approximation.
12532 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12534 2012-05-25 Glenn Morris <rgm@gnu.org>
12536 * lisp.mk (lisp): Update for more files being compiled now.
12538 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12540 * lread.c: Remove `read_pure' which makes no difference.
12541 (read_pure): Remove var.
12542 (unreadpure): Remove function.
12543 (readevalloop): Don't call read_list with -1 flag.
12544 (read1, read_vector): Don't test read_pure any more.
12545 (read_list): Simplify.
12547 * fileio.c, character.h: Minor style tweaks.
12549 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12551 * window.h (clip_changed): Remove useless declaration.
12553 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
12555 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12556 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12558 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12561 This directory predates autoconf and is no longer needed nowadays.
12562 Move its few remaining bits of functionality to where they're needed.
12563 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12564 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12565 * m/template.h: Remove.
12566 * Makefile.in (M_FILE): Remove. All uses removed.
12567 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12568 * lisp.h (USE_LSB_TAG):
12569 * mem-limits.h (EXCEEDS_LISP_PTR):
12570 Use VAL_MAX, not VALBITS, in #if.
12571 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12572 (EMACS_UINT): Define unconditionally now.
12573 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12574 (BITS_PER_EMACS_INT): New constants, replacing
12575 what used to be in config.h, but not useful in #if.
12576 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12577 define them any more.
12578 (VAL_MAX): New macro.
12580 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12581 BITS_PER_EMACS_INT, in #if.
12582 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12583 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12584 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12585 * s/ms-w32.h (DATA_START):
12586 Move here from removed file m/intel386.h.
12587 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12588 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12590 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12592 Assume C89 or later.
12593 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12594 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12596 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12597 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12598 * textprop.c, tparam.c (NULL): Remove.
12599 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12600 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12601 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12602 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12603 * xterm.c (input_signal_count): Assume volatile works.
12605 2012-05-21 Ken Brown <kbrown@cornell.edu>
12607 * xgselect.c (xg_select): Fix first argument in call to 'select'
12610 2012-05-20 Ken Brown <kbrown@cornell.edu>
12612 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
12613 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
12615 2012-05-19 Ken Brown <kbrown@cornell.edu>
12617 * xfns.c (x_in_use): Remove `static' qualifier.
12618 * xterm.h (x_in_use): Declare.
12619 * xgselect.c: Include xterm.h.
12620 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12621 and `display_arg' (bug#9754).
12623 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12625 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12627 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12628 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12630 2012-05-18 Eli Zaretskii <eliz@gnu.org>
12632 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12634 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
12635 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
12637 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12638 reference to image_cache->refcount.
12639 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12641 2012-05-17 Juri Linkov <juri@jurta.org>
12643 * search.c (Fword_search_regexp, Fword_search_backward)
12644 (Fword_search_forward, Fword_search_backward_lax)
12645 (Fword_search_forward_lax): Move functions to isearch.el
12646 (bug#10145, bug#11381).
12648 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12650 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12652 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12654 * lread.c (init_obarray): Declare Qt and Qnil as special.
12656 2012-05-14 Glenn Morris <rgm@gnu.org>
12658 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12659 Put "libexec" before "bin", for the sake of init_callproc_1.
12661 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12663 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12665 * unexaix.c: Port to more-recent AIX compilers.
12666 (report_error, report_error_1, make_hdr, copy_sym)
12667 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12668 Make arguments const char *, not char *, to avoid violations of C
12669 standard and to fix some AIX warnings reported by Gilles Pion.
12671 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12673 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12674 already have overlays loaded.
12675 (handle_single_display_spec): Before returning without displaying
12676 fringe bitmap, synchronize the bidi iterator with the main display
12677 iterator, by calling iterate_out_of_display_property.
12678 (iterate_out_of_display_property): Detect buffer iteration by
12679 testing that it->string is a Lisp string.
12680 (get_next_display_element): When the current object is exhausted,
12681 and there's something on it->stack, call set_iterator_to_next to
12682 proceed with what's on the stack, instead of returning zero.
12683 (set_iterator_to_next): If called at the end of a Lisp string,
12684 proceed to consider_string_end without incrementing string
12685 position. Don't increment display vector index past the end of
12686 the display vector. (Bug#11417)
12687 (pos_visible_p): Don't report a position visible when move_it_to
12688 stopped at the last line of window, which happens to be scanned
12689 backwards by the bidi iteration. (Bug#11464)
12691 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12693 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12694 and right-margin display specs even if the spec is invalid or we
12695 are on a TTY, and thus unable to display on the fringes.
12696 That's because the text with the property will not be displayed anyway,
12697 so we need to signal to the caller that this is a "replacing"
12698 display spec. This fixes display when the spec is invalid or we
12701 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12703 * unexaix.c (make_hdr): Fix typo in prototype.
12704 This bug broke the build on AIX. Problem reported by Gilles Pion.
12706 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
12708 * keyboard.c (kbd_buffer_get_event): Read special events also in
12709 batch mode. (Bug#11415)
12711 2012-05-12 Glenn Morris <rgm@gnu.org>
12713 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12715 2012-05-12 Eli Zaretskii <eliz@gnu.org>
12717 * lisp.mk (lisp): Add newcomment.elc.
12719 2012-05-12 Glenn Morris <rgm@gnu.org>
12721 * Makefile.in (MKDIR_P): New, set by configure.
12722 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12724 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12726 Remove unused function hourglass_started.
12727 * dispextern.h (hourglass_started):
12728 * w32fns.c (hourglass_started):
12729 * xdisp.c (hourglass_started): Remove.
12731 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
12733 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12734 Update dependencies.
12736 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12738 * xgselect.c (xg_select): Put maxfds+1 into a var.
12739 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12741 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12743 2012-05-10 Dave Abrahams <dave@boostpro.com>
12745 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12746 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12748 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
12750 * dbusbind.c (xd_registered_buses): New internal Lisp object.
12751 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
12752 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12753 Initialize xd_registered_buses.
12755 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12757 Untag more efficiently if USE_LSB_TAG.
12758 This is based on a proposal by YAMAMOTO Mitsuharu in
12759 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12760 For an admittedly artificial (nth 8000 longlist) benchmark on
12761 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12762 Emacs's overall text size by 1%.
12763 * lisp.h (XUNTAG): New macro.
12764 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12765 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12766 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12767 * eval.c (Fautoload):
12768 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12769 * frame.h (XFRAME): Use XUNTAG.
12771 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12772 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12773 Remove unportable assumptions about print widths of types like
12775 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12776 intptr_t when converting between pointer and integer, to avoid GCC
12777 warnings about wrong width.
12779 2012-05-09 Eli Zaretskii <eliz@gnu.org>
12781 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12782 stack for each reader_thread, instead of defaulting to 8MB
12783 determined by the linker. This avoids failures in creating
12784 subprocesses on Windows 7, see the discussion in this thread:
12785 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12787 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12789 Fix up display of the *Minibuf-0* buffer in the mini window.
12790 * keyboard.c (read_char): Don't clear the echo area if there's no
12792 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
12793 contents of *Minibuf-0*) if there's no message displayed in its stead.
12795 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
12797 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12800 2012-05-06 Chong Yidong <cyd@gnu.org>
12802 * lisp.mk (lisp): Update.
12804 2012-05-05 Jim Meyering <meyering@redhat.com>
12806 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12808 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12810 * data.c (PUT_ERROR): New macro.
12811 (syms_of_data): Use it. Add new error type `user-error'.
12812 * undo.c (user_error): New function.
12813 (Fprimitive_undo): Use it.
12814 * print.c (print_error_message): Adjust print style for `user-error'.
12815 * keyboard.c (user_error): New function.
12816 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12818 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12820 Do not limit current-time-string to years 1000..9999.
12821 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12822 (Fcurrent_time_string): Support any year that is supported by the
12823 underlying localtime representation. Don't use asctime, as it
12824 has undefined behavior for years outside the range -999..9999.
12826 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12828 Fix race conditions involving setenv, gmtime, localtime, asctime.
12829 Without this fix, interrupts could mess up code that uses these
12830 nonreentrant functions, since setting TZ invalidates existing
12831 tm_zone or tzname values, and since most of these functions return
12832 pointers to static storage.
12833 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12834 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12835 Grow the critical sections to include not just invoking
12836 localtime/gmtime, but also accessing these functions' results
12837 including their tm_zone values if any, and any related TZ setting.
12838 (format_time_string): Last arg is now struct tm *, not struct tm **,
12839 so that the struct tm is saved in the critical section.
12840 All callers changed. Simplify allocation of initial buffer, partly
12841 motivated by the fact that memory allocation needs to be outside
12842 the critical section.
12844 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12846 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12847 with RESET_INTERVAL.
12849 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12850 Remove duplicated buffer name initialization.
12852 2012-05-02 Jim Meyering <jim@meyering.net>
12854 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12856 * xfns.c (x_window): Use xstrdup (Bug#11375).
12858 2012-05-02 Eli Zaretskii <eliz@gnu.org>
12860 * xdisp.c (pos_visible_p): If already at a newline from the
12861 display string before the 'while' loop, don't walk back the glyphs
12862 from it3.glyph_row. Solves assertion violation when the display
12863 string begins with a newline (egg.el). (Bug#11367)
12865 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12867 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12870 2012-05-01 Glenn Morris <rgm@gnu.org>
12872 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12873 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12874 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12875 All were removed before 23.1.
12877 * dispnew.c: Remove HAVE_LIBNCURSES test;
12878 it is always true on relevant platforms.
12880 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12881 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12883 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12885 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12887 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12888 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12891 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12893 Do not avoid creating empty evaporating overlays (Bug#9642).
12894 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12895 That is, do not delete an evaporating overlay if it becomes
12896 empty after its bounds are adjusted to fit within its buffer.
12897 This fix caused other problems, and I'm reverting it until we get
12898 to the bottom of them.
12900 2012-04-27 Chong Yidong <cyd@gnu.org>
12902 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12904 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12906 * xdisp.c (pos_visible_p): If the window start position is beyond
12907 ZV, start the display from buffer beginning. Prevents assertion
12908 violation in init_iterator when the minibuffer window is scrolled
12909 via the scroll bar.
12911 * window.c (window_scroll_pixel_based): Likewise.
12913 2012-04-27 Chong Yidong <cyd@gnu.org>
12915 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12917 2012-04-27 Glenn Morris <rgm@gnu.org>
12919 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12920 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12922 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12924 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12925 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
12927 2012-04-26 Eli Zaretskii <eliz@gnu.org>
12929 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12930 display element, check also the underlying string or buffer
12931 character. (Bug#11341)
12933 * w32menu.c: Include w32heap.h.
12934 (add_menu_item): If the call to AppendMenuW (via
12935 unicode_append_menu) fails, disable Unicode menus only if we are
12936 running on Windows 9X/Me.
12938 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12940 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12941 (xgetint): Add missing shift for LSB tags.
12943 2012-04-24 Martin Rudalics <rudalics@gmx.at>
12945 * keyboard.c (read_char): Don't wipe echo area for select window
12946 events: These might get delayed via `mouse-autoselect-window'
12949 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
12951 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12952 manipulation of :loaded-from data.
12954 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
12956 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12957 now a cons (bug#11311).
12959 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12961 Do not create empty overlays with the evaporate property (Bug#9642).
12962 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12963 if it becomes empty after its bounds are adjusted to fit within
12964 its buffer. Without this fix, in a nonempty buffer (let ((o
12965 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12966 yields an empty overlay that has the evaporate property, which is
12967 not supposed to happen.
12969 Fix minor GTK3 problems found by static checking.
12970 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12971 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12972 (struct _EmacsFixedClass, emacs_fixed_get_type):
12973 Move decls here from emacsgtkfixed.h, since they needn't be public.
12974 (emacs_fixed_get_type): Now static.
12975 (emacs_fixed_class_init): Omit unused local.
12976 (emacs_fixed_child_type): Remove; unused.
12977 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12978 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12979 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12980 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12981 (EMACS_FIXED_GET_CLASS): Remove; unused.
12982 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12984 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12985 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12987 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12989 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
12990 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
12991 (__malloc_size_t, __malloc_ptrdiff_t):
12992 Remove. All uses removed, replaced by the definiens if needed,
12993 since we can assume C89 or better now.
12994 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12995 (protect_malloc_state, align, get_contiguous_space)
12996 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12997 (malloc_atfork_handler_child, malloc_enable_thread)
12998 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12999 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13000 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13001 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13002 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13003 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13004 Define using prototypes, not old style.
13005 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13006 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13007 (align): Don't assume that signed integer overflow wraps around.
13008 Omit unused local var.
13009 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13010 (_free_internal_nolock, memalign, mallochook, reallochook):
13011 Omit no-longer-needed casts.
13012 (valloc): Use getpagesize, not __getpagesize.
13013 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13014 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13016 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13018 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13020 Move functions from C to Lisp. Make non-blocking method calls
13021 the default. Implement further D-Bus standard interfaces.
13023 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13024 (QCdbus_request_name_allow_replacement)
13025 (QCdbus_request_name_replace_existing)
13026 (QCdbus_request_name_do_not_queue)
13027 (QCdbus_request_name_reply_primary_owner)
13028 (QCdbus_request_name_reply_in_queue)
13029 (QCdbus_request_name_reply_exists)
13030 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13031 (QCdbus_registered_serial, QCdbus_registered_method)
13032 (QCdbus_registered_signal): New Lisp objects.
13033 (XD_DEBUG_MESSAGE): Use sizeof.
13034 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13035 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13036 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13037 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13038 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13039 (xd_signature, xd_append_arg): Allow float for integer types.
13040 (xd_get_connection_references): New function.
13041 (xd_get_connection_address): Rename from xd_initialize.
13042 Return cached address.
13043 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13044 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13046 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13047 Return number of refcounts.
13048 (Fdbus_get_unique_name): Make stronger parameter check.
13049 (Fdbus_message_internal): New defun.
13050 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13051 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13052 (Fdbus_send_signal, Fdbus_register_service)
13053 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13054 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13055 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13056 (Vdbus_compiled_version, Vdbus_runtime_version)
13057 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13058 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13059 (Vdbus_message_type_signal): New defvars.
13060 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13063 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13065 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13066 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13067 Do not assume ptrdiff_t is the same width as 'int'.
13069 * alloc.c: Handle unusual debugging option combinations.
13070 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13071 since the two debugging options are incompatible.
13072 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13074 (mem_init, mem_insert, mem_insert_fixup):
13075 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13076 (NEED_MEM_INSERT): Remove; no longer needed.
13078 2012-04-22 Leo Liu <sdl.web@gmail.com>
13080 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13082 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13084 * sysdep.c [__FreeBSD__]: Minor cleanups.
13085 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13086 Use Emacs indenting style more consistently. Avoid some casts.
13087 Use 'double' consistently rather than mixing 'float' and 'double'.
13089 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13091 * sysdep.c (list_system_processes, system_process_attributes):
13092 Add implementation for FreeBSD (Bug#5243).
13094 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13096 * lisp.mk (lisp): Update.
13098 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13100 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13101 It is never used otherwise.
13103 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13105 * print.c (print_preprocess): Only check print_depth if print-circle
13107 (print_object): Check for cycles even when print-circle is nil and
13108 print-gensym is t, but only check print_depth if print-circle is nil.
13110 2012-04-20 Chong Yidong <cyd@gnu.org>
13112 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13113 set the status to "failed" and ensure that sentinel is run.
13115 2012-04-20 Glenn Morris <rgm@gnu.org>
13117 * process.c (Fset_process_inherit_coding_system_flag)
13118 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13119 (Fmake_network_process, Fmake_serial_process): Doc fix.
13121 2012-04-20 Eli Zaretskii <eliz@gnu.org>
13123 * xdisp.c (string_buffer_position_lim): Limit starting position to
13125 (set_cursor_from_row): If called for a mode-line or header-line
13126 row, return zero immediately.
13127 (try_cursor_movement): If inside continuation line, don't back up
13128 farther than the first row after the header line, if any.
13129 Don't consider the header-line row as "partially visible", even if
13130 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13132 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13134 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13137 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
13138 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
13140 configure: new option --enable-gcc-warnings (Bug#11207)
13141 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13142 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13143 (ALL_CFLAGS): Use new macros rather than old.
13144 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13145 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13146 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13147 -Wunused-result, -Wunused-variable. This should go away once
13148 the Emacs and Gnulib regex code is merged.
13149 (xmalloc, xrealloc): Now static.
13151 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13153 * dired.c (Fsystem_groups): Remove unused local.
13155 2012-04-17 Glenn Morris <rgm@gnu.org>
13157 * dired.c (Fsystem_users): Doc fix.
13159 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13161 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13162 (syms_of_dired): Add them.
13164 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13166 Fix minor alloc.c problems found by static checking.
13167 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13168 New extern decls, to avoid calling undeclared functions.
13169 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13170 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13171 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13172 (NEED_MEM_INSERT): New macro.
13173 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13174 Remove one incorrect comment and fix another.
13176 Fix minor ralloc.c problems found by static checking.
13177 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13178 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13179 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13180 (r_alloc_sbrk): Now static.
13182 Improve ralloc.c interface checking.
13183 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13184 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13185 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13186 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13187 [REL_ALLOC]: ... to here, to check interface.
13188 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13189 Remove decls. This fixes an "It stinks!".
13191 * alloc.c (which_symbols): Fix alignment issue / type clash.
13193 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13195 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13196 (struct Lisp_Misc_Any): Likewise.
13197 (struct Lisp_Free): Likewise.
13198 * alloc.c (union aligned_Lisp_Symbol): Define.
13199 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13200 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13201 (union aligned_Lisp_Misc): Define.
13202 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13203 aligned_Lisp_Misc instead of union Lisp_Misc.
13204 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13206 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13208 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13209 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13210 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13211 * s/netbsd.h, s/sol2-6.h:
13212 Remove definition of GC_MARK_STACK, since the default now works.
13213 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13214 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13215 no longer the default.
13216 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13218 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13220 * lread.c (lisp_file_lexically_bound_p):
13221 Fix hang at ";-*-\n" (bug#11238).
13223 2012-04-14 Eli Zaretskii <eliz@gnu.org>
13225 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13226 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13228 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13230 * nsterm.m (constrainFrameRect): Always constrain when there is only
13231 one screen (Bug#10962).
13233 2012-04-13 Ken Brown <kbrown@cornell.edu>
13235 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13237 2012-04-13 Reuben Thomas <rrt@sc3d.org>
13239 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13241 2012-04-11 Daniel Colascione <dancol@dancol.org>
13243 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13244 against is gone. It's better to use vfork now so that when Cygwin
13245 gains a new, working vfork, we use it automatically (bug#10398).
13247 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13249 * window.c (save_window_save): Obey window-point-insertion-type.
13251 2012-04-11 Glenn Morris <rgm@gnu.org>
13253 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13255 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13257 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13259 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
13261 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13262 (force_quit_count): New var.
13263 (handle_interrupt): Use it.
13265 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
13267 * w32.c (w32_delayed_load): Record the full path of the library
13268 being loaded (bug#10424).
13270 2012-04-09 Glenn Morris <rgm@gnu.org>
13272 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13273 not just in the obarray, before snarfing them. (Bug#11036)
13275 * Makefile.in ($(leimdir)/leim-list.el):
13276 Pass EMACS rather than BUILT_EMACS.
13278 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13280 * process.c (make_process):
13281 * process.h: Add integer `gnutls_handshakes_tried' member to
13284 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13285 Add convenience `GNUTLS_LOG2i' macro.
13287 * gnutls.c (gnutls_log_function2i): Convenience log function.
13288 (emacs_gnutls_read): Use new log functions,
13289 `gnutls_handshakes_tried' process member, and
13290 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13291 attempts per process (connection).
13293 2012-04-09 Chong Yidong <cyd@gnu.org>
13295 * eval.c (Fuser_variable_p, user_variable_p_eh)
13296 (lisp_indirect_variable): Functions deleted.
13297 (Fdefvar): Caller changed.
13299 * callint.c (Finteractive, Fcall_interactively):
13300 * minibuf.c (Fread_variable): Callers changed.
13302 2012-04-09 Eli Zaretskii <eliz@gnu.org>
13304 * xdisp.c (set_cursor_from_row): If the display string appears in
13305 the buffer at position that is closer to point than the position
13306 after the display string, display the cursor on the first glyph of
13307 the display string. Fixes cursor display when a 'display' text
13308 property immediately follows invisible text. (Bug#11094)
13310 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13312 composite.c: use 'double' consistently
13313 * composite.c (get_composition_id): Use 'double' consistently
13314 instead of converting 'float' to 'double' and vice versa; this is
13315 easier to understand and avoids a GCC warning.
13317 2012-04-09 Glenn Morris <rgm@gnu.org>
13319 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13320 preparation for dumping it with emacs. (Bug#4789)
13321 (leimdir): New variable.
13322 ($(leimdir)/leim-list.el): New rule.
13323 (emacs$(EXEEXT)): Depend on leim-list.el.
13325 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13326 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13327 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13329 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13331 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13334 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
13336 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13337 Remove unused local variable.
13339 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13341 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13342 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13343 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13344 objects, as mark_maybe_pointer will catch them otherwise.
13345 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13346 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13348 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13350 Fix typo that broke non-Windows builds.
13351 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13353 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13355 Support building on MS-Windows with libxml2.
13357 * makefile.w32-in (OBJ2): Add xml.$(O).
13358 (GLOBAL_SOURCES): Add xml.c.
13359 ($(BLD)/xml.$(O)): New dependency list.
13361 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13362 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13363 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13364 [!WINDOWSNT]: New macros.
13365 (init_libxml2_functions, libxml2_loaded_p): New functions.
13366 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13367 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13368 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13369 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13371 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13372 Call init_libxml2_functions before calling libxml2 functions.
13373 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13375 * emacs.c: Don't include libxml/parser.h.
13376 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13377 xmlCleanupParser directly.
13379 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13381 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13383 * indent.c (Fvertical_motion): If there is a display string at
13384 point, use it.vpos to compute how many lines to backtrack after
13385 move_it_to point. (Bug#11133)
13387 2012-04-06 Eli Zaretskii <eliz@gnu.org>
13389 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13390 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13391 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13392 macros related to unification of CJK characters. For the details,
13393 see the discussion following the message here:
13394 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13396 2012-04-04 Chong Yidong <cyd@gnu.org>
13398 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13400 2012-04-01 Eli Zaretskii <eliz@gnu.org>
13402 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13403 instead of alloca. (Bug#11138)
13405 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13407 * w32menu.c (is_simple_dialog): Properly check lisp types.
13410 2012-03-31 Eli Zaretskii <eliz@gnu.org>
13412 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13413 position we get to after a call to move_it_to fails the
13414 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13415 only if we wind up in a string from display property. (Bug#11063)
13417 * window.c (Fdelete_other_windows_internal): Invalidate the row
13418 and column information about mouse highlight, so that redisplay
13419 restores it after reallocating the glyph matrices. (Bug#7464)
13421 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13422 string comes from a `display' text property, use the buffer
13423 position of that property as if we actually saw that position in
13425 (move_it_by_lines): Remove the assertion that
13426 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13427 violated when there's a before-string at the beginning of a line.
13430 2012-03-30 Eli Zaretskii <eliz@gnu.org>
13432 * xdisp.c (append_space_for_newline): If the default face was
13433 remapped, use the remapped face for the appended newline.
13434 (extend_face_to_end_of_line): Use the remapped default face for
13435 extending the face to the end of the line.
13436 (display_line): Call extend_face_to_end_of_line when the default
13437 face was remapped. (Bug#11068)
13439 2012-03-29 Eli Zaretskii <eliz@gnu.org>
13441 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13443 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13445 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13447 2012-03-27 Glenn Morris <rgm@gnu.org>
13449 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13452 2012-03-26 Kenichi Handa <handa@m17n.org>
13454 * dispextern.h (struct glyph): Fix previous change. Change the
13455 bit length of glyphless.ch to 25 (Bug#11082).
13457 2012-03-26 Chong Yidong <cyd@gnu.org>
13459 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13460 (command_loop_1): Use it; inhibit selection update for
13461 handle-select-window too (Bug#8996).
13463 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13465 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13467 2012-03-25 Kenichi Handa <handa@m17n.org>
13469 * dispextern.h (struct glyph): Change the bit length of
13470 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13472 2012-03-24 Eli Zaretskii <eliz@gnu.org>
13474 * s/ms-w32.h (tzname): Include time.h before redirecting to
13475 _tzname. Fixes the MSVC build. (Bug#9960)
13477 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13479 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13482 * xterm.c (XTread_socket): Only modify handling_signal if
13483 !SYNC_INPUT. (Bug#11080)
13485 2012-03-23 Eli Zaretskii <eliz@gnu.org>
13487 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13488 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13489 when fetching a multibyte character consumes more bytes than
13490 CHAR_BYTES returns, due to unification of CJK characters in
13491 string_char. (Bug#11073)
13493 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13495 * process.c (wait_reading_process_output): Handle pty disconnect
13496 by refraining from sending oneself a SIGCHLD (bug#10933).
13498 2012-03-22 Chong Yidong <cyd@gnu.org>
13500 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13502 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13503 Mark string as coming from a prefix property.
13504 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13505 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13507 2012-03-21 Chong Yidong <cyd@gnu.org>
13509 * xfaces.c (Vface_remapping_alist): Doc fix.
13511 2012-03-20 Eli Zaretskii <eliz@gnu.org>
13513 * w32proc.c (Fw32_set_console_codepage)
13514 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13517 2012-03-20 Chong Yidong <cyd@gnu.org>
13519 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13520 to reflect default non-nil value of redisplay-dont-pause.
13522 2012-03-19 Kenichi Handa <handa@m17n.org>
13524 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13525 it fit in a valid range (Bug#11003).
13527 2012-03-18 Eli Zaretskii <eliz@gnu.org>
13529 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13530 that is not from display property, accept the row as a "cursor
13531 row" if one of the string's character has a non-nil `cursor'
13532 property. Fixes cursor positioning when there are newlines in
13533 overlay strings, e.g. in icomplete.el. (Bug#11035)
13535 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13537 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13539 2012-03-12 Chong Yidong <cyd@gnu.org>
13541 * eval.c (inhibit_lisp_code): Rename from
13542 inhibit_window_configuration_change_hook; move from window.c.
13544 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13545 * window.c (run_window_configuration_change_hook)
13546 (syms_of_window): Callers changed.
13548 2012-03-11 Chong Yidong <cyd@gnu.org>
13550 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13552 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13554 2012-03-10 Chong Yidong <cyd@gnu.org>
13556 * frame.c (other_visible_frames): Don't assume the selected frame
13557 is visible (Bug#10955).
13559 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13561 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13563 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13565 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13566 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13569 2012-03-03 Glenn Morris <rgm@gnu.org>
13571 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13573 2012-03-02 Eli Zaretskii <eliz@gnu.org>
13575 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13576 position past the first glyph_row that ends at ZV. (Bug#10902)
13577 (redisplay_window, next_element_from_string): Fix typos in
13579 (redisplay_window): Pass to move_it_vertically the margin in
13580 pixels, not in screen lines.
13582 2012-03-02 Glenn Morris <rgm@gnu.org>
13584 * buffer.c (buffer-list-update-hook): Doc fix.
13586 2012-02-29 Eli Zaretskii <eliz@gnu.org>
13588 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13589 push_it before setting up the iterator for the first overlay
13590 string, even if we have an empty string loaded.
13591 (next_overlay_string): If there's an empty string on the iterator
13592 stack, pop the stack. (Bug#10903)
13594 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13596 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13597 Suggested by Stefan Monnier in
13598 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13599 * alloc.c (widen_to_Lisp_Object): New static function.
13600 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13601 and widening them to Lisp_Objects. This would work even if
13602 USE_LSB_TAG is defined and wide integers are used, which might
13603 happen in a future version of Emacs.
13605 2012-02-25 Chong Yidong <cyd@gnu.org>
13607 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13610 * xselect.c (Fx_selection_exists_p): Doc fix.
13611 (x_clipboard_manager_save_all): Print an informative message
13612 before saving to clipboard manager.
13614 2012-02-24 Chong Yidong <cyd@gnu.org>
13616 * keyboard.c (process_special_events): Handle all X selection
13617 requests in kbd_buffer, not just the next one (Bug#8869).
13619 2012-02-23 Chong Yidong <cyd@gnu.org>
13621 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13622 call when setting menu-bar-lines and tool-bar-lines parameters.
13623 (unwind_create_frame_1): New helper function.
13625 * window.c (inhibit_window_configuration_change_hook): New var.
13626 (run_window_configuration_change_hook): Obey it.
13627 (syms_of_window): Initialize it.
13629 2012-02-22 Chong Yidong <cyd@gnu.org>
13631 * xterm.c (x_draw_image_relief): Add missing type check for
13632 Vtool_bar_button_margin (Bug#10743).
13634 2012-02-21 Chong Yidong <cyd@gnu.org>
13636 * fileio.c (Vfile_name_handler_alist): Doc fix.
13638 * buffer.c (Fget_file_buffer): Protect against invalid file
13639 handler return value.
13641 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13643 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13644 when computing $valmask.
13646 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13647 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13648 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13649 It's useless in that case, and it can cause problems on hosts
13650 that allocate halves of EMACS_INT values separately.
13651 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13652 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13653 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13654 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13655 it avoids undefined behavior on hosts where shifting right by more
13656 than the word width has undefined behavior.
13658 2012-02-19 Chong Yidong <cyd@gnu.org>
13660 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13661 (Funhandled_file_name_directory, Ffile_name_as_directory)
13662 (Fdirectory_file_name, Fexpand_file_name)
13663 (Fsubstitute_in_file_name): Protect against invalid file handler
13664 return values (Bug#10845).
13666 2012-02-18 Eli Zaretskii <eliz@gnu.org>
13668 * .gdbinit (pitx): Fix incorrect references to fields of the
13671 2012-02-17 Chong Yidong <cyd@gnu.org>
13673 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13675 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13677 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13678 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13680 2012-02-15 Chong Yidong <cyd@gnu.org>
13682 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13683 marked as special. Also, starting docstrings with * is obsolete.
13685 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13687 * gnutls.c (emacs_gnutls_write): Fix last change.
13689 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13691 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13694 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13696 * keymap.c (Fsingle_key_description): Handle char ranges.
13698 2012-02-12 Chong Yidong <cyd@gnu.org>
13700 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13701 as that creates a dangerous corner case.
13703 * window.c (Fdelete_window_internal): Invalidate the mouse
13704 highlight (Bug#9904).
13706 2012-02-12 Glenn Morris <rgm@gnu.org>
13708 * xselect.c (Fx_own_selection_internal)
13709 (Fx_get_selection_internal, Fx_disown_selection_internal)
13710 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13711 * nsselect.m (Fx_own_selection_internal)
13712 (Fx_disown_selection_internal, Fx_selection_exists_p)
13713 (Fx_selection_owner_p, Fx_get_selection_internal):
13714 Sync docs and argument specs with the xselect.c versions.
13716 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13718 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13720 2012-02-11 Eli Zaretskii <eliz@gnu.org>
13722 * w32select.c (Fx_selection_exists_p): Sync doc string and
13723 argument list with xselect.c. (Bug#10783)
13725 * w16select.c (Fx_selection_exists_p): Sync doc string and
13726 argument list with xselect.c. (Bug#10783)
13728 2012-02-10 Glenn Morris <rgm@gnu.org>
13730 * fns.c (Fsecure_hash): Doc fix.
13732 2012-02-09 Kenichi Handa <handa@m17n.org>
13734 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13736 2012-02-07 Chong Yidong <cyd@gnu.org>
13738 * buffer.c (Fbuffer_local_variables)
13739 (buffer_lisp_local_variables): Handle unbound vars correctly;
13740 don't let Qunbound leak into Lisp.
13742 2012-02-07 Glenn Morris <rgm@gnu.org>
13744 * image.c (Fimagemagick_types): Doc fix.
13746 * image.c (imagemagick-render-type): Change it from a lisp object
13747 to an integer. Move the doc here from the lisp manual.
13748 Treat all values not equal to 0 the same.
13750 2012-02-06 Chong Yidong <cyd@gnu.org>
13752 * doc.c (store_function_docstring): Avoid applying docstring of
13753 alias to base function (Bug#2603).
13755 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13757 * .gdbinit (pp1, pv1): Remove redundant defines.
13760 2012-02-04 Chong Yidong <cyd@gnu.org>
13762 * nsterm.m: Declare a global (Bug#10694).
13764 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13766 * w32.c (get_emacs_configuration_options):
13767 Include --enable-checking, if specified, in the return value.
13769 2012-02-04 Martin Rudalics <rudalics@gmx.at>
13771 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13772 after rounding frame sizes. (Bug#9723)
13774 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13776 * keyboard.c (adjust_point_for_property): Don't position point
13777 before BEGV. (Bug#10696)
13779 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13781 Handle overflow when computing char display width (Bug#9496).
13782 * character.c (char_width): Return EMACS_INT, not int.
13783 (char_width, c_string_width): Check for overflow when
13784 computing the width; this is possible now that individual
13785 characters can have unbounded width. Problem introduced
13786 by merge from Emacs 23 on 2012-01-19.
13788 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
13790 * dbusbind.c (Fdbus_register_method): Mention the return value
13791 :ignore in the docstring.
13793 2012-02-02 Glenn Morris <rgm@gnu.org>
13795 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13797 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13798 Unconditionally set to t. (Bug#10673)
13799 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13800 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13801 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13803 2012-02-02 Kenichi Handa <handa@m17n.org>
13805 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13806 0, do not call append_composite_glyph.
13808 2012-02-02 Kenichi Handa <handa@m17n.org>
13810 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13812 (x_produce_glyphs): If the component of a composition is a null
13813 string, set it->pixel_width to 1 to avoid zero-width glyph.
13815 2012-02-01 Eli Zaretskii <eliz@gnu.org>
13817 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13818 first 2 arguments are identical. This makes inserting large
13819 output from a subprocess an order of magnitude faster on
13820 MS-Windows, where all sbrk'ed memory is always contiguous.
13822 2012-01-31 Glenn Morris <rgm@gnu.org>
13824 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13825 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13826 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13828 2012-01-29 Glenn Morris <rgm@gnu.org>
13830 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13832 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13834 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13836 2012-01-28 Chong Yidong <cyd@gnu.org>
13838 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13840 2012-01-26 Chong Yidong <cyd@gnu.org>
13842 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13844 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13845 repeat counts (Bug#10507).
13847 2012-01-26 Glenn Morris <rgm@gnu.org>
13849 * lread.c (syms_of_lread): Doc fix.
13851 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13853 * coding.c (encode_designation_at_bol): Change return value to
13856 2012-01-25 Chong Yidong <cyd@gnu.org>
13858 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13860 2012-01-21 Chong Yidong <cyd@gnu.org>
13862 * floatfns.c (Fcopysign): Make the second argument non-optional,
13863 since nil is not allowed anyway.
13865 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13867 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13868 (send_process): Likewise.
13870 2012-01-19 Martin Rudalics <rudalics@gmx.at>
13872 * window.c (save_window_save, Fcurrent_window_configuration)
13873 (Vwindow_persistent_parameters): Do not use Qstate.
13874 Rewrite doc-strings.
13876 2012-01-19 Kenichi Handa <handa@m17n.org>
13878 * character.c (char_width): New function.
13879 (Fchar_width, c_string_width, lisp_string_width):
13880 Use char_width (Bug#9496).
13882 2012-01-16 Martin Rudalics <rudalics@gmx.at>
13884 * window.c (Vwindow_persistent_parameters): New variable.
13885 (Fset_window_configuration, save_window_save): Handle persistent
13888 2012-01-14 Eli Zaretskii <eliz@gnu.org>
13890 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13891 thrashing the stack of the thread. (Bug#9087)
13893 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13895 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13897 2012-01-11 Eli Zaretskii <eliz@gnu.org>
13899 * xdisp.c (rows_from_pos_range): Handle the case where the
13900 highlight ends on a newline. (Bug#10464)
13901 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13902 he end column for display of highlight that ends on a newline
13905 2012-01-11 Glenn Morris <rgm@gnu.org>
13907 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13908 from load-path also when installation-directory is nil. (Bug#10208)
13910 2012-01-10 Glenn Morris <rgm@gnu.org>
13912 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13914 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13915 Update template values to be closer to their typical values these days.
13917 2012-01-09 Eli Zaretskii <eliz@gnu.org>
13919 * xdisp.c (rows_from_pos_range): Accept additional argument
13920 DISP_STRING, and accept any glyph in a row whose object is that
13921 string as eligible for mouse highlight. Fixes mouse highlight of
13922 display strings from overlays. (Bug#10464)
13924 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
13926 emacs: fix an auto-save permissions race condition (Bug#10400)
13927 * fileio.c (auto_saving_dir_umask): New static var.
13928 (Fmake_directory_internal): Use it.
13929 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13930 creating the directory. The old code temporarily assigns
13931 too-generous permissions to the directory.
13932 (do_auto_save_eh): Clear it.
13933 (Fdo_auto_save): Catch all errors, not just file errors, so
13934 that the var is always cleared.
13936 2012-01-07 Eli Zaretskii <eliz@gnu.org>
13938 * search.c (scan_buffer): Pass character positions to
13939 know_region_cache, not byte positions. (Bug#6540)
13941 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
13943 * w32.c (sys_rename): Report EXDEV when rename of a directory
13944 fails because the target is on another logical disk. (Bug#10284)
13946 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13948 * xterm.c (x_embed_request_focus): New function.
13950 * xterm.h: Add prototype.
13952 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13954 2012-01-05 Glenn Morris <rgm@gnu.org>
13956 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13958 2012-01-01 Eli Zaretskii <eliz@gnu.org>
13960 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13961 Load gnutls_transport_set_lowat only if GnuTLS version is below
13963 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13964 GnuTLS versions below 2.11.1.
13966 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13968 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13969 to the doc string advising against its use for altering the way
13970 windows are scrolled.
13972 2011-12-28 Kenichi Handa <handa@m17n.org>
13974 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13975 coding-system ASCII compatible only when it does not produce BOM
13976 on encoding (Bug#10383).
13978 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13980 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13982 (create_and_show_popup_menu): Always use menu_position_func for
13985 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13987 * callint.c (Fcall_interactively): Don't truncate prompt string.
13989 2011-12-23 Eli Zaretskii <eliz@gnu.org>
13991 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13992 property that ends at ZV, so that the bidi iteration could be
13993 resumed from there (after widening). (Bug#10360)
13995 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13997 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13999 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14001 * nsterm.m (x_free_frame_resources):
14002 Release f->output_data.ns->miniimage.
14003 (ns_index_color): Fix indentation. Do not retain
14004 color_table->colors[i].
14006 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14009 * nsfns.m (x_set_background_color): Assign return value from
14010 ns_index_color to face-background instead of NSColor*.
14011 (ns_implicitly_set_icon_type): Fix indentation.
14012 Change assignment in for loop to comparison.
14014 * emacs.c (ns_pool): New variable.
14015 (main): Assign ns_pool.
14016 (Fkill_emacs): Call ns_release_autorelease_pool.
14018 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14019 autorelease fdesc, release fdAttrs and tdict.
14020 (ns_get_covering_families): Release charset.
14021 (ns_findfonts): Release NSFontDescriptor created with new.
14022 (ns_uni_to_glyphs): Fix indentation.
14023 (setString): Release attrStr before assigning new value.
14025 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14027 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14029 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14030 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14032 2011-12-18 David Reitter <reitter@cmu.edu>
14034 * nsterm.m (ns_term_init): Subscribe for notifications
14035 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14036 to method trackingNotification in EmacsMenu.
14038 * nsmenu.m (trackingMenu): New variable.
14039 (trackingNotification): New method (from Aquamacs).
14040 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14041 from Aquamacs (Bug#7030).
14043 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14045 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14046 (symbol_to_nsstring): Fix indentation.
14047 (ns_symbol_to_pb): New function.
14048 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14049 (Fns_rotate_cut_buffers_internal): Remove.
14050 (Fns_store_selection_internal): Rename from
14051 Fns_store_cut_buffer_internal.
14052 (ns_get_foreign_selection, Fx_own_selection_internal)
14053 (Fx_disown_selection_internal, Fx_selection_exists_p)
14054 (Fns_get_selection_internal, Fns_store_selection_internal):
14055 Use ns_symbol_to_pb and check if return value is nil.
14056 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14057 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14058 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14059 renamed to Sns_store_selection_internal.
14060 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14061 and remove this function.
14062 (ns_handle_selection_clear): Remove, never used.
14063 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14066 2011-12-17 Ken Brown <kbrown@cornell.edu>
14068 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14069 GID is unknown (Bug#10257).
14071 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14073 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14074 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14075 which caused a build failure on GNU/Linux IA-64. This problem was
14076 introduced by my 2011-10-07 patch.
14078 2011-12-15 Juri Linkov <juri@jurta.org>
14080 * image.c (imagemagick_error): New function. (Bug#10112)
14081 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14082 Use `imagemagick_error' where ImageMagick functions return
14084 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14087 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14089 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14090 fill background (Bug#8992).
14092 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14094 * window.c (Vwindow_combination_resize)
14095 (Vwindow_combination_limit): Use t instead of non-nil in
14097 (Vrecenter_redisplay): Add first sentence of doc-string on
14099 (Frecenter): Fix doc-string typo.
14101 2011-12-11 Kenichi Handa <handa@m17n.org>
14103 * coding.c (Funencodable_char_position): Pay attention to the
14104 buffer text relocation (Bug#9389).
14106 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14108 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14109 gtk_init (Bug#10100).
14111 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14113 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14114 IT->string is nil. (Bug#10263)
14116 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14118 * nsterm.h (x_free_frame_resources): Declare.
14120 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14121 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14123 * nsterm.h (ns_get_defaults_value): Declare.
14125 * nsterm.m (ns_default): Call ns_get_defaults_value.
14127 2011-12-09 Eli Zaretskii <eliz@gnu.org>
14129 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14132 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14134 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14135 that where the value of an _OBJC_* symbol points to is in the .bss
14136 section (Bug#10240).
14138 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14140 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14141 after the loop to call ccl_driver at least once (Bug#8619).
14143 2011-12-08 Kenichi Handa <handa@m17n.org>
14145 * ftfont.c (get_adstyle_property): Fix previous change
14148 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
14150 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14151 dirs from the default value of EMACSLOADPATH (bug#10208).
14153 2011-12-07 Glenn Morris <rgm@gnu.org>
14155 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14156 installation and source directories as well. (Bug#10208)
14158 2011-12-06 Chong Yidong <cyd@gnu.org>
14160 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14162 2011-12-06 Glenn Morris <rgm@gnu.org>
14164 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14165 as an error, not just -1. (Bug#10217)
14167 2011-12-05 Chong Yidong <cyd@gnu.org>
14169 * keyboard.c (process_special_events): New function.
14170 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14172 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14174 * coding.c (encode_designation_at_bol): Don't use uninitialized
14175 local variable (Bug#9318).
14177 2011-12-05 Kenichi Handa <handa@m17n.org>
14179 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14180 return Qnil (Bug#8046, Bug#10193).
14182 2011-12-05 Kenichi Handa <handa@m17n.org>
14184 * coding.c (encode_designation_at_bol): New args charbuf_end and
14185 dst. Return the number of produced bytes. Callers changed.
14186 (coding_set_source): Return how many bytes coding->source was
14188 (coding_set_destination): Return how many bytes
14189 coding->destination was relocated.
14190 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14191 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14193 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14195 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14196 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14199 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14201 The following changes are to fix Bug#9318.
14203 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14204 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14205 (encode_coding_iso_2022, encode_coding_sjis)
14206 (encode_coding_big5, encode_coding_charset): Use the above macros.
14208 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
14210 * lisp.h (process_quit_flag): Fix external declaration.
14212 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14214 Don't macro-inline non-performance-critical code.
14215 * eval.c (process_quit_flag): New function.
14216 * lisp.h (QUIT): Use it.
14218 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14220 * nsfns.m (get_geometry_from_preferences): New function.
14221 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14223 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14225 * emacs.c (Qkill_emacs): Define.
14226 (syms_of_emacs): Initialize it.
14227 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14228 Qquit_flag to `kill-emacs' instead.
14229 (quit_throw_to_read_char): Add parameter `from_signal'.
14230 All callers changed. Call Fkill_emacs if requested and safe.
14231 * lisp.h (QUIT): Call Fkill_emacs if requested.
14233 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14235 * widget.c (update_wm_hints): Return if wmshell is null.
14236 (widget_update_wm_size_hints): New function.
14238 * widget.h (widget_update_wm_size_hints): Declare.
14240 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14241 widget_update_wm_size_hints (Bug#10104).
14243 2011-12-03 Eli Zaretskii <eliz@gnu.org>
14245 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14246 before a newline, prepare the bidi iterator for consuming the
14247 newline, and keep the current paragraph direction. (Bug#10183)
14248 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
14250 2011-12-02 Juri Linkov <juri@jurta.org>
14252 * search.c (Fword_search_regexp): New Lisp function created from
14253 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14254 (Fword_search_backward, Fword_search_forward)
14255 (Fword_search_backward_lax, Fword_search_forward_lax):
14256 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14257 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14259 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14261 * fileio.c (Finsert_file_contents): Move after-change-function call
14262 to before the "handled:" label, since all "goto handled" appear in
14263 cases where the *-change-functions have already been properly called
14266 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14268 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14269 waiting for input. (Bug#10169)
14271 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14273 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14274 verifies glyph row's hash code--we have just reallocated the
14275 glyphs, so their contents can be complete garbage. (Bug#10164)
14277 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
14279 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14281 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14283 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14284 attributes are tested _before_ calling verify_row_hash, to protect
14285 against GCC re-ordering of the tests. (Bug#10164)
14287 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14289 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14291 * xterm.c (handle_one_xevent): Only set async_visible and friends
14292 if net_wm_state_hidden_seen is non-zero (Bug#10002)
14293 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14294 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14296 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14298 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14299 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14300 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14301 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14302 All uses changed to use GCPRO1 etc.
14303 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14304 Revert to old implementation (i.e., before 2011-03-11).
14306 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14308 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14309 of scroll runs so as to avoid assigning disabled bogus rows and
14310 unnecessary graphics copy operations.
14312 2011-11-27 Eli Zaretskii <eliz@gnu.org>
14314 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14315 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14316 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14317 (malloc, free, realloc, calloc): Redirect to e_* only when
14320 * lisp.h (GCTYPEBITS): Move before first use.
14321 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14322 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14323 this macro definition.
14325 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14328 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14330 * gtkutil.c (xg_create_frame_widgets):
14331 Call gtk_window_set_has_resize_grip (FALSE) if that function is
14332 present with Gtk+ 2.0.
14334 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14336 * fileio.c (Finsert_file_contents): Undo previous change; see
14337 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14339 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14341 Rename locals to avoid shadowing.
14342 * fileio.c (Finsert_file_contents):
14343 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14344 * process.c (wait_reading_process_output):
14345 Rename inner 'proc' to 'p' to avoid shadowing.
14346 Indent for consistency with usual Emacs style.
14348 2011-11-25 Eli Zaretskii <eliz@gnu.org>
14350 * xdisp.c (redisplay_window): If cursor row is not fully visible
14351 after recentering, and scroll-conservatively is set to a large
14352 number, scroll window by a few more lines to make the cursor fully
14353 visible and out of scroll-margin. (Bug#10105)
14354 (start_display): Don't move to the next line if the display should
14355 start at a newline that is part of a display vector or an overlay
14356 string. (Bug#10119)
14358 2011-11-24 Juri Linkov <juri@jurta.org>
14360 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14361 after the `MagickPingImage' call. (Bug#10112)
14363 2011-11-23 Chong Yidong <cyd@gnu.org>
14365 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14367 2011-11-23 Martin Rudalics <rudalics@gmx.at>
14369 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14370 making another buffer current. (Bug#10114)
14372 2011-11-23 Glenn Morris <rgm@gnu.org>
14374 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14376 2011-11-23 Chong Yidong <cyd@gnu.org>
14378 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14379 using it (Bug#5984).
14381 2011-11-22 Eli Zaretskii <eliz@gnu.org>
14383 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14384 and header-lines, as they don't have one computed for them.
14387 * .gdbinit (prow): Make displayed values more self-explaining.
14388 Add row's hash code.
14390 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14392 * process.c (wait_reading_process_output): Fix asynchrounous
14393 GnuTLS socket handling on some versions of the GnuTLS library.
14394 (wait_reading_process_output): Add comment and URL.
14396 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14398 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14400 2011-11-21 Chong Yidong <cyd@gnu.org>
14402 * window.c (Fnext_window, Fprevious_window): Doc fix.
14404 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14406 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14408 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14410 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14412 2011-11-20 Martin Rudalics <rudalics@gmx.at>
14414 * window.c (Fset_window_combination_limit): Rename argument
14416 (Vwindow_combination_limit): Remove "status" from doc-string.
14418 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14420 * m/ibms390.h: Remove.
14421 * m/ibms390x.h: Don't include "ibms390.h".
14423 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14425 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14426 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14428 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14430 * casetab.c (Fset_case_table):
14431 * charset.c (Fcharset_after): Fix typos.
14433 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
14435 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14436 Otherwise, valgrind does not work on some platforms.
14437 Problem reported by Andreas Schwab in
14438 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14439 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14440 is set, removing the need for VIRT_ADDRESS_VARIES.
14441 (PURE_P): Use a more-efficient implementation that needs just one
14442 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14443 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14444 to 4 (xorl, subq, cmpq, setbe).
14445 * alloc.c (pure): Always extern now, since that's the
14446 VIRT_ADDR_VARIES behavior.
14447 (PURE_POINTER_P): Use a single comparison, not two, for
14448 consistency with the new puresize.h.
14449 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14450 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14451 Remove VIRT_ADDR_VARIES no longer needed.
14453 2011-11-19 Eli Zaretskii <eliz@gnu.org>
14455 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14456 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14457 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14458 behave as if the cursor position were at the window margin.
14460 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14461 and the cursor position is out of bounds, behave as if the cursor
14462 position were at the window margin. (Bug#10075)
14464 2011-11-18 Chong Yidong <cyd@gnu.org>
14466 * window.c (Fwindow_combination_limit): Make first argument
14467 non-optional, since it is meaningless for live windows like the
14470 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14472 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14474 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14476 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14477 (graft_intervals_into_buffer): Simplify.
14479 2011-11-18 Eli Zaretskii <eliz@gnu.org>
14481 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14482 hash values of the two rows.
14483 (copy_row_except_pointers): Preserve the used[] arrays and the
14484 hash values of the two rows. (Bug#10035)
14485 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14487 * xdisp.c (row_hash): New function, body extracted from
14488 compute_line_metrics.
14489 (compute_line_metrics): Call row_hash, instead of computing the
14492 * dispnew.c (verify_row_hash): Call row_hash for computing the
14493 hash code of a row, instead of duplicating code from xdisp.c.
14495 * dispextern.h (row_hash): Add prototype.
14497 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14499 * frame.c (delete_frame): Don't delete the terminal when the last
14500 X frame is closed if emacs is built with GTK toolkit.
14502 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
14504 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14506 2011-11-17 Martin Rudalics <rudalics@gmx.at>
14508 * window.c (Vwindow_splits): Rename to
14509 Vwindow_combination_resize. Suggested by Juri Linkov.
14510 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14513 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
14515 * nsfns.m (Fns_font_name):
14516 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14518 2011-11-16 Martin Rudalics <rudalics@gmx.at>
14520 * window.h (window): Rename slot "nest" to "combination_limit".
14521 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14522 (Fset_window_nest): Rename to Fset_window_combination_limit.
14523 (Vwindow_nest): Rename to Vwindow_combination_limit.
14524 (recombine_windows, make_parent_window, make_window)
14525 (Fsplit_window_internal, saved_window)
14526 (Fset_window_configuration, save_window_save): Rename all
14527 occurrences of window_nest to window_combination_limit.
14529 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
14531 * image.c (imagemagick_load_image): Fix typo.
14533 2011-11-14 Eli Zaretskii <eliz@gnu.org>
14535 * xdisp.c (display_line): Move the call to
14536 highlight_trailing_whitespace before the call to
14537 compute_line_metrics, since the latter needs to see the final
14538 faces of all the glyphs to compute ROW's hash value.
14539 Fixes assertion violations in row_equal_p. (Bug#10035)
14541 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
14543 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14544 just return (bug#10044).
14546 2011-11-12 Eli Zaretskii <eliz@gnu.org>
14548 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14549 with user-defined heap size. Bump the default size of the temacs
14550 heap to 27MB, to avoid memory warning when running temacs.
14551 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14553 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14554 current_matrix and desired_matrix. (Bug#9990)
14555 (verify_row_hash) [XASSERTS]: New function.
14556 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14557 that the hash value of glyph rows is correct.
14559 2011-11-12 Martin Rudalics <rudalics@gmx.at>
14561 * window.h (window): Remove splits slot.
14562 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14563 (Fdelete_other_windows_internal, make_parent_window)
14564 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14565 (Fset_window_configuration, save_window_save): Don't deal with
14566 split status of windows.
14567 (saved_window): Remove splits slot.
14568 (Vwindow_splits): Rewrite doc-string.
14570 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14572 * xfns.c (unwind_create_frame):
14573 * nsfns.m (unwind_create_frame):
14574 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14575 Vframe_list (Bug#9999).
14577 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14579 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
14581 2011-11-11 Kenichi Handa <handa@m17n.org>
14583 * callproc.c (Fcall_process): Set the member dst_multibyte of
14586 2011-11-11 Johan Bockgård <bojohan@gnu.org>
14588 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14589 avoid a crash (bug#9496).
14591 2011-11-09 Chong Yidong <cyd@gnu.org>
14593 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14594 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14596 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14598 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14600 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14602 Avoid some portability problems by eschewing 'extern inline' functions.
14603 The trivial performance wins aren't worth the portability hassles; see
14604 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14606 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14607 (window_box_width, window_box_left, window_box_left_offset)
14608 (window_box_right, window_box_right_offset): Undo previous change,
14609 by removing the "extern"s.
14610 * intervals.c (adjust_intervals_for_insertion)
14611 (adjust_intervals_for_deletion): Undo previous change,
14612 making these static again.
14613 (offset_intervals, temp_set_point_both, temp_set_point)
14614 (copy_intervals_to_string): No longer inline.
14615 * xdisp.c (window_text_bottom_y, window_box_width)
14616 (window_box_height, window_box_left_offset)
14617 (window_box_right_offset, window_box_left, window_box_right)
14618 (window_box): No longer inline.
14620 2011-11-08 Chong Yidong <cyd@gnu.org>
14622 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
14623 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14624 Signal an error if not a live window.
14625 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14626 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14628 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
14630 * lisp.h (syms_of_abbrev): Remove declaration.
14631 Reported by CHENG Gao <chenggao@royau.me>.
14633 2011-11-07 Eli Zaretskii <eliz@gnu.org>
14635 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14636 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14637 of temacs in GUI mode.
14639 2011-11-07 Martin Rudalics <rudalics@gmx.at>
14641 * window.h: Declare delete_all_child_windows instead of
14642 delete_all_subwindows.
14643 * window.c (Fwindow_nest, Fset_window_nest)
14644 (Fset_window_new_total, Fset_window_new_normal)
14645 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14646 (delete_all_subwindows): Rename to delete_all_child_windows.
14647 (Fdelete_other_windows_internal, Fset_window_configuration):
14648 Call delete_all_child_windows instead of delete_all_subwindows.
14649 * frame.c (delete_frame): Call delete_all_child_windows instead
14650 of delete_all_subwindows.
14652 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14654 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14655 This is also needed for porting to any host where GC_MARK_STACK is
14656 not GC_MAKE_GCPROS_NOOPS.
14657 (which_symbols): Use it.
14659 2011-11-07 Kenichi Handa <handa@m17n.org>
14661 * coding.c (coding_set_destination): Check coding->src_pos only
14662 when coding->src_object is a buffer (bug#9910).
14664 * process.c (send_process): Set the member src_multibyte of coding
14665 to 0 (bug#9911) when sending a unibyte text.
14667 * callproc.c (Fcall_process): Set the member src_multibyte of
14668 process_coding to 0 (bug#9912).
14670 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14672 * xmenu.c (cleanup_widget_value_tree): New function.
14673 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14674 calling free_menubar_widget_value_tree directly (Bug#9830).
14676 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14678 Fix some portability problems with 'inline'.
14679 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14680 (window_box_width, window_box_left, window_box_left_offset)
14681 (window_box_right, window_box_right_offset): Declare extern.
14682 Otherwise, these inline functions do not conform to C99 and
14683 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14684 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14685 * intervals.c (adjust_intervals_for_insertion)
14686 (adjust_intervals_for_deletion): Now extern, because otherwise the
14687 extern inline functions 'offset_intervals' couldn't refer to it.
14688 (static_offset_intervals): Remove.
14689 (offset_intervals): Rewrite using the old contents of
14690 static_offset_intervals. The old version didn't conform to C99
14691 because an extern inline function contained a reference to an
14692 identifier with static linkage.
14694 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14696 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14699 2011-11-06 Eli Zaretskii <eliz@gnu.org>
14701 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14702 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14703 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14704 return Qleft_to_right.
14706 2011-11-06 Chong Yidong <cyd@gnu.org>
14708 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14709 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14710 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14711 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14712 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14713 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14714 (Fwindow_vscroll): Doc fix.
14715 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14716 argument, since it makes no sense to pass a live window and for
14717 consistency with window-child.
14719 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14721 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14724 2011-11-05 Jason Rumney <jasonr@gnu.org>
14726 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14727 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14729 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14730 bitwise arithmetic preventing use of unicode-sip and non-truetype
14733 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14735 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14738 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14739 initialization code to keep similarity to xfns.c after changes
14742 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14744 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14745 (unwind_create_frame): New function (Bug#9943).
14746 (Fx_create_frame): Restructure code to be more similar to the one in
14747 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14748 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14749 Move terminal->reference_count++ just before making the frame official
14752 * nsterm.m (x_free_frame_resources): New function.
14753 (x_destroy_window): Move code to x_free_frame_resources.
14755 * xfns.c (unwind_create_frame): Fix comment.
14756 (Fx_create_frame, x_create_tip_frame):
14757 Move terminal->reference_count++ just before making the frame
14758 official. Move initialization of image_cache_refcount and
14759 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14761 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14763 Support MSVC build with newer versions of Visual Studio.
14764 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14765 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14768 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14769 which are not supported by MSVC.
14770 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14771 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14773 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14774 types in bitfields.
14775 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14777 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14779 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
14781 Support MSVC build with newer versions of Visual Studio.
14782 * w32.c: Don't include w32api.h for MSVC.
14783 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14785 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14786 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14787 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14788 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14790 (alloca) [_MSC_VER]: Define to _alloca.
14792 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14794 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14796 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14798 * xdisp.c (note_mouse_highlight): If either of
14799 previous/next-single-property-change returns nil, treat that as
14800 the beginning or the end of the buffer. (Bug#9955)
14802 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14804 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
14805 label is not null (Bug#9951).
14806 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14809 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14811 * window.c (Fwindow_body_size): Mention in the doc string that the
14812 return value is in frame's canonical units. (Bug#9949)
14814 2011-11-03 Eli Zaretskii <eliz@gnu.org>
14816 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14818 * w32fns.c (unwind_create_frame): If needed, free the glyph
14819 matrices of the partially constructed frame. (Bug#9943)
14820 * xfns.c (unwind_create_frame): Likewise.
14822 2011-11-01 Eli Zaretskii <eliz@gnu.org>
14824 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14825 Don't stop backward scan on the continuation glyph, even though
14826 its CHARPOS is positive.
14827 (mouse_face_from_buffer_pos, note_mouse_highlight):
14828 Rename cover_string to disp_string.
14830 2011-11-01 Martin Rudalics <rudalics@gmx.at>
14832 * window.c (temp_output_buffer_show): Don't use
14833 Vtemp_buffer_show_specifiers.
14834 (Vtemp_buffer_show_specifiers): Remove unused variable.
14836 2011-10-30 Eli Zaretskii <eliz@gnu.org>
14838 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14839 past the beginning of the current glyph matrix.
14841 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
14843 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14844 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14845 HAVE_GTK3 (Bug#9869).
14847 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14848 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14850 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14852 * xterm.c: Declare x_handle_net_wm_state to return int.
14853 (handle_one_xevent): Check if we are iconified but don't have
14854 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14855 (get_current_wm_state): Return non-zero if not hidden,
14856 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14857 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14858 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14859 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14861 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14863 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14864 so that this new function doesn't get optimized away by a
14865 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14867 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14869 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14871 2011-10-29 Eli Zaretskii <eliz@gnu.org>
14873 Fix the `xbytecode' command.
14874 * .gdbinit (xprintbytestr): New command.
14875 (xwhichsymbols): Rename from `which'; all callers changed.
14876 (xbytecode): Print the byte-code string as well.
14878 2011-10-29 Kim Storm <storm@cua.dk>
14880 * alloc.c (which_symbols): New function.
14882 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14884 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14887 2011-10-29 Glenn Morris <rgm@gnu.org>
14889 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14890 Not clear what it was for, and it causes various bugs. (Bug#9839)
14892 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14894 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14895 possible random value that matches one of those tested as
14896 condition to clear the mouse face.
14898 2011-10-28 Chong Yidong <cyd@gnu.org>
14900 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14902 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14904 * window.c (make_window): Initialize phys_cursor_on_p.
14906 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14908 * lisp.h (struct Lisp_Symbol): Update comments.
14910 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
14912 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14914 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14916 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14917 <oslsachem@gmail.com> for helping to debug this.
14919 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14920 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14921 (g_b_init_get_glyph_outline_w): New static variables.
14922 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14923 (GetGlyphOutlineW_Proc): New typedefs.
14924 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
14925 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14927 (w32font_open_internal, compute_metrics):
14928 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
14929 instead of calling the "wide" APIs directly.
14931 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14933 * w32.h (syms_of_w32font): Add prototype.
14935 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14937 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14938 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14939 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14940 (Fmove_to_window_line): Doc fix.
14942 2011-10-27 Chong Yidong <cyd@gnu.org>
14944 * process.c (make_process): Set gnutls_state to NULL.
14946 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14947 non-NULL, regardless of GNUTLS_INITSTAGE.
14948 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14949 an error. Set process slots as soon as we allocate them.
14951 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14953 2011-10-27 Chong Yidong <cyd@gnu.org>
14955 * gnutls.c (emacs_gnutls_deinit): New function.
14956 Deallocate credentials structures as well as calling gnutls_deinit.
14957 (Fgnutls_deinit, Fgnutls_boot): Use it.
14959 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14960 (deactivate_process): Call emacs_gnutls_deinit.
14962 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14964 * image.c (x_create_x_image_and_pixmap):
14965 * w32.c (sys_rename, w32_delayed_load):
14966 * w32font.c (fill_in_logfont):
14967 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14969 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
14971 * w32fns.c (w32_default_color_map): New function,
14972 extracted from Fw32_default_color_map.
14973 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
14975 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14977 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14979 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14981 * keyboard.c (test_undefined): New function (bug#9751).
14982 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14984 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14986 * sysdep.c (init_sys_modes): Fix the check for the controlling
14987 terminal (Bug#6649).
14989 2011-10-20 Eli Zaretskii <eliz@gnu.org>
14991 * dispextern.h (struct bidi_it): New member next_en_type.
14993 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14994 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14995 current character, check also for next_en_type being WEAK_EN.
14996 (bidi_resolve_weak): Don't enter the expensive loop if the current
14997 position is before next_en_pos. Record the bidi type of the first
14998 non-ET, non-BN character we find, in addition to its position.
14999 (bidi_level_of_next_char): Invalidate next_en_type when
15000 next_en_pos is over-stepped.
15002 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15004 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15005 * editfns.c: Rewrite current-time-zone so that it invokes
15006 the equivalent of (format-time-string "%Z") to get the time zone name.
15007 This fixes a bug when the time zone name contains characters that
15008 need converting from the system time locale to Emacs internal format.
15009 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15010 that patch fixed format-time-string to do the conversion, but
15011 I forgot to fix current-time-zone.
15012 (format_time_string): New function, containing most of
15013 what Fformat_time_string used to contain.
15014 (Fformat_time_string): Rewrite in terms of format_time_string.
15015 This doesn't change this function's behavior.
15016 (current-time-zone): Rewrite to use format_time_string.
15017 This fixes the bug reported by Michael Schierl in
15018 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15019 Jason Rumney's 2007-06-07 change worked around this bug, but
15021 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15023 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15025 * xdisp.c (start_display): If the character at POS is displayed
15026 via a display vector, reset IT->current.dpvec_index to zero.
15027 (try_window_reusing_current_matrix): If a line ends in a display
15028 vector or the next line starts in a display vector, continue
15029 redrawing the window even though the character position of
15030 start_row was reached.
15033 2011-10-18 Chong Yidong <cyd@gnu.org>
15035 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15036 with nobreak-char-display too.
15038 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15040 Fix part 3 of bug#9771.
15041 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15042 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15043 non-neutral characters if the current character is a paragraph
15044 separator (a.k.a. Newline). This avoids running the same
15045 expensive loop twice, once when we consume the preceding newline
15046 and the other time when the line actually needs to be displayed.
15047 Avoid the loop when we see neutrals on the base embedding level
15048 following a character whose directionality is the same as the
15049 paragraph's. This avoids running the expensive loop when a line
15050 ends in a long sequence of neutrals, like control characters.
15051 Add assertion against STRONG_AL type. Slightly rearrange code
15052 that determines the type of a neutral given the first non-neutral
15054 (bidi_level_of_next_char): Set next_en_pos to zero when
15055 invalidating its info.
15057 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15059 * xdisp.c (push_display_prop): Determine whether to record string
15060 or buffer position by IT->string, not by IT->method. Allow
15061 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15062 (move_it_vertically_backward): Don't look for character position
15063 immediately after the newline when in a continuation line.
15066 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15068 * window.c (coordinates_in_window): Rewrite and delabelize
15069 vertical border check. (Bug#5357) (Bug#9618)
15071 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15073 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15074 errors in XSetWindowBorder (bug#9310).
15076 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15078 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15079 avoid crash when xmalloc overrun checking is enabled.
15081 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15083 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15084 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15085 cursor motion with <left> and <right> arrow keys.
15087 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15088 some callers set that themselves.
15090 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15092 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15093 display string and the previous row comes from the same string and
15094 is empty. (Bug#9739) (Bug#9738)
15096 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15098 * doc.c (get_doc_string): Encode file name (bug#9735).
15100 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15102 * bidi.c (bidi_level_of_next_char):
15103 * xdisp.c (get_visually_first_element): Remove old incorrect
15104 comments regarding the Unicode Line Separator character.
15106 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15108 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15110 * alloc.c (Fgc_status): Do not access beyond zombies array
15111 boundary if nzombies > MAX_ZOMBIES.
15112 * alloc.c (dump_zombies): Add missing format specifier.
15114 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15116 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15117 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15119 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15120 Some packages use them to denote characters with modifiers.
15122 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15124 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15125 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15126 matching a pp-number. Rename parameter var to var1.
15128 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15130 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15132 2011-10-08 Glenn Morris <rgm@gnu.org>
15134 * callint.c (Fcall_interactively): Give a more explicit error for the
15135 'c' case with a non-character input. (Bug#8479)
15137 2011-10-08 Eli Zaretskii <eliz@gnu.org>
15139 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15141 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15142 lines that are hscrolled on the left.
15144 * dispnew.c (buffer_posn_from_coords): Account for a possible
15145 presence of header-line. (Bug#4426)
15147 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15149 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15150 Don't advertise functionality which we discourage or doesn't work.
15152 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15154 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15155 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15156 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15157 this makes Emacs dump core during garbage collection on rare
15158 occasions. sizeof is obviously inferior to offsetof here, so
15159 stick with offsetof.
15160 (GC_POINTER_ALIGNMENT): New macro.
15161 (mark_memory): Omit 3rd (offset) arg; caller changed.
15162 Don't assume EMACS_INT alignment is the same as pointer alignment.
15164 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15166 * keyboard.c (read_key_sequence_remapped): New var.
15167 (read_key_sequence): Compute remapping in the right buffer.
15168 (command_loop_1): Use read_key_sequence's remapping directly.
15170 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15172 * dired.c (file_name_completion): Don't expand file name.
15173 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15174 before checking file name handler.
15176 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15177 they've been requested explicitly (bug#9591).
15179 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
15181 * keymap.c (Fsingle_key_description): Use make_specified_string
15182 instead of build_string to build string from push_key_description.
15185 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15187 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15188 This fixes a Y2038 bug on 64-bit hosts.
15189 * buffer.c (reset_buffer):
15190 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15191 (Fclear_buffer_auto_save_failure):
15192 Use 0, not -1, to represent an unset failure time, since time_t
15193 might not be signed.
15195 Remove dependency on glibc malloc internals.
15196 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15197 Move back here from lisp.h, but with their new implementations.
15198 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15199 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15200 * charset.c (charset_table_init): New static var.
15201 (syms_of_charset): Use it instead of xmalloc. This removes a
15202 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15203 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15204 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15205 Move back to alloc.c.
15206 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15207 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15209 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15211 * nsterm.m (windowDidResize): Call x_set_window_size only when
15212 ns_in_resize is true. Otherwise set pixelwidth/height and
15213 call change_frame_size (Bug#9628).
15215 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15217 Port --enable-checking=all to Fedora 14 x86-64.
15218 * charset.c (syms_of_charset): Also account for glibc malloc's
15219 internal overhead when calculating the initial malloc maximum.
15221 Port --enable-checking=all to Fedora 14 x86.
15222 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15224 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15225 (overrun_check_realloc, overrun_check_free):
15226 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15227 That way, xmalloc returns a properly-aligned pointer even if
15228 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15229 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15230 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15231 into account when calculating the initial malloc maximum.
15232 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15233 Move here from alloc.c, so that charset.c can use it too.
15234 Properly align; the old code wasn't right for common 32-bit hosts
15235 when configured with --enable-checking=all.
15236 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15237 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15239 2011-09-29 Eli Zaretskii <eliz@gnu.org>
15241 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15244 2011-09-28 Eli Zaretskii <eliz@gnu.org>
15246 * xdisp.c (compute_display_string_end): If there's no display
15247 string at CHARPOS, return -1.
15249 * bidi.c (bidi_fetch_char): When compute_display_string_end
15250 returns a negative value, treat the character as a normal
15251 character not covered by a display string. (Bug#9624)
15253 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
15255 * lread.c (Fread_from_string): Fix typo in docstring.
15257 2011-09-27 Eli Zaretskii <eliz@gnu.org>
15259 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15260 newline, reseat the iterator instead of bidi-iterating there one
15261 character at a time. (Bug#9610)
15262 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15263 TO_CHARPOS if the bidi iterator is at base embedding level.
15265 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15267 * lread.c (readevalloop): Use correct code for NBSP.
15268 (read1): Likewise. (Bug#9608)
15270 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
15272 * dbusbind.c (Fdbus_register_signal): When service is not
15273 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15275 2011-09-25 Glenn Morris <rgm@gnu.org>
15277 * buffer.c (truncate-lines): Doc fix.
15279 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
15281 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15282 (Fset_window_next_buffers): Doc fix.
15284 2011-09-24 Glenn Morris <rgm@gnu.org>
15286 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15288 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15290 Fix minor problems found by static checking.
15291 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15292 * indent.c (Fvertical_motion): Fix == vs = typo.
15294 2011-09-24 Eli Zaretskii <eliz@gnu.org>
15296 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15297 Default value is now t. Doc fix.
15299 * indent.c (Fvertical_motion): Compute and apply the overshoot
15300 logic when moving up, not only when moving down. Fix the
15301 confusing name and values of the it_overshoot_expected variable;
15302 logic changes accordingly. (Bug#9254) (Bug#9549)
15304 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15305 CHARPOS is covered by a display string which includes newlines.
15306 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15307 is covered by a display string with embedded newlines.
15309 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
15311 * dbusbind.c (Fdbus_register_signal): Add match rule to
15312 Vdbus_registered_objects_table. (Bug#9581)
15313 (Fdbus_register_method, Vdbus_registered_objects_table):
15316 2011-09-24 Jim Meyering <meyering@redhat.com>
15318 do not ignore write error for any output size
15319 The previous change was incomplete.
15320 While it makes emacs --batch detect the vast majority of stdout
15321 write failures, errors were still ignored whenever the output size is
15322 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15323 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15324 && echo FAIL: ignored write error
15325 FAIL: ignored write error
15326 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15327 && echo FAIL: ignored write error
15328 FAIL: ignored write error
15329 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15331 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15333 * emacs.c (Fkill_emacs): In noninteractive mode exit
15334 non-successfully if a write error occurred on stdout. (Bug#9574)
15336 2011-09-21 Eli Zaretskii <eliz@gnu.org>
15338 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15341 * dispextern.h (struct it): Update the comment documenting what
15344 2011-09-20 Eli Zaretskii <eliz@gnu.org>
15346 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15347 a display string, extend search for cursor position to end of row.
15348 (find_row_edges): If the row ends in a newline from a display
15349 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15350 Handle the case of a display string with multiple newlines.
15351 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15352 non-empty line. Fixes confusing cursor motion with arrow keys at
15353 the beginning of a line that starts with whitespace.
15355 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15357 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15360 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
15362 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15363 boolean (Bug#9154).
15365 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15367 * xdisp.c (display_line): Record maximum and minimum buffer
15368 positions even if no glyphs were produced (e.g., by a zero-width
15369 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15370 buffer positions that will be removed from the glyph row because
15372 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15373 column is beyond frame width: don't subtract 1 "pixel" when
15374 computing width of the stretch.
15375 (reseat_at_next_visible_line_start): Undo the change made on
15376 2011-09-17 that saved paragraph information and restored it after
15377 the call to `reseat'. (Bug#9545)
15379 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15381 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15382 and turn window cursor on if cleared (Bug#9415).
15384 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
15386 * search.c (boyer_moore): Take unibyte characters from pattern
15387 literally. (Bug#9458)
15389 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15391 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15393 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15395 Fix minor problem found by static checking.
15396 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15397 initialized, to pacify gcc -Wuninitialized.
15399 * fileio.c: Report proper errno when syscall falls.
15400 (Finsert_file_contents): Save and restore errno,
15401 so that report_file_error outputs the correct diagnostic.
15402 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15404 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15406 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15408 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15410 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15411 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15413 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15415 * xdisp.c (reseat_at_next_visible_line_start): Keep information
15416 about the current paragraph and restore it after the call to reseat.
15418 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15419 (bidi_find_paragraph_start): Search back for paragraph beginning
15420 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15421 (bidi_move_to_visually_next): Only trigger paragraph-related
15422 computations when the last character is a newline or at EOB, not
15423 just any NEUTRAL_B. (Bug#9470)
15425 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15426 truncated lines if point is covered by a display string. (Bug#9524)
15428 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15430 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15431 (cons_to_x_long): New function.
15432 (lisp_data_to_selection_data): Use it. Correct the test for
15433 short-versus-long data; it was negated. Break out of vector
15434 loop, for efficiency, when a long datum is discovered.
15436 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15438 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15440 2011-09-16 Eli Zaretskii <eliz@gnu.org>
15442 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15443 GCC PR/17406) by declaring this function with external scope.
15445 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15447 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15448 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15450 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15452 * editfns.c (Fformat): Correctly handle text properties on "%%".
15454 2011-09-15 Eli Zaretskii <eliz@gnu.org>
15456 * xterm.c (x_draw_composite_glyph_string_foreground):
15457 * w32term.c (x_draw_composite_glyph_string_foreground):
15458 * term.c (encode_terminal_code):
15459 * composite.c (composition_update_it, get_composition_id):
15460 * xdisp.c (get_next_display_element)
15461 (fill_composite_glyph_string): Add comments about special meaning
15462 of TAB characters in a composition.
15464 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15466 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15467 This occurs when processing a multibyte format.
15468 Problem reported by Wolfgang Jenker.
15470 2011-09-15 Johan Bockgård <bojohan@gnu.org>
15472 * xdisp.c (try_cursor_movement): Only check for exact match if
15473 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15475 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15477 Remove unused external symbols.
15478 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15479 * xdisp.c (calc_pixel_width_or_height): Now static.
15480 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15481 * indent.c (check_display_width):
15482 * w32term.c: Fix comment to match code.
15483 * xterm.c, xterm.h (x_catching_errors): Remove.
15485 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15487 * xselect.c: Use signed conversions more consistently (Bug#9498).
15488 (selection_data_to_lisp_data): Assume incoming selection data are
15489 signed integers, not unsigned. This is to be consistent with
15490 outgoing selection data, which was modified to use signed integers
15491 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15492 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15493 expects long, not unsigned long.
15495 2011-09-14 Eli Zaretskii <eliz@gnu.org>
15497 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15498 computation of loop end. Reported by Johan Bockgård
15501 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
15503 * frame.c (Fother_visible_frames_p): Function deleted.
15505 2011-09-12 Eli Zaretskii <eliz@gnu.org>
15507 * indent.c (compute_motion): Process display vector front to back
15508 rather than the other way around. (Bug#2496)
15510 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15512 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15514 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
15516 * minibuf.c (Fread_from_minibuffer): Doc fix.
15518 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15520 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15521 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15523 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15525 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15526 value for non-existent files.
15528 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15530 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15531 set its "size" to -1. This will set the modtime_size field of
15532 the corresponding buffer to -1, which is what
15533 verify-visited-file-modtime expects for files that do not exist.
15536 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15538 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15540 * lisp.h: ... from here. push_key_description is no longer
15541 defined in keyboard.c, so its declaration should not be in
15542 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15543 logically belongs with push_key_description.
15545 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15547 * buffer.h: Include <sys/types.h> instead of <time.h>.
15548 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15549 Problem reported by Herbert J. Skuhra.
15551 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15553 * xml.c (parse_region): Make the parsing work for
15554 non-comment-starting XML files again (bug#9144).
15556 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15558 * image.c (gif_load): Fix calculation of bottom and right corner.
15561 2011-09-10 Eli Zaretskii <eliz@gnu.org>
15563 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15564 redisplay in small windows.
15566 2011-09-09 Eli Zaretskii <eliz@gnu.org>
15568 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15570 2011-09-08 Martin Rudalics <rudalics@gmx.at>
15572 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15573 Operate on live windows only.
15575 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
15577 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15579 2011-09-07 Eli Zaretskii <eliz@gnu.org>
15581 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15582 only under bidi iteration.
15584 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15586 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15588 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15590 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15591 Without this fix, the command to link temacs failed due to an
15592 undefined symbol __builtin_isnan. This is because
15593 /usr/include/iso/math_c99.h #defines isnan(x) to
15594 __builtin_isnan(x), but the bundled gcc, which identifies itself
15595 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15597 * floatfns.c (isnan): #undef, and then #define to a clone of
15599 (Fisnan): Always define, since it's always available now.
15600 (syms_of_floatfns): Always define isnan at the Lisp level.
15602 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15604 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15606 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15608 * fileio.c: Fix bugs with large file offsets (Bug#9428).
15609 The previous code assumed that file offsets (off_t values) fit in
15610 EMACS_INT variables, which is not true on typical 32-bit hosts.
15611 The code messed up by falsely reporting buffer overflow in cases
15612 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15613 when "big" contains more than 2**29 bytes, even though this
15614 inserts just one byte and does not overflow the buffer.
15615 (Finsert_file_contents): Store file offsets as off_t
15616 values, not as EMACS_INT values. Check for overflow when
15617 converting between EMACS_INT and off_t. When checking for
15618 buffer overflow or for overlap, take the offsets into account.
15619 Don't use EMACS_INT for small values where int suffices.
15620 When checking for overlap, fix a typo: ZV was used where
15621 ZV_BYTE was intended.
15622 (Fwrite_region): Don't assume off_t fits into 'long'.
15623 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15625 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
15627 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15629 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15631 sprintf-related integer and memory overflow issues (Bug#9412).
15633 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
15634 (esprintf, exprintf, evxprintf): New functions.
15635 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
15636 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
15637 (modify_event_symbol): Do not assume that the length of
15638 name_alist_or_stem is safe to alloca and fits in int.
15639 (Fexecute_extended_command): Likewise for function name and binding.
15640 (Frecursion_depth): Wrap around reliably on integer overflow.
15641 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15642 since some callers pass EMACS_INT values.
15643 (Fsingle_key_description): Don't crash if symbol name contains more
15644 than MAX_ALLOCA bytes.
15645 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15646 (get_minibuffer): Arg is now EMACS_INT, not int.
15647 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
15648 (esprintf, exprintf, evxprintf): New decls.
15649 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15651 * dbusbind.c (signature_cat): New function.
15652 (xd_signature, Fdbus_register_signal):
15653 Do not overrun buffer; instead, report string overflow.
15655 * dispnew.c (add_window_display_history): Don't overrun buffer.
15656 Truncate instead; this is OK since it's just a log.
15658 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15659 even if the time zone offset is outlandishly large.
15660 Don't mishandle offset == INT_MIN.
15662 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15663 when creating daemon; the previous buffer-overflow check was incorrect.
15665 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15666 which has the guts of the old verror function.
15668 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15669 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15671 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15672 (font_unparse_xlfd): Don't blindly alloca long strings.
15673 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
15674 fits in int, when using sprintf. Use single snprintf to count
15675 length of string rather than counting it via multiple sprintfs;
15676 that's simpler and more reliable.
15677 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15678 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15679 sprintf, in case result does not fit in int.
15681 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15682 (fontset_from_font): Print it.
15684 * frame.c (tty_frame_count): Now printmax_t, not int.
15685 (make_terminal_frame, set_term_frame_name): Print it.
15686 (x_report_frame_params): In X, window IDs are unsigned long,
15687 not signed long, so print them as unsigned.
15688 (validate_x_resource_name): Check for implausibly long names,
15689 and don't assume name length fits in 'int'.
15690 (x_get_resource_string): Don't blindly alloca invocation name;
15691 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15694 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15695 (xg_check_special_colors, xg_set_geometry):
15696 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15698 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15699 Use esprintf, not sprintf, in case result does not fit in int.
15701 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15702 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15703 it as a large positive number.
15704 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15705 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15707 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15708 in case result does not fit in int.
15710 * print.c (float_to_string): Detect width overflow more reliably.
15711 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15712 buffer overrun. Don't assume list length fits in 'int'. Treat
15713 print length of 0 as 0, not as infinity; to be consistent with other
15714 uses of print length in this function. Don't overflow print length
15715 index. Don't assume hash table size fits in 'long', or that
15716 vectorlike size fits in 'unsigned long'.
15718 * process.c (make_process): Use printmax_t, not int, to format
15719 process-name gensyms.
15721 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15723 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15724 to avoid potential buffer overrun.
15726 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15727 if X resource line is longer than 512 bytes.
15729 * xfns.c (x_window): Make sprintf buffer a bit bigger
15730 to avoid potential buffer overrun.
15732 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15734 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15736 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15738 Integer overflow fixes for scrolling, etc.
15739 Without these, Emacs silently mishandles large integers sometimes.
15740 For example, "C-u 4294967297 M-x recenter" was treated as if
15741 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15743 * xdisp.c (try_window_id): Check Emacs fixnum range before
15744 converting to 'int'.
15746 * window.c (window_scroll_line_based, Frecenter):
15747 Check that an Emacs fixnum is in range before assigning it to 'int'.
15748 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15749 values converted from Emacs fixnums.
15750 (Frecenter): Don't wrap around a line count if it is out of 'int'
15751 range; instead, treat it as an extreme value.
15752 (Fset_window_configuration, compare_window_configurations):
15753 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15755 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15756 that can exceed INT_MAX. Check that EMACS_INT value is in range
15757 before assigning it to the (possibly-narrower) index.
15758 (match_limit): Don't assume that a fixnum can fit in 'int'.
15760 * print.c (print_object): Use ptrdiff_t, not int, for index that can
15763 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
15764 (Fvertical_motion): Don't wrap around LINES values that don't fit
15765 in 'int'. Instead, treat them as extreme values. This is good
15766 enough for windows, which can't have more than INT_MAX lines anyway.
15768 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15770 * Require libxml/parser.h to avoid compilation warning.
15772 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15774 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15775 since this reportedly can destroy thread storage.
15777 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
15779 * syntax.c (find_defun_start): Update all cache variables if
15780 exiting early (Bug#9401).
15782 2011-08-30 Eli Zaretskii <eliz@gnu.org>
15784 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15786 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15787 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15788 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15790 * term.c (tty_append_glyph): New function.
15791 (produce_stretch_glyph): Static function and its prototype deleted.
15793 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15796 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15798 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15799 when checking :margin (Bug#9390).
15800 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
15801 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
15802 so that the name doesn't mislead. All uses changed.
15804 2011-08-28 Johan Bockgård <bojohan@gnu.org>
15806 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15809 2011-08-27 Eli Zaretskii <eliz@gnu.org>
15811 * xdisp.c (move_it_to): Don't bail out early when reaching
15812 position beyond to_charpos, if we are scanning backwards.
15813 (move_it_vertically_backward): When DY == 0, make sure we get to
15814 the first character in the line after the newline.
15816 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15818 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15819 (ccl_driver): Do not generate an out-of-range pointer.
15820 (Fccl_execute_on_string): Remove unnecessary check for
15821 integer overflow, noted by Stefan Monnier in
15822 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15823 Remove a FIXME that didn't need fixing.
15824 Simplify the newly-introduced buffer reallocation code.
15826 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
15828 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15830 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
15832 Integer and memory overflow issues (Bug#9196).
15834 * doc.c (get_doc_string): Rework so that
15835 get_doc_string_buffer_size is the actual buffer size, rather than
15836 being 1 less than the actual buffer size; this makes xpalloc more
15839 * image.c (x_allocate_bitmap_record, cache_image):
15840 * xselect.c (Fx_register_dnd_atom):
15841 Simplify previous changes by using xpalloc.
15843 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15844 since either will do and ptrdiff_t is convenient with xpalloc.
15846 * charset.c (charset_table_size)
15847 (struct charset_sort_data.priority): Now ptrdiff_t.
15848 (charset_compare): Don't overflow if priorities differ greatly.
15849 (Fsort_charsets): Don't assume list length fits in int.
15850 Check for size-calculation overflow when allocating sort data.
15851 (syms_of_charset): Allocate an initial charset table that is
15852 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15854 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15856 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15857 The actual value is always <= INT_MAX, and leaving it unsigned made
15858 overflow checking harder.
15860 * dispextern.h (struct glyph_matrix.rows_allocated)
15861 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15862 with xpalloc. The values are still always <= INT_MAX.
15864 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15866 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15867 (SAFE_NALLOCA): New macro.
15869 * region-cache.c (struct boundary.pos, find_cache_boundary)
15870 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15871 (set_cache_region, invalidate_region_cache)
15872 (revalidate_region_cache, know_region_cache, region_cache_forward)
15873 (region_cache_backward, pp_cache):
15874 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15875 so that ptrdiff_t * can be passed to xpalloc.
15876 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15877 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15878 (pp_cache): Don't assume cache_len fits in int.
15879 * region-cache.h: Adjust extern decls to match.
15881 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15882 EMACS_INT, since either will do, for xpalloc.
15884 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15885 (xnmalloc, xnrealloc, xpalloc): New functions.
15887 * bidi.c (bidi_shelve_header_size): New constant.
15888 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15889 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15891 * bidi.c (bidi_cache_shrink):
15892 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15894 Don't update size of array until after memory allocation succeeds,
15895 because xmalloc/xrealloc may not return.
15896 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15897 now that we have proper integer overflow checking.
15898 (record_overlay_string, overlay_strings): Catch overflows when
15899 calculating size of overlay_str_buf.
15901 * callproc.c (Fcall_process): Check for size overflow when
15902 calculating size of args2.
15903 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15904 Normally we prefer signed values, but sticking with ptrdiff_t would
15905 require adding more-complicated checks.
15907 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15908 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15909 Redo buffer-overflow calculations to avoid integer overflow.
15910 Add a FIXME comment where memory seems to be over-allocated.
15912 * character.c (Fstring): Check for size-calculation overflow.
15914 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15915 unnecessary integer overflow. Check for size overflow.
15916 (encode_coding_object): Don't update size until xmalloc succeeds.
15918 * composite.c (get_composition_id): Check for overflow in glyph
15919 length calculations.
15921 Integer and memory overflow fixes for display code.
15922 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15923 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15924 (scrolling_window): Check for overflow in size calculations.
15925 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15926 Don't assume glyph table len fits in int.
15927 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15928 (row_table_size): Now ptrdiff_t, not int.
15929 (scrolling_window): Avoid overflow in size calculations.
15930 Don't update size until allocation succeeds.
15931 * fns.c (concat): Check for overflow in size calculations.
15932 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15933 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15934 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15936 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15937 (get_doc_string): Check for size calculation overflow.
15938 Don't update size until allocation succeeds.
15939 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15940 EMACS_INT, where ptrdiff_t will do.
15941 (Fsubstitute_command_keys): Check for string overflow.
15943 * editfns.c (set_time_zone_rule): Don't assume environment length
15945 (message_length): Now ptrdiff_t, not int.
15946 (Fmessage_box): Don't update size until allocation succeeds.
15947 Don't assume message length fits in int.
15948 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15950 * emacs.c (main): Do not reallocate argv, since there is a null at
15951 the end that can be overwritten, and this way there's no need to
15952 worry about size-calculation overflow.
15953 (sort_args): Check for size-calculation overflow.
15955 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15957 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15959 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15960 (x_set_scroll_bar_width, x_figure_window_size):
15961 Check for integer overflow.
15962 (x_set_alpha): Do not assume XINT fits in int.
15964 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15965 This is for the members text_lines, text_cols, total_lines, total_cols,
15966 where the system imposes an 'int' limit.
15968 * fringe.c (Fdefine_fringe_bitmap):
15969 Don't update size until alloc works.
15971 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15972 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15974 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15975 Check for size-calculation overflow.
15976 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15977 do, as we prefer signed integers.
15978 (id_to_widget.max_size, id_to_widget.used)
15979 (xg_store_widget_in_map, xg_remove_widget_from_map)
15980 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15981 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15982 Use and return ptrdiff_t, not int.
15983 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15984 * gtkutil.h: Change prototypes to match the above.
15986 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15987 are duplicate now that they've been promoted to lisp.h.
15988 (x_allocate_bitmap_record, x_alloc_image_color)
15989 (make_image_cache, cache_image, xpm_load):
15990 Don't update size until alloc is done.
15991 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15993 Check for size calculation overflow.
15994 (ct_colors_allocated_max): New constant.
15995 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15998 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15999 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16000 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16001 Use ptrdiff_t, not int, to count maps.
16002 (read_char_minibuf_menu_prompt): Check for overflow in size
16003 calculations. Don't update size until allocation succeeds.
16004 Redo calculations to avoid overflow.
16005 * keyboard.h: Change prototypes to match the above.
16007 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16009 (current_minor_maps): Check for size calculation overflow.
16010 * keymap.h: Change prototypes to match the above.
16012 * lread.c (read1, init_obarray): Don't update size until alloc done.
16014 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16015 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16017 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16018 Now ptrdiff_t, not int.
16019 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16020 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16022 * process.c (Fnetwork_interface_list): Check for overflow
16023 in size calculation.
16025 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16027 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16028 overflow. Don't bother calling xmalloc when xrealloc will do.
16030 * search.c (Freplace_match): Check for size calculation overflow.
16031 (Fset_match_data): Don't assume list lengths fit in 'int'.
16033 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16034 for command line length. Do not attempt to address one before the
16035 beginning of an array, as that's not portable.
16037 * term.c (max_frame_lines): Remove; unused.
16038 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16040 (encode_terminal_code, calculate_costs): Check for size
16041 calculation overflow.
16042 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16043 table lengths and related sizes. Don't update size until alloc
16044 done. Redo calculations to avoid overflow.
16045 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16047 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16048 subtracting pointers.
16049 (gobble_line): Check for overflow more carefully. Don't update size
16052 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16053 Don't update size until alloc done.
16054 Redo size calculations to avoid overflow.
16055 Check for size calculation overflow.
16056 (main) [DEBUG]: Fix typo in invoking tparam1.
16058 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16059 Use ptrdiff_t, not int, for sizes.
16060 (store_mode_line_noprop_char): Don't update size until alloc done.
16062 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16063 Use ptrdiff_t, not int, for sizes.
16064 (Finternal_make_lisp_face, cache_face):
16065 Check for size calculation overflow.
16066 (cache_face): Treat size calculation overflows as if they were
16067 memory exhaustion (the usual treatment), rather than aborting.
16069 * xfns.c (x_encode_text, x_set_name_internal)
16070 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16071 sizes, since they can exceed INT_MAX in size. Check for size
16072 calculation overflow.
16074 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16075 (xg_select): Check for size calculation overflow.
16076 Don't update size until alloc done.
16078 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16079 as sprintf is limited to int lengths.
16081 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16082 (X_LONG_MIN): New macros.
16083 Use them to make the following changes clearer.
16084 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16085 This change doesn't affect the value now, but it may help remind
16086 future maintainers not to raise the value too much later.
16087 (SELECTION_QUANTUM): Remove, replacing with ...
16088 (selection_quantum): ... new function, which avoids overflow.
16090 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16091 assumption that selection length fits in 'int'.
16092 (x_reply_selection_request, x_handle_selection_request)
16093 (x_get_window_property, receive_incremental_selection)
16094 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16095 (lisp_data_to_selection_data, clean_local_selection_data):
16096 Use ptrdiff_t, not int, to record length of selection.
16097 (x_reply_selection_request, x_get_window_property)
16098 (receive_incremental_selection, x_property_data_to_lisp):
16099 Redo calculations to avoid overflow.
16100 (x_reply_selection_request): When sending hint, ceiling it at
16101 X_LONG_MAX rather than relying on wraparound overflow to send
16103 (x_get_window_property, receive_incremental_selection)
16104 (lisp_data_to_selection_data, x_property_data_to_lisp):
16105 Check for size-calculation overflow.
16106 (x_get_window_property, receive_incremental_selection)
16107 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16108 Don't store size until memory allocation succeeds.
16109 (x_get_window_property): Plug memory leak on memory exhaustion.
16110 Don't double-block input; malloc is safe here. Don't assume 2**34
16111 - 4 fits in unsigned long. Add an xassert to check
16112 XGetWindowProperty overflow. Be more careful about overflow
16113 calculations, and distinguish size from memory overflow better.
16114 (receive_incremental_selection): When tracing, don't assume
16115 unsigned int is less than INT_MAX.
16116 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16117 harmful) conversions of unsigned short to int.
16118 (lisp_data_to_selection_data): Don't assume that integers
16119 in the range -65535 through -1 fit in an X unsigned short.
16120 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16121 result parameters unless successful. Rely on cons_to_unsigned
16122 to report problems with elements; the old code wasn't right anyway.
16123 (x_check_property_data): Check for int overflow; we cannot use
16124 a wider type due to X limits.
16125 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16127 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16129 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16130 (x_term_init): Check for size calculation overflow.
16131 (x_color_cells): Don't store size until memory allocation succeeds.
16132 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16133 Don't assume alloca size is less than MAX_ALLOCA.
16134 (x_term_init): Don't assume length fits in int (sprintf is limited
16137 Use ptrdiff_t for composition IDs.
16138 * character.c (lisp_string_width):
16139 * composite.c (composition_table_size, n_compositions)
16140 (get_composition_id, composition_gstring_from_id):
16141 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16142 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16143 * window.c (Frecenter):
16144 Use ptrdiff_t, not int, for composition IDs.
16145 * composite.c (get_composition_id): Check for integer overflow.
16146 * composite.h: Adjust prototypes to match the above changes.
16148 Use ptrdiff_t for hash table indexes.
16149 * category.c (hash_get_category_set):
16150 * ccl.c (ccl_driver):
16151 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16152 * coding.c (coding_system_charset_list, detect_coding_system):
16153 * coding.h (struct coding_system.id):
16154 * composite.c (get_composition_id, gstring_lookup_cache):
16155 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16156 * image.c (xpm_get_color_table_h):
16157 * lisp.h (hash_lookup, hash_put):
16158 * minibuf.c (Ftest_completion):
16159 Use ptrdiff_t for hash table indexes, not int (which is too
16160 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16161 32-bit --with-wide-int hosts).
16163 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16164 Add a FIXME comment about memory leaks.
16165 (syms_of_charset): Don't assume xmalloc returns.
16167 Don't assume that stated character widths fit in int.
16168 * character.c (Fchar_width, c_string_width, lisp_string_width):
16169 * character.h (CHAR_WIDTH):
16170 * indent.c (MULTIBYTE_BYTES_WIDTH):
16171 Use sanitize_char_width to avoid undefined and/or bad behavior
16172 with outlandish widths.
16173 * character.h (sanitize_tab_width): Rename from sanitize_width,
16174 now that we have two such functions. All uses changed.
16175 (sanitize_char_width): New inline function.
16177 Don't assume that tab-width fits in int.
16178 * character.h (sanitize_width): New inline function.
16179 (SANE_TAB_WIDTH): New macro.
16180 (ASCII_CHAR_WIDTH): Use it.
16181 * indent.c (sane_tab_width): Remove. All uses replaced by
16182 SANE_TAB_WIDTH (current_buffer).
16183 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16185 * fileio.c: Integer overflow issues with file modes.
16186 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16188 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16189 Remove unreachable code.
16190 (read_hex, load_charset_map_from_file): Check for integer overflow.
16192 * xterm.c: Don't go over XClientMessageEvent limit.
16193 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16194 (x_send_scroll_bar_event): Likewise. Check that the size does not
16195 exceed limits imposed by XClientMessageEvent, as well as the usual
16196 ptrdiff_t and size_t limits.
16198 * keyboard.c: Overflow, signedness and related fixes.
16199 (make_lispy_movement): Use same integer type in forward decl
16200 that is used in the definition.
16201 (read_key_sequence, keyremap_step):
16202 Change bufsize argument back to int, undoing my 2011-03-30 change.
16203 We prefer signed types, and int is wide enough here.
16204 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16205 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16206 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16207 length, not size_t. Use ptrdiff_t for index, not int.
16208 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16209 possibility of integer overflow.
16211 Overflow, signedness and related fixes for images.
16213 * dispextern.h (struct it.stack[0].u.image.image_id)
16214 (struct_it.image_id, struct image.id, struct image_cache.size)
16215 (struct image_cache.used, struct image_cache.ref_count):
16216 * gtkutil.c (update_frame_tool_bar):
16217 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16218 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16219 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16220 * nsmenu.m (update_frame_tool_bar):
16221 * xdisp.c (calc_pixel_width_or_height):
16222 * xfns.c (image_cache_refcount):
16223 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16224 on typical 64-bit hosts.
16226 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16227 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16228 Omit unnecessary casts to int.
16229 (parse_image_spec): Check that integers fall into 'int' range
16230 when the callers expect that.
16231 (image_ascent): Redo ascent calculation to avoid int overflow.
16232 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16233 (lookup_image): Remove unnecessary tests.
16234 (xbm_image_p): Locals are now of int, not EMACS_INT,
16235 since parse_image_check makes sure they fit into int.
16236 (png_load, gif_load, svg_load_image):
16237 Prefer int to unsigned where either will do.
16238 (tiff_handler): New function, combining the cores of the
16239 old tiff_error_handler and tiff_warning_handler.
16240 This function is rewritten to use vsnprintf and thereby avoid
16241 stack buffer overflows. It uses only the features of vsnprintf
16242 that are common to both POSIX and native Microsoft.
16243 (tiff_error_handler, tiff_warning_handler): Use it.
16244 (tiff_load, gif_load, imagemagick_load_image):
16245 Don't assume :index value fits in 'int'.
16246 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16247 (imagemagick_load_image): Check that crop parameters fit into
16248 the integer types that MagickCropImage accepts. Don't assume
16249 Vimagemagick_render_type has a nonnegative value. Don't assume
16250 size_t fits in 'long'.
16251 (gs_load): Use printmax_t to print the widest integers possible.
16252 Check for integer overflow when computing image height and width.
16254 2011-08-26 Eli Zaretskii <eliz@gnu.org>
16256 * xdisp.c (redisplay_window): Don't force window start if point
16257 will be invisible in the resulting window. (Bug#9324)
16259 2011-08-25 Eli Zaretskii <eliz@gnu.org>
16261 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16262 the display spec is of the form `(space ...)'.
16263 (handle_display_spec): Return the value returned by
16264 handle_single_display_spec, not just 1 or zero.
16265 (handle_single_display_spec): If the display spec is of the form
16266 `(space ...)', and specifies display in the text area, return 2
16268 (try_cursor_movement): Check for the need to scroll more
16269 accurately, and prefer exact match for point under bidi.
16270 Don't advance `row' beyond the last row of the window.
16272 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16273 into disp_prop; all users changed.
16275 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16276 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16277 for the text covered by the display property.
16279 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
16281 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16282 Change return value to nil.
16283 (Frecord_buffer): Delete unused function.
16285 2011-08-24 Eli Zaretskii <eliz@gnu.org>
16287 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16288 buffers, return left-to-right.
16289 (set_cursor_from_row): Consider candidate row a win if its glyph
16290 represents a newline and point is on that newline. Fixes cursor
16291 positioning on the newline at EOL of R2L text within L2R
16292 paragraph, and vice versa.
16293 (try_cursor_movement): Check continued rows, in addition to
16294 continuation rows. Fixes unwarranted scroll when point enters a
16295 continued line of R2L text within an L2R paragraph, or vice versa.
16296 (cursor_row_p): Consider the case of point being equal to
16297 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16298 from the end of a short line to the beginning of a continued line
16299 of R2L text within L2R paragraph.
16300 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16301 composed characters.
16303 * bidi.c (bidi_check_type): Use xassert.
16304 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16307 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16309 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16312 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
16314 * nsfont.m (ns_otf_to_script): Fix typo.
16316 2011-08-22 Kenichi Handa <handa@m17n.org>
16318 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16319 extra slot even if the purpose is char-code-property-table.
16321 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16323 * xdisp.c (redisplay_window): When computing centering_position,
16324 account for the height of the header line. (Bug#8874)
16326 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16327 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16328 candidate is selected by the mouse, and that candidate has a
16329 composed character under the mouse.
16331 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16332 coordinates reported by pos-visible-in-window-p for a composed
16333 character in column zero.
16335 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16337 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16339 2011-08-22 Eli Zaretskii <eliz@gnu.org>
16341 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16342 consider it a hit if to_charpos is anywhere in the range of the
16343 composed buffer positions.
16345 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
16347 * image.c (gif_load): Don't assume that each subimage has the same
16348 dimensions as the base image. Handle disposal method that is
16349 "undefined" by the gif spec (Bug#9335).
16351 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
16353 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
16354 (Fcondition_case): Document `debug' symbol in error handler.
16356 2011-08-19 Eli Zaretskii <eliz@gnu.org>
16358 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16359 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16360 from an Org mode buffer to a Speedbar frame.
16362 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16363 a composition, take its buffer position from IT->cmp_it.charpos.
16364 Fixes cursor positioning at the beginning of a line that begins
16365 with a composed character.
16367 2011-08-18 Eli Zaretskii <eliz@gnu.org>
16369 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16370 character bidirectional type, use STRONG_L instead. Fixes crashes
16371 in a buffer produced by `describe-categories'.
16373 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16374 members before the level stack, so they would be saved and
16375 restored when copying iterator state. Fixes incorrect reordering
16376 around TABs covered by display properties.
16378 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16380 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16382 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
16384 * eval.c (internal_condition_case, internal_condition_case_1)
16385 (internal_condition_case_2, internal_condition_case_n):
16386 Remove unnecessary aborts (Bug#9081).
16388 2011-08-17 Eli Zaretskii <eliz@gnu.org>
16390 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16391 has no `load' handler, try opening the file locally. (Bug#9311)
16393 2011-08-16 Ken Brown <kbrown@cornell.edu>
16395 * gmalloc.c: Expand comment.
16397 2011-08-16 Eli Zaretskii <eliz@gnu.org>
16399 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16400 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16402 2011-08-16 Ken Brown <kbrown@cornell.edu>
16404 Fix memory allocation problems in Cygwin build (Bug#9273).
16406 * unexcw.c ( __malloc_initialized): Declare external variable.
16407 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16409 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16411 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16413 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16414 in the static heap.
16415 [CYGWIN] (special_realloc): New function.
16416 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16417 requests to realloc storage in the static heap.
16419 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16421 * bidi.c (bidi_initialize): Remove unused local.
16423 2011-08-15 Eli Zaretskii <eliz@gnu.org>
16426 * biditype.h: Remove file.
16427 * makefile.w32-in ($(BLD)/bidi.$(O)):
16428 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16430 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16432 * chartab.c: Improve commentary for the uniprop_table API.
16434 * bidi.c (bidi_paragraph_init): Support zero value of
16435 bidi_ignore_explicit_marks_for_paragraph_level.
16436 (bidi_initialize): Use uniprop_table instead of including
16437 biditype.h and bidimirror.h.
16439 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16440 coordinates of the iterator when restoring from ppos_it.
16443 2011-08-14 Kenichi Handa <handa@m17n.org>
16445 * process.c (create_process): Call setup_process_coding_systems
16446 after the pid of the process is set to -1 (Bug#8162).
16448 2011-08-14 Eli Zaretskii <eliz@gnu.org>
16450 * xdisp.c (move_it_in_display_line_to): Don't invoke
16451 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16452 ppos_it. Fixes vertical cursor motion when line beginning is
16453 covered by an image. (Bug#9296)
16455 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16457 * nsterm.h (ns_run_ascript): Declare.
16458 (NSAPP_DATA2_RUNASSCRIPT): Define.
16460 * nsfns.m (as_script, as_result, as_status): New static variables.
16461 (ns_run_ascript): New function.
16462 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
16463 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16464 the event loop. Get status from as_status (Bug#7276).
16466 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16467 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16468 the event loop (Bug#7276).
16470 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16472 * gnutls.c (QCgnutls_bootprop_priority)
16473 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16474 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16475 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16476 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16477 (QCgnutls_bootprop_verify_hostname_error)
16478 (QCgnutls_bootprop_callbacks_verify): Rename from
16479 Qgnutls_bootprop_..., all uses changed.
16481 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16484 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16486 * xfaces.c (Qframe_set_background_mode): Now static.
16487 * dispextern.h (Qframe_set_background_mode): Remove decl.
16489 * process.c (Fnetwork_interface_info): Declare local only if needed.
16491 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16493 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16494 (Fnetwork_interface_list): Allocate in increments of bytes instead
16495 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16496 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16498 (struct ifflag_def): notrailers is smart on OSX.
16499 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16500 Get hardware address with getifaddrs if available.
16502 2011-08-12 Eli Zaretskii <eliz@gnu.org>
16504 * xdisp.c (iterate_out_of_display_property): xassert that
16505 IT->position is set to within IT->object's boundaries. Break from
16506 the loop as soon as EOB is reached; avoids infloops in redisplay
16507 when IT->position is set up wrongly due to some bug.
16508 Set IT->current to match the bidi iterator unconditionally.
16509 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16510 entry. Force push_it to save on the stack the current
16511 buffer/string position, to be restored by pop_it. Fix flags in
16512 the iterator structure wrt the object coming from a display
16513 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16514 properties. (Bug#9284)
16516 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
16518 * fontset.c (fontset_get_font_group): Add proper type checks.
16521 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16523 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16524 and LC_VERSION_MIN_MACOSX.
16525 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16526 (dump_it) [LC_FUNCTION_STARTS]: Use it.
16528 2011-08-08 Eli Zaretskii <eliz@gnu.org>
16530 * xdisp.c (forward_to_next_line_start): Allow to use the
16531 no-display-properties-and-no-overlays under bidi display.
16532 Set disp_pos in the bidi iterator to avoid searches for display
16533 properties and overlays.
16535 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
16537 * editfns.c (Fset_time_zone_rule): Document relationship with the
16540 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16541 the font entity extracted from the cache (Bug#8109).
16543 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
16545 * composite.c (autocmp_chars): Don't reset point. That is done by
16546 restore_point_unwind (Bug#5984).
16548 2011-08-07 Juri Linkov <juri@jurta.org>
16550 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16551 to show the arg `TIME' instead of `TIMEVAL'.
16553 2011-08-06 Eli Zaretskii <eliz@gnu.org>
16555 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16556 display property strides EOL and includes a newline, as in
16557 longlines-mode. (Bug#9254)
16558 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16559 word-wrap under bidirectional display. (Bug#9224)
16561 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16562 is non-zero, even if the data buffer is NULL. Fixes a crash in
16563 vertical-motion with longlines-mode. (Bug#9254)
16565 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16567 * bidi.c <bidi_cache_total_alloc>: Now static.
16568 (bidi_initialize): Initialize bidi_cache_total_alloc.
16570 * xdisp.c (display_line): Release buffer allocated for shelved bidi
16573 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16574 amount allocated this far in `bidi_cache_total_alloc'.
16575 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16576 non-zero, only free the data buffer without restoring the cache
16577 contents. All callers changed.
16579 * dispextern.h (bidi_unshelve_cache): Update prototype.
16581 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16582 (move_it_in_display_line, move_it_to)
16583 (move_it_vertically_backward, move_it_by_lines): Replace the call
16584 to xfree to an equivalent call to bidi_unshelve_cache.
16585 (move_it_in_display_line_to): Fix logic of returning
16586 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
16588 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16590 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16591 came from a string character with a `cursor' property. (Bug#9229)
16593 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16595 * Makefile.in (LIB_PTHREAD): New variable.
16596 (LIBES): Add LIB_PTHREAD (Bug#9216).
16598 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16599 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16601 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16603 * regex.c (re_iswctype): Remove some redundant boolean conversions.
16605 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16607 * xterm.c (x_find_topmost_parent): New function.
16608 (x_set_frame_alpha): Find topmost parent window with
16609 x_find_topmost_parent and set the property there also (bug#9181).
16610 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16612 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16614 * callproc.c (Fcall_process): Avoid vfork clobbering
16615 the local vars buffer, coding_systems, current_dir.
16617 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16619 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16621 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16623 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16624 so that it is not optimized away.
16626 * xdisp.c (compute_display_string_pos): Remove unused local.
16628 2011-08-02 Eli Zaretskii <eliz@gnu.org>
16630 Fix slow cursor motion and scrolling in large buffers with
16631 selective display, like Org Mode buffers. (Bug#9218)
16633 * dispextern.h (struct bidi_it): New member disp_prop_p.
16635 * xdisp.c: Remove one-slot cache of display string positions.
16636 (compute_display_string_pos): Accept an additional argument
16637 DISP_PROP_P; callers changed. Scan at most 5K characters forward
16638 for a display string or property. If found, set DISP_PROP_P
16641 * bidi.c (bidi_fetch_char): Accept an additional argument
16642 DISP_PROP_P, and pass it to compute_display_string_pos.
16643 Only handle text covered by a display string if DISP_PROP_P is returned
16644 non-zero. All callers of bidi_fetch_char changed.
16646 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16648 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16650 2010-12-03 Don March <don@ohspite.net>
16652 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16653 last character M-[char] is translated to ESC [char] (bug#7541).
16655 2011-08-02 Kenichi Handa <handa@m17n.org>
16657 * lisp.h (uniprop_table): Extern it.
16659 * chartab.c (uniprop_table): Make it non-static.
16661 2011-08-01 Eli Zaretskii <eliz@gnu.org>
16663 * xdisp.c (forward_to_next_line_start): Accept additional argument
16664 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16666 (reseat_at_next_visible_line_start): Use the bidi iterator state
16667 returned by forward_to_next_line_start to restore the state of
16668 it->bidi_it after backing up to previous newline. (Bug#9212)
16670 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16672 * regex.c (re_comp): Protoize.
16673 (re_exec): Fix return type.
16674 (regexec): Fix type of `ret'. (Bug#9203)
16676 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16678 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16679 This is needed if max-image-size is a floating-point number.
16681 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16683 * print.c (print_object): Print empty symbol as ##.
16685 * lread.c (read1): Read ## as empty symbol.
16687 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16689 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16690 setting frame foreground color (Bug#9175).
16691 (x_set_background_color): Likewise.
16693 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16694 contents (Bug#9176).
16695 (EmacsTooltip -init): Remove bezels and add shadows to
16698 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16699 or scroll bar (Bug#8470).
16701 * nsfont.m (nsfont_open): Remove assignment to voffset and
16702 unnecessary vars hshink, expand, hd, full_height, min_height.
16703 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16705 * nsterm.h (nsfont_info): Remove voffset field.
16707 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16709 Implement strike-through and overline on NextStep (Bug#8863).
16711 * nsfont.m (nsfont_open): Use underline position provided by font,
16712 instead of hard-coded value of 2.
16713 (nsfont_draw): Call ns_draw_text_decoration instead.
16715 * nsterm.h: Add declaration for ns_draw_text_decoration.
16717 * nsterm.m (ns_draw_text_decoration): New function for drawing
16718 underline, overline, and strike-through.
16719 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16720 ns_draw_text_decoration. Change treatment of cursor drawing to
16721 accommodate underlining, etc.
16723 2011-07-28 Eli Zaretskii <eliz@gnu.org>
16725 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16728 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16730 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16731 Without this fix, if a signal arrives just after memory fills up,
16732 'malloc' might be invoked reentrantly.
16734 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16735 In other words, assume that every image size is allowed, on non-X
16736 hosts. This assumption is probably wrong, but it lets Emacs compile.
16738 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16740 * regex.c (re_iswctype): Convert return values to boolean.
16742 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16744 * xdisp.c (compute_display_string_pos): Don't use cached display
16745 string position if the buffer had its restriction changed.
16748 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16750 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16752 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16754 Integer signedness and overflow and related fixes. (Bug#9079)
16756 * bidi.c: Integer size and overflow fixes.
16757 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16758 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16759 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16760 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16761 (bidi_find_other_level_edge):
16762 Use ptrdiff_t instead of EMACS_INT where either will do.
16763 This works better on 32-bit hosts configured --with-wide-int.
16764 (bidi_cache_ensure_space): Check for size-calculation overflow.
16765 Use % rather than repeated addition, for better worst-case speed.
16766 Don't set bidi_cache_size until after xrealloc returns, because it
16768 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
16769 (bidi_cache_ensure_space): Also check that the bidi cache size
16770 does not exceed that of the largest Lisp string or buffer. See Eli
16771 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
16773 * alloc.c (__malloc_size_t): Remove.
16774 All uses replaced by size_t. See Andreas Schwab's note
16775 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16777 * image.c: Improve checking for integer overflow.
16778 (check_image_size): Assume that f is nonnull, since
16779 it is always nonnull in practice. This is one less thing to
16780 worry about when checking for integer overflow later.
16781 (x_check_image_size): New function, which checks for integer
16782 overflow issues inside X.
16783 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16784 This removes the need for a memory_full check.
16785 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16786 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16787 (xbm_read_bitmap_data): Change locals back to 'int', since
16788 their values must fit in 'int'.
16789 (xpm_load_image, png_load, tiff_load):
16790 Invoke x_create_x_image_and_pixmap earlier,
16791 to avoid much needless work if the image is too large.
16792 (tiff_load): Treat overly large images as if
16793 x_create_x_image_and_pixmap failed, not as malloc failures.
16794 (gs_load): Use x_check_image_size.
16796 * gtkutil.c: Omit integer casts.
16797 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16798 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16800 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16802 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16803 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16804 would wrongly return t on a 64-bit host.
16806 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16807 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16808 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16809 and therefore cause GCC to emit a bogus diagnostic in some cases.
16811 * image.c: Integer signedness and overflow and related fixes.
16812 This is not an exhaustive set of fixes, but it's time to
16813 record what I've got.
16814 (lookup_pixel_color, check_image_size): Remove redundant decls.
16815 (check_image_size): Don't assume that arbitrary EMACS_INT values
16816 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16817 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16818 (tiff_load, imagemagick_load_image):
16819 Check for overflow in size calculations.
16820 (x_create_x_image_and_pixmap): Remove unnecessary test for
16821 xmalloc returning NULL; that can't happen.
16822 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16823 (xpm_color_bucket): Use better integer hashing function.
16824 (xpm_cache_color): Don't possibly over-allocate memory.
16825 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16826 (gif_memory_source):
16827 Use ptrdiff_t, not int or size_t, to record sizes.
16828 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16829 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16830 either works, as we prefer signed integers.
16831 (tiff_read_from_memory, tiff_write_from_memory):
16832 Return tsize_t, not size_t, since that's what the TIFF API wants.
16833 (tiff_read_from_memory): Don't fail simply because the read would
16834 go past EOF; instead, return a short read.
16835 (tiff_load): Omit no-longer-needed casts.
16836 (Fimagemagick_types): Don't assume size fits into 'int'.
16838 Improve hashing quality when configured --with-wide-int.
16839 * fns.c (hash_string): New function, taken from sxhash_string.
16840 Do not discard information about ASCII character case; this
16841 discarding is no longer needed.
16842 (sxhash-string): Use it. Change sig to match it. Caller changed.
16843 * lisp.h: Declare it.
16844 * lread.c (hash_string): Remove, since we now use fns.c's version.
16845 The fns.c version returns a wider integer if --with-wide-int is
16846 specified, so this should help the quality of the hashing a bit.
16848 * emacs.c: Integer overflow minor fix.
16849 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16850 Define only if GNU_LINUX.
16851 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16853 * dispnew.c: Integer signedness and overflow fixes.
16854 Remove unnecessary forward decls, that were a maintenance hassle.
16855 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16857 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16858 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16859 (prepare_desired_row, line_draw_cost):
16860 Use int, not unsigned, where either works.
16861 (save_current_matrix, restore_current_matrix):
16862 Use ptrdiff_t, not size_t, where either works.
16863 (init_display): Check for overflow more accurately, and without
16864 relying on undefined behavior.
16866 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16867 Remove, replacing with the new symbols in lisp.h. All uses changed.
16868 * fileio.c (make_temp_name):
16869 * filelock.c (lock_file_1, lock_file):
16870 * xdisp.c (message_dolog):
16871 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16872 Use pMd etc. instead.
16873 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16874 replacing the pWIDE etc. symbols removed from editfns.c.
16876 * keyboard.h (num_input_events): Now uintmax_t.
16877 This is (very slightly) less likely to mess up due to wraparound.
16880 * buffer.c: Integer signedness fixes.
16881 (alloc_buffer_text, enlarge_buffer_text):
16882 Use ptrdiff_t rather than size_t when either will do, as we prefer
16885 * alloc.c: Integer signedness and overflow fixes.
16886 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16887 (__malloc_size_t): Default to size_t, not to int.
16888 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16889 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16890 Prefer ptrdiff_t to size_t when either would do, as we prefer
16892 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16893 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16894 Now const. Initialize with values that are in range even if char
16896 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16897 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16898 These functions do the right thing with sizes > 2**32.
16899 (check_depth): Now ptrdiff_t, not int.
16900 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16901 Adjust to new way of storing sizes. Check for size overflow bugs
16903 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16904 slightly wrong anyway, as it missed one instance of
16905 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16906 (refill_memory_reserve): Omit needless cast to size_t.
16907 (mark_object_loop_halt): Mark as externally visible.
16909 * xselect.c: Integer signedness and overflow fixes.
16910 (Fx_register_dnd_atom, x_handle_dnd_message):
16911 Use ptrdiff_t, not size_t, since we prefer signed.
16912 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16913 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16914 x_dnd_atoms_size and x_dnd_atoms_length.
16916 * doprnt.c: Prefer signed to unsigned when either works.
16918 * doprnt.c (doprnt):
16920 * xdisp.c (vmessage):
16921 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16922 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16923 prefer signed arithmetic to avoid comparison confusion.
16924 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16925 but is a bit tricky.
16927 Assume freestanding C89 headers, string.h, stdlib.h.
16928 * data.c, doprnt.c, floatfns.c, print.c:
16929 Include float.h unconditionally.
16930 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16931 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16932 * regex.c: Likewise for stddef.h, string.h.
16933 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16934 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16935 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16936 (STDC_HEADERS): Remove obsolete defines.
16937 * sysdep.c: Include limits.h unconditionally.
16939 Assume support for memcmp, memcpy, memmove, memset.
16940 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16941 * regex.c (memcmp, memcpy):
16942 Remove; we assume C89 now.
16944 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16945 (__malloc_safe_bcopy): Remove; no longer needed.
16947 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
16948 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16949 well either way, and we prefer signed to unsigned.
16951 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16953 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16954 closes the connection while we're reading (bug#9182).
16956 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
16958 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16959 are specified (Bug#9168).
16961 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16963 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16964 Found by GCC static checking and --with-wide-int on a 32-bit host.
16966 2011-07-25 Eli Zaretskii <eliz@gnu.org>
16968 * xdisp.c (compute_display_string_pos): Fix logic of caching
16969 previous display string position. Initialize cached_prev_pos to
16970 -1. Fixes slow-down at the beginning of a buffer.
16972 2011-07-24 Eli Zaretskii <eliz@gnu.org>
16974 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16975 for attrs[LFACE_FONTSET_INDEX].
16977 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16979 * xml.c (parse_region): Remove unused local
16980 that was recently introduced.
16982 2011-07-23 Eli Zaretskii <eliz@gnu.org>
16984 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16985 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16987 * xdisp.c (move_it_in_display_line_to): Record the best matching
16988 position for TO_CHARPOS while scanning the line, and restore it on
16989 exit if none of the characters scanned was an exact match.
16990 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
16991 when exact match is impossible due to invisible text, and the
16992 lines are truncated.
16994 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16996 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16999 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17001 Fix a significant slow-down of cursor motion with C-n, C-p,
17002 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17003 auto-repeat under bidi redisplay in fontified buffers.
17004 * xdisp.c (compute_stop_pos_backwards): New function.
17005 (next_element_from_buffer): Call compute_stop_pos_backwards to
17006 find a suitable prev_stop when we find ourselves before
17008 (reseat): Don't look for prev_stop, as that could mean a very long
17010 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17011 <cached_disp_overlay_modiff>: Cache for last found display string
17013 (compute_display_string_pos): Return the cached position if asked
17014 about the same buffer in the same area of character positions, and
17015 the buffer wasn't changed since the time the display string
17016 position was cached.
17018 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17020 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17021 is an integer, which is important for empty lines. (Bug#9149)
17023 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17025 * frame.c (Fmodify_frame_parameters): In tty case, update the
17026 default face if necessary (Bug#4238).
17028 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17030 * editfns.c (Fstring_to_char): No need to explain what a character
17031 is in the docstring (Bug#6576).
17033 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17035 * xml.c (parse_region): Make sure we always return a tree.
17037 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17039 * xml.c (parse_region): If a document contains only comments,
17042 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17044 * xml.c (make_dom): Return comments, too.
17046 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17049 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17050 and the surrounding thread.
17051 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17052 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17053 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17055 * s/openbsd.h (BROKEN_SIGIO): Define.
17056 * unexelf.c (unexec) [__OpenBSD__]:
17057 Don't update the .mdebug section of the Alpha COFF symbol table.
17059 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17061 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17064 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17066 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17067 This fixes some race conditions on the permissions of any newly
17070 * alloc.c (valid_pointer_p): Use pipe, not open.
17071 This fixes some permissions issues when debugging.
17073 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17074 If fchown fails to set both uid and gid, try to set just gid,
17075 as that is sometimes allowed. Adjust the file's mode to eliminate
17076 setuid or setgid bits that are inappropriate if fchown fails.
17078 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17080 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17081 to compare Lisp_Objects.
17082 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17083 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17084 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17086 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17088 * lread.c (read_integer): Unread even EOF character.
17089 (read1): Likewise. Properly record start position of symbol.
17091 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17092 symbol character follows.
17094 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17096 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17097 This works around a problem with the previous change to Fcopy_file.
17098 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17099 and without this change, GCC might complain about discarding
17100 fchown's return value.
17102 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17104 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17106 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17108 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17110 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17112 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17113 it's used from the C level.
17115 * process.c: Use the same condition for POLL_FOR_INPUT in both
17116 keyboard.c and process.c (bug#1858).
17118 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17120 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17121 (Fgnutls_boot): Use it.
17123 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17125 * doc.c (Fsubstitute_command_keys): Revert last change.
17127 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17129 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17130 quotes the next character, and doesn't affect other longer
17131 sequences (bug#8935).
17133 * lread.c (syms_of_lread): Clarify that is isn't only
17134 `eval-buffer' and `eval-defun' that's affected by
17135 `lexical-binding' (bug#8460).
17137 2011-07-15 Eli Zaretskii <eliz@gnu.org>
17139 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17140 bidi redisplay when a line includes both an image and is truncated.
17142 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17144 Fix minor problems found by static checking.
17145 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17146 (elsz): Now a signed constant, not a size_t var. We prefer signed
17147 types to unsigned, to avoid integer comparison confusion. Without
17148 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17149 "cannot optimize loop, the loop counter may overflow", a symptom
17151 * indent.c (Fvertical_motion): Mark locals as initialized.
17152 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17154 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17156 * search.c (Fre_search_backward): Mention `case-fold-search' in
17157 all the re_search_* functions (bug#8138).
17159 * keyboard.c (Fopen_dribble_file): Document when the file is
17162 2011-07-14 Eli Zaretskii <eliz@gnu.org>
17164 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17167 Support bidi reordering of display and overlay strings.
17168 * xdisp.c (compute_display_string_pos)
17169 (compute_display_string_end): Accept additional argument STRING.
17170 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17171 (reseat_to_string): Initialize bidi_it->string.s and
17172 bidi_it->string.schars.
17173 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17174 NULL (avoids a crash in bidi_paragraph_init).
17175 Initialize itb.string.lstring.
17176 (init_iterator): Call bidi_init_it only of a valid
17177 buffer position was specified. Initialize paragraph_embedding to
17179 (reseat_to_string): Initialize the bidi iterator.
17180 (display_string): If we need to ignore text properties of
17181 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17182 original value of -1 will not work with bidi.)
17183 (compute_display_string_pos): First arg is now struct
17184 `text_pos *'; all callers changed. Support display properties on
17186 (compute_display_string_end): Support display properties on Lisp
17188 (init_iterator, reseat_1, reseat_to_string): Initialize the
17189 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17190 when iterating on a string not from display properties).
17191 (compute_display_string_pos, compute_display_string_end):
17192 Fix calculation of the object to scan. Fixes an error when using
17194 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17195 base_level_stop; instead, set base_level_stop to BEGV.
17196 Fixes crashes in vertical-motion.
17197 (next_element_from_buffer): Improve commentary for when
17198 the iterator is before prev_stop.
17199 (init_iterator): Initialize bidi_p from the default value of
17200 bidi-display-reordering, not from buffer-local value. Use the
17201 buffer-local value only if initializing for buffer iteration.
17202 (handle_invisible_prop): Support invisible properties on strings
17203 that are being bidi-reordered.
17204 (set_iterator_to_next): Support bidi reordering of C strings and
17206 (next_element_from_string): Support bidi reordering of Lisp
17208 (handle_stop_backwards): Support Lisp strings as well.
17209 (display_string): Support display of R2L glyph rows.
17210 Use IT_STRING_CHARPOS when displaying from a Lisp string.
17211 (init_iterator): Don't initialize it->bidi_p for strings
17213 (reseat_to_string): Initialize it->bidi_p for strings here.
17214 (next_element_from_string, next_element_from_c_string)
17215 (next_element_from_buffer): Add xassert's for correspondence
17216 between IT's object being iterated and it->bidi_it.string
17218 (face_before_or_after_it_pos): Support bidi iteration.
17219 (next_element_from_c_string): Handle the case of the first string
17220 character that is not the first one in the visual order.
17221 (get_visually_first_element): New function, refactored from common
17222 parts of next_element_from_buffer, next_element_from_string, and
17223 next_element_from_c_string.
17224 (tool_bar_lines_needed, redisplay_tool_bar)
17225 (display_menu_bar): Force left-to-right direction. Add a FIXME
17226 comment for making that be controlled by a user option.
17227 (push_it, pop_it): Save and restore the state of the
17228 bidi iterator. Save and restore the bidi_p flag.
17229 (pop_it): Iterate out of display property for string iteration as
17231 (iterate_out_of_display_property): Support iteration over strings.
17232 (handle_single_display_spec): Set up it->bidi_it for iteration
17233 over a display string, and call bidi_init_it.
17234 (handle_single_display_spec, next_overlay_string)
17235 (get_overlay_strings_1, push_display_prop): Set up the bidi
17236 iterator for displaying display or overlay strings.
17237 (forward_to_next_line_start): Don't use the shortcut if
17239 (back_to_previous_visible_line_start): If handle_display_prop
17240 pushed the iterator stack, restore the internal state of the bidi
17241 iterator by calling bidi_pop_it same number of times.
17242 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17243 and we are bidi-iterating, don't decrement the iterator position;
17244 instead, set the first_elt flag in the bidi iterator, to produce
17246 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17247 (push_display_prop): xassert that we are iterating a buffer.
17248 (push_it, pop_it): Save and restore paragraph_embedding member.
17249 (handle_single_display_spec, next_overlay_string)
17250 (get_overlay_strings_1, reseat_1, reseat_to_string)
17251 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17252 correctly. Don't assume unibyte strings are not bidi-reordered.
17253 (compute_display_string_pos)
17254 (compute_display_string_end): Fix handling the case of C string.
17255 (push_it, pop_it): Save and restore from_disp_prop_p.
17256 (handle_single_display_spec, push_display_prop): Set the
17257 from_disp_prop_p flag.
17258 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17259 (pop_it): Call iterate_out_of_display_property only if we are
17260 popping after iteration over a string that came from a display
17261 property. Fix a typo in popping stretch info. Add an assertion
17262 for verifying that the iterator position is in sync with the bidi
17264 (handle_single_display_spec, get_overlay_strings_1)
17265 (push_display_prop): Fix initialization of paragraph direction for
17266 string when that of the parent object is not yet determined.
17267 (reseat_1): Call bidi_init_it to resync the bidi
17268 iterator with IT's position. (Bug#7616)
17269 (find_row_edges): If ROW->start.pos gives position
17270 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17271 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17272 Reset the from_disp_prop_p flag.
17273 (SAVE_IT, RESTORE_IT): New macros.
17274 (pos_visible_p, face_before_or_after_it_pos)
17275 (back_to_previous_visible_line_start)
17276 (move_it_in_display_line_to, move_it_in_display_line)
17277 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17278 (try_scrolling, redisplay_window, display_line): Use them when
17279 saving a temporary copy of the iterator and restoring it back.
17280 (back_to_previous_visible_line_start, reseat_1)
17281 (init_iterator): Empty the bidi cache "stack".
17282 (move_it_in_display_line_to): If iterator ended up at
17283 EOL, but we never saw any buffer positions smaller than
17284 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17285 motion in bidi-reordered lines.
17286 (move_it_in_display_line_to): Record prev_method and prev_pos
17287 immediately before the call to set_iterator_to_next. Fixes cursor
17288 motion in bidi-reordered lines with stretch glyphs and strings
17289 displayed in margins. (Bug#8133) (Bug#8867)
17290 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17292 (pos_visible_p): Support positions in bidi-reordered lines.
17293 Save and restore bidi cache.
17295 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17296 (bidi_paragraph_info): Delete unused struct.
17297 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17298 (bidi_cache_start): New variable.
17299 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17301 (bidi_cache_fetch_state, bidi_cache_search)
17302 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17303 (bidi_cache_find, bidi_peek_at_next_level)
17304 (bidi_level_of_next_char, bidi_find_other_level_edge)
17305 (bidi_move_to_visually_next): Compare cache index with
17306 bidi_cache_start rather than with zero.
17307 (bidi_fetch_char): Accept new argument STRING; all callers
17308 changed. Support iteration over a string. Support strings with
17309 display properties. Support unibyte strings. Fix the type of
17310 `len' according to what STRING_CHAR_AND_LENGTH expects.
17311 (bidi_paragraph_init, bidi_resolve_explicit_1)
17312 (bidi_resolve_explicit, bidi_resolve_weak)
17313 (bidi_level_of_next_char, bidi_move_to_visually_next):
17314 Support iteration over a string.
17315 (bidi_set_sor_type, bidi_resolve_explicit_1)
17316 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17317 can now be zero (for strings); special values 0 and -1 were
17318 changed to -1 and -2, respectively.
17319 (bidi_char_at_pos): New function.
17320 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17321 Call it instead of FETCH_MULTIBYTE_CHAR.
17322 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17323 initialized to valid values.
17324 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17326 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17327 the test for valid cached positions. Fix the logic for looking up
17328 the sentinel state in the cache. GCPRO the Lisp string we are
17330 (bidi_push_it, bidi_pop_it): New functions.
17331 (bidi_initialize): Initialize the bidi cache start stack pointer.
17332 (bidi_cache_ensure_space): New function, refactored from part of
17333 bidi_cache_iterator_state. Don't assume the required size is just
17334 one BIDI_CACHE_CHUNK away.
17335 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17336 (bidi_count_bytes, bidi_char_at_pos): New functions.
17337 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17338 always valid if bidi_cache_idx is valid.
17339 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17340 is valid if it's going to be used.
17341 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17342 (bidi_cache_fetch_state, bidi_cache_search)
17343 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17344 (bidi_cache_iterator_state, bidi_cache_find)
17345 (bidi_find_other_level_edge, bidi_cache_start_stack):
17346 All variables related to cache indices are now EMACS_INT.
17348 * dispextern.h (struct bidi_string_data): New structure.
17349 (struct bidi_it): New member `string'. Make flag members be 1-bit
17350 fields, and put them last in the struct.
17351 (compute_display_string_pos, compute_display_string_end):
17353 (bidi_push_it, bidi_pop_it): Add prototypes.
17354 (struct iterator_stack_entry): New members bidi_p,
17355 paragraph_embedding, and from_disp_prop_p.
17356 (struct it): Member bidi_p is now a bit field 1 bit wide.
17357 (bidi_shelve_cache, bidi_unshelve_cache):
17358 Declare prototypes.
17360 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17361 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17362 and vector-like objects.
17364 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17365 cache around display iteration.
17367 * window.c (Fwindow_end, window_scroll_pixel_based)
17368 (displayed_window_lines, Frecenter): Save and restore the bidi
17369 cache around display iteration.
17371 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17373 * editfns.c (Fdelete_region): Clarify the use of the named
17374 parameters (bug#6788).
17376 2011-07-14 Martin Rudalics <rudalics@gmx.at>
17378 * indent.c (Fvertical_motion): Set and restore w->pointm when
17379 saving and restoring the window's buffer (Bug#9006).
17381 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17383 * editfns.c (Fstring_to_char): Clarify just what is returned
17384 (bug#6576). Text by Eli Zaretskii.
17386 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
17388 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17390 2011-07-13 Eli Zaretskii <eliz@gnu.org>
17392 * buffer.c (mmap_find): Fix a typo.
17394 2011-07-13 Johan Bockgård <bojohan@gnu.org>
17396 Fix execution of x selection hooks.
17397 * xselect.c (Qx_lost_selection_functions)
17398 (Qx_sent_selection_functions): New vars.
17399 (syms_of_xselect): DEFSYM them.
17400 (x_handle_selection_request): Pass Qx_sent_selection_functions
17401 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17402 (x_handle_selection_clear,x_clear_frame_selections):
17403 Pass Qx_lost_selection_functions rather than
17404 Vx_lost_selection_functions to Frun_hook_with_args.
17406 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17408 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17409 The old code sometimes used this field without initializing it.
17411 * alloc.c (gc_sweep): Don't read past end of array.
17412 In theory, the old code could also have corrupted Emacs internals,
17413 though it'd be very unlikely.
17415 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17417 * character.c (Fcharacterp): Don't advertise optional ignored
17418 argument. (Bug#4026)
17420 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17422 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17425 * window.c (Fset_window_start): Doc fix (bug#4199).
17426 (Fset_window_hscroll): Ditto.
17428 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17430 Fix minor new problems caught by GCC 4.6.1.
17431 * term.c (init_tty): Remove unused local.
17432 * xsettings.c (store_monospaced_changed): Define this function only
17433 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17434 not used otherwise.
17436 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
17438 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17440 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17442 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17443 are the mini-buffer and the echo area (bug#3320).
17445 * term.c (init_tty): Remove support for supdup, c10 and perq
17446 terminals, which are no longer supported (bug#1482).
17448 2011-07-10 Johan Bockgård <bojohan@gnu.org>
17450 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17452 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17454 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17455 for non-popups (Bug#3642).
17457 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17459 * alloc.c (reset_malloc_hooks): Protoize.
17460 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17461 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17462 * cm.c (losecursor): Likewise.
17463 * data.c (fmod): Likewise.
17464 * dispnew.c (swap_glyphs_in_rows): Likewise.
17465 * emacs.c (memory_warning_signal): Likewise.
17466 * floatfns.c (float_error): Likewise.
17467 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17468 (otf_open, font_otf_capability, generate_otf_features)
17469 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17471 * image.c (pbm_read_file): Likewise.
17472 * indent.c (string_display_width): Likewise.
17473 * intervals.c (check_for_interval, search_for_interval)
17474 (inc_interval_count, count_intervals, root_interval)
17475 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17476 * lread.c (defalias): Likewise.
17477 * ralloc.c (r_alloc_check): Likewise.
17478 * regex.c (set_image_of_range_1, set_image_of_range)
17479 (regex_grow_registers): Likewise.
17480 * sysdep.c (strerror): Likewise.
17481 * termcap.c (valid_filename_p, tprint, main): Likewise.
17482 * tparam.c (main): Likewise.
17483 * unexhp9k800.c (run_time_remap, save_data_space)
17484 (update_file_ptrs, read_header, write_header, calculate_checksum)
17485 (copy_file, copy_rest, display_header): Likewise.
17486 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17488 * xdisp.c (check_it): Likewise.
17489 * xfaces.c (register_color, unregister_color, unregister_colors):
17491 * xfns.c (print_fontset_result): Likewise.
17492 * xrdb.c (member, fatal, main): Likewise.
17494 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17496 Fix minor problems found by static checking (Bug#9031).
17497 * chartab.c (char_table_set_range, map_sub_char_table):
17498 Remove unused locals.
17499 (uniprop_table): Now static.
17500 * composite.c (_work_char): Remove unused static var.
17502 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
17504 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17506 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17508 * gtkutil.c (qttip_cb): Remove code without function.
17510 2011-07-09 Eli Zaretskii <eliz@gnu.org>
17512 * w32.c (pthread_sigmask): New stub.
17514 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
17516 Use pthread_sigmask, not sigprocmask (Bug#9010).
17517 sigprocmask is portable only for single-threaded applications, and
17518 Emacs can be multi-threaded when it uses GTK.
17519 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17521 * callproc.c (Fcall_process):
17522 * process.c (create_process):
17523 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17524 Use pthread_sigmask, not sigprocmask.
17526 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17528 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17529 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17532 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17534 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17535 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17536 (xg_hide_tooltip): Fix comment.
17538 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17539 in registerServicesMenuSendTypes.
17540 (validRequestorForSendType): Don't check ns_return_types.
17542 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17545 2011-07-08 Jason Rumney <jasonr@gnu.org>
17547 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17548 SH_SHOW for hidden windows (Bug#5482).
17550 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17551 frame struct members of non-existent frames (Bug#6284).
17553 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17555 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17556 variable firstTime not needed on OSX >= 10.6.
17557 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17558 >= 10.5. Use setKnobProportion, setDoubleValue.
17560 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17561 (MAC_OS_X_VERSION_10_5): Define if not defined.
17562 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17563 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17564 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17566 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17567 cString and lossyCString on OSX >= 10.4.
17569 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17570 sizeToFit on OSX >= 10.2.
17572 * nsimage.m (allocInitFromFile): Don't use deprecated method
17573 bestRepresentationForDevice on OSX >= 10.6.
17575 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17578 * emacs.c: Declare unexec_init_emacs_zone.
17580 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17582 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17584 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17585 on svcsMenu (Bug#8842).
17587 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17589 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17591 * nsterm.m (QUTF8_STRING): Declare.
17592 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17593 (validRequestorForSendType): Return type is (id).
17594 Change indexOfObjectIdenticalTo to indexOfObject.
17595 Check if we have local selection before returning self (Bug#8842).
17596 (writeSelectionToPasteboard): Put local selection into paste board
17597 if we have a local selection (Bug#8842).
17598 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17600 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17601 (ns_get_local_selection): Declare.
17603 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17605 * keymap.c (describe_map_tree): Don't insert a double newline at
17606 the end of the buffer (bug#1169) and return whether we inserted
17609 * callint.c (Fcall_interactively): Change "reading args" to
17610 "providing args" to try to clarify what it does (bug#1010).
17612 2011-07-07 Kenichi Handa <handa@m17n.org>
17614 * composite.c (composition_compute_stop_pos): Ignore a static
17615 composition starting before CHARPOS (Bug#8915).
17617 * xdisp.c (handle_composition_prop): Likewise.
17619 2011-07-07 Eli Zaretskii <eliz@gnu.org>
17621 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17624 2011-07-07 Kenichi Handa <handa@m17n.org>
17626 * character.h (unicode_category_t): New enum type.
17628 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17629 (Qchar_code_property_table): New variable.
17630 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17631 (UNIPROP_COMPRESSED_FORM_P): New macros.
17632 (char_table_ascii): Uncompress the compressed values.
17633 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17634 Uncompress the compressed values.
17635 (sub_char_table_ref_and_range): Likewise.
17636 (char_table_ref_and_range): Uncompress the compressed values.
17637 (sub_char_table_set): New arg is_uniprop. Callers changed.
17638 Uncompress the compressed values.
17639 (sub_char_table_set_range): Args changed. Callers changed.
17640 (char_table_set_range): Adjuted for the above change.
17641 (map_sub_char_table): Delete args default_val and parent. Add arg
17642 top. Give decoded values to a Lisp function.
17643 (map_char_table): Adjust for the above change. Give decoded
17644 values to a Lisp function. Gcpro more variables.
17645 (uniprop_table_uncompress)
17646 (uniprop_decode_value_run_length): New functions.
17647 (uniprop_decoder, uniprop_decoder_count): New variables.
17648 (uniprop_get_decoder, uniprop_encode_value_character)
17649 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17651 (uniprop_encoder, uniprop_encoder_count): New variables.
17652 (uniprop_get_encoder, uniprop_table)
17653 (Funicode_property_table_internal, Fget_unicode_property_internal)
17654 (Fput_unicode_property_internal): New functions.
17655 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17656 Sunicode_property_table_internal, Sget_unicode_property_internal,
17657 and Sput_unicode_property_internal. Defvar_lisp
17658 char-code-property-alist.
17660 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
17661 Vunicode_category_table.
17663 * font.c (font_range): Adjust for the change of
17664 Vunicode_category_table.
17666 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17668 * m/iris4d.h: Remove file, move contents ...
17669 * s/irix6-5.h: ... here.
17671 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17673 Remove unportable assumption about struct layout (Bug#8884).
17674 * alloc.c (mark_buffer):
17675 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17676 (clone_per_buffer_values): Don't assume that
17677 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17678 This isn't true in general, and it's particularly not true
17679 if Emacs is configured with --with-wide-int.
17680 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17681 New macros, used in the buffer.c change.
17683 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17685 * xsettings.c: Use both GConf and GSettings if both are available.
17686 (store_config_changed_event): Add comment.
17687 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17688 (store_tool_bar_style_changed): New functions.
17689 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
17690 (struct xsettings): Move font inside HAVE_XFT.
17691 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
17692 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
17693 Move inside HAVE_XFT.
17694 (something_changed_gsettingsCB): Rename from something_changedCB.
17695 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17697 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
17698 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
17699 (something_changed_gconfCB): Rename from something_changedCB.
17700 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17701 (parse_settings): Move check for font inside HAVE_XFT.
17702 (read_settings, apply_xft_settings): Add comment.
17703 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17704 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17705 call store_font_name_changed.
17706 (xft_settings_event): Add comment.
17707 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17708 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17709 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17710 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17711 (xsettings_initialize): Call init_gsettings last.
17712 (xsettings_get_system_font, xsettings_get_system_normal_font):
17715 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17717 Random fixes. E.g., (random) never returned negative values.
17718 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17719 subseconds part to the entropy, as that's a bit more random.
17720 Prefer signed to unsigned, since the signedness doesn't matter and
17721 in general we prefer signed. When given a limit, use a
17722 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17723 latter isn't right if USE_2_TAGS_FOR_INTS.
17724 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17725 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17727 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17729 * textprop.c (text_property_stickiness):
17730 Obey Vtext_property_default_nonsticky.
17731 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17732 * w32fns.c (syms_of_w32fns):
17733 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17735 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17737 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17738 This is more efficient than Ffile_directory_p and avoids a minor race.
17740 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17742 * buffer.c (Foverlay_put): Say what the return value is
17745 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17746 is a directory before asking whether to use the file name
17748 (barf_or_query_if_file_exists): Make the "File is a directory"
17749 error be more correct.
17751 * fns.c (Frequire): Remove the mention of the .gz files, since
17752 that's installation-specific, but keep the mention of
17753 `get-load-suffixes'.
17755 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17757 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17758 Report string overflow if the output is too long.
17760 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
17762 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17763 (syms_of_gnutls): Remove duplicate DEFSYM for
17764 Qgnutls_bootprop_verify_hostname_error, an error for
17765 Qgnutls_bootprop_verify_error (which is no longer used).
17767 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17768 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17769 Also (re)move comments that are misplaced or no longer relevant.
17771 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17773 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17775 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
17777 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17778 and background color parameters if they have been changed.
17780 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17782 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17784 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17786 * xsettings.c (SYSTEM_FONT): Define only when used.
17787 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17789 * keymap.c (access_keymap_1): Now static.
17791 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
17793 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17794 leave any prefix arg for the up event (Bug#1586).
17796 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17798 * lread.c (syms_of_lread): Mention single symbols defined by
17799 `defvar' or `defconst' (bug#7154).
17801 * fns.c (Frequire): Mention .el.gz files (bug#7314).
17802 (Frequire): Mention get-load-suffixes.
17804 2011-07-02 Martin Rudalics <rudalics@gmx.at>
17806 * window.h (window): Remove clone_number slot.
17807 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17809 (make_parent_window, make_window, saved_window)
17810 (Fset_window_configuration, save_window_save): Don't deal with
17812 * buffer.c (Qclone_number): Remove declaration.
17813 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17815 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17817 Add multiple inheritance to keymaps.
17818 * keymap.c (Fmake_composed_keymap): New function.
17819 (Fset_keymap_parent): Simplify.
17820 (fix_submap_inheritance): Remove.
17821 (access_keymap_1): New function extracted from access_keymap to handle
17822 embedded parents and handle lists of maps.
17823 (access_keymap): Use it.
17824 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17825 (Fcopy_keymap): Handle embedded parents.
17826 (Fcommand_remapping, define_as_prefix): Simplify.
17827 (Fkey_binding): Simplify.
17828 (syms_of_keymap): Move minibuffer-local-completion-map,
17829 minibuffer-local-filename-completion-map,
17830 minibuffer-local-must-match-map, and
17831 minibuffer-local-filename-must-match-map to Elisp.
17832 (syms_of_keymap): Defsubr make-composed-keymap.
17833 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17834 (parse_menu_item): Trivial simplification.
17836 2011-07-01 Glenn Morris <rgm@gnu.org>
17838 * Makefile.in (SETTINGS_LIBS): Fix typo.
17840 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
17842 * coding.c (Fencode_coding_string): Record the last coding system
17843 used, as the function doc string says (bug#8738).
17845 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17847 * xsettings.c (store_monospaced_changed): Take new font as arg and
17848 check for change against current_mono_font.
17849 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17850 (emacs_settings_constructor, emacs_settings_get_property)
17851 (emacs_settings_set_property, emacs_settings_class_init)
17852 (emacs_settings_init, gsettings_obj): Remove.
17853 (something_changedCB): New function for HAVE_GSETTINGS.
17854 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17855 with value as argument.
17856 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17857 g_settings_new (Bug#8967). Do not create gsettings_obj.
17858 Remove calls to g_settings_bind. Connect something_changedCB to
17861 * xgselect.c: Add defined (HAVE_GSETTINGS).
17862 (xgselect_initialize): Ditto.
17864 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17865 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17868 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17870 * eval.c (struct backtrace): Simplify and port the data structure.
17871 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17872 signed bit field, as this assumption is not portable and it makes
17873 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17874 "char debug_on_exit : 1" as this is not portable either; instead,
17875 use the portable "unsigned int debug_on_exit : 1". Remove unused
17876 member evalargs. Remove obsolete comments about cc bombing out.
17878 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17880 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17881 Let HAVE_GSETTINGS override HAVE_GCONF.
17882 (store_monospaced_changed): New function.
17883 (EMACS_SETTINGS): A new type derived from GObject to handle
17884 GSettings notifications.
17885 (emacs_settings_constructor, emacs_settings_get_property)
17886 (emacs_settings_set_property, emacs_settings_class_init):
17888 (gsettings_client, gsettings_obj): New variables.
17889 (GSETTINGS_SCHEMA): New define.
17890 (something_changedCB): Call store_monospaced_changed.
17891 (init_gsettings): New function.
17892 (xsettings_initialize): Call init_gsettings.
17893 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17896 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17899 2011-06-29 Martin Rudalics <rudalics@gmx.at>
17901 * window.c (resize_root_window, grow_mini_window)
17902 (shrink_mini_window): Rename Qresize_root_window to
17903 Qwindow_resize_root_window and Qresize_root_window_vertically to
17904 Qwindow_resize_root_window_vertically.
17906 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17908 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17910 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
17912 * makefile.w32-in: Redesign dependencies so they reflect more
17913 clearly which files are directly included by each source file,
17914 and not through other includes.
17916 2011-06-27 Martin Rudalics <rudalics@gmx.at>
17918 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17919 (sort_overlays, overlay_strings): When an overlay's clone number
17920 matches the window's clone number process the overlay even if
17921 the overlay's window property doesn't match the current window.
17923 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17924 (Fwindow_hchild): Rename to Fwindow_left_child.
17925 (Fwindow_next): Rename to Fwindow_next_sibling.
17926 (Fwindow_prev): Rename to Fwindow_prev_sibling.
17927 (resize_window_check): Rename to window_resize_check.
17928 (resize_window_apply): Rename to window_resize_apply.
17929 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17930 (Fdelete_other_windows_internal, resize_frame_windows)
17931 (Fsplit_window_internal, Fdelete_window_internal)
17932 (grow_mini_window, shrink_mini_window)
17933 (Fresize_mini_window_internal): Fix callers accordingly.
17935 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17937 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17938 (emacs_fixed_set_min_size): Remove.
17939 (emacs_fixed_new): Take frame as argument.
17941 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17942 (_EmacsFixedPrivate): Remove minwidth/height.
17943 Add struct frame *f.
17944 (emacs_fixed_init): Initialize priv->f.
17945 (get_parent_class, emacs_fixed_set_min_size): Remove.
17946 (emacs_fixed_new): Set priv->f to argument.
17947 (emacs_fixed_get_preferred_width)
17948 (emacs_fixed_get_preferred_height): Use min_width/height from
17949 frames size_hint to set minimum and natural (Bug#8919).
17950 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17951 and use min_width/height from frames size_hint to set
17952 min_width/height (Bug#8919).
17954 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
17955 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17958 2011-06-26 Eli Zaretskii <eliz@gnu.org>
17960 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17961 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17964 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
17966 * process.c (wait_reading_process_output): Bypass select if
17967 waiting for a cell while ignoring keyboard input, and input is
17968 pending. Suggested by Jan Djärv (Bug#8869).
17970 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17972 Use gnulib's dup2 module instead of rolling our own.
17973 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17975 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17977 * dispnew.c (scrolling_window): Before scrolling, turn off a
17978 mouse-highlight in the window being scrolled.
17980 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
17982 Move DEFSYM to lisp.h and use everywhere.
17984 * character.h (DEFSYM): Move declaration...
17985 * lisp.h (DEFSYM): ...here.
17991 * w32select.c: Don't include character.h.
17993 * alloc.c (syms_of_alloc):
17994 * buffer.c (syms_of_buffer):
17995 * bytecode.c (syms_of_bytecode):
17996 * callint.c (syms_of_callint):
17997 * casefiddle.c (syms_of_casefiddle):
17998 * casetab.c (init_casetab_once):
17999 * category.c (init_category_once, syms_of_category):
18000 * ccl.c (syms_of_ccl):
18001 * cmds.c (syms_of_cmds):
18002 * composite.c (syms_of_composite):
18003 * dbusbind.c (syms_of_dbusbind):
18004 * dired.c (syms_of_dired):
18005 * dispnew.c (syms_of_display):
18006 * doc.c (syms_of_doc):
18007 * editfns.c (syms_of_editfns):
18008 * emacs.c (syms_of_emacs):
18009 * eval.c (syms_of_eval):
18010 * fileio.c (syms_of_fileio):
18011 * fns.c (syms_of_fns):
18012 * frame.c (syms_of_frame):
18013 * fringe.c (syms_of_fringe):
18014 * insdel.c (syms_of_insdel):
18015 * keymap.c (syms_of_keymap):
18016 * lread.c (init_obarray, syms_of_lread):
18017 * macros.c (syms_of_macros):
18018 * msdos.c (syms_of_msdos):
18019 * print.c (syms_of_print):
18020 * process.c (syms_of_process):
18021 * search.c (syms_of_search):
18022 * sound.c (syms_of_sound):
18023 * syntax.c (init_syntax_once, syms_of_syntax):
18024 * terminal.c (syms_of_terminal):
18025 * textprop.c (syms_of_textprop):
18026 * undo.c (syms_of_undo):
18027 * w32.c (globals_of_w32):
18028 * window.c (syms_of_window):
18029 * xdisp.c (syms_of_xdisp):
18030 * xfaces.c (syms_of_xfaces):
18031 * xfns.c (syms_of_xfns):
18032 * xmenu.c (syms_of_xmenu):
18033 * xsettings.c (syms_of_xsettings):
18034 * xterm.c (syms_of_xterm): Use DEFSYM.
18036 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18038 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18040 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18042 Integer and buffer overflow fixes (Bug#8873).
18044 * print.c (printchar, strout): Check for string overflow.
18045 (PRINTPREPARE, printchar, strout):
18046 Don't set size unless allocation succeeds.
18048 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18049 for sizes. Check for string overflow more accurately.
18050 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18052 * macros.c: Integer and buffer overflow fixes.
18053 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18054 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18055 Use ptrdiff_t, not int, for sizes.
18056 Don't increment bufsize until after realloc succeeds.
18057 Check for size-calculation overflow.
18058 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18060 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18062 * lread.c: Integer overflow fixes.
18063 (read_integer): Radix is now EMACS_INT, not int,
18064 to improve quality of diagnostics for out-of-range radices.
18065 Calculate buffer size correctly for out-of-range radices.
18066 (read1): Check for integer overflow in radices, and in
18067 read-circle numbers.
18068 (read_escape): Avoid int overflow.
18069 (Fload, openp, read_buffer_size, read1)
18070 (substitute_object_recurse, read_vector, read_list, map_obarray):
18071 Use ptrdiff_t, not int, for sizes.
18072 (read1): Use EMACS_INT, not int, for sizes.
18073 Check for size overflow.
18075 * image.c (cache_image): Check for size arithmetic overflow.
18077 * lread.c: Integer overflow issues.
18078 (saved_doc_string_size, saved_doc_string_length)
18079 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18080 Now ptrdiff_t, not int.
18081 (read1): Don't assume doc string length fits in int. Check for
18082 out-of-range doc string lengths.
18083 (read_list): Don't assume file position fits in int.
18084 (read_escape): Check for hex character overflow.
18086 2011-06-22 Leo Liu <sdl.web@gmail.com>
18088 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18089 Move to minibuffer.el.
18091 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18093 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18094 The following patches are for when GLYPH_DEBUG && !XASSERT.
18095 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18096 * dispnew.c (flush_stdout):
18097 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18098 Mark as externally visible.
18099 * dispnew.c (check_window_matrix_pointers): Now static.
18100 * dispnew.c (window_to_frame_vpos):
18101 * xfns.c (unwind_create_frame):
18102 * xterm.c (x_check_font): Remove unused local.
18103 * scroll.c (CHECK_BOUNDS):
18104 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18105 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18106 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18107 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18108 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18110 (debug_method_add): Use va_list and vsprintf rather than relying
18111 on undefined behavior with wrong number of arguments.
18112 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18113 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18114 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18115 since we're not interested in debugging glyphs with old libraries.
18116 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18117 GCC 4.6.0's static checking.
18119 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18121 Integer overflow and signedness fixes (Bug#8873).
18122 A few related buffer overrun fixes, too.
18124 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18126 * dispextern.h (struct face.stipple):
18127 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18128 (x_bitmap_mask, x_allocate_bitmap_record)
18129 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18130 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18131 (x_create_bitmap_from_xpm_data):
18132 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18133 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18135 * xfaces.c (load_pixmap):
18136 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18137 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18138 (.bitmaps_last, struct x_output.icon_bitmap):
18139 Use ptrdiff_t, not int, for bitmap indexes.
18140 (x_allocate_bitmap_record): Check for size overflow.
18141 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18143 Use ptrdiff_t, not int, for overlay counts.
18144 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18145 * editfns.c (overlays_around, get_pos_property):
18146 * textprop.c (get_char_property_and_overlay):
18147 * xdisp.c (next_overlay_change, note_mouse_highlight):
18148 * xfaces.c (face_at_buffer_position):
18149 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18150 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18151 (Fnext_overlay_change, Fprevious_overlay_change)
18152 (mouse_face_overlay_overlaps, Foverlays_in):
18153 Use ptrdiff_t, not int, for sizes.
18154 (overlays_at, overlays_in): Check for size-calculation overflow.
18156 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18158 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18159 (x_session_initialize): Do not assume string length fits in int.
18161 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18162 This is unlikely, but can occur if DPI is outlandish.
18164 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18165 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18167 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18168 * xrdb.c (magic_file_p, search_magic_path):
18169 Omit last arg SUFFIX; it was always 0. All callers changed.
18170 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18172 * xfont.c (xfont_match): Avoid need for strlen.
18174 * xfns.c: Don't assume strlen fits in int.
18175 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18177 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18178 not unsigned long, as we prefer signed integers. All callers changed.
18179 Detect integer overflow in repeat count.
18180 (message_dolog): Don't assume print length fits in 39 bytes.
18181 (display_mode_element): Don't assume strlen fits in int.
18183 * termcap.c: Don't assume sizes fit in int and never overflow.
18184 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18185 (gobble_line): Check for size-calculation overflow.
18187 * minibuf.c (Fread_buffer):
18188 * lread.c (intern, intern_c_string):
18189 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18190 Don't assume string length fits in int.
18192 * keyboard.c (parse_tool_bar_item):
18193 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18195 * font.c: Don't assume string length fits in int.
18196 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18197 Use ptrdiff_t, not int.
18198 (font_intern_prop): Don't assume string length fits in int.
18199 Don't assume integer property fits in fixnum.
18200 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18202 * filelock.c: Fix some buffer overrun and integer overflow issues.
18203 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18204 Reformulate so as not to need the command string.
18205 Invoke gzip -cd rather than gunzip, as it's more portable.
18206 (lock_info_type, lock_file_1, lock_file):
18207 Don't assume pid_t and time_t fit in unsigned long.
18208 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18209 (current_lock_owner): Prefer signed type for sizes.
18210 Use memcpy, not strncpy, where memcpy is what is really wanted.
18211 Don't assume (via atoi) that time_t and pid_t fit in int.
18212 Check for time_t and/or pid_t out of range, e.g., via a network share.
18213 Don't alloca where an auto var works fine.
18215 * fileio.c: Fix some integer overflow issues.
18216 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18217 Don't assume string length fits in int.
18218 (directory_file_name): Don't assume string length fits in long.
18219 (make_temp_name): Don't assume pid fits in int, or that its print
18220 length is less than 20.
18222 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18224 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18226 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18228 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18229 We prefer signed integers, even for size calculations.
18231 * emacs.c: Don't assume string length fits in 'int'.
18232 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18233 (main): Don't invoke strlen when not needed.
18235 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18236 (XD_DEBUG_MESSAGE): Don't waste a byte.
18238 * callproc.c (getenv_internal_1, getenv_internal)
18239 (Fgetenv_internal):
18240 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18242 * lread.c (invalid_syntax): Omit length argument.
18243 All uses changed. This doesn't fix a bug, but it simplifies the
18244 code away from its former Hollerith-constant appearance, and it's
18245 one less 'int' to worry about when looking at integer-overflow issues.
18246 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18248 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18249 This didn't break anything, but it didn't help either.
18250 It's confusing to put a bogus integer in a place where the actual
18251 value does not matter.
18252 (LIST_END_P): Remove unused macro and its bogus comment.
18253 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18255 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18256 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18258 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18259 We prefer signed types, and the value cannot exceed the EMACS_INT
18260 range anyway (because otherwise the length would not be representable).
18261 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18262 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18263 This avoids a GCC warning when WIDE_EMACS_INT.
18265 * indent.c (sane_tab_width): New function.
18266 (current_column, scan_for_column, Findent_to, position_indentation)
18267 (compute_motion): Use it. This is just for clarity.
18268 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18270 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18272 * lisp.h (lint_assume): New macro.
18273 * composite.c (composition_gstring_put_cache):
18274 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18276 * editfns.c, insdel.c:
18277 Omit unnecessary forward decls, to simplify future changes.
18279 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18281 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18283 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18284 Use much-faster test for byte-length change.
18285 Don't assume string byte-length fits in 'int'.
18286 Check that character arg fits in 'int'.
18287 (mapcar1): Declare byte as byte, for clarity.
18289 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18291 * fns.c (concat): Catch string overflow earlier.
18292 Do not rely on integer wraparound.
18294 * dispextern.h (struct it.overlay_strings_charpos)
18295 (struct it.selective): Now EMACS_INT, not int.
18296 * xdisp.c (forward_to_next_line_start)
18297 (back_to_previous_visible_line_start)
18298 (reseat_at_next_visible_line_start, next_element_from_buffer):
18299 Don't arbitrarily truncate the value of 'selective' to int.
18301 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18303 * composite.c: Don't truncate sizes to 'int'.
18304 (composition_gstring_p, composition_reseat_it)
18305 (composition_adjust_point): Use EMACS_INT, not int.
18306 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18307 not EMACS_UINT, for indexes.
18309 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18311 * buffer.c: Include <verify.h>.
18312 (struct sortvec.priority, struct sortstr.priority):
18313 Now EMACS_INT, not int.
18314 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
18315 (struct sortstr.size, record_overlay_string)
18316 (struct sortstrlist.size, struct sortlist.used):
18317 Don't truncate size to int.
18318 (record_overlay_string): Check for size-calculation overflow.
18319 (init_buffer_once): Check at compile-time, not run-time.
18321 2011-06-22 Jim Meyering <meyering@redhat.com>
18323 Don't leak an XBM-image-sized buffer
18324 * image.c (xbm_load): Free the image buffer after using it.
18326 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18329 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18330 that Sun C diagnosed.
18331 * fns.c (secure_hash): Fix pointer signedness issue.
18332 * intervals.c (static_offset_intervals): New function.
18333 (offset_intervals): Use it.
18335 2011-06-21 Leo Liu <sdl.web@gmail.com>
18338 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18341 * fns.c (secure_hash): Rename from crypto_hash_function and change
18342 the first arg to accept symbols.
18343 (Fsecure_hash): New primitive.
18344 (syms_of_fns): New symbols.
18346 2011-06-20 Deniz Dogan <deniz@dogan.se>
18348 * process.c (Fset_process_buffer): Clarify return value in
18351 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
18353 * dispnew.c (add_window_display_history): Use BVAR.
18355 * xdisp.c (debug_method_add): Use BVAR.
18356 (check_window_end, dump_glyph_matrix, dump_glyph)
18357 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18359 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18362 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18363 check till after the cache is created in init_frame_faces.
18365 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18367 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18369 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18371 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18372 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18373 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18375 Improve buffer-overflow checking (Bug#8873).
18376 * fileio.c (Finsert_file_contents):
18377 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18378 Remove the old (too-loose) buffer overflow checks.
18379 They weren't needed, since make_gap checks for buffer overflow.
18380 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18381 The old code merely checked for Emacs fixnum overflow, and relied
18382 on undefined (wraparound) behavior. The new code avoids undefined
18383 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18385 * editfns.c (Finsert_char): Don't dump core with very negative counts.
18386 Tune. Don't use wider integers than needed. Don't use alloca.
18387 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
18389 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18391 * insdel.c, lisp.h (buffer_overflow): New function.
18392 (insert_from_buffer_1, replace_range, replace_range_2):
18393 * insdel.c (make_gap_larger):
18394 * editfns.c (Finsert_char):
18395 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18397 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18399 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18401 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18403 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18404 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18406 * fileio.c: Don't assume EMACS_INT fits in off_t.
18407 (emacs_lseek): New static function.
18408 (Finsert_file_contents, Fwrite_region): Use it.
18409 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18411 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18413 * fns.c: Don't overflow int when computing a list length.
18414 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18415 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18416 truncation on 64-bit hosts. Check for QUIT every
18417 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18418 faster and is responsive enough.
18419 (Flength): Report an error instead of overflowing an integer.
18420 (Fsafe_length): Return a float if the value is not representable
18421 as a fixnum. This shouldn't happen except in contrived situations.
18422 (Fnthcdr, Fsort): Don't assume list length fits in int.
18423 (Fcopy_sequence): Don't assume vector length fits in int.
18425 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18426 (header_size, word_size): New constants.
18427 (allocate_vectorlike): Don't check size overflow here.
18428 (allocate_vector): Check it here instead, since this is the only
18429 caller of allocate_vectorlike that could cause overflow.
18430 Check that the new vector's length is representable as a fixnum.
18432 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18433 The previous code was bogus. For example, next_almost_prime (32)
18434 returned 39, which is undesirable as it is a multiple of 3; and
18435 next_almost_prime (24) returned 25, which is a multiple of 5 so
18436 why was the code bothering to check for multiples of 7?
18438 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18440 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18442 Variadic C functions now count arguments with ptrdiff_t.
18443 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18444 Back then I didn't know that the Emacs coding style prefers signed int.
18445 Also, in the meantime I found a few more instances where arguments
18446 were being counted with int, which may truncate counts on 64-bit
18447 machines, or EMACS_INT, which may be unnecessarily wide.
18448 * lisp.h (struct Lisp_Subr.function.aMANY)
18449 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18450 Arg counts are now ptrdiff_t, not size_t.
18451 All variadic functions and their callers changed accordingly.
18452 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18453 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18454 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18455 * callint.c (Fcall_interactively): Check arg count for overflow,
18456 to avoid potential buffer overrun. Use signed char, not 'int',
18457 for 'varies' array, so that we needn't bother to check its size
18458 calculation for overflow.
18459 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18460 * eval.c (apply_lambda):
18461 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18462 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18463 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18465 * callint.c (Fcall_interactively): Don't use index var as event count.
18467 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18468 * mem-limits.h (SIZE): Remove; no longer used.
18470 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18472 Remove unnecessary casts.
18473 * xterm.c (x_term_init):
18474 * xfns.c (x_set_border_pixel):
18475 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18476 These aren't needed now that we assume ANSI C.
18478 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18479 It's more likely to cause problems (due to unsigned overflow)
18482 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18484 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18486 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18488 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18490 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18492 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18494 GLYPH_CODE_FACE returns EMACS_INT, not int.
18495 * dispextern.h (merge_faces):
18496 * xfaces.c (merge_faces):
18497 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18498 Don't assume EMACS_INT fits in int.
18500 * character.h (CHAR_VALID_P): Remove unused parameter.
18501 * fontset.c, lisp.h, xdisp.c: All uses changed.
18503 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18505 * fns.c (concat): Minor tuning based on overflow analysis.
18506 This doesn't fix any bugs. Use int to hold character, instead
18507 of constantly refetching from Emacs object. Use XFASTINT, not
18508 XINT, for value known to be a character. Don't bother comparing
18509 a single byte to 0400, as it's always less.
18511 * floatfns.c (Fexpt):
18512 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18514 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18517 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18519 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18520 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18521 incorrectly succeed when S was a string, because 4294967386 was
18522 truncated before it was used.
18524 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18525 Otherwise, an out-of-range integer could cause undefined behavior
18528 * composite.c: Use int, not EMACS_INT, for characters.
18529 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18530 EMACS_INT, for values that are known to be in character range.
18531 This doesn't fix any bugs but is the usual style inside Emacs and
18532 may generate better code on 32-bit machines.
18534 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18535 This is for reasons similar to the recent CHAR_STRING fix.
18536 * charset.c (Fencode_char): Check that character arg is actually
18537 a character. Pass an int to ENCODE_CHAR.
18538 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18539 wider than 'int', as a compile-time check to prevent future regressions
18542 * character.c (char_string): Remove unnecessary casts.
18544 Make sure a 64-bit char is never passed to CHAR_STRING.
18545 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18546 by silently ignoring the top 32 bits, allowing some values
18547 that were far too large to be valid characters.
18548 * character.h: Include <verify.h>.
18549 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18550 arguments are no wider than unsigned, as a compile-time check
18551 to prevent future regressions in this area.
18553 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18554 (Fsubst_char_in_region):
18556 * xdisp.c (decode_mode_spec_coding):
18557 Adjust to CHAR_STRING's new requirement.
18558 * editfns.c (Finsert_char, Fsubst_char_in_region):
18559 * fns.c (concat): Check that character args are actually
18560 characters. Without this test, these functions did the wrong
18561 thing with wildly out-of-range values on 64-bit hosts.
18563 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18564 These casts should not be needed on 32-bit hosts, either.
18565 * keyboard.c (read_char):
18566 * lread.c (Fload): Remove casts to unsigned.
18568 * lisp.h (UNSIGNED_CMP): New macro.
18569 This fixes comparison bugs on 64-bit hosts.
18570 (ASCII_CHAR_P): Use it.
18571 * casefiddle.c (casify_object):
18572 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18573 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18574 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18575 * dispextern.h (FACE_FROM_ID):
18576 * keyboard.c (read_char): Use UNSIGNED_CMP.
18578 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18579 not to EMACS_INT, to avoid GCC warning.
18581 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18583 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18584 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18585 isn't needed on 32-bit machines.
18587 * buffer.c (Fgenerate_new_buffer_name):
18588 Use EMACS_INT for count, not int.
18589 (advance_to_char_boundary): Return EMACS_INT, not int.
18591 * data.c (Qcompiled_function): Now static.
18593 * window.c (window_body_lines): Now static.
18595 * image.c (gif_load): Rename local to avoid shadowing.
18597 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18598 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18599 * alloc.c (make_save_value): Integer argument is now of type
18600 ptrdiff_t, not int.
18601 (mark_object): Use ptrdiff_t, not int.
18602 * lisp.h (pD): New macro.
18603 * print.c (print_object): Use it.
18605 * alloc.c: Use EMACS_INT, not int, to count objects.
18606 (total_conses, total_markers, total_symbols, total_vector_size)
18607 (total_free_conses, total_free_markers, total_free_symbols)
18608 (total_free_floats, total_floats, total_free_intervals)
18609 (total_intervals, total_strings, total_free_strings):
18610 Now EMACS_INT, not int. All uses changed.
18611 (Fgarbage_collect): Compute overall total using a double, so that
18612 integer overflow is less likely to be a problem. Check for overflow
18613 when converting back to an integer.
18614 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18615 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18616 These were 'int' variables that could overflow on 64-bit hosts;
18617 they were never used, so remove them instead of repairing them.
18618 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
18619 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18620 Previously, this ceilinged at INT_MAX, but that doesn't work on
18622 (allocate_pseudovector): Don't use EMACS_INT when int would do.
18624 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18625 (allocate_vectorlike): Check for ptrdiff_t overflow.
18626 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18627 when a (possibly-narrower) signed value would do just as well.
18628 We prefer using signed arithmetic, to avoid comparison confusion.
18630 * alloc.c: Catch some string size overflows that we were missing.
18631 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18632 for convenience in STRING_BYTES_MAX.
18633 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18634 The definition here is exact; the one in lisp.h was approximate.
18635 (allocate_string_data): Check for string overflow. This catches
18636 some instances we weren't catching before. Also, it catches
18637 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18638 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18639 and ptrdiff_t and EMACS_INT are both 64 bits.
18641 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18642 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
18643 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
18645 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18647 * alloc.c (Fmake_string): Check for out-of-range init.
18649 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18651 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18653 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18655 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18656 xg_get_default_scrollbar_width.
18658 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18659 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18660 (style_changed_cb): Call update_theme_scrollbar_width and call
18661 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18662 all frames (Bug#8505).
18663 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18664 Call gtk_window_set_resizable if HAVE_GTK3.
18665 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18666 and height if HAVE_GTK3 (Bug#8505).
18667 (scroll_bar_width_for_theme): New variable.
18668 (update_theme_scrollbar_width): New function.
18669 (xg_get_default_scrollbar_width): Move code to
18670 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18671 (xg_initialize): Call update_theme_scrollbar_width.
18673 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18675 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18677 2011-06-12 Martin Rudalics <rudalics@gmx.at>
18679 * frame.c (make_frame): Call other_buffer_safely instead of
18682 * window.c (temp_output_buffer_show): Call display_buffer with
18683 second argument Vtemp_buffer_show_specifiers and reset latter
18684 immediately after the call.
18685 (Vtemp_buffer_show_specifiers): New variable.
18686 (auto_window_vscroll_p, next_screen_context_lines)
18687 (Vscroll_preserve_screen_position): Remove leading asterisks from
18690 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
18692 Fix minor problems found by GCC 4.6.0 static checking.
18693 * buffer.c (Qclone_number): Remove for now, as it's unused.
18694 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18695 (record_buffer): Remove unused local.
18696 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18697 (set_frame_buffer_list): Remove; unused.
18698 * frame.h (other_visible_frames): Remove decl.
18699 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18700 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18701 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18703 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18704 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18705 Define only if HAVE_GPM.
18706 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18707 (update_hints_inhibit): Remove; never set. All uses removed.
18708 * widgetprv.h (emacsFrameClassRec): Remove decl.
18709 * window.c (delete_deletable_window): Now returns void, since it
18710 wasn't returning anything.
18711 (compare_window_configurations): Remove unused locals.
18712 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18713 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
18714 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18715 the same widths as pointers. This follows up on the 2011-05-06 patch.
18716 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18717 * xterm.h: Likewise.
18718 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18720 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
18722 * makefile.w32-in: Update dependencies.
18723 (LISP_H): Add lib/intprops.h.
18725 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18727 * image.c (gif_load): Add animation frame delay to the metadata.
18728 (syms_of_image): Use DEFSYM. New symbol `delay'.
18730 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18732 * window.c (delete_deletable_window): Re-add.
18733 (Fset_window_configuration): Rewrite to handle dead buffers and
18734 consequently deletable windows.
18735 (window_tree, Fwindow_tree): Remove. Supply functionality in
18737 (compare_window_configurations): Simplify code.
18739 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18741 * image.c (imagemagick_load_image): Fix type mismatch.
18742 (Fimagemagick_types): Likewise.
18744 * window.h (replace_buffer_in_windows): Declare.
18746 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18748 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18749 Qclone_number. Remove external declaration of Qdelete_window.
18750 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18752 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18753 Run Qbuffer_list_update_hook if allowed.
18754 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18755 buffer list implementation.
18756 (other_buffer_safely): New function.
18757 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18758 calls to replace_buffer_in_windows and
18759 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18761 (record_buffer): Inhibit quitting and rewrite using quittable
18762 functions. Run Qbuffer_list_update_hook if allowed.
18763 (Frecord_buffer, Funrecord_buffer): New functions.
18764 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18765 Move switch-to-buffer to window.el.
18766 (bury-buffer): Move to window.el.
18767 (Vbuffer_list_update_hook): New variable.
18769 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18772 * window.h (resize_frame_windows): Move up in code.
18773 (Fwindow_frame): Remove EXFUN.
18774 (replace_buffer_in_all_windows): Remove prototype.
18775 (replace_buffer_in_windows_safely): Add prototype.
18777 * window.c: Declare Qdelete_window static again. Move down
18778 declaration of select_count.
18779 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18780 (Fother_window): Move to window.el.
18781 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18782 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18783 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18785 (replace_buffer_in_windows): Implement by calling
18786 Qreplace_buffer_in_windows.
18787 (replace_buffer_in_all_windows): Remove with some functionality
18788 moved into replace_buffer_in_windows_safely.
18789 (replace_buffer_in_windows_safely): New function.
18790 (select_window_norecord, select_frame_norecord): Move in front
18791 of run_window_configuration_change_hook. Remove now obsolete
18793 (Fset_window_buffer): Rewrite doc-string.
18794 Call Qrecord_window_buffer.
18795 (keys_of_window): Move binding for other-window to window.el.
18797 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18799 * dispextern.h (struct image): Replace data member, whose int_val
18800 and ptr_val fields were not used by anything, with a single
18803 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18804 (gif_clear_image, gif_load, imagemagick_load_image)
18805 (gs_clear_image, gs_load): Callers changed.
18807 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18809 * buffer.h: Include <time.h>, for time_t.
18810 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18812 Fix minor problems found by static checking.
18814 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18816 Make identifiers static if they are not used in other modules.
18817 * data.c (Qcompiled_function, Qframe, Qvector):
18818 * image.c (QimageMagick, Qsvg):
18819 * minibuf.c (Qmetadata):
18820 * window.c (resize_window_check, resize_root_window): Now static.
18821 * window.h (resize_window_check, resize_root_window): Remove decls.
18823 * window.c (window_deletion_count, delete_deletable_window):
18825 (window_body_lines): Now static.
18826 (Fdelete_other_windows_internal): Mark vars as initialized.
18827 Make sure 'resize_failed' is initialized.
18828 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18829 (resize_window_apply): Remove unused local.
18830 * window.h (delete_deletable_window): Remove decl.
18832 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
18833 (imagemagick_load_image): Fix pointer signedness problem by changing
18834 last arg from unsigned char * to char *. All uses changed.
18835 Also, fix a local for similar reasons.
18836 Remove unused locals. Remove locals to avoid shadowing.
18837 (fn_rsvg_handle_free): Remove; unused.
18838 (svg_load, svg_load_image): Fix pointer signedness problem.
18839 (imagemagick_load_image): Don't use garbage pointer image_wand.
18841 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18843 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
18845 * image.c (gif_load): Fix omitted cast error introduced by
18848 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18850 * window.h (resize_proportionally, orig_total_lines)
18851 (orig_top_line): Remove from window structure.
18852 (set_window_height, set_window_width, change_window_heights)
18853 (Fdelete_window): Remove prototypes.
18854 (resize_frame_windows): Remove duplicate declaration.
18856 2011-06-10 Eli Zaretskii <eliz@gnu.org>
18858 * window.h (resize_frame_windows, resize_window_check)
18859 (delete_deletable_window, resize_root_window)
18860 (resize_frame_windows): Declare prototypes.
18862 * window.c (resize_window_apply): Make definition be "static" to
18863 match the prototype.
18865 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18867 * window.c: Remove declarations of Qwindow_size_fixed,
18868 window_min_size_1, window_min_size_2, window_min_size,
18869 size_window, window_fixed_size_p, enlarge_window, delete_window.
18870 Remove static from declaration of Qdelete_window, it's
18871 temporarily needed by Fbury_buffer.
18872 (replace_window): Don't assign orig_top_line and
18874 (Fdelete_window, delete_window): Remove. Window deletion is
18875 handled by window.el.
18876 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18877 Replace Fdelete_window calls with calls to Qdelete_window.
18878 (Fdelete_other_windows): Remove. Deleting other windows is
18879 handled by window.el.
18880 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18881 handled in window.el.
18882 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18883 Window minimum sizes are handled in window.el.
18884 (shrink_windows, size_window, set_window_height)
18885 (set_window_width, change_window_heights, window_height)
18886 (window_width, CURBEG, CURSIZE, enlarge_window)
18887 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18888 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18889 handled in window.el.
18890 (make_dummy_parent): Rename to make_parent_window and give it a
18891 second argument horflag.
18892 (make_window): Don't set resize_proportionally any more.
18893 (Fsplit_window): Remove. Windows are split in window.el.
18894 (save_restore_action, save_restore_orig_size)
18895 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18896 Resize mini windows in window.el.
18897 (grow_mini_window, shrink_mini_window): Implement by calling
18898 Qresize_root_window_vertically, resize_window_check and
18899 resize_window_apply.
18900 (saved_window, Fset_window_configuration, save_window_save):
18901 Do not handle orig_top_line, orig_total_lines, and
18902 resize_proportionally.
18903 (window_min_height, window_min_width): Move to window.el.
18904 (keys_of_window): Move bindings for delete-other-windows,
18905 split-window, delete-window and enlarge-window to window.el.
18907 * buffer.c: Temporarily extern Qdelete_window.
18908 (Fbury_buffer): Temporarily call Qdelete_window instead of
18909 Fdelete_window (Fbury_buffer will move to window.el soon).
18911 * frame.c (set_menu_bar_lines_1): Remove code handling
18912 orig_top_line and orig_total_lines.
18914 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18915 set_window_height but set heights directly.
18916 (change_frame_size_1): Use resize_frame_windows.
18918 * xdisp.c (init_xdisp): Don't use set_window_height but set
18921 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18922 Use resize_frame_windows instead of change_window_heights and run
18923 run_window_configuration_change_hook.
18925 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18926 instead of change_window_heights and run
18927 run_window_configuration_change_hook.
18929 2011-06-09 Martin Rudalics <rudalics@gmx.at>
18931 * window.c (replace_window): Rename second argument REPLACEMENT to
18932 NEW. New third argument SETFLAG. Rewrite.
18933 (delete_window, make_dummy_parent): Call replace_window with
18935 (window_list_1): Move down in code.
18936 (run_window_configuration_change_hook): Move set_buffer part
18937 before select_frame_norecord part in order to unwind correctly.
18938 Rename count1 to count.
18939 (recombine_windows, delete_deletable_window, resize_root_window)
18940 (Fdelete_other_windows_internal)
18941 (Frun_window_configuration_change_hook, make_parent_window)
18942 (resize_window_check, resize_window_apply, Fresize_window_apply)
18943 (resize_frame_windows, Fsplit_window_internal)
18944 (Fdelete_window_internal, Fresize_mini_window_internal):
18946 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18948 2011-06-08 Martin Rudalics <rudalics@gmx.at>
18950 * window.h (window): Add some new members to window structure -
18951 normal_lines, normal_cols, new_total, new_normal, clone_number,
18952 splits, nest, prev_buffers, next_buffers.
18953 (WINDOW_TOTAL_SIZE): Move here from window.c.
18954 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
18956 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18958 (make_dummy_parent): Set new members of windows structure.
18959 (make_window): Move down in code. Handle new members of window
18961 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18962 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18963 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18964 (Fset_window_prev_buffers, Fwindow_next_buffers)
18965 (Fset_window_next_buffers, Fset_window_clone_number):
18967 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18968 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18970 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18971 Argument WINDOW can be now internal window too.
18972 (Fwindow_use_time): Move up in code.
18973 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18974 Rewrite doc-string.
18975 (Fset_window_configuration, saved_window)
18976 (Fcurrent_window_configuration, save_window_save): Handle new
18977 members of window structure.
18978 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18979 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18980 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18981 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18982 Qget_mru_window, Qresize_root_window,
18983 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18984 Qauto_buffer_name; staticpro them.
18986 2011-06-07 Martin Rudalics <rudalics@gmx.at>
18988 * window.c (Fwindow_total_size, Fwindow_left_column)
18989 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18990 (Fwindow_list_1): New functions.
18991 (window_box_text_cols): Replace with window_body_cols.
18992 (Fwindow_width, Fscroll_left, Fscroll_right):
18993 Use window_body_cols instead of window_box_text_cols.
18994 (delete_window, Fset_window_configuration):
18995 Call delete_all_subwindows with window as argument.
18996 (delete_all_subwindows): Take a window as argument and not a
18997 structure. Rewrite.
18998 (window_loop): Remove handling of GET_LRU_WINDOW and
18999 GET_LARGEST_WINDOW.
19000 (Fget_lru_window, Fget_largest_window): Move to window.el.
19002 * window.h: Extern window_body_cols instead of
19003 window_box_text_cols. delete_all_subwindows now takes a
19004 Lisp_Object as argument.
19006 * indent.c (compute_motion, Fcompute_motion):
19007 Use window_body_cols instead of window_box_text_cols.
19009 * frame.c (delete_frame): Call delete_all_subwindows with root
19010 window as argument.
19012 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19014 * fns.c (Fputhash): Document return value.
19016 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19018 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19020 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19022 Cons<->int and similar integer overflow fixes (Bug#8794).
19024 Check for overflow when converting integer to cons and back.
19025 * charset.c (Fdefine_charset_internal, Fdecode_char):
19026 Use cons_to_unsigned to catch overflow.
19027 (Fencode_char): Use INTEGER_TO_CONS.
19028 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19029 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19030 * data.c (long_to_cons, cons_to_long): Remove.
19031 (cons_to_unsigned, cons_to_signed): New functions.
19032 These signal an error for invalid or out-of-range values.
19033 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19034 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19035 * font.c (Ffont_variation_glyphs):
19036 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19037 * lisp.h: Include <intprops.h>.
19038 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19039 (cons_to_signed, cons_to_unsigned): New decls.
19040 (long_to_cons, cons_to_long): Remove decls.
19041 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19042 (Fprimitive_undo): Use CONS_TO_INTEGER.
19043 * xfns.c (Fx_window_property): Likewise.
19044 * xselect.c: Include <limits.h>.
19045 (x_own_selection, selection_data_to_lisp_data):
19046 Use INTEGER_TO_CONS.
19047 (x_handle_selection_request, x_handle_selection_clear)
19048 (x_get_foreign_selection, Fx_disown_selection_internal)
19049 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19050 (lisp_data_to_selection_data): Use cons_to_unsigned.
19051 (x_fill_property_data): Use cons_to_signed.
19052 Report values out of range.
19054 Check for buffer and string overflow more precisely.
19055 * buffer.h (BUF_BYTES_MAX): New macro.
19056 * lisp.h (STRING_BYTES_MAX): New macro.
19057 * alloc.c (Fmake_string):
19058 * character.c (string_escape_byte8):
19059 * coding.c (coding_alloc_by_realloc):
19060 * doprnt.c (doprnt):
19061 * editfns.c (Fformat):
19063 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19064 since they may not be the same number.
19065 * editfns.c (Finsert_char):
19066 * fileio.c (Finsert_file_contents):
19067 Likewise for BUF_BYTES_MAX.
19069 * image.c: Use ptrdiff_t, not int, for sizes.
19070 (slurp_file): Switch from int to ptrdiff_t.
19072 (slurp_file): Check that file size fits in both size_t (for
19073 malloc) and ptrdiff_t (for sanity and safety).
19075 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19076 if b->modtime has its maximal value.
19078 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19080 Don't assume time_t can fit into int.
19081 * buffer.h (struct buffer.modtime): Now time_t, not int.
19082 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19083 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19085 Minor fixes for signed vs unsigned integers.
19086 * character.h (MAYBE_UNIFY_CHAR):
19087 * charset.c (maybe_unify_char):
19088 * keyboard.c (read_char, reorder_modifiers):
19089 XINT -> XFASTINT, since the integer must be nonnegative.
19090 * ftfont.c (ftfont_spec_pattern):
19091 * keymap.c (access_keymap, silly_event_symbol_error):
19092 XUINT -> XFASTINT, since the integer must be nonnegative.
19093 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19094 since it makes no difference and we prefer signed.
19095 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19096 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19099 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19101 * window.h (Fwindow_frame): Declare.
19103 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19105 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19106 (SPARE_MEMORY): Always define.
19107 (LARGE_REQUEST): Remove.
19108 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19110 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19112 * lisp.h: Move EXFUNS for Fframe_root_window,
19113 Fframe_first_window and Fset_frame_selected_window to window.h.
19115 * window.h: Move EXFUNS for Fframe_root_window,
19116 Fframe_first_window and Fset_frame_selected_window here from
19119 * frame.c (Fwindow_frame, Fframe_first_window)
19120 (Fframe_root_window, Fframe_selected_window)
19121 (Fset_frame_selected_window): Move to window.c.
19122 (Factive_minibuffer_window): Move to minibuf.c.
19123 (Fother_visible_frames_p): New function.
19125 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19127 * window.c (decode_window, decode_any_window): Move up in code.
19128 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19129 (inhibit_frame_unsplittable): Remove unused variable.
19130 (Fwindow_buffer): Move up and rewrite doc-string.
19131 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19132 (Fwindow_prev): New functions.
19133 (Fwindow_frame): Move here from frame.c. Accept any window as
19135 (Fframe_root_window, Fframe_first_window)
19136 (Fframe_selected_window): Move here from frame.c. Accept frame
19137 or arbitrary window as argument. Update doc-strings.
19138 (Fminibuffer_window): Move up in code.
19139 (Fwindow_minibuffer_p): Move up in code and simplify.
19140 (Fset_frame_selected_window): Move here from frame.c.
19142 (Fselected_window, select_window, Fselect_window): Move up in
19143 code. Minor doc-string fixes.
19145 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19147 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19148 Do not assume that spare memory exists; that assumption is valid
19149 only if SYSTEM_MALLOC.
19150 (LARGE_REQUEST): New macro, so that the issue of large requests
19151 is separated from the issue of spare memory.
19153 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19155 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19158 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19160 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19163 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19165 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19167 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19169 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19170 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19172 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
19174 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19176 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
19178 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19179 (x_clipboard_manager_save): Add return value.
19180 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19181 New error handlers.
19182 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19183 Obey Vx_select_enable_clipboard_manager. Catch errors in
19184 x_clipboard_manager_save (Bug#8779).
19185 (Vx_select_enable_clipboard_manager): New variable.
19186 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19188 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
19190 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19192 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19194 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19195 in the current matrix if keep_current_p is non-zero.
19197 2011-06-04 Eli Zaretskii <eliz@gnu.org>
19199 * bidi.c (bidi_level_of_next_char): Fix last change.
19201 2011-06-03 Eli Zaretskii <eliz@gnu.org>
19203 Support bidi reordering of text covered by display properties.
19205 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19206 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19207 (bidi_cache_search, bidi_cache_iterator_state)
19208 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19209 (bidi_level_of_next_char, bidi_move_to_visually_next):
19210 Support character positions inside a run of characters covered by a
19212 (bidi_paragraph_init, bidi_resolve_explicit_1)
19213 (bidi_level_of_next_char): Call bidi_fetch_char and
19214 bidi_fetch_char_advance instead of FETCH_CHAR and
19215 FETCH_CHAR_ADVANCE.
19216 (bidi_init_it): Initialize new members.
19217 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19219 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19220 instead of using explicit *_CHAR codes.
19221 (bidi_resolve_explicit, bidi_resolve_weak):
19222 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19223 bidirectional text is supported only in multibyte buffers.
19224 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19225 it to initialize the frame_window_p member of struct bidi_it.
19226 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19227 (bidi_resolve_explicit, bidi_resolve_weak)
19228 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19229 bidi_it->nchars is non-positive.
19230 (bidi_level_of_next_char): Don't try to lookup the cache for the
19231 next/previous character if nothing is cached there yet, or if we
19232 were just reseat()'ed to a new position.
19234 * xdisp.c (set_cursor_from_row): Set start and stop points
19235 according to the row's direction when priming the loop that looks
19236 for the glyph on which to display cursor.
19237 (single_display_spec_intangible_p): Function deleted.
19238 (display_prop_intangible_p): Reimplement to call
19239 handle_display_spec instead of single_display_spec_intangible_p.
19240 Accept 3 additional arguments needed by handle_display_spec.
19241 This fixes incorrect cursor motion across display property with complex
19242 values: lists, `(when COND...)' forms, etc.
19243 (single_display_spec_string_p): Support property values that are
19244 lists with the argument STRING its top-level element.
19245 (display_prop_string_p): Fix the condition for processing a
19246 property that is a list to be consistent with handle_display_spec.
19247 (handle_display_spec): New function, refactored from the
19248 last portion of handle_display_prop.
19249 (compute_display_string_pos): Accept additional argument
19250 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19251 value of a `display' property is a "replacing spec".
19252 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19253 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19254 the display property, but just return a value indicating whether
19255 the display property will replace the characters it covers.
19256 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19257 frame_window_p members of struct bidi_it.
19258 (compute_display_string_pos, compute_display_string_end):
19260 (push_it): Accept second argument POSITION, where pop_it should
19261 jump to continue iteration.
19262 (reseat_1): Initialize bidi_it.disp_pos.
19264 * keyboard.c (adjust_point_for_property): Adjust the call to
19265 display_prop_intangible_p to its new signature.
19267 * dispextern.h (struct bidi_it): New member frame_window_p.
19268 (bidi_init_it): Update prototypes.
19269 (display_prop_intangible_p): Update prototype.
19270 (compute_display_string_pos, compute_display_string_end):
19271 Declare prototypes.
19272 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19275 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
19277 Malloc failure behavior now depends on size of allocation.
19278 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19279 * lisp.h: Change signatures accordingly.
19280 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19281 All callers changed. (Bug#8762)
19283 * gnutls.c: Use Emacs's memory allocators.
19284 Without this change, the gnutls library would invoke malloc etc.
19285 directly, which causes problems on non-SYNC_INPUT hosts, and which
19286 runs afoul of improving memory_full behavior. (Bug#8761)
19287 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19288 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19289 xfree instead of the default malloc, realloc, free.
19290 (Fgnutls_boot): No need to check for memory allocation failure,
19291 since xmalloc does that for us.
19293 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
19294 * category.c (hash_get_category_set):
19295 * ccl.c (ccl_driver):
19296 * charset.c (Fdefine_charset_internal):
19297 * charset.h (struct charset.hash_index):
19298 * composite.c (get_composition_id, gstring_lookup_cache)
19299 (composition_gstring_put_cache):
19300 * composite.h (struct composition.hash_index):
19301 * dispextern.h (struct image.hash):
19302 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19303 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19304 (hashfn_equal, hashfn_user_defined, make_hash_table)
19305 (maybe_resize_hash_table, hash_lookup, hash_put)
19306 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19307 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19308 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19309 * image.c (make_image, search_image_cache, lookup_image)
19310 (xpm_put_color_table_h):
19311 * lisp.h (struct Lisp_Hash_Table):
19312 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
19313 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
19314 for hashes and hash indexes, instead of 'unsigned' and 'int'.
19315 * alloc.c (allocate_vectorlike):
19316 Check for overflow in vector size calculations.
19317 * ccl.c (ccl_driver):
19318 Check for overflow when converting EMACS_INT to int.
19319 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19320 need to be updated by these changes.
19321 * fns.c (make_hash_table, maybe_resize_hash_table):
19322 Check for integer overflow with large hash tables.
19323 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19324 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19325 (SXHASH_REDUCE): New macro.
19326 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19327 Use it instead of discarding useful hash info with large hash values.
19328 (sxhash_float): New function.
19329 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19330 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
19331 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19332 Rewrite to use FIXNUM_BITS, as this simplifies things.
19333 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19334 Adjust signatures to match updated version of code.
19335 (consing_since_gc): Now EMACS_INT, since a single hash table can
19336 use more than INT_MAX bytes.
19338 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19340 Make it possible to build with GCC-4.6+ -O2 -flto.
19342 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19344 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19346 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19347 Call minibuffer-inactive-mode.
19349 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
19351 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19352 Update dependencies.
19354 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19356 * data.c (init_data): Remove code for UTS, this system is not
19359 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19361 Don't force ./temacs to start in terminal mode.
19363 * frame.c (make_initial_frame): Initialize faces in all cases, not
19364 only when CANNOT_DUMP is defined.
19365 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19367 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19369 * dispnew.c (add_window_display_history): Use const for the string
19370 pointer. Remove declaration, not needed.
19372 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19374 Use 'inline', not 'INLINE'.
19375 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19376 * alloc.c, fontset.c (INLINE): Remove.
19377 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19378 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19379 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19380 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19381 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19383 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19385 Make it possible to run ./temacs.
19387 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19388 syms_of_callproc does the same thing. Remove test for
19389 "initialized", do it in the caller.
19390 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19392 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19394 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19395 (read_minibuf): Use get_minibuffer.
19396 (syms_of_minibuf): Use DEFSYM.
19397 (Qmetadata): New var.
19398 * data.c (Qbuffer): Don't make it static.
19399 (syms_of_data): Use DEFSYM.
19401 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19403 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19404 (CCL_CODE_MIN): New macro.
19406 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19408 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19410 * eval.c (Qdebug): Now static.
19411 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19412 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19413 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19415 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19417 * image.c: Various fixes to ImageMagick code comments.
19418 (Fimagemagick_types): Doc fix.
19420 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19422 Minor fixes prompted by GCC 4.6.0 warnings.
19424 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19426 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19427 (x_clipboard_manager_save_all): Move extern decl to ...
19428 * xterm.h: ... here, so that it can be checked for consistency.
19430 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19432 * xselect.c (x_clipboard_manager_save_frame)
19433 (x_clipboard_manager_save_all): New functions.
19434 (Fx_clipboard_manager_save): Lisp function deleted.
19436 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19437 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19439 * xterm.h: Update prototype.
19441 2011-05-28 William Xu <william.xwl@gmail.com>
19443 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19444 exiting (Bug#8239).
19446 2011-05-28 Jim Meyering <meyering@redhat.com>
19448 Avoid a sign-extension bug in crypto_hash_function.
19449 * fns.c (to_uchar): Define.
19450 (crypto_hash_function): Use it to convert some newly-signed
19451 variables to unsigned, to avoid sign-extension bugs. For example,
19452 without this change, (md5 "truc") would evaluate to
19453 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19454 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
19455 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19457 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19459 Integer overflow fixes.
19461 * dbusbind.c: Serial number integer overflow fixes.
19462 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19463 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19464 to hold a serial number that is too large for a fixnum.
19465 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19466 Check for serial numbers out of range. Decode any serial number
19467 that was so large that it became a float. (Bug#8722)
19469 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19470 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19471 Use XFASTINT rather than XUINT when numbers are nonnegative.
19472 (xd_append_arg, Fdbus_method_return_internal):
19473 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19474 arguments, check that Lisp number is nonnegative, rather than
19475 silently wrapping negative numbers around. (Bug#8722)
19476 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19479 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19481 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19483 ccl: Add integer overflow checks.
19484 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19485 (IN_INT_RANGE): New macros.
19486 (ccl_driver): Use them to check for integer overflow when
19487 decoding a CCL program. Many of the new checks are whether XINT (x)
19488 fits in int; it doesn't always, on 64-bit hosts. The new version
19489 doesn't catch all possible integer overflows, but it's an
19490 improvement. (Bug#8719)
19492 * alloc.c (make_event_array): Use XINT, not XUINT.
19493 There's no need for unsigned here.
19495 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19496 This follows up to the 2011-05-06 change that substituted uintptr_t
19497 for EMACS_INT. This case wasn't caught back then.
19499 Rework Fformat to avoid integer overflow issues.
19500 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19501 now (part of C89). Include <verify.h>.
19502 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19503 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19504 (Fformat): Avoid the prepass trying to compute sizes; it was only
19505 approximate and thus did not catch overflow reliably. Instead, walk
19506 through the format just once, formatting and computing sizes as we go,
19507 checking for integer overflow at every step, and allocating a larger
19508 buffer as needed. Keep track separately whether the format is
19509 multibyte. Keep only the most-recently calculated precision, rather
19510 than them all. Record whether each argument has been converted to
19511 string. Use EMACS_INT, not int, for byte and char and arg counts.
19512 Support field widths and precisions larger than INT_MAX. Avoid
19513 sprintf's undefined behavior with conversion specifications such as %#d
19514 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19515 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19516 formatting out-of-range floating point numbers with int
19517 formats. (Bug#8668)
19519 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19521 * data.c: Avoid integer truncation in expressions involving floats.
19522 * data.c: Include <intprops.h>.
19523 (arith_driver): When there's an integer overflow in an expression
19524 involving floating point, convert the integers to floating point
19525 so that the resulting value does not suffer from catastrophic
19526 integer truncation. For example, on a 64-bit host (* 4
19527 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19528 Do not rely on undefined behavior after integer overflow.
19530 merge count_size_as_multibyte, parse_str_to_multibyte
19531 * character.c, character.h (count_size_as_multibyte):
19532 Rename from parse_str_to_multibyte; all uses changed.
19533 Check for integer overflow.
19534 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19535 since it's now a duplicate of the other. This is more of
19536 a character than a buffer op, so better that it's in character.c.
19537 * fns.c, print.c: Adjust to above changes.
19539 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19541 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19543 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19545 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19546 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19547 (x_clipboard_manager_save): Now static.
19548 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19550 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19551 (crypto_hash_function): Now static.
19552 Fix pointer signedness problems. Avoid unnecessary initializations.
19554 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
19556 * termhooks.h (Vselection_alist): Make it terminal-local.
19558 * terminal.c (create_terminal): Initialize it.
19560 * xselect.c: Support for clipboard managers.
19561 (Vselection_alist): Move to termhooks.h as terminal-local var.
19562 (LOCAL_SELECTION): New macro.
19563 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19564 (symbol_to_x_atom): Remove gratuitous arg.
19565 (x_handle_selection_request, lisp_data_to_selection_data)
19566 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19567 (x_own_selection, x_get_local_selection, x_convert_selection):
19568 New arg, specifying work frame. Use terminal-local Vselection_alist.
19569 (some_frame_on_display): Delete unused function.
19570 (Fx_own_selection_internal, Fx_get_selection_internal)
19571 (Fx_disown_selection_internal, Fx_selection_owner_p)
19572 (Fx_selection_exists_p): New optional frame arg.
19573 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19574 (x_handle_selection_clear): Don't treat other terminals with the
19575 same keyboard specially. Use the terminal-local Vselection_alist.
19576 (x_clear_frame_selections): Use Frun_hook_with_args.
19578 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19580 * xterm.h: Add support for those atoms.
19582 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
19584 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19585 (converted_selections, conversion_fail_tag): New global variables.
19586 (x_selection_request_lisp_error): Free the above.
19587 (x_get_local_selection): Remove unnecessary code.
19588 (x_reply_selection_request): Args changed; handle arbitrary array
19589 of converted selections stored in converted_selections.
19590 Separate the XChangeProperty and SelectionNotify steps.
19591 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19592 (x_convert_selection): New function.
19593 (x_handle_selection_event): Simplify.
19594 (x_get_foreign_selection): Don't ignore incoming requests while
19595 waiting for an answer; this will fail when we implement
19596 SAVE_TARGETS, and seems unnecessary anyway.
19597 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19598 (Vx_sent_selection_functions): Doc fix.
19600 2011-05-26 Leo Liu <sdl.web@gmail.com>
19602 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19604 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19606 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19608 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19609 for fringe update if it has periodic bitmap.
19610 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
19611 and fringe_bitmap_periodic_p.
19613 * fringe.c (get_fringe_bitmap_data): New function.
19614 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19615 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19616 row. Mark glyph row for fringe update if periodicity changed.
19618 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19619 for fringe update unless it has periodic bitmap.
19621 2011-05-25 Kenichi Handa <handa@m17n.org>
19623 * xdisp.c (get_next_display_element): Set correct it->face_id for
19624 a static composition.
19626 2011-05-24 Leo Liu <sdl.web@gmail.com>
19629 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19631 * fns.c (crypto_hash_function, Fsha1): New function.
19632 (Fmd5): Use crypto_hash_function.
19633 (syms_of_fns): Add Ssha1.
19635 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19637 * gnutls.c: Remove unused macros.
19638 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19639 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19640 Remove macros that are defined and never used.
19641 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19643 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19645 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19646 (Fx_get_selection_internal): Minor cleanup.
19647 (Fx_own_selection_internal): Rename arguments for consistency with
19650 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19652 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19654 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19656 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19658 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19660 * dispnew.c (scrolling_window): Don't exclude the case that the
19661 last enabled row in the desired matrix touches the bottom boundary.
19663 2011-05-21 Glenn Morris <rgm@gnu.org>
19665 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
19666 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19667 and add some more files.
19669 2011-05-20 Eli Zaretskii <eliz@gnu.org>
19671 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19672 report_file_error introduced by the change from 2011-05-07.
19674 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19676 * systime.h (Time): Define only if emacs is defined.
19677 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19678 where the include path doesn't have X11/X.h by default. See
19679 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19681 2011-05-20 Kenichi Handa <handa@m17n.org>
19683 * composite.c (find_automatic_composition): Fix previous change.
19685 2011-05-20 Glenn Morris <rgm@gnu.org>
19687 * lisp.mk: New file, split from Makefile.in.
19688 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19689 (shortlisp): Remove.
19690 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19692 2011-05-19 Glenn Morris <rgm@gnu.org>
19694 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19695 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19696 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19697 (lisp): Set the order to that of loadup.el.
19698 (shortlisp): Make it a copy of $lisp.
19699 (SOME_MACHINE_LISP): Remove.
19700 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19701 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19703 2011-05-18 Kenichi Handa <handa@m17n.org>
19705 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19706 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19707 (find_automatic_composition): Mostly rewrite for efficiency.
19709 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
19711 * makefile.w32-in: Update dependencies.
19713 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19715 * menu.c: Include limits.h (fixes the MS-Windows build broken by
19716 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
19718 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
19720 Fix some integer overflow issues, such as string length overflow.
19722 * insdel.c (count_size_as_multibyte): Check for string overflow.
19724 * character.c (lisp_string_width): Check for string overflow.
19725 Use EMACS_INT, not int, for string indexes and lengths; in
19726 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19727 the resulting string length overflows an EMACS_INT; instead,
19728 report a string overflow if no precision given. When checking for
19729 precision exhaustion, use a check that cannot possibly have
19730 integer overflow. (Bug#8675)
19731 * character.h (lisp_string_width): Adjust to new signature.
19733 * alloc.c (string_overflow): New function.
19734 (Fmake_string): Use it. This doesn't change behavior, but saves
19735 a few bytes and will simplify future changes.
19736 * character.c (string_escape_byte8): Likewise.
19737 * lisp.h (string_overflow): New decl.
19739 Fixups, following up to the user-interface timestamp change.
19740 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19741 for UI timestamps, instead of unsigned long.
19742 * msdos.c (mouse_get_pos): Likewise.
19743 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
19744 * w32gui.h (Time): Define by including "systime.h" rather than by
19745 declaring it ourselves. (Bug#8664)
19747 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19748 * image.c (clear_image_cache): Likewise.
19750 * term.c (term_mouse_position): Don't assume time_t wraparound.
19752 Be more systematic about user-interface timestamps.
19753 Before, the code sometimes used 'Time', sometimes 'unsigned long',
19754 and sometimes 'EMACS_UINT', to represent these timestamps.
19755 This change causes it to use 'Time' uniformly, as that's what X uses.
19756 This makes the code easier to follow, and makes it easier to catch
19757 integer overflow bugs such as Bug#8664.
19758 * frame.c (Fmouse_position, Fmouse_pixel_position):
19759 Use Time, not unsigned long, for user-interface timestamps.
19760 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19761 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19762 * keyboard.h (last_event_timestamp): Likewise.
19763 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19764 * menu.h (xmenu_show): Likewise.
19765 * term.c (term_mouse_position): Likewise.
19766 * termhooks.h (struct input_event.timestamp): Likewise.
19767 (struct terminal.mouse_position_hook): Likewise.
19768 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19769 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19770 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19771 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19772 what it was before.
19773 * menu.h, termhooks.h: Include "systime.h", for Time.
19775 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19776 Don't assume that the difference between two unsigned long values
19777 can fit into an integer. At this point, we know button_down_time
19778 <= event->timestamp, so the difference must be nonnegative, so
19779 there's no need to cast the result if double-click-time is
19780 nonnegative, as it should be; check that it's nonnegative, just in
19781 case. This bug is triggered when events are more than 2**31 ms
19782 apart (about 25 days). (Bug#8664)
19784 * xselect.c (last_event_timestamp): Remove duplicate decl.
19785 (x_own_selection): Remove needless cast to unsigned long.
19787 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19788 that always fit in int. Use a sentinel instead of a counter, to
19789 avoid a temp and to allay GCC's concerns about possible int overflow.
19790 * frame.h (struct frame): Use int for menu_bar_items_used
19791 instead of EMACS_INT, since it always fits in int.
19793 * menu.c (grow_menu_items): Check for int overflow.
19795 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19797 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19798 Before, the code was not consistent. These values cannot exceed
19799 2**31 - 1 so there's no need to make them unsigned.
19800 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19801 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19802 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19804 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19806 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19807 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19808 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19809 presumably because the widths might not match.
19811 * window.c (size_window): Avoid needless test at loop start.
19813 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19815 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19817 2011-05-12 Drew Adams <drew.adams@oracle.com>
19819 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19821 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19823 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19824 `width' to `bar_area_x' and `bar_area_width', respectively.
19825 (x_scroll_run): Take account of fringe background extension.
19827 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19828 Rename local vars `left' and `width' to `bar_area_x' and
19829 `bar_area_width', respectively.
19830 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19831 background extension.
19833 2011-05-10 Jim Meyering <meyering@redhat.com>
19835 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19837 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
19839 * image.c (Finit_image_library): Return t for built-in image types,
19840 like pbm and xbm. (Bug#8640)
19842 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19844 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19846 2011-05-07 Eli Zaretskii <eliz@gnu.org>
19848 * w32console.c (Fset_screen_color): Doc fix.
19849 (Fget_screen_color): New function.
19850 (syms_of_ntterm): Defsubr it.
19852 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19853 unlink the temporary file if Fcall_process didn't create it in the
19855 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19856 child process will be redirected to a file specified with `:file'.
19857 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19858 cue to call_process_cleanup not to close that handle.
19860 2011-05-07 Ben Key <bkey76@gmail.com>
19862 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19863 one of two shell specific rules, either bootstrap-temacs-CMD or
19864 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19865 to the previous implementation of the bootstrap-temacs rule.
19866 The bootstrap-temacs-CMD rule is similar to the previous
19867 implementation of the bootstrap-temacs rule except that it
19868 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19871 These changes, along with some changes to nt/configure.bat,
19872 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19873 earlier fix to add support for --cflags and --ldflags options
19874 that include quotes so that it works whether make uses cmd or
19877 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
19879 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19880 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19882 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19883 a string. Handle both cases.
19884 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19885 (Fdbus_register_method): Use Qinvalid_function.
19887 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19889 * makefile.w32-in: Update dependencies.
19890 (LISP_H): Add inttypes.h and stdin.h.
19891 (PROCESS_H): Add unistd.h.
19893 2011-05-06 Eli Zaretskii <eliz@gnu.org>
19895 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19896 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19898 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
19900 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19902 * term.c (vfatal): Remove stray call to va_end.
19903 It's not needed and the C Standard doesn't allow it here anyway.
19905 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19906 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19908 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19911 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19913 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19915 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19917 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19919 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19921 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19922 * charset.c (Fdefine_charset_internal): Don't initialize
19923 charset.code_space[15]. The value was garbage, on hosts with
19924 32-bit int (Bug#8600).
19926 * lread.c (read_integer): Be more consistent with string-to-number.
19927 Use string_to_number to do the actual conversion; this avoids
19928 rounding errors and fixes some other screwups. Without this fix,
19929 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19930 (digit_to_number): Move earlier, for benefit of read_integer.
19931 Return -1 if the digit is out of range for the base, -2 if it is
19932 not a digit in any supported base. (Bug#8602)
19934 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19936 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19937 to match comment at start of function. This also removes a
19938 GCC warning about overflow in a 32+64-bit port.
19940 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19942 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19943 Reported by Stefan Monnier in
19944 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
19945 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19946 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
19948 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19949 (EMACS_UINTPTR): Likewise, with uintptr_t.
19951 * lisp.h: Prefer 64-bit EMACS_INT if available.
19952 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19953 on 32-bit hosts that have 64-bit int, so that they can access
19955 However, temporarily disable this change unless the temporary
19956 symbol WIDE_EMACS_INT is defined.
19958 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19960 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19961 This removes an assumption that EMACS_INT and long are the same
19962 width as pointers. The assumption is true for Emacs porting targets
19963 now, but we want to make other targets possible.
19964 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19965 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19966 In the rest of the code, change types of integers that hold casted
19967 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19968 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19969 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19970 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19971 No need to cast type when ORing.
19972 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19973 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19974 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19975 assume EMACS_INT is the same width as char *.
19976 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19977 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19978 Remove no-longer-needed casts.
19979 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19980 (xg_tool_bar_help_callback, xg_make_tool_item):
19981 Use EMACS_INTPTR to hold an integer
19982 that will be cast to void *; this can avoid a GCC warning
19983 if EMACS_INT is not the same width as void *.
19984 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19985 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19986 (current_message_1, set_message_1):
19987 Use a local to convert to proper width without a cast.
19988 * xmenu.c (dialog_selection_callback): Likewise.
19990 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19991 Also, don't assume VALBITS / RAND_BITS is less than 5,
19992 and don't rely on undefined behavior when shifting a 1 left into
19994 * lisp.h (get_random): Change signature to match.
19996 * lread.c (hash_string): Use size_t, not int, for hash computation.
19997 Normally we prefer signed values; but hashing is special, because
19998 it's better to use unsigned division on hash table sizes so that
19999 the remainder is nonnegative. Also, size_t is the natural width
20000 for hashing into memory. The previous code used 'int', which doesn't
20001 retain enough info to hash well into very large tables.
20002 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20004 * dbusbind.c: Don't possibly lose pointer info when converting.
20005 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20006 Use XPNTR rather than XHASH, so that the high-order bits of
20007 the pointer aren't lost when converting through void *.
20009 * eval.c (Fautoload): Don't double-shift a pointer.
20011 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20013 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20015 * gnutls.c (DEF_GNUTLS_FN):
20016 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20018 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20020 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20023 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20025 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20026 New version that can reserve upto 2GB of heap space.
20028 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20030 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20032 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20034 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20035 `gnutls_certificate_set_x509_key_file'.
20037 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20039 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20040 Update dependencies.
20042 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20044 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20045 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20046 Remove unused parameter `fildes'.
20047 * process.c (read_process_output, send_process): Don't pass it.
20049 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20051 Fix previous change: the library cache is defined in w32.c.
20052 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20053 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20055 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20057 Implement dynamic loading of GnuTLS on Windows.
20059 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20060 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20061 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20064 * gnutls.c (Qgnutls_dll): Define.
20065 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20066 (gnutls_*): Declare function pointers.
20067 (init_gnutls_functions): New function to initialize function pointers.
20068 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20069 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20070 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20071 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20072 (emacs_gnutls_write, emacs_gnutls_read)
20073 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20074 (Fgnutls_available_p): New function.
20075 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20076 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20077 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20079 * image.c: Include w32.h.
20080 (Vimage_type_cache): Delete.
20081 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20082 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20083 (w32_delayed_load): Move to w32.c.
20085 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20087 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20088 (w32_delayed_load): Move from image.c. When loading a library, record
20089 its filename in the :loaded-from property of the library id.
20090 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20091 Initialize and staticpro them.
20092 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20094 * process.c: Include lisp.h before w32.h, not after.
20095 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20096 instead of gnutls_record_check_pending.
20098 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20100 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20102 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20103 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20106 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20108 * xterm.c (x_set_frame_alpha): Do not set property on anything
20109 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20111 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20113 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20115 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20117 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20118 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20119 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20120 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20121 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20122 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20123 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20124 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20125 (Qgnutls_bootprop_callbacks_verify): Make static.
20127 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20129 * callproc.c: Indentation fixup.
20131 * sysdep.c (wait_for_termination_1): Make static.
20132 (wait_for_termination, interruptible_wait_for_termination):
20133 Move after wait_for_termination_1.
20135 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20137 * sysdep.c (interruptible_wait_for_termination): New function
20138 which is like wait_for_termination, but allows keyboard
20141 * callproc.c (Fcall_process): Add (:file "file") as an option for
20143 (Fcall_process_region): Ditto.
20145 2011-04-30 Eli Zaretskii <eliz@gnu.org>
20147 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20148 rather than `XVECTOR (FOO)->size'.
20150 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20151 inttypes.h, as a gnulib replacement is used if it not available in
20154 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20156 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20157 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20158 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20160 * coding.c (coding_alloc_by_realloc): Error out if destination
20161 will grow beyond MOST_POSITIVE_FIXNUM.
20162 (decode_coding_emacs_mule): Abort if there isn't enough place in
20163 charbuf for the composition carryover bytes. Reserve an extra
20164 space for up to 2 characters produced in a loop.
20165 (decode_coding_iso_2022): Abort if there isn't enough place in
20166 charbuf for the composition carryover bytes.
20168 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20170 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20171 aborting when %lld or %lll format is passed.
20172 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20173 %llo or %llx format is passed. (Bug#8545)
20175 * window.c (window_scroll_line_based): Use a marker instead of
20176 simple variables to record original value of point. (Bug#7952)
20178 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20179 produced by %s or %c overflows available buffer space. (Bug#8545)
20181 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20183 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20184 (SIZE_MAX): Move defn after all includes, as they might #define it.
20186 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20188 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20190 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20192 * keyboard.c (Qdelayed_warnings_hook): Define.
20193 (command_loop_1): Run `delayed-warnings-hook'
20194 if Vdelayed_warnings_list is non-nil.
20195 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20196 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20198 2011-04-28 Eli Zaretskii <eliz@gnu.org>
20200 * doprnt.c (doprnt): Don't return value smaller than the buffer
20201 size if the message was truncated. (Bug#8545).
20203 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20205 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20206 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20208 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20210 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20212 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
20214 * makefile.w32-in: Update dependencies.
20216 2011-04-27 Eli Zaretskii <eliz@gnu.org>
20218 Improve `doprnt' and its usage. (Bug#8545)
20219 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20220 `format_end'. Remove support for %l as a conversion specifier.
20221 Don't use xrealloc. Improve diagnostics when the %l size modifier
20222 is used. Update the commentary.
20224 * eval.c (verror): Simplify calculation of size_t.
20226 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20229 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20231 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20234 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20236 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20237 This makes this file independent of the recent pseudovector change.
20239 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
20241 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20243 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20244 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20245 Remove unused local.
20246 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20248 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
20249 GCC 4.6.0 optimizes based on type-based alias analysis.
20250 For example, if b is of type struct buffer * and v of type struct
20251 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20252 != &v->size, and therefore "v->size = 1; b->size = 2; return
20253 v->size;" must therefore return 1. This assumption is incorrect
20254 for Emacs, since it type-puns struct Lisp_Vector * with many other
20255 types. To fix this problem, this patch adds a new type struct
20256 vectorlike_header that documents the constraints on layout of vectors
20257 and pseudovectors, and helps optimizing compilers not get fooled
20258 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20259 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20260 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20262 (XSETPVECTYPE): Rewrite in terms of new macro.
20263 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20264 This is a bit clearer, and further avoids the possibility of
20265 undesirable aliasing.
20266 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20267 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20268 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20269 since Lisp_Subr is a special case (no "next" field).
20270 (ASIZE): Now uses header.size rather than size.
20271 All previous uses of XVECTOR (foo)->size replaced to use this macro,
20272 to avoid the hassle of writing XVECTOR (foo)->header.size.
20273 (struct vectorlike_header): New type.
20274 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20275 object, to help avoid aliasing.
20276 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20277 (SUBRP): Likewise, since Lisp_Subr is a special case.
20278 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20279 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20280 (struct Lisp_Hash_Table): Combine first two members into a single
20281 struct vectorlike_header member. All uses of "size" and "next" members
20282 changed to be "header.size" and "header.next".
20283 * buffer.h (struct buffer): Likewise.
20284 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20285 * frame.h (struct frame): Likewise.
20286 * process.h (struct Lisp_Process): Likewise.
20287 * termhooks.h (struct terminal): Likewise.
20288 * window.c (struct save_window_data, struct saved_window): Likewise.
20289 * window.h (struct window): Likewise.
20290 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20291 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20292 * buffer.c (init_buffer_once): Likewise.
20293 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20295 * process.c (Fformat_network_address): Use local var for size,
20298 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20300 Make the Lisp reader and string-to-float more consistent (Bug#8525)
20301 * data.c (atof): Remove decl; no longer used or needed.
20302 (digit_to_number): Move to lread.c.
20303 (Fstring_to_number): Use new string_to_number function, to be
20304 consistent with how the Lisp reader treats infinities and NaNs.
20305 Do not assume that floating-point numbers represent EMACS_INT
20306 without losing information; this is not true on most 64-bit hosts.
20307 Avoid double-rounding errors, by insisting on integers when
20308 parsing non-base-10 numbers, as the documentation specifies.
20309 * lisp.h (string_to_number): New decl, replacing ...
20310 (isfloat_string): Remove.
20311 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
20312 (read1): Do not accept +. and -. as integers; this
20313 appears to have been a coding error. Similarly, do not accept
20314 strings like +-1e0 as floating point numbers. Do not report
20315 overflow for integer overflows unless the base is not 10 which
20316 means we have no simple and reliable way to continue.
20317 Break out the floating-point parsing into a new
20318 function string_to_number, so that Fstring_to_number parses
20319 floating point numbers consistently with the Lisp reader.
20320 (digit_to_number): Move here from data.c. Make it static inline.
20321 (E_CHAR, EXP_INT): Remove, replacing with ...
20322 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20323 (string_to_number): New function, replacing isfloat_string.
20324 This function checks for valid syntax and produces the resulting
20325 Lisp float number too. Rework it so that string-to-number
20326 no longer mishandles examples like "1.0e+". Use strtoumax,
20327 so that overflow for non-base-10 numbers is reported only when
20328 there's no portable and simple way to convert to floating point.
20330 * textprop.c (set_text_properties_1): Rewrite for clarity,
20331 and to avoid GCC warning about integer overflow.
20333 * intervals.h (struct interval): Use EMACS_INT for members
20334 where EMACS_UINT might cause problems. See
20335 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20336 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20337 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20339 (offset_intervals): Tell GCC not to worry about length overflow
20340 when negating a negative length.
20342 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20343 (overrun_check_free): Likewise.
20345 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20346 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20349 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20350 (gnutls_make_error): Rename local to avoid shadowing.
20351 (gnutls_emacs_global_deinit): ifdef out; not used.
20352 (Fgnutls_boot): Use const for pointer to readonly storage.
20353 Comment out unused local. Fix pointer signedness problems.
20355 * lread.c (openp): Don't stuff size_t into an 'int'.
20356 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20357 about possible signed overflow.
20359 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20360 (GDK_KEY_g): Don't define if already defined.
20361 (xg_prepare_tooltip): Avoid pointer signedness problem.
20362 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20364 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20365 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20367 * xfns.c (Fx_window_property): Simplify a bit,
20368 to make a bit faster and to avoid GCC 4.6.0 warning.
20369 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20371 * fns.c (internal_equal): Don't assume size_t fits in int.
20373 * alloc.c (compact_small_strings): Tighten assertion a little.
20375 Replace pEd with more-general pI, and fix some printf arg casts.
20376 * lisp.h (pI): New macro, generalizing old pEd macro to other
20377 conversion specifiers. For example, use "...%"pI"d..." rather
20378 than "...%"pEd"...".
20379 (pEd): Remove. All uses replaced with similar uses of pI.
20380 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20381 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20382 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20383 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20384 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20385 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20386 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20388 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20389 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20390 * print.c (safe_debug_print, print_object): Likewise.
20391 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20393 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20394 avoiding the 0 flag, which is not portable.
20395 * process.c (Fmake_network_process): Use pI to avoid cast.
20396 * region-cache.c (pp_cache): Likewise.
20397 * xdisp.c (decode_mode_spec): Likewise.
20398 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20399 behavior on 64-bit hosts with printf arg.
20400 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20401 (x_stop_queuing_selection_requests): Likewise.
20402 (x_get_window_property): Don't truncate byte count to an 'int'
20405 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20406 here, since it parses constructs like leading '-' and spaces,
20407 which are not wanted; and it overflows with large numbers.
20408 Instead, simply match F[0-9]+, which is what is wanted anyway.
20410 * alloc.c: Remove unportable assumptions about struct layout.
20411 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20412 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20413 (allocate_vectorlike, make_pure_vector): Use the new macros,
20414 plus offsetof, to remove unportable assumptions about struct layout.
20415 These assumptions hold on all porting targets that I know of, but
20416 they are not guaranteed, they're easy to remove, and removing them
20417 makes further changes easier.
20419 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20420 This doesn't fix a bug but makes the code clearer.
20421 (string_overrun_cookie): Now const. Use initializers that
20422 don't formally overflow signed char, to avoid warnings.
20423 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20424 can cause Emacs to crash when string overrun checking is enabled.
20425 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20426 multiple of sizeof (EMACS_INT); it need not be, if
20427 alignof(EMACS_INT) < sizeof (EMACS_INT).
20428 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20430 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
20432 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20434 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20436 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20437 supposed to be handshaking. (Bug#8556)
20438 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20440 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
20442 * lisp.h (Qdebug): List symbol.
20443 * eval.c (Qdebug): Restore global linkage.
20444 * keyboard.c (debug-on-event): New variable.
20445 (handle_user_signal): Break into debugger when debug-on-event
20446 matches the current signal symbol.
20448 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20450 * alloc.c (check_sblock, check_string_bytes)
20451 (check_string_free_list): Convert to standard C.
20453 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20455 * w32.c (emacs_gnutls_push): Fix typo.
20457 2011-04-25 Eli Zaretskii <eliz@gnu.org>
20459 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20460 "cast to pointer from integer of different size".
20462 Improve doprnt and its use in verror. (Bug#8545)
20463 * doprnt.c (doprnt): Document the set of format control sequences
20464 supported by the function. Use SAFE_ALLOCA instead of always
20467 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20468 is one byte too soon. Don't use xrealloc; instead xfree and
20471 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20473 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20476 * gnutls.c: Renamed global_initialized to
20477 gnutls_global_initialized. Added internals for the
20478 :verify-hostname-error, :verify-error, and :verify-flags
20479 parameters of `gnutls-boot' and documented those parameters in the
20480 docstring. Start callback support.
20481 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20482 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20483 on error. Return error code.
20484 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20485 (emacs_gnutls_read): Likewise.
20486 (Fgnutls_boot): Return handshake error code.
20487 (emacs_gnutls_handle_error): New function.
20488 (wsaerror_to_errno): Likewise.
20490 * w32.h (emacs_gnutls_pull): Add prototype.
20491 (emacs_gnutls_push): Likewise.
20493 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20494 (emacs_gnutls_push): Likewise.
20496 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20498 * process.c (wait_reading_process_output): Check if GnuTLS
20499 buffered some data internally if no FDs are set for TLS
20502 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20503 (LIBS): Link to USER_LIBS.
20504 ($(BLD)/gnutls.$(0)): New target.
20506 2011-04-24 Eli Zaretskii <eliz@gnu.org>
20508 * xdisp.c (handle_single_display_spec): Rename the
20509 display_replaced_before_p argument into display_replaced_p, to
20510 make it consistent with the commentary. Fix typos in the
20513 * textprop.c (syms_of_textprop): Remove dead code.
20514 (copy_text_properties): Delete obsolete commentary about an
20515 interface that was deleted long ago. Fix typos in the description
20518 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20519 to changes in oldXMenu/XMenu.h from 2011-04-16.
20520 <menu_help_message, prev_menu_help_message>: Constify.
20521 (IT_menu_make_room): menu->help_text is now `const char **';
20524 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20525 to changes in oldXMenu/XMenu.h from 2011-04-16.
20526 (struct XMenu): Declare `help_text' `const char **'.
20528 * xfaces.c <Qunspecified>: Make extern again.
20530 * syntax.c: Include sys/types.h before including regex.h, as
20533 * doc.c (get_doc_string): Improve the format passed to `error'.
20535 * doprnt.c (doprnt): Improve commentary.
20537 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20539 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20542 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20543 changes in globals.h immediately force recompilation.
20544 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20545 $(CURDIR)/s/ms-w32.h.
20546 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20548 * character.c (Fchar_direction): Function deleted.
20549 (syms_of_character): Don't defsubr it.
20550 <char-direction-table>: Deleted.
20552 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20554 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20555 * doprnt.c: Include limits.h.
20556 (SIZE_MAX): New macro.
20557 (doprnt): Return a size_t value. 2nd arg is now size_t.
20558 Many local variables are now size_t instead of int or unsigned.
20559 Improve overflow protection. Support `l' modifier for integer
20560 conversions. Support %l conversion. Don't assume an EMACS_INT
20561 argument for integer conversions and for %c.
20563 * lisp.h (doprnt): Restore prototype.
20565 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20566 $(SRC)/character.h.
20568 * Makefile.in (base_obj): Add back doprnt.o.
20570 * deps.mk (doprnt.o): Add back prerequisites.
20571 (callint.o): Depend on character.h.
20573 * eval.c (internal_lisp_condition_case): Include the handler
20574 representation in the error message.
20575 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20576 when breaking from the loop.
20578 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20580 * callint.c (Fcall_interactively): When displaying error message
20581 about invalid control letter, pass the character's codepoint, not
20582 a pointer to its multibyte form. Improve display of the character
20583 in octal and display also its hex code.
20585 * character.c (char_string): Use %x to display the (unsigned)
20586 codepoint of an invalid character, to avoid displaying a bogus
20589 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20590 `error', not SYMBOL_NAME itself.
20592 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20593 character arguments to `error'.
20595 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20596 to `error' in error message about FINAL_CHAR argument. Make sure
20597 FINAL_CHAR is a character, and use %c when it is passed as
20598 argument to `error'.
20600 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20602 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20604 * w32.c: Include <time.h>.
20605 (sys_localtime): New function.
20607 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
20609 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20611 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
20613 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
20615 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20616 zombies (Bug#8467).
20618 2011-04-19 Eli Zaretskii <eliz@gnu.org>
20620 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20621 gl_state.e_property when gl_state.object is Qt.
20623 * insdel.c (make_gap_larger): Remove limitation of buffer size
20626 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
20628 * xdisp.c (lookup_glyphless_char_display)
20629 (produce_glyphless_glyph): Handle cons cell entry in
20630 glyphless-char-display.
20631 (Vglyphless_char_display): Document it.
20633 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20634 glyphless-char-display.
20636 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
20638 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20640 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20642 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20643 definition for no-X builds.
20645 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
20647 Static checks with GCC 4.6.0 and non-default toolkits.
20649 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20651 * process.c (keyboard_bit_set): Define only if SIGIO.
20652 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20653 (send_process): Repair possible setjmp clobbering.
20655 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20657 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20659 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20661 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20662 Define only if needed.
20664 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20665 by pacifying GCC about it. Maybe it's time to retire it?
20666 * xfaces.c (USG, __TIMEVAL__): Likewise.
20668 * dispextern.h (struct redisplay_interface): Rename param
20669 to avoid shadowing.
20670 * termhooks.h (struct terminal): Likewise.
20671 * xterm.c (xembed_send_message): Likewise.
20673 * insdel.c (make_gap_smaller): Define only if
20674 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20676 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20679 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20680 so that we aren't warned about unused symbols.
20682 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20684 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
20686 * xfns.c (x_real_positions): Mark locals as initialized.
20688 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20690 * xterm.c: Fix problems found by static analysis with other toolkits.
20691 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
20692 (x_dispatch_event): Declare static if USE_GTK, and
20693 define if USE_GTK || USE_X_TOOLKIT.
20694 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
20695 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
20696 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20697 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
20699 * xmenu.c (menu_help_callback): Pointer type fixes.
20700 Use const pointers when pointing at readonly data. Avoid pointer
20701 signedness clashes.
20702 (FALSE): Remove unused macro.
20703 (update_frame_menubar): Remove unused decl.
20705 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20707 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20708 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20709 (single_menu_item): Rename local to avoid shadowing.
20711 * keyboard.c (make_lispy_event): Remove unused local var.
20713 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20714 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20716 * bitmaps: Change bitmaps from unsigned char back to the X11
20717 compatible char. Avoid the old compiler warnings about
20718 out-of-range initializers by using, for example, '\xab' rather
20721 * xgselect.c (xgselect_initialize): Check vs interface
20722 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20724 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20726 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20727 to read-only memory.
20729 * fns.c (vector): Remove; this old hack is no longer needed.
20731 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
20733 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
20735 * xrdb.c (x_load_resources): Omit unused local.
20737 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
20738 (x_window): Rename locals to avoid shadowing.
20739 (USG): Use the kludged USG macro, to pacify gcc.
20741 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
20742 (x_term_init): Remove local to avoid shadowing.
20744 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
20746 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20747 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20749 2011-04-16 Eli Zaretskii <eliz@gnu.org>
20751 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20753 Fix regex.c, syntax.c and friends for buffers > 2GB.
20754 * syntax.h (struct gl_state_s): Declare character position members
20757 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20759 * textprop.c (verify_interval_modification, interval_of):
20760 Declare arguments EMACS_INT.
20762 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20765 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20767 * indent.c (Fvertical_motion): Local variable it_start is now
20770 * regex.c (re_match, re_match_2, re_match_2_internal)
20771 (bcmp_translate, regcomp, regexec, print_double_string)
20772 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20773 (re_compile_pattern, re_exec): Declare arguments and local
20774 variables `size_t' and `ssize_t' and return values `regoff_t', as
20776 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20777 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20778 <compile_stack_type>: `size' and `avail' are now `size_t'.
20780 * regex.h <regoff_t>: Use ssize_t, not int.
20781 (re_search, re_search_2, re_match, re_match_2): Arguments that
20782 specify buffer/string position and length are now ssize_t and
20783 size_t. Return type is regoff_t.
20785 2011-04-16 Ben Key <bkey76@gmail.com>
20787 * nsfont.m: Fixed bugs in ns_get_family and
20788 ns_descriptor_to_entity that were caused by using free to
20789 deallocate memory blocks that were allocated by xmalloc (via
20790 xstrdup). This caused Emacs to crash when compiled with
20791 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20792 --enable-checking=xmallocoverrun). xfree is now used to
20793 deallocate these memory blocks.
20795 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
20797 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20799 emacs_write: Accept and return EMACS_INT for sizes.
20800 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20802 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20803 Accept and return EMACS_INT.
20804 (emacs_gnutls_write): Return the number of bytes written on
20806 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
20807 (emacs_read, emacs_write): Remove check for negative size, as the
20808 Emacs source code has been audited now.
20809 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20810 (emacs_read, emacs_write): Use it.
20811 * process.c (send_process): Adjust to the new signatures of
20812 emacs_write and emacs_gnutls_write. Do not attempt to store
20813 a byte offset into an 'int'; it might overflow.
20814 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
20816 * sound.c: Don't assume sizes fit in 'int'.
20817 (struct sound_device.period_size, alsa_period_size):
20818 Return EMACS_INT, not int.
20819 (struct sound_device.write, vox_write, alsa_write):
20820 Accept EMACS_INT, not int.
20821 (wav_play, au_play): Use EMACS_INT to store sizes and to
20822 record read return values.
20824 2011-04-15 Ben Key <bkey76@gmail.com>
20826 * keyboard.c (Qundefined): Don't declare static since it is used
20828 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20829 static since they are used in nsfont.m.
20831 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20833 * process.c (Qprocessp): Don't declare static.
20834 * lisp.h (Qprocessp): Declare again.
20836 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
20838 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20840 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20842 Improve C-level modularity by making more things 'static'.
20844 Don't publish debugger-only interfaces to other modules.
20845 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20846 (verify_bytepos, count_markers): Move decls to the only modules
20848 * region-cache.h (pp_cache): Likewise.
20849 * window.h (check_all_windows): Likewise.
20850 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20852 * sysdep.c (croak): Now static, if
20853 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20854 * syssignal.h (croak): Declare only if not static.
20856 * alloc.c (refill_memory_reserve): Now static if
20857 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20858 * lisp.h (refill_memory_reserve): Declare only if not static.
20860 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20861 Define only if USE_LUCID.
20863 * xrdb.c (x_customization_string, x_rm_string): Now static.
20865 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20866 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20868 * xdisp.c (draw_row_with_mouse_face): Now static.
20869 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20871 * window.h (check_all_windows): Mark externally visible.
20873 * window.c (window_deletion_count): Now static.
20875 * undo.c: Make symbols static if they're not exported.
20876 (last_undo_buffer, last_boundary_position, pending_boundary):
20879 * textprop.c (interval_insert_behind_hooks): Now static.
20880 (interval_insert_in_front_hooks): Likewise.
20882 * term.c: Make symbols static if they're not exported.
20883 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20884 (max_frame_lines, tty_set_terminal_modes):
20885 (tty_reset_terminal_modes, tty_turn_off_highlight):
20886 (get_tty_terminal): Now static.
20887 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20888 * termhooks.h (term_mouse_moveto): Do not declare if
20889 HAVE_WINDOW_SYSTEM.
20890 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20891 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20893 * sysdep.c: Make symbols static if they're not exported.
20894 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20896 (sigprocmask_set, full_mask): Remove; unused.
20897 (wait_debugging): Mark as visible.
20898 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20899 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20901 * syntax.c (syntax_temp): Define only if !__GNUC__.
20903 * sound.c (current_sound_device, current_sound): Now static.
20905 * search.c (searchbufs, searchbuf_head): Now static.
20907 * scroll.c (scroll_cost): Remove; unused.
20908 * dispextern.h (scroll_cost): Remove decl.
20910 * region-cache.h (pp_cache): Mark as externally visible.
20912 * process.c: Make symbols static if they're not exported.
20913 (process_tick, update_tick, create_process, chan_process):
20914 (Vprocess_alist, proc_buffered_char, datagram_access):
20915 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20916 (deactivate_process): Mark defn as static, as well as decl.
20917 * lisp.h (create_process): Remove decl.
20918 * process.h (chan_process, Vprocess_alist): Remove decls.
20920 * print.c: Make symbols static if they're not exported.
20921 (print_depth, new_backquote_output, being_printed, print_buffer):
20922 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20923 (print_interval, print_number_index, initial_stderr_stream):
20925 * lisp.h (Fprinc): Remove decl.
20926 (debug_output_compilation_hack): Mark as externally visible.
20928 * sysdep.c (croak): Move decl from here to syssignal.h.
20929 * syssignal.h (croak): Put it here, so the API can be checked when
20930 'croak' is called from dissociate_if_controlling_tty.
20932 * minibuf.c: Make symbols static if they're not exported.
20933 (minibuf_save_list, choose_minibuf_frame): Now static.
20934 * lisp.h (choose_minibuf_frame): Remove decl.
20936 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20938 * lread.c: Make symbols static if they're not exported.
20939 (read_objects, initial_obarray, oblookup_last_bucket_number):
20941 (make_symbol): Remove; unused.
20942 * lisp.h (initial_obarray, make_symbol): Remove decls.
20944 * keyboard.c: Make symbols static if they're not exported.
20945 (single_kboard, recent_keys_index, total_keys, recent_keys):
20946 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20947 (this_single_command_key_start, echoing, last_auto_save):
20948 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20949 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20950 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20951 (Vlispy_mouse_stem, double_click_count):
20953 (force_auto_save_soon): Define only if SIGDANGER.
20954 (ignore_mouse_drag_p): Now static if
20955 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20956 (print_help): Remove; unused.
20957 (stop_character, last_timer_event): Mark as externally visible.
20958 * keyboard.h (ignore_mouse_drag_p): Declare only if
20959 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20960 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20961 * lisp.h (echoing): Remove decl.
20962 (force_auto_save_soon): Declare only if SIGDANGER.
20963 * xdisp.c (redisplay_window): Simplify code, to make it more
20964 obvious that ignore_mouse_drag_p is not accessed if !defined
20965 USE_GTK && !defined HAVE_NS.
20967 * intervals.c: Make symbols static if they're not exported.
20968 (merge_properties_sticky, merge_interval_right, delete_interval):
20970 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20972 * insdel.c: Make symbols static if they're not exported.
20973 However, leave prepare_to_modify_buffer alone. It's never
20974 called from outside this function, but that appears to be a bug.
20975 (combine_after_change_list, combine_after_change_buffer):
20976 (adjust_after_replace, signal_before_change): Now static.
20977 (adjust_after_replace_noundo): Remove; unused.
20978 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
20979 (signal_before_change): Remove decls.
20981 * indent.c (val_compute_motion, val_vmotion): Now static.
20983 * image.c: Make symbols static if they're not exported.
20984 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20986 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20987 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20989 * fringe.c (standard_bitmaps): Now static.
20990 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20992 * frame.c: Make symbols static if they're not exported.
20993 (x_report_frame_params, make_terminal_frame): Now static.
20994 (get_frame_param): Now static, unless HAVE_NS.
20995 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20996 (x_get_resource_string): Remove; not used.
20997 * frame.h (make_terminal_frame, x_report_frame_params):
20998 (x_get_resource_string); Remove decls.
20999 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21000 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21002 * font.c, fontset.c: Make symbols static if they're not exported.
21003 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21004 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21005 * font.c (font_close_object): Now static.
21006 * font.h (font_close_object): Remove.
21007 * fontset.c (FONTSET_OBJLIST): Remove.
21008 (free_realized_fontset) #if-0 the body, which does nothing.
21009 (face_suitable_for_char_p): #if-0, as it's never called.
21010 * fontset.h (face_suitable_for_char_p): Remove decl.
21011 * xfaces.c (face_at_string_position):
21012 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21013 since 0 is always ASCII.
21015 * fns.c (weak_hash_tables): Now static.
21017 * fileio.c: Make symbols static if they're not exported.
21018 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21019 (Vwrite_region_annotation_buffers): Now static.
21021 * eval.c: Make symbols static if they're not exported.
21022 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21023 * lisp.h (backtrace_list): Remove decl.
21025 * emacs.c: Make symbols static if they're not exported.
21026 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21027 (fatal_error_code, fatal_error_signal_hook, standard_args):
21029 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21030 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21031 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21032 * lisp.h (fatal_error_signal_hook): Remove decl.
21033 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21035 * editfns.c: Move a (normally-unused) function to its only use.
21036 * editfns.c, lisp.h (get_operating_system_release): Remove.
21037 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21038 worth the hassle of breaking this out.
21040 * xterm.c: Make symbols static if they're not exported.
21041 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21042 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21043 (x_destroy_window, x_delete_display):
21045 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21046 (x_mouse_leave): Remove; unused.
21047 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21048 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21049 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21051 (x_mouse_leave): Declare only if WINDOWSNT.
21052 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21053 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21056 * ftxfont.c: Make symbols static if they're not exported.
21057 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21059 * font.h (ftxfont_driver): Likewise.
21061 * xfns.c: Make symbols static if they're not exported.
21062 (x_last_font_name, x_display_info_for_name):
21063 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21064 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21065 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21066 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21067 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21068 (last_show_tip_args): Now static.
21069 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21070 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21071 (x_screen_planes): Remove; unused.
21072 * dispextern.h (x_screen_planes): Remove decl.
21074 * dispnew.c: Make symbols static if they're not exported.
21075 * dispextern.h (redraw_garbaged_frames, scrolling):
21076 (increment_row_positions): Remove.
21077 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21078 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21080 (redraw_garbaged_frames): Remove; unused.
21082 * xfaces.c: Make symbols static if they're not exported.
21083 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21085 * xterm.h (defined_color): Remove decls.
21086 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21087 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21088 (menu_face_changed_default, defined_color, free_realized_face):
21089 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21090 (ascii_face_of_lisp_face): Remove; unused.
21092 * xdisp.c: Make symbols static if they're not exported.
21093 * dispextern.h (scratch_glyph_row, window_box_edges):
21094 (glyph_to_pixel_coords, set_cursor_from_row):
21095 (get_next_display_element, set_iterator_to_next):
21096 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21097 (show_mouse_face): Remove decls
21098 * frame.h (message_buf_print): Likewise.
21099 * lisp.h (pop_message, set_message, check_point_in_composition):
21101 * xterm.h (set_vertical_scroll_bar): Likewise.
21102 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21103 (message_buf_print, scratch_glyph_row, displayed_buffer):
21104 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21105 (get_next_display_element, show_mouse_face, window_box_edges):
21106 (frame_to_window_pixel_xy, check_point_in_composition):
21107 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21108 (glyph_to_pixel_coords): Remove; unused.
21110 * dired.c (file_name_completion): Now static.
21112 * dbusbind.c (xd_in_read_queued_messages): Now static.
21114 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21115 * data.c (circular_list_error): Remove.
21117 * commands.h (last_point_position, last_point_position_buffer):
21118 (last_point_position_window): Remove decls.
21119 * keyboard.c: Make these variables static.
21121 * coding.h (coding, code_convert_region, encode_coding_gap):
21123 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21124 (iso_code_class, detect_coding, code_convert_region): Now static.
21125 (encode_coding_gap): Remove; unused.
21127 * chartab.c (chartab_chars, chartab_bits): Now static.
21129 * charset.h (charset_iso_8859_1): Remove decl.
21130 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21133 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21134 * ccl.c (Vccl_program_table): Now static.
21135 (check_ccl_update): Remove; unused.
21137 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21138 * category.h: ... from here.
21139 * category.c (check_category_table, set_category_set): Now static.
21141 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21142 * lisp.h: Remove these decls.
21144 * buffer.c (buffer_count): Remove unused var.
21146 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21147 so that it's not optimized away.
21148 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21149 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21150 exported only to the debugger.
21152 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21153 * atimer.h (run_all_atimers): Remove; not exported.
21155 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21156 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21157 was inaccessible from Lisp.
21158 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21159 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21161 alloc.c: Import and export fewer symbols, and remove unused items.
21162 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21164 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21165 it's not optimized away by whole-program optimization.
21166 (message_enable_multibyte, free_misc): Remove.
21167 (catchlist, handlerlist, mark_backtrace):
21168 Declare only if BYTE_MARK_STACK.
21169 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21170 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21171 (message_enable_multibyte): Remove decl.
21172 (free_misc, interval_free_list, float_block, float_block_index):
21173 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21174 (cons_free_list, last_marked_index):
21176 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21177 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21178 (mark_backtrace): Define only if BYTE_MARK_STACK.
21179 * xdisp.c (message_enable_multibyte): Now static.
21181 Declare Lisp_Object Q* variables to be 'static' if not exported.
21182 This makes it easier for human readers (and static analyzers)
21183 to see whether these variables are used from other modules.
21184 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21185 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21186 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21187 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21188 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21189 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21190 * xmenu.c, xselect.c:
21191 Declare Q* vars static if they are not used in other modules.
21192 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21193 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21194 Remove decls of unexported vars.
21195 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21197 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21199 Make Emacs functions such as Fatom 'static' by default.
21200 This makes it easier for human readers (and static analyzers)
21201 to see whether these functions can be called from other modules.
21202 DEFUN now defines a static function. To make the function external
21203 so that it can be used in other C modules, use the new macro DEFUE.
21204 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21205 (Finit_image_library):
21206 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21207 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21208 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21209 Remove decls, since these functions are now static.
21210 (Funintern, Fget_internal_run_time): New decls, since these functions
21211 were already external.
21213 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21214 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21215 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21216 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21217 * keyboard.c, keymap.c, lread.c:
21218 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21219 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21220 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21221 Mark functions with DEFUE instead of DEFUN,
21222 if they are used in other modules.
21223 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21224 decls for now-static functions.
21225 * buffer.h (Fdelete_overlay): Remove decl.
21226 * callproc.c (Fgetenv_internal): Mark as internal.
21227 * composite.c (Fremove_list_of_text_properties): Remove decl.
21228 (Fcomposition_get_gstring): New forward static decl.
21229 * composite.h (Fcomposite_get_gstring): Remove decl.
21230 * dired.c (Ffile_attributes): New forward static decl.
21231 * doc.c (Fdocumntation_property): New forward static decl.
21232 * eval.c (Ffetch_bytecode): New forward static decl.
21233 (Funintern): Remove extern decl; now in .h file where it belongs.
21234 * fileio.c (Fmake_symbolic_link): New forward static decl.
21235 * image.c (Finit_image_library): New forward static decl.
21236 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21237 * intervals.h (Fprevious_property_change):
21238 (Fremove_list_of_text_properties): Remove decls.
21239 * keyboard.c (Fthis_command_keys): Remove decl.
21240 (Fcommand_execute): New forward static decl.
21241 * keymap.c (Flookup_key): New forward static decl.
21242 (Fcopy_keymap): Now static.
21243 * keymap.h (Flookup_key): Remove decl.
21244 * process.c (Fget_process): New forward static decl.
21245 (Fprocess_datagram_address): Mark as internal.
21246 * syntax.c (Fsyntax_table_p): New forward static decl.
21247 (skip_chars): Remove duplicate decl.
21248 * textprop.c (Fprevious_property_change): New forward static decl.
21249 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21251 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21252 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21254 * editfns.c (Fformat): Remove unreachable code.
21256 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21258 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21261 2011-04-13 Eli Zaretskii <eliz@gnu.org>
21263 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21264 when at ZV. (Bug#8487)
21266 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21268 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21270 * keyboard.c (parse_tool_bar_item): Likewise.
21271 * sound.c (sound_cleanup, alsa_close): Likewise.
21272 * termcap.c (tgetent): Likewise.
21273 * xfns.c (x_default_font_parameter): Likewise.
21274 * xsettings.c (read_and_apply_settings): Likewise.
21276 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21277 (overrun_check_free): Protoize.
21279 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21281 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21282 since callers should never pass a negative size.
21283 Change the signature to match that of plain 'read' and 'write'; see
21284 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21285 * lisp.h: Update prototypes of emacs_write and emacs_read.
21287 2011-04-11 Eli Zaretskii <eliz@gnu.org>
21289 * xdisp.c (redisplay_window): Don't try to determine the character
21290 position of the scroll margin if the window start point w->startp
21291 is outside the buffer's accessible region. (Bug#8468)
21293 2011-04-10 Eli Zaretskii <eliz@gnu.org>
21295 Fix write-region and its subroutines for buffers > 2GB.
21296 * fileio.c (a_write, e_write): Modify declaration of arguments and
21297 local variables to support buffers larger than 2GB.
21298 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21300 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21301 argument, local variables, and return value.
21303 * lisp.h: Update prototypes of emacs_write and emacs_read.
21305 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21307 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
21309 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21311 Fix more problems found by GCC 4.6.0's static checks.
21313 * xdisp.c (vmessage): Use a better test for character truncation.
21315 * charset.c (load_charset_map): <, not <=, for optimization,
21316 and to avoid potential problems with integer overflow.
21317 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
21318 * casetab.c (set_identity, shuffle): Likewise.
21319 * editfns.c (Fformat): Likewise.
21320 * syntax.c (skip_chars): Likewise.
21322 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21323 This also lets GCC 4.6.0 generate slightly better loop code.
21325 * callint.c (Fcall_interactively): <, not <=, for optimization.
21326 (Fcall_interactively): Count the number of arguments produced,
21327 not the number of arguments given. This is simpler and lets GCC
21328 4.6.0 generate slightly better code.
21330 * ftfont.c: Distingish more carefully between FcChar8 and char.
21331 The previous code passed unsigned char * to a functions like
21332 strlen and xstrcasecmp that expect char *, which does not
21333 conform to the C standard.
21334 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21335 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21336 char * when the C standard requires it.
21338 * keyboard.c (read_char): Remove unused var.
21340 * eval.c: Port to Windows vsnprintf (Bug#8435).
21341 Include <limits.h>.
21342 (SIZE_MAX): Define if the headers do not.
21343 (verror): Do not give up if vsnprintf returns a negative count.
21344 Instead, grow the buffer. This ports to Windows vsnprintf, which
21345 does not conform to C99. Problem reported by Eli Zaretskii.
21346 Also, simplify the allocation scheme, by avoiding the need for
21347 calling realloc, and removing the ALLOCATED variable.
21349 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21351 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21352 But keep the doprint source code for now, as we might revamp it
21353 and use it again (Bug#8435).
21354 * lisp.h (doprnt): Remove.
21355 * Makefile.in (base_obj): Remove doprnt.o.
21356 * deps.mk (doprnt.o): Remove.
21358 error: Print 32- and 64-bit integers portably (Bug#8435).
21359 Without this change, on typical 64-bit hosts error ("...%d...", N)
21360 was used to print both 32- and 64-bit integers N, which relied on
21361 undefined behavior.
21362 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
21363 * lisp.h (error, verror): Mark as printf-like functions.
21364 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21365 Report overflow in size calculations when allocating printf buffer.
21366 Do not truncate output string at its first null byte.
21367 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21368 Truncate the output at a character boundary, since vsnprintf does not
21370 * charset.c (check_iso_charset_parameter): Convert internal
21371 character to string before calling 'error', since %c now has the
21373 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21374 overflow when computing char to be passed to 'error'. Do not
21375 pass Lisp_Object to 'error'; pass the integer instead.
21376 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21377 formatted with plain %d.
21379 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21381 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21383 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21385 * xterm.c (x_catch_errors): Remove duplicate declaration.
21387 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21389 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21391 2011-04-10 Jim Meyering <meyering@redhat.com>
21393 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21394 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21395 return ssize_t not "int", and use size_t as the buffer length.
21396 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21397 * gnutls.h: Update declarations.
21398 * process.c (read_process_output): Use ssize_t, to match.
21399 (send_process): Likewise.
21401 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21403 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21405 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21407 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21408 Use unsigned char, to match FcChar8 type definition.
21410 * xterm.c (handle_one_xevent):
21411 * xmenu.c (create_and_show_popup_menu):
21412 * xselect.c (x_decline_selection_request)
21413 (x_reply_selection_request): Avoid type-punned deref of X events.
21415 2011-04-09 Eli Zaretskii <eliz@gnu.org>
21417 Fix some uses of `int' instead of EMACS_INT.
21418 * search.c (string_match_1, fast_string_match)
21419 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21420 (scan_buffer, find_next_newline_no_quit)
21421 (find_before_next_newline, search_command, Freplace_match)
21422 (Fmatch_data): Make some `int' variables be EMACS_INT.
21424 * xdisp.c (display_count_lines): 3rd argument and return value now
21425 EMACS_INT. All callers changed.
21426 (pint2hrstr): Last argument is now EMACS_INT.
21428 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21429 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21430 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21431 (decode_coding_utf_16, decode_coding_emacs_mule)
21432 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21433 (decode_coding_ccl, decode_coding_charset)
21434 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21435 (decode_coding_iso_2022, decode_coding_emacs_mule)
21436 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21437 <char_offset, last_offset>: Declare EMACS_INT.
21438 (encode_coding_utf_8, encode_coding_utf_16)
21439 (encode_coding_emacs_mule, encode_invocation_designation)
21440 (encode_designation_at_bol, encode_coding_iso_2022)
21441 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21442 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21444 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21445 (encode_invocation_designation): Last argument P_NCHARS is now
21447 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21448 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21450 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21453 * ccl.c (Fccl_execute_on_string): Declare some variables
21456 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
21458 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21460 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21462 * process.c (Fformat_network_address): Doc fix.
21464 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21466 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21468 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
21470 * keyboard.c (read_char): Call Lisp function help-form-show,
21471 instead of using internal_with_output_to_temp_buffer.
21472 (Qhelp_form_show): New var.
21473 (syms_of_keyboard): Use DEFSYM macro.
21475 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21477 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21479 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
21481 * process.c (Flist_processes): Remove to Lisp.
21482 (list_processes_1): Delete.
21484 2011-04-06 Eli Zaretskii <eliz@gnu.org>
21486 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21488 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21490 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
21492 Fix more problems found by GCC 4.6.0's static checks.
21494 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21496 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21498 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21500 * xdisp.c (vmessage): Mark as a printf-like function.
21502 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21504 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21506 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21507 printf-like functions.
21508 (tiff_load): Add casts to remove these marks before passing them
21509 to system-supplied API.
21511 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21513 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21514 This avoids several warnings with gcc -Wstrict-overflow.
21515 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21516 directly, rather than having caller test rule sign. This avoids
21517 some unnecessary tests.
21518 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21519 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21520 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21522 * xfont.c (xfont_text_extents): Remove var that was set but not used.
21523 (xfont_open): Avoid unnecessary tests.
21525 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21527 * composite.h, composite.c (composition_gstring_put_cache):
21528 Use EMACS_INT, not int, for length.
21530 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21531 breaking out part of COMPOSITION_DECODE_RULE.
21532 (COMPOSITION_DECODE_RULE): Use it.
21533 * composite.c (get_composition_id): Remove unused local vars,
21534 by using the new macro.
21536 * textprop.c (set_text_properties_1): Change while to do-while,
21537 since the condition is always true at first.
21539 * intervals.c (graft_intervals_into_buffer): Mark var as used.
21540 (interval_deletion_adjustment): Return unsigned value.
21543 * process.c (list_processes_1, create_pty, read_process_output):
21544 (exec_sentinel): Remove vars that were set but not used.
21545 (create_pty): Remove unnecessary "volatile"s.
21546 (Fnetwork_interface_info): Avoid possibility of int overflow.
21547 (read_process_output): Do adaptive read buffering even if carryover.
21548 (read_process_output): Simplify nbytes computation if buffered.
21550 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21552 * syntax.c (scan_words): Remove var that was set but not used.
21553 (update_syntax_table): Use unsigned instead of int.
21555 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21556 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21557 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21559 * print.c (print_error_message): Avoid int overflow.
21561 * font.c (font_list_entities): Redo for clarity,
21562 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21564 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21565 (font_score): Avoid potential overflow in diff calculation.
21567 * fns.c (substring_both): Remove var that is set but not used.
21568 (sxhash): Redo loop for clarity and to avoid wraparound warning.
21570 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21572 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21573 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21574 can always succeed if overflow has undefined behavior.
21576 * search.c (boyer_moore, wordify): Remove vars set but not used.
21577 (wordify): Omit three unnecessary tests.
21579 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21580 All callers changed. This avoids the need for an unused var.
21582 * casefiddle.c (casify_region): Remove var that is set but not used.
21584 * dired.c (file_name_completion): Remove var that is set but not used.
21586 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21588 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
21589 (Finsert_file_contents): Remove unnecessary code checking fd.
21591 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21592 Check for integer overflow on size calculations.
21594 * buffer.c (Fprevious_overlay_change): Remove var that is set
21597 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21598 Remove vars that are set but not used.
21599 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
21600 (timer_check_2): Mark vars as initialized.
21602 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21604 * image.c (lookup_image): Remove var that is set but not used.
21605 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
21607 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21608 that are set but not used.
21610 * xfns.c (make_invisible_cursor): Don't return garbage
21611 if XCreateBitmapFromData fails (Bug#8410).
21613 * xselect.c (x_get_local_selection, x_handle_property_notify):
21614 Remove vars that are set but not used.
21616 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
21617 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
21619 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21620 Remove var that is set but not used.
21621 (scroll_bar_windows_size): Now size_t, not int.
21622 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21623 Check for overflow.
21625 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21626 (map_tty_color) [!defined MSDOS]: Likewise.
21628 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21630 * coding.c: Remove vars that are set but not used.
21631 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21632 All callers changed.
21633 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21634 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21635 (decode_coding_charset): Remove vars that are set but not used.
21637 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21638 that is set but not used.
21640 * print.c (print_object): Remove var that is set but not used.
21642 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
21643 The gnulib version avoids calling malloc in the usual case,
21644 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21645 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21646 * filelock.c (current_lock_owner): Likewise.
21647 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21648 * sysdep.c: Include allocator.h, careadlinkat.h.
21649 (emacs_no_realloc_allocator): New static constant.
21650 (emacs_readlink): New function.
21651 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21652 ../lib/careadlinkat.h.
21654 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21656 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21657 first non-nil return value).
21659 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21661 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21662 if not defined (Bug#8403).
21664 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21666 * xdisp.c (display_count_lines): Remove parameter `start',
21667 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21668 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21669 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21670 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21671 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21672 and thereabouts. All callers changed.
21673 (get_per_char_metric): Remove parameter `f', unused since
21674 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21676 2011-04-02 Jim Meyering <meyering@redhat.com>
21678 do not dereference NULL upon failed strdup
21679 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21680 (ns_get_family): Likewise.
21682 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21684 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21686 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21688 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21691 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21693 Add lexical binding.
21695 * window.c (Ftemp_output_buffer_show): New fun.
21696 (Fsave_window_excursion):
21697 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21699 * lread.c (lisp_file_lexically_bound_p): New function.
21700 (Fload): Bind Qlexical_binding.
21701 (readevalloop): Remove `evalfun' arg.
21702 Bind Qinternal_interpreter_environment.
21703 (Feval_buffer): Bind Qlexical_binding.
21704 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21706 (syms_of_lread): Declare `lexical-binding'.
21708 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21710 * keyboard.c (eval_dyn): New fun.
21711 (menu_item_eval_property): Use it.
21713 * image.c (parse_image_spec): Use Ffunctionp.
21715 * fns.c (concat, mapcar1): Accept byte-code-functions.
21717 * eval.c (Fsetq): Handle lexical vars.
21718 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21719 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21720 (FletX, Flet): Obey lexical binding.
21721 (Fcommandp): Handle closures.
21722 (Feval): New `lexical' arg.
21723 (eval_sub): New function extracted from Feval. Use it almost
21724 everywhere where Feval was used. Look up vars in lexical env.
21726 (Ffunctionp): Move from subr.el.
21727 (Ffuncall): Handle closures.
21728 (apply_lambda): Remove `eval_flags'.
21729 (funcall_lambda): Handle closures and new byte-code-functions.
21730 (Fspecial_variable_p): New function.
21731 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21732 but without exporting it to Lisp.
21734 * doc.c (Fdocumentation, store_function_docstring):
21735 * data.c (Finteractive_form): Handle closures.
21737 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21740 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21742 (exec_byte_code): New function extracted from Fbyte_code to handle new
21743 calling convention for byte-code-functions. Add new byte-codes.
21745 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
21747 * alloc.c (Fmake_symbol): Init new `declared_special' field.
21749 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21751 * xdisp.c (redisplay_internal): Fix prototype.
21753 2011-03-31 Eli Zaretskii <eliz@gnu.org>
21755 * xdisp.c (SCROLL_LIMIT): New macro.
21756 (try_scrolling): Use it when setting scroll_limit.
21757 Limit scrolling to 100 screen lines.
21758 (redisplay_window): Even when falling back on "recentering",
21759 position point in the window according to scroll-conservatively,
21760 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21762 (try_scrolling): When point is above the window, allow searching
21763 as far as scroll_max, or one screenful, to compute vertical
21764 distance from PT to the scroll margin position. This prevents
21765 try_scrolling from unnecessarily failing when
21766 scroll-conservatively is set to a value slightly larger than the
21767 window height. Clean up the case of PT below the margin at bottom
21768 of window: scroll_max can no longer be INT_MAX. When aggressive
21769 scrolling is in use, don't let point enter the opposite scroll
21770 margin as result of the scroll.
21771 (syms_of_xdisp) <scroll-conservatively>: Document the
21772 threshold of 100 lines for never-recentering scrolling.
21774 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21776 * dispextern.h (move_it_by_lines):
21777 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21778 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21779 (message_log_check_duplicate): Remove parameters `prev_bol' and
21780 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21781 (redisplay_internal): Remove parameter `preserve_echo_area',
21782 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21784 * indent.c (Fvertical_motion):
21785 * window.c (window_scroll_pixel_based, Frecenter):
21786 Don't pass `need_y_p' to `move_it_by_lines'.
21788 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21790 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21791 steal a few bits to be more compact.
21792 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21793 Remove unneeded casts.
21795 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21797 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21799 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21800 binding" message (bug#7967).
21802 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21804 Fix more problems found by GCC 4.6.0's static checks.
21806 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21807 Remove unused local var.
21809 * editfns.c (Fmessage_box): Remove unused local var.
21811 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21812 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21813 Omit unused local vars.
21814 * window.c (shrink_windows): Omit unused local var.
21815 * menu.c (digest_single_submenu): Omit unused local var.
21816 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21817 Omit unused local var.
21819 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21820 Don't assume string length fits in int.
21821 (keyremap_step, read_key_sequence): Use size_t for sizes.
21822 (read_key_sequence): Don't check last_real_key_start redundantly.
21824 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21825 instead of alloca (Bug#8344).
21827 * eval.c (Fbacktrace): Don't assume nargs fits in int.
21828 (Fbacktrace_frame): Don't assume nframes fits in int.
21830 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21832 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21835 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21837 * cm.c (calccost): Turn while-do into do-while, for clarity.
21839 * keyboard.c (syms_of_keyboard): Use the same style as later
21840 in this function when indexing through an array. This also
21841 works around GCC bug 48267.
21843 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21845 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21847 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21848 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21850 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21851 This avoids undefined behavior on integer overflow, and is a bit
21852 more convenient anyway since it is compared to a size_t variable.
21854 Variadic C functions now count arguments with size_t, not int.
21855 This avoids an unnecessary limitation on 64-bit machines, which
21856 caused (substring ...) to crash on large vectors (Bug#8344).
21857 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21858 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21859 All variadic functions and their callers changed accordingly.
21860 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21861 * data.c (arith_driver, float_arith_driver): Likewise.
21862 * editfns.c (general_insert_function): Likewise.
21863 * eval.c (struct backtrace.nargs, interactive_p)
21864 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21865 (funcall_lambda, mark_backtrace): Likewise.
21866 * fns.c (concat): Likewise.
21867 * frame.c (x_set_frame_parameters): Likewise.
21868 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21869 0 if not found, not -1. All callers changed.
21871 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21872 (stack_copy_size): Now size_t, not int.
21873 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21875 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21877 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21878 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21879 All callers changed.
21881 * lisp.h (multibyte_char_to_unibyte):
21882 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21883 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21884 * character.h (CHAR_TO_BYTE8):
21885 * cmds.c (internal_self_insert):
21886 * editfns.c (general_insert_function):
21887 * keymap.c (push_key_description):
21888 * search.c (Freplace_match):
21889 * xdisp.c (message_dolog, set_message_1): All callers changed.
21891 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21893 * keyboard.c (safe_run_hook_funcall): New function.
21894 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21895 don't set the hook to nil, but remove the offending function instead.
21896 (Qcommand_hook_internal): Remove, unused.
21897 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21898 Vcommand_hook_internal.
21900 * eval.c (enum run_hooks_condition): Remove.
21901 (funcall_nil, funcall_not): New functions.
21902 (run_hook_with_args): Call each function through a `funcall' argument.
21903 Remove `cond' argument, now redundant.
21904 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21905 (Frun_hook_with_args_until_failure): Adjust accordingly.
21906 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21908 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21910 * dispextern.h (string_buffer_position): Remove declaration.
21912 * print.c (strout): Remove parameter `multibyte', unused since
21913 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21915 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21916 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21917 All callers changed.
21919 * w32.c (_wsa_errlist): Use braces for struct initializers.
21921 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21922 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21923 All callers changed.
21924 (string_buffer_position): Likewise. Also, make static (it's never
21925 used outside xdisp.c).
21926 (cursor_row_p): Remove parameter `w', unused since
21927 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21928 (decode_mode_spec): Remove parameter `precision', introduced during
21929 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21930 All callers changed.
21932 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21934 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21936 2011-03-27 Anders Lindgren <andlind@gmail.com>
21938 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21939 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21940 (ns_update_auto_hide_menu_bar): New functions.
21941 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21942 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21943 ns_constrain_all_frames.
21944 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21945 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21947 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21949 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21951 2011-03-27 Glenn Morris <rgm@gnu.org>
21953 * syssignal.h: Replace RETSIGTYPE with void.
21954 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21955 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21956 Replace SIGTYPE with void everywhere.
21957 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21958 * s/template.h (SIGTYPE): Remove commented out definition.
21960 2011-03-26 Eli Zaretskii <eliz@gnu.org>
21962 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21963 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21965 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
21967 * w32.c (read_unc_volume): Use parameter `henum', instead of
21968 global variable `wget_enum_handle'.
21970 * keymap.c (describe_vector): Remove parameters `indices' and
21971 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21972 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21974 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21976 * keyboard.c (timer_check): Remove parameter `do_it_now',
21977 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21978 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21979 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21981 * keyboard.c (read_char):
21982 * w32menu.c (w32_menu_display_help):
21983 * xmenu.c (show_help_event, menu_help_callback):
21984 Adjust calls to `show_help_echo'.
21986 * gtkutil.c (xg_maybe_add_timer):
21987 * keyboard.c (readable_events):
21988 * process.c (wait_reading_process_output):
21989 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21991 * insdel.c (adjust_markers_gap_motion):
21992 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21993 (gap_left, gap_right): Don't call it.
21995 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
21997 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21998 incurred during fontification.
22000 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22002 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22003 (DEFVAR_PER_BUFFER): Don't pass it.
22005 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22006 (scrolling_window): Don't pass it.
22008 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22010 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22012 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22014 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22015 of variables specific to SELinux and computation of `encoded_absname'.
22017 * image.c (XPutPixel): Remove unused variable `height'.
22019 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22021 * unexw32.c (get_section_info): Remove unused variable `section'.
22023 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22024 (system_process_attributes): Remove unused variable `sess'.
22025 (sys_read): Remove unused variable `err'.
22027 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22028 (w32_wnd_proc): Remove unused variable `isdead'.
22029 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22030 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22031 (x_create_tip_frame): Remove unused variable `tem'.
22033 * w32inevt.c (w32_console_read_socket):
22034 Remove unused variable `no_events'.
22036 * w32term.c (x_draw_composite_glyph_string_foreground):
22037 Remove unused variable `width'.
22039 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22041 * w32term.c (x_set_glyph_string_clipping):
22042 Don't pass uninitialized region to CombineRgn.
22044 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22046 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22047 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22048 (Fx_close_connection): Remove unused variable `i'.
22050 * w32font.c (w32font_draw): Return number of glyphs.
22051 (w32font_open_internal): Remove unused variable `i'.
22052 (w32font_driver): Add missing initializer.
22054 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22055 (fill_in_menu): Remove unused variable `items_added'.
22057 * w32term.c (last_mouse_press_frame): Remove static global variable.
22058 (w32_clip_to_row): Remove unused variable `f'.
22059 (x_delete_terminal): Remove unused variable `i'.
22061 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22062 (NOTHING): Remove unused static global variable.
22063 (uniscribe_check_otf): Remove unused variable `table'.
22064 (uniscribe_font_driver): Add missing initializers.
22066 2011-03-23 Julien Danjou <julien@danjou.info>
22068 * term.c (Fsuspend_tty, Fresume_tty):
22069 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22070 * window.c (temp_output_buffer_show):
22071 * insdel.c (signal_before_change):
22072 * frame.c (Fhandle_switch_frame):
22073 * fileio.c (Fdo_auto_save):
22074 * emacs.c (Fkill_emacs):
22075 * editfns.c (save_excursion_restore):
22076 * cmds.c (internal_self_insert):
22077 * callint.c (Fcall_interactively):
22078 * buffer.c (Fkill_all_local_variables):
22079 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22081 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22082 unconditionally since it does the check itself.
22084 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22086 Fix more problems found by GCC 4.5.2's static checks.
22088 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22089 the first time through the loop, since we know p0 < p1 then.
22090 This also avoids a gcc -Wstrict-overflow warning.
22092 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22093 leading to a memory leak, possible in functions like
22094 load_charset_map_from_file that can allocate an unbounded number
22095 of objects (Bug#8318).
22097 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22098 that could (at least in theory) be that large.
22100 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22101 This is less likely to overflow, and avoids undefined behavior if
22102 overflow does occur. All callers changed. Use strtoul to scan
22103 for the unsigned long integer.
22104 (pint2hrstr): Simplify and tune code slightly.
22105 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22107 * scroll.c (do_scrolling): Work around GCC bug 48228.
22108 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22110 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22111 This also avoids a warning with gcc -Wstrict-overflow.
22112 (validate_x_resource_name): Simplify count usage.
22113 This also avoids a warning with gcc -Wstrict-overflow.
22115 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22118 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22120 * process.c (Fmake_network_process): Use socklen_t, not int,
22121 where POSIX says socklen_t is required in portable programs.
22122 This fixes a porting bug on hosts like 64-bit HP-UX, where
22123 socklen_t is wider than int (Bug#8277).
22124 (Fmake_network_process, server_accept_connection):
22125 (wait_reading_process_output, read_process_output):
22128 * process.c: Rename or move locals to avoid shadowing.
22129 (list_processes_1, Fmake_network_process):
22130 (read_process_output_error_handler, exec_sentinel_error_handler):
22131 Rename or move locals.
22132 (Fmake_network_process): Define label "retry_connect" only if needed.
22133 (Fnetwork_interface_info): Fix pointer signedness.
22134 (process_send_signal): Add cast to avoid pointer signedness problem.
22135 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22136 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22138 Make tparam.h and terminfo.c consistent.
22139 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22140 Include tparam.h instead, since it declares them.
22141 * cm.h (PC): Remove extern decl; tparam.h now does this.
22142 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22143 * terminfo.c: Include tparam.h, to check interfaces.
22144 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22145 (tparam): Adjust signature to match interface in tparam.h;
22146 this removes some undefined behavior. Check that outstring and len
22147 are zero, which they always are with Emacs.
22148 * tparam.h (PC, BC, UP): New extern decls.
22150 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22151 (xftfont_open): Rename locals to avoid shadowing.
22153 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22154 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22155 (OTF_TAG_SYM): Omit macro if not needed.
22156 (ftfont_list): Remove unused local.
22157 (get_adstyle_property, ftfont_pattern_entity):
22158 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22159 Rename locals to avoid shadowing.
22161 * xfont.c (xfont_list_family): Mark var as initialized.
22163 * xml.c (make_dom): Now static.
22165 * composite.c (composition_compute_stop_pos): Rename local to
22167 (composition_reseat_it): Remove unused locals.
22168 (find_automatic_composition, composition_adjust_point): Likewise.
22169 (composition_update_it): Mark var as initialized.
22170 (find_automatic_composition): Mark vars as initialized,
22171 with a FIXME (Bug#8290).
22173 character.h: Rename locals to avoid shadowing.
22174 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22175 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22176 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22177 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22178 to avoid shadowing.
22180 * textprop.c (property_change_between_p): Remove; unused.
22182 * intervals.c (interval_start_pos): Now static.
22184 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22186 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22187 Rename locals to avoid shadowing.
22189 * sound.c (wav_play, au_play, Fplay_sound_internal):
22190 Fix pointer signedness.
22191 (alsa_choose_format): Remove unused local var.
22192 (wav_play): Initialize a variable to 0, to prevent undefined
22193 behavior (Bug#8278).
22195 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22197 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22199 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22200 clobbering (Bug#8298).
22201 * sysdep.c (sys_subshell): Likewise.
22202 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22204 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22205 This should get cleaned up, so that child_setup has the
22206 same signature on all platforms.
22208 * callproc.c (call_process_cleanup): Now static.
22209 (relocate_fd): Rename locals to avoid shadowing.
22211 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
22213 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22214 not to be necessary, and produces flickering.
22216 2011-03-20 Glenn Morris <rgm@gnu.org>
22218 * config.in: Remove file.
22220 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
22222 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22223 are now in src/globals.h.
22224 (syms_of_minibuf): Remove spurious & from previous change.
22226 2011-03-20 Leo Liu <sdl.web@gmail.com>
22228 * minibuf.c (completing-read-function): New variable.
22229 (completing-read-default): Rename from completing-read.
22230 (completing-read): Call completing-read-function.
22232 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22234 * xfaces.c (Fx_load_color_file):
22235 Read color file from absolute filename (bug#8250).
22237 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22239 * makefile.w32-in: Update dependencies.
22241 2011-03-17 Eli Zaretskii <eliz@gnu.org>
22243 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22245 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22247 Fix more problems found by GCC 4.5.2's static checks.
22249 * process.c (make_serial_process_unwind, send_process_trap):
22250 (sigchld_handler): Now static.
22252 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22253 That way, the code declares only the vars that it needs.
22254 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22255 * s/cygwin.h (PTY_ITERATION): Likewise.
22256 * s/darwin.h (PTY_ITERATION): Likewise.
22257 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22259 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22260 * process.c (allocate_pty): Don't declare stb unless it's needed.
22262 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22263 (CONSTANTLIM): Remove; unused.
22264 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22265 Define only if needed.
22267 * unexelf.c (unexec): Name an expression,
22268 to avoid gcc -Wbad-function-cast warning.
22269 Use a different way to cause a compilation error if anyone uses
22270 n rather than nn, a way that does not involve shadowing.
22271 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22273 * deps.mk (unexalpha.o): Remove; unused.
22275 New file unexec.h, the (simple) interface for unexec (Bug#8267).
22276 * unexec.h: New file.
22277 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22278 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22279 Depend on unexec.h.
22280 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22281 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22282 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22283 Change as necessary to match prototype in unexec.h.
22285 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22287 (back_comment, skip_chars): Mark vars as initialized.
22289 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22290 Rename locals to avoid shadowing.
22292 * lread.c (read1): Rewrite so as not to use empty "else".
22293 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22295 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22297 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22298 warning when compiling print.c.
22300 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22301 instead of using an uninitialized var.
22302 (font_sort_entities): Mark var as initialized.
22304 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22306 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22307 pointers to constants.
22308 (font_parse_fcname): Remove unused vars.
22309 (font_delete_unmatched): Now static.
22310 (font_get_spec): Remove; unused.
22311 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22312 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22313 Rename or move locals to avoid shadowing.
22315 * fns.c (require_nesting_list, require_unwind): Now static.
22316 (Ffillarray): Rename locals to avoid shadowing.
22318 * floatfns.c (domain_error2): Define only if needed.
22319 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
22321 * alloc.c (mark_backtrace): Move decl from here ...
22322 * lisp.h: ... to here, so that it can be checked.
22324 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
22325 (Fdefvar): Rewrite so as not to use empty "else".
22326 (lisp_indirect_variable): Name an expression,
22327 to avoid gcc -Wbad-function-cast warning.
22328 (Fdefvar): Rename locals to avoid shadowing.
22330 * callint.c (quotify_arg, quotify_args): Now static.
22331 (Fcall_interactively): Rename locals to avoid shadowing.
22332 Use const pointer when appropriate.
22334 * lisp.h (get_system_name, get_operating_system_release):
22335 Move decls here, to check interfaces.
22336 * process.c (get_operating_system_release): Move decl to lisp.h.
22337 * xrdb.c (get_system_name): Likewise.
22338 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22339 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22340 some of which prompt warnings from gcc -Wbad-function-cast.
22341 (Fformat_time_string, Fencode_time, Finsert_char):
22342 (Ftranslate_region_internal, Fformat):
22343 Rename or remove local vars to avoid shadowing.
22344 (Ftranslate_region_internal): Mark var as initialized.
22346 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22349 * lisp.h (eassert): Check that the argument compiles, even if
22350 ENABLE_CHECKING is not defined.
22352 * data.c (Findirect_variable): Name an expression, to avoid
22353 gcc -Wbad-function-cast warning.
22354 (default_value, arithcompare, arith_driver, arith_error): Now static.
22355 (store_symval_forwarding): Rename local to avoid shadowing.
22356 (Fmake_variable_buffer_local, Fmake_local_variable):
22357 Mark variables as initialized.
22358 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
22360 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
22361 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22362 Rename locals to avoid shadowing.
22363 (mark_stack): Move local variables into the #ifdef region where
22365 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22366 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22368 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22369 (GC_STRING_CHARS): Remove; not used.
22370 (Fmemory_limit): Cast sbrk's returned value to char *.
22372 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22373 avoids undefined behavior in theory.
22375 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22377 Use functions, not macros, for up- and down-casing (Bug#8254).
22378 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22379 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22380 to use the following functions instead of these macros.
22381 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22382 EMACS_INT, since callers assume the returned value fits in int.
22383 (upcase1): Likewise, for UPCASE_TABLE.
22384 (uppercasep, lowercasep, upcase): New static inline functions.
22385 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22386 the race-condition problem in the old DOWNCASE.
22388 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22389 Rename locals to avoid shadowing.
22390 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22391 (regex_compile, re_search_2, re_match_2_internal):
22392 Remove unused local vars.
22393 (FREE_VAR): Rewrite so as not to use empty "else",
22394 which gcc can warn about.
22395 (regex_compile, re_match_2_internal): Mark locals as initialized.
22396 (RETALLOC_IF): Define only if needed.
22397 (WORDCHAR_P): Likewise. This one is never needed, but is used
22398 only in a comment talking about a compiler bug, so put inside
22399 the #if 0 of that comment.
22400 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22401 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22404 * search.c (boyer_moore): Rename locals to avoid shadowing.
22405 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22406 (PREV_CHAR_BOUNDARY): Likewise.
22408 * search.c (simple_search): Remove unused var.
22410 * dired.c (compile_pattern): Move decl from here ...
22411 * lisp.h: ... to here, so that it can be checked.
22412 (struct re_registers): New forward decl.
22414 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22416 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22418 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22419 Rename locals to avoid shadowing.
22420 (Fvertical_motion): Mark locals as initialized.
22422 * casefiddle.c (casify_object, casify_region): Now static.
22423 (casify_region): Mark local as initialized.
22425 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22427 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22428 New macros, so that the caller can use some names other than
22429 gcpro1, gcpro2, etc.
22430 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22432 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22433 argument, for consistency with GCPRO2_VAR, etc: it is now the
22434 prefix of the variable, not the variable itself. All uses
22436 * dired.c (directory_files_internal, file_name_completion):
22437 Rename locals to avoid shadowing.
22439 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22440 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22441 dired.c's scmp function, had undefined behavior.
22442 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22443 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22444 * buffer.h: ... to here, because these macros use current_buffer,
22445 and the new implementation with inline functions needs to have
22446 current_buffer in scope now, rather than later when the macros
22448 (downcase, upcase1): New static inline functions.
22449 (DOWNCASE, UPCASE1): Reimplement using these functions.
22450 This avoids undefined behavior in expressions like
22451 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22452 from race conditions in accessing the global variables
22453 case_temp1 and case_temp2.
22454 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22455 * lisp.h (case_temp1, case_temp2): Remove their decls.
22456 * character.h (ASCII_CHAR_P): Move from here ...
22457 * lisp.h: ... to here, so that the inline functions mentioned
22458 above can use them.
22460 * dired.c (directory_files_internal_unwind): Now static.
22462 * fileio.c (file_name_as_directory, directory_file_name):
22463 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22465 (file_name_as_directory): Use const pointers when appropriate.
22466 (Fexpand_file_name): Likewise. In particular, newdir might
22467 point at constant storage, so make it a const pointer.
22468 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22469 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22471 (Fset_file_times, Finsert_file_contents, auto_save_error):
22472 Rename locals to avoid shadowing.
22474 * minibuf.c (choose_minibuf_frame_1): Now static.
22475 (Ftry_completion, Fall_completions): Rename or remove locals
22476 to avoid shadowing.
22478 * marker.c (bytepos_to_charpos): Remove; unused.
22480 * lisp.h (verify_bytepos, count_markers): New decls,
22481 so that gcc does not warn that these functions aren't declared.
22483 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22484 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22485 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22486 (copy_text): Remove unused local var.
22488 * filelock.c (within_one_second): Now static.
22489 (lock_file_1): Rename local to avoid shadowing.
22491 * buffer.c (fix_overlays_before): Mark locals as initialized.
22492 (fix_start_end_in_overlays): Likewise. This function should be
22493 simplified by using pointers-to-pointers, but that's a different
22495 (switch_to_buffer_1): Now static.
22496 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22497 (report_overlay_modification): Rename locals to avoid shadowing.
22499 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22500 Fix pointer signedness issue.
22501 (sys_subshell): Mark local as volatile if checking for lint,
22502 to suppress a gcc -Wclobbered warning that does not seem to be right.
22503 (MAXPATHLEN): Define only if needed.
22505 * process.c (serial_open, serial_configure): Move decls from here ...
22506 * systty.h: ... to here, so that they can be checked.
22508 * fns.c (get_random, seed_random): Move extern decls from here ...
22509 * lisp.h: ... to here, so that they can be checked.
22511 * sysdep.c (reset_io): Now static.
22512 (wait_for_termination_signal): Remove; unused.
22514 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22515 (copy_keymap_item, append_key, push_text_char_description):
22517 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22518 (DENSE_TABLE_SIZE): Remove; unused.
22519 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22520 (describe_map_tree):
22521 Rename locals to avoid shadowing.
22523 * keyboard.c: Declare functions static if they are not used elsewhere.
22524 (echo_char, echo_dash, cmd_error, top_level_2):
22525 (poll_for_input, handle_async_input): Now static.
22526 (read_char, kbd_buffer_get_event, make_lispy_position):
22527 (make_lispy_event, make_lispy_movement, apply_modifiers):
22528 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22529 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22530 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22531 (read_key_sequence, read_char): Mark locals as initialized.
22532 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22534 * keyboard.h (make_ctrl_char): New decl.
22535 (mark_kboards): Move decl here ...
22536 * alloc.c (mark_kboards): ... from here.
22538 * lisp.h (force_auto_save_soon): New decl.
22540 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22541 (DEFINE_DUMMY_FUNCTION): New macro.
22542 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22544 (main): Add casts to avoid warnings
22545 if GCC considers string literals to be constants.
22547 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22549 * dbusbind.c: Pointer signedness fixes.
22550 (xd_signature, xd_append_arg, xd_initialize):
22551 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22552 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22553 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22554 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22556 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22557 if GCC considers string literals to be constants.
22558 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22560 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22562 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22563 (print_preprocess, print_object): New macro to fix last change.
22565 * print.c (print_preprocess): Don't forget font objects.
22567 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
22569 * emacs.c (USAGE3): Doc fixes.
22571 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22573 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22576 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
22578 * lisp.h (VWindow_system, Qfile_name_history):
22579 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22580 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22581 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22583 * w32select.c: Don't #include "keyboard.h".
22584 (run_protected): Add extern declaration for waiting_for_input.
22586 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22587 * w32console.c (detect_input_pending, read_input_pending)
22588 (encode_terminal_code):
22589 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22590 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22591 (w32_system_caret_y, Qfile_name_history):
22592 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22593 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22594 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22595 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22596 * w32proc.c (Qlocal, report_file_error):
22597 * w32term.c (Vwindow_system, updating_frame):
22598 * w32uniscribe.c (initialized, uniscribe_font_driver):
22599 Remove unneeded extern declarations.
22601 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
22603 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
22605 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
22607 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22608 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22609 These macros can no longer be used for assignment.
22611 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22612 Assign struct members directly, instead of using BUF_BEGV etc.
22613 (record_buffer_markers, fetch_buffer_markers): New functions for
22614 recording and fetching special buffer markers.
22615 (set_buffer_internal_1, set_buffer_temp): Use them.
22617 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22619 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22621 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22622 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22624 * xdisp.c (hscroll_window_tree):
22625 (reconsider_clip_changes): Use PT instead of BUF_PT.
22627 2011-03-13 Eli Zaretskii <eliz@gnu.org>
22629 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22630 $(EMACS_ROOT)/lib/intprops.h.
22632 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22634 Fix more problems found by GCC 4.5.2's static checks.
22636 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22637 to unsigned char * to avoid compiler diagnostic.
22638 (xg_free_frame_widgets): Make it clear that a local variable is
22639 needed only if USE_GTK_TOOLTIP.
22640 (gdk_window_get_screen): Make it clear that this macro is needed
22641 only if USE_GTK_TOOLTIP.
22642 (int_gtk_range_get_value): New function, which avoids a diagnostic
22643 from gcc -Wbad-function-cast.
22644 (xg_set_toolkit_scroll_bar_thumb): Use it.
22645 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22646 diagnostic from gcc -Wbad-function-cast.
22647 (get_utf8_string, xg_get_file_with_chooser):
22648 Rename locals to avoid shadowing.
22649 (create_dialog): Move locals to avoid shadowing.
22651 * xgselect.c (xg_select): Remove unused var.
22653 * image.c (four_corners_best): Mark locals as initialized.
22654 (gif_load): Initialize transparent_p to zero (Bug#8238).
22655 Mark another local as initialized.
22656 (my_png_error, my_error_exit): Mark with NO_RETURN.
22658 * image.c (clear_image_cache): Now static.
22659 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
22660 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
22661 (x_edge_detection): Remove unnecessary cast that
22662 gcc -Wbad-function-cast diagnoses.
22663 (gif_load): Fix pointer signedness.
22664 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22665 (jpeg_load, gif_load): Rename locals to avoid shadowing.
22667 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
22669 Improve quality of tests for time stamp overflow.
22670 For example, without this patch (encode-time 0 0 0 1 1
22671 1152921504606846976) returns the obviously-bogus value (-948597
22672 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22673 reports time overflow. See
22674 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
22675 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22676 * editfns.c: Include limits.h and intprops.h.
22677 (TIME_T_MIN, TIME_T_MAX): New macros.
22678 (time_overflow): Move earlier, to before first use.
22679 (hi_time, lo_time): New functions, for an accurate test for
22680 out-of-range times.
22681 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22682 (Fget_internal_run_time): Don't assume time_t fits in int.
22683 (make_time): Use list2 instead of Fcons twice.
22684 (Fdecode_time): More accurate test for out-of-range times.
22685 (check_tm_member): New function.
22686 (Fencode_time): Use it, to test for out-of-range times.
22687 (lisp_time_argument): Don't rely on undefined left-shift and
22688 right-shift behavior when checking for time stamp overflow.
22690 * editfns.c (time_overflow): New function, refactoring common code.
22691 (Fformat_time_string, Fdecode_time, Fencode_time):
22692 (Fcurrent_time_string): Use it.
22694 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22695 * dired.c (make_time): Move to ...
22696 * editfns.c (make_time): ... here.
22697 * systime.h: Note the move.
22699 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
22701 * fringe.c (update_window_fringes): Remove unused variables.
22703 * unexmacosx.c (copy_data_segment): Also copy __got section.
22706 2011-03-12 Eli Zaretskii <eliz@gnu.org>
22708 * termcap.c [MSDOS]: Include "msdos.h".
22709 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22710 Constify `char *' arguments and their references according to
22711 prototypes in tparam.h.
22713 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
22715 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22716 Adapt all references accordingly.
22718 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22720 2011-03-11 Tom Tromey <tromey@redhat.com>
22722 * buffer.c (syms_of_buffer): Remove obsolete comment.
22724 2011-03-11 Eli Zaretskii <eliz@gnu.org>
22726 * termhooks.h (encode_terminal_code): Declare prototype.
22728 * msdos.c (encode_terminal_code): Don't declare prototype.
22730 * term.c (encode_terminal_code): Now external again, used by
22731 w32console.c and msdos.c.
22733 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22734 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
22736 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
22738 Fix some minor problems found by GCC 4.5.2's static checks.
22740 * fringe.c (update_window_fringes): Mark locals as initialized
22742 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
22744 * alloc.c (mark_fringe_data): Move decl from here ...
22745 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22746 to check its interface.
22747 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22749 * fontset.c (free_realized_fontset): Now static.
22750 (Fset_fontset_font): Rename local to avoid shadowing.
22751 (fontset_font): Mark local as initialized.
22752 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
22754 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22756 * xselect.c (x_disown_buffer_selections): Remove; not used.
22757 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
22758 (x_own_selection, Fx_disown_selection_internal): Rename locals
22759 to avoid shadowing.
22760 (x_handle_dnd_message): Remove local to avoid shadowing.
22762 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22763 so that the caller can use some name other than gcpro1.
22764 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
22765 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22766 (Fx_backspace_delete_keys_p):
22767 Use them to avoid shadowing, and rename vars to avoid shadowing.
22768 (x_decode_color, x_set_name, x_window): Now static.
22769 (Fx_create_frame): Add braces to silence GCC warning.
22770 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
22771 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22772 Remove unused locals.
22773 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22774 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22775 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22778 * xterm.h (x_mouse_leave): New decl.
22780 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22781 Remove unused functions.
22782 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22783 (x_calc_absolute_position): Now static.
22784 (XTread_socket): Don't define label "out" unless it's used.
22785 Don't declare local "event" unless it's used.
22786 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22787 unless they are used.
22788 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22789 (x_fatal_error_signal): Remove; not used.
22790 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22791 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22792 (x_error_catcher, x_connection_closed, x_error_handler):
22793 (x_error_quitter, xembed_send_message, x_iconify_frame):
22794 (my_log_handler): Rename locals to avoid shadowing.
22795 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
22796 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
22798 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22799 Rename or move locals to avoid shadowing.
22800 (tty_defined_color, merge_face_heights): Now static.
22801 (free_realized_faces_for_fontset): Remove; not used.
22802 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22803 does not deduce is never used uninitialized.
22804 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22805 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
22807 * terminal.c (store_terminal_param): Now static.
22809 * xmenu.c (menu_highlight_callback): Now static.
22810 (set_frame_menubar): Remove unused local.
22811 (xmenu_show): Rename parameter to avoid shadowing.
22812 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22813 since they might point to immutable storage.
22814 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22815 since it's unused otherwise.
22817 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
22818 Add a FIXME, since the code still doesn't look right. (Bug#8215)
22819 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22820 avoids a gcc -Wuninitialized diagnostic.
22821 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
22822 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22823 does not deduce are never used uninitialized.
22825 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22827 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
22828 * window.c (window_loop, size_window):
22829 (run_window_configuration_change_hook, enlarge_window): Likewise.
22831 * window.c (display_buffer): Now static.
22832 (size_window): Mark variables that gcc -Wuninitialized
22833 does not deduce are never used uninitialized.
22834 * window.h (check_all_windows): New decl, to forestall
22835 gcc -Wmissing-prototypes diagnostic.
22836 * dispextern.h (bidi_dump_cached_states): Likewise.
22838 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22840 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
22841 Include <limits.h>.
22842 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22843 and to avoid gcc -Wuninitialized warning.
22844 (load_charset_map): Mark variables that gcc -Wuninitialized
22845 does not deduce are never used uninitialized.
22846 (load_charset): Abort instead of using uninitialized var (Bug#8229).
22848 * coding.c (coding_set_source, coding_set_destination):
22849 Use "else { /* comment */ }" rather than "else /* comment */;"
22850 for clarity, and to avoid gcc -Wempty-body warning.
22851 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22852 a block, when the outer 'i' will do.
22853 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22854 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22855 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22856 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22857 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22858 Rename locals to avoid shadowing.
22859 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22860 * coding.c (emacs_mule_char, encode_invocation_designation):
22861 Now static, since they're not used elsewhere.
22862 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22863 (decode_coding_object, encode_coding_object, detect_coding_system):
22864 (decode_coding_emacs_mule): Mark variables that gcc
22865 -Wuninitialized does not deduce are never used uninitialized.
22866 (detect_coding_iso_2022): Initialize a local variable that might
22867 be used uninitialized. Leave a FIXME because it's not clear that
22868 this initialization is needed. (Bug#8211)
22869 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22870 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22871 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22872 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22873 Remove unused macros.
22875 * category.c (hash_get_category_set): Remove unused local var.
22876 (copy_category_table): Now static, since it's not used elsewhere.
22877 * character.c (string_count_byte8): Likewise.
22879 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22880 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22882 * chartab.c (copy_sub_char_table): Now static, since it's not used
22884 (sub_char_table_ref_and_range, char_table_ref_and_range):
22885 Rename locals to avoid shadowing.
22886 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22888 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22889 (BIDI_BOB): Remove unused macro.
22891 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22892 deduce are never used uninitialized.
22893 * term.c (encode_terminal_code): Likewise.
22895 * term.c (encode_terminal_code): Now static. Remove unused local.
22897 * tparam.h: New file.
22898 * term.c, tparam.h: Include it.
22899 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22900 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22901 Move these decls to tparam.h, and make them agree with what
22902 is actually in tparam.c. The previous trick of using incompatible
22903 decls in different modules does not conform to the C standard.
22904 All callers of tparam changed to use tparam's actual API.
22905 * tparam.c (tparam1, tparam, tgoto):
22906 Use const pointers where appropriate.
22908 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22909 * cm.h (struct cm): Likewise.
22910 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22911 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22912 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22913 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22914 (turn_on_face, init_tty): Likewise.
22915 * termchar.h (struct tty_display_info): Likewise.
22917 * term.c (term_mouse_position): Rename local to avoid shadowing.
22919 * alloc.c (mark_ttys): Move decl from here ...
22920 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22922 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22924 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22926 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
22928 * search.c (compile_pattern_1): Remove argument regp, unused since
22929 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22930 (compile_pattern): Don't pass it.
22932 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22934 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22935 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22937 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22939 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22941 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22942 gdk_window_get_screen, gdk_window_get_geometry,
22943 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22944 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22945 (xg_get_pixbuf_from_pixmap): New function.
22946 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22947 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22948 Call xg_get_pixbuf_from_pixmap instead of
22949 gdk_pixbuf_get_from_drawable.
22950 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22951 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22952 (xg_check_special_colors): Use GtkStyleContext and its functions
22954 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22955 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22956 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
22957 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22958 Call gtk_widget_get_preferred_size.
22959 (xg_frame_resized): gdk_window_get_geometry only takes 5
22961 (xg_win_to_widget, xg_event_is_for_menubar):
22962 Call gdk_x11_window_lookup_for_display.
22963 (xg_set_widget_bg): New function.
22964 (delete_cb): New function.
22965 (xg_create_frame_widgets): Connect delete-event to delete_cb.
22966 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
22967 (xg_set_background_color): Call xg_set_widget_bg.
22968 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22969 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22970 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22971 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22973 (update_frame_tool_bar): Call gtk_widget_hide.
22974 (xg_initialize): Use GDK_KEY_g.
22976 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22978 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22980 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22981 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22982 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22984 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
22986 * w32xfns.c (select_palette): Check success of RealizePalette against
22987 GDI_ERROR, not zero.
22989 See ChangeLog.11 for earlier changes.
22991 ;; Local Variables:
22995 Copyright (C) 2011-2013 Free Software Foundation, Inc.
22997 This file is part of GNU Emacs.
22999 GNU Emacs is free software: you can redistribute it and/or modify
23000 it under the terms of the GNU General Public License as published by
23001 the Free Software Foundation, either version 3 of the License, or
23002 (at your option) any later version.
23004 GNU Emacs is distributed in the hope that it will be useful,
23005 but WITHOUT ANY WARRANTY; without even the implied warranty of
23006 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23007 GNU General Public License for more details.
23009 You should have received a copy of the GNU General Public License
23010 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.