diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-01-30 18:06:22 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-01-30 18:06:22 +0000 |
commit | e31331e5cb40d3e56e4160229b33f2dad9d5e4ab (patch) | |
tree | 29d504a565260e6ba5d2972ec742a25574b7357a /src | |
parent | 9688ff534500a278871366f699cd0ead3524b68a (diff) | |
parent | 75e49434a5b90f797fe9b0250d426793793fb8e7 (diff) | |
download | emacs-e31331e5cb40d3e56e4160229b33f2dad9d5e4ab.tar.gz |
Merged from miles@gnu.org--gnu-2005 (patch 187, 704)
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--base-0
tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-704
* emacs@sv.gnu.org/emacs--devo--0--patch-1
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-2
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-3
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-4
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-5
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-6
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-7
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-8
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-9
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-10
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-11
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-12
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-13
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-14
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-15
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-16
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-17
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-18
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-19
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-20
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-21
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-22
Install ERC.
* emacs@sv.gnu.org/emacs--devo--0--patch-23
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-24
Fix ERC compiler warnings.
* emacs@sv.gnu.org/emacs--devo--0--patch-25
Use utf-8 encoding in ERC ChangeLogs.
* emacs@sv.gnu.org/emacs--devo--0--patch-26
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-27
Merge ERC-related Viper hacks into Viper.
* emacs@sv.gnu.org/emacs--devo--0--patch-28
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-29
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-30
Merge from erc--main--0
* emacs@sv.gnu.org/gnus--rel--5.10--base-0
tag of miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-187
* emacs@sv.gnu.org/gnus--rel--5.10--patch-1
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-2
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-3
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-4
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-5
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-6
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-7
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-704
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-187
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-501
Diffstat (limited to 'src')
-rw-r--r-- | src/.gdbinit | 27 | ||||
-rw-r--r-- | src/ChangeLog | 192 | ||||
-rw-r--r-- | src/alloc.c | 96 | ||||
-rw-r--r-- | src/callproc.c | 22 | ||||
-rw-r--r-- | src/cmds.c | 23 | ||||
-rw-r--r-- | src/data.c | 10 | ||||
-rw-r--r-- | src/dired.c | 13 | ||||
-rw-r--r-- | src/editfns.c | 60 | ||||
-rw-r--r-- | src/frame.c | 17 | ||||
-rw-r--r-- | src/keyboard.c | 16 | ||||
-rw-r--r-- | src/keymap.c | 6 | ||||
-rw-r--r-- | src/lread.c | 8 | ||||
-rw-r--r-- | src/minibuf.c | 3 | ||||
-rw-r--r-- | src/regex.c | 9 | ||||
-rw-r--r-- | src/s/irix6-5.h | 4 | ||||
-rw-r--r-- | src/w32.c | 18 | ||||
-rw-r--r-- | src/xdisp.c | 45 | ||||
-rw-r--r-- | src/xfns.c | 8 | ||||
-rw-r--r-- | src/xterm.c | 102 |
19 files changed, 519 insertions, 160 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 1b8d17607ff..0d1f51e5d54 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -766,18 +766,21 @@ show environment TERM # People get bothered when they see messages about non-existent functions... xgetptr Vsystem_type -set $tem = (struct Lisp_Symbol *) $ptr -xgetptr $tem->xname -set $tem = (struct Lisp_String *) $ptr -set $tem = (char *) $tem->data - -# Don't let abort actually run, as it will make stdio stop working and -# therefore the `pr' command above as well. -if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd' - # The windows-nt build replaces abort with its own function. - break w32_abort -else - break abort +# $ptr is NULL in temacs +if ($ptr != 0) + set $tem = (struct Lisp_Symbol *) $ptr + xgetptr $tem->xname + set $tem = (struct Lisp_String *) $ptr + set $tem = (char *) $tem->data + + # Don't let abort actually run, as it will make stdio stop working and + # therefore the `pr' command above as well. + if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd' + # The windows-nt build replaces abort with its own function. + break w32_abort + else + break abort + end end # x_error_quitter is defined only on X. But window-system is set up diff --git a/src/ChangeLog b/src/ChangeLog index b9bb573b326..4a48e9ac452 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,143 @@ +2006-01-28 Luc Teirlinck <teirllm@auburn.edu> + + * data.c (Fcar, Fcdr): Add links to Elisp manual to the docstrings. + +2006-01-27 Chong Yidong <cyd@stupidchicken.com> + + * alloc.c (make_interval, allocate_string) + (allocate_string_data, make_float, Fcons, allocate_vectorlike) + (Fmake_symbol, allocate_misc): Use BLOCK_INPUT when accessing + global variables. + +2006-01-27 Eli Zaretskii <eliz@gnu.org> + + * dired.c (DIRENTRY_NONEMPTY) [__CYGWIN__]: Don't use d_ino; use + the MSDOS definition. + +2006-01-26 Richard M. Stallman <rms@gnu.org> + + * alloc.c (check_pure_size): Make overflow message an "error message". + + * keymap.c (Fmap_keymap): Doc fix. + + * xfns.c (Fx_create_frame): Put all specified parms into f->param_alist + unless they were cleared out. + + * frame.c (x_get_arg): "Clear out" the parm in ALIST if found there. + +2006-01-26 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * editfns.c (Fconstrain_to_field): Fix behaviour on field boundaries. + (find_field): Set before_field to after_field when pos is at BEGV. + (Fline_beginning_position, Fline_end_position): Clarify + confusing doc string. + + * cmds.c (Fbeginning_of_line, Fend_of_line): Clarify confusing doc + string. + +2006-01-26 Kenichi Handa <handa@m17n.org> + + * callproc.c (Fcall_process): GCPRO error_file. Encode infile, + current_dir, and error_file. On reporting an error, decode them + back. + +2006-01-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * regex.c (IMMEDIATE_QUIT_CHECK): Use it with SYNC_INPUT as well. + (re_match_2_internal) <on_failure_jump, on_failure_jump_smart>: + Don't check for quit, since any loop will go through fail or jump. + +2006-01-24 Chong Yidong <cyd@stupidchicken.com> + + * alloc.c (allocate_string_data): Update next_free immediately, to + reduce risk of memory clobberage. + +2006-01-24 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * xdisp.c (handle_invisible_prop): Set it->position to fix cursor + display when point moves across an ellipsis. If there are + adjacent invisible texts, don't lose the second one's ellipsis. + (x_produce_glyphs): Doc fix. + +2006-01-23 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c (x_catch_errors_unwind): Yet another int/Lisp_Object mixup. + +2006-01-23 Kim F. Storm <storm@cua.dk> + + * xdisp.c (handle_single_display_spec): Fix handling of space + property on char from string: set *position rather than + it->current.pos. + (produce_stretch_glyph): Reduce width of stretch glyphs so they + don't get wider than the window (unless truncate-lines is on). + +2006-01-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c: Avoid allocating Lisp data from a signal handler. + (x_error_message): New var to replace x_error_message_string. + (x_error_catcher, x_catch_errors, x_catch_errors_unwind) + (x_check_errors, x_had_errors_p, x_clear_errors, x_error_handler) + (syms_of_xterm): Use it instead of x_error_message_string. + + * alloc.c (lisp_align_free): Add an assertion. + (make_interval, allocate_string, make_float, Fcons, Fmake_symbol) + (allocate_misc): If ENABLE_CHECKING is on, check we're not called from + a signal handler. + +2006-01-21 Luc Teirlinck <teirllm@auburn.edu> + + * dired.c (syms_of_dired) <completion-ignored-extensions>: Doc fix. + +2006-01-21 Romain Francoise <romain@orebokech.com> + + * xdisp.c (get_window_cursor_type): Fix last change. + Update copyright year. + +2006-01-20 Eli Zaretskii <eliz@gnu.org> + + * lread.c (Fload): Don't leak the file descriptor returned by + openp if we are going to signal an error. + + * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it + directly to _close. + (sys_dup): Protect against new_fd larger than fd_info[] can handle. + (sys_read): If FD is outside [0..MAXDESC) limits, pass it directly + to _read. + (sys_write): If FD is outside [0..MAXDESC) limits, pass it + directly to _write. + + * .gdbinit: Don't dereference Vsystem_type's Lisp_Symbol pointer + if it is NULL. + +2006-01-20 Kenichi Handa <handa@m17n.org> + + * puresize.h (BASE_PURESIZE): Increment to 1190000. + +2006-01-19 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (get_window_cursor_type): Use cursor type specified by + the selected buffer for the echo area too. + +2006-01-19 Richard M. Stallman <rms@gnu.org> + + * keymap.c (Fmap_keymap): Doc fix. + + * s/irix6-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): New definitions. + + * keyboard.c (echo_char): Don't omit the space between first two + echoed chars. + + * minibuf.c (read_minibuf): Fix previous change. + +2006-01-19 Kenichi Handa <handa@m17n.org> + + * xterm.c (handle_one_xevent): Handle keysyms 0x1000000..0x10000FF. + +2006-01-17 Richard M. Stallman <rms@gnu.org> + + * frame.c (x_frame_get_and_record_arg): Don't record Qunbound + value in f->param_alist. + 2006-01-15 Andreas Schwab <schwab@suse.de> * search.c (Freplace_match): Use UPPERCASEP instead of !NOCASEP. @@ -562,7 +702,7 @@ * w32fns.c (w32_abort) [__GNUC__]: Add instructions for attaching GDB to the abort dialog. -2005-12-09 Kyotaro HORIGUCHI <horiguti@meadowy.org> (tiny change) +2005-12-09 Kyotaro HORIGUCHI <horiguti@meadowy.org> (tiny change) * indent.c (Fvertical_motion): Force move if starting on stretch glyph. @@ -816,7 +956,7 @@ * s/darwin.h (LIBS_CARBON) [!HAVE_CARBON]: Remove `-framework Carbon'. -2005-11-11 David Reitter <david.reitter@gmail.com> +2005-11-11 David Reitter <david.reitter@gmail.com> * macterm.c (syms_of_macterm): Remove macCtrlKey, macShiftKey, macMetaKey, macAltKey. Introduce Qctrl, Qmeta, @@ -848,7 +988,7 @@ ignore_overlay_strings_at_pos_p if dpvec came from an overlay string, so we skip those overlay strings at current pos. -2005-11-10 Lars Hansen <larsh@soem.dk> +2005-11-10 Lars Hansen <larsh@soem.dk> * fileio.c (file-regular-p): Doc fix. @@ -959,7 +1099,7 @@ * xdisp.c (display_line): Restore it->current_x and call extend_face_to_end_of_line when last glyph doesn't fit on line. - (set_glyph_string_background_width): Remove specific tests here + (set_glyph_string_background_width): Remove specific tests here to see if face background should extend to end of line. Simplify. 2005-10-30 Richard M. Stallman <rms@gnu.org> @@ -1561,7 +1701,7 @@ * dispextern.h (fatal): Delete prototype. - * systime.h: (make_time): Prototype moved from ... + * systime.h (make_time): Prototype moved from ... * editfns.c (make_time): ... here. * editfns.c: Move systime.h include after lisp.h. @@ -1795,9 +1935,9 @@ get_current_dir_name. (get_current_dir_name): Remove prototype. - * xsmfns.c: (get_current_dir_name): Remove prototype. + * xsmfns.c (get_current_dir_name): Remove prototype. - * lisp.h: (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: + * lisp.h (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: Add prototype. * sysdep.c [WINDOWSNT]: Add prototype for getwd. @@ -2488,7 +2628,7 @@ * window.c (window_scroll_pixel_based, window_scroll_line_based): Handle `scroll-preserve-screen-position' non-nil, non-t specially. - (syms_of_window): <scroll-preserve-screen-position>: Doc fix. + (syms_of_window) <scroll-preserve-screen-position>: Doc fix. 2005-07-02 Juri Linkov <juri@jurta.org> @@ -7116,7 +7256,7 @@ * config.in: Rebuild. - * Makefile.in: Run setarch i386 ./temacs if exec-shield is present. + * Makefile.in: Run setarch i386 ./temacs if exec-shield is present. 2004-09-18 Stefan Monnier <monnier@iro.umontreal.ca> @@ -7696,7 +7836,7 @@ * buffer.c (Fswitch_to_buffer, Fpop_to_buffer): Doc fixes. - * window.c (Fwindow_buffer, Fother_window, Fget_lru_window) + * window.c (Fwindow_buffer, Fother_window, Fget_lru_window) (Fget_largest_window, Fget_buffer_window, Fdelete_windows_on) (Freplace_buffer_in_windows, Fset_window_buffer) (Fselect-window, Fdisplay-buffer, Fsplit_window): Doc fixes. @@ -9349,7 +9489,7 @@ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) (make_image, free_image, prepare_image_for_display, image_ascent) (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) + (x_clear_image_1, x_clear_image, x_alloc_image_color) (make_image_cache, free_image_cache, clear_image_cache) (Fclear_image_cache, postprocess_image, lookup_image, cache_image) (forall_images_in_image_cache, x_create_x_image_and_pixmap) @@ -9387,7 +9527,7 @@ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) (make_image, free_image, prepare_image_for_display, image_ascent) (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) + (x_clear_image_1, x_clear_image, x_alloc_image_color) (make_image_cache, free_image_cache, clear_image_cache) (Fclear_image_cache, postprocess_image, lookup_image, cache_image) (forall_images_in_image_cache, x_create_x_image_and_pixmap) @@ -9419,7 +9559,7 @@ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) (make_image, free_image, prepare_image_for_display, image_ascent) (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) + (x_clear_image_1, x_clear_image, x_alloc_image_color) (make_image_cache, free_image_cache, clear_image_cache) (Fclear_image_cache, postprocess_image, lookup_image, cache_image) (forall_images_in_image_cache, x_create_x_image_and_pixmap) @@ -9449,7 +9589,7 @@ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) (make_image, free_image, prepare_image_for_display, image_ascent) (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) + (x_clear_image_1, x_clear_image, x_alloc_image_color) (make_image_cache, free_image_cache, clear_image_cache) (Fclear_image_cache, postprocess_image, lookup_image, cache_image) (forall_images_in_image_cache, x_create_x_image_and_pixmap) @@ -10224,7 +10364,7 @@ (Fx_change_window_property): Add declaration of parameters type and format. Remove unused variable cons. - * xselect.c: Include stdio,h. + * xselect.c: Include stdio.h. 2004-02-05 Kenichi Handa <handa@m17n.org> @@ -11857,7 +11997,7 @@ 2003-07-13 Terje Rosten <terjeros@phys.ntnu.no> - * xterm.c (x_bitmap_icon,x_wm_set_icon_pixmap): Modify to add mask, + * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap): Modify to add mask, and use the Gtk+ function gtk_window_icon_from_file if available. * xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to @@ -16436,7 +16576,7 @@ 2002-09-08 Kim F. Storm <storm@cua.dk> * macros.c (executing_macro_index): Change type to EMACS_INT. - (syms_of_macros): DEFVAR_INT it (needed by kmacro). + (syms_of_macros): DEFVAR_INT it (needed by kmacro). * macros.h (executing_macro_index): Change type to EMACS_INT. @@ -18924,10 +19064,10 @@ Intern and staticpro QCtype and Qdatagram. (syms_of_process) [!subprocess]: Intern and staticpro QCtype. - * xfns.c: (QCtype): Remove duplicate declaration and + * xfns.c (QCtype): Remove duplicate declaration and initialization (is now declared in process.c). - * w32fns.c: (QCtype): Remove duplicate declaration and + * w32fns.c (QCtype): Remove duplicate declaration and initialization (is now declared in process.c). 2002-03-21 Richard M. Stallman <rms@gnu.org> @@ -19042,7 +19182,7 @@ Doc fix: Member kill_without_query is inverse of query-on-exit flag. * process.c (Qlocal, QCname, QCbuffer, QChost, QCservice, QCfamily) - (QClocal, QCremote, QCserver, QCdatagram, QCnowait, QCnoquery,QCstop) + (QClocal, QCremote, QCserver, QCdatagram, QCnowait, QCnoquery, QCstop) (QCcoding, QCoptions, QCfilter, QCsentinel, QClog, QCfeature): New variables. (NETCONN1_P): New macro. @@ -19372,7 +19512,7 @@ 2002-02-28 Kim F. Storm <storm@cua.dk> - * window.c: (minibuf_selected_window): Renamed from + * window.c (minibuf_selected_window): Renamed from Vminibuf_selected_window. Users changed. (syms_of_window): Staticpro it. @@ -19382,14 +19522,14 @@ which is similar to Vminibuf_scroll_window, but which is only set on entry to the minibuffer (from a non-minibuffer window): - * window.c: (Vminibuf_selected_window): New variable. + * window.c (Vminibuf_selected_window): New variable. (struct save_window_data): New member minibuf_selected_window. (Fset_window_configuration): Restore Vminibuf_selected_window. (Fcurrent_window_configuration): Save Vminibuf_selected_window. Set minibuf_scroll_window member to nil if minibuf_level is 0. (compare_window_configurations): Compare minibuf_selected_window. - * window.h: (Vminibuf_selected_window): Declare extern. + * window.h (Vminibuf_selected_window): Declare extern. * minibuf.c (read_minibuf): Set Vminibuf_selected_window on first entry to minibuffer or on entry from a non-minibuffer window. @@ -19515,7 +19655,7 @@ 2002-02-22 Eli Zaretskii <eliz@is.elta.co.il> - Support for ICCCM Extended Segments in X selections: + Support for ICCCM Extended Segments in X selections: * xselect.c <Qcompound_text_no_extensions>: New variable. (syms_of_xselect): Intern and staticpro it. @@ -19669,7 +19809,7 @@ 2002-02-13 Kim F. Storm <storm@cua.dk> - * window.c: (Vmode_line_in_non_selected_windows): Removed. + * window.c (Vmode_line_in_non_selected_windows): Removed. (mode_line_in_non_selected_windows): New variable. (syms_of_window): DEFVAR_BOOL it. @@ -19700,7 +19840,7 @@ 2002-02-11 Kim F. Storm <storm@cua.dk> - * window.c: (Vmode_line_in_non_selected_windows): New variable. + * window.c (Vmode_line_in_non_selected_windows): New variable. (syms_of_window): DEFVAR_LISP it. * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): New macro. diff --git a/src/alloc.c b/src/alloc.c index cf86c80deaf..be03f4ebf7c 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,6 +1,6 @@ /* Storage allocation and gc for GNU Emacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1107,6 +1107,9 @@ lisp_align_free (block) } eassert ((aligned & 1) == aligned); eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1)); +#ifdef HAVE_POSIX_MEMALIGN + eassert ((unsigned long)ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0); +#endif free (ABLOCKS_BASE (abase)); } UNBLOCK_INPUT; @@ -1421,6 +1424,12 @@ make_interval () { INTERVAL val; + /* eassert (!handling_signal); */ + +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif + if (interval_free_list) { val = interval_free_list; @@ -1442,6 +1451,11 @@ make_interval () } val = &interval_block->intervals[interval_block_index++]; } + +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + consing_since_gc += sizeof (struct interval); intervals_consed++; RESET_INTERVAL (val); @@ -1839,6 +1853,12 @@ allocate_string () { struct Lisp_String *s; + /* eassert (!handling_signal); */ + +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif + /* If the free-list is empty, allocate a new string_block, and add all the Lisp_Strings in it to the free-list. */ if (string_free_list == NULL) @@ -1868,6 +1888,10 @@ allocate_string () s = string_free_list; string_free_list = NEXT_FREE_LISP_STRING (s); +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + /* Probably not strictly necessary, but play it safe. */ bzero (s, sizeof *s); @@ -1915,6 +1939,12 @@ allocate_string_data (s, nchars, nbytes) /* Determine the number of bytes needed to store NBYTES bytes of string data. */ needed = SDATA_SIZE (nbytes); + old_data = s->data ? SDATA_OF_STRING (s) : NULL; + old_nbytes = GC_STRING_BYTES (s); + +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif if (nbytes > LARGE_STRING_BYTES) { @@ -1969,10 +1999,13 @@ allocate_string_data (s, nchars, nbytes) else b = current_sblock; - old_data = s->data ? SDATA_OF_STRING (s) : NULL; - old_nbytes = GC_STRING_BYTES (s); - data = b->next_free; + b->next_free = (struct sdata *) ((char *) data + needed + GC_STRING_EXTRA); + +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + data->string = s; s->data = SDATA_DATA (data); #ifdef GC_CHECK_STRING_BYTES @@ -1985,7 +2018,6 @@ allocate_string_data (s, nchars, nbytes) bcopy (string_overrun_cookie, (char *) data + needed, GC_STRING_OVERRUN_COOKIE_SIZE); #endif - b->next_free = (struct sdata *) ((char *) data + needed + GC_STRING_EXTRA); /* If S had already data assigned, mark that as free by setting its string back-pointer to null, and recording the size of the data @@ -2554,6 +2586,12 @@ make_float (float_value) { register Lisp_Object val; + /* eassert (!handling_signal); */ + +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif + if (float_free_list) { /* We use the data field for chaining the free list @@ -2579,6 +2617,10 @@ make_float (float_value) float_block_index++; } +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + XFLOAT_DATA (val) = float_value; eassert (!FLOAT_MARKED_P (XFLOAT (val))); consing_since_gc += sizeof (struct Lisp_Float); @@ -2673,6 +2715,12 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, { register Lisp_Object val; + /* eassert (!handling_signal); */ + +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif + if (cons_free_list) { /* We use the cdr for chaining the free list @@ -2697,6 +2745,10 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, cons_block_index++; } +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + XSETCAR (val, car); XSETCDR (val, cdr); eassert (!CONS_MARKED_P (XCONS (val))); @@ -2854,6 +2906,9 @@ allocate_vectorlike (len, type) UNBLOCK_INPUT; #endif + /* This gets triggered by code which I haven't bothered to fix. --Stef */ + /* eassert (!handling_signal); */ + nbytes = sizeof *p + (len - 1) * sizeof p->contents[0]; p = (struct Lisp_Vector *) lisp_malloc (nbytes, type); @@ -2867,8 +2922,17 @@ allocate_vectorlike (len, type) consing_since_gc += nbytes; vector_cells_consed += len; +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif + p->next = all_vectors; all_vectors = p; + +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + ++n_vectors; return p; } @@ -3147,6 +3211,12 @@ Its value and function definition are void, and its property list is nil. */) CHECK_STRING (name); + eassert (!handling_signal); + +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif + if (symbol_free_list) { XSETSYMBOL (val, symbol_free_list); @@ -3168,6 +3238,10 @@ Its value and function definition are void, and its property list is nil. */) symbol_block_index++; } +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + p = XSYMBOL (val); p->xname = name; p->plist = Qnil; @@ -3227,6 +3301,12 @@ allocate_misc () { Lisp_Object val; + /* eassert (!handling_signal); */ + +#ifndef SYNC_INPUT + BLOCK_INPUT; +#endif + if (marker_free_list) { XSETMISC (val, marker_free_list); @@ -3249,6 +3329,10 @@ allocate_misc () marker_block_index++; } +#ifndef SYNC_INPUT + UNBLOCK_INPUT; +#endif + --total_free_markers; consing_since_gc += sizeof (union Lisp_Misc); misc_objects_consed++; @@ -4642,7 +4726,7 @@ void check_pure_size () { if (pure_bytes_used_before_overflow) - message ("Pure Lisp storage overflow (approx. %d bytes needed)", + message ("emacs:0:Pure Lisp storage overflow (approx. %d bytes needed)", (int) (pure_bytes_used + pure_bytes_used_before_overflow)); } diff --git a/src/callproc.c b/src/callproc.c index eebbabb2739..71071217208 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -362,11 +362,11 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) protected by the caller, so all we really have to worry about is buffer. */ { - struct gcpro gcpro1, gcpro2, gcpro3; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; current_dir = current_buffer->directory; - GCPRO3 (infile, buffer, current_dir); + GCPRO4 (infile, buffer, current_dir, error_file); current_dir = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir), @@ -375,6 +375,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) report_file_error ("Setting current directory", Fcons (current_buffer->directory, Qnil)); + if (STRING_MULTIBYTE (infile)) + infile = ENCODE_FILE (infile); + if (STRING_MULTIBYTE (current_dir)) + current_dir = ENCODE_FILE (current_dir); + if (STRINGP (error_file) && STRING_MULTIBYTE (error_file)) + error_file = ENCODE_FILE (error_file); UNGCPRO; } @@ -383,6 +389,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) filefd = emacs_open (SDATA (infile), O_RDONLY, 0); if (filefd < 0) { + infile = DECODE_FILE (infile); report_file_error ("Opening process input file", Fcons (infile, Qnil)); } /* Search for program; barf if not found. */ @@ -540,14 +547,13 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) #ifdef MSDOS unlink (tempfile); #endif - report_file_error ("Cannot redirect stderr", - Fcons ((NILP (error_file) - ? build_string (NULL_DEVICE) : error_file), - Qnil)); + if (NILP (error_file)) + error_file = build_string (NULL_DEVICE); + else if (STRINGP (error_file)) + error_file = DECODE_FILE (error_file); + report_file_error ("Cannot redirect stderr", Fcons (error_file, Qnil)); } - current_dir = ENCODE_FILE (current_dir); - #ifdef MAC_OS8 { /* Call run_mac_command in sysdep.c here directly instead of doing diff --git a/src/cmds.c b/src/cmds.c index cc5bd90cca7..8f7e3bf02df 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -157,13 +157,13 @@ DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, 0, 1, "p", With argument N not nil or 1, move forward N - 1 lines first. If point reaches the beginning or end of buffer, it stops there. -This command does not move point across a field boundary unless doing so -would move beyond there to a different line; If N is nil or 1, and point -starts at a field boundary, point does not move. To ignore field -boundaries, either bind `inhibit-field-text-motion' to t, or use the -`forward-line' function instead. For instance, `(forward-line 0)' does -the same thing as `(beginning-of-line)', except that it ignores field -boundaries. */) +This function constrains point to the current field unless this moves +point to a different line than the original, unconstrained result. If +N is nil or 1, and a front-sticky field starts at point, the point +does not move. To ignore field boundaries bind +`inhibit-field-text-motion' to t, or use the `forward-line' function +instead. For instance, `(forward-line 0)' does the same thing as +`(beginning-of-line)', except that it ignores field boundaries. */) (n) Lisp_Object n; { @@ -183,10 +183,11 @@ With argument N not nil or 1, move forward N - 1 lines first. If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t. -This command does not move point across a field boundary unless doing so -would move beyond there to a different line; if N is nil or 1, and -point starts at a field boundary, point does not move. To ignore field -boundaries bind `inhibit-field-text-motion' to t. */) +This function constrains point to the current field unless this moves +point to a different line than the original, unconstrained result. If +N is nil or 1, and a rear-sticky field ends at point, the point does +not move. To ignore field boundaries bind `inhibit-field-text-motion' +to t. */) (n) Lisp_Object n; { diff --git a/src/data.c b/src/data.c index 0b2036395da..c70e3219eac 100644 --- a/src/data.c +++ b/src/data.c @@ -522,7 +522,10 @@ DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0, DEFUN ("car", Fcar, Scar, 1, 1, 0, doc: /* Return the car of LIST. If arg is nil, return nil. -Error if arg is not nil and not a cons cell. See also `car-safe'. */) +Error if arg is not nil and not a cons cell. See also `car-safe'. + +See Info node `(elisp)Cons Cells' for a discussion of related basic +Lisp concepts such as car, cdr, cons cell and list. */) (list) register Lisp_Object list; { @@ -550,7 +553,10 @@ DEFUN ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0, DEFUN ("cdr", Fcdr, Scdr, 1, 1, 0, doc: /* Return the cdr of LIST. If arg is nil, return nil. -Error if arg is not nil and not a cons cell. See also `cdr-safe'. */) +Error if arg is not nil and not a cons cell. See also `cdr-safe'. + +See Info node `(elisp)Cons Cells' for a discussion of related basic +Lisp concepts such as cdr, car, cons cell and list. */) (list) register Lisp_Object list; { diff --git a/src/dired.c b/src/dired.c index 1f20ef8d10a..474683c3c87 100644 --- a/src/dired.c +++ b/src/dired.c @@ -85,7 +85,8 @@ extern struct direct *readdir (); #endif /* not MSDOS */ #endif /* not SYSV_SYSTEM_DIR */ -#ifdef MSDOS +/* Some versions of Cygwin don't have d_ino in `struct dirent'. */ +#if defined(MSDOS) || defined(__CYGWIN__) #define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0) #else #define DIRENTRY_NONEMPTY(p) ((p)->d_ino) @@ -1036,11 +1037,11 @@ syms_of_dired () #endif /* VMS */ DEFVAR_LISP ("completion-ignored-extensions", &Vcompletion_ignored_extensions, - doc: /* *Completion ignores filenames ending in any string in this list. -Directories are ignored if they match any string in this list which -ends in a slash. -This variable does not affect lists of possible completions, -but does affect the commands that actually do completions. */); + doc: /* Completion ignores file names ending in any string in this list. +It does not ignore them if all possible completions end in one of +these strings or when displaying a list of completions. +It ignores directory names if they match any string in this list which +ends in a slash. */); Vcompletion_ignored_extensions = Qnil; } diff --git a/src/editfns.c b/src/editfns.c index 5605a25bdd2..9be9232a9c7 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -526,7 +526,9 @@ find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end) = (XFASTINT (pos) > BEGV ? get_char_property_and_overlay (make_number (XINT (pos) - 1), Qfield, Qnil, NULL) - : Qnil); + /* Using nil here would be a more obvious choice, but it would + fail when the buffer starts with a non-sticky field. */ + : after_field); /* See if we need to handle the case where MERGE_AT_BOUNDARY is nil and POS is at beginning of a field, which can also be interpreted @@ -717,7 +719,8 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) { /* If non-zero, then the original point, before re-positioning. */ int orig_point = 0; - + int fwd, prev_old, prev_new; + if (NILP (new_pos)) /* Use the current point, and afterwards, set it. */ { @@ -725,23 +728,40 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) XSETFASTINT (new_pos, PT); } + CHECK_NUMBER_COERCE_MARKER (new_pos); + CHECK_NUMBER_COERCE_MARKER (old_pos); + + fwd = (XFASTINT (new_pos) > XFASTINT (old_pos)); + + prev_old = make_number (XFASTINT (old_pos) - 1); + prev_new = make_number (XFASTINT (new_pos) - 1); + if (NILP (Vinhibit_field_text_motion) && !EQ (new_pos, old_pos) - && (!NILP (Fget_char_property (new_pos, Qfield, Qnil)) - || !NILP (Fget_char_property (old_pos, Qfield, Qnil))) + && (!NILP (Fget_text_property (new_pos, Qfield, Qnil)) + || !NILP (Fget_text_property (old_pos, Qfield, Qnil)) + /* To recognize field boundaries, we must also look at the + previous positions; we could use `get_pos_property' + instead, but in itself that would fail inside non-sticky + fields (like comint prompts). */ + || (XFASTINT (new_pos) > BEGV + && !NILP (Fget_text_property (prev_new, Qfield, Qnil))) + || (XFASTINT (old_pos) > BEGV + && !NILP (Fget_text_property (prev_old, Qfield, Qnil)))) && (NILP (inhibit_capture_property) - || NILP (Fget_char_property(old_pos, inhibit_capture_property, Qnil)))) - /* NEW_POS is not within the same field as OLD_POS; try to - move NEW_POS so that it is. */ + /* Field boundaries are again a problem; but now we must + decide the case exactly, so we need to call + `get_pos_property' as well. */ + || (NILP (get_pos_property (old_pos, inhibit_capture_property, Qnil)) + && (XFASTINT (old_pos) <= BEGV + || NILP (Fget_text_property (old_pos, inhibit_capture_property, Qnil)) + || NILP (Fget_text_property (prev_old, inhibit_capture_property, Qnil)))))) + /* It is possible that NEW_POS is not within the same field as + OLD_POS; try to move NEW_POS so that it is. */ { - int fwd, shortage; + int shortage; Lisp_Object field_bound; - CHECK_NUMBER_COERCE_MARKER (new_pos); - CHECK_NUMBER_COERCE_MARKER (old_pos); - - fwd = (XFASTINT (new_pos) > XFASTINT (old_pos)); - if (fwd) field_bound = Ffield_end (old_pos, escape_from_edge, new_pos); else @@ -782,9 +802,10 @@ DEFUN ("line-beginning-position", With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. -The scan does not cross a field boundary unless doing so would move -beyond there to a different line; if N is nil or 1, and scan starts at a -field boundary, the scan stops as soon as it starts. To ignore field +This function constrains the returned position to the current field +unless that would be on a different line than the original, +unconstrained result. If N is nil or 1, and a front-sticky field +starts at point, the scan stops as soon as it starts. To ignore field boundaries bind `inhibit-field-text-motion' to t. This function does not move point. */) @@ -816,9 +837,10 @@ DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. -The scan does not cross a field boundary unless doing so would move -beyond there to a different line; if N is nil or 1, and scan starts at a -field boundary, the scan stops as soon as it starts. To ignore field +This function constrains the returned position to the current field +unless that would be on a different line than the original, +unconstrained result. If N is nil or 1, and a rear-sticky field ends +at point, the scan stops as soon as it starts. To ignore field boundaries bind `inhibit-field-text-motion' to t. This function does not move point. */) diff --git a/src/frame.c b/src/frame.c index 6b848ea2fef..c9061423193 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3819,8 +3819,21 @@ x_get_arg (dpyinfo, alist, param, attribute, class, type) register Lisp_Object tem; tem = Fassq (param, alist); - if (EQ (tem, Qnil)) + + if (!NILP (tem)) + { + /* If we find this parm in ALIST, clear it out + so that it won't be "left over" at the end. */ +#ifdef HAVE_X_WINDOWS /* macfns.c and w32fns.c have not yet + been changed to cope with this. */ + XSETCAR (tem, Qnil); +#endif + } + else tem = Fassq (param, Vdefault_frame_alist); + + /* If it wasn't specified in ALIST or the Lisp-level defaults, + look in the X resources. */ if (EQ (tem, Qnil)) { if (attribute) @@ -3904,7 +3917,7 @@ x_frame_get_and_record_arg (f, alist, param, attribute, class, type) value = x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, param, attribute, class, type); - if (! NILP (value)) + if (! NILP (value) && ! EQ (value, Qunbound)) store_frame_param (f, param, value); return value; diff --git a/src/keyboard.c b/src/keyboard.c index cbf0987048a..dc509ad5717 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -777,6 +777,8 @@ echo_char (c) else echo_string = concat2 (echo_string, build_string (" ")); } + else if (STRINGP (echo_string)) + echo_string = concat2 (echo_string, build_string (" ")); current_kboard->echo_string = concat2 (echo_string, make_string (buffer, ptr - buffer)); @@ -807,16 +809,16 @@ echo_dash () /* Do nothing if we have already put a dash at the end. */ if (SCHARS (current_kboard->echo_string) > 1) { - Lisp_Object last_char, prev_char, idx; + Lisp_Object last_char, prev_char, idx; - idx = make_number (SCHARS (current_kboard->echo_string) - 2); - prev_char = Faref (current_kboard->echo_string, idx); + idx = make_number (SCHARS (current_kboard->echo_string) - 2); + prev_char = Faref (current_kboard->echo_string, idx); - idx = make_number (SCHARS (current_kboard->echo_string) - 1); - last_char = Faref (current_kboard->echo_string, idx); + idx = make_number (SCHARS (current_kboard->echo_string) - 1); + last_char = Faref (current_kboard->echo_string, idx); - if (XINT (last_char) == '-' && XINT (prev_char) != ' ') - return; + if (XINT (last_char) == '-' && XINT (prev_char) != ' ') + return; } /* Put a dash at the end of the buffer temporarily, diff --git a/src/keymap.c b/src/keymap.c index b09358dbbcb..fa64e88d6e5 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -736,8 +736,10 @@ map_keymap_call (key, val, fun, dummy) } DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 3, 0, - doc: /* Call FUNCTION for every binding in KEYMAP. -FUNCTION is called with two arguments: the event and its binding. + doc: /* Call FUNCTION once for each event binding in KEYMAP. +FUNCTION is called with two arguments: the event that is bound, and +the definition it is bound to. + If KEYMAP has a parent, the parent's bindings are included as well. This works recursively: if the parent has itself a parent, then the grandparent's bindings are also included and so on. diff --git a/src/lread.c b/src/lread.c index 345af109050..590ff65bbce 100644 --- a/src/lread.c +++ b/src/lread.c @@ -803,8 +803,12 @@ Return t if file exists. */) if (!NILP (Fequal (found, XCAR (tem)))) count++; if (count > 3) - Fsignal (Qerror, Fcons (build_string ("Recursive load"), - Fcons (found, Vloads_in_progress))); + { + if (fd >= 0) + emacs_close (fd); + Fsignal (Qerror, Fcons (build_string ("Recursive load"), + Fcons (found, Vloads_in_progress))); + } record_unwind_protect (record_load_unwind, Vloads_in_progress); Vloads_in_progress = Fcons (found, Vloads_in_progress); } diff --git a/src/minibuf.c b/src/minibuf.c index b327f2d040a..b9bbaf5b186 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -655,7 +655,8 @@ read_minibuf (map, initial, prompt, backup_n, expflag, Lisp_Object root_window = Fframe_root_window (frame); Lisp_Object mini_window = XWINDOW (root_window)->next; - if (! NILP (mini_window) && !NILP (Fwindow_minibuffer_p (mini_window))) + if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) + && !NILP (Fwindow_minibuffer_p (mini_window))) Fset_window_buffer (mini_window, empty_minibuf, Qnil); } diff --git a/src/regex.c b/src/regex.c index 4f2683adfb9..60231826380 100644 --- a/src/regex.c +++ b/src/regex.c @@ -3,7 +3,7 @@ internationalization features.) Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1874,8 +1874,9 @@ typedef struct /* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) -/* Explicit quit checking is only used on NTemacs. */ -#if defined WINDOWSNT && defined emacs && defined QUIT +/* Explicit quit checking is only used on NTemacs and whenever we + use polling to process input events. */ +#if defined emacs && (defined WINDOWSNT || defined SYNC_INPUT) && defined QUIT extern int immediate_quit; # define IMMEDIATE_QUIT_CHECK \ do { \ @@ -5636,7 +5637,6 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) the repetition text and either the following jump or pop_failure_jump back to this on_failure_jump. */ case on_failure_jump: - IMMEDIATE_QUIT_CHECK; EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT3 ("EXECUTING on_failure_jump %d (to %p):\n", mcnt, p + mcnt); @@ -5652,7 +5652,6 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) then we can use a non-backtracking loop based on on_failure_keep_string_jump instead of on_failure_jump. */ case on_failure_jump_smart: - IMMEDIATE_QUIT_CHECK; EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT3 ("EXECUTING on_failure_jump_smart %d (to %p).\n", mcnt, p + mcnt); diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h index c1cc42a8c0e..9df3e0a2ef6 100644 --- a/src/s/irix6-5.h +++ b/src/s/irix6-5.h @@ -33,5 +33,9 @@ #undef TIOCSIGSEND /* defined in usg5-4.h */ +/* Tested on Irix 6.5. SCM worked on earlier versions. */ +#define GC_SETJMP_WORKS 1 +#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS + /* arch-tag: d7ad9ec2-54ad-4b2f-adf2-0070c5c63e83 (do not change this comment) */ diff --git a/src/w32.c b/src/w32.c index 9a51233527d..9860a6cc353 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3426,13 +3426,13 @@ sys_close (int fd) { int rc; - if (fd < 0 || fd >= MAXDESC) + if (fd < 0) { errno = EBADF; return -1; } - if (fd_info[fd].cp) + if (fd < MAXDESC && fd_info[fd].cp) { child_process * cp = fd_info[fd].cp; @@ -3474,7 +3474,7 @@ sys_close (int fd) because socket handles are fully fledged kernel handles. */ rc = _close (fd); - if (rc == 0) + if (rc == 0 && fd < MAXDESC) fd_info[fd].flags = 0; return rc; @@ -3486,7 +3486,7 @@ sys_dup (int fd) int new_fd; new_fd = _dup (fd); - if (new_fd >= 0) + if (new_fd >= 0 && new_fd < MAXDESC) { /* duplicate our internal info as well */ fd_info[new_fd] = fd_info[fd]; @@ -3641,13 +3641,13 @@ sys_read (int fd, char * buffer, unsigned int count) DWORD waiting; char * orig_buffer = buffer; - if (fd < 0 || fd >= MAXDESC) + if (fd < 0) { errno = EBADF; return -1; } - if (fd_info[fd].flags & (FILE_PIPE | FILE_SOCKET)) + if (fd < MAXDESC && fd_info[fd].flags & (FILE_PIPE | FILE_SOCKET)) { child_process *cp = fd_info[fd].cp; @@ -3785,13 +3785,13 @@ sys_write (int fd, const void * buffer, unsigned int count) { int nchars; - if (fd < 0 || fd >= MAXDESC) + if (fd < 0) { errno = EBADF; return -1; } - if (fd_info[fd].flags & (FILE_PIPE | FILE_SOCKET)) + if (fd < MAXDESC && fd_info[fd].flags & (FILE_PIPE | FILE_SOCKET)) { if ((fd_info[fd].flags & FILE_WRITE) == 0) { @@ -3833,7 +3833,7 @@ sys_write (int fd, const void * buffer, unsigned int count) } #ifdef HAVE_SOCKETS - if (fd_info[fd].flags & FILE_SOCKET) + if (fd < MAXDESC && fd_info[fd].flags & FILE_SOCKET) { unsigned long nblock = 0; if (winsock_lib == NULL) abort (); diff --git a/src/xdisp.c b/src/xdisp.c index ca6c8f793a2..70dc9bd4515 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1,7 +1,7 @@ /* Display generation from window structure and buffer text. Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -3605,6 +3605,11 @@ handle_invisible_prop (it) skip starting with next_stop. */ if (invis_p) IT_CHARPOS (*it) = next_stop; + + /* If there are adjacent invisible texts, don't lose the + second one's ellipsis. */ + if (invis_p == 2) + display_ellipsis_p = 1; } while (invis_p); @@ -3625,7 +3630,23 @@ handle_invisible_prop (it) it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p; } else if (display_ellipsis_p) - setup_for_ellipsis (it, 0); + { + /* Make sure that the glyphs of the ellipsis will get + correct `charpos' values. If we would not update + it->position here, the glyphs would belong to the + last visible character _before_ the invisible + text, which confuses `set_cursor_from_row'. + + We use the last invisible position instead of the + first because this way the cursor is always drawn on + the first "." of the ellipsis, whenever PT is inside + the invisible text. Otherwise the cursor would be + placed _after_ the ellipsis when the point is after the + first invisible character. */ + it->position.charpos = IT_CHARPOS (*it) - 1; + it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); + setup_for_ellipsis (it, 0); + } } } @@ -4138,8 +4159,7 @@ handle_single_display_spec (it, spec, object, position, { it->method = GET_FROM_STRETCH; it->object = value; - it->current.pos = it->position = start_pos; - + *position = it->position = start_pos; } #ifdef HAVE_WINDOW_SYSTEM else @@ -19690,6 +19710,10 @@ produce_stretch_glyph (it) else ascent = (height * FONT_BASE (font)) / FONT_HEIGHT (font); + if (width > 0 && !it->truncate_lines_p + && it->current_x + width > it->last_visible_x) + width = it->last_visible_x - it->current_x - 1; + if (width > 0 && height > 0 && it->glyph_row) { Lisp_Object object = it->stack[it->sp - 1].string; @@ -19830,8 +19854,8 @@ calc_line_height_property (it, val, font, boff, override) /* RIF: Produce glyphs/get display metrics for the display element IT is - loaded with. See the description of struct display_iterator in - dispextern.h for an overview of struct display_iterator. */ + loaded with. See the description of struct it in dispextern.h + for an overview of struct it. */ void x_produce_glyphs (it) @@ -20791,8 +20815,13 @@ get_window_cursor_type (w, glyph, width, active_cursor) { if (w == XWINDOW (echo_area_window)) { - *width = FRAME_CURSOR_WIDTH (f); - return FRAME_DESIRED_CURSOR (f); + if (EQ (b->cursor_type, Qt) || NILP (b->cursor_type)) + { + *width = FRAME_CURSOR_WIDTH (f); + return FRAME_DESIRED_CURSOR (f); + } + else + return get_specified_cursor_type (b->cursor_type, width); } *active_cursor = 0; diff --git a/src/xfns.c b/src/xfns.c index 8da2e27687d..e478bde7984 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3021,6 +3021,8 @@ This function is an internal primitive--use `make-frame' instead. */) Lisp_Object parent; struct kboard *kb; + parms = Fcopy_alist (parms); + /* Use this general default value to start with until we know if this frame has a specified name. */ Vx_resource_name = Vinvocation_name; @@ -3401,6 +3403,12 @@ This function is an internal primitive--use `make-frame' instead. */) || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) kb->Vdefault_minibuffer_frame = frame; + /* All remaining specified parameters, which have not been "used" + by x_get_arg and friends, now go in the misc. alist of the frame. */ + for (tem = parms; !NILP (tem); tem = XCDR (tem)) + if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) + f->param_alist = Fcons (XCAR (tem), f->param_alist); + UNGCPRO; /* Make sure windows on this frame appear in calls to next-window diff --git a/src/xterm.c b/src/xterm.c index b784b560fc4..a71ffd75e70 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1,6 +1,6 @@ /* X Communication module for terminals which understand the X protocol. Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -6255,23 +6255,40 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) } /* Keysyms directly mapped to supported Unicode characters. */ - if ((keysym >= 0x01000100 && keysym <= 0x010033ff) + if ((keysym >= 0x01000000 && keysym <= 0x010033ff) || (keysym >= 0x0100e000 && keysym <= 0x0100ffff)) { - int code, charset_id, c1, c2; - - if (keysym < 0x01002500) - charset_id = charset_mule_unicode_0100_24ff, - code = (keysym & 0xFFFF) - 0x100; - else if (keysym < 0x0100e000) - charset_id = charset_mule_unicode_2500_33ff, - code = (keysym & 0xFFFF) - 0x2500; + int code = keysym & 0xFFFF, charset_id, c1, c2; + + if (code < 0x80) + { + inev.ie.kind = ASCII_KEYSTROKE_EVENT; + inev.ie.code = code; + } + else if (code < 0x100) + { + if (code < 0xA0) + charset_id = CHARSET_8_BIT_CONTROL; + else + charset_id = charset_latin_iso8859_1; + inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT; + inev.ie.code = MAKE_CHAR (charset_id, code, 0); + } else - charset_id = charset_mule_unicode_e000_ffff, - code = (keysym & 0xFFFF) - 0xe000; - c1 = (code / 96) + 32, c2 = (code % 96) + 32; - inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT; - inev.ie.code = MAKE_CHAR (charset_id, c1, c2); + { + if (code < 0x2500) + charset_id = charset_mule_unicode_0100_24ff, + code -= 0x100; + else if (code < 0xE000) + charset_id = charset_mule_unicode_2500_33ff, + code -= 0x2500; + else + charset_id = charset_mule_unicode_e000_ffff, + code -= 0xE000; + c1 = (code / 96) + 32, c2 = (code % 96) + 32; + inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT; + inev.ie.code = MAKE_CHAR (charset_id, c1, c2); + } goto done_keysym; } @@ -7455,7 +7472,12 @@ x_text_icon (f, icon_name) /* If non-nil, this should be a string. It means catch X errors and store the error message in this string. */ -static Lisp_Object x_error_message_string; +struct x_error_message_stack { + char string[X_ERROR_MESSAGE_SIZE]; + Display *dpy; + struct x_error_message_stack *prev; +}; +static struct x_error_message_stack *x_error_message; /* An X error handler which stores the error message in x_error_message_string. This is called from x_error_handler if @@ -7467,7 +7489,7 @@ x_error_catcher (display, error) XErrorEvent *error; { XGetErrorText (display, error->error_code, - SDATA (x_error_message_string), + x_error_message->string, X_ERROR_MESSAGE_SIZE); } @@ -7492,16 +7514,23 @@ x_catch_errors (dpy) Display *dpy; { int count = SPECPDL_INDEX (); + struct x_error_message_stack *data = malloc (sizeof (*data)); + Lisp_Object dummy; +#ifdef ENABLE_CHECKING + dummy = make_number ((EMACS_INT)dpy + (EMACS_INT)x_error_message); +#else + dummy = Qnil; +#endif /* Make sure any errors from previous requests have been dealt with. */ XSync (dpy, False); - record_unwind_protect (x_catch_errors_unwind, - Fcons (make_save_value (dpy, 0), - x_error_message_string)); + data->dpy = dpy; + data->string[0] = 0; + data->prev = x_error_message; + x_error_message = data; - x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE); - SSET (x_error_message_string, 0, 0); + record_unwind_protect (x_catch_errors_unwind, dummy); return count; } @@ -7509,11 +7538,11 @@ x_catch_errors (dpy) /* Unbind the binding that we made to check for X errors. */ static Lisp_Object -x_catch_errors_unwind (old_val) - Lisp_Object old_val; +x_catch_errors_unwind (dummy) + Lisp_Object dummy; { - Lisp_Object first = XCAR (old_val); - Display *dpy = XSAVE_VALUE (first)->pointer; + Display *dpy = x_error_message->dpy; + struct x_error_message_stack *tmp; /* The display may have been closed before this function is called. Check if it is still open before calling XSync. */ @@ -7524,7 +7553,13 @@ x_catch_errors_unwind (old_val) UNBLOCK_INPUT; } - x_error_message_string = XCDR (old_val); + tmp = x_error_message; + x_error_message = x_error_message->prev; + free (tmp); + + eassert (EQ (dummy, + make_number ((EMACS_INT)dpy + (EMACS_INT)x_error_message))); + return Qnil; } @@ -7540,8 +7575,8 @@ x_check_errors (dpy, format) /* Make sure to catch any errors incurred so far. */ XSync (dpy, False); - if (SREF (x_error_message_string, 0)) - error (format, SDATA (x_error_message_string)); + if (x_error_message->string[0]) + error (format, x_error_message->string); } /* Nonzero if we had any X protocol errors @@ -7554,7 +7589,7 @@ x_had_errors_p (dpy) /* Make sure to catch any errors incurred so far. */ XSync (dpy, False); - return SREF (x_error_message_string, 0) != 0; + return x_error_message->string[0] != 0; } /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ @@ -7563,7 +7598,7 @@ void x_clear_errors (dpy) Display *dpy; { - SSET (x_error_message_string, 0, 0); + x_error_message->string[0] = 0; } /* Stop catching X protocol errors and let them make Emacs die. @@ -7765,7 +7800,7 @@ x_error_handler (display, error) Display *display; XErrorEvent *error; { - if (! NILP (x_error_message_string)) + if (x_error_message) x_error_catcher (display, error); else x_error_quitter (display, error); @@ -10923,8 +10958,7 @@ x_initialize () void syms_of_xterm () { - staticpro (&x_error_message_string); - x_error_message_string = Qnil; + x_error_message = NULL; staticpro (&x_display_name_list); x_display_name_list = Qnil; |